@atlaskit/editor-plugin-mentions 1.8.2 → 2.0.1

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,25 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - [`d9b562bd66f8e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d9b562bd66f8e) -
14
+ [ux] [ED-23947] restoring the original order of the typeahead menu so that actions, media,
15
+ mentions and emojis are above the fold (in the top 5 results). this change is a major because it
16
+ removes the `getEditorFeatureFlags prop` for plugins. if any consumers who have adopted these
17
+ changes to the public API, they should remove them on their side too.
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 1.8.2
4
24
 
5
25
  ### Patch Changes
@@ -88,14 +88,13 @@ var mentionsPlugin = exports.mentionsPlugin = function mentionsPlugin(_ref) {
88
88
  },
89
89
  pluginsOptions: {
90
90
  quickInsert: function quickInsert(_ref4) {
91
- var _options$getEditorFea;
92
91
  var formatMessage = _ref4.formatMessage;
93
92
  return [{
94
93
  id: 'mention',
95
94
  title: formatMessage(_messages.toolbarInsertBlockMessages.mention),
96
95
  description: formatMessage(_messages.toolbarInsertBlockMessages.mentionDescription),
97
96
  keywords: ['team', 'user'],
98
- priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 700 : 400,
97
+ priority: 400,
99
98
  keyshortcut: '@',
100
99
  icon: function icon() {
101
100
  return /*#__PURE__*/_react.default.createElement(_quickInsert.IconMention, null);
@@ -9,7 +9,7 @@ var _colors = require("@atlaskit/theme/colors");
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
 
11
11
  var ROW_SIDE_PADDING = exports.ROW_SIDE_PADDING = 14;
12
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
12
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
13
13
  var rowStyle = exports.rowStyle = (0, _react.css)({
14
14
  alignItems: 'center',
15
15
  display: 'flex',
@@ -21,7 +21,7 @@ var rowStyle = exports.rowStyle = (0, _react.css)({
21
21
  verticalAlign: 'middle'
22
22
  });
23
23
  var AVATAR_HEIGHT = exports.AVATAR_HEIGHT = 36;
24
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
24
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
25
25
  var avatarStyle = exports.avatarStyle = (0, _react.css)({
26
26
  position: 'relative',
27
27
  flex: 'initial',
@@ -36,7 +36,7 @@ var avatarStyle = exports.avatarStyle = (0, _react.css)({
36
36
  }
37
37
  });
38
38
 
39
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
40
40
  var nameSectionStyle = exports.nameSectionStyle = (0, _react.css)({
41
41
  flex: 1,
42
42
  minWidth: 0,
@@ -46,7 +46,7 @@ var nameSectionStyle = exports.nameSectionStyle = (0, _react.css)({
46
46
  opacity: 'inherit'
47
47
  });
48
48
 
49
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
49
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
50
50
  var mentionItemStyle = exports.mentionItemStyle = (0, _react.css)({
51
51
  backgroundColor: 'transparent',
52
52
  display: 'block',
@@ -55,12 +55,12 @@ var mentionItemStyle = exports.mentionItemStyle = (0, _react.css)({
55
55
  cursor: 'pointer'
56
56
  });
57
57
 
58
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
58
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
59
59
  var mentionItemSelectedStyle = exports.mentionItemSelectedStyle = (0, _react.css)({
60
60
  backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30, ")")
61
61
  });
62
62
 
63
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
63
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
64
64
  var capitalizedStyle = exports.capitalizedStyle = (0, _react.css)({
65
65
  textTransform: 'capitalize'
66
66
  });
@@ -81,31 +81,28 @@ const mentionsPlugin = ({
81
81
  pluginsOptions: {
82
82
  quickInsert: ({
83
83
  formatMessage
84
- }) => {
85
- var _options$getEditorFea;
86
- return [{
87
- id: 'mention',
88
- title: formatMessage(messages.mention),
89
- description: formatMessage(messages.mentionDescription),
90
- keywords: ['team', 'user'],
91
- priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 700 : 400,
92
- keyshortcut: '@',
93
- icon: () => /*#__PURE__*/React.createElement(IconMention, null),
94
- action(insert, state) {
95
- var _api$typeAhead2;
96
- const tr = insert(undefined);
97
- const pluginState = mentionPluginKey.getState(state);
98
- if (pluginState && pluginState.canInsertMention === false) {
99
- return false;
100
- }
101
- api === null || api === void 0 ? void 0 : (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 ? void 0 : _api$typeAhead2.actions.openAtTransaction({
102
- triggerHandler: typeAhead,
103
- inputMethod: INPUT_METHOD.QUICK_INSERT
104
- })(tr);
105
- return tr;
84
+ }) => [{
85
+ id: 'mention',
86
+ title: formatMessage(messages.mention),
87
+ description: formatMessage(messages.mentionDescription),
88
+ keywords: ['team', 'user'],
89
+ priority: 400,
90
+ keyshortcut: '@',
91
+ icon: () => /*#__PURE__*/React.createElement(IconMention, null),
92
+ action(insert, state) {
93
+ var _api$typeAhead2;
94
+ const tr = insert(undefined);
95
+ const pluginState = mentionPluginKey.getState(state);
96
+ if (pluginState && pluginState.canInsertMention === false) {
97
+ return false;
106
98
  }
107
- }];
108
- },
99
+ api === null || api === void 0 ? void 0 : (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 ? void 0 : _api$typeAhead2.actions.openAtTransaction({
100
+ triggerHandler: typeAhead,
101
+ inputMethod: INPUT_METHOD.QUICK_INSERT
102
+ })(tr);
103
+ return tr;
104
+ }
105
+ }],
109
106
  typeAhead
110
107
  }
111
108
  };
@@ -2,7 +2,7 @@
2
2
  import { css } from '@emotion/react';
3
3
  import { N30, N300 } from '@atlaskit/theme/colors';
4
4
  export const ROW_SIDE_PADDING = 14;
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
6
6
  export const rowStyle = css({
7
7
  alignItems: 'center',
8
8
  display: 'flex',
@@ -14,7 +14,7 @@ export const rowStyle = css({
14
14
  verticalAlign: 'middle'
15
15
  });
16
16
  export const AVATAR_HEIGHT = 36;
17
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
17
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
18
18
  export const avatarStyle = css({
19
19
  position: 'relative',
20
20
  flex: 'initial',
@@ -29,7 +29,7 @@ export const avatarStyle = css({
29
29
  }
30
30
  });
31
31
 
32
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
32
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
33
33
  export const nameSectionStyle = css({
34
34
  flex: 1,
35
35
  minWidth: 0,
@@ -39,7 +39,7 @@ export const nameSectionStyle = css({
39
39
  opacity: 'inherit'
40
40
  });
41
41
 
42
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
42
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
43
43
  export const mentionItemStyle = css({
44
44
  backgroundColor: 'transparent',
45
45
  display: 'block',
@@ -48,12 +48,12 @@ export const mentionItemStyle = css({
48
48
  cursor: 'pointer'
49
49
  });
50
50
 
51
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
51
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
52
52
  export const mentionItemSelectedStyle = css({
53
53
  backgroundColor: `var(--ds-background-neutral-subtle-hovered, ${N30})`
54
54
  });
55
55
 
56
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
56
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
57
57
  export const capitalizedStyle = css({
58
58
  textTransform: 'capitalize'
59
59
  });
@@ -81,14 +81,13 @@ var mentionsPlugin = function mentionsPlugin(_ref) {
81
81
  },
82
82
  pluginsOptions: {
83
83
  quickInsert: function quickInsert(_ref4) {
84
- var _options$getEditorFea;
85
84
  var formatMessage = _ref4.formatMessage;
86
85
  return [{
87
86
  id: 'mention',
88
87
  title: formatMessage(messages.mention),
89
88
  description: formatMessage(messages.mentionDescription),
90
89
  keywords: ['team', 'user'],
91
- priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 700 : 400,
90
+ priority: 400,
92
91
  keyshortcut: '@',
93
92
  icon: function icon() {
94
93
  return /*#__PURE__*/React.createElement(IconMention, null);
@@ -2,7 +2,7 @@
2
2
  import { css } from '@emotion/react';
3
3
  import { N30, N300 } from '@atlaskit/theme/colors';
4
4
  export var ROW_SIDE_PADDING = 14;
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
6
6
  export var rowStyle = css({
7
7
  alignItems: 'center',
8
8
  display: 'flex',
@@ -14,7 +14,7 @@ export var rowStyle = css({
14
14
  verticalAlign: 'middle'
15
15
  });
16
16
  export var AVATAR_HEIGHT = 36;
17
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
17
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
18
18
  export var avatarStyle = css({
19
19
  position: 'relative',
20
20
  flex: 'initial',
@@ -29,7 +29,7 @@ export var avatarStyle = css({
29
29
  }
30
30
  });
31
31
 
32
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
32
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
33
33
  export var nameSectionStyle = css({
34
34
  flex: 1,
35
35
  minWidth: 0,
@@ -39,7 +39,7 @@ export var nameSectionStyle = css({
39
39
  opacity: 'inherit'
40
40
  });
41
41
 
42
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
42
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
43
43
  export var mentionItemStyle = css({
44
44
  backgroundColor: 'transparent',
45
45
  display: 'block',
@@ -48,12 +48,12 @@ export var mentionItemStyle = css({
48
48
  cursor: 'pointer'
49
49
  });
50
50
 
51
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
51
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
52
52
  export var mentionItemSelectedStyle = css({
53
53
  backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(N30, ")")
54
54
  });
55
55
 
56
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
56
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
57
57
  export var capitalizedStyle = css({
58
58
  textTransform: 'capitalize'
59
59
  });
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { AnalyticsEventPayload } from '@atlaskit/analytics-next';
3
3
  import { type ProfilecardProvider } from '@atlaskit/editor-common/src/provider-factory/profile-card-provider';
4
- import type { GetEditorFeatureFlags, NextEditorPlugin, OptionalPlugin, TypeAheadHandler } from '@atlaskit/editor-common/types';
4
+ import type { NextEditorPlugin, OptionalPlugin, TypeAheadHandler } from '@atlaskit/editor-common/types';
5
5
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
6
6
  import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
7
7
  import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
@@ -15,7 +15,6 @@ export interface MentionPluginConfig {
15
15
  HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
16
16
  insertDisplayName?: boolean;
17
17
  profilecardProvider?: Promise<ProfilecardProvider>;
18
- getEditorFeatureFlags?: GetEditorFeatureFlags;
19
18
  }
20
19
  export interface MentionPluginOptions extends MentionPluginConfig {
21
20
  sanitizePrivateContent?: boolean;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { AnalyticsEventPayload } from '@atlaskit/analytics-next';
3
3
  import { type ProfilecardProvider } from '@atlaskit/editor-common/src/provider-factory/profile-card-provider';
4
- import type { GetEditorFeatureFlags, NextEditorPlugin, OptionalPlugin, TypeAheadHandler } from '@atlaskit/editor-common/types';
4
+ import type { NextEditorPlugin, OptionalPlugin, TypeAheadHandler } from '@atlaskit/editor-common/types';
5
5
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
6
6
  import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
7
7
  import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
@@ -15,7 +15,6 @@ export interface MentionPluginConfig {
15
15
  HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
16
16
  insertDisplayName?: boolean;
17
17
  profilecardProvider?: Promise<ProfilecardProvider>;
18
- getEditorFeatureFlags?: GetEditorFeatureFlags;
19
18
  }
20
19
  export interface MentionPluginOptions extends MentionPluginConfig {
21
20
  sanitizePrivateContent?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "1.8.2",
3
+ "version": "2.0.1",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,16 +35,16 @@
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^39.0.3",
37
37
  "@atlaskit/analytics-gas-types": "^5.1.0",
38
- "@atlaskit/editor-common": "^83.5.0",
38
+ "@atlaskit/editor-common": "^85.0.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.4.0",
40
40
  "@atlaskit/editor-plugin-context-identifier": "^1.1.0",
41
41
  "@atlaskit/editor-plugin-type-ahead": "^1.4.0",
42
42
  "@atlaskit/editor-prosemirror": "4.0.1",
43
- "@atlaskit/icon": "^22.5.0",
43
+ "@atlaskit/icon": "^22.6.0",
44
44
  "@atlaskit/mention": "^23.2.0",
45
45
  "@atlaskit/platform-feature-flags": "^0.3.0",
46
46
  "@atlaskit/theme": "^12.11.0",
47
- "@atlaskit/tokens": "^1.53.0",
47
+ "@atlaskit/tokens": "^1.54.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@emotion/react": "^11.7.1",
50
50
  "uuid": "^3.1.0"