@atlaskit/editor-plugin-mentions 14.5.15 → 14.5.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/nodeviews/profileCardRenderer.js +4 -4
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/ui/ProfileCardComponent.js +2 -3
- package/dist/es2019/nodeviews/profileCardRenderer.js +4 -4
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/ui/ProfileCardComponent.js +2 -3
- package/dist/esm/nodeviews/profileCardRenderer.js +4 -4
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/ui/ProfileCardComponent.js +2 -3
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
2
|
|
|
3
|
+
## 14.5.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 14.5.16
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`763bf25cf903d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/763bf25cf903d) -
|
|
14
|
+
Converted platform_editor_reduced_agent_profile_card to be an experiment flag
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 14.5.15
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -53,14 +53,14 @@ var profileCardRenderer = exports.profileCardRenderer = function profileCardRend
|
|
|
53
53
|
cleanupSelection = api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 ? void 0 : _api$selection.sharedState.onChange(function (_ref2) {
|
|
54
54
|
var nextSharedState = _ref2.nextSharedState;
|
|
55
55
|
var selection = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.selection;
|
|
56
|
-
if (selection instanceof _state.NodeSelection ? (0,
|
|
56
|
+
if (selection instanceof _state.NodeSelection ? (0, _expVal.expVal)('platform_editor_reduced_profile_cards', 'isEnabled', false) ? selection.node.sameMarkup(currentNode) : selection.node === node : false) {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
removeProfileCard === null || removeProfileCard === void 0 || removeProfileCard();
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
62
|
var renderEditorProfileCard = function renderEditorProfileCard() {
|
|
63
|
-
var activeMention = (0,
|
|
63
|
+
var activeMention = (0, _expVal.expVal)('platform_editor_reduced_profile_cards', 'isEnabled', false) ? function (_dom$querySelector, _currentNode, _currentNode2) {
|
|
64
64
|
// Read the display name from the DOM element at click time — this is
|
|
65
65
|
// always up-to-date even when node.attrs.text is absent
|
|
66
66
|
var primitiveText = dom instanceof HTMLElement ? (_dom$querySelector = dom.querySelector('.editor-mention-primitive')) === null || _dom$querySelector === void 0 || (_dom$querySelector = _dom$querySelector.textContent) === null || _dom$querySelector === void 0 ? void 0 : _dom$querySelector.trim() : undefined;
|
|
@@ -129,7 +129,7 @@ var profileCardRenderer = exports.profileCardRenderer = function profileCardRend
|
|
|
129
129
|
listener: function listener() {
|
|
130
130
|
if ((0, _platformFeatureFlags.fg)('people-teams_migrate-user-profile-card')) {
|
|
131
131
|
var _currentNode$attrs, _node$attrs, _options$profilecardP;
|
|
132
|
-
var userId = (0,
|
|
132
|
+
var userId = (0, _expVal.expVal)('platform_editor_reduced_profile_cards', 'isEnabled', false) ? (_currentNode$attrs = currentNode.attrs) === null || _currentNode$attrs === void 0 ? void 0 : _currentNode$attrs.id : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.id;
|
|
133
133
|
if (!userId) {
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
@@ -140,7 +140,7 @@ var profileCardRenderer = exports.profileCardRenderer = function profileCardRend
|
|
|
140
140
|
renderDefaultProfileCard(userId, provider);
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
-
if ((0, _ProfileCardComponent.isAgentMentionType)((0,
|
|
143
|
+
if ((0, _ProfileCardComponent.isAgentMentionType)((0, _expVal.expVal)('platform_editor_reduced_profile_cards', 'isEnabled', false) ? (_currentNode$attrs2 = currentNode.attrs) === null || _currentNode$attrs2 === void 0 ? void 0 : _currentNode$attrs2.userType : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.userType)) {
|
|
144
144
|
renderEditorProfileCard();
|
|
145
145
|
} else {
|
|
146
146
|
renderDefaultProfileCard(userId, provider);
|
|
@@ -53,7 +53,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
|
53
53
|
var AGENT_MENTION_INACTIVITY_MS = 3000;
|
|
54
54
|
var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
|
|
55
55
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
56
|
-
var PACKAGE_VERSION = "14.5.
|
|
56
|
+
var PACKAGE_VERSION = "14.5.16";
|
|
57
57
|
var setProvider = function setProvider(provider) {
|
|
58
58
|
return function (state, dispatch) {
|
|
59
59
|
if (dispatch) {
|
|
@@ -17,7 +17,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
17
17
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
18
18
|
var _bindEventListener = require("bind-event-listener");
|
|
19
19
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
20
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
20
|
var _user = require("@atlaskit/profilecard/user");
|
|
22
21
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
23
22
|
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
@@ -194,7 +193,7 @@ function ProfileCardComponent(_ref5) {
|
|
|
194
193
|
}, isAgentMention && provider && id ? /*#__PURE__*/React.createElement(AgentProfileCardContent, {
|
|
195
194
|
accountId: id,
|
|
196
195
|
provider: provider,
|
|
197
|
-
text: (0,
|
|
196
|
+
text: (0, _expVal.expVal)('platform_editor_reduced_profile_cards', 'isEnabled', false) ? text : undefined
|
|
198
197
|
}) : /*#__PURE__*/React.createElement(UserProfileCardContent, {
|
|
199
198
|
accessLevel: accessLevel,
|
|
200
199
|
id: id,
|
|
@@ -252,7 +251,7 @@ var AgentProfileCardContent = function AgentProfileCardContent(_ref9) {
|
|
|
252
251
|
provider = _ref9.provider,
|
|
253
252
|
text = _ref9.text;
|
|
254
253
|
var agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
|
|
255
|
-
return (0,
|
|
254
|
+
return (0, _expVal.expVal)('platform_editor_reduced_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, {
|
|
256
255
|
accountId: accountId,
|
|
257
256
|
cloudId: provider.cloudId,
|
|
258
257
|
resourceClient: provider.resourceClient,
|
|
@@ -44,14 +44,14 @@ export const profileCardRenderer = ({
|
|
|
44
44
|
nextSharedState
|
|
45
45
|
}) => {
|
|
46
46
|
const selection = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.selection;
|
|
47
|
-
if (selection instanceof NodeSelection ?
|
|
47
|
+
if (selection instanceof NodeSelection ? expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? selection.node.sameMarkup(currentNode) : selection.node === node : false) {
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
removeProfileCard === null || removeProfileCard === void 0 ? void 0 : removeProfileCard();
|
|
51
51
|
});
|
|
52
52
|
};
|
|
53
53
|
const renderEditorProfileCard = () => {
|
|
54
|
-
const activeMention =
|
|
54
|
+
const activeMention = expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? ((_dom$querySelector, _dom$querySelector$te, _currentNode, _currentNode2, _currentNode2$attrs) => {
|
|
55
55
|
// Read the display name from the DOM element at click time — this is
|
|
56
56
|
// always up-to-date even when node.attrs.text is absent
|
|
57
57
|
const primitiveText = dom instanceof HTMLElement ? (_dom$querySelector = dom.querySelector('.editor-mention-primitive')) === null || _dom$querySelector === void 0 ? void 0 : (_dom$querySelector$te = _dom$querySelector.textContent) === null || _dom$querySelector$te === void 0 ? void 0 : _dom$querySelector$te.trim() : undefined;
|
|
@@ -119,7 +119,7 @@ export const profileCardRenderer = ({
|
|
|
119
119
|
listener: () => {
|
|
120
120
|
if (fg('people-teams_migrate-user-profile-card')) {
|
|
121
121
|
var _currentNode$attrs, _node$attrs, _options$profilecardP;
|
|
122
|
-
const userId =
|
|
122
|
+
const userId = expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? (_currentNode$attrs = currentNode.attrs) === null || _currentNode$attrs === void 0 ? void 0 : _currentNode$attrs.id : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.id;
|
|
123
123
|
if (!userId) {
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
@@ -130,7 +130,7 @@ export const profileCardRenderer = ({
|
|
|
130
130
|
renderDefaultProfileCard(userId, provider);
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
if (isAgentMentionType(
|
|
133
|
+
if (isAgentMentionType(expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? (_currentNode$attrs2 = currentNode.attrs) === null || _currentNode$attrs2 === void 0 ? void 0 : _currentNode$attrs2.userType : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.userType)) {
|
|
134
134
|
renderEditorProfileCard();
|
|
135
135
|
} else {
|
|
136
136
|
renderDefaultProfileCard(userId, provider);
|
|
@@ -38,7 +38,7 @@ const AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
|
38
38
|
const AGENT_MENTION_INACTIVITY_MS = 3000;
|
|
39
39
|
const MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
|
|
40
40
|
const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
41
|
-
const PACKAGE_VERSION = "14.5.
|
|
41
|
+
const PACKAGE_VERSION = "14.5.16";
|
|
42
42
|
const setProvider = provider => (state, dispatch) => {
|
|
43
43
|
if (dispatch) {
|
|
44
44
|
dispatch(state.tr.setMeta(mentionPluginKey, {
|
|
@@ -5,7 +5,6 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import { useEffect, useMemo, useState } from 'react';
|
|
6
6
|
import { bind } from 'bind-event-listener';
|
|
7
7
|
import Loadable from 'react-loadable';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { ProfileCardLazy } from '@atlaskit/profilecard/user';
|
|
10
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
10
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
@@ -124,7 +123,7 @@ export function ProfileCardComponent({
|
|
|
124
123
|
}, isAgentMention && provider && id ? /*#__PURE__*/React.createElement(AgentProfileCardContent, {
|
|
125
124
|
accountId: id,
|
|
126
125
|
provider: provider,
|
|
127
|
-
text:
|
|
126
|
+
text: expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? text : undefined
|
|
128
127
|
}) : /*#__PURE__*/React.createElement(UserProfileCardContent, {
|
|
129
128
|
accessLevel: accessLevel,
|
|
130
129
|
id: id,
|
|
@@ -183,7 +182,7 @@ const AgentProfileCardContent = ({
|
|
|
183
182
|
text
|
|
184
183
|
}) => {
|
|
185
184
|
const agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
|
|
186
|
-
return
|
|
185
|
+
return expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, {
|
|
187
186
|
accountId: accountId,
|
|
188
187
|
cloudId: provider.cloudId,
|
|
189
188
|
resourceClient: provider.resourceClient,
|
|
@@ -47,14 +47,14 @@ export var profileCardRenderer = function profileCardRenderer(_ref) {
|
|
|
47
47
|
cleanupSelection = api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 ? void 0 : _api$selection.sharedState.onChange(function (_ref2) {
|
|
48
48
|
var nextSharedState = _ref2.nextSharedState;
|
|
49
49
|
var selection = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.selection;
|
|
50
|
-
if (selection instanceof NodeSelection ?
|
|
50
|
+
if (selection instanceof NodeSelection ? expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? selection.node.sameMarkup(currentNode) : selection.node === node : false) {
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
removeProfileCard === null || removeProfileCard === void 0 || removeProfileCard();
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
56
|
var renderEditorProfileCard = function renderEditorProfileCard() {
|
|
57
|
-
var activeMention =
|
|
57
|
+
var activeMention = expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? function (_dom$querySelector, _currentNode, _currentNode2) {
|
|
58
58
|
// Read the display name from the DOM element at click time — this is
|
|
59
59
|
// always up-to-date even when node.attrs.text is absent
|
|
60
60
|
var primitiveText = dom instanceof HTMLElement ? (_dom$querySelector = dom.querySelector('.editor-mention-primitive')) === null || _dom$querySelector === void 0 || (_dom$querySelector = _dom$querySelector.textContent) === null || _dom$querySelector === void 0 ? void 0 : _dom$querySelector.trim() : undefined;
|
|
@@ -123,7 +123,7 @@ export var profileCardRenderer = function profileCardRenderer(_ref) {
|
|
|
123
123
|
listener: function listener() {
|
|
124
124
|
if (fg('people-teams_migrate-user-profile-card')) {
|
|
125
125
|
var _currentNode$attrs, _node$attrs, _options$profilecardP;
|
|
126
|
-
var userId =
|
|
126
|
+
var userId = expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? (_currentNode$attrs = currentNode.attrs) === null || _currentNode$attrs === void 0 ? void 0 : _currentNode$attrs.id : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.id;
|
|
127
127
|
if (!userId) {
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
@@ -134,7 +134,7 @@ export var profileCardRenderer = function profileCardRenderer(_ref) {
|
|
|
134
134
|
renderDefaultProfileCard(userId, provider);
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
if (isAgentMentionType(
|
|
137
|
+
if (isAgentMentionType(expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? (_currentNode$attrs2 = currentNode.attrs) === null || _currentNode$attrs2 === void 0 ? void 0 : _currentNode$attrs2.userType : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.userType)) {
|
|
138
138
|
renderEditorProfileCard();
|
|
139
139
|
} else {
|
|
140
140
|
renderDefaultProfileCard(userId, provider);
|
|
@@ -45,7 +45,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
|
45
45
|
var AGENT_MENTION_INACTIVITY_MS = 3000;
|
|
46
46
|
var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
|
|
47
47
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
48
|
-
var PACKAGE_VERSION = "14.5.
|
|
48
|
+
var PACKAGE_VERSION = "14.5.16";
|
|
49
49
|
var setProvider = function setProvider(provider) {
|
|
50
50
|
return function (state, dispatch) {
|
|
51
51
|
if (dispatch) {
|
|
@@ -8,7 +8,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
8
8
|
import { useEffect, useMemo, useState } from 'react';
|
|
9
9
|
import { bind } from 'bind-event-listener';
|
|
10
10
|
import Loadable from 'react-loadable';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
import { ProfileCardLazy } from '@atlaskit/profilecard/user';
|
|
13
12
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
13
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
@@ -183,7 +182,7 @@ export function ProfileCardComponent(_ref5) {
|
|
|
183
182
|
}, isAgentMention && provider && id ? /*#__PURE__*/React.createElement(AgentProfileCardContent, {
|
|
184
183
|
accountId: id,
|
|
185
184
|
provider: provider,
|
|
186
|
-
text:
|
|
185
|
+
text: expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? text : undefined
|
|
187
186
|
}) : /*#__PURE__*/React.createElement(UserProfileCardContent, {
|
|
188
187
|
accessLevel: accessLevel,
|
|
189
188
|
id: id,
|
|
@@ -241,7 +240,7 @@ var AgentProfileCardContent = function AgentProfileCardContent(_ref9) {
|
|
|
241
240
|
provider = _ref9.provider,
|
|
242
241
|
text = _ref9.text;
|
|
243
242
|
var agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
|
|
244
|
-
return
|
|
243
|
+
return expVal('platform_editor_reduced_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, {
|
|
245
244
|
accountId: accountId,
|
|
246
245
|
cloudId: provider.cloudId,
|
|
247
246
|
resourceClient: provider.resourceClient,
|
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.17",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@atlaskit/editor-plugin-base": "^13.0.0",
|
|
28
28
|
"@atlaskit/editor-plugin-context-identifier": "^12.0.0",
|
|
29
29
|
"@atlaskit/editor-plugin-selection": "^12.0.0",
|
|
30
|
-
"@atlaskit/editor-plugin-type-ahead": "^
|
|
30
|
+
"@atlaskit/editor-plugin-type-ahead": "^13.0.0",
|
|
31
31
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
32
32
|
"@atlaskit/icon": "^36.2.0",
|
|
33
33
|
"@atlaskit/insm": "^1.0.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
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": "^
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^124.0.0",
|
|
45
45
|
"@atlaskit/tokens": "^15.5.0",
|
|
46
46
|
"@atlaskit/tooltip": "^23.1.0",
|
|
47
47
|
"@atlaskit/user-picker": "^13.4.0",
|
|
@@ -120,9 +120,6 @@
|
|
|
120
120
|
},
|
|
121
121
|
"rovo_chat_agent_selection": {
|
|
122
122
|
"type": "boolean"
|
|
123
|
-
},
|
|
124
|
-
"platform_editor_reduced_agent_profile_card": {
|
|
125
|
-
"type": "boolean"
|
|
126
123
|
}
|
|
127
124
|
}
|
|
128
125
|
}
|