@atlaskit/editor-plugin-mentions 14.5.11 → 14.5.12

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,13 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 14.5.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c2986ab2c7a01`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c2986ab2c7a01) -
8
+ Cleans up prefer static regex violations and enables e18e rule
9
+ - Updated dependencies
10
+
3
11
  ## 14.5.11
4
12
 
5
13
  ### Patch Changes
@@ -52,7 +52,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
52
52
  var AGENT_MENTION_INACTIVITY_MS = 3000;
53
53
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
54
54
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
55
- var PACKAGE_VERSION = "14.5.10";
55
+ var PACKAGE_VERSION = "14.5.11";
56
56
  var setProvider = function setProvider(provider) {
57
57
  return function (state, dispatch) {
58
58
  if (dispatch) {
@@ -23,6 +23,8 @@ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
23
23
  var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
24
24
  var _PopperWrapper = require("./PopperWrapper");
25
25
  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" != (0, _typeof2.default)(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 _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
26
+ // eslint-disable-next-line require-unicode-regexp
27
+ var LEADING_AT_SIGN_RE = /^@/;
26
28
  var AgentProfileCardResourcedLazy = (0, _reactLoadable.default)({
27
29
  loader: function loader() {
28
30
  return Promise.resolve().then(function () {
@@ -249,8 +251,7 @@ var AgentProfileCardContent = function AgentProfileCardContent(_ref9) {
249
251
  var accountId = _ref9.accountId,
250
252
  provider = _ref9.provider,
251
253
  text = _ref9.text;
252
- // eslint-disable-next-line require-unicode-regexp
253
- var agentName = (text !== null && text !== void 0 ? text : '').replace(/^@/, '');
254
+ var agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
254
255
  return (0, _platformFeatureFlags.fg)('platform_editor_reduced_agent_profile_card') ? /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, {
255
256
  accountId: accountId,
256
257
  cloudId: provider.cloudId,
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.shouldKeepInviteItem = exports.isTeamType = exports.isTeamStats = exports.isInviteItem = void 0;
7
7
  var _InviteItem = require("../InviteItem");
8
+ // Ignored via go/ees005
9
+ // eslint-disable-next-line require-unicode-regexp
10
+ var SUFFIX_WITH_EXTRA_WORDS_REGEX = /\s[^\s]+\s/;
11
+
8
12
  // Ignored via go/ees005
9
13
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
14
  var isTeamType = exports.isTeamType = function isTeamType(userType) {
@@ -32,8 +36,6 @@ var shouldKeepInviteItem = exports.shouldKeepInviteItem = function shouldKeepInv
32
36
  if (query[lastIndexWithResults - 1] === ' ') {
33
37
  suffix = ' ' + suffix;
34
38
  }
35
- // Ignored via go/ees005
36
- // eslint-disable-next-line require-unicode-regexp
37
- var depletedExtraWords = /\s[^\s]+\s/.test(suffix);
39
+ var depletedExtraWords = SUFFIX_WITH_EXTRA_WORDS_REGEX.test(suffix);
38
40
  return !depletedExtraWords;
39
41
  };
@@ -37,7 +37,7 @@ const AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
37
37
  const AGENT_MENTION_INACTIVITY_MS = 3000;
38
38
  const MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
39
39
  const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
40
- const PACKAGE_VERSION = "14.5.10";
40
+ const PACKAGE_VERSION = "14.5.11";
41
41
  const setProvider = provider => (state, dispatch) => {
42
42
  if (dispatch) {
43
43
  dispatch(state.tr.setMeta(mentionPluginKey, {
@@ -10,6 +10,9 @@ import { ProfileCardLazy } from '@atlaskit/profilecard/user';
10
10
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
11
  import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
12
12
  import { Popup } from './PopperWrapper';
13
+
14
+ // eslint-disable-next-line require-unicode-regexp
15
+ const LEADING_AT_SIGN_RE = /^@/;
13
16
  const AgentProfileCardResourcedLazy = Loadable({
14
17
  loader: () => import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-mentions-agent-profile-card-resourced" */
15
18
  '@atlaskit/profilecard/agent-profile-card-resourced').then(({
@@ -179,8 +182,7 @@ const AgentProfileCardContent = ({
179
182
  provider,
180
183
  text
181
184
  }) => {
182
- // eslint-disable-next-line require-unicode-regexp
183
- const agentName = (text !== null && text !== void 0 ? text : '').replace(/^@/, '');
185
+ const agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
184
186
  return fg('platform_editor_reduced_agent_profile_card') ? /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, {
185
187
  accountId: accountId,
186
188
  cloudId: provider.cloudId,
@@ -1,5 +1,9 @@
1
1
  import { INVITE_ITEM_DESCRIPTION } from '../InviteItem';
2
2
 
3
+ // Ignored via go/ees005
4
+ // eslint-disable-next-line require-unicode-regexp
5
+ const SUFFIX_WITH_EXTRA_WORDS_REGEX = /\s[^\s]+\s/;
6
+
3
7
  // Ignored via go/ees005
4
8
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
9
  export const isTeamType = userType => userType === 'TEAM';
@@ -21,8 +25,6 @@ export const shouldKeepInviteItem = (query, firstQueryWithoutResults) => {
21
25
  if (query[lastIndexWithResults - 1] === ' ') {
22
26
  suffix = ' ' + suffix;
23
27
  }
24
- // Ignored via go/ees005
25
- // eslint-disable-next-line require-unicode-regexp
26
- const depletedExtraWords = /\s[^\s]+\s/.test(suffix);
28
+ const depletedExtraWords = SUFFIX_WITH_EXTRA_WORDS_REGEX.test(suffix);
27
29
  return !depletedExtraWords;
28
30
  };
@@ -44,7 +44,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
44
44
  var AGENT_MENTION_INACTIVITY_MS = 3000;
45
45
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
46
46
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
47
- var PACKAGE_VERSION = "14.5.10";
47
+ var PACKAGE_VERSION = "14.5.11";
48
48
  var setProvider = function setProvider(provider) {
49
49
  return function (state, dispatch) {
50
50
  if (dispatch) {
@@ -13,6 +13,9 @@ import { ProfileCardLazy } from '@atlaskit/profilecard/user';
13
13
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
14
  import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
15
15
  import { Popup } from './PopperWrapper';
16
+
17
+ // eslint-disable-next-line require-unicode-regexp
18
+ var LEADING_AT_SIGN_RE = /^@/;
16
19
  var AgentProfileCardResourcedLazy = Loadable({
17
20
  loader: function loader() {
18
21
  return import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-mentions-agent-profile-card-resourced" */
@@ -237,8 +240,7 @@ var AgentProfileCardContent = function AgentProfileCardContent(_ref9) {
237
240
  var accountId = _ref9.accountId,
238
241
  provider = _ref9.provider,
239
242
  text = _ref9.text;
240
- // eslint-disable-next-line require-unicode-regexp
241
- var agentName = (text !== null && text !== void 0 ? text : '').replace(/^@/, '');
243
+ var agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
242
244
  return fg('platform_editor_reduced_agent_profile_card') ? /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, {
243
245
  accountId: accountId,
244
246
  cloudId: provider.cloudId,
@@ -1,5 +1,9 @@
1
1
  import { INVITE_ITEM_DESCRIPTION } from '../InviteItem';
2
2
 
3
+ // Ignored via go/ees005
4
+ // eslint-disable-next-line require-unicode-regexp
5
+ var SUFFIX_WITH_EXTRA_WORDS_REGEX = /\s[^\s]+\s/;
6
+
3
7
  // Ignored via go/ees005
4
8
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
9
  export var isTeamType = function isTeamType(userType) {
@@ -27,8 +31,6 @@ export var shouldKeepInviteItem = function shouldKeepInviteItem(query, firstQuer
27
31
  if (query[lastIndexWithResults - 1] === ' ') {
28
32
  suffix = ' ' + suffix;
29
33
  }
30
- // Ignored via go/ees005
31
- // eslint-disable-next-line require-unicode-regexp
32
- var depletedExtraWords = /\s[^\s]+\s/.test(suffix);
34
+ var depletedExtraWords = SUFFIX_WITH_EXTRA_WORDS_REGEX.test(suffix);
33
35
  return !depletedExtraWords;
34
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "14.5.11",
3
+ "version": "14.5.12",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",