@atlaskit/editor-plugin-mentions 9.2.3 → 9.2.5

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,19 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 9.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`305de6482efe2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/305de6482efe2) -
8
+ Addressing several eslint issues
9
+ - Updated dependencies
10
+
11
+ ## 9.2.4
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 9.2.3
4
18
 
5
19
  ### Patch Changes
@@ -23,7 +23,7 @@ var ACTIONS = exports.ACTIONS = {
23
23
  SET_PROVIDER: 'SET_PROVIDER'
24
24
  };
25
25
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
26
- var PACKAGE_VERSION = "0.0.0-development";
26
+ var PACKAGE_VERSION = "9.2.4";
27
27
  var setProvider = function setProvider(provider) {
28
28
  return function (state, dispatch) {
29
29
  if (dispatch) {
@@ -43,7 +43,15 @@ var InviteItem = function InviteItem(_ref) {
43
43
  // Ignored via go/ees005
44
44
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
45
  function (event) {
46
- if (leftClick(event) && onSelection) {
46
+ if (onSelection) {
47
+ // For mouse events, only handle left click
48
+ if ('button' in event && !leftClick(event)) {
49
+ return;
50
+ }
51
+ // For keyboard events, only handle Enter and Space
52
+ if ('key' in event && event.key !== 'Enter' && event.key !== ' ') {
53
+ return;
54
+ }
47
55
  event.preventDefault();
48
56
  onSelection(INVITE_ITEM_DESCRIPTION, event);
49
57
  }
@@ -56,16 +64,29 @@ var InviteItem = function InviteItem(_ref) {
56
64
  onMouseEnter(INVITE_ITEM_DESCRIPTION, event);
57
65
  }
58
66
  }, [onMouseEnter]);
67
+ var onItemFocus = (0, _react.useCallback)(
68
+ // Ignored via go/ees005
69
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
70
+ function (event) {
71
+ if (onMouseEnter) {
72
+ onMouseEnter(INVITE_ITEM_DESCRIPTION, event);
73
+ }
74
+ }, [onMouseEnter]);
59
75
  (0, _react.useEffect)(function () {
60
76
  if (onMount) {
61
77
  onMount();
62
78
  }
63
79
  }, [onMount]);
64
80
  return /*#__PURE__*/_react.default.createElement("div", {
65
- onMouseDown: onSelected
66
- // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
81
+ role: "button",
82
+ tabIndex: 0
83
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
67
84
  ,
85
+
86
+ onMouseDown: onSelected,
87
+ onKeyDown: onSelected,
68
88
  onMouseEnter: onItemMouseEnter,
89
+ onFocus: onItemFocus,
69
90
  "data-id": INVITE_ITEM_DESCRIPTION.id,
70
91
  className: (0, _runtime.ax)(["_1reo15vq _18m915vq _bfhk1j28 _1e0c1ule _2mzuglyw _80omtlke", selected && "_bfhk2tgk"]),
71
92
  style: {
@@ -12,7 +12,7 @@ export const ACTIONS = {
12
12
  SET_PROVIDER: 'SET_PROVIDER'
13
13
  };
14
14
  const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
15
- const PACKAGE_VERSION = "0.0.0-development";
15
+ const PACKAGE_VERSION = "9.2.4";
16
16
  const setProvider = provider => (state, dispatch) => {
17
17
  if (dispatch) {
18
18
  dispatch(state.tr.setMeta(mentionPluginKey, {
@@ -35,7 +35,15 @@ const InviteItem = ({
35
35
  // Ignored via go/ees005
36
36
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
37
  event => {
38
- if (leftClick(event) && onSelection) {
38
+ if (onSelection) {
39
+ // For mouse events, only handle left click
40
+ if ('button' in event && !leftClick(event)) {
41
+ return;
42
+ }
43
+ // For keyboard events, only handle Enter and Space
44
+ if ('key' in event && event.key !== 'Enter' && event.key !== ' ') {
45
+ return;
46
+ }
39
47
  event.preventDefault();
40
48
  onSelection(INVITE_ITEM_DESCRIPTION, event);
41
49
  }
@@ -48,16 +56,29 @@ const InviteItem = ({
48
56
  onMouseEnter(INVITE_ITEM_DESCRIPTION, event);
49
57
  }
50
58
  }, [onMouseEnter]);
59
+ const onItemFocus = useCallback(
60
+ // Ignored via go/ees005
61
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
62
+ event => {
63
+ if (onMouseEnter) {
64
+ onMouseEnter(INVITE_ITEM_DESCRIPTION, event);
65
+ }
66
+ }, [onMouseEnter]);
51
67
  useEffect(() => {
52
68
  if (onMount) {
53
69
  onMount();
54
70
  }
55
71
  }, [onMount]);
56
72
  return /*#__PURE__*/React.createElement("div", {
57
- onMouseDown: onSelected
58
- // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
73
+ role: "button",
74
+ tabIndex: 0
75
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
59
76
  ,
77
+
78
+ onMouseDown: onSelected,
79
+ onKeyDown: onSelected,
60
80
  onMouseEnter: onItemMouseEnter,
81
+ onFocus: onItemFocus,
61
82
  "data-id": INVITE_ITEM_DESCRIPTION.id,
62
83
  className: ax(["_1reo15vq _18m915vq _bfhk1j28 _1e0c1ule _2mzuglyw _80omtlke", selected && "_bfhk14ae"])
63
84
  }, /*#__PURE__*/React.createElement("div", {
@@ -15,7 +15,7 @@ export var ACTIONS = {
15
15
  SET_PROVIDER: 'SET_PROVIDER'
16
16
  };
17
17
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
18
- var PACKAGE_VERSION = "0.0.0-development";
18
+ var PACKAGE_VERSION = "9.2.4";
19
19
  var setProvider = function setProvider(provider) {
20
20
  return function (state, dispatch) {
21
21
  if (dispatch) {
@@ -34,7 +34,15 @@ var InviteItem = function InviteItem(_ref) {
34
34
  // Ignored via go/ees005
35
35
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
36
  function (event) {
37
- if (leftClick(event) && onSelection) {
37
+ if (onSelection) {
38
+ // For mouse events, only handle left click
39
+ if ('button' in event && !leftClick(event)) {
40
+ return;
41
+ }
42
+ // For keyboard events, only handle Enter and Space
43
+ if ('key' in event && event.key !== 'Enter' && event.key !== ' ') {
44
+ return;
45
+ }
38
46
  event.preventDefault();
39
47
  onSelection(INVITE_ITEM_DESCRIPTION, event);
40
48
  }
@@ -47,16 +55,29 @@ var InviteItem = function InviteItem(_ref) {
47
55
  onMouseEnter(INVITE_ITEM_DESCRIPTION, event);
48
56
  }
49
57
  }, [onMouseEnter]);
58
+ var onItemFocus = useCallback(
59
+ // Ignored via go/ees005
60
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
61
+ function (event) {
62
+ if (onMouseEnter) {
63
+ onMouseEnter(INVITE_ITEM_DESCRIPTION, event);
64
+ }
65
+ }, [onMouseEnter]);
50
66
  useEffect(function () {
51
67
  if (onMount) {
52
68
  onMount();
53
69
  }
54
70
  }, [onMount]);
55
71
  return /*#__PURE__*/React.createElement("div", {
56
- onMouseDown: onSelected
57
- // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
72
+ role: "button",
73
+ tabIndex: 0
74
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
58
75
  ,
76
+
77
+ onMouseDown: onSelected,
78
+ onKeyDown: onSelected,
59
79
  onMouseEnter: onItemMouseEnter,
80
+ onFocus: onItemFocus,
60
81
  "data-id": INVITE_ITEM_DESCRIPTION.id,
61
82
  className: ax(["_1reo15vq _18m915vq _bfhk1j28 _1e0c1ule _2mzuglyw _80omtlke", selected && "_bfhk2tgk"]),
62
83
  style: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "9.2.3",
3
+ "version": "9.2.5",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -47,9 +47,9 @@
47
47
  "@atlaskit/primitives": "^18.0.0",
48
48
  "@atlaskit/profilecard": "^24.35.0",
49
49
  "@atlaskit/theme": "^21.0.0",
50
- "@atlaskit/tmp-editor-statsig": "^24.1.0",
50
+ "@atlaskit/tmp-editor-statsig": "^25.2.0",
51
51
  "@atlaskit/tokens": "^11.0.0",
52
- "@atlaskit/user-picker": "^11.21.0",
52
+ "@atlaskit/user-picker": "^11.22.0",
53
53
  "@babel/runtime": "^7.0.0",
54
54
  "@compiled/react": "^0.18.6",
55
55
  "bind-event-listener": "^3.0.0",
@@ -57,7 +57,7 @@
57
57
  "uuid": "^3.1.0"
58
58
  },
59
59
  "peerDependencies": {
60
- "@atlaskit/editor-common": "^111.12.0",
60
+ "@atlaskit/editor-common": "^111.14.0",
61
61
  "react": "^18.2.0",
62
62
  "react-dom": "^18.2.0",
63
63
  "react-intl-next": "npm:react-intl@^5.18.1"