@atlaskit/editor-plugin-mentions 15.0.4 → 15.1.0

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,23 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 15.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`34a4b81d50881`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/34a4b81d50881) -
8
+ Revert the mentions invite item to a whole-row selection trigger, removing the separate Invite
9
+ button
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 15.0.5
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 15.0.4
4
22
 
5
23
  ### Patch Changes
@@ -67,7 +67,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
67
67
  var AGENT_MENTION_INACTIVITY_MS = 3000;
68
68
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
69
69
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
70
- var PACKAGE_VERSION = "15.0.3";
70
+ var PACKAGE_VERSION = "15.0.5";
71
71
  var setProvider = function setProvider(provider) {
72
72
  return function (state, dispatch) {
73
73
  if (dispatch) {
@@ -1,8 +1,3 @@
1
- ._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
- ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
- ._189ee4h9{border-width:var(--ds-border-width,1px)}
4
- ._1dqonqa1{border-style:solid}
5
- ._1h6d1l7x{border-color:var(--ds-border,#0b120e24)}
6
1
  ._16jlidpf{flex-grow:0}
7
2
  ._16jlkb7n{flex-grow:1}
8
3
  ._18m915vq{overflow-y:hidden}
@@ -12,7 +7,6 @@
12
7
  ._1bah1h6o{justify-content:center}
13
8
  ._1bsb14no{width:36px}
14
9
  ._1bto1l2s{text-overflow:ellipsis}
15
- ._1e0c116y{display:inline-flex}
16
10
  ._1e0c1o8l{display:inline-block}
17
11
  ._1e0c1txw{display:flex}
18
12
  ._1e0c1ule{display:block}
@@ -27,19 +21,15 @@
27
21
  ._2mzuglyw{list-style-type:none}
28
22
  ._4cvr1h6o{align-items:center}
29
23
  ._4t3i14no{height:36px}
30
- ._4t3iviql{height:2rem}
24
+ ._80omtlke{cursor:pointer}
31
25
  ._bfhk1dpa{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
32
26
  ._bfhk1j28{background-color:transparent}
33
- ._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
34
27
  ._ca0q12x7{padding-top:var(--ds-space-075,6px)}
35
- ._cun9187o:disabled{background-color:var(--ds-background-disabled,#0515240f)}
36
28
  ._i0dl1wug{flex-basis:auto}
37
29
  ._i0dlf1ug{flex-basis:0%}
38
- ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
39
30
  ._kqswh2mm{position:relative}
40
31
  ._n3td12x7{padding-bottom:var(--ds-space-075,6px)}
41
32
  ._p12f1osq{max-width:100%}
42
33
  ._s7n4nkob{vertical-align:middle}
43
34
  ._syazazsu{color:var(--ds-text-subtle,#505258)}
44
- ._u5f3utpp{padding-right:var(--ds-space-150,9pt)}
45
- ._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
35
+ ._u5f3utpp{padding-right:var(--ds-space-150,9pt)}
@@ -16,10 +16,8 @@ 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 _pressable = require("@atlaskit/primitives/pressable");
20
19
  var _userPicker = require("@atlaskit/user-picker");
21
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); }
22
- // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- TODO: migrate to @atlaskit/primitives/compiled
23
21
  var mentionItemStyle = null;
24
22
  var mentionItemSelectedStyle = null;
25
23
  var displayNameStyles = {
@@ -47,8 +45,7 @@ var style = {
47
45
  rowStyle: "_1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _2lx2vrvc _1n261g80 _ca0q12x7 _n3td12x7 _19bvutpp _u5f3utpp _1bto1l2s _s7n4nkob",
48
46
  avatar: "_16jlidpf _1o9zkb7n _i0dl1wug _1e0c1txw _4cvr1h6o _1bah1h6o _kqswh2mm _1bsb14no _4t3i14no",
49
47
  nameSection: "_16jlkb7n _1o9zkb7n _i0dlf1ug _1ul9idpf _18u0utpp _2hwxu2gc _syazazsu",
50
- capitalize: "_1p1d1dk0",
51
- inviteButton: "_2rko12b0 _11c8fhey _1h6d1l7x _1dqonqa1 _189ee4h9 _1e0c116y _4cvr1h6o _1bah1h6o _ca0q12x7 _u5f3utpp _n3td12x7 _19bvutpp _syazazsu _k48p1wq8 _4t3iviql _bfhksm61 _cun9187o _irr31dpa"
48
+ capitalize: "_1p1d1dk0"
52
49
  };
53
50
  var VALID_OPTION = 'VALID';
54
51
  var POTENTIAL_OPTION = 'POTENTIAL';
@@ -112,6 +109,12 @@ var getIsEmailValid = function getIsEmailValid(inputValue) {
112
109
  var INVITE_ITEM_DESCRIPTION = exports.INVITE_ITEM_DESCRIPTION = {
113
110
  id: 'invite-teammate'
114
111
  };
112
+
113
+ // Ignored via go/ees005
114
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
115
+ var leftClick = function leftClick(event) {
116
+ return event.button === 0 && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;
117
+ };
115
118
  var InviteItemWithEmailDomain = function InviteItemWithEmailDomain(_ref2) {
116
119
  var productName = _ref2.productName,
117
120
  onMount = _ref2.onMount,
@@ -151,15 +154,26 @@ var InviteItemWithEmailDomain = function InviteItemWithEmailDomain(_ref2) {
151
154
  }
152
155
  return intl.formatMessage(_messages.mentionMessages.sendInvite);
153
156
  };
154
- var onInviteButtonClick = (0, _react.useCallback)(
157
+ var onSelected = (0, _react.useCallback)(
155
158
  // Ignored via go/ees005
156
159
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
157
160
  function (event) {
161
+ if (showErrorIcon) {
162
+ return;
163
+ }
158
164
  if (onSelection) {
165
+ // For mouse events, only handle left click
166
+ if ('button' in event && !leftClick(event)) {
167
+ return;
168
+ }
169
+ // For keyboard events, only handle Enter and Space
170
+ if ('key' in event && event.key !== 'Enter' && event.key !== ' ') {
171
+ return;
172
+ }
159
173
  event.preventDefault();
160
174
  onSelection(INVITE_ITEM_DESCRIPTION, event);
161
175
  }
162
- }, [onSelection]);
176
+ }, [onSelection, showErrorIcon]);
163
177
  var onItemMouseEnter = (0, _react.useCallback)(
164
178
  // Ignored via go/ees005
165
179
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -209,10 +223,14 @@ var InviteItemWithEmailDomain = function InviteItemWithEmailDomain(_ref2) {
209
223
  }, [query, isEmailValid]);
210
224
  var displayName = query && emailDomain ? possibleEmail : undefined;
211
225
  return displayName && /*#__PURE__*/_react.default.createElement("div", {
226
+ role: "button",
227
+ tabIndex: 0,
228
+ onMouseDown: onSelected,
229
+ onKeyDown: onSelected,
212
230
  onMouseEnter: onItemMouseEnter,
213
231
  onFocus: onItemFocus,
214
232
  "data-id": INVITE_ITEM_DESCRIPTION.id,
215
- className: (0, _runtime.ax)(["_1reo15vq _18m915vq _bfhk1j28 _1e0c1ule _2mzuglyw", selected && "_bfhk1dpa"])
233
+ className: (0, _runtime.ax)(["_1reo15vq _18m915vq _bfhk1j28 _1e0c1ule _2mzuglyw _80omtlke", selected && "_bfhk1dpa"])
216
234
  }, /*#__PURE__*/_react.default.createElement("div", {
217
235
  className: (0, _runtime.ax)([style.rowStyle])
218
236
  }, /*#__PURE__*/_react.default.createElement("span", {
@@ -230,11 +248,7 @@ var InviteItemWithEmailDomain = function InviteItemWithEmailDomain(_ref2) {
230
248
  name: displayName
231
249
  }), /*#__PURE__*/_react.default.createElement("div", {
232
250
  className: (0, _runtime.ax)([style.byline])
233
- }, getByline())), /*#__PURE__*/_react.default.createElement(_pressable.Pressable, {
234
- onClick: onInviteButtonClick,
235
- xcss: style.inviteButton,
236
- isDisabled: showErrorIcon
237
- }, intl.formatMessage(_messages.mentionMessages.inviteButton))));
251
+ }, getByline()))));
238
252
  };
239
253
 
240
254
  // eslint-disable-next-line @typescript-eslint/ban-types
@@ -51,7 +51,7 @@ const AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
51
51
  const AGENT_MENTION_INACTIVITY_MS = 3000;
52
52
  const MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
53
53
  const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
54
- const PACKAGE_VERSION = "15.0.3";
54
+ const PACKAGE_VERSION = "15.0.5";
55
55
  const setProvider = provider => (state, dispatch) => {
56
56
  if (dispatch) {
57
57
  dispatch(state.tr.setMeta(mentionPluginKey, {
@@ -1,8 +1,3 @@
1
- ._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
- ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
- ._189ee4h9{border-width:var(--ds-border-width,1px)}
4
- ._1dqonqa1{border-style:solid}
5
- ._1h6d1l7x{border-color:var(--ds-border,#0b120e24)}
6
1
  ._16jlidpf{flex-grow:0}
7
2
  ._16jlkb7n{flex-grow:1}
8
3
  ._18m915vq{overflow-y:hidden}
@@ -12,7 +7,6 @@
12
7
  ._1bah1h6o{justify-content:center}
13
8
  ._1bsb14no{width:36px}
14
9
  ._1bto1l2s{text-overflow:ellipsis}
15
- ._1e0c116y{display:inline-flex}
16
10
  ._1e0c1o8l{display:inline-block}
17
11
  ._1e0c1txw{display:flex}
18
12
  ._1e0c1ule{display:block}
@@ -27,19 +21,15 @@
27
21
  ._2mzuglyw{list-style-type:none}
28
22
  ._4cvr1h6o{align-items:center}
29
23
  ._4t3i14no{height:36px}
30
- ._4t3iviql{height:2rem}
24
+ ._80omtlke{cursor:pointer}
31
25
  ._bfhk1dpa{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
32
26
  ._bfhk1j28{background-color:transparent}
33
- ._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
34
27
  ._ca0q12x7{padding-top:var(--ds-space-075,6px)}
35
- ._cun9187o:disabled{background-color:var(--ds-background-disabled,#0515240f)}
36
28
  ._i0dl1wug{flex-basis:auto}
37
29
  ._i0dlf1ug{flex-basis:0%}
38
- ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
39
30
  ._kqswh2mm{position:relative}
40
31
  ._n3td12x7{padding-bottom:var(--ds-space-075,6px)}
41
32
  ._p12f1osq{max-width:100%}
42
33
  ._s7n4nkob{vertical-align:middle}
43
34
  ._syazazsu{color:var(--ds-text-subtle,#505258)}
44
- ._u5f3utpp{padding-right:var(--ds-space-150,9pt)}
45
- ._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
35
+ ._u5f3utpp{padding-right:var(--ds-space-150,9pt)}
@@ -7,8 +7,6 @@ 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
- // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- TODO: migrate to @atlaskit/primitives/compiled
11
- import { Pressable } from '@atlaskit/primitives/pressable';
12
10
  import { isValidEmail } from '@atlaskit/user-picker';
13
11
  const mentionItemStyle = null;
14
12
  const mentionItemSelectedStyle = null;
@@ -38,8 +36,7 @@ const style = {
38
36
  rowStyle: "_1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _2lx2vrvc _1n261g80 _ca0q12x7 _n3td12x7 _19bvutpp _u5f3utpp _1bto1l2s _s7n4nkob",
39
37
  avatar: "_16jlidpf _1o9zkb7n _i0dl1wug _1e0c1txw _4cvr1h6o _1bah1h6o _kqswh2mm _1bsb14no _4t3i14no",
40
38
  nameSection: "_16jlkb7n _1o9zkb7n _i0dlf1ug _1ul9idpf _18u0utpp _2hwxu2gc _syazazsu",
41
- capitalize: "_1p1d1dk0",
42
- inviteButton: "_2rko12b0 _11c8fhey _1h6d1l7x _1dqonqa1 _189ee4h9 _1e0c116y _4cvr1h6o _1bah1h6o _ca0q12x7 _u5f3utpp _n3td12x7 _19bvutpp _syazazsu _k48p1wq8 _4t3iviql _bfhksm61 _cun9187o _irr31dpa"
39
+ capitalize: "_1p1d1dk0"
43
40
  };
44
41
  const VALID_OPTION = 'VALID';
45
42
  const POTENTIAL_OPTION = 'POTENTIAL';
@@ -102,6 +99,12 @@ const getIsEmailValid = inputValue => {
102
99
  export const INVITE_ITEM_DESCRIPTION = {
103
100
  id: 'invite-teammate'
104
101
  };
102
+
103
+ // Ignored via go/ees005
104
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
105
+ const leftClick = event => {
106
+ return event.button === 0 && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;
107
+ };
105
108
  const InviteItemWithEmailDomain = ({
106
109
  productName,
107
110
  onMount,
@@ -138,15 +141,26 @@ const InviteItemWithEmailDomain = ({
138
141
  }
139
142
  return intl.formatMessage(messages.sendInvite);
140
143
  };
141
- const onInviteButtonClick = useCallback(
144
+ const onSelected = useCallback(
142
145
  // Ignored via go/ees005
143
146
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
144
147
  event => {
148
+ if (showErrorIcon) {
149
+ return;
150
+ }
145
151
  if (onSelection) {
152
+ // For mouse events, only handle left click
153
+ if ('button' in event && !leftClick(event)) {
154
+ return;
155
+ }
156
+ // For keyboard events, only handle Enter and Space
157
+ if ('key' in event && event.key !== 'Enter' && event.key !== ' ') {
158
+ return;
159
+ }
146
160
  event.preventDefault();
147
161
  onSelection(INVITE_ITEM_DESCRIPTION, event);
148
162
  }
149
- }, [onSelection]);
163
+ }, [onSelection, showErrorIcon]);
150
164
  const onItemMouseEnter = useCallback(
151
165
  // Ignored via go/ees005
152
166
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -196,10 +210,14 @@ const InviteItemWithEmailDomain = ({
196
210
  }, [query, isEmailValid]);
197
211
  const displayName = query && emailDomain ? possibleEmail : undefined;
198
212
  return displayName && /*#__PURE__*/React.createElement("div", {
213
+ role: "button",
214
+ tabIndex: 0,
215
+ onMouseDown: onSelected,
216
+ onKeyDown: onSelected,
199
217
  onMouseEnter: onItemMouseEnter,
200
218
  onFocus: onItemFocus,
201
219
  "data-id": INVITE_ITEM_DESCRIPTION.id,
202
- className: ax(["_1reo15vq _18m915vq _bfhk1j28 _1e0c1ule _2mzuglyw", selected && "_bfhk1dpa"])
220
+ className: ax(["_1reo15vq _18m915vq _bfhk1j28 _1e0c1ule _2mzuglyw _80omtlke", selected && "_bfhk1dpa"])
203
221
  }, /*#__PURE__*/React.createElement("div", {
204
222
  className: ax([style.rowStyle])
205
223
  }, /*#__PURE__*/React.createElement("span", {
@@ -217,11 +235,7 @@ const InviteItemWithEmailDomain = ({
217
235
  name: displayName
218
236
  }), /*#__PURE__*/React.createElement("div", {
219
237
  className: ax([style.byline])
220
- }, getByline())), /*#__PURE__*/React.createElement(Pressable, {
221
- onClick: onInviteButtonClick,
222
- xcss: style.inviteButton,
223
- isDisabled: showErrorIcon
224
- }, intl.formatMessage(messages.inviteButton))));
238
+ }, getByline()))));
225
239
  };
226
240
 
227
241
  // eslint-disable-next-line @typescript-eslint/ban-types
@@ -58,7 +58,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
58
58
  var AGENT_MENTION_INACTIVITY_MS = 3000;
59
59
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
60
60
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
61
- var PACKAGE_VERSION = "15.0.3";
61
+ var PACKAGE_VERSION = "15.0.5";
62
62
  var setProvider = function setProvider(provider) {
63
63
  return function (state, dispatch) {
64
64
  if (dispatch) {
@@ -1,8 +1,3 @@
1
- ._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
- ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
- ._189ee4h9{border-width:var(--ds-border-width,1px)}
4
- ._1dqonqa1{border-style:solid}
5
- ._1h6d1l7x{border-color:var(--ds-border,#0b120e24)}
6
1
  ._16jlidpf{flex-grow:0}
7
2
  ._16jlkb7n{flex-grow:1}
8
3
  ._18m915vq{overflow-y:hidden}
@@ -12,7 +7,6 @@
12
7
  ._1bah1h6o{justify-content:center}
13
8
  ._1bsb14no{width:36px}
14
9
  ._1bto1l2s{text-overflow:ellipsis}
15
- ._1e0c116y{display:inline-flex}
16
10
  ._1e0c1o8l{display:inline-block}
17
11
  ._1e0c1txw{display:flex}
18
12
  ._1e0c1ule{display:block}
@@ -27,19 +21,15 @@
27
21
  ._2mzuglyw{list-style-type:none}
28
22
  ._4cvr1h6o{align-items:center}
29
23
  ._4t3i14no{height:36px}
30
- ._4t3iviql{height:2rem}
24
+ ._80omtlke{cursor:pointer}
31
25
  ._bfhk1dpa{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
32
26
  ._bfhk1j28{background-color:transparent}
33
- ._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
34
27
  ._ca0q12x7{padding-top:var(--ds-space-075,6px)}
35
- ._cun9187o:disabled{background-color:var(--ds-background-disabled,#0515240f)}
36
28
  ._i0dl1wug{flex-basis:auto}
37
29
  ._i0dlf1ug{flex-basis:0%}
38
- ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
39
30
  ._kqswh2mm{position:relative}
40
31
  ._n3td12x7{padding-bottom:var(--ds-space-075,6px)}
41
32
  ._p12f1osq{max-width:100%}
42
33
  ._s7n4nkob{vertical-align:middle}
43
34
  ._syazazsu{color:var(--ds-text-subtle,#505258)}
44
- ._u5f3utpp{padding-right:var(--ds-space-150,9pt)}
45
- ._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
35
+ ._u5f3utpp{padding-right:var(--ds-space-150,9pt)}
@@ -8,8 +8,6 @@ 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
- // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- TODO: migrate to @atlaskit/primitives/compiled
12
- import { Pressable } from '@atlaskit/primitives/pressable';
13
11
  import { isValidEmail } from '@atlaskit/user-picker';
14
12
  var mentionItemStyle = null;
15
13
  var mentionItemSelectedStyle = null;
@@ -38,8 +36,7 @@ var style = {
38
36
  rowStyle: "_1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _2lx2vrvc _1n261g80 _ca0q12x7 _n3td12x7 _19bvutpp _u5f3utpp _1bto1l2s _s7n4nkob",
39
37
  avatar: "_16jlidpf _1o9zkb7n _i0dl1wug _1e0c1txw _4cvr1h6o _1bah1h6o _kqswh2mm _1bsb14no _4t3i14no",
40
38
  nameSection: "_16jlkb7n _1o9zkb7n _i0dlf1ug _1ul9idpf _18u0utpp _2hwxu2gc _syazazsu",
41
- capitalize: "_1p1d1dk0",
42
- inviteButton: "_2rko12b0 _11c8fhey _1h6d1l7x _1dqonqa1 _189ee4h9 _1e0c116y _4cvr1h6o _1bah1h6o _ca0q12x7 _u5f3utpp _n3td12x7 _19bvutpp _syazazsu _k48p1wq8 _4t3iviql _bfhksm61 _cun9187o _irr31dpa"
39
+ capitalize: "_1p1d1dk0"
43
40
  };
44
41
  var VALID_OPTION = 'VALID';
45
42
  var POTENTIAL_OPTION = 'POTENTIAL';
@@ -103,6 +100,12 @@ var getIsEmailValid = function getIsEmailValid(inputValue) {
103
100
  export var INVITE_ITEM_DESCRIPTION = {
104
101
  id: 'invite-teammate'
105
102
  };
103
+
104
+ // Ignored via go/ees005
105
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
106
+ var leftClick = function leftClick(event) {
107
+ return event.button === 0 && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;
108
+ };
106
109
  var InviteItemWithEmailDomain = function InviteItemWithEmailDomain(_ref2) {
107
110
  var productName = _ref2.productName,
108
111
  onMount = _ref2.onMount,
@@ -142,15 +145,26 @@ var InviteItemWithEmailDomain = function InviteItemWithEmailDomain(_ref2) {
142
145
  }
143
146
  return intl.formatMessage(messages.sendInvite);
144
147
  };
145
- var onInviteButtonClick = useCallback(
148
+ var onSelected = useCallback(
146
149
  // Ignored via go/ees005
147
150
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
148
151
  function (event) {
152
+ if (showErrorIcon) {
153
+ return;
154
+ }
149
155
  if (onSelection) {
156
+ // For mouse events, only handle left click
157
+ if ('button' in event && !leftClick(event)) {
158
+ return;
159
+ }
160
+ // For keyboard events, only handle Enter and Space
161
+ if ('key' in event && event.key !== 'Enter' && event.key !== ' ') {
162
+ return;
163
+ }
150
164
  event.preventDefault();
151
165
  onSelection(INVITE_ITEM_DESCRIPTION, event);
152
166
  }
153
- }, [onSelection]);
167
+ }, [onSelection, showErrorIcon]);
154
168
  var onItemMouseEnter = useCallback(
155
169
  // Ignored via go/ees005
156
170
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -200,10 +214,14 @@ var InviteItemWithEmailDomain = function InviteItemWithEmailDomain(_ref2) {
200
214
  }, [query, isEmailValid]);
201
215
  var displayName = query && emailDomain ? possibleEmail : undefined;
202
216
  return displayName && /*#__PURE__*/React.createElement("div", {
217
+ role: "button",
218
+ tabIndex: 0,
219
+ onMouseDown: onSelected,
220
+ onKeyDown: onSelected,
203
221
  onMouseEnter: onItemMouseEnter,
204
222
  onFocus: onItemFocus,
205
223
  "data-id": INVITE_ITEM_DESCRIPTION.id,
206
- className: ax(["_1reo15vq _18m915vq _bfhk1j28 _1e0c1ule _2mzuglyw", selected && "_bfhk1dpa"])
224
+ className: ax(["_1reo15vq _18m915vq _bfhk1j28 _1e0c1ule _2mzuglyw _80omtlke", selected && "_bfhk1dpa"])
207
225
  }, /*#__PURE__*/React.createElement("div", {
208
226
  className: ax([style.rowStyle])
209
227
  }, /*#__PURE__*/React.createElement("span", {
@@ -221,11 +239,7 @@ var InviteItemWithEmailDomain = function InviteItemWithEmailDomain(_ref2) {
221
239
  name: displayName
222
240
  }), /*#__PURE__*/React.createElement("div", {
223
241
  className: ax([style.byline])
224
- }, getByline())), /*#__PURE__*/React.createElement(Pressable, {
225
- onClick: onInviteButtonClick,
226
- xcss: style.inviteButton,
227
- isDisabled: showErrorIcon
228
- }, intl.formatMessage(messages.inviteButton))));
242
+ }, getByline()))));
229
243
  };
230
244
 
231
245
  // eslint-disable-next-line @typescript-eslint/ban-types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "15.0.4",
3
+ "version": "15.1.0",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "atlaskit:src": "src/index.ts",
23
23
  "dependencies": {
24
- "@atlaskit/adf-schema": "^56.5.0",
24
+ "@atlaskit/adf-schema": "^56.6.0",
25
25
  "@atlaskit/css": "^1.0.0",
26
26
  "@atlaskit/editor-plugin-analytics": "^13.0.0",
27
27
  "@atlaskit/editor-plugin-base": "^14.0.0",
@@ -42,8 +42,8 @@
42
42
  "@atlaskit/primitives": "^22.2.0",
43
43
  "@atlaskit/profilecard": "^26.15.0",
44
44
  "@atlaskit/teams-app-config": "^2.2.0",
45
- "@atlaskit/theme": "^26.1.0",
46
- "@atlaskit/tmp-editor-statsig": "^140.0.0",
45
+ "@atlaskit/theme": "^27.0.0",
46
+ "@atlaskit/tmp-editor-statsig": "^141.1.0",
47
47
  "@atlaskit/tokens": "^16.3.0",
48
48
  "@atlaskit/tooltip": "^24.0.0",
49
49
  "@atlaskit/user-picker": "^13.8.0",
@@ -55,7 +55,7 @@
55
55
  "uuid": "^3.1.0"
56
56
  },
57
57
  "peerDependencies": {
58
- "@atlaskit/editor-common": "^117.2.0",
58
+ "@atlaskit/editor-common": "^117.3.0",
59
59
  "react": "^18.2.0 || ^19.2.0",
60
60
  "react-dom": "^18.2.0 || ^19.2.0",
61
61
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"