@atlaskit/editor-plugin-mentions 1.8.2 → 2.0.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 +14 -0
- package/dist/cjs/plugin.js +1 -2
- package/dist/cjs/ui/InviteItem/styles.js +6 -6
- package/dist/es2019/plugin.js +21 -24
- package/dist/es2019/ui/InviteItem/styles.js +6 -6
- package/dist/esm/plugin.js +1 -2
- package/dist/esm/ui/InviteItem/styles.js +6 -6
- package/dist/types/types.d.ts +1 -2
- package/dist/types-ts4.5/types.d.ts +1 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`d9b562bd66f8e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d9b562bd66f8e) -
|
|
8
|
+
[ux] [ED-23947] restoring the original order of the typeahead menu so that actions, media,
|
|
9
|
+
mentions and emojis are above the fold (in the top 5 results). this change is a major because it
|
|
10
|
+
removes the `getEditorFeatureFlags prop` for plugins. if any consumers who have adopted these
|
|
11
|
+
changes to the public API, they should remove them on their side too.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 1.8.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -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:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
});
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -81,31 +81,28 @@ const mentionsPlugin = ({
|
|
|
81
81
|
pluginsOptions: {
|
|
82
82
|
quickInsert: ({
|
|
83
83
|
formatMessage
|
|
84
|
-
}) => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
});
|
package/dist/esm/plugin.js
CHANGED
|
@@ -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:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
});
|
package/dist/types/types.d.ts
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^39.0.3",
|
|
37
37
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
38
|
-
"@atlaskit/editor-common": "^
|
|
38
|
+
"@atlaskit/editor-common": "^84.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",
|