@atlaskit/editor-plugin-mentions 2.10.4 → 2.10.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 +12 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/{plugin.js → mentionsPlugin.js} +2 -1
- package/dist/cjs/mentionsPluginType.js +5 -0
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/ui/InviteItem/index.js +29 -26
- package/dist/cjs/{type-ahead → ui/type-ahead}/index.js +4 -4
- package/dist/cjs/{utils.js → ui/type-ahead/utils.js} +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/{plugin.js → mentionsPlugin.js} +2 -1
- package/dist/es2019/mentionsPluginType.js +1 -0
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/ui/InviteItem/index.js +29 -26
- package/dist/es2019/{type-ahead → ui/type-ahead}/index.js +4 -4
- package/dist/es2019/{utils.js → ui/type-ahead/utils.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/{plugin.js → mentionsPlugin.js} +2 -1
- package/dist/esm/mentionsPluginType.js +1 -0
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/ui/InviteItem/index.js +29 -26
- package/dist/esm/{type-ahead → ui/type-ahead}/index.js +4 -4
- package/dist/esm/{utils.js → ui/type-ahead/utils.js} +1 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/{plugin.d.ts → mentionsPlugin.d.ts} +1 -1
- package/dist/types/mentionsPluginType.d.ts +23 -0
- package/dist/types/{types.d.ts → types/index.d.ts} +1 -22
- package/dist/types/ui/SecondaryToolbarComponent.d.ts +1 -1
- package/dist/types/{analytics.d.ts → ui/type-ahead/analytics.d.ts} +1 -1
- package/dist/{types-ts4.5 → types/ui}/type-ahead/index.d.ts +2 -1
- package/dist/types-ts4.5/index.d.ts +3 -2
- package/dist/types-ts4.5/{plugin.d.ts → mentionsPlugin.d.ts} +1 -1
- package/dist/types-ts4.5/mentionsPluginType.d.ts +23 -0
- package/dist/types-ts4.5/{types.d.ts → types/index.d.ts} +1 -22
- package/dist/types-ts4.5/ui/SecondaryToolbarComponent.d.ts +1 -1
- package/dist/types-ts4.5/{analytics.d.ts → ui/type-ahead/analytics.d.ts} +1 -1
- package/dist/{types → types-ts4.5/ui}/type-ahead/index.d.ts +2 -1
- package/package.json +7 -7
- /package/dist/cjs/{types.js → types/index.js} +0 -0
- /package/dist/cjs/{analytics.js → ui/type-ahead/analytics.js} +0 -0
- /package/dist/es2019/{types.js → types/index.js} +0 -0
- /package/dist/es2019/{analytics.js → ui/type-ahead/analytics.js} +0 -0
- /package/dist/esm/{types.js → types/index.js} +0 -0
- /package/dist/esm/{analytics.js → ui/type-ahead/analytics.js} +0 -0
- /package/dist/types/{utils.d.ts → ui/type-ahead/utils.d.ts} +0 -0
- /package/dist/types-ts4.5/{utils.d.ts → ui/type-ahead/utils.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
2
|
|
|
3
|
+
## 2.10.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#171350](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171350)
|
|
8
|
+
[`436dfb28a4833`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/436dfb28a4833) -
|
|
9
|
+
[ux] Support disabled type-ahead items while user is offline for media, emoji, and mentions.
|
|
10
|
+
- [#170868](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/170868)
|
|
11
|
+
[`ed6ece7d3c533`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ed6ece7d3c533) -
|
|
12
|
+
ED-25814: refactors plugins to meet folder standards
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 2.10.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "mentionsPlugin", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _mentionsPlugin.mentionsPlugin;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var
|
|
12
|
+
var _mentionsPlugin = require("./mentionsPlugin");
|
|
@@ -14,8 +14,8 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
14
14
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
15
15
|
var _key = require("./pm-plugins/key");
|
|
16
16
|
var _main = require("./pm-plugins/main");
|
|
17
|
-
var _typeAhead = require("./type-ahead");
|
|
18
17
|
var _SecondaryToolbarComponent = require("./ui/SecondaryToolbarComponent");
|
|
18
|
+
var _typeAhead = require("./ui/type-ahead");
|
|
19
19
|
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; }
|
|
20
20
|
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) { (0, _defineProperty2.default)(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; }
|
|
21
21
|
var mentionsPlugin = exports.mentionsPlugin = function mentionsPlugin(_ref) {
|
|
@@ -100,6 +100,7 @@ var mentionsPlugin = exports.mentionsPlugin = function mentionsPlugin(_ref) {
|
|
|
100
100
|
keywords: ['team', 'user'],
|
|
101
101
|
priority: 400,
|
|
102
102
|
keyshortcut: '@',
|
|
103
|
+
isDisabledOffline: true,
|
|
103
104
|
icon: function icon() {
|
|
104
105
|
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconMention, null);
|
|
105
106
|
},
|
|
@@ -23,7 +23,7 @@ var ACTIONS = {
|
|
|
23
23
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
24
24
|
};
|
|
25
25
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
26
|
-
var PACKAGE_VERSION = "2.10.
|
|
26
|
+
var PACKAGE_VERSION = "2.10.5";
|
|
27
27
|
var setProvider = function setProvider(provider) {
|
|
28
28
|
return function (state, dispatch) {
|
|
29
29
|
if (dispatch) {
|
|
@@ -53,32 +53,35 @@ var InviteItem = function InviteItem(_ref) {
|
|
|
53
53
|
onMount();
|
|
54
54
|
}
|
|
55
55
|
}, [onMount]);
|
|
56
|
-
return (
|
|
57
|
-
// eslint-disable-next-line
|
|
58
|
-
|
|
59
|
-
onMouseDown: onSelected,
|
|
60
|
-
onMouseEnter: onItemMouseEnter,
|
|
61
|
-
"data-id": INVITE_ITEM_DESCRIPTION.id
|
|
62
|
-
}, (0, _react2.jsx)("div", {
|
|
63
|
-
css: _styles.rowStyle
|
|
64
|
-
}, (0, _react2.jsx)("span", {
|
|
65
|
-
css: _styles.avatarStyle
|
|
66
|
-
}, (0, _react2.jsx)(_add.default, {
|
|
67
|
-
label: intl.formatMessage(_messages.mentionMessages.mentionsAddLabel),
|
|
68
|
-
primaryColor: "var(--ds-icon-subtle, ".concat(_colors.N300, ")")
|
|
69
|
-
})), (0, _react2.jsx)("div", {
|
|
70
|
-
css: _styles.nameSectionStyle,
|
|
71
|
-
"data-testid": "name-section"
|
|
72
|
-
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.mentionMessages.inviteItemTitle, {
|
|
73
|
-
values: {
|
|
74
|
-
userRole: userRole || 'basic',
|
|
75
|
-
productName:
|
|
56
|
+
return (
|
|
57
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
58
|
+
(0, _react2.jsx)("div", {
|
|
76
59
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
60
|
+
css: [_styles.mentionItemStyle, selected && _styles.mentionItemSelectedStyle],
|
|
61
|
+
onMouseDown: onSelected,
|
|
62
|
+
onMouseEnter: onItemMouseEnter,
|
|
63
|
+
"data-id": INVITE_ITEM_DESCRIPTION.id
|
|
64
|
+
}, (0, _react2.jsx)("div", {
|
|
65
|
+
css: _styles.rowStyle
|
|
66
|
+
}, (0, _react2.jsx)("span", {
|
|
67
|
+
css: _styles.avatarStyle
|
|
68
|
+
}, (0, _react2.jsx)(_add.default, {
|
|
69
|
+
label: intl.formatMessage(_messages.mentionMessages.mentionsAddLabel),
|
|
70
|
+
primaryColor: "var(--ds-icon-subtle, ".concat(_colors.N300, ")")
|
|
71
|
+
})), (0, _react2.jsx)("div", {
|
|
72
|
+
css: _styles.nameSectionStyle,
|
|
73
|
+
"data-testid": "name-section"
|
|
74
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.mentionMessages.inviteItemTitle, {
|
|
75
|
+
values: {
|
|
76
|
+
userRole: userRole || 'basic',
|
|
77
|
+
productName:
|
|
78
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
79
|
+
(0, _react2.jsx)("span", {
|
|
80
|
+
css: _styles.capitalizedStyle,
|
|
81
|
+
"data-testid": "capitalized-message"
|
|
82
|
+
}, productName)
|
|
83
|
+
}
|
|
84
|
+
})))))
|
|
85
|
+
);
|
|
83
86
|
};
|
|
84
87
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(InviteItem);
|
|
@@ -19,10 +19,10 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
|
19
19
|
var _item = require("@atlaskit/mention/item");
|
|
20
20
|
var _resource = require("@atlaskit/mention/resource");
|
|
21
21
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var _utils4 = require("
|
|
22
|
+
var _utils3 = require("../../pm-plugins/utils");
|
|
23
|
+
var _InviteItem = _interopRequireWildcard(require("../InviteItem"));
|
|
24
|
+
var _analytics = require("./analytics");
|
|
25
|
+
var _utils4 = require("./utils");
|
|
26
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
27
27
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
28
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.shouldKeepInviteItem = exports.isTeamType = exports.isTeamStats = exports.isInviteItem = void 0;
|
|
7
|
-
var _InviteItem = require("
|
|
7
|
+
var _InviteItem = require("../InviteItem");
|
|
8
8
|
var isTeamType = exports.isTeamType = function isTeamType(userType) {
|
|
9
9
|
return userType === 'TEAM';
|
|
10
10
|
};
|
package/dist/es2019/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { mentionsPlugin } from './
|
|
1
|
+
export { mentionsPlugin } from './mentionsPlugin';
|
|
@@ -6,8 +6,8 @@ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/
|
|
|
6
6
|
import { IconMention } from '@atlaskit/editor-common/quick-insert';
|
|
7
7
|
import { mentionPluginKey } from './pm-plugins/key';
|
|
8
8
|
import { createMentionPlugin } from './pm-plugins/main';
|
|
9
|
-
import { createTypeAheadConfig } from './type-ahead';
|
|
10
9
|
import { SecondaryToolbarComponent } from './ui/SecondaryToolbarComponent';
|
|
10
|
+
import { createTypeAheadConfig } from './ui/type-ahead';
|
|
11
11
|
const mentionsPlugin = ({
|
|
12
12
|
config: options,
|
|
13
13
|
api
|
|
@@ -91,6 +91,7 @@ const mentionsPlugin = ({
|
|
|
91
91
|
keywords: ['team', 'user'],
|
|
92
92
|
priority: 400,
|
|
93
93
|
keyshortcut: '@',
|
|
94
|
+
isDisabledOffline: true,
|
|
94
95
|
icon: () => /*#__PURE__*/React.createElement(IconMention, null),
|
|
95
96
|
action(insert, state) {
|
|
96
97
|
var _api$typeAhead2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,7 +13,7 @@ const ACTIONS = {
|
|
|
13
13
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
14
14
|
};
|
|
15
15
|
const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
16
|
-
const PACKAGE_VERSION = "2.10.
|
|
16
|
+
const PACKAGE_VERSION = "2.10.5";
|
|
17
17
|
const setProvider = provider => (state, dispatch) => {
|
|
18
18
|
if (dispatch) {
|
|
19
19
|
dispatch(state.tr.setMeta(mentionPluginKey, {
|
|
@@ -44,32 +44,35 @@ const InviteItem = ({
|
|
|
44
44
|
onMount();
|
|
45
45
|
}
|
|
46
46
|
}, [onMount]);
|
|
47
|
-
return
|
|
48
|
-
// eslint-disable-next-line
|
|
49
|
-
|
|
50
|
-
onMouseDown: onSelected,
|
|
51
|
-
onMouseEnter: onItemMouseEnter,
|
|
52
|
-
"data-id": INVITE_ITEM_DESCRIPTION.id
|
|
53
|
-
}, jsx("div", {
|
|
54
|
-
css: rowStyle
|
|
55
|
-
}, jsx("span", {
|
|
56
|
-
css: avatarStyle
|
|
57
|
-
}, jsx(AddIcon, {
|
|
58
|
-
label: intl.formatMessage(messages.mentionsAddLabel),
|
|
59
|
-
primaryColor: `var(--ds-icon-subtle, ${N300})`
|
|
60
|
-
})), jsx("div", {
|
|
61
|
-
css: nameSectionStyle,
|
|
62
|
-
"data-testid": "name-section"
|
|
63
|
-
}, jsx(FormattedMessage, _extends({}, messages.inviteItemTitle, {
|
|
64
|
-
values: {
|
|
65
|
-
userRole: userRole || 'basic',
|
|
66
|
-
productName:
|
|
47
|
+
return (
|
|
48
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
49
|
+
jsx("div", {
|
|
67
50
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
51
|
+
css: [mentionItemStyle, selected && mentionItemSelectedStyle],
|
|
52
|
+
onMouseDown: onSelected,
|
|
53
|
+
onMouseEnter: onItemMouseEnter,
|
|
54
|
+
"data-id": INVITE_ITEM_DESCRIPTION.id
|
|
55
|
+
}, jsx("div", {
|
|
56
|
+
css: rowStyle
|
|
57
|
+
}, jsx("span", {
|
|
58
|
+
css: avatarStyle
|
|
59
|
+
}, jsx(AddIcon, {
|
|
60
|
+
label: intl.formatMessage(messages.mentionsAddLabel),
|
|
61
|
+
primaryColor: `var(--ds-icon-subtle, ${N300})`
|
|
62
|
+
})), jsx("div", {
|
|
63
|
+
css: nameSectionStyle,
|
|
64
|
+
"data-testid": "name-section"
|
|
65
|
+
}, jsx(FormattedMessage, _extends({}, messages.inviteItemTitle, {
|
|
66
|
+
values: {
|
|
67
|
+
userRole: userRole || 'basic',
|
|
68
|
+
productName:
|
|
69
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
70
|
+
jsx("span", {
|
|
71
|
+
css: capitalizedStyle,
|
|
72
|
+
"data-testid": "capitalized-message"
|
|
73
|
+
}, productName)
|
|
74
|
+
}
|
|
75
|
+
})))))
|
|
76
|
+
);
|
|
74
77
|
};
|
|
75
78
|
export default injectIntl(InviteItem);
|
|
@@ -7,10 +7,10 @@ import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
|
7
7
|
import { MENTION_ITEM_HEIGHT, MentionItem } from '@atlaskit/mention/item';
|
|
8
8
|
import { isResolvingMentionProvider } from '@atlaskit/mention/resource';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import { isInviteItem, isTeamStats, isTeamType, shouldKeepInviteItem } from '
|
|
10
|
+
import { getMentionPluginState } from '../../pm-plugins/utils';
|
|
11
|
+
import InviteItem, { INVITE_ITEM_DESCRIPTION } from '../InviteItem';
|
|
12
|
+
import { buildTypeAheadCancelPayload, buildTypeAheadInsertedPayload, buildTypeAheadInviteItemClickedPayload, buildTypeAheadInviteItemViewedPayload, buildTypeAheadRenderedPayload } from './analytics';
|
|
13
|
+
import { isInviteItem, isTeamStats, isTeamType, shouldKeepInviteItem } from './utils';
|
|
14
14
|
const createInviteItem = ({
|
|
15
15
|
mentionProvider,
|
|
16
16
|
onInviteItemMount
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INVITE_ITEM_DESCRIPTION } from '
|
|
1
|
+
import { INVITE_ITEM_DESCRIPTION } from '../InviteItem';
|
|
2
2
|
export const isTeamType = userType => userType === 'TEAM';
|
|
3
3
|
export const isTeamStats = stat => stat && !isNaN(stat.teamMentionDuration);
|
|
4
4
|
export const isInviteItem = mention => mention && mention.id === INVITE_ITEM_DESCRIPTION.id;
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { mentionsPlugin } from './
|
|
1
|
+
export { mentionsPlugin } from './mentionsPlugin';
|
|
@@ -9,8 +9,8 @@ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/
|
|
|
9
9
|
import { IconMention } from '@atlaskit/editor-common/quick-insert';
|
|
10
10
|
import { mentionPluginKey } from './pm-plugins/key';
|
|
11
11
|
import { createMentionPlugin } from './pm-plugins/main';
|
|
12
|
-
import { createTypeAheadConfig } from './type-ahead';
|
|
13
12
|
import { SecondaryToolbarComponent } from './ui/SecondaryToolbarComponent';
|
|
13
|
+
import { createTypeAheadConfig } from './ui/type-ahead';
|
|
14
14
|
var mentionsPlugin = function mentionsPlugin(_ref) {
|
|
15
15
|
var options = _ref.config,
|
|
16
16
|
api = _ref.api;
|
|
@@ -93,6 +93,7 @@ var mentionsPlugin = function mentionsPlugin(_ref) {
|
|
|
93
93
|
keywords: ['team', 'user'],
|
|
94
94
|
priority: 400,
|
|
95
95
|
keyshortcut: '@',
|
|
96
|
+
isDisabledOffline: true,
|
|
96
97
|
icon: function icon() {
|
|
97
98
|
return /*#__PURE__*/React.createElement(IconMention, null);
|
|
98
99
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,7 +16,7 @@ var ACTIONS = {
|
|
|
16
16
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
17
17
|
};
|
|
18
18
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
19
|
-
var PACKAGE_VERSION = "2.10.
|
|
19
|
+
var PACKAGE_VERSION = "2.10.5";
|
|
20
20
|
var setProvider = function setProvider(provider) {
|
|
21
21
|
return function (state, dispatch) {
|
|
22
22
|
if (dispatch) {
|
|
@@ -43,32 +43,35 @@ var InviteItem = function InviteItem(_ref) {
|
|
|
43
43
|
onMount();
|
|
44
44
|
}
|
|
45
45
|
}, [onMount]);
|
|
46
|
-
return
|
|
47
|
-
// eslint-disable-next-line
|
|
48
|
-
|
|
49
|
-
onMouseDown: onSelected,
|
|
50
|
-
onMouseEnter: onItemMouseEnter,
|
|
51
|
-
"data-id": INVITE_ITEM_DESCRIPTION.id
|
|
52
|
-
}, jsx("div", {
|
|
53
|
-
css: rowStyle
|
|
54
|
-
}, jsx("span", {
|
|
55
|
-
css: avatarStyle
|
|
56
|
-
}, jsx(AddIcon, {
|
|
57
|
-
label: intl.formatMessage(messages.mentionsAddLabel),
|
|
58
|
-
primaryColor: "var(--ds-icon-subtle, ".concat(N300, ")")
|
|
59
|
-
})), jsx("div", {
|
|
60
|
-
css: nameSectionStyle,
|
|
61
|
-
"data-testid": "name-section"
|
|
62
|
-
}, jsx(FormattedMessage, _extends({}, messages.inviteItemTitle, {
|
|
63
|
-
values: {
|
|
64
|
-
userRole: userRole || 'basic',
|
|
65
|
-
productName:
|
|
46
|
+
return (
|
|
47
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
48
|
+
jsx("div", {
|
|
66
49
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
50
|
+
css: [mentionItemStyle, selected && mentionItemSelectedStyle],
|
|
51
|
+
onMouseDown: onSelected,
|
|
52
|
+
onMouseEnter: onItemMouseEnter,
|
|
53
|
+
"data-id": INVITE_ITEM_DESCRIPTION.id
|
|
54
|
+
}, jsx("div", {
|
|
55
|
+
css: rowStyle
|
|
56
|
+
}, jsx("span", {
|
|
57
|
+
css: avatarStyle
|
|
58
|
+
}, jsx(AddIcon, {
|
|
59
|
+
label: intl.formatMessage(messages.mentionsAddLabel),
|
|
60
|
+
primaryColor: "var(--ds-icon-subtle, ".concat(N300, ")")
|
|
61
|
+
})), jsx("div", {
|
|
62
|
+
css: nameSectionStyle,
|
|
63
|
+
"data-testid": "name-section"
|
|
64
|
+
}, jsx(FormattedMessage, _extends({}, messages.inviteItemTitle, {
|
|
65
|
+
values: {
|
|
66
|
+
userRole: userRole || 'basic',
|
|
67
|
+
productName:
|
|
68
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
69
|
+
jsx("span", {
|
|
70
|
+
css: capitalizedStyle,
|
|
71
|
+
"data-testid": "capitalized-message"
|
|
72
|
+
}, productName)
|
|
73
|
+
}
|
|
74
|
+
})))))
|
|
75
|
+
);
|
|
73
76
|
};
|
|
74
77
|
export default injectIntl(InviteItem);
|
|
@@ -14,10 +14,10 @@ import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
|
14
14
|
import { MENTION_ITEM_HEIGHT, MentionItem } from '@atlaskit/mention/item';
|
|
15
15
|
import { isResolvingMentionProvider } from '@atlaskit/mention/resource';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import { isInviteItem, isTeamStats, isTeamType, shouldKeepInviteItem } from '
|
|
17
|
+
import { getMentionPluginState } from '../../pm-plugins/utils';
|
|
18
|
+
import InviteItem, { INVITE_ITEM_DESCRIPTION } from '../InviteItem';
|
|
19
|
+
import { buildTypeAheadCancelPayload, buildTypeAheadInsertedPayload, buildTypeAheadInviteItemClickedPayload, buildTypeAheadInviteItemViewedPayload, buildTypeAheadRenderedPayload } from './analytics';
|
|
20
|
+
import { isInviteItem, isTeamStats, isTeamType, shouldKeepInviteItem } from './utils';
|
|
21
21
|
var createInviteItem = function createInviteItem(_ref) {
|
|
22
22
|
var mentionProvider = _ref.mentionProvider,
|
|
23
23
|
onInviteItemMount = _ref.onInviteItemMount;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { mentionsPlugin } from './
|
|
2
|
-
export type {
|
|
1
|
+
export { mentionsPlugin } from './mentionsPlugin';
|
|
2
|
+
export type { MentionsPlugin } from './mentionsPluginType';
|
|
3
|
+
export type { MentionPluginConfig, MentionPluginOptions, MentionSharedState } from './types';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
4
|
+
import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
5
|
+
import type { MentionPluginOptions, MentionSharedState } from './types';
|
|
6
|
+
export type MentionsPlugin = NextEditorPlugin<'mention', {
|
|
7
|
+
pluginConfiguration: MentionPluginOptions | undefined;
|
|
8
|
+
dependencies: [
|
|
9
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
10
|
+
TypeAheadPlugin,
|
|
11
|
+
OptionalPlugin<ContextIdentifierPlugin>
|
|
12
|
+
];
|
|
13
|
+
sharedState: MentionSharedState | undefined;
|
|
14
|
+
actions: {
|
|
15
|
+
openTypeAhead: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
16
|
+
announceMentionsInsertion: (mentionIds: {
|
|
17
|
+
type: 'added' | 'deleted';
|
|
18
|
+
localId: string;
|
|
19
|
+
id: string;
|
|
20
|
+
taskLocalId?: string;
|
|
21
|
+
}[]) => void;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { type ProfilecardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
-
import type {
|
|
5
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
6
|
-
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
7
|
-
import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
4
|
+
import type { TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
8
5
|
import type { MentionDescription, MentionProvider } from '@atlaskit/mention';
|
|
9
6
|
export declare const MENTION_PROVIDER_REJECTED = "REJECTED";
|
|
10
7
|
export declare const MENTION_PROVIDER_UNDEFINED = "UNDEFINED";
|
|
@@ -37,21 +34,3 @@ export type FireElementsChannelEvent = (payload: AnalyticsEventPayload, channel?
|
|
|
37
34
|
export type MentionSharedState = MentionPluginState & {
|
|
38
35
|
typeAheadHandler: TypeAheadHandler;
|
|
39
36
|
};
|
|
40
|
-
export type MentionsPlugin = NextEditorPlugin<'mention', {
|
|
41
|
-
pluginConfiguration: MentionPluginOptions | undefined;
|
|
42
|
-
dependencies: [
|
|
43
|
-
OptionalPlugin<AnalyticsPlugin>,
|
|
44
|
-
TypeAheadPlugin,
|
|
45
|
-
OptionalPlugin<ContextIdentifierPlugin>
|
|
46
|
-
];
|
|
47
|
-
sharedState: MentionSharedState | undefined;
|
|
48
|
-
actions: {
|
|
49
|
-
openTypeAhead: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
50
|
-
announceMentionsInsertion: (mentionIds: {
|
|
51
|
-
type: 'added' | 'deleted';
|
|
52
|
-
localId: string;
|
|
53
|
-
id: string;
|
|
54
|
-
taskLocalId?: string;
|
|
55
|
-
}[]) => void;
|
|
56
|
-
};
|
|
57
|
-
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ExtractInjectionAPI, TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { MentionsPlugin } from '../
|
|
4
|
+
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
5
5
|
interface SecondaryToolbarComponentProps {
|
|
6
6
|
editorView: EditorView;
|
|
7
7
|
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
@@ -3,7 +3,7 @@ import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider
|
|
|
3
3
|
import type { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
4
4
|
import type { UserRole } from '@atlaskit/mention';
|
|
5
5
|
import type { MentionDescription } from '@atlaskit/mention/resource';
|
|
6
|
-
import type { TeamInfoAttrAnalytics } from '
|
|
6
|
+
import type { TeamInfoAttrAnalytics } from '../../types';
|
|
7
7
|
export declare const buildTypeAheadCancelPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, query?: string) => AnalyticsEventPayload;
|
|
8
8
|
export declare const buildTypeAheadInviteItemViewedPayload: (sessionId: string, contextIdentifierProvider?: ContextIdentifierProvider, userRole?: UserRole) => AnalyticsEventPayload;
|
|
9
9
|
export declare const buildTypeAheadInviteItemClickedPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, insertType: SelectItemMode, query?: string, contextIdentifierProvider?: ContextIdentifierProvider, userRole?: UserRole) => AnalyticsEventPayload;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExtractInjectionAPI, TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MentionDescription } from '@atlaskit/mention/resource';
|
|
4
|
-
import type {
|
|
4
|
+
import type { MentionsPlugin } from '../../mentionsPluginType';
|
|
5
|
+
import type { FireElementsChannelEvent } from '../../types';
|
|
5
6
|
export declare const mentionToTypeaheadItem: (mention: MentionDescription) => TypeAheadItem;
|
|
6
7
|
export declare function memoize<ResultFn extends (mention: MentionDescription) => TypeAheadItem>(fn: ResultFn): {
|
|
7
8
|
call: ResultFn;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { mentionsPlugin } from './
|
|
2
|
-
export type {
|
|
1
|
+
export { mentionsPlugin } from './mentionsPlugin';
|
|
2
|
+
export type { MentionsPlugin } from './mentionsPluginType';
|
|
3
|
+
export type { MentionPluginConfig, MentionPluginOptions, MentionSharedState } from './types';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
4
|
+
import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
5
|
+
import type { MentionPluginOptions, MentionSharedState } from './types';
|
|
6
|
+
export type MentionsPlugin = NextEditorPlugin<'mention', {
|
|
7
|
+
pluginConfiguration: MentionPluginOptions | undefined;
|
|
8
|
+
dependencies: [
|
|
9
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
10
|
+
TypeAheadPlugin,
|
|
11
|
+
OptionalPlugin<ContextIdentifierPlugin>
|
|
12
|
+
];
|
|
13
|
+
sharedState: MentionSharedState | undefined;
|
|
14
|
+
actions: {
|
|
15
|
+
openTypeAhead: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
16
|
+
announceMentionsInsertion: (mentionIds: {
|
|
17
|
+
type: 'added' | 'deleted';
|
|
18
|
+
localId: string;
|
|
19
|
+
id: string;
|
|
20
|
+
taskLocalId?: string;
|
|
21
|
+
}[]) => void;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { type ProfilecardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
-
import type {
|
|
5
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
6
|
-
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
7
|
-
import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
4
|
+
import type { TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
8
5
|
import type { MentionDescription, MentionProvider } from '@atlaskit/mention';
|
|
9
6
|
export declare const MENTION_PROVIDER_REJECTED = "REJECTED";
|
|
10
7
|
export declare const MENTION_PROVIDER_UNDEFINED = "UNDEFINED";
|
|
@@ -37,21 +34,3 @@ export type FireElementsChannelEvent = (payload: AnalyticsEventPayload, channel?
|
|
|
37
34
|
export type MentionSharedState = MentionPluginState & {
|
|
38
35
|
typeAheadHandler: TypeAheadHandler;
|
|
39
36
|
};
|
|
40
|
-
export type MentionsPlugin = NextEditorPlugin<'mention', {
|
|
41
|
-
pluginConfiguration: MentionPluginOptions | undefined;
|
|
42
|
-
dependencies: [
|
|
43
|
-
OptionalPlugin<AnalyticsPlugin>,
|
|
44
|
-
TypeAheadPlugin,
|
|
45
|
-
OptionalPlugin<ContextIdentifierPlugin>
|
|
46
|
-
];
|
|
47
|
-
sharedState: MentionSharedState | undefined;
|
|
48
|
-
actions: {
|
|
49
|
-
openTypeAhead: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
50
|
-
announceMentionsInsertion: (mentionIds: {
|
|
51
|
-
type: 'added' | 'deleted';
|
|
52
|
-
localId: string;
|
|
53
|
-
id: string;
|
|
54
|
-
taskLocalId?: string;
|
|
55
|
-
}[]) => void;
|
|
56
|
-
};
|
|
57
|
-
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ExtractInjectionAPI, TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { MentionsPlugin } from '../
|
|
4
|
+
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
5
5
|
interface SecondaryToolbarComponentProps {
|
|
6
6
|
editorView: EditorView;
|
|
7
7
|
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
@@ -3,7 +3,7 @@ import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider
|
|
|
3
3
|
import type { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
4
4
|
import type { UserRole } from '@atlaskit/mention';
|
|
5
5
|
import type { MentionDescription } from '@atlaskit/mention/resource';
|
|
6
|
-
import type { TeamInfoAttrAnalytics } from '
|
|
6
|
+
import type { TeamInfoAttrAnalytics } from '../../types';
|
|
7
7
|
export declare const buildTypeAheadCancelPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, query?: string) => AnalyticsEventPayload;
|
|
8
8
|
export declare const buildTypeAheadInviteItemViewedPayload: (sessionId: string, contextIdentifierProvider?: ContextIdentifierProvider, userRole?: UserRole) => AnalyticsEventPayload;
|
|
9
9
|
export declare const buildTypeAheadInviteItemClickedPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, insertType: SelectItemMode, query?: string, contextIdentifierProvider?: ContextIdentifierProvider, userRole?: UserRole) => AnalyticsEventPayload;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExtractInjectionAPI, TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MentionDescription } from '@atlaskit/mention/resource';
|
|
4
|
-
import type {
|
|
4
|
+
import type { MentionsPlugin } from '../../mentionsPluginType';
|
|
5
|
+
import type { FireElementsChannelEvent } from '../../types';
|
|
5
6
|
export declare const mentionToTypeaheadItem: (mention: MentionDescription) => TypeAheadItem;
|
|
6
7
|
export declare function memoize<ResultFn extends (mention: MentionDescription) => TypeAheadItem>(fn: ResultFn): {
|
|
7
8
|
call: ResultFn;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-mentions",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.5",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
|
-
"@atlaskit/editor-common": "^95.
|
|
35
|
+
"@atlaskit/editor-common": "^95.10.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-context-identifier": "^1.3.0",
|
|
38
|
-
"@atlaskit/editor-plugin-type-ahead": "^1.
|
|
39
|
-
"@atlaskit/editor-prosemirror": "6.
|
|
40
|
-
"@atlaskit/icon": "^22.
|
|
38
|
+
"@atlaskit/editor-plugin-type-ahead": "^1.11.0",
|
|
39
|
+
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
40
|
+
"@atlaskit/icon": "^22.28.0",
|
|
41
41
|
"@atlaskit/mention": "^23.4.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
43
43
|
"@atlaskit/theme": "^14.0.0",
|
|
44
|
-
"@atlaskit/tokens": "^2.
|
|
44
|
+
"@atlaskit/tokens": "^2.4.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@emotion/react": "^11.7.1",
|
|
47
47
|
"uuid": "^3.1.0"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"techstack": {
|
|
63
63
|
"@atlassian/frontend": {
|
|
64
64
|
"code-structure": [
|
|
65
|
-
"
|
|
65
|
+
"editor-plugin"
|
|
66
66
|
],
|
|
67
67
|
"import-structure": [
|
|
68
68
|
"atlassian-conventions"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|