@atlaskit/editor-plugin-mentions 18.2.8 → 18.2.10
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 +43 -0
- package/dist/cjs/editor-commands/index.js +2 -3
- package/dist/cjs/mentionsPlugin.js +4 -4
- package/dist/cjs/nodeviews/disabledTooltipRenderer.js +2 -2
- package/dist/cjs/nodeviews/profileCardRenderer.js +2 -2
- package/dist/cjs/pm-plugins/main.js +10 -808
- package/dist/cjs/ui/type-ahead/index.js +8 -8
- package/dist/es2019/editor-commands/index.js +1 -1
- package/dist/es2019/mentionsPlugin.js +3 -3
- package/dist/es2019/nodeviews/disabledTooltipRenderer.js +1 -1
- package/dist/es2019/nodeviews/profileCardRenderer.js +1 -1
- package/dist/es2019/pm-plugins/main.js +3 -772
- package/dist/es2019/ui/type-ahead/index.js +1 -1
- package/dist/esm/editor-commands/index.js +1 -1
- package/dist/esm/mentionsPlugin.js +3 -3
- package/dist/esm/nodeviews/disabledTooltipRenderer.js +1 -1
- package/dist/esm/nodeviews/profileCardRenderer.js +1 -1
- package/dist/esm/pm-plugins/main.js +11 -808
- package/dist/esm/ui/type-ahead/index.js +1 -1
- package/dist/types/pm-plugins/main.d.ts +0 -15
- package/package.json +5 -5
|
@@ -11,7 +11,7 @@ exports.mentionToTypeaheadItem = void 0;
|
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
|
-
var _uuid =
|
|
14
|
+
var _uuid = require("uuid");
|
|
15
15
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
16
16
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
17
17
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
@@ -283,7 +283,7 @@ var buildNodesForTeamMention = function buildNodesForTeamMention(schema, selecte
|
|
|
283
283
|
accessLevel: accessLevel,
|
|
284
284
|
userType: 'DEFAULT',
|
|
285
285
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
286
|
-
localId: (0, _uuid.
|
|
286
|
+
localId: (0, _uuid.v4)()
|
|
287
287
|
});
|
|
288
288
|
inlineNodes.push(userMentionNode);
|
|
289
289
|
// should not add empty space after the last user mention.
|
|
@@ -378,7 +378,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
378
378
|
showAgentMentionsLabsLozenge = _ref0$showAgentMentio === void 0 ? false : _ref0$showAgentMentio,
|
|
379
379
|
profilecardProvider = _ref0.profilecardProvider;
|
|
380
380
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
381
|
-
var sessionId = (0, _uuid.
|
|
381
|
+
var sessionId = (0, _uuid.v4)();
|
|
382
382
|
var firstQueryWithoutResults = null;
|
|
383
383
|
var lastTypeAheadQuery = '';
|
|
384
384
|
var subscriptionKeys = new Set();
|
|
@@ -423,7 +423,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
423
423
|
contextIdentifierProvider = _ref10.contextIdentifierProvider;
|
|
424
424
|
return new Promise(function (resolve, reject) {
|
|
425
425
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
426
|
-
var key = "loadingMentionsForTypeAhead_".concat((0, _uuid.
|
|
426
|
+
var key = "loadingMentionsForTypeAhead_".concat((0, _uuid.v4)());
|
|
427
427
|
var mentionsSubscribeCallback = function mentionsSubscribeCallback(mentions) {
|
|
428
428
|
var resultQuery = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
429
429
|
var stats = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -589,7 +589,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
589
589
|
}
|
|
590
590
|
|
|
591
591
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
592
|
-
var mentionLocalId = (0, _uuid.
|
|
592
|
+
var mentionLocalId = (0, _uuid.v4)();
|
|
593
593
|
if (handleMentionsChanged) {
|
|
594
594
|
var mentionChange = _objectSpread({
|
|
595
595
|
id: id,
|
|
@@ -612,7 +612,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
612
612
|
}), query, contextIdentifierProvider, taskListId, taskItemId, isAgentMentionSelection, enableAgentSectioning));
|
|
613
613
|
|
|
614
614
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
615
|
-
sessionId = (0, _uuid.
|
|
615
|
+
sessionId = (0, _uuid.v4)();
|
|
616
616
|
if (mentionProvider && (0, _utils3.isTeamType)(userType)) {
|
|
617
617
|
return insert(buildNodesForTeamMention(schema, item.mention, mentionProvider, sanitizePrivateContent));
|
|
618
618
|
}
|
|
@@ -679,7 +679,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
679
679
|
subscriptionKeys.clear();
|
|
680
680
|
|
|
681
681
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
682
|
-
sessionId = (0, _uuid.
|
|
682
|
+
sessionId = (0, _uuid.v4)();
|
|
683
683
|
}
|
|
684
684
|
};
|
|
685
685
|
|
|
@@ -717,7 +717,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
717
717
|
contextIdentifierProvider = _ref16.contextIdentifierProvider;
|
|
718
718
|
|
|
719
719
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
720
|
-
var key = "loadingMentionsForTypeAhead_".concat((0, _uuid.
|
|
720
|
+
var key = "loadingMentionsForTypeAhead_".concat((0, _uuid.v4)());
|
|
721
721
|
var initialResolve = null;
|
|
722
722
|
var initialReject = null;
|
|
723
723
|
var initialResolved = false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
|
-
import uuid from 'uuid';
|
|
2
|
+
import { v4 as uuid } from 'uuid';
|
|
3
3
|
import { getAnnotationMarksForPos } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { isResolvingMentionProvider } from '@atlaskit/mention/resource';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useMemo } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
|
-
import uuid from 'uuid';
|
|
4
|
+
import { v4 as uuid } from 'uuid';
|
|
5
5
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { toolbarInsertBlockMessages as messages, mentionMessages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -137,7 +137,7 @@ const mentionsPlugin = ({
|
|
|
137
137
|
api
|
|
138
138
|
})
|
|
139
139
|
}];
|
|
140
|
-
if (editorExperiment('platform_editor_agent_mentions', true)
|
|
140
|
+
if (editorExperiment('platform_editor_agent_mentions', true)) {
|
|
141
141
|
plugins.push({
|
|
142
142
|
name: 'agentMention',
|
|
143
143
|
plugin: pmPluginFactoryParams => createAgentMentionPlugin({
|
|
@@ -257,7 +257,7 @@ const mentionsPlugin = ({
|
|
|
257
257
|
return undefined;
|
|
258
258
|
}
|
|
259
259
|
const mentionPluginState = mentionPluginKey.getState(editorState);
|
|
260
|
-
const agentMentionPluginState =
|
|
260
|
+
const agentMentionPluginState = agentMentionPluginKey.getState(editorState);
|
|
261
261
|
// Exclude pendingPastedAgentMention — it is an @internal transient field and
|
|
262
262
|
// should not be part of the public shared state API. Exposing it would cause
|
|
263
263
|
// unnecessary re-renders in subscribers and leak implementation details.
|
|
@@ -4,7 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
5
|
import { bindAll } from 'bind-event-listener';
|
|
6
6
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- mirror existing renderer pattern
|
|
7
|
-
import uuid from 'uuid
|
|
7
|
+
import { v4 as uuid } from 'uuid';
|
|
8
8
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
9
9
|
const styles = {
|
|
10
10
|
hiddenTrigger: "_1e0cglyw"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
3
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
|
-
import uuid from 'uuid
|
|
4
|
+
import { v4 as uuid } from 'uuid';
|
|
5
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { findChildrenByAttr } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|