@atlaskit/editor-plugin-mentions 18.2.6 → 18.2.8

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,17 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 18.2.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 18.2.7
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 18.2.6
4
16
 
5
17
  ### Patch Changes
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.mentionNodeSpec = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _adfSchema = require("@atlaskit/adf-schema");
9
+ var _mention = require("@atlaskit/adf-schema/mention");
10
10
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
11
11
  var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -21,9 +21,9 @@ var isSSR = Boolean(process.env.REACT_SSR);
21
21
  */
22
22
  var mentionNodeSpec = exports.mentionNodeSpec = function mentionNodeSpec() {
23
23
  if (isSSR) {
24
- return _adfSchema.mention;
24
+ return _mention.mention;
25
25
  }
26
- return _objectSpread(_objectSpread({}, _adfSchema.mention), {}, {
26
+ return _objectSpread(_objectSpread({}, _mention.mention), {}, {
27
27
  toDOM: function toDOM(node) {
28
28
  // packages/elements/mention/src/components/Mention/index.tsx
29
29
  var mentionAttrs = {
@@ -74,7 +74,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
74
74
  var AGENT_MENTION_INACTIVITY_MS = 3000;
75
75
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
76
76
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
77
- var PACKAGE_VERSION = "18.2.5";
77
+ var PACKAGE_VERSION = "18.2.7";
78
78
  var setProvider = function setProvider(provider) {
79
79
  return function (state, dispatch) {
80
80
  if (dispatch) {
@@ -607,7 +607,9 @@ function createMentionPlugin(_ref2) {
607
607
  from = _step$value[0],
608
608
  to = _step$value[1];
609
609
  var clampedTo = Math.min(to, newState.doc.content.size);
610
- if (from >= clampedTo) continue;
610
+ if (from >= clampedTo) {
611
+ continue;
612
+ }
611
613
  newState.doc.nodesBetween(from, clampedTo, function (node, pos) {
612
614
  if (node.type !== _mentionSchema || !isAgentUserType(node.attrs.userType)) {
613
615
  return true;
@@ -649,7 +651,9 @@ function createMentionPlugin(_ref2) {
649
651
  _from = _step2$value[0],
650
652
  _to = _step2$value[1];
651
653
  var clampedOldTo = Math.min(_to, oldState.doc.content.size);
652
- if (_from >= clampedOldTo) continue;
654
+ if (_from >= clampedOldTo) {
655
+ continue;
656
+ }
653
657
  oldState.doc.nodesBetween(_from, clampedOldTo, function (node) {
654
658
  if (node.type !== _mentionSchema || !isAgentUserType(node.attrs.userType)) {
655
659
  return true;
@@ -16,7 +16,7 @@ var _reactIntl = require("react-intl");
16
16
  var _messages = require("@atlaskit/editor-common/messages");
17
17
  var _email = _interopRequireDefault(require("@atlaskit/icon/core/email"));
18
18
  var _statusError = _interopRequireDefault(require("@atlaskit/icon/core/status-error"));
19
- var _userPicker = require("@atlaskit/user-picker");
19
+ var _emailValidation = require("@atlaskit/user-picker/components/email-validation");
20
20
  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); }
21
21
  var mentionItemStyle = null;
22
22
  var mentionItemSelectedStyle = null;
@@ -88,7 +88,7 @@ var getInviteOption = function getInviteOption(inputValue, suggestedEmailDomain)
88
88
  if (inputValue.includes(' ') && inputValue.includes('@')) {
89
89
  return truncateInviteOption(inputValue);
90
90
  }
91
- var isEmail = inputValue && [VALID_OPTION, POTENTIAL_OPTION].includes((0, _userPicker.isValidEmail)(inputValue));
91
+ var isEmail = inputValue && [VALID_OPTION, POTENTIAL_OPTION].includes((0, _emailValidation.isValidEmail)(inputValue));
92
92
  if (isEmail || !suggestedEmailDomain) {
93
93
  return truncateInviteOption(inputValue);
94
94
  }
@@ -18,7 +18,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
18
18
  var _bindEventListener = require("bind-event-listener");
19
19
  var _reactLoadable = _interopRequireDefault(require("react-loadable"));
20
20
  var _fg = require("@atlaskit/platform-feature-flags/fg");
21
- var _user = require("@atlaskit/profilecard/user");
21
+ var _lazyProfileCard = require("@atlaskit/profilecard/lazy-profile-card");
22
22
  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");
@@ -246,7 +246,7 @@ var UserProfileCardContent = function UserProfileCardContent(_ref8) {
246
246
  hasError = _useProfileCardState.hasError;
247
247
  return /*#__PURE__*/React.createElement(LoadingWrapper, {
248
248
  isLoading: isLoading
249
- }, /*#__PURE__*/React.createElement(_user.ProfileCardLazy, {
249
+ }, /*#__PURE__*/React.createElement(_lazyProfileCard.ProfileCardLazy, {
250
250
  avatarUrl: data === null || data === void 0 ? void 0 : data.avatarUrl,
251
251
  accountType: data === null || data === void 0 ? void 0 : data.accountType,
252
252
  status: data === null || data === void 0 ? void 0 : data.status,
@@ -1,4 +1,4 @@
1
- import { mention } from '@atlaskit/adf-schema';
1
+ import { mention } from '@atlaskit/adf-schema/mention';
2
2
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
3
3
  import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
4
4
  const isSSR = Boolean(process.env.REACT_SSR);
@@ -58,7 +58,7 @@ const AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
58
58
  const AGENT_MENTION_INACTIVITY_MS = 3000;
59
59
  const MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
60
60
  const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
61
- const PACKAGE_VERSION = "18.2.5";
61
+ const PACKAGE_VERSION = "18.2.7";
62
62
  const setProvider = provider => (state, dispatch) => {
63
63
  if (dispatch) {
64
64
  dispatch(state.tr.setMeta(mentionPluginKey, {
@@ -584,7 +584,9 @@ export function createMentionPlugin({
584
584
  if (stepsTouchMentions) {
585
585
  for (const [from, to] of newDocRanges) {
586
586
  const clampedTo = Math.min(to, newState.doc.content.size);
587
- if (from >= clampedTo) continue;
587
+ if (from >= clampedTo) {
588
+ continue;
589
+ }
588
590
  newState.doc.nodesBetween(from, clampedTo, (node, pos) => {
589
591
  if (node.type !== mentionSchema || !isAgentUserType(node.attrs.userType)) {
590
592
  return true;
@@ -611,7 +613,9 @@ export function createMentionPlugin({
611
613
  }
612
614
  for (const [from, to] of oldDocRanges) {
613
615
  const clampedOldTo = Math.min(to, oldState.doc.content.size);
614
- if (from >= clampedOldTo) continue;
616
+ if (from >= clampedOldTo) {
617
+ continue;
618
+ }
615
619
  oldState.doc.nodesBetween(from, clampedOldTo, node => {
616
620
  if (node.type !== mentionSchema || !isAgentUserType(node.attrs.userType)) {
617
621
  return true;
@@ -7,7 +7,7 @@ import { FormattedMessage, injectIntl } from 'react-intl';
7
7
  import { mentionMessages as messages } from '@atlaskit/editor-common/messages';
8
8
  import EmailIcon from '@atlaskit/icon/core/email';
9
9
  import StatusErrorIcon from '@atlaskit/icon/core/status-error';
10
- import { isValidEmail } from '@atlaskit/user-picker';
10
+ import { isValidEmail } from '@atlaskit/user-picker/components/email-validation';
11
11
  const mentionItemStyle = null;
12
12
  const mentionItemSelectedStyle = null;
13
13
  const displayNameStyles = {
@@ -6,7 +6,7 @@ import { useEffect, useMemo, useState } from 'react';
6
6
  import { bind } from 'bind-event-listener';
7
7
  import Loadable from 'react-loadable';
8
8
  import { fg } from '@atlaskit/platform-feature-flags/fg';
9
- import { ProfileCardLazy } from '@atlaskit/profilecard/user';
9
+ import { ProfileCardLazy } from '@atlaskit/profilecard/lazy-profile-card';
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';
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- import { mention } from '@atlaskit/adf-schema';
4
+ import { mention } from '@atlaskit/adf-schema/mention';
5
5
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
6
6
  import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
7
7
  var isSSR = Boolean(process.env.REACT_SSR);
@@ -65,7 +65,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
65
65
  var AGENT_MENTION_INACTIVITY_MS = 3000;
66
66
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
67
67
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
68
- var PACKAGE_VERSION = "18.2.5";
68
+ var PACKAGE_VERSION = "18.2.7";
69
69
  var setProvider = function setProvider(provider) {
70
70
  return function (state, dispatch) {
71
71
  if (dispatch) {
@@ -598,7 +598,9 @@ export function createMentionPlugin(_ref2) {
598
598
  from = _step$value[0],
599
599
  to = _step$value[1];
600
600
  var clampedTo = Math.min(to, newState.doc.content.size);
601
- if (from >= clampedTo) continue;
601
+ if (from >= clampedTo) {
602
+ continue;
603
+ }
602
604
  newState.doc.nodesBetween(from, clampedTo, function (node, pos) {
603
605
  if (node.type !== _mentionSchema || !isAgentUserType(node.attrs.userType)) {
604
606
  return true;
@@ -640,7 +642,9 @@ export function createMentionPlugin(_ref2) {
640
642
  _from = _step2$value[0],
641
643
  _to = _step2$value[1];
642
644
  var clampedOldTo = Math.min(_to, oldState.doc.content.size);
643
- if (_from >= clampedOldTo) continue;
645
+ if (_from >= clampedOldTo) {
646
+ continue;
647
+ }
644
648
  oldState.doc.nodesBetween(_from, clampedOldTo, function (node) {
645
649
  if (node.type !== _mentionSchema || !isAgentUserType(node.attrs.userType)) {
646
650
  return true;
@@ -8,7 +8,7 @@ import { FormattedMessage, injectIntl } from 'react-intl';
8
8
  import { mentionMessages as messages } from '@atlaskit/editor-common/messages';
9
9
  import EmailIcon from '@atlaskit/icon/core/email';
10
10
  import StatusErrorIcon from '@atlaskit/icon/core/status-error';
11
- import { isValidEmail } from '@atlaskit/user-picker';
11
+ import { isValidEmail } from '@atlaskit/user-picker/components/email-validation';
12
12
  var mentionItemStyle = null;
13
13
  var mentionItemSelectedStyle = null;
14
14
  var displayNameStyles = {
@@ -9,7 +9,7 @@ import { useEffect, useMemo, useState } from 'react';
9
9
  import { bind } from 'bind-event-listener';
10
10
  import Loadable from 'react-loadable';
11
11
  import { fg } from '@atlaskit/platform-feature-flags/fg';
12
- import { ProfileCardLazy } from '@atlaskit/profilecard/user';
12
+ import { ProfileCardLazy } from '@atlaskit/profilecard/lazy-profile-card';
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';
@@ -1,4 +1,4 @@
1
- import type { DocNode } from '@atlaskit/adf-schema';
1
+ import type { DocNode } from '@atlaskit/adf-schema/doc';
2
2
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
3
  /**
4
4
  * Returns the direct parent content of an inserted agent mention as prompt ADF.
@@ -1,4 +1,4 @@
1
- import type { DocNode } from '@atlaskit/adf-schema';
1
+ import type { DocNode } from '@atlaskit/adf-schema/doc';
2
2
  import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
3
3
  import type { MentionNodeDataProvider } from '@atlaskit/editor-common/mention';
4
4
  import type { Providers, ProfilecardProvider } from '@atlaskit/editor-common/provider-factory';
@@ -1,5 +1,5 @@
1
1
  import type { MentionAttributes } from '@atlaskit/adf-schema/mention';
2
- import type { DocNode } from '@atlaskit/adf-schema/schema';
2
+ import type { DocNode } from '@atlaskit/adf-schema/doc';
3
3
  import type { ProfilecardProvider } from '@atlaskit/editor-common/provider-factory';
4
4
  import type { Placement } from '@atlaskit/popper/main';
5
5
  import type { ProfileCardClientData, TeamCentralReportingLinesData } from '@atlaskit/profilecard/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "18.2.6",
3
+ "version": "18.2.8",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -45,9 +45,9 @@
45
45
  "@atlaskit/primitives": "^22.5.0",
46
46
  "@atlaskit/profilecard": "^26.21.0",
47
47
  "@atlaskit/section-message": "^10.2.0",
48
- "@atlaskit/teams-app-config": "^3.0.0",
48
+ "@atlaskit/teams-app-config": "^3.1.0",
49
49
  "@atlaskit/theme": "^28.2.0",
50
- "@atlaskit/tmp-editor-statsig": "^172.0.0",
50
+ "@atlaskit/tmp-editor-statsig": "^174.0.0",
51
51
  "@atlaskit/tokens": "^16.11.0",
52
52
  "@atlaskit/tooltip": "^24.3.0",
53
53
  "@atlaskit/user-picker": "^13.12.0",
@@ -59,7 +59,7 @@
59
59
  "uuid": "^3.1.0"
60
60
  },
61
61
  "peerDependencies": {
62
- "@atlaskit/editor-common": "^120.11.0",
62
+ "@atlaskit/editor-common": "^120.12.0",
63
63
  "react": "^18.2.0 || ^19.2.0",
64
64
  "react-dom": "^18.2.0 || ^19.2.0",
65
65
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"