@atlaskit/editor-plugin-mentions 18.1.0 → 18.1.2
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/nodeviews/profileCardRenderer.js +8 -1
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/ui/ProfileCardComponent.js +7 -5
- package/dist/es2019/nodeviews/profileCardRenderer.js +11 -2
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/ui/ProfileCardComponent.js +9 -4
- package/dist/esm/nodeviews/profileCardRenderer.js +9 -2
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/ui/ProfileCardComponent.js +7 -5
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
2
|
|
|
3
|
+
## 18.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 18.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`243f04087ceef`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/243f04087ceef) -
|
|
14
|
+
Dismiss the agent profile card and clear the mention's node selection when opening Rovo chat from
|
|
15
|
+
the mention card's chat action, gated behind platform_editor_agent_card_close_on_chat.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 18.1.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -103,7 +103,14 @@ var profileCardRenderer = exports.profileCardRenderer = function profileCardRend
|
|
|
103
103
|
profilecardProvider: options === null || options === void 0 ? void 0 : options.profilecardProvider,
|
|
104
104
|
onAgentMentionChatClick: options !== null && options !== void 0 && options.onAgentMentionChatClick && (0, _fg.fg)('platform_editor_agent_mentions_drop_one_fixes') ? function (agentId) {
|
|
105
105
|
var _options$onAgentMenti;
|
|
106
|
-
|
|
106
|
+
(_options$onAgentMenti = options.onAgentMentionChatClick) === null || _options$onAgentMenti === void 0 || _options$onAgentMenti.call(options, agentId, agentMentionContext);
|
|
107
|
+
// The mention stays node-selected after the chat opens; collapse the
|
|
108
|
+
// selection to a cursor just after it so it is no longer left selected.
|
|
109
|
+
// Selection-only change, so it does not move focus (EDITOR-8257).
|
|
110
|
+
if (editorView && (0, _fg.fg)('platform_editor_agent_card_close_on_chat')) {
|
|
111
|
+
var state = editorView.state;
|
|
112
|
+
editorView.dispatch(state.tr.setSelection(_state.TextSelection.create(state.doc, state.selection.to)));
|
|
113
|
+
}
|
|
107
114
|
} : undefined,
|
|
108
115
|
dom: referenceElement,
|
|
109
116
|
closeComponent: removeProfileCard
|
|
@@ -74,7 +74,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
|
74
74
|
var AGENT_MENTION_INACTIVITY_MS = 3000;
|
|
75
75
|
var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
|
|
76
76
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
77
|
-
var PACKAGE_VERSION = "18.
|
|
77
|
+
var PACKAGE_VERSION = "18.1.1";
|
|
78
78
|
var setProvider = function setProvider(provider) {
|
|
79
79
|
return function (state, dispatch) {
|
|
80
80
|
if (dispatch) {
|
|
@@ -209,11 +209,13 @@ function ProfileCardComponent(_ref5) {
|
|
|
209
209
|
hideActions: hideActions,
|
|
210
210
|
text: (0, _expVal.expVal)('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? text : undefined,
|
|
211
211
|
onChatClick: onAgentMentionChatClick && (0, _fg.fg)('platform_editor_agent_mentions_drop_one_fixes') ? function (event, agentStudioId) {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
)
|
|
212
|
+
// agentMentionContext is already captured in the onAgentMentionChatClick
|
|
213
|
+
// closure built by profileCardRenderer at chip-click time via doc.descendants()
|
|
214
|
+
onAgentMentionChatClick(agentStudioId !== null && agentStudioId !== void 0 ? agentStudioId : id);
|
|
215
|
+
// Dismiss the profile card once the Rovo chat panel opens (EDITOR-8257).
|
|
216
|
+
if ((0, _fg.fg)('platform_editor_agent_card_close_on_chat')) {
|
|
217
|
+
closeComponent();
|
|
218
|
+
}
|
|
217
219
|
} : undefined
|
|
218
220
|
}) : /*#__PURE__*/React.createElement(UserProfileCardContent, {
|
|
219
221
|
accessLevel: accessLevel,
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
3
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
4
|
import uuid from 'uuid/v4';
|
|
5
|
-
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { findChildrenByAttr } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -92,7 +92,16 @@ export const profileCardRenderer = ({
|
|
|
92
92
|
profilecardProvider: options === null || options === void 0 ? void 0 : options.profilecardProvider,
|
|
93
93
|
onAgentMentionChatClick: options !== null && options !== void 0 && options.onAgentMentionChatClick && fg('platform_editor_agent_mentions_drop_one_fixes') ? agentId => {
|
|
94
94
|
var _options$onAgentMenti;
|
|
95
|
-
|
|
95
|
+
(_options$onAgentMenti = options.onAgentMentionChatClick) === null || _options$onAgentMenti === void 0 ? void 0 : _options$onAgentMenti.call(options, agentId, agentMentionContext);
|
|
96
|
+
// The mention stays node-selected after the chat opens; collapse the
|
|
97
|
+
// selection to a cursor just after it so it is no longer left selected.
|
|
98
|
+
// Selection-only change, so it does not move focus (EDITOR-8257).
|
|
99
|
+
if (editorView && fg('platform_editor_agent_card_close_on_chat')) {
|
|
100
|
+
const {
|
|
101
|
+
state
|
|
102
|
+
} = editorView;
|
|
103
|
+
editorView.dispatch(state.tr.setSelection(TextSelection.create(state.doc, state.selection.to)));
|
|
104
|
+
}
|
|
96
105
|
} : undefined,
|
|
97
106
|
dom: referenceElement,
|
|
98
107
|
closeComponent: removeProfileCard
|
|
@@ -58,7 +58,7 @@ const AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
|
58
58
|
const AGENT_MENTION_INACTIVITY_MS = 3000;
|
|
59
59
|
const MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
|
|
60
60
|
const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
61
|
-
const PACKAGE_VERSION = "18.
|
|
61
|
+
const PACKAGE_VERSION = "18.1.1";
|
|
62
62
|
const setProvider = provider => (state, dispatch) => {
|
|
63
63
|
if (dispatch) {
|
|
64
64
|
dispatch(state.tr.setMeta(mentionPluginKey, {
|
|
@@ -138,10 +138,15 @@ export function ProfileCardComponent({
|
|
|
138
138
|
provider: provider,
|
|
139
139
|
hideActions: hideActions,
|
|
140
140
|
text: expVal('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? text : undefined,
|
|
141
|
-
onChatClick: onAgentMentionChatClick && fg('platform_editor_agent_mentions_drop_one_fixes') ? (event, agentStudioId) =>
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
onChatClick: onAgentMentionChatClick && fg('platform_editor_agent_mentions_drop_one_fixes') ? (event, agentStudioId) => {
|
|
142
|
+
// agentMentionContext is already captured in the onAgentMentionChatClick
|
|
143
|
+
// closure built by profileCardRenderer at chip-click time via doc.descendants()
|
|
144
|
+
onAgentMentionChatClick(agentStudioId !== null && agentStudioId !== void 0 ? agentStudioId : id);
|
|
145
|
+
// Dismiss the profile card once the Rovo chat panel opens (EDITOR-8257).
|
|
146
|
+
if (fg('platform_editor_agent_card_close_on_chat')) {
|
|
147
|
+
closeComponent();
|
|
148
|
+
}
|
|
149
|
+
} : undefined
|
|
145
150
|
}) : /*#__PURE__*/React.createElement(UserProfileCardContent, {
|
|
146
151
|
accessLevel: accessLevel,
|
|
147
152
|
id: id,
|
|
@@ -5,7 +5,7 @@ import React from 'react';
|
|
|
5
5
|
import { bind } from 'bind-event-listener';
|
|
6
6
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
7
7
|
import uuid from 'uuid/v4';
|
|
8
|
-
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
8
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { findChildrenByAttr } from '@atlaskit/editor-prosemirror/utils';
|
|
10
10
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -97,7 +97,14 @@ export var profileCardRenderer = function profileCardRenderer(_ref) {
|
|
|
97
97
|
profilecardProvider: options === null || options === void 0 ? void 0 : options.profilecardProvider,
|
|
98
98
|
onAgentMentionChatClick: options !== null && options !== void 0 && options.onAgentMentionChatClick && fg('platform_editor_agent_mentions_drop_one_fixes') ? function (agentId) {
|
|
99
99
|
var _options$onAgentMenti;
|
|
100
|
-
|
|
100
|
+
(_options$onAgentMenti = options.onAgentMentionChatClick) === null || _options$onAgentMenti === void 0 || _options$onAgentMenti.call(options, agentId, agentMentionContext);
|
|
101
|
+
// The mention stays node-selected after the chat opens; collapse the
|
|
102
|
+
// selection to a cursor just after it so it is no longer left selected.
|
|
103
|
+
// Selection-only change, so it does not move focus (EDITOR-8257).
|
|
104
|
+
if (editorView && fg('platform_editor_agent_card_close_on_chat')) {
|
|
105
|
+
var state = editorView.state;
|
|
106
|
+
editorView.dispatch(state.tr.setSelection(TextSelection.create(state.doc, state.selection.to)));
|
|
107
|
+
}
|
|
101
108
|
} : undefined,
|
|
102
109
|
dom: referenceElement,
|
|
103
110
|
closeComponent: removeProfileCard
|
|
@@ -65,7 +65,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
|
65
65
|
var AGENT_MENTION_INACTIVITY_MS = 3000;
|
|
66
66
|
var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
|
|
67
67
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
68
|
-
var PACKAGE_VERSION = "18.
|
|
68
|
+
var PACKAGE_VERSION = "18.1.1";
|
|
69
69
|
var setProvider = function setProvider(provider) {
|
|
70
70
|
return function (state, dispatch) {
|
|
71
71
|
if (dispatch) {
|
|
@@ -198,11 +198,13 @@ export function ProfileCardComponent(_ref5) {
|
|
|
198
198
|
hideActions: hideActions,
|
|
199
199
|
text: expVal('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? text : undefined,
|
|
200
200
|
onChatClick: onAgentMentionChatClick && fg('platform_editor_agent_mentions_drop_one_fixes') ? function (event, agentStudioId) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
)
|
|
201
|
+
// agentMentionContext is already captured in the onAgentMentionChatClick
|
|
202
|
+
// closure built by profileCardRenderer at chip-click time via doc.descendants()
|
|
203
|
+
onAgentMentionChatClick(agentStudioId !== null && agentStudioId !== void 0 ? agentStudioId : id);
|
|
204
|
+
// Dismiss the profile card once the Rovo chat panel opens (EDITOR-8257).
|
|
205
|
+
if (fg('platform_editor_agent_card_close_on_chat')) {
|
|
206
|
+
closeComponent();
|
|
207
|
+
}
|
|
206
208
|
} : undefined
|
|
207
209
|
}) : /*#__PURE__*/React.createElement(UserProfileCardContent, {
|
|
208
210
|
accessLevel: accessLevel,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-mentions",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.2",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@atlaskit/adf-schema": "^57.2.0",
|
|
25
25
|
"@atlaskit/css": "^1.1.0",
|
|
26
|
-
"@atlaskit/editor-json-transformer": "^9.
|
|
26
|
+
"@atlaskit/editor-json-transformer": "^9.7.0",
|
|
27
27
|
"@atlaskit/editor-plugin-analytics": "^16.0.0",
|
|
28
28
|
"@atlaskit/editor-plugin-base": "^17.0.0",
|
|
29
29
|
"@atlaskit/editor-plugin-context-identifier": "^16.0.0",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"@atlaskit/popup": "^6.2.0",
|
|
44
44
|
"@atlaskit/portal": "^6.3.0",
|
|
45
45
|
"@atlaskit/primitives": "^22.4.0",
|
|
46
|
-
"@atlaskit/profilecard": "^26.
|
|
46
|
+
"@atlaskit/profilecard": "^26.20.0",
|
|
47
47
|
"@atlaskit/section-message": "^10.1.0",
|
|
48
48
|
"@atlaskit/teams-app-config": "^3.0.0",
|
|
49
49
|
"@atlaskit/theme": "^28.1.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^165.0.0",
|
|
51
51
|
"@atlaskit/tokens": "^16.8.0",
|
|
52
52
|
"@atlaskit/tooltip": "^24.2.0",
|
|
53
53
|
"@atlaskit/user-picker": "^13.10.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"uuid": "^3.1.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@atlaskit/editor-common": "^120.
|
|
62
|
+
"@atlaskit/editor-common": "^120.6.0",
|
|
63
63
|
"react": "^18.2.0 || ^19.2.0",
|
|
64
64
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
65
65
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -129,6 +129,9 @@
|
|
|
129
129
|
"platform_editor_agent_mentions_drop_one_fixes": {
|
|
130
130
|
"type": "boolean"
|
|
131
131
|
},
|
|
132
|
+
"platform_editor_agent_card_close_on_chat": {
|
|
133
|
+
"type": "boolean"
|
|
134
|
+
},
|
|
132
135
|
"platform_editor_mention_typeahead_profilecard": {
|
|
133
136
|
"type": "boolean"
|
|
134
137
|
},
|