@atlaskit/editor-plugin-mentions 8.2.6 → 8.2.7
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 +8 -0
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/ui/type-ahead/index.js +26 -50
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/ui/type-ahead/index.js +12 -36
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/ui/type-ahead/index.js +12 -36
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
2
|
|
|
3
|
+
## 8.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0a9692c1ee81f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0a9692c1ee81f) -
|
|
8
|
+
Cleanup minor refactor.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 8.2.6
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -25,7 +25,7 @@ var ACTIONS = exports.ACTIONS = {
|
|
|
25
25
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
26
26
|
};
|
|
27
27
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
28
|
-
var PACKAGE_VERSION = "
|
|
28
|
+
var PACKAGE_VERSION = "0.0.0-development";
|
|
29
29
|
var setProvider = function setProvider(provider) {
|
|
30
30
|
return function (state, dispatch) {
|
|
31
31
|
if (dispatch) {
|
|
@@ -13,18 +13,17 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
15
15
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
16
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
17
16
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
18
|
-
var
|
|
17
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
19
18
|
var _item = require("@atlaskit/mention/item");
|
|
20
19
|
var _resource = require("@atlaskit/mention/resource");
|
|
21
20
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
21
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
23
22
|
var _editorCommands = require("../../editor-commands");
|
|
24
|
-
var
|
|
23
|
+
var _utils2 = require("../../pm-plugins/utils");
|
|
25
24
|
var _InviteItem = _interopRequireWildcard(require("../InviteItem"));
|
|
26
25
|
var _analytics = require("./analytics");
|
|
27
|
-
var
|
|
26
|
+
var _utils3 = require("./utils");
|
|
28
27
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
29
28
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
30
29
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -62,7 +61,7 @@ var withInviteItem = function withInviteItem(_ref3) {
|
|
|
62
61
|
mentionProvider: mentionProvider,
|
|
63
62
|
onInviteItemMount: onInviteItemMount
|
|
64
63
|
});
|
|
65
|
-
var keepInviteItem = (0,
|
|
64
|
+
var keepInviteItem = (0, _utils3.shouldKeepInviteItem)(currentQuery, firstQueryWithoutResults);
|
|
66
65
|
if (mentionItems.length === 0) {
|
|
67
66
|
return keepInviteItem ? [inviteItem] : [];
|
|
68
67
|
}
|
|
@@ -123,7 +122,7 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
|
|
|
123
122
|
var userOrTeamIds = null;
|
|
124
123
|
var teams = null;
|
|
125
124
|
var xProductMentionsLength = 0;
|
|
126
|
-
if (!(0,
|
|
125
|
+
if (!(0, _utils3.isTeamStats)(stats)) {
|
|
127
126
|
// is from primary mention endpoint which could be just user mentions or user/team mentions
|
|
128
127
|
duration = stats && stats.duration;
|
|
129
128
|
teams = null;
|
|
@@ -138,7 +137,7 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
|
|
|
138
137
|
duration = stats && stats.teamMentionDuration;
|
|
139
138
|
userOrTeamIds = null;
|
|
140
139
|
teams = mentions.map(function (mention) {
|
|
141
|
-
return (0,
|
|
140
|
+
return (0, _utils3.isTeamType)(mention.userType) ? {
|
|
142
141
|
teamId: mention.id,
|
|
143
142
|
// Ignored via go/ees005
|
|
144
143
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -235,7 +234,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
235
234
|
var _api$contextIdentifie, _api$contextIdentifie2;
|
|
236
235
|
var query = _ref7.query,
|
|
237
236
|
editorState = _ref7.editorState;
|
|
238
|
-
var pluginState = (0,
|
|
237
|
+
var pluginState = (0, _utils2.getMentionPluginState)(editorState);
|
|
239
238
|
if (!(pluginState !== null && pluginState !== void 0 && pluginState.mentionProvider)) {
|
|
240
239
|
return Promise.resolve([]);
|
|
241
240
|
}
|
|
@@ -300,7 +299,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
300
299
|
query = _ref9.query,
|
|
301
300
|
sourceListItem = _ref9.sourceListItem;
|
|
302
301
|
var schema = state.schema;
|
|
303
|
-
var pluginState = (0,
|
|
302
|
+
var pluginState = (0, _utils2.getMentionPluginState)(state);
|
|
304
303
|
var mentionProvider = pluginState.mentionProvider;
|
|
305
304
|
var _item$mention = item.mention,
|
|
306
305
|
id = _item$mention.id,
|
|
@@ -309,20 +308,18 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
309
308
|
accessLevel = _item$mention.accessLevel,
|
|
310
309
|
userType = _item$mention.userType,
|
|
311
310
|
isXProductUser = _item$mention.isXProductUser;
|
|
312
|
-
var trimmedNickname = nickname && nickname.startsWith('@') ? nickname.slice(1) : nickname;
|
|
313
|
-
var renderName = mentionInsertDisplayName || !trimmedNickname ? name : trimmedNickname;
|
|
314
311
|
var _ref0 = (_api$contextIdentifie3 = api === null || api === void 0 || (_api$contextIdentifie4 = api.contextIdentifier) === null || _api$contextIdentifie4 === void 0 ? void 0 : _api$contextIdentifie4.sharedState.currentState()) !== null && _api$contextIdentifie3 !== void 0 ? _api$contextIdentifie3 : {},
|
|
315
312
|
contextIdentifierProvider = _ref0.contextIdentifierProvider;
|
|
316
313
|
var mentionContext = _objectSpread(_objectSpread({}, contextIdentifierProvider), {}, {
|
|
317
314
|
sessionId: sessionId
|
|
318
315
|
});
|
|
319
|
-
if (mentionProvider && !(0,
|
|
316
|
+
if (mentionProvider && !(0, _utils3.isInviteItem)(item.mention)) {
|
|
320
317
|
mentionProvider.recordMentionSelection(item.mention, mentionContext);
|
|
321
318
|
}
|
|
322
319
|
|
|
323
320
|
// use same timer as StatsModifier
|
|
324
321
|
var pickerElapsedTime = stats.startedAt ? performance.now() - stats.startedAt : 0;
|
|
325
|
-
if (mentionProvider && mentionProvider.shouldEnableInvite && (0,
|
|
322
|
+
if (mentionProvider && mentionProvider.shouldEnableInvite && (0, _utils3.isInviteItem)(item.mention)) {
|
|
326
323
|
// Don't fire event and the callback with selection by space press
|
|
327
324
|
if (mode !== 'space') {
|
|
328
325
|
fireEvent((0, _analytics.buildTypeAheadInviteItemClickedPayload)(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, query, contextIdentifierProvider, mentionProvider.userRole));
|
|
@@ -333,10 +330,10 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
333
330
|
return state.tr;
|
|
334
331
|
}
|
|
335
332
|
var taskListId, taskItemId;
|
|
336
|
-
var taskList = (0,
|
|
333
|
+
var taskList = (0, _utils.findParentNodeOfType)(state.schema.nodes.taskList)(state.selection);
|
|
337
334
|
if (taskList) {
|
|
338
335
|
taskListId = taskList.node.attrs.localId;
|
|
339
|
-
var taskItem = (0,
|
|
336
|
+
var taskItem = (0, _utils.findParentNodeOfType)(state.schema.nodes.taskItem)(state.selection);
|
|
340
337
|
if (taskItem) {
|
|
341
338
|
taskItemId = taskItem.node.attrs.localId;
|
|
342
339
|
}
|
|
@@ -364,47 +361,26 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
364
361
|
return x.mention;
|
|
365
362
|
}), query, contextIdentifierProvider, taskListId, taskItemId));
|
|
366
363
|
sessionId = (0, _uuid.default)();
|
|
367
|
-
if (mentionProvider && (0,
|
|
364
|
+
if (mentionProvider && (0, _utils3.isTeamType)(userType)) {
|
|
368
365
|
return insert(buildNodesForTeamMention(schema, item.mention, mentionProvider, sanitizePrivateContent));
|
|
369
366
|
}
|
|
370
367
|
if (isXProductUser && mentionProvider && mentionProvider.inviteXProductUser) {
|
|
371
368
|
mentionProvider.inviteXProductUser(id, name);
|
|
372
369
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
sanitizePrivateContent: sanitizePrivateContent
|
|
381
|
-
})({
|
|
382
|
-
name: name,
|
|
383
|
-
id: id,
|
|
384
|
-
userType: userType,
|
|
385
|
-
nickname: nickname,
|
|
386
|
-
localId: mentionLocalId,
|
|
387
|
-
accessLevel: accessLevel,
|
|
388
|
-
isXProductUser: isXProductUser
|
|
389
|
-
}));
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
// Don't insert into document if document data is sanitized.
|
|
393
|
-
var text = sanitizePrivateContent ? '' : "@".concat(renderName);
|
|
394
|
-
if (sanitizePrivateContent && (0, _resource.isResolvingMentionProvider)(mentionProvider)) {
|
|
395
|
-
// Cache (locally) for later rendering
|
|
396
|
-
mentionProvider.cacheMentionName(id, renderName);
|
|
397
|
-
}
|
|
398
|
-
var annotationMarksForPos = (0, _platformFeatureFlags.fg)('editor_inline_comments_paste_insert_nodes') ? (0, _utils.getAnnotationMarksForPos)(state.tr.selection.$head) : undefined;
|
|
399
|
-
var mentionNode = schema.nodes.mention.createChecked({
|
|
400
|
-
text: text,
|
|
370
|
+
return insert((0, _editorCommands.createSingleMentionFragment)({
|
|
371
|
+
mentionProvider: mentionProvider,
|
|
372
|
+
mentionInsertDisplayName: mentionInsertDisplayName,
|
|
373
|
+
tr: state.tr,
|
|
374
|
+
sanitizePrivateContent: sanitizePrivateContent
|
|
375
|
+
})({
|
|
376
|
+
name: name,
|
|
401
377
|
id: id,
|
|
378
|
+
userType: userType,
|
|
379
|
+
nickname: nickname,
|
|
380
|
+
localId: mentionLocalId,
|
|
402
381
|
accessLevel: accessLevel,
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}, null, (0, _platformFeatureFlags.fg)('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined);
|
|
406
|
-
var space = schema.text(' ', (0, _platformFeatureFlags.fg)('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined);
|
|
407
|
-
return insert(_model.Fragment.from([mentionNode, space]));
|
|
382
|
+
isXProductUser: isXProductUser
|
|
383
|
+
}));
|
|
408
384
|
},
|
|
409
385
|
dismiss: function dismiss(_ref1) {
|
|
410
386
|
var editorState = _ref1.editorState,
|
|
@@ -416,7 +392,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
416
392
|
if (!wasItemInserted) {
|
|
417
393
|
fireEvent((0, _analytics.buildTypeAheadCancelPayload)(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, query || ''), 'fabric-elements');
|
|
418
394
|
}
|
|
419
|
-
var pluginState = (0,
|
|
395
|
+
var pluginState = (0, _utils2.getMentionPluginState)(editorState);
|
|
420
396
|
if (pluginState !== null && pluginState !== void 0 && pluginState.mentionProvider) {
|
|
421
397
|
var mentionProvider = pluginState.mentionProvider;
|
|
422
398
|
var _iterator = _createForOfIteratorHelper(subscriptionKeys),
|
|
@@ -14,7 +14,7 @@ export const ACTIONS = {
|
|
|
14
14
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
15
15
|
};
|
|
16
16
|
const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
17
|
-
const PACKAGE_VERSION = "
|
|
17
|
+
const PACKAGE_VERSION = "0.0.0-development";
|
|
18
18
|
const setProvider = provider => (state, dispatch) => {
|
|
19
19
|
if (dispatch) {
|
|
20
20
|
dispatch(state.tr.setMeta(mentionPluginKey, {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import uuid from 'uuid';
|
|
3
3
|
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
4
|
-
import { getAnnotationMarksForPos } from '@atlaskit/editor-common/utils';
|
|
5
4
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
6
5
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
6
|
import { MENTION_ITEM_HEIGHT, MentionItem } from '@atlaskit/mention/item';
|
|
@@ -292,8 +291,6 @@ export const createTypeAheadConfig = ({
|
|
|
292
291
|
userType,
|
|
293
292
|
isXProductUser
|
|
294
293
|
} = item.mention;
|
|
295
|
-
const trimmedNickname = nickname && nickname.startsWith('@') ? nickname.slice(1) : nickname;
|
|
296
|
-
const renderName = mentionInsertDisplayName || !trimmedNickname ? name : trimmedNickname;
|
|
297
294
|
const {
|
|
298
295
|
contextIdentifierProvider
|
|
299
296
|
} = (_api$contextIdentifie3 = api === null || api === void 0 ? void 0 : (_api$contextIdentifie4 = api.contextIdentifier) === null || _api$contextIdentifie4 === void 0 ? void 0 : _api$contextIdentifie4.sharedState.currentState()) !== null && _api$contextIdentifie3 !== void 0 ? _api$contextIdentifie3 : {};
|
|
@@ -353,41 +350,20 @@ export const createTypeAheadConfig = ({
|
|
|
353
350
|
if (isXProductUser && mentionProvider && mentionProvider.inviteXProductUser) {
|
|
354
351
|
mentionProvider.inviteXProductUser(id, name);
|
|
355
352
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
sanitizePrivateContent
|
|
364
|
-
})({
|
|
365
|
-
name,
|
|
366
|
-
id,
|
|
367
|
-
userType,
|
|
368
|
-
nickname,
|
|
369
|
-
localId: mentionLocalId,
|
|
370
|
-
accessLevel,
|
|
371
|
-
isXProductUser
|
|
372
|
-
}));
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
// Don't insert into document if document data is sanitized.
|
|
376
|
-
const text = sanitizePrivateContent ? '' : `@${renderName}`;
|
|
377
|
-
if (sanitizePrivateContent && isResolvingMentionProvider(mentionProvider)) {
|
|
378
|
-
// Cache (locally) for later rendering
|
|
379
|
-
mentionProvider.cacheMentionName(id, renderName);
|
|
380
|
-
}
|
|
381
|
-
const annotationMarksForPos = fg('editor_inline_comments_paste_insert_nodes') ? getAnnotationMarksForPos(state.tr.selection.$head) : undefined;
|
|
382
|
-
const mentionNode = schema.nodes.mention.createChecked({
|
|
383
|
-
text,
|
|
353
|
+
return insert(createSingleMentionFragment({
|
|
354
|
+
mentionProvider,
|
|
355
|
+
mentionInsertDisplayName,
|
|
356
|
+
tr: state.tr,
|
|
357
|
+
sanitizePrivateContent
|
|
358
|
+
})({
|
|
359
|
+
name,
|
|
384
360
|
id,
|
|
361
|
+
userType,
|
|
362
|
+
nickname,
|
|
363
|
+
localId: mentionLocalId,
|
|
385
364
|
accessLevel,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}, null, fg('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined);
|
|
389
|
-
const space = schema.text(' ', fg('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined);
|
|
390
|
-
return insert(Fragment.from([mentionNode, space]));
|
|
365
|
+
isXProductUser
|
|
366
|
+
}));
|
|
391
367
|
},
|
|
392
368
|
dismiss({
|
|
393
369
|
editorState,
|
|
@@ -17,7 +17,7 @@ export var ACTIONS = {
|
|
|
17
17
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
18
18
|
};
|
|
19
19
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
20
|
-
var PACKAGE_VERSION = "
|
|
20
|
+
var PACKAGE_VERSION = "0.0.0-development";
|
|
21
21
|
var setProvider = function setProvider(provider) {
|
|
22
22
|
return function (state, dispatch) {
|
|
23
23
|
if (dispatch) {
|
|
@@ -8,7 +8,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import uuid from 'uuid';
|
|
10
10
|
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
11
|
-
import { getAnnotationMarksForPos } from '@atlaskit/editor-common/utils';
|
|
12
11
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
13
12
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
14
13
|
import { MENTION_ITEM_HEIGHT, MentionItem } from '@atlaskit/mention/item';
|
|
@@ -298,8 +297,6 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
|
|
|
298
297
|
accessLevel = _item$mention.accessLevel,
|
|
299
298
|
userType = _item$mention.userType,
|
|
300
299
|
isXProductUser = _item$mention.isXProductUser;
|
|
301
|
-
var trimmedNickname = nickname && nickname.startsWith('@') ? nickname.slice(1) : nickname;
|
|
302
|
-
var renderName = mentionInsertDisplayName || !trimmedNickname ? name : trimmedNickname;
|
|
303
300
|
var _ref0 = (_api$contextIdentifie3 = api === null || api === void 0 || (_api$contextIdentifie4 = api.contextIdentifier) === null || _api$contextIdentifie4 === void 0 ? void 0 : _api$contextIdentifie4.sharedState.currentState()) !== null && _api$contextIdentifie3 !== void 0 ? _api$contextIdentifie3 : {},
|
|
304
301
|
contextIdentifierProvider = _ref0.contextIdentifierProvider;
|
|
305
302
|
var mentionContext = _objectSpread(_objectSpread({}, contextIdentifierProvider), {}, {
|
|
@@ -359,41 +356,20 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
|
|
|
359
356
|
if (isXProductUser && mentionProvider && mentionProvider.inviteXProductUser) {
|
|
360
357
|
mentionProvider.inviteXProductUser(id, name);
|
|
361
358
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
sanitizePrivateContent: sanitizePrivateContent
|
|
370
|
-
})({
|
|
371
|
-
name: name,
|
|
372
|
-
id: id,
|
|
373
|
-
userType: userType,
|
|
374
|
-
nickname: nickname,
|
|
375
|
-
localId: mentionLocalId,
|
|
376
|
-
accessLevel: accessLevel,
|
|
377
|
-
isXProductUser: isXProductUser
|
|
378
|
-
}));
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
// Don't insert into document if document data is sanitized.
|
|
382
|
-
var text = sanitizePrivateContent ? '' : "@".concat(renderName);
|
|
383
|
-
if (sanitizePrivateContent && isResolvingMentionProvider(mentionProvider)) {
|
|
384
|
-
// Cache (locally) for later rendering
|
|
385
|
-
mentionProvider.cacheMentionName(id, renderName);
|
|
386
|
-
}
|
|
387
|
-
var annotationMarksForPos = fg('editor_inline_comments_paste_insert_nodes') ? getAnnotationMarksForPos(state.tr.selection.$head) : undefined;
|
|
388
|
-
var mentionNode = schema.nodes.mention.createChecked({
|
|
389
|
-
text: text,
|
|
359
|
+
return insert(createSingleMentionFragment({
|
|
360
|
+
mentionProvider: mentionProvider,
|
|
361
|
+
mentionInsertDisplayName: mentionInsertDisplayName,
|
|
362
|
+
tr: state.tr,
|
|
363
|
+
sanitizePrivateContent: sanitizePrivateContent
|
|
364
|
+
})({
|
|
365
|
+
name: name,
|
|
390
366
|
id: id,
|
|
367
|
+
userType: userType,
|
|
368
|
+
nickname: nickname,
|
|
369
|
+
localId: mentionLocalId,
|
|
391
370
|
accessLevel: accessLevel,
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}, null, fg('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined);
|
|
395
|
-
var space = schema.text(' ', fg('editor_inline_comments_paste_insert_nodes') ? annotationMarksForPos : undefined);
|
|
396
|
-
return insert(Fragment.from([mentionNode, space]));
|
|
371
|
+
isXProductUser: isXProductUser
|
|
372
|
+
}));
|
|
397
373
|
},
|
|
398
374
|
dismiss: function dismiss(_ref1) {
|
|
399
375
|
var editorState = _ref1.editorState,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-mentions",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.7",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"@atlaskit/icon": "^28.5.0",
|
|
41
41
|
"@atlaskit/insm": "^0.2.0",
|
|
42
42
|
"@atlaskit/link": "^3.2.0",
|
|
43
|
-
"@atlaskit/mention": "^24.
|
|
43
|
+
"@atlaskit/mention": "^24.4.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/popper": "^7.1.0",
|
|
46
46
|
"@atlaskit/portal": "^5.1.0",
|
|
47
47
|
"@atlaskit/profilecard": "^24.20.0",
|
|
48
48
|
"@atlaskit/theme": "^21.0.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^13.30.0",
|
|
50
50
|
"@atlaskit/tokens": "^7.1.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"@compiled/react": "^0.18.6",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"uuid": "^3.1.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@atlaskit/editor-common": "^110.
|
|
58
|
+
"@atlaskit/editor-common": "^110.23.0",
|
|
59
59
|
"react": "^18.2.0",
|
|
60
60
|
"react-dom": "^18.2.0",
|
|
61
61
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -113,9 +113,6 @@
|
|
|
113
113
|
"platform_editor_mention_provider_via_plugin_config": {
|
|
114
114
|
"type": "boolean"
|
|
115
115
|
},
|
|
116
|
-
"platform_mention_insert_mention_refactor": {
|
|
117
|
-
"type": "boolean"
|
|
118
|
-
},
|
|
119
116
|
"platform_editor_adf_with_localid": {
|
|
120
117
|
"type": "boolean"
|
|
121
118
|
},
|