@atlaskit/editor-plugin-mentions 2.10.7 → 2.10.9
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/pm-plugins/main.js +7 -2
- package/dist/cjs/ui/InviteItem/index.js +15 -3
- package/dist/cjs/ui/Mention/index.js +6 -0
- package/dist/cjs/ui/ToolbarMention/index.js +8 -9
- package/dist/cjs/ui/type-ahead/analytics.js +16 -4
- package/dist/cjs/ui/type-ahead/index.js +14 -2
- package/dist/cjs/ui/type-ahead/utils.js +7 -0
- package/dist/es2019/index.js +3 -0
- package/dist/es2019/mentionsPlugin.js +1 -1
- package/dist/es2019/pm-plugins/main.js +7 -2
- package/dist/es2019/ui/InviteItem/index.js +15 -3
- package/dist/es2019/ui/Mention/index.js +6 -0
- package/dist/es2019/ui/ToolbarMention/index.js +2 -0
- package/dist/es2019/ui/type-ahead/analytics.js +16 -4
- package/dist/es2019/ui/type-ahead/index.js +15 -3
- package/dist/es2019/ui/type-ahead/utils.js +9 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/pm-plugins/main.js +7 -2
- package/dist/esm/ui/InviteItem/index.js +15 -3
- package/dist/esm/ui/Mention/index.js +6 -0
- package/dist/esm/ui/ToolbarMention/index.js +8 -9
- package/dist/esm/ui/type-ahead/analytics.js +16 -4
- package/dist/esm/ui/type-ahead/index.js +14 -2
- package/dist/esm/ui/type-ahead/utils.js +8 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -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.9";
|
|
27
27
|
var setProvider = function setProvider(provider) {
|
|
28
28
|
return function (state, dispatch) {
|
|
29
29
|
if (dispatch) {
|
|
@@ -39,7 +39,10 @@ var setProvider = function setProvider(provider) {
|
|
|
39
39
|
};
|
|
40
40
|
function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
|
|
41
41
|
var mentionProvider;
|
|
42
|
-
var sendAnalytics = function sendAnalytics(event, actionSubject, action, attributes
|
|
42
|
+
var sendAnalytics = function sendAnalytics(event, actionSubject, action, attributes
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
45
|
+
) {
|
|
43
46
|
if (event === _resource.SLI_EVENT_TYPE || event === _resource.SMART_EVENT_TYPE) {
|
|
44
47
|
fireEvent({
|
|
45
48
|
action: action,
|
|
@@ -62,6 +65,8 @@ function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
|
|
|
62
65
|
canInsertMention: canInsertMention
|
|
63
66
|
};
|
|
64
67
|
},
|
|
68
|
+
// Ignored via go/ees005
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
65
70
|
apply: function apply(tr, pluginState, oldState, newState) {
|
|
66
71
|
var _ref = tr.getMeta(_key.mentionPluginKey) || {
|
|
67
72
|
action: null,
|
|
@@ -26,6 +26,9 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
26
26
|
var INVITE_ITEM_DESCRIPTION = exports.INVITE_ITEM_DESCRIPTION = {
|
|
27
27
|
id: 'invite-teammate'
|
|
28
28
|
};
|
|
29
|
+
|
|
30
|
+
// Ignored via go/ees005
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
32
|
var leftClick = function leftClick(event) {
|
|
30
33
|
return event.button === 0 && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;
|
|
31
34
|
};
|
|
@@ -37,13 +40,19 @@ var InviteItem = function InviteItem(_ref) {
|
|
|
37
40
|
selected = _ref.selected,
|
|
38
41
|
userRole = _ref.userRole,
|
|
39
42
|
intl = _ref.intl;
|
|
40
|
-
var onSelected = (0, _react.useCallback)(
|
|
43
|
+
var onSelected = (0, _react.useCallback)(
|
|
44
|
+
// Ignored via go/ees005
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
function (event) {
|
|
41
47
|
if (leftClick(event) && onSelection) {
|
|
42
48
|
event.preventDefault();
|
|
43
49
|
onSelection(INVITE_ITEM_DESCRIPTION, event);
|
|
44
50
|
}
|
|
45
51
|
}, [onSelection]);
|
|
46
|
-
var onItemMouseEnter = (0, _react.useCallback)(
|
|
52
|
+
var onItemMouseEnter = (0, _react.useCallback)(
|
|
53
|
+
// Ignored via go/ees005
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
+
function (event) {
|
|
47
56
|
if (onMouseEnter) {
|
|
48
57
|
onMouseEnter(INVITE_ITEM_DESCRIPTION, event);
|
|
49
58
|
}
|
|
@@ -71,7 +80,10 @@ var InviteItem = function InviteItem(_ref) {
|
|
|
71
80
|
})), (0, _react2.jsx)("div", {
|
|
72
81
|
css: _styles.nameSectionStyle,
|
|
73
82
|
"data-testid": "name-section"
|
|
74
|
-
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
|
|
83
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
|
|
84
|
+
// Ignored via go/ees005
|
|
85
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
86
|
+
, (0, _extends2.default)({}, _messages.mentionMessages.inviteItemTitle, {
|
|
75
87
|
values: {
|
|
76
88
|
userRole: userRole || 'basic',
|
|
77
89
|
productName:
|
|
@@ -97,6 +97,8 @@ var Mention = exports.Mention = function Mention(props) {
|
|
|
97
97
|
}, []);
|
|
98
98
|
var actionHandlers = {};
|
|
99
99
|
['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(function (handler) {
|
|
100
|
+
// Ignored via go/ees005
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
102
|
actionHandlers[handler] = eventHandlers && eventHandlers[handler] || function () {};
|
|
101
103
|
});
|
|
102
104
|
if (profilecardProvider) {
|
|
@@ -108,6 +110,8 @@ var Mention = exports.Mention = function Mention(props) {
|
|
|
108
110
|
mentionProvider: mentionProvider,
|
|
109
111
|
profilecardProvider: profilecardProvider,
|
|
110
112
|
localId: localId
|
|
113
|
+
// Ignored via go/ees005
|
|
114
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
111
115
|
}, actionHandlers));
|
|
112
116
|
} else {
|
|
113
117
|
return /*#__PURE__*/_react.default.createElement(_element.ResourcedMention, (0, _extends2.default)({
|
|
@@ -116,6 +120,8 @@ var Mention = exports.Mention = function Mention(props) {
|
|
|
116
120
|
accessLevel: accessLevel,
|
|
117
121
|
mentionProvider: mentionProvider,
|
|
118
122
|
localId: localId
|
|
123
|
+
// Ignored via go/ees005
|
|
124
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
119
125
|
}, actionHandlers));
|
|
120
126
|
}
|
|
121
127
|
};
|
|
@@ -8,10 +8,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
16
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -20,19 +19,19 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
|
20
19
|
var _mention = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/mention"));
|
|
21
20
|
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); }
|
|
22
21
|
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; }
|
|
23
|
-
function
|
|
22
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
24
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
|
+
// Ignored via go/ees005
|
|
25
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
25
26
|
var ToolbarMention = /*#__PURE__*/function (_PureComponent) {
|
|
26
|
-
(0, _inherits2.default)(ToolbarMention, _PureComponent);
|
|
27
|
-
var _super = _createSuper(ToolbarMention);
|
|
28
27
|
function ToolbarMention() {
|
|
29
28
|
var _this;
|
|
30
29
|
(0, _classCallCheck2.default)(this, ToolbarMention);
|
|
31
30
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32
31
|
args[_key] = arguments[_key];
|
|
33
32
|
}
|
|
34
|
-
_this =
|
|
35
|
-
(0, _defineProperty2.default)(
|
|
33
|
+
_this = _callSuper(this, ToolbarMention, [].concat(args));
|
|
34
|
+
(0, _defineProperty2.default)(_this, "handleInsertMention", function () {
|
|
36
35
|
if (!_this.props.editorView) {
|
|
37
36
|
return false;
|
|
38
37
|
}
|
|
@@ -41,7 +40,8 @@ var ToolbarMention = /*#__PURE__*/function (_PureComponent) {
|
|
|
41
40
|
});
|
|
42
41
|
return _this;
|
|
43
42
|
}
|
|
44
|
-
(0,
|
|
43
|
+
(0, _inherits2.default)(ToolbarMention, _PureComponent);
|
|
44
|
+
return (0, _createClass2.default)(ToolbarMention, [{
|
|
45
45
|
key: "render",
|
|
46
46
|
value: function render() {
|
|
47
47
|
var mentionStringTranslated = this.props.intl.formatMessage(_messages.mentionMessages.mentionsIconLabel);
|
|
@@ -58,6 +58,5 @@ var ToolbarMention = /*#__PURE__*/function (_PureComponent) {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
}]);
|
|
61
|
-
return ToolbarMention;
|
|
62
61
|
}(_react.PureComponent);
|
|
63
62
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(ToolbarMention);
|
|
@@ -21,7 +21,10 @@ var extractAttributesFromQuery = function extractAttributesFromQuery(query) {
|
|
|
21
21
|
}
|
|
22
22
|
return emptyQueryResponse;
|
|
23
23
|
};
|
|
24
|
-
var buildTypeAheadCancelPayload = exports.buildTypeAheadCancelPayload = function buildTypeAheadCancelPayload(duration, upKeyCount, downKeyCount, sessionId, query
|
|
24
|
+
var buildTypeAheadCancelPayload = exports.buildTypeAheadCancelPayload = function buildTypeAheadCancelPayload(duration, upKeyCount, downKeyCount, sessionId, query
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
27
|
+
) {
|
|
25
28
|
var _extractAttributesFro = extractAttributesFromQuery(query),
|
|
26
29
|
queryLength = _extractAttributesFro.queryLength,
|
|
27
30
|
spaceInQuery = _extractAttributesFro.spaceInQuery;
|
|
@@ -71,7 +74,10 @@ var buildTypeAheadInviteItemViewedPayload = exports.buildTypeAheadInviteItemView
|
|
|
71
74
|
}
|
|
72
75
|
};
|
|
73
76
|
};
|
|
74
|
-
var buildTypeAheadInviteItemClickedPayload = exports.buildTypeAheadInviteItemClickedPayload = function buildTypeAheadInviteItemClickedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, query, contextIdentifierProvider, userRole
|
|
77
|
+
var buildTypeAheadInviteItemClickedPayload = exports.buildTypeAheadInviteItemClickedPayload = function buildTypeAheadInviteItemClickedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, query, contextIdentifierProvider, userRole
|
|
78
|
+
// Ignored via go/ees005
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
80
|
+
) {
|
|
75
81
|
var _extractAttributesFro2 = extractAttributesFromQuery(query),
|
|
76
82
|
queryLength = _extractAttributesFro2.queryLength,
|
|
77
83
|
spaceInQuery = _extractAttributesFro2.spaceInQuery;
|
|
@@ -99,7 +105,10 @@ var buildTypeAheadInviteItemClickedPayload = exports.buildTypeAheadInviteItemCli
|
|
|
99
105
|
}
|
|
100
106
|
};
|
|
101
107
|
};
|
|
102
|
-
var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId
|
|
108
|
+
var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId
|
|
109
|
+
// Ignored via go/ees005
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
111
|
+
) {
|
|
103
112
|
var _extractAttributesFro3 = extractAttributesFromQuery(query),
|
|
104
113
|
queryLength = _extractAttributesFro3.queryLength,
|
|
105
114
|
spaceInQuery = _extractAttributesFro3.spaceInQuery;
|
|
@@ -140,7 +149,10 @@ var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = func
|
|
|
140
149
|
}
|
|
141
150
|
};
|
|
142
151
|
};
|
|
143
|
-
var buildTypeAheadRenderedPayload = exports.buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams
|
|
152
|
+
var buildTypeAheadRenderedPayload = exports.buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams
|
|
153
|
+
// Ignored via go/ees005
|
|
154
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
155
|
+
) {
|
|
144
156
|
var _extractAttributesFro4 = extractAttributesFromQuery(query),
|
|
145
157
|
queryLength = _extractAttributesFro4.queryLength,
|
|
146
158
|
spaceInQuery = _extractAttributesFro4.spaceInQuery;
|
|
@@ -133,7 +133,11 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
|
|
|
133
133
|
teams = mentions.map(function (mention) {
|
|
134
134
|
return (0, _utils4.isTeamType)(mention.userType) ? {
|
|
135
135
|
teamId: mention.id,
|
|
136
|
+
// Ignored via go/ees005
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
136
138
|
includesYou: mention.context.includesYou,
|
|
139
|
+
// Ignored via go/ees005
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
137
141
|
memberCount: mention.context.memberCount
|
|
138
142
|
} : null;
|
|
139
143
|
}).filter(function (m) {
|
|
@@ -149,7 +153,10 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
|
|
|
149
153
|
* When a team mention is selected, we render a team link and list of member/user mentions
|
|
150
154
|
* in editor content
|
|
151
155
|
*/
|
|
152
|
-
var buildNodesForTeamMention = function buildNodesForTeamMention(schema, selectedMention, mentionProvider, sanitizePrivateContent
|
|
156
|
+
var buildNodesForTeamMention = function buildNodesForTeamMention(schema, selectedMention, mentionProvider, sanitizePrivateContent
|
|
157
|
+
// Ignored via go/ees005
|
|
158
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
159
|
+
) {
|
|
153
160
|
var nodes = schema.nodes,
|
|
154
161
|
marks = schema.marks;
|
|
155
162
|
var name = selectedMention.name,
|
|
@@ -162,7 +169,10 @@ var buildNodesForTeamMention = function buildNodesForTeamMention(schema, selecte
|
|
|
162
169
|
var teamLink = context && context.teamLink ? context.teamLink : defaultTeamLink;
|
|
163
170
|
var teamLinkNode = (0, _platformFeatureFlags.fg)('team-mention-inline-smartlink') ? schema.nodes.inlineCard.create({
|
|
164
171
|
url: teamLink
|
|
165
|
-
}) :
|
|
172
|
+
}) :
|
|
173
|
+
// Ignored via go/ees005
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
175
|
+
schema.text(name, [marks.link.create({
|
|
166
176
|
href: teamLink
|
|
167
177
|
})]);
|
|
168
178
|
var openBracketText = schema.text('(');
|
|
@@ -273,6 +283,8 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
273
283
|
onOpen: function onOpen() {
|
|
274
284
|
firstQueryWithoutResults = null;
|
|
275
285
|
},
|
|
286
|
+
// Ignored via go/ees005
|
|
287
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
276
288
|
selectItem: function selectItem(state, item, insert, _ref9) {
|
|
277
289
|
var _api$contextIdentifie3, _api$contextIdentifie4;
|
|
278
290
|
var mode = _ref9.mode,
|
|
@@ -5,9 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.shouldKeepInviteItem = exports.isTeamType = exports.isTeamStats = exports.isInviteItem = void 0;
|
|
7
7
|
var _InviteItem = require("../InviteItem");
|
|
8
|
+
// Ignored via go/ees005
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
10
|
var isTeamType = exports.isTeamType = function isTeamType(userType) {
|
|
9
11
|
return userType === 'TEAM';
|
|
10
12
|
};
|
|
13
|
+
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
16
|
var isTeamStats = exports.isTeamStats = function isTeamStats(stat) {
|
|
12
17
|
return stat && !isNaN(stat.teamMentionDuration);
|
|
13
18
|
};
|
|
@@ -27,6 +32,8 @@ var shouldKeepInviteItem = exports.shouldKeepInviteItem = function shouldKeepInv
|
|
|
27
32
|
if (query[lastIndexWithResults - 1] === ' ') {
|
|
28
33
|
suffix = ' ' + suffix;
|
|
29
34
|
}
|
|
35
|
+
// Ignored via go/ees005
|
|
36
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
30
37
|
var depletedExtraWords = /\s[^\s]+\s/.test(suffix);
|
|
31
38
|
return !depletedExtraWords;
|
|
32
39
|
};
|
package/dist/es2019/index.js
CHANGED
|
@@ -12,7 +12,7 @@ const mentionsPlugin = ({
|
|
|
12
12
|
config: options,
|
|
13
13
|
api
|
|
14
14
|
}) => {
|
|
15
|
-
|
|
15
|
+
const sessionId = uuid();
|
|
16
16
|
const fireEvent = (payload, channel) => {
|
|
17
17
|
var _api$analytics, _api$analytics$action;
|
|
18
18
|
const fireAnalyticsEvent = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent;
|
|
@@ -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.9";
|
|
17
17
|
const setProvider = provider => (state, dispatch) => {
|
|
18
18
|
if (dispatch) {
|
|
19
19
|
dispatch(state.tr.setMeta(mentionPluginKey, {
|
|
@@ -27,7 +27,10 @@ const setProvider = provider => (state, dispatch) => {
|
|
|
27
27
|
};
|
|
28
28
|
export function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
|
|
29
29
|
let mentionProvider;
|
|
30
|
-
const sendAnalytics = (event, actionSubject, action, attributes
|
|
30
|
+
const sendAnalytics = (event, actionSubject, action, attributes
|
|
31
|
+
// Ignored via go/ees005
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
33
|
+
) => {
|
|
31
34
|
if (event === SLI_EVENT_TYPE || event === SMART_EVENT_TYPE) {
|
|
32
35
|
fireEvent({
|
|
33
36
|
action: action,
|
|
@@ -51,6 +54,8 @@ export function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
|
|
|
51
54
|
canInsertMention
|
|
52
55
|
};
|
|
53
56
|
},
|
|
57
|
+
// Ignored via go/ees005
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
54
59
|
apply(tr, pluginState, oldState, newState) {
|
|
55
60
|
const {
|
|
56
61
|
action,
|
|
@@ -16,6 +16,9 @@ import { avatarStyle, capitalizedStyle, mentionItemSelectedStyle, mentionItemSty
|
|
|
16
16
|
export const INVITE_ITEM_DESCRIPTION = {
|
|
17
17
|
id: 'invite-teammate'
|
|
18
18
|
};
|
|
19
|
+
|
|
20
|
+
// Ignored via go/ees005
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
22
|
const leftClick = event => {
|
|
20
23
|
return event.button === 0 && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;
|
|
21
24
|
};
|
|
@@ -28,13 +31,19 @@ const InviteItem = ({
|
|
|
28
31
|
userRole,
|
|
29
32
|
intl
|
|
30
33
|
}) => {
|
|
31
|
-
const onSelected = useCallback(
|
|
34
|
+
const onSelected = useCallback(
|
|
35
|
+
// Ignored via go/ees005
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
event => {
|
|
32
38
|
if (leftClick(event) && onSelection) {
|
|
33
39
|
event.preventDefault();
|
|
34
40
|
onSelection(INVITE_ITEM_DESCRIPTION, event);
|
|
35
41
|
}
|
|
36
42
|
}, [onSelection]);
|
|
37
|
-
const onItemMouseEnter = useCallback(
|
|
43
|
+
const onItemMouseEnter = useCallback(
|
|
44
|
+
// Ignored via go/ees005
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
event => {
|
|
38
47
|
if (onMouseEnter) {
|
|
39
48
|
onMouseEnter(INVITE_ITEM_DESCRIPTION, event);
|
|
40
49
|
}
|
|
@@ -62,7 +71,10 @@ const InviteItem = ({
|
|
|
62
71
|
})), jsx("div", {
|
|
63
72
|
css: nameSectionStyle,
|
|
64
73
|
"data-testid": "name-section"
|
|
65
|
-
}, jsx(FormattedMessage
|
|
74
|
+
}, jsx(FormattedMessage
|
|
75
|
+
// Ignored via go/ees005
|
|
76
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
77
|
+
, _extends({}, messages.inviteItemTitle, {
|
|
66
78
|
values: {
|
|
67
79
|
userRole: userRole || 'basic',
|
|
68
80
|
productName:
|
|
@@ -64,6 +64,8 @@ export const Mention = props => {
|
|
|
64
64
|
}, []);
|
|
65
65
|
const actionHandlers = {};
|
|
66
66
|
['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(handler => {
|
|
67
|
+
// Ignored via go/ees005
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
69
|
actionHandlers[handler] = eventHandlers && eventHandlers[handler] || (() => {});
|
|
68
70
|
});
|
|
69
71
|
if (profilecardProvider) {
|
|
@@ -75,6 +77,8 @@ export const Mention = props => {
|
|
|
75
77
|
mentionProvider: mentionProvider,
|
|
76
78
|
profilecardProvider: profilecardProvider,
|
|
77
79
|
localId: localId
|
|
80
|
+
// Ignored via go/ees005
|
|
81
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
78
82
|
}, actionHandlers));
|
|
79
83
|
} else {
|
|
80
84
|
return /*#__PURE__*/React.createElement(ResourcedMention, _extends({
|
|
@@ -83,6 +87,8 @@ export const Mention = props => {
|
|
|
83
87
|
accessLevel: accessLevel,
|
|
84
88
|
mentionProvider: mentionProvider,
|
|
85
89
|
localId: localId
|
|
90
|
+
// Ignored via go/ees005
|
|
91
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
86
92
|
}, actionHandlers));
|
|
87
93
|
}
|
|
88
94
|
};
|
|
@@ -4,6 +4,8 @@ import { injectIntl } from 'react-intl-next';
|
|
|
4
4
|
import { mentionMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
6
6
|
import MentionIcon from '@atlaskit/icon/glyph/editor/mention';
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
7
9
|
class ToolbarMention extends PureComponent {
|
|
8
10
|
constructor(...args) {
|
|
9
11
|
super(...args);
|
|
@@ -15,7 +15,10 @@ const extractAttributesFromQuery = query => {
|
|
|
15
15
|
}
|
|
16
16
|
return emptyQueryResponse;
|
|
17
17
|
};
|
|
18
|
-
export const buildTypeAheadCancelPayload = (duration, upKeyCount, downKeyCount, sessionId, query
|
|
18
|
+
export const buildTypeAheadCancelPayload = (duration, upKeyCount, downKeyCount, sessionId, query
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
21
|
+
) => {
|
|
19
22
|
const {
|
|
20
23
|
queryLength,
|
|
21
24
|
spaceInQuery
|
|
@@ -63,7 +66,10 @@ export const buildTypeAheadInviteItemViewedPayload = (sessionId, contextIdentifi
|
|
|
63
66
|
}
|
|
64
67
|
};
|
|
65
68
|
};
|
|
66
|
-
export const buildTypeAheadInviteItemClickedPayload = (duration, upKeyCount, downKeyCount, sessionId, insertType, query, contextIdentifierProvider, userRole
|
|
69
|
+
export const buildTypeAheadInviteItemClickedPayload = (duration, upKeyCount, downKeyCount, sessionId, insertType, query, contextIdentifierProvider, userRole
|
|
70
|
+
// Ignored via go/ees005
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
72
|
+
) => {
|
|
67
73
|
const {
|
|
68
74
|
queryLength,
|
|
69
75
|
spaceInQuery
|
|
@@ -93,7 +99,10 @@ export const buildTypeAheadInviteItemClickedPayload = (duration, upKeyCount, dow
|
|
|
93
99
|
}
|
|
94
100
|
};
|
|
95
101
|
};
|
|
96
|
-
export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId
|
|
102
|
+
export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId
|
|
103
|
+
// Ignored via go/ees005
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
105
|
+
) => {
|
|
97
106
|
const {
|
|
98
107
|
queryLength,
|
|
99
108
|
spaceInQuery
|
|
@@ -135,7 +144,10 @@ export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount
|
|
|
135
144
|
}
|
|
136
145
|
};
|
|
137
146
|
};
|
|
138
|
-
export const buildTypeAheadRenderedPayload = (duration, userIds, query, teams
|
|
147
|
+
export const buildTypeAheadRenderedPayload = (duration, userIds, query, teams
|
|
148
|
+
// Ignored via go/ees005
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
150
|
+
) => {
|
|
139
151
|
const {
|
|
140
152
|
queryLength,
|
|
141
153
|
spaceInQuery
|
|
@@ -107,7 +107,11 @@ const buildAndSendElementsTypeAheadAnalytics = fireEvent => ({
|
|
|
107
107
|
userOrTeamIds = null;
|
|
108
108
|
teams = mentions.map(mention => isTeamType(mention.userType) ? {
|
|
109
109
|
teamId: mention.id,
|
|
110
|
+
// Ignored via go/ees005
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
110
112
|
includesYou: mention.context.includesYou,
|
|
113
|
+
// Ignored via go/ees005
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
111
115
|
memberCount: mention.context.memberCount
|
|
112
116
|
} : null).filter(m => !!m);
|
|
113
117
|
}
|
|
@@ -119,7 +123,10 @@ const buildAndSendElementsTypeAheadAnalytics = fireEvent => ({
|
|
|
119
123
|
* When a team mention is selected, we render a team link and list of member/user mentions
|
|
120
124
|
* in editor content
|
|
121
125
|
*/
|
|
122
|
-
const buildNodesForTeamMention = (schema, selectedMention, mentionProvider, sanitizePrivateContent
|
|
126
|
+
const buildNodesForTeamMention = (schema, selectedMention, mentionProvider, sanitizePrivateContent
|
|
127
|
+
// Ignored via go/ees005
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
129
|
+
) => {
|
|
123
130
|
const {
|
|
124
131
|
nodes,
|
|
125
132
|
marks
|
|
@@ -136,7 +143,10 @@ const buildNodesForTeamMention = (schema, selectedMention, mentionProvider, sani
|
|
|
136
143
|
const teamLink = context && context.teamLink ? context.teamLink : defaultTeamLink;
|
|
137
144
|
const teamLinkNode = fg('team-mention-inline-smartlink') ? schema.nodes.inlineCard.create({
|
|
138
145
|
url: teamLink
|
|
139
|
-
}) :
|
|
146
|
+
}) :
|
|
147
|
+
// Ignored via go/ees005
|
|
148
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
149
|
+
schema.text(name, [marks.link.create({
|
|
140
150
|
href: teamLink
|
|
141
151
|
})]);
|
|
142
152
|
const openBracketText = schema.text('(');
|
|
@@ -251,6 +261,8 @@ export const createTypeAheadConfig = ({
|
|
|
251
261
|
onOpen: () => {
|
|
252
262
|
firstQueryWithoutResults = null;
|
|
253
263
|
},
|
|
264
|
+
// Ignored via go/ees005
|
|
265
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
254
266
|
selectItem(state, item, insert, {
|
|
255
267
|
mode,
|
|
256
268
|
stats,
|
|
@@ -360,7 +372,7 @@ export const createTypeAheadConfig = ({
|
|
|
360
372
|
const pluginState = getMentionPluginState(editorState);
|
|
361
373
|
if (pluginState !== null && pluginState !== void 0 && pluginState.mentionProvider) {
|
|
362
374
|
const mentionProvider = pluginState.mentionProvider;
|
|
363
|
-
for (
|
|
375
|
+
for (const key of subscriptionKeys) {
|
|
364
376
|
mentionProvider.unsubscribe(key);
|
|
365
377
|
}
|
|
366
378
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { INVITE_ITEM_DESCRIPTION } from '../InviteItem';
|
|
2
|
+
|
|
3
|
+
// Ignored via go/ees005
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
5
|
export const isTeamType = userType => userType === 'TEAM';
|
|
6
|
+
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
9
|
export const isTeamStats = stat => stat && !isNaN(stat.teamMentionDuration);
|
|
4
10
|
export const isInviteItem = mention => mention && mention.id === INVITE_ITEM_DESCRIPTION.id;
|
|
5
11
|
|
|
@@ -10,11 +16,13 @@ export const shouldKeepInviteItem = (query, firstQueryWithoutResults) => {
|
|
|
10
16
|
if (!firstQueryWithoutResults) {
|
|
11
17
|
return true;
|
|
12
18
|
}
|
|
13
|
-
|
|
19
|
+
const lastIndexWithResults = firstQueryWithoutResults.length - 1;
|
|
14
20
|
let suffix = query.slice(lastIndexWithResults);
|
|
15
21
|
if (query[lastIndexWithResults - 1] === ' ') {
|
|
16
22
|
suffix = ' ' + suffix;
|
|
17
23
|
}
|
|
24
|
+
// Ignored via go/ees005
|
|
25
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
18
26
|
const depletedExtraWords = /\s[^\s]+\s/.test(suffix);
|
|
19
27
|
return !depletedExtraWords;
|
|
20
28
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -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.9";
|
|
20
20
|
var setProvider = function setProvider(provider) {
|
|
21
21
|
return function (state, dispatch) {
|
|
22
22
|
if (dispatch) {
|
|
@@ -32,7 +32,10 @@ var setProvider = function setProvider(provider) {
|
|
|
32
32
|
};
|
|
33
33
|
export function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
|
|
34
34
|
var mentionProvider;
|
|
35
|
-
var sendAnalytics = function sendAnalytics(event, actionSubject, action, attributes
|
|
35
|
+
var sendAnalytics = function sendAnalytics(event, actionSubject, action, attributes
|
|
36
|
+
// Ignored via go/ees005
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
38
|
+
) {
|
|
36
39
|
if (event === SLI_EVENT_TYPE || event === SMART_EVENT_TYPE) {
|
|
37
40
|
fireEvent({
|
|
38
41
|
action: action,
|
|
@@ -55,6 +58,8 @@ export function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
|
|
|
55
58
|
canInsertMention: canInsertMention
|
|
56
59
|
};
|
|
57
60
|
},
|
|
61
|
+
// Ignored via go/ees005
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
58
63
|
apply: function apply(tr, pluginState, oldState, newState) {
|
|
59
64
|
var _ref = tr.getMeta(mentionPluginKey) || {
|
|
60
65
|
action: null,
|
|
@@ -16,6 +16,9 @@ import { avatarStyle, capitalizedStyle, mentionItemSelectedStyle, mentionItemSty
|
|
|
16
16
|
export var INVITE_ITEM_DESCRIPTION = {
|
|
17
17
|
id: 'invite-teammate'
|
|
18
18
|
};
|
|
19
|
+
|
|
20
|
+
// Ignored via go/ees005
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
22
|
var leftClick = function leftClick(event) {
|
|
20
23
|
return event.button === 0 && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;
|
|
21
24
|
};
|
|
@@ -27,13 +30,19 @@ var InviteItem = function InviteItem(_ref) {
|
|
|
27
30
|
selected = _ref.selected,
|
|
28
31
|
userRole = _ref.userRole,
|
|
29
32
|
intl = _ref.intl;
|
|
30
|
-
var onSelected = useCallback(
|
|
33
|
+
var onSelected = useCallback(
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
|
+
function (event) {
|
|
31
37
|
if (leftClick(event) && onSelection) {
|
|
32
38
|
event.preventDefault();
|
|
33
39
|
onSelection(INVITE_ITEM_DESCRIPTION, event);
|
|
34
40
|
}
|
|
35
41
|
}, [onSelection]);
|
|
36
|
-
var onItemMouseEnter = useCallback(
|
|
42
|
+
var onItemMouseEnter = useCallback(
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
+
function (event) {
|
|
37
46
|
if (onMouseEnter) {
|
|
38
47
|
onMouseEnter(INVITE_ITEM_DESCRIPTION, event);
|
|
39
48
|
}
|
|
@@ -61,7 +70,10 @@ var InviteItem = function InviteItem(_ref) {
|
|
|
61
70
|
})), jsx("div", {
|
|
62
71
|
css: nameSectionStyle,
|
|
63
72
|
"data-testid": "name-section"
|
|
64
|
-
}, jsx(FormattedMessage
|
|
73
|
+
}, jsx(FormattedMessage
|
|
74
|
+
// Ignored via go/ees005
|
|
75
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
76
|
+
, _extends({}, messages.inviteItemTitle, {
|
|
65
77
|
values: {
|
|
66
78
|
userRole: userRole || 'basic',
|
|
67
79
|
productName:
|
|
@@ -88,6 +88,8 @@ export var Mention = function Mention(props) {
|
|
|
88
88
|
}, []);
|
|
89
89
|
var actionHandlers = {};
|
|
90
90
|
['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(function (handler) {
|
|
91
|
+
// Ignored via go/ees005
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
93
|
actionHandlers[handler] = eventHandlers && eventHandlers[handler] || function () {};
|
|
92
94
|
});
|
|
93
95
|
if (profilecardProvider) {
|
|
@@ -99,6 +101,8 @@ export var Mention = function Mention(props) {
|
|
|
99
101
|
mentionProvider: mentionProvider,
|
|
100
102
|
profilecardProvider: profilecardProvider,
|
|
101
103
|
localId: localId
|
|
104
|
+
// Ignored via go/ees005
|
|
105
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
102
106
|
}, actionHandlers));
|
|
103
107
|
} else {
|
|
104
108
|
return /*#__PURE__*/React.createElement(ResourcedMention, _extends({
|
|
@@ -107,6 +111,8 @@ export var Mention = function Mention(props) {
|
|
|
107
111
|
accessLevel: accessLevel,
|
|
108
112
|
mentionProvider: mentionProvider,
|
|
109
113
|
localId: localId
|
|
114
|
+
// Ignored via go/ees005
|
|
115
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
110
116
|
}, actionHandlers));
|
|
111
117
|
}
|
|
112
118
|
};
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import React, { PureComponent } from 'react';
|
|
11
10
|
import { injectIntl } from 'react-intl-next';
|
|
12
11
|
import { mentionMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
12
|
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
14
13
|
import MentionIcon from '@atlaskit/icon/glyph/editor/mention';
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
15
16
|
var ToolbarMention = /*#__PURE__*/function (_PureComponent) {
|
|
16
|
-
_inherits(ToolbarMention, _PureComponent);
|
|
17
|
-
var _super = _createSuper(ToolbarMention);
|
|
18
17
|
function ToolbarMention() {
|
|
19
18
|
var _this;
|
|
20
19
|
_classCallCheck(this, ToolbarMention);
|
|
21
20
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22
21
|
args[_key] = arguments[_key];
|
|
23
22
|
}
|
|
24
|
-
_this =
|
|
25
|
-
_defineProperty(
|
|
23
|
+
_this = _callSuper(this, ToolbarMention, [].concat(args));
|
|
24
|
+
_defineProperty(_this, "handleInsertMention", function () {
|
|
26
25
|
if (!_this.props.editorView) {
|
|
27
26
|
return false;
|
|
28
27
|
}
|
|
@@ -31,7 +30,8 @@ var ToolbarMention = /*#__PURE__*/function (_PureComponent) {
|
|
|
31
30
|
});
|
|
32
31
|
return _this;
|
|
33
32
|
}
|
|
34
|
-
|
|
33
|
+
_inherits(ToolbarMention, _PureComponent);
|
|
34
|
+
return _createClass(ToolbarMention, [{
|
|
35
35
|
key: "render",
|
|
36
36
|
value: function render() {
|
|
37
37
|
var mentionStringTranslated = this.props.intl.formatMessage(messages.mentionsIconLabel);
|
|
@@ -48,6 +48,5 @@ var ToolbarMention = /*#__PURE__*/function (_PureComponent) {
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
}]);
|
|
51
|
-
return ToolbarMention;
|
|
52
51
|
}(PureComponent);
|
|
53
52
|
export default injectIntl(ToolbarMention);
|
|
@@ -15,7 +15,10 @@ var extractAttributesFromQuery = function extractAttributesFromQuery(query) {
|
|
|
15
15
|
}
|
|
16
16
|
return emptyQueryResponse;
|
|
17
17
|
};
|
|
18
|
-
export var buildTypeAheadCancelPayload = function buildTypeAheadCancelPayload(duration, upKeyCount, downKeyCount, sessionId, query
|
|
18
|
+
export var buildTypeAheadCancelPayload = function buildTypeAheadCancelPayload(duration, upKeyCount, downKeyCount, sessionId, query
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
21
|
+
) {
|
|
19
22
|
var _extractAttributesFro = extractAttributesFromQuery(query),
|
|
20
23
|
queryLength = _extractAttributesFro.queryLength,
|
|
21
24
|
spaceInQuery = _extractAttributesFro.spaceInQuery;
|
|
@@ -65,7 +68,10 @@ export var buildTypeAheadInviteItemViewedPayload = function buildTypeAheadInvite
|
|
|
65
68
|
}
|
|
66
69
|
};
|
|
67
70
|
};
|
|
68
|
-
export var buildTypeAheadInviteItemClickedPayload = function buildTypeAheadInviteItemClickedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, query, contextIdentifierProvider, userRole
|
|
71
|
+
export var buildTypeAheadInviteItemClickedPayload = function buildTypeAheadInviteItemClickedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, query, contextIdentifierProvider, userRole
|
|
72
|
+
// Ignored via go/ees005
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
74
|
+
) {
|
|
69
75
|
var _extractAttributesFro2 = extractAttributesFromQuery(query),
|
|
70
76
|
queryLength = _extractAttributesFro2.queryLength,
|
|
71
77
|
spaceInQuery = _extractAttributesFro2.spaceInQuery;
|
|
@@ -93,7 +99,10 @@ export var buildTypeAheadInviteItemClickedPayload = function buildTypeAheadInvit
|
|
|
93
99
|
}
|
|
94
100
|
};
|
|
95
101
|
};
|
|
96
|
-
export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId
|
|
102
|
+
export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId
|
|
103
|
+
// Ignored via go/ees005
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
105
|
+
) {
|
|
97
106
|
var _extractAttributesFro3 = extractAttributesFromQuery(query),
|
|
98
107
|
queryLength = _extractAttributesFro3.queryLength,
|
|
99
108
|
spaceInQuery = _extractAttributesFro3.spaceInQuery;
|
|
@@ -134,7 +143,10 @@ export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayloa
|
|
|
134
143
|
}
|
|
135
144
|
};
|
|
136
145
|
};
|
|
137
|
-
export var buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams
|
|
146
|
+
export var buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams
|
|
147
|
+
// Ignored via go/ees005
|
|
148
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
149
|
+
) {
|
|
138
150
|
var _extractAttributesFro4 = extractAttributesFromQuery(query),
|
|
139
151
|
queryLength = _extractAttributesFro4.queryLength,
|
|
140
152
|
spaceInQuery = _extractAttributesFro4.spaceInQuery;
|
|
@@ -121,7 +121,11 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
|
|
|
121
121
|
teams = mentions.map(function (mention) {
|
|
122
122
|
return isTeamType(mention.userType) ? {
|
|
123
123
|
teamId: mention.id,
|
|
124
|
+
// Ignored via go/ees005
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
124
126
|
includesYou: mention.context.includesYou,
|
|
127
|
+
// Ignored via go/ees005
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
125
129
|
memberCount: mention.context.memberCount
|
|
126
130
|
} : null;
|
|
127
131
|
}).filter(function (m) {
|
|
@@ -137,7 +141,10 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
|
|
|
137
141
|
* When a team mention is selected, we render a team link and list of member/user mentions
|
|
138
142
|
* in editor content
|
|
139
143
|
*/
|
|
140
|
-
var buildNodesForTeamMention = function buildNodesForTeamMention(schema, selectedMention, mentionProvider, sanitizePrivateContent
|
|
144
|
+
var buildNodesForTeamMention = function buildNodesForTeamMention(schema, selectedMention, mentionProvider, sanitizePrivateContent
|
|
145
|
+
// Ignored via go/ees005
|
|
146
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
147
|
+
) {
|
|
141
148
|
var nodes = schema.nodes,
|
|
142
149
|
marks = schema.marks;
|
|
143
150
|
var name = selectedMention.name,
|
|
@@ -150,7 +157,10 @@ var buildNodesForTeamMention = function buildNodesForTeamMention(schema, selecte
|
|
|
150
157
|
var teamLink = context && context.teamLink ? context.teamLink : defaultTeamLink;
|
|
151
158
|
var teamLinkNode = fg('team-mention-inline-smartlink') ? schema.nodes.inlineCard.create({
|
|
152
159
|
url: teamLink
|
|
153
|
-
}) :
|
|
160
|
+
}) :
|
|
161
|
+
// Ignored via go/ees005
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
163
|
+
schema.text(name, [marks.link.create({
|
|
154
164
|
href: teamLink
|
|
155
165
|
})]);
|
|
156
166
|
var openBracketText = schema.text('(');
|
|
@@ -261,6 +271,8 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
|
|
|
261
271
|
onOpen: function onOpen() {
|
|
262
272
|
firstQueryWithoutResults = null;
|
|
263
273
|
},
|
|
274
|
+
// Ignored via go/ees005
|
|
275
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
264
276
|
selectItem: function selectItem(state, item, insert, _ref9) {
|
|
265
277
|
var _api$contextIdentifie3, _api$contextIdentifie4;
|
|
266
278
|
var mode = _ref9.mode,
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { INVITE_ITEM_DESCRIPTION } from '../InviteItem';
|
|
2
|
+
|
|
3
|
+
// Ignored via go/ees005
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
5
|
export var isTeamType = function isTeamType(userType) {
|
|
3
6
|
return userType === 'TEAM';
|
|
4
7
|
};
|
|
8
|
+
|
|
9
|
+
// Ignored via go/ees005
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
11
|
export var isTeamStats = function isTeamStats(stat) {
|
|
6
12
|
return stat && !isNaN(stat.teamMentionDuration);
|
|
7
13
|
};
|
|
@@ -21,6 +27,8 @@ export var shouldKeepInviteItem = function shouldKeepInviteItem(query, firstQuer
|
|
|
21
27
|
if (query[lastIndexWithResults - 1] === ' ') {
|
|
22
28
|
suffix = ' ' + suffix;
|
|
23
29
|
}
|
|
30
|
+
// Ignored via go/ees005
|
|
31
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
24
32
|
var depletedExtraWords = /\s[^\s]+\s/.test(suffix);
|
|
25
33
|
return !depletedExtraWords;
|
|
26
34
|
};
|
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.9",
|
|
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": "^
|
|
35
|
+
"@atlaskit/editor-common": "^98.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-context-identifier": "^1.3.0",
|
|
38
38
|
"@atlaskit/editor-plugin-type-ahead": "^1.11.0",
|
|
39
39
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
40
|
-
"@atlaskit/icon": "^23.
|
|
41
|
-
"@atlaskit/mention": "^23.
|
|
40
|
+
"@atlaskit/icon": "^23.1.0",
|
|
41
|
+
"@atlaskit/mention": "^23.5.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.5.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@emotion/react": "^11.7.1",
|
|
47
47
|
"uuid": "^3.1.0"
|