@atlaskit/editor-plugin-mentions 14.5.11 → 14.5.13
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 +15 -0
- package/dist/cjs/pm-plugins/main.js +73 -15
- package/dist/cjs/ui/ProfileCardComponent.js +3 -2
- package/dist/cjs/ui/type-ahead/utils.js +5 -3
- package/dist/es2019/pm-plugins/main.js +77 -17
- package/dist/es2019/ui/ProfileCardComponent.js +4 -2
- package/dist/es2019/ui/type-ahead/utils.js +5 -3
- package/dist/esm/pm-plugins/main.js +73 -15
- package/dist/esm/ui/ProfileCardComponent.js +4 -2
- package/dist/esm/ui/type-ahead/utils.js +5 -3
- package/dist/types/pm-plugins/main.d.ts +1 -0
- package/dist/types/types/index.d.ts +12 -0
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
2
|
|
|
3
|
+
## 14.5.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d8df4ec19d384`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d8df4ec19d384) -
|
|
8
|
+
Suppresses nudge from agent mention when rovo chat is open
|
|
9
|
+
|
|
10
|
+
## 14.5.12
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`c2986ab2c7a01`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c2986ab2c7a01) -
|
|
15
|
+
Cleans up prefer static regex violations and enables e18e rule
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 14.5.11
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -27,6 +27,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
27
27
|
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; }
|
|
28
28
|
var ACTIONS = exports.ACTIONS = {
|
|
29
29
|
COMMIT_PENDING_TYPED_AGENT_MENTION: 'COMMIT_PENDING_TYPED_AGENT_MENTION',
|
|
30
|
+
DISCARD_PENDING_TYPED_AGENT_MENTION: 'DISCARD_PENDING_TYPED_AGENT_MENTION',
|
|
30
31
|
SET_PENDING_TYPED_AGENT_MENTION: 'SET_PENDING_TYPED_AGENT_MENTION',
|
|
31
32
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
32
33
|
};
|
|
@@ -52,7 +53,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
|
52
53
|
var AGENT_MENTION_INACTIVITY_MS = 3000;
|
|
53
54
|
var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
|
|
54
55
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
55
|
-
var PACKAGE_VERSION = "14.5.
|
|
56
|
+
var PACKAGE_VERSION = "14.5.12";
|
|
56
57
|
var setProvider = function setProvider(provider) {
|
|
57
58
|
return function (state, dispatch) {
|
|
58
59
|
if (dispatch) {
|
|
@@ -163,6 +164,7 @@ var getPendingTypedAgentMentionAfterDocChange = function getPendingTypedAgentMen
|
|
|
163
164
|
localId: pendingTypedAgentMention.localId,
|
|
164
165
|
name: pendingMentionDetails.name,
|
|
165
166
|
nodeSize: pendingMentionDetails.nodeSize,
|
|
167
|
+
parentNodeType: pendingMentionDetails.parentNodeType,
|
|
166
168
|
pos: pendingMentionDetails.pos,
|
|
167
169
|
resetCount: resetCount
|
|
168
170
|
} : null;
|
|
@@ -252,6 +254,10 @@ function createMentionPlugin(_ref2) {
|
|
|
252
254
|
options = _ref2.options,
|
|
253
255
|
api = _ref2.api;
|
|
254
256
|
var mentionProvider;
|
|
257
|
+
|
|
258
|
+
// Injected by Rovo-aware consumers only. Non-Rovo consumers omit this field
|
|
259
|
+
// entirely so this plugin incurs zero bundle cost from rovo-experience-api.
|
|
260
|
+
var getIsRovoPanelOpen = options === null || options === void 0 ? void 0 : options.getIsRovoPanelOpen;
|
|
255
261
|
var sendAnalytics = function sendAnalytics(event, actionSubject, action, attributes) {
|
|
256
262
|
if (event === _resource.SLI_EVENT_TYPE || event === _resource.SMART_EVENT_TYPE) {
|
|
257
263
|
fireEvent({
|
|
@@ -306,6 +312,19 @@ function createMentionPlugin(_ref2) {
|
|
|
306
312
|
hasPublicPluginStateChanged = hasPublicPluginStateChanged || commitResult.hasPublicPluginStateChanged;
|
|
307
313
|
break;
|
|
308
314
|
}
|
|
315
|
+
case ACTIONS.DISCARD_PENDING_TYPED_AGENT_MENTION:
|
|
316
|
+
{
|
|
317
|
+
// Silently discard the pending typed agent mention without committing it.
|
|
318
|
+
var pendingTypedAgentMentionToDiscard = newPluginState.pendingTypedAgentMention;
|
|
319
|
+
if (!isAgentMentionsExperimentEnabled || !pendingTypedAgentMentionToDiscard || pendingTypedAgentMentionToDiscard.localId !== (params === null || params === void 0 ? void 0 : params.localId) || pendingTypedAgentMentionToDiscard.resetCount !== (params === null || params === void 0 ? void 0 : params.resetCount)) {
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
323
|
+
pendingTypedAgentMention: null
|
|
324
|
+
});
|
|
325
|
+
hasPublicPluginStateChanged = true;
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
309
328
|
case ACTIONS.SET_PROVIDER:
|
|
310
329
|
newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
311
330
|
mentionProvider: params.provider
|
|
@@ -549,6 +568,7 @@ function createMentionPlugin(_ref2) {
|
|
|
549
568
|
localId: pendingTypedAgentMentionLocalId,
|
|
550
569
|
name: pendingTypedAgentMentionDetailsForState.name,
|
|
551
570
|
nodeSize: pendingTypedAgentMentionDetailsForState.nodeSize,
|
|
571
|
+
parentNodeType: pendingTypedAgentMentionDetailsForState.parentNodeType,
|
|
552
572
|
pos: pendingTypedAgentMentionDetailsForState.pos,
|
|
553
573
|
resetCount: 1
|
|
554
574
|
}
|
|
@@ -569,17 +589,26 @@ function createMentionPlugin(_ref2) {
|
|
|
569
589
|
} : {});
|
|
570
590
|
hasPublicPluginStateChanged = true;
|
|
571
591
|
} else if (agentMentionId !== ((_newPluginState$lastI2 = newPluginState.lastInsertedAgentMentionId) !== null && _newPluginState$lastI2 !== void 0 ? _newPluginState$lastI2 : null) || agentMentionLocalId !== ((_newPluginState$lastI3 = newPluginState.lastInsertedAgentMentionLocalId) !== null && _newPluginState$lastI3 !== void 0 ? _newPluginState$lastI3 : null) || agentMentionName !== ((_newPluginState$lastI4 = newPluginState.lastInsertedAgentMentionName) !== null && _newPluginState$lastI4 !== void 0 ? _newPluginState$lastI4 : null) || agentMentionPrompt !== ((_newPluginState$lastI5 = newPluginState.lastInsertedAgentMentionPrompt) !== null && _newPluginState$lastI5 !== void 0 ? _newPluginState$lastI5 : null) || agentMentionParentNodeType !== ((_newPluginState$lastI6 = newPluginState.lastInsertedAgentMentionParentNodeType) !== null && _newPluginState$lastI6 !== void 0 ? _newPluginState$lastI6 : null) || newInsertionCount !== undefined) {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
592
|
+
// Suppress the nudge for pasted/non-typed agent mentions when Rovo is already
|
|
593
|
+
// open.
|
|
594
|
+
var isTaskItemMentionForPaste = agentMentionParentNodeType === 'taskItem';
|
|
595
|
+
if (!isTaskItemMentionForPaste && isNewInsertion && getIsRovoPanelOpen !== null && getIsRovoPanelOpen !== void 0 && getIsRovoPanelOpen()) {
|
|
596
|
+
// Rovo is already open — skip setting lastInsertedAgentMention* so the
|
|
597
|
+
// downstream nudge listener never fires.
|
|
598
|
+
} else {
|
|
599
|
+
// Not suppressed — update state so the nudge fires normally.
|
|
600
|
+
newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
601
|
+
lastInsertedAgentMentionId: agentMentionId,
|
|
602
|
+
lastInsertedAgentMentionLocalId: agentMentionLocalId,
|
|
603
|
+
lastInsertedAgentMentionContext: agentMentionContext,
|
|
604
|
+
lastInsertedAgentMentionName: agentMentionName,
|
|
605
|
+
lastInsertedAgentMentionPrompt: agentMentionPrompt,
|
|
606
|
+
lastInsertedAgentMentionParentNodeType: agentMentionParentNodeType
|
|
607
|
+
}, newInsertionCount !== undefined ? {
|
|
608
|
+
lastAgentMentionInsertionCount: newInsertionCount
|
|
609
|
+
} : {});
|
|
610
|
+
hasPublicPluginStateChanged = true;
|
|
611
|
+
}
|
|
583
612
|
}
|
|
584
613
|
}
|
|
585
614
|
}
|
|
@@ -610,9 +639,21 @@ function createMentionPlugin(_ref2) {
|
|
|
610
639
|
pendingTypedAgentMention: null
|
|
611
640
|
});
|
|
612
641
|
} else if (hasPendingMentionMovedToNewParent(oldState, tr, pluginState.pendingTypedAgentMention, pendingMentionDetails) || isSelectionOutsideDirectParent(newState, pendingMentionDetails)) {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
642
|
+
// Suppress the nudge when Rovo chat is already open, mirroring the same
|
|
643
|
+
// guard used in the inactivity-timer path. Task-item mentions are
|
|
644
|
+
// exempt because they auto-fire the mini modal and never show a nudge.
|
|
645
|
+
if (pendingMentionDetails.parentNodeType !== 'taskItem' && getIsRovoPanelOpen !== null && getIsRovoPanelOpen !== void 0 && getIsRovoPanelOpen()) {
|
|
646
|
+
// Discard without committing so lastInsertedAgentMention* fields are
|
|
647
|
+
// never set and the downstream nudge listener never fires.
|
|
648
|
+
newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
649
|
+
pendingTypedAgentMention: null
|
|
650
|
+
});
|
|
651
|
+
hasPublicPluginStateChanged = true;
|
|
652
|
+
} else {
|
|
653
|
+
var _commitResult = commitResolvedPendingTypedAgentMention(newPluginState, pendingMentionDetails);
|
|
654
|
+
newPluginState = _commitResult.pluginState;
|
|
655
|
+
hasPublicPluginStateChanged = hasPublicPluginStateChanged || _commitResult.hasPublicPluginStateChanged;
|
|
656
|
+
}
|
|
616
657
|
}
|
|
617
658
|
}
|
|
618
659
|
if (hasPublicPluginStateChanged && isAgentMentionsExperimentEnabled) {
|
|
@@ -696,6 +737,23 @@ function createMentionPlugin(_ref2) {
|
|
|
696
737
|
pendingTypedAgentMentionTimerKey = timerKey;
|
|
697
738
|
pendingTypedAgentMentionTimer = setTimeout(function () {
|
|
698
739
|
var _mentionPluginKey$get;
|
|
740
|
+
{
|
|
741
|
+
// Suppress the agent-mention nudge when the Rovo panel is already open,
|
|
742
|
+
// but only for non-task-item mentions.
|
|
743
|
+
var isTaskItemMention = pendingTypedAgentMention.parentNodeType === 'taskItem';
|
|
744
|
+
if (!isTaskItemMention && getIsRovoPanelOpen !== null && getIsRovoPanelOpen !== void 0 && getIsRovoPanelOpen()) {
|
|
745
|
+
// Dispatch a discard so pendingTypedAgentMention is nulled out of plugin
|
|
746
|
+
// state.
|
|
747
|
+
editorView.dispatch(editorView.state.tr.setMeta(_key.mentionPluginKey, {
|
|
748
|
+
action: ACTIONS.DISCARD_PENDING_TYPED_AGENT_MENTION,
|
|
749
|
+
params: {
|
|
750
|
+
localId: pendingTypedAgentMention.localId,
|
|
751
|
+
resetCount: pendingTypedAgentMention.resetCount
|
|
752
|
+
}
|
|
753
|
+
}));
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
699
757
|
var latestPendingTypedAgentMention = (_mentionPluginKey$get = _key.mentionPluginKey.getState(editorView.state)) === null || _mentionPluginKey$get === void 0 ? void 0 : _mentionPluginKey$get.pendingTypedAgentMention;
|
|
700
758
|
if (!latestPendingTypedAgentMention || latestPendingTypedAgentMention.localId !== pendingTypedAgentMention.localId || latestPendingTypedAgentMention.resetCount !== pendingTypedAgentMention.resetCount) {
|
|
701
759
|
return;
|
|
@@ -23,6 +23,8 @@ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
|
23
23
|
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
24
24
|
var _PopperWrapper = require("./PopperWrapper");
|
|
25
25
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
26
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
27
|
+
var LEADING_AT_SIGN_RE = /^@/;
|
|
26
28
|
var AgentProfileCardResourcedLazy = (0, _reactLoadable.default)({
|
|
27
29
|
loader: function loader() {
|
|
28
30
|
return Promise.resolve().then(function () {
|
|
@@ -249,8 +251,7 @@ var AgentProfileCardContent = function AgentProfileCardContent(_ref9) {
|
|
|
249
251
|
var accountId = _ref9.accountId,
|
|
250
252
|
provider = _ref9.provider,
|
|
251
253
|
text = _ref9.text;
|
|
252
|
-
|
|
253
|
-
var agentName = (text !== null && text !== void 0 ? text : '').replace(/^@/, '');
|
|
254
|
+
var agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
|
|
254
255
|
return (0, _platformFeatureFlags.fg)('platform_editor_reduced_agent_profile_card') ? /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, {
|
|
255
256
|
accountId: accountId,
|
|
256
257
|
cloudId: provider.cloudId,
|
|
@@ -5,6 +5,10 @@ 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 require-unicode-regexp
|
|
10
|
+
var SUFFIX_WITH_EXTRA_WORDS_REGEX = /\s[^\s]+\s/;
|
|
11
|
+
|
|
8
12
|
// Ignored via go/ees005
|
|
9
13
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
14
|
var isTeamType = exports.isTeamType = function isTeamType(userType) {
|
|
@@ -32,8 +36,6 @@ var shouldKeepInviteItem = exports.shouldKeepInviteItem = function shouldKeepInv
|
|
|
32
36
|
if (query[lastIndexWithResults - 1] === ' ') {
|
|
33
37
|
suffix = ' ' + suffix;
|
|
34
38
|
}
|
|
35
|
-
|
|
36
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
37
|
-
var depletedExtraWords = /\s[^\s]+\s/.test(suffix);
|
|
39
|
+
var depletedExtraWords = SUFFIX_WITH_EXTRA_WORDS_REGEX.test(suffix);
|
|
38
40
|
return !depletedExtraWords;
|
|
39
41
|
};
|
|
@@ -12,6 +12,7 @@ import { mentionPluginKey } from './key';
|
|
|
12
12
|
import { canMentionBeCreatedInRange } from './utils';
|
|
13
13
|
export const ACTIONS = {
|
|
14
14
|
COMMIT_PENDING_TYPED_AGENT_MENTION: 'COMMIT_PENDING_TYPED_AGENT_MENTION',
|
|
15
|
+
DISCARD_PENDING_TYPED_AGENT_MENTION: 'DISCARD_PENDING_TYPED_AGENT_MENTION',
|
|
15
16
|
SET_PENDING_TYPED_AGENT_MENTION: 'SET_PENDING_TYPED_AGENT_MENTION',
|
|
16
17
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
17
18
|
};
|
|
@@ -37,7 +38,7 @@ const AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
|
37
38
|
const AGENT_MENTION_INACTIVITY_MS = 3000;
|
|
38
39
|
const MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
|
|
39
40
|
const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
40
|
-
const PACKAGE_VERSION = "14.5.
|
|
41
|
+
const PACKAGE_VERSION = "14.5.12";
|
|
41
42
|
const setProvider = provider => (state, dispatch) => {
|
|
42
43
|
if (dispatch) {
|
|
43
44
|
dispatch(state.tr.setMeta(mentionPluginKey, {
|
|
@@ -143,6 +144,7 @@ const getPendingTypedAgentMentionAfterDocChange = (state, tr, pendingTypedAgentM
|
|
|
143
144
|
localId: pendingTypedAgentMention.localId,
|
|
144
145
|
name: pendingMentionDetails.name,
|
|
145
146
|
nodeSize: pendingMentionDetails.nodeSize,
|
|
147
|
+
parentNodeType: pendingMentionDetails.parentNodeType,
|
|
146
148
|
pos: pendingMentionDetails.pos,
|
|
147
149
|
resetCount
|
|
148
150
|
} : null;
|
|
@@ -230,6 +232,10 @@ export function createMentionPlugin({
|
|
|
230
232
|
api
|
|
231
233
|
}) {
|
|
232
234
|
let mentionProvider;
|
|
235
|
+
|
|
236
|
+
// Injected by Rovo-aware consumers only. Non-Rovo consumers omit this field
|
|
237
|
+
// entirely so this plugin incurs zero bundle cost from rovo-experience-api.
|
|
238
|
+
const getIsRovoPanelOpen = options === null || options === void 0 ? void 0 : options.getIsRovoPanelOpen;
|
|
233
239
|
const sendAnalytics = (event, actionSubject, action, attributes) => {
|
|
234
240
|
if (event === SLI_EVENT_TYPE || event === SMART_EVENT_TYPE) {
|
|
235
241
|
fireEvent({
|
|
@@ -287,6 +293,20 @@ export function createMentionPlugin({
|
|
|
287
293
|
hasPublicPluginStateChanged = hasPublicPluginStateChanged || commitResult.hasPublicPluginStateChanged;
|
|
288
294
|
break;
|
|
289
295
|
}
|
|
296
|
+
case ACTIONS.DISCARD_PENDING_TYPED_AGENT_MENTION:
|
|
297
|
+
{
|
|
298
|
+
// Silently discard the pending typed agent mention without committing it.
|
|
299
|
+
const pendingTypedAgentMentionToDiscard = newPluginState.pendingTypedAgentMention;
|
|
300
|
+
if (!isAgentMentionsExperimentEnabled || !pendingTypedAgentMentionToDiscard || pendingTypedAgentMentionToDiscard.localId !== (params === null || params === void 0 ? void 0 : params.localId) || pendingTypedAgentMentionToDiscard.resetCount !== (params === null || params === void 0 ? void 0 : params.resetCount)) {
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
newPluginState = {
|
|
304
|
+
...newPluginState,
|
|
305
|
+
pendingTypedAgentMention: null
|
|
306
|
+
};
|
|
307
|
+
hasPublicPluginStateChanged = true;
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
290
310
|
case ACTIONS.SET_PROVIDER:
|
|
291
311
|
newPluginState = {
|
|
292
312
|
...newPluginState,
|
|
@@ -504,6 +524,7 @@ export function createMentionPlugin({
|
|
|
504
524
|
localId: pendingTypedAgentMentionLocalId,
|
|
505
525
|
name: pendingTypedAgentMentionDetailsForState.name,
|
|
506
526
|
nodeSize: pendingTypedAgentMentionDetailsForState.nodeSize,
|
|
527
|
+
parentNodeType: pendingTypedAgentMentionDetailsForState.parentNodeType,
|
|
507
528
|
pos: pendingTypedAgentMentionDetailsForState.pos,
|
|
508
529
|
resetCount: 1
|
|
509
530
|
}
|
|
@@ -526,19 +547,28 @@ export function createMentionPlugin({
|
|
|
526
547
|
};
|
|
527
548
|
hasPublicPluginStateChanged = true;
|
|
528
549
|
} else if (agentMentionId !== ((_newPluginState$lastI2 = newPluginState.lastInsertedAgentMentionId) !== null && _newPluginState$lastI2 !== void 0 ? _newPluginState$lastI2 : null) || agentMentionLocalId !== ((_newPluginState$lastI3 = newPluginState.lastInsertedAgentMentionLocalId) !== null && _newPluginState$lastI3 !== void 0 ? _newPluginState$lastI3 : null) || agentMentionName !== ((_newPluginState$lastI4 = newPluginState.lastInsertedAgentMentionName) !== null && _newPluginState$lastI4 !== void 0 ? _newPluginState$lastI4 : null) || agentMentionPrompt !== ((_newPluginState$lastI5 = newPluginState.lastInsertedAgentMentionPrompt) !== null && _newPluginState$lastI5 !== void 0 ? _newPluginState$lastI5 : null) || agentMentionParentNodeType !== ((_newPluginState$lastI6 = newPluginState.lastInsertedAgentMentionParentNodeType) !== null && _newPluginState$lastI6 !== void 0 ? _newPluginState$lastI6 : null) || newInsertionCount !== undefined) {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
550
|
+
// Suppress the nudge for pasted/non-typed agent mentions when Rovo is already
|
|
551
|
+
// open.
|
|
552
|
+
const isTaskItemMentionForPaste = agentMentionParentNodeType === 'taskItem';
|
|
553
|
+
if (!isTaskItemMentionForPaste && isNewInsertion && getIsRovoPanelOpen !== null && getIsRovoPanelOpen !== void 0 && getIsRovoPanelOpen()) {
|
|
554
|
+
// Rovo is already open — skip setting lastInsertedAgentMention* so the
|
|
555
|
+
// downstream nudge listener never fires.
|
|
556
|
+
} else {
|
|
557
|
+
// Not suppressed — update state so the nudge fires normally.
|
|
558
|
+
newPluginState = {
|
|
559
|
+
...newPluginState,
|
|
560
|
+
lastInsertedAgentMentionId: agentMentionId,
|
|
561
|
+
lastInsertedAgentMentionLocalId: agentMentionLocalId,
|
|
562
|
+
lastInsertedAgentMentionContext: agentMentionContext,
|
|
563
|
+
lastInsertedAgentMentionName: agentMentionName,
|
|
564
|
+
lastInsertedAgentMentionPrompt: agentMentionPrompt,
|
|
565
|
+
lastInsertedAgentMentionParentNodeType: agentMentionParentNodeType,
|
|
566
|
+
...(newInsertionCount !== undefined ? {
|
|
567
|
+
lastAgentMentionInsertionCount: newInsertionCount
|
|
568
|
+
} : {})
|
|
569
|
+
};
|
|
570
|
+
hasPublicPluginStateChanged = true;
|
|
571
|
+
}
|
|
542
572
|
}
|
|
543
573
|
}
|
|
544
574
|
}
|
|
@@ -569,9 +599,22 @@ export function createMentionPlugin({
|
|
|
569
599
|
pendingTypedAgentMention: null
|
|
570
600
|
};
|
|
571
601
|
} else if (hasPendingMentionMovedToNewParent(oldState, tr, pluginState.pendingTypedAgentMention, pendingMentionDetails) || isSelectionOutsideDirectParent(newState, pendingMentionDetails)) {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
602
|
+
// Suppress the nudge when Rovo chat is already open, mirroring the same
|
|
603
|
+
// guard used in the inactivity-timer path. Task-item mentions are
|
|
604
|
+
// exempt because they auto-fire the mini modal and never show a nudge.
|
|
605
|
+
if (pendingMentionDetails.parentNodeType !== 'taskItem' && getIsRovoPanelOpen !== null && getIsRovoPanelOpen !== void 0 && getIsRovoPanelOpen()) {
|
|
606
|
+
// Discard without committing so lastInsertedAgentMention* fields are
|
|
607
|
+
// never set and the downstream nudge listener never fires.
|
|
608
|
+
newPluginState = {
|
|
609
|
+
...newPluginState,
|
|
610
|
+
pendingTypedAgentMention: null
|
|
611
|
+
};
|
|
612
|
+
hasPublicPluginStateChanged = true;
|
|
613
|
+
} else {
|
|
614
|
+
const commitResult = commitResolvedPendingTypedAgentMention(newPluginState, pendingMentionDetails);
|
|
615
|
+
newPluginState = commitResult.pluginState;
|
|
616
|
+
hasPublicPluginStateChanged = hasPublicPluginStateChanged || commitResult.hasPublicPluginStateChanged;
|
|
617
|
+
}
|
|
575
618
|
}
|
|
576
619
|
}
|
|
577
620
|
if (hasPublicPluginStateChanged && isAgentMentionsExperimentEnabled) {
|
|
@@ -651,6 +694,23 @@ export function createMentionPlugin({
|
|
|
651
694
|
pendingTypedAgentMentionTimerKey = timerKey;
|
|
652
695
|
pendingTypedAgentMentionTimer = setTimeout(() => {
|
|
653
696
|
var _mentionPluginKey$get;
|
|
697
|
+
{
|
|
698
|
+
// Suppress the agent-mention nudge when the Rovo panel is already open,
|
|
699
|
+
// but only for non-task-item mentions.
|
|
700
|
+
const isTaskItemMention = pendingTypedAgentMention.parentNodeType === 'taskItem';
|
|
701
|
+
if (!isTaskItemMention && getIsRovoPanelOpen !== null && getIsRovoPanelOpen !== void 0 && getIsRovoPanelOpen()) {
|
|
702
|
+
// Dispatch a discard so pendingTypedAgentMention is nulled out of plugin
|
|
703
|
+
// state.
|
|
704
|
+
editorView.dispatch(editorView.state.tr.setMeta(mentionPluginKey, {
|
|
705
|
+
action: ACTIONS.DISCARD_PENDING_TYPED_AGENT_MENTION,
|
|
706
|
+
params: {
|
|
707
|
+
localId: pendingTypedAgentMention.localId,
|
|
708
|
+
resetCount: pendingTypedAgentMention.resetCount
|
|
709
|
+
}
|
|
710
|
+
}));
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
654
714
|
const latestPendingTypedAgentMention = (_mentionPluginKey$get = mentionPluginKey.getState(editorView.state)) === null || _mentionPluginKey$get === void 0 ? void 0 : _mentionPluginKey$get.pendingTypedAgentMention;
|
|
655
715
|
if (!latestPendingTypedAgentMention || latestPendingTypedAgentMention.localId !== pendingTypedAgentMention.localId || latestPendingTypedAgentMention.resetCount !== pendingTypedAgentMention.resetCount) {
|
|
656
716
|
return;
|
|
@@ -10,6 +10,9 @@ import { ProfileCardLazy } from '@atlaskit/profilecard/user';
|
|
|
10
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
11
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
12
12
|
import { Popup } from './PopperWrapper';
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
15
|
+
const LEADING_AT_SIGN_RE = /^@/;
|
|
13
16
|
const AgentProfileCardResourcedLazy = Loadable({
|
|
14
17
|
loader: () => import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-mentions-agent-profile-card-resourced" */
|
|
15
18
|
'@atlaskit/profilecard/agent-profile-card-resourced').then(({
|
|
@@ -179,8 +182,7 @@ const AgentProfileCardContent = ({
|
|
|
179
182
|
provider,
|
|
180
183
|
text
|
|
181
184
|
}) => {
|
|
182
|
-
|
|
183
|
-
const agentName = (text !== null && text !== void 0 ? text : '').replace(/^@/, '');
|
|
185
|
+
const agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
|
|
184
186
|
return fg('platform_editor_reduced_agent_profile_card') ? /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, {
|
|
185
187
|
accountId: accountId,
|
|
186
188
|
cloudId: provider.cloudId,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { INVITE_ITEM_DESCRIPTION } from '../InviteItem';
|
|
2
2
|
|
|
3
|
+
// Ignored via go/ees005
|
|
4
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
5
|
+
const SUFFIX_WITH_EXTRA_WORDS_REGEX = /\s[^\s]+\s/;
|
|
6
|
+
|
|
3
7
|
// Ignored via go/ees005
|
|
4
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
9
|
export const isTeamType = userType => userType === 'TEAM';
|
|
@@ -21,8 +25,6 @@ export const shouldKeepInviteItem = (query, firstQueryWithoutResults) => {
|
|
|
21
25
|
if (query[lastIndexWithResults - 1] === ' ') {
|
|
22
26
|
suffix = ' ' + suffix;
|
|
23
27
|
}
|
|
24
|
-
|
|
25
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
26
|
-
const depletedExtraWords = /\s[^\s]+\s/.test(suffix);
|
|
28
|
+
const depletedExtraWords = SUFFIX_WITH_EXTRA_WORDS_REGEX.test(suffix);
|
|
27
29
|
return !depletedExtraWords;
|
|
28
30
|
};
|
|
@@ -19,6 +19,7 @@ import { mentionPluginKey } from './key';
|
|
|
19
19
|
import { canMentionBeCreatedInRange } from './utils';
|
|
20
20
|
export var ACTIONS = {
|
|
21
21
|
COMMIT_PENDING_TYPED_AGENT_MENTION: 'COMMIT_PENDING_TYPED_AGENT_MENTION',
|
|
22
|
+
DISCARD_PENDING_TYPED_AGENT_MENTION: 'DISCARD_PENDING_TYPED_AGENT_MENTION',
|
|
22
23
|
SET_PENDING_TYPED_AGENT_MENTION: 'SET_PENDING_TYPED_AGENT_MENTION',
|
|
23
24
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
24
25
|
};
|
|
@@ -44,7 +45,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
|
44
45
|
var AGENT_MENTION_INACTIVITY_MS = 3000;
|
|
45
46
|
var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
|
|
46
47
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
47
|
-
var PACKAGE_VERSION = "14.5.
|
|
48
|
+
var PACKAGE_VERSION = "14.5.12";
|
|
48
49
|
var setProvider = function setProvider(provider) {
|
|
49
50
|
return function (state, dispatch) {
|
|
50
51
|
if (dispatch) {
|
|
@@ -155,6 +156,7 @@ var getPendingTypedAgentMentionAfterDocChange = function getPendingTypedAgentMen
|
|
|
155
156
|
localId: pendingTypedAgentMention.localId,
|
|
156
157
|
name: pendingMentionDetails.name,
|
|
157
158
|
nodeSize: pendingMentionDetails.nodeSize,
|
|
159
|
+
parentNodeType: pendingMentionDetails.parentNodeType,
|
|
158
160
|
pos: pendingMentionDetails.pos,
|
|
159
161
|
resetCount: resetCount
|
|
160
162
|
} : null;
|
|
@@ -244,6 +246,10 @@ export function createMentionPlugin(_ref2) {
|
|
|
244
246
|
options = _ref2.options,
|
|
245
247
|
api = _ref2.api;
|
|
246
248
|
var mentionProvider;
|
|
249
|
+
|
|
250
|
+
// Injected by Rovo-aware consumers only. Non-Rovo consumers omit this field
|
|
251
|
+
// entirely so this plugin incurs zero bundle cost from rovo-experience-api.
|
|
252
|
+
var getIsRovoPanelOpen = options === null || options === void 0 ? void 0 : options.getIsRovoPanelOpen;
|
|
247
253
|
var sendAnalytics = function sendAnalytics(event, actionSubject, action, attributes) {
|
|
248
254
|
if (event === SLI_EVENT_TYPE || event === SMART_EVENT_TYPE) {
|
|
249
255
|
fireEvent({
|
|
@@ -298,6 +304,19 @@ export function createMentionPlugin(_ref2) {
|
|
|
298
304
|
hasPublicPluginStateChanged = hasPublicPluginStateChanged || commitResult.hasPublicPluginStateChanged;
|
|
299
305
|
break;
|
|
300
306
|
}
|
|
307
|
+
case ACTIONS.DISCARD_PENDING_TYPED_AGENT_MENTION:
|
|
308
|
+
{
|
|
309
|
+
// Silently discard the pending typed agent mention without committing it.
|
|
310
|
+
var pendingTypedAgentMentionToDiscard = newPluginState.pendingTypedAgentMention;
|
|
311
|
+
if (!isAgentMentionsExperimentEnabled || !pendingTypedAgentMentionToDiscard || pendingTypedAgentMentionToDiscard.localId !== (params === null || params === void 0 ? void 0 : params.localId) || pendingTypedAgentMentionToDiscard.resetCount !== (params === null || params === void 0 ? void 0 : params.resetCount)) {
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
315
|
+
pendingTypedAgentMention: null
|
|
316
|
+
});
|
|
317
|
+
hasPublicPluginStateChanged = true;
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
301
320
|
case ACTIONS.SET_PROVIDER:
|
|
302
321
|
newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
303
322
|
mentionProvider: params.provider
|
|
@@ -541,6 +560,7 @@ export function createMentionPlugin(_ref2) {
|
|
|
541
560
|
localId: pendingTypedAgentMentionLocalId,
|
|
542
561
|
name: pendingTypedAgentMentionDetailsForState.name,
|
|
543
562
|
nodeSize: pendingTypedAgentMentionDetailsForState.nodeSize,
|
|
563
|
+
parentNodeType: pendingTypedAgentMentionDetailsForState.parentNodeType,
|
|
544
564
|
pos: pendingTypedAgentMentionDetailsForState.pos,
|
|
545
565
|
resetCount: 1
|
|
546
566
|
}
|
|
@@ -561,17 +581,26 @@ export function createMentionPlugin(_ref2) {
|
|
|
561
581
|
} : {});
|
|
562
582
|
hasPublicPluginStateChanged = true;
|
|
563
583
|
} else if (agentMentionId !== ((_newPluginState$lastI2 = newPluginState.lastInsertedAgentMentionId) !== null && _newPluginState$lastI2 !== void 0 ? _newPluginState$lastI2 : null) || agentMentionLocalId !== ((_newPluginState$lastI3 = newPluginState.lastInsertedAgentMentionLocalId) !== null && _newPluginState$lastI3 !== void 0 ? _newPluginState$lastI3 : null) || agentMentionName !== ((_newPluginState$lastI4 = newPluginState.lastInsertedAgentMentionName) !== null && _newPluginState$lastI4 !== void 0 ? _newPluginState$lastI4 : null) || agentMentionPrompt !== ((_newPluginState$lastI5 = newPluginState.lastInsertedAgentMentionPrompt) !== null && _newPluginState$lastI5 !== void 0 ? _newPluginState$lastI5 : null) || agentMentionParentNodeType !== ((_newPluginState$lastI6 = newPluginState.lastInsertedAgentMentionParentNodeType) !== null && _newPluginState$lastI6 !== void 0 ? _newPluginState$lastI6 : null) || newInsertionCount !== undefined) {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
584
|
+
// Suppress the nudge for pasted/non-typed agent mentions when Rovo is already
|
|
585
|
+
// open.
|
|
586
|
+
var isTaskItemMentionForPaste = agentMentionParentNodeType === 'taskItem';
|
|
587
|
+
if (!isTaskItemMentionForPaste && isNewInsertion && getIsRovoPanelOpen !== null && getIsRovoPanelOpen !== void 0 && getIsRovoPanelOpen()) {
|
|
588
|
+
// Rovo is already open — skip setting lastInsertedAgentMention* so the
|
|
589
|
+
// downstream nudge listener never fires.
|
|
590
|
+
} else {
|
|
591
|
+
// Not suppressed — update state so the nudge fires normally.
|
|
592
|
+
newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
593
|
+
lastInsertedAgentMentionId: agentMentionId,
|
|
594
|
+
lastInsertedAgentMentionLocalId: agentMentionLocalId,
|
|
595
|
+
lastInsertedAgentMentionContext: agentMentionContext,
|
|
596
|
+
lastInsertedAgentMentionName: agentMentionName,
|
|
597
|
+
lastInsertedAgentMentionPrompt: agentMentionPrompt,
|
|
598
|
+
lastInsertedAgentMentionParentNodeType: agentMentionParentNodeType
|
|
599
|
+
}, newInsertionCount !== undefined ? {
|
|
600
|
+
lastAgentMentionInsertionCount: newInsertionCount
|
|
601
|
+
} : {});
|
|
602
|
+
hasPublicPluginStateChanged = true;
|
|
603
|
+
}
|
|
575
604
|
}
|
|
576
605
|
}
|
|
577
606
|
}
|
|
@@ -602,9 +631,21 @@ export function createMentionPlugin(_ref2) {
|
|
|
602
631
|
pendingTypedAgentMention: null
|
|
603
632
|
});
|
|
604
633
|
} else if (hasPendingMentionMovedToNewParent(oldState, tr, pluginState.pendingTypedAgentMention, pendingMentionDetails) || isSelectionOutsideDirectParent(newState, pendingMentionDetails)) {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
634
|
+
// Suppress the nudge when Rovo chat is already open, mirroring the same
|
|
635
|
+
// guard used in the inactivity-timer path. Task-item mentions are
|
|
636
|
+
// exempt because they auto-fire the mini modal and never show a nudge.
|
|
637
|
+
if (pendingMentionDetails.parentNodeType !== 'taskItem' && getIsRovoPanelOpen !== null && getIsRovoPanelOpen !== void 0 && getIsRovoPanelOpen()) {
|
|
638
|
+
// Discard without committing so lastInsertedAgentMention* fields are
|
|
639
|
+
// never set and the downstream nudge listener never fires.
|
|
640
|
+
newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
641
|
+
pendingTypedAgentMention: null
|
|
642
|
+
});
|
|
643
|
+
hasPublicPluginStateChanged = true;
|
|
644
|
+
} else {
|
|
645
|
+
var _commitResult = commitResolvedPendingTypedAgentMention(newPluginState, pendingMentionDetails);
|
|
646
|
+
newPluginState = _commitResult.pluginState;
|
|
647
|
+
hasPublicPluginStateChanged = hasPublicPluginStateChanged || _commitResult.hasPublicPluginStateChanged;
|
|
648
|
+
}
|
|
608
649
|
}
|
|
609
650
|
}
|
|
610
651
|
if (hasPublicPluginStateChanged && isAgentMentionsExperimentEnabled) {
|
|
@@ -688,6 +729,23 @@ export function createMentionPlugin(_ref2) {
|
|
|
688
729
|
pendingTypedAgentMentionTimerKey = timerKey;
|
|
689
730
|
pendingTypedAgentMentionTimer = setTimeout(function () {
|
|
690
731
|
var _mentionPluginKey$get;
|
|
732
|
+
{
|
|
733
|
+
// Suppress the agent-mention nudge when the Rovo panel is already open,
|
|
734
|
+
// but only for non-task-item mentions.
|
|
735
|
+
var isTaskItemMention = pendingTypedAgentMention.parentNodeType === 'taskItem';
|
|
736
|
+
if (!isTaskItemMention && getIsRovoPanelOpen !== null && getIsRovoPanelOpen !== void 0 && getIsRovoPanelOpen()) {
|
|
737
|
+
// Dispatch a discard so pendingTypedAgentMention is nulled out of plugin
|
|
738
|
+
// state.
|
|
739
|
+
editorView.dispatch(editorView.state.tr.setMeta(mentionPluginKey, {
|
|
740
|
+
action: ACTIONS.DISCARD_PENDING_TYPED_AGENT_MENTION,
|
|
741
|
+
params: {
|
|
742
|
+
localId: pendingTypedAgentMention.localId,
|
|
743
|
+
resetCount: pendingTypedAgentMention.resetCount
|
|
744
|
+
}
|
|
745
|
+
}));
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
691
749
|
var latestPendingTypedAgentMention = (_mentionPluginKey$get = mentionPluginKey.getState(editorView.state)) === null || _mentionPluginKey$get === void 0 ? void 0 : _mentionPluginKey$get.pendingTypedAgentMention;
|
|
692
750
|
if (!latestPendingTypedAgentMention || latestPendingTypedAgentMention.localId !== pendingTypedAgentMention.localId || latestPendingTypedAgentMention.resetCount !== pendingTypedAgentMention.resetCount) {
|
|
693
751
|
return;
|
|
@@ -13,6 +13,9 @@ import { ProfileCardLazy } from '@atlaskit/profilecard/user';
|
|
|
13
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
14
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
15
15
|
import { Popup } from './PopperWrapper';
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
18
|
+
var LEADING_AT_SIGN_RE = /^@/;
|
|
16
19
|
var AgentProfileCardResourcedLazy = Loadable({
|
|
17
20
|
loader: function loader() {
|
|
18
21
|
return import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-mentions-agent-profile-card-resourced" */
|
|
@@ -237,8 +240,7 @@ var AgentProfileCardContent = function AgentProfileCardContent(_ref9) {
|
|
|
237
240
|
var accountId = _ref9.accountId,
|
|
238
241
|
provider = _ref9.provider,
|
|
239
242
|
text = _ref9.text;
|
|
240
|
-
|
|
241
|
-
var agentName = (text !== null && text !== void 0 ? text : '').replace(/^@/, '');
|
|
243
|
+
var agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
|
|
242
244
|
return fg('platform_editor_reduced_agent_profile_card') ? /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, {
|
|
243
245
|
accountId: accountId,
|
|
244
246
|
cloudId: provider.cloudId,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { INVITE_ITEM_DESCRIPTION } from '../InviteItem';
|
|
2
2
|
|
|
3
|
+
// Ignored via go/ees005
|
|
4
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
5
|
+
var SUFFIX_WITH_EXTRA_WORDS_REGEX = /\s[^\s]+\s/;
|
|
6
|
+
|
|
3
7
|
// Ignored via go/ees005
|
|
4
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
9
|
export var isTeamType = function isTeamType(userType) {
|
|
@@ -27,8 +31,6 @@ export var shouldKeepInviteItem = function shouldKeepInviteItem(query, firstQuer
|
|
|
27
31
|
if (query[lastIndexWithResults - 1] === ' ') {
|
|
28
32
|
suffix = ' ' + suffix;
|
|
29
33
|
}
|
|
30
|
-
|
|
31
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
32
|
-
var depletedExtraWords = /\s[^\s]+\s/.test(suffix);
|
|
34
|
+
var depletedExtraWords = SUFFIX_WITH_EXTRA_WORDS_REGEX.test(suffix);
|
|
33
35
|
return !depletedExtraWords;
|
|
34
36
|
};
|
|
@@ -4,6 +4,7 @@ import type { MentionsPlugin } from '../mentionsPluginType';
|
|
|
4
4
|
import type { FireElementsChannelEvent, MentionPluginOptions, MentionPluginState } from '../types';
|
|
5
5
|
export declare const ACTIONS: {
|
|
6
6
|
COMMIT_PENDING_TYPED_AGENT_MENTION: string;
|
|
7
|
+
DISCARD_PENDING_TYPED_AGENT_MENTION: string;
|
|
7
8
|
SET_PENDING_TYPED_AGENT_MENTION: string;
|
|
8
9
|
SET_PROVIDER: string;
|
|
9
10
|
};
|
|
@@ -34,6 +34,12 @@ export interface MentionsPluginOptions extends MentionPluginConfig {
|
|
|
34
34
|
* Takes priority over `MentionProvider.shouldHighlightMention()` if both are present.
|
|
35
35
|
*/
|
|
36
36
|
currentUserId?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Optional getter injected by Rovo-aware consumers to check whether the Rovo
|
|
39
|
+
* panel is currently open. When provided, the mentions plugin uses it to
|
|
40
|
+
* suppress the agent-mention nudge when Rovo is already visible.
|
|
41
|
+
*/
|
|
42
|
+
getIsRovoPanelOpen?: () => boolean;
|
|
37
43
|
handleMentionsChanged?: MentionsChangedHandler;
|
|
38
44
|
mentionProvider?: Providers['mentionProvider'];
|
|
39
45
|
sanitizePrivateContent?: boolean;
|
|
@@ -111,6 +117,12 @@ export type MentionPluginState = {
|
|
|
111
117
|
localId: string;
|
|
112
118
|
name: string | null;
|
|
113
119
|
nodeSize: number;
|
|
120
|
+
/**
|
|
121
|
+
* ProseMirror node type of the direct parent of the pending agent mention
|
|
122
|
+
* (e.g. 'taskItem', 'paragraph'). Used in the inactivity timer to skip the
|
|
123
|
+
* getIsRovoPanelOpen() suppression check for task-item mentions.
|
|
124
|
+
*/
|
|
125
|
+
parentNodeType: string | null;
|
|
114
126
|
pos: number;
|
|
115
127
|
/**
|
|
116
128
|
* Generation value for the inactivity timer. This changes when local edits
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-mentions",
|
|
3
|
-
"version": "14.5.
|
|
3
|
+
"version": "14.5.13",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@atlaskit/profilecard": "^26.8.0",
|
|
42
42
|
"@atlaskit/teams-app-config": "^2.1.0",
|
|
43
43
|
"@atlaskit/theme": "^26.1.0",
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^120.
|
|
45
|
-
"@atlaskit/tokens": "^15.
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^120.2.0",
|
|
45
|
+
"@atlaskit/tokens": "^15.4.0",
|
|
46
46
|
"@atlaskit/tooltip": "^23.1.0",
|
|
47
47
|
"@atlaskit/user-picker": "^13.4.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"uuid": "^3.1.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@atlaskit/editor-common": "^116.
|
|
56
|
+
"@atlaskit/editor-common": "^116.22.0",
|
|
57
57
|
"react": "^18.2.0",
|
|
58
58
|
"react-dom": "^18.2.0",
|
|
59
59
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -118,9 +118,6 @@
|
|
|
118
118
|
"people-teams_migrate-user-profile-card": {
|
|
119
119
|
"type": "boolean"
|
|
120
120
|
},
|
|
121
|
-
"platform_editor_agent_mentions": {
|
|
122
|
-
"type": "boolean"
|
|
123
|
-
},
|
|
124
121
|
"rovo_chat_agent_selection": {
|
|
125
122
|
"type": "boolean"
|
|
126
123
|
},
|