@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.
@@ -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 = _interopRequireDefault(require("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.default)()
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.default)();
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.default)());
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.default)();
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.default)();
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.default)();
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.default)());
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) && isExperimentEnabled('platform_editor_agent_mentions_separate_pm_plugin')) {
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 = isExperimentEnabled('platform_editor_agent_mentions_separate_pm_plugin') ? agentMentionPluginKey.getState(editorState) : undefined;
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/v4';
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/v4';
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';