@atlaskit/editor-plugin-mentions 21.0.1 → 21.1.0
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 +21 -0
- package/dist/cjs/mentionsPlugin.js +3 -3
- package/dist/cjs/nodeviews/mentionNodeView.js +1 -1
- package/dist/cjs/pm-plugins/agent.js +1 -1
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/ui/ProfileCardComponent.js +69 -49
- package/dist/cjs/ui/type-ahead/index.js +3 -3
- package/dist/es2019/entry-points/anchored-popup.js +1 -0
- package/dist/es2019/entry-points/mentions-plugin.js +1 -0
- package/dist/es2019/mentionsPlugin.js +3 -3
- package/dist/es2019/nodeviews/mentionNodeView.js +1 -1
- package/dist/es2019/pm-plugins/agent.js +1 -1
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/ui/ProfileCardComponent.js +21 -7
- package/dist/es2019/ui/type-ahead/index.js +3 -3
- package/dist/esm/entry-points/anchored-popup.js +1 -0
- package/dist/esm/entry-points/mentions-plugin.js +1 -0
- package/dist/esm/mentionsPlugin.js +3 -3
- package/dist/esm/nodeviews/mentionNodeView.js +1 -1
- package/dist/esm/pm-plugins/agent.js +1 -1
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/ui/ProfileCardComponent.js +65 -46
- package/dist/esm/ui/type-ahead/index.js +3 -3
- package/dist/types/entry-points/mention-node-data-provider.d.ts +1 -1
- package/dist/types/mentionsPluginType.d.ts +1 -1
- package/dist/types/ui/ProfileCardComponent.d.ts +1 -1
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
2
|
|
|
3
|
+
## 21.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`1012a17b207ba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1012a17b207ba) -
|
|
8
|
+
Migrate the editor mentions profile card loader to react-loosely-lazy behind the
|
|
9
|
+
`platform_editor_loosely_lazy_migration` experiment.
|
|
10
|
+
- [`d28cad9beb783`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d28cad9beb783) -
|
|
11
|
+
Enable mention avatars when the platform_editor_mention_node_graphql_provider experiment is
|
|
12
|
+
enabled
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
18
|
+
## 21.0.2
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 21.0.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -14,11 +14,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
14
14
|
var _reactIntl = require("react-intl");
|
|
15
15
|
var _uuid = require("uuid");
|
|
16
16
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
|
+
var _assets = require("@atlaskit/editor-common/assets");
|
|
17
18
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
18
19
|
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
19
|
-
var _assets = require("@atlaskit/editor-common/assets");
|
|
20
|
-
var _isResolvingMentionProvider = require("@atlaskit/mention/is-resolving-mention-provider");
|
|
21
20
|
var _isPromise = require("@atlaskit/mention/is-promise");
|
|
21
|
+
var _isResolvingMentionProvider = require("@atlaskit/mention/is-resolving-mention-provider");
|
|
22
22
|
var _types = require("@atlaskit/mention/types");
|
|
23
23
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
24
24
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
@@ -30,9 +30,9 @@ var _agent = require("./pm-plugins/agent");
|
|
|
30
30
|
var _key = require("./pm-plugins/key");
|
|
31
31
|
var _main = require("./pm-plugins/main");
|
|
32
32
|
var _InlineInvitePopupContainer = require("./ui/InlineInvitePopupContainer");
|
|
33
|
+
var _getMentionQuickInsertComponents = require("./ui/quick-insert/getMentionQuickInsertComponents");
|
|
33
34
|
var _SecondaryToolbarComponent = require("./ui/SecondaryToolbarComponent");
|
|
34
35
|
var _typeAhead = require("./ui/type-ahead");
|
|
35
|
-
var _getMentionQuickInsertComponents = require("./ui/quick-insert/getMentionQuickInsertComponents");
|
|
36
36
|
var _excluded2 = ["pendingPastedAgentMention", "runStateDecorations"]; // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
37
37
|
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" != _typeof(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 _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
38
38
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -172,7 +172,7 @@ var MentionNodeView = exports.MentionNodeView = /*#__PURE__*/function () {
|
|
|
172
172
|
api = config.api,
|
|
173
173
|
portalProviderAPI = config.portalProviderAPI,
|
|
174
174
|
editorView = config.editorView;
|
|
175
|
-
this.hasAvatarSlot = Boolean(options === null || options === void 0 ? void 0 : options.mentionNodeDataProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_node_avatar');
|
|
175
|
+
this.hasAvatarSlot = Boolean(options === null || options === void 0 ? void 0 : options.mentionNodeDataProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_node_avatar') || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_node_graphql_provider'));
|
|
176
176
|
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, toDOM(node, this.hasAvatarSlot)),
|
|
177
177
|
dom = _DOMSerializer$render.dom,
|
|
178
178
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
@@ -10,8 +10,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
12
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
13
|
-
var _types = require("@atlaskit/mention/types");
|
|
14
13
|
var _isResolvingMentionProvider = require("@atlaskit/mention/is-resolving-mention-provider");
|
|
14
|
+
var _types = require("@atlaskit/mention/types");
|
|
15
15
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
16
16
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
17
17
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
@@ -44,7 +44,7 @@ var ACTIONS = exports.ACTIONS = {
|
|
|
44
44
|
CLEAR_PENDING_PASTED_AGENT_MENTION: 'CLEAR_PENDING_PASTED_AGENT_MENTION'
|
|
45
45
|
};
|
|
46
46
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
47
|
-
var PACKAGE_VERSION = "21.0.
|
|
47
|
+
var PACKAGE_VERSION = "21.0.2";
|
|
48
48
|
var setProvider = function setProvider(provider) {
|
|
49
49
|
return function (state, dispatch) {
|
|
50
50
|
if (dispatch) {
|
|
@@ -17,34 +17,54 @@ 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 _reactLooselyLazy = require("react-loosely-lazy");
|
|
21
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
20
22
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
21
23
|
var _lazyProfileCard = require("@atlaskit/profilecard/lazy-profile-card");
|
|
22
24
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
23
25
|
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
24
26
|
var _PopperWrapper = require("./PopperWrapper");
|
|
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); }
|
|
27
|
+
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); } // oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
26
28
|
// eslint-disable-next-line require-unicode-regexp
|
|
27
29
|
var LEADING_AT_SIGN_RE = /^@/;
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
var loadAgentProfileCardResourced = function loadAgentProfileCardResourced() {
|
|
31
|
+
return Promise.resolve().then(function () {
|
|
32
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_editor-plugin-mentions-agent-profile-card-resourced" */
|
|
33
|
+
'@atlaskit/profilecard/agent-profile-card-resourced'));
|
|
34
|
+
}).then(function (_ref) {
|
|
35
|
+
var AgentProfileCardResourced = _ref.AgentProfileCardResourced;
|
|
36
|
+
return AgentProfileCardResourced;
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var AgentProfileCardResourcedLazy = (0, _reactLooselyLazy.lazyForPaint)(function () {
|
|
40
|
+
return Promise.resolve().then(function () {
|
|
41
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_editor-plugin-mentions-agent-profile-card-resourced" */
|
|
42
|
+
'@atlaskit/profilecard/agent-profile-card-resourced'));
|
|
43
|
+
}).then(function (_ref2) {
|
|
44
|
+
var AgentProfileCardResourced = _ref2.AgentProfileCardResourced;
|
|
45
|
+
return AgentProfileCardResourced;
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
var AgentProfileCardResourcedLoadable = (0, _reactLoadable.default)({
|
|
49
|
+
loader: loadAgentProfileCardResourced,
|
|
38
50
|
loading: function loading() {
|
|
39
51
|
return null;
|
|
40
52
|
}
|
|
41
53
|
});
|
|
54
|
+
var AgentProfileCardResourced = function AgentProfileCardResourced(props) {
|
|
55
|
+
return (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_loosely_lazy_migration') ? /*#__PURE__*/React.createElement(_reactLooselyLazy.LazySuspense, {
|
|
56
|
+
fallback: null
|
|
57
|
+
}, /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, props)) :
|
|
58
|
+
/*#__PURE__*/
|
|
59
|
+
// eslint-disable-next-line react/jsx-props-no-spreading -- forward the loader props to the profile card
|
|
60
|
+
React.createElement(AgentProfileCardResourcedLoadable, props);
|
|
61
|
+
};
|
|
42
62
|
var styles = {
|
|
43
63
|
loadingStyles: "_2rko12b0 _16qs130s"
|
|
44
64
|
};
|
|
45
|
-
var LoadingWrapper = function LoadingWrapper(
|
|
46
|
-
var children =
|
|
47
|
-
isLoading =
|
|
65
|
+
var LoadingWrapper = function LoadingWrapper(_ref3) {
|
|
66
|
+
var children = _ref3.children,
|
|
67
|
+
isLoading = _ref3.isLoading;
|
|
48
68
|
return isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
49
69
|
className: (0, _runtime.ax)([styles.loadingStyles])
|
|
50
70
|
}, children) : children;
|
|
@@ -52,9 +72,9 @@ var LoadingWrapper = function LoadingWrapper(_ref2) {
|
|
|
52
72
|
var isAgentMentionType = exports.isAgentMentionType = function isAgentMentionType(userType) {
|
|
53
73
|
return userType === 'APP' || userType === 'AGENT';
|
|
54
74
|
};
|
|
55
|
-
var useProfileCardState = exports.useProfileCardState = function useProfileCardState(
|
|
56
|
-
var id =
|
|
57
|
-
provider =
|
|
75
|
+
var useProfileCardState = exports.useProfileCardState = function useProfileCardState(_ref4) {
|
|
76
|
+
var id = _ref4.id,
|
|
77
|
+
provider = _ref4.provider;
|
|
58
78
|
var _useState = (0, _react.useState)(),
|
|
59
79
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
60
80
|
data = _useState2[0],
|
|
@@ -83,7 +103,7 @@ var useProfileCardState = exports.useProfileCardState = function useProfileCardS
|
|
|
83
103
|
// From: packages/people-and-teams/profilecard/src/components/User/ProfileCardTrigger.tsx
|
|
84
104
|
(0, _react.useEffect)(function () {
|
|
85
105
|
var fetchData = /*#__PURE__*/function () {
|
|
86
|
-
var
|
|
106
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
87
107
|
var _yield$Promise$all, _yield$Promise$all2, _data, reportingLines, shouldGiveKudos, _teamCentralBaseUrl, _t;
|
|
88
108
|
return _regenerator.default.wrap(function (_context) {
|
|
89
109
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -130,7 +150,7 @@ var useProfileCardState = exports.useProfileCardState = function useProfileCardS
|
|
|
130
150
|
}, _callee, null, [[2, 4, 5, 6]]);
|
|
131
151
|
}));
|
|
132
152
|
return function fetchData() {
|
|
133
|
-
return
|
|
153
|
+
return _ref5.apply(this, arguments);
|
|
134
154
|
};
|
|
135
155
|
}();
|
|
136
156
|
fetchData();
|
|
@@ -148,17 +168,17 @@ var useProfileCardState = exports.useProfileCardState = function useProfileCardS
|
|
|
148
168
|
/**
|
|
149
169
|
* Renders the profile card popup for an editor mention node.
|
|
150
170
|
*/
|
|
151
|
-
function ProfileCardComponent(
|
|
152
|
-
var
|
|
153
|
-
var profilecardProvider =
|
|
154
|
-
activeMention =
|
|
155
|
-
dom =
|
|
156
|
-
closeComponent =
|
|
157
|
-
onAgentMentionChatClick =
|
|
158
|
-
placement =
|
|
159
|
-
offset =
|
|
160
|
-
disableFocusTrap =
|
|
161
|
-
hideActions =
|
|
171
|
+
function ProfileCardComponent(_ref6) {
|
|
172
|
+
var _ref8;
|
|
173
|
+
var profilecardProvider = _ref6.profilecardProvider,
|
|
174
|
+
activeMention = _ref6.activeMention,
|
|
175
|
+
dom = _ref6.dom,
|
|
176
|
+
closeComponent = _ref6.closeComponent,
|
|
177
|
+
onAgentMentionChatClick = _ref6.onAgentMentionChatClick,
|
|
178
|
+
placement = _ref6.placement,
|
|
179
|
+
offset = _ref6.offset,
|
|
180
|
+
disableFocusTrap = _ref6.disableFocusTrap,
|
|
181
|
+
hideActions = _ref6.hideActions;
|
|
162
182
|
var _useState11 = (0, _react.useState)(undefined),
|
|
163
183
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
164
184
|
provider = _useState12[0],
|
|
@@ -168,11 +188,11 @@ function ProfileCardComponent(_ref5) {
|
|
|
168
188
|
setProvider(p);
|
|
169
189
|
});
|
|
170
190
|
}, [profilecardProvider]);
|
|
171
|
-
var
|
|
172
|
-
id =
|
|
173
|
-
text =
|
|
174
|
-
accessLevel =
|
|
175
|
-
userType =
|
|
191
|
+
var _ref7 = (_ref8 = activeMention.attrs) !== null && _ref8 !== void 0 ? _ref8 : {},
|
|
192
|
+
id = _ref7.id,
|
|
193
|
+
text = _ref7.text,
|
|
194
|
+
accessLevel = _ref7.accessLevel,
|
|
195
|
+
userType = _ref7.userType;
|
|
176
196
|
(0, _react.useEffect)(function () {
|
|
177
197
|
return (0, _bindEventListener.bind)(window, {
|
|
178
198
|
type: 'keydown',
|
|
@@ -225,12 +245,12 @@ function ProfileCardComponent(_ref5) {
|
|
|
225
245
|
hideActions: hideActions
|
|
226
246
|
}));
|
|
227
247
|
}
|
|
228
|
-
var UserProfileCardContent = function UserProfileCardContent(
|
|
229
|
-
var accessLevel =
|
|
230
|
-
id =
|
|
231
|
-
provider =
|
|
232
|
-
text =
|
|
233
|
-
hideActions =
|
|
248
|
+
var UserProfileCardContent = function UserProfileCardContent(_ref9) {
|
|
249
|
+
var accessLevel = _ref9.accessLevel,
|
|
250
|
+
id = _ref9.id,
|
|
251
|
+
provider = _ref9.provider,
|
|
252
|
+
text = _ref9.text,
|
|
253
|
+
hideActions = _ref9.hideActions;
|
|
234
254
|
var actions = (0, _react.useMemo)(function () {
|
|
235
255
|
return hideActions ? [] : provider === null || provider === void 0 ? void 0 : provider.getActions(id, text !== null && text !== void 0 ? text : '', accessLevel);
|
|
236
256
|
}, [hideActions, accessLevel, id, provider, text]);
|
|
@@ -271,14 +291,14 @@ var UserProfileCardContent = function UserProfileCardContent(_ref8) {
|
|
|
271
291
|
isRenderedInPortal: (0, _expValEquals.expValEquals)('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)
|
|
272
292
|
}));
|
|
273
293
|
};
|
|
274
|
-
var AgentProfileCardContent = function AgentProfileCardContent(
|
|
275
|
-
var accountId =
|
|
276
|
-
provider =
|
|
277
|
-
text =
|
|
278
|
-
onChatClick =
|
|
279
|
-
hideActions =
|
|
294
|
+
var AgentProfileCardContent = function AgentProfileCardContent(_ref0) {
|
|
295
|
+
var accountId = _ref0.accountId,
|
|
296
|
+
provider = _ref0.provider,
|
|
297
|
+
text = _ref0.text,
|
|
298
|
+
onChatClick = _ref0.onChatClick,
|
|
299
|
+
hideActions = _ref0.hideActions;
|
|
280
300
|
var agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
|
|
281
|
-
return (0, _expVal.expVal)('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(
|
|
301
|
+
return (0, _expVal.expVal)('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(AgentProfileCardResourced, {
|
|
282
302
|
accountId: accountId,
|
|
283
303
|
cloudId: provider.cloudId,
|
|
284
304
|
resourceClient: provider.resourceClient,
|
|
@@ -289,7 +309,7 @@ var AgentProfileCardContent = function AgentProfileCardContent(_ref9) {
|
|
|
289
309
|
hideStarButton: hideActions,
|
|
290
310
|
hideAiDisclaimer: hideActions,
|
|
291
311
|
showCreatorNameWithoutLink: hideActions
|
|
292
|
-
}) : /*#__PURE__*/React.createElement(
|
|
312
|
+
}) : /*#__PURE__*/React.createElement(AgentProfileCardResourced, {
|
|
293
313
|
accountId: accountId,
|
|
294
314
|
cloudId: provider.cloudId,
|
|
295
315
|
resourceClient: provider.resourceClient,
|
|
@@ -17,9 +17,9 @@ var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
|
17
17
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
18
18
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
19
19
|
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge/lozenge"));
|
|
20
|
-
var _styles = require("@atlaskit/mention/mention-item/styles");
|
|
21
|
-
var _mentionItem = _interopRequireDefault(require("@atlaskit/mention/mention-item"));
|
|
22
20
|
var _isResolvingMentionProvider = require("@atlaskit/mention/is-resolving-mention-provider");
|
|
21
|
+
var _mentionItem = _interopRequireDefault(require("@atlaskit/mention/mention-item"));
|
|
22
|
+
var _styles = require("@atlaskit/mention/mention-item/styles");
|
|
23
23
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
24
24
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
25
25
|
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
@@ -29,8 +29,8 @@ var _main = require("../../pm-plugins/main");
|
|
|
29
29
|
var _utils2 = require("../../pm-plugins/utils");
|
|
30
30
|
var _InviteItem = _interopRequireWildcard(require("../InviteItem"));
|
|
31
31
|
var _InviteItemWithEmailDomain = _interopRequireDefault(require("../InviteItem/InviteItemWithEmailDomain"));
|
|
32
|
-
var _analytics = require("./analytics");
|
|
33
32
|
var _AgentMentionLoadErrorItem = require("./AgentMentionLoadErrorItem");
|
|
33
|
+
var _analytics = require("./analytics");
|
|
34
34
|
var _MentionItemWithProfileCard = require("./MentionItemWithProfileCard");
|
|
35
35
|
var _utils3 = require("./utils");
|
|
36
36
|
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" != _typeof(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 _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -3,11 +3,11 @@ import { useIntl } from 'react-intl';
|
|
|
3
3
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
4
|
import { v4 as uuid } from 'uuid';
|
|
5
5
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import { IconMention } from '@atlaskit/editor-common/assets';
|
|
6
7
|
import { toolbarInsertBlockMessages as messages, mentionMessages } from '@atlaskit/editor-common/messages';
|
|
7
8
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
8
|
-
import { IconMention } from '@atlaskit/editor-common/assets';
|
|
9
|
-
import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
|
|
10
9
|
import { isPromise } from '@atlaskit/mention/is-promise';
|
|
10
|
+
import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
|
|
11
11
|
import { MentionNameStatus } from '@atlaskit/mention/types';
|
|
12
12
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -19,9 +19,9 @@ import { agentMentionPluginKey, createAgentMentionPlugin } from './pm-plugins/ag
|
|
|
19
19
|
import { mentionPluginKey } from './pm-plugins/key';
|
|
20
20
|
import { ACTIONS, createMentionPlugin } from './pm-plugins/main';
|
|
21
21
|
import { InlineInvitePopupContainer } from './ui/InlineInvitePopupContainer';
|
|
22
|
+
import { getMentionQuickInsertComponents } from './ui/quick-insert/getMentionQuickInsertComponents';
|
|
22
23
|
import { SecondaryToolbarComponent } from './ui/SecondaryToolbarComponent';
|
|
23
24
|
import { createTypeAheadConfig } from './ui/type-ahead';
|
|
24
|
-
import { getMentionQuickInsertComponents } from './ui/quick-insert/getMentionQuickInsertComponents';
|
|
25
25
|
const processName = (name, intl) => {
|
|
26
26
|
const unknownLabel = intl.formatMessage(mentionMessages.unknownLabel);
|
|
27
27
|
if (name.status === MentionNameStatus.OK) {
|
|
@@ -135,7 +135,7 @@ export class MentionNodeView {
|
|
|
135
135
|
portalProviderAPI,
|
|
136
136
|
editorView
|
|
137
137
|
} = config;
|
|
138
|
-
this.hasAvatarSlot = Boolean(options === null || options === void 0 ? void 0 : options.mentionNodeDataProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && isExperimentEnabled('platform_editor_mention_node_avatar');
|
|
138
|
+
this.hasAvatarSlot = Boolean(options === null || options === void 0 ? void 0 : options.mentionNodeDataProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && (isExperimentEnabled('platform_editor_mention_node_avatar') || isExperimentEnabled('platform_editor_mention_node_graphql_provider'));
|
|
139
139
|
const {
|
|
140
140
|
dom,
|
|
141
141
|
contentDOM
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import { MentionNameStatus } from '@atlaskit/mention/types';
|
|
5
4
|
import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
|
|
5
|
+
import { MentionNameStatus } from '@atlaskit/mention/types';
|
|
6
6
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
@@ -33,7 +33,7 @@ export const ACTIONS = {
|
|
|
33
33
|
CLEAR_PENDING_PASTED_AGENT_MENTION: 'CLEAR_PENDING_PASTED_AGENT_MENTION'
|
|
34
34
|
};
|
|
35
35
|
const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
36
|
-
const PACKAGE_VERSION = "21.0.
|
|
36
|
+
const PACKAGE_VERSION = "21.0.2";
|
|
37
37
|
const setProvider = provider => (state, dispatch) => {
|
|
38
38
|
if (dispatch) {
|
|
39
39
|
dispatch(state.tr.setMeta(mentionPluginKey, {
|
|
@@ -5,6 +5,9 @@ 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
|
+
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
9
|
+
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
10
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
8
11
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
12
|
import { ProfileCardLazy } from '@atlaskit/profilecard/lazy-profile-card';
|
|
10
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -13,13 +16,24 @@ import { Popup } from './PopperWrapper';
|
|
|
13
16
|
|
|
14
17
|
// eslint-disable-next-line require-unicode-regexp
|
|
15
18
|
const LEADING_AT_SIGN_RE = /^@/;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const loadAgentProfileCardResourced = () => import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-mentions-agent-profile-card-resourced" */
|
|
20
|
+
'@atlaskit/profilecard/agent-profile-card-resourced').then(({
|
|
21
|
+
AgentProfileCardResourced
|
|
22
|
+
}) => AgentProfileCardResourced);
|
|
23
|
+
const AgentProfileCardResourcedLazy = lazyForPaint(() => import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-mentions-agent-profile-card-resourced" */
|
|
24
|
+
'@atlaskit/profilecard/agent-profile-card-resourced').then(({
|
|
25
|
+
AgentProfileCardResourced
|
|
26
|
+
}) => AgentProfileCardResourced));
|
|
27
|
+
const AgentProfileCardResourcedLoadable = Loadable({
|
|
28
|
+
loader: loadAgentProfileCardResourced,
|
|
21
29
|
loading: () => null
|
|
22
30
|
});
|
|
31
|
+
const AgentProfileCardResourced = props => isExperimentEnabled('platform_editor_loosely_lazy_migration') ? /*#__PURE__*/React.createElement(LazySuspense, {
|
|
32
|
+
fallback: null
|
|
33
|
+
}, /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, props)) :
|
|
34
|
+
/*#__PURE__*/
|
|
35
|
+
// eslint-disable-next-line react/jsx-props-no-spreading -- forward the loader props to the profile card
|
|
36
|
+
React.createElement(AgentProfileCardResourcedLoadable, props);
|
|
23
37
|
const styles = {
|
|
24
38
|
loadingStyles: "_2rko12b0 _16qs130s"
|
|
25
39
|
};
|
|
@@ -209,7 +223,7 @@ const AgentProfileCardContent = ({
|
|
|
209
223
|
hideActions
|
|
210
224
|
}) => {
|
|
211
225
|
const agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
|
|
212
|
-
return expVal('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(
|
|
226
|
+
return expVal('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(AgentProfileCardResourced, {
|
|
213
227
|
accountId: accountId,
|
|
214
228
|
cloudId: provider.cloudId,
|
|
215
229
|
resourceClient: provider.resourceClient,
|
|
@@ -220,7 +234,7 @@ const AgentProfileCardContent = ({
|
|
|
220
234
|
hideStarButton: hideActions,
|
|
221
235
|
hideAiDisclaimer: hideActions,
|
|
222
236
|
showCreatorNameWithoutLink: hideActions
|
|
223
|
-
}) : /*#__PURE__*/React.createElement(
|
|
237
|
+
}) : /*#__PURE__*/React.createElement(AgentProfileCardResourced, {
|
|
224
238
|
accountId: accountId,
|
|
225
239
|
cloudId: provider.cloudId,
|
|
226
240
|
resourceClient: provider.resourceClient,
|
|
@@ -7,9 +7,9 @@ import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
|
7
7
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
9
9
|
import Lozenge from '@atlaskit/lozenge/lozenge';
|
|
10
|
-
import { MENTION_ITEM_HEIGHT, MENTION_ITEM_HEIGHT_REFRESHED } from '@atlaskit/mention/mention-item/styles';
|
|
11
|
-
import MentionItem from '@atlaskit/mention/mention-item';
|
|
12
10
|
import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
|
|
11
|
+
import MentionItem from '@atlaskit/mention/mention-item';
|
|
12
|
+
import { MENTION_ITEM_HEIGHT, MENTION_ITEM_HEIGHT_REFRESHED } from '@atlaskit/mention/mention-item/styles';
|
|
13
13
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
15
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
@@ -19,8 +19,8 @@ import { ACTIONS } from '../../pm-plugins/main';
|
|
|
19
19
|
import { getMentionPluginState } from '../../pm-plugins/utils';
|
|
20
20
|
import InviteItem, { INVITE_ITEM_DESCRIPTION } from '../InviteItem';
|
|
21
21
|
import InviteItemWithEmailDomain from '../InviteItem/InviteItemWithEmailDomain';
|
|
22
|
-
import { buildTypeAheadCancelPayload, buildTypeAheadInsertedPayload, buildTypeAheadInviteItemClickedPayload, buildTypeAheadInviteItemViewedPayload, buildTypeAheadRenderedPayload } from './analytics';
|
|
23
22
|
import { AgentMentionLoadErrorItem } from './AgentMentionLoadErrorItem';
|
|
23
|
+
import { buildTypeAheadCancelPayload, buildTypeAheadInsertedPayload, buildTypeAheadInviteItemClickedPayload, buildTypeAheadInviteItemViewedPayload, buildTypeAheadRenderedPayload } from './analytics';
|
|
24
24
|
import { MentionItemWithProfileCard } from './MentionItemWithProfileCard';
|
|
25
25
|
import { isAgentMention, isAgentMentionLoadError, isBotOrTeamMention, isExplicitAgentMention, isInviteItem, isTeamStats, isTeamType, orderMentionsForDisplay, shouldKeepInviteItem } from './utils';
|
|
26
26
|
const isAgentTypeAheadItem = item => item.mention ? isAgentMention(item.mention) : false;
|
|
@@ -10,11 +10,11 @@ import { useIntl } from 'react-intl';
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
11
11
|
import { v4 as uuid } from 'uuid';
|
|
12
12
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
13
|
+
import { IconMention } from '@atlaskit/editor-common/assets';
|
|
13
14
|
import { toolbarInsertBlockMessages as messages, mentionMessages } from '@atlaskit/editor-common/messages';
|
|
14
15
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
15
|
-
import { IconMention } from '@atlaskit/editor-common/assets';
|
|
16
|
-
import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
|
|
17
16
|
import { isPromise } from '@atlaskit/mention/is-promise';
|
|
17
|
+
import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
|
|
18
18
|
import { MentionNameStatus } from '@atlaskit/mention/types';
|
|
19
19
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
20
20
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -26,9 +26,9 @@ import { agentMentionPluginKey, createAgentMentionPlugin } from './pm-plugins/ag
|
|
|
26
26
|
import { mentionPluginKey } from './pm-plugins/key';
|
|
27
27
|
import { ACTIONS, createMentionPlugin } from './pm-plugins/main';
|
|
28
28
|
import { InlineInvitePopupContainer } from './ui/InlineInvitePopupContainer';
|
|
29
|
+
import { getMentionQuickInsertComponents } from './ui/quick-insert/getMentionQuickInsertComponents';
|
|
29
30
|
import { SecondaryToolbarComponent } from './ui/SecondaryToolbarComponent';
|
|
30
31
|
import { createTypeAheadConfig } from './ui/type-ahead';
|
|
31
|
-
import { getMentionQuickInsertComponents } from './ui/quick-insert/getMentionQuickInsertComponents';
|
|
32
32
|
var processName = function processName(name, intl) {
|
|
33
33
|
var unknownLabel = intl.formatMessage(mentionMessages.unknownLabel);
|
|
34
34
|
if (name.status === MentionNameStatus.OK) {
|
|
@@ -167,7 +167,7 @@ export var MentionNodeView = /*#__PURE__*/function () {
|
|
|
167
167
|
api = config.api,
|
|
168
168
|
portalProviderAPI = config.portalProviderAPI,
|
|
169
169
|
editorView = config.editorView;
|
|
170
|
-
this.hasAvatarSlot = Boolean(options === null || options === void 0 ? void 0 : options.mentionNodeDataProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && isExperimentEnabled('platform_editor_mention_node_avatar');
|
|
170
|
+
this.hasAvatarSlot = Boolean(options === null || options === void 0 ? void 0 : options.mentionNodeDataProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && (isExperimentEnabled('platform_editor_mention_node_avatar') || isExperimentEnabled('platform_editor_mention_node_graphql_provider'));
|
|
171
171
|
var _DOMSerializer$render = DOMSerializer.renderSpec(document, toDOM(node, this.hasAvatarSlot)),
|
|
172
172
|
dom = _DOMSerializer$render.dom,
|
|
173
173
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
@@ -8,8 +8,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
8
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
9
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
11
|
-
import { MentionNameStatus } from '@atlaskit/mention/types';
|
|
12
11
|
import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
|
|
12
|
+
import { MentionNameStatus } from '@atlaskit/mention/types';
|
|
13
13
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
15
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
@@ -36,7 +36,7 @@ export var ACTIONS = {
|
|
|
36
36
|
CLEAR_PENDING_PASTED_AGENT_MENTION: 'CLEAR_PENDING_PASTED_AGENT_MENTION'
|
|
37
37
|
};
|
|
38
38
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
39
|
-
var PACKAGE_VERSION = "21.0.
|
|
39
|
+
var PACKAGE_VERSION = "21.0.2";
|
|
40
40
|
var setProvider = function setProvider(provider) {
|
|
41
41
|
return function (state, dispatch) {
|
|
42
42
|
if (dispatch) {
|
|
@@ -8,6 +8,9 @@ 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
|
+
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
12
|
+
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
13
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
11
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
15
|
import { ProfileCardLazy } from '@atlaskit/profilecard/lazy-profile-card';
|
|
13
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -16,24 +19,40 @@ import { Popup } from './PopperWrapper';
|
|
|
16
19
|
|
|
17
20
|
// eslint-disable-next-line require-unicode-regexp
|
|
18
21
|
var LEADING_AT_SIGN_RE = /^@/;
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
var loadAgentProfileCardResourced = function loadAgentProfileCardResourced() {
|
|
23
|
+
return import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-mentions-agent-profile-card-resourced" */
|
|
24
|
+
'@atlaskit/profilecard/agent-profile-card-resourced').then(function (_ref) {
|
|
25
|
+
var AgentProfileCardResourced = _ref.AgentProfileCardResourced;
|
|
26
|
+
return AgentProfileCardResourced;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var AgentProfileCardResourcedLazy = lazyForPaint(function () {
|
|
30
|
+
return import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-mentions-agent-profile-card-resourced" */
|
|
31
|
+
'@atlaskit/profilecard/agent-profile-card-resourced').then(function (_ref2) {
|
|
32
|
+
var AgentProfileCardResourced = _ref2.AgentProfileCardResourced;
|
|
33
|
+
return AgentProfileCardResourced;
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
var AgentProfileCardResourcedLoadable = Loadable({
|
|
37
|
+
loader: loadAgentProfileCardResourced,
|
|
27
38
|
loading: function loading() {
|
|
28
39
|
return null;
|
|
29
40
|
}
|
|
30
41
|
});
|
|
42
|
+
var AgentProfileCardResourced = function AgentProfileCardResourced(props) {
|
|
43
|
+
return isExperimentEnabled('platform_editor_loosely_lazy_migration') ? /*#__PURE__*/React.createElement(LazySuspense, {
|
|
44
|
+
fallback: null
|
|
45
|
+
}, /*#__PURE__*/React.createElement(AgentProfileCardResourcedLazy, props)) :
|
|
46
|
+
/*#__PURE__*/
|
|
47
|
+
// eslint-disable-next-line react/jsx-props-no-spreading -- forward the loader props to the profile card
|
|
48
|
+
React.createElement(AgentProfileCardResourcedLoadable, props);
|
|
49
|
+
};
|
|
31
50
|
var styles = {
|
|
32
51
|
loadingStyles: "_2rko12b0 _16qs130s"
|
|
33
52
|
};
|
|
34
|
-
var LoadingWrapper = function LoadingWrapper(
|
|
35
|
-
var children =
|
|
36
|
-
isLoading =
|
|
53
|
+
var LoadingWrapper = function LoadingWrapper(_ref3) {
|
|
54
|
+
var children = _ref3.children,
|
|
55
|
+
isLoading = _ref3.isLoading;
|
|
37
56
|
return isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
38
57
|
className: ax([styles.loadingStyles])
|
|
39
58
|
}, children) : children;
|
|
@@ -41,9 +60,9 @@ var LoadingWrapper = function LoadingWrapper(_ref2) {
|
|
|
41
60
|
export var isAgentMentionType = function isAgentMentionType(userType) {
|
|
42
61
|
return userType === 'APP' || userType === 'AGENT';
|
|
43
62
|
};
|
|
44
|
-
export var useProfileCardState = function useProfileCardState(
|
|
45
|
-
var id =
|
|
46
|
-
provider =
|
|
63
|
+
export var useProfileCardState = function useProfileCardState(_ref4) {
|
|
64
|
+
var id = _ref4.id,
|
|
65
|
+
provider = _ref4.provider;
|
|
47
66
|
var _useState = useState(),
|
|
48
67
|
_useState2 = _slicedToArray(_useState, 2),
|
|
49
68
|
data = _useState2[0],
|
|
@@ -72,7 +91,7 @@ export var useProfileCardState = function useProfileCardState(_ref3) {
|
|
|
72
91
|
// From: packages/people-and-teams/profilecard/src/components/User/ProfileCardTrigger.tsx
|
|
73
92
|
useEffect(function () {
|
|
74
93
|
var fetchData = /*#__PURE__*/function () {
|
|
75
|
-
var
|
|
94
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
76
95
|
var _yield$Promise$all, _yield$Promise$all2, _data, reportingLines, shouldGiveKudos, _teamCentralBaseUrl, _t;
|
|
77
96
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
78
97
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -119,7 +138,7 @@ export var useProfileCardState = function useProfileCardState(_ref3) {
|
|
|
119
138
|
}, _callee, null, [[2, 4, 5, 6]]);
|
|
120
139
|
}));
|
|
121
140
|
return function fetchData() {
|
|
122
|
-
return
|
|
141
|
+
return _ref5.apply(this, arguments);
|
|
123
142
|
};
|
|
124
143
|
}();
|
|
125
144
|
fetchData();
|
|
@@ -137,17 +156,17 @@ export var useProfileCardState = function useProfileCardState(_ref3) {
|
|
|
137
156
|
/**
|
|
138
157
|
* Renders the profile card popup for an editor mention node.
|
|
139
158
|
*/
|
|
140
|
-
export function ProfileCardComponent(
|
|
141
|
-
var
|
|
142
|
-
var profilecardProvider =
|
|
143
|
-
activeMention =
|
|
144
|
-
dom =
|
|
145
|
-
closeComponent =
|
|
146
|
-
onAgentMentionChatClick =
|
|
147
|
-
placement =
|
|
148
|
-
offset =
|
|
149
|
-
disableFocusTrap =
|
|
150
|
-
hideActions =
|
|
159
|
+
export function ProfileCardComponent(_ref6) {
|
|
160
|
+
var _ref8;
|
|
161
|
+
var profilecardProvider = _ref6.profilecardProvider,
|
|
162
|
+
activeMention = _ref6.activeMention,
|
|
163
|
+
dom = _ref6.dom,
|
|
164
|
+
closeComponent = _ref6.closeComponent,
|
|
165
|
+
onAgentMentionChatClick = _ref6.onAgentMentionChatClick,
|
|
166
|
+
placement = _ref6.placement,
|
|
167
|
+
offset = _ref6.offset,
|
|
168
|
+
disableFocusTrap = _ref6.disableFocusTrap,
|
|
169
|
+
hideActions = _ref6.hideActions;
|
|
151
170
|
var _useState11 = useState(undefined),
|
|
152
171
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
153
172
|
provider = _useState12[0],
|
|
@@ -157,11 +176,11 @@ export function ProfileCardComponent(_ref5) {
|
|
|
157
176
|
setProvider(p);
|
|
158
177
|
});
|
|
159
178
|
}, [profilecardProvider]);
|
|
160
|
-
var
|
|
161
|
-
id =
|
|
162
|
-
text =
|
|
163
|
-
accessLevel =
|
|
164
|
-
userType =
|
|
179
|
+
var _ref7 = (_ref8 = activeMention.attrs) !== null && _ref8 !== void 0 ? _ref8 : {},
|
|
180
|
+
id = _ref7.id,
|
|
181
|
+
text = _ref7.text,
|
|
182
|
+
accessLevel = _ref7.accessLevel,
|
|
183
|
+
userType = _ref7.userType;
|
|
165
184
|
useEffect(function () {
|
|
166
185
|
return bind(window, {
|
|
167
186
|
type: 'keydown',
|
|
@@ -214,12 +233,12 @@ export function ProfileCardComponent(_ref5) {
|
|
|
214
233
|
hideActions: hideActions
|
|
215
234
|
}));
|
|
216
235
|
}
|
|
217
|
-
var UserProfileCardContent = function UserProfileCardContent(
|
|
218
|
-
var accessLevel =
|
|
219
|
-
id =
|
|
220
|
-
provider =
|
|
221
|
-
text =
|
|
222
|
-
hideActions =
|
|
236
|
+
var UserProfileCardContent = function UserProfileCardContent(_ref9) {
|
|
237
|
+
var accessLevel = _ref9.accessLevel,
|
|
238
|
+
id = _ref9.id,
|
|
239
|
+
provider = _ref9.provider,
|
|
240
|
+
text = _ref9.text,
|
|
241
|
+
hideActions = _ref9.hideActions;
|
|
223
242
|
var actions = useMemo(function () {
|
|
224
243
|
return hideActions ? [] : provider === null || provider === void 0 ? void 0 : provider.getActions(id, text !== null && text !== void 0 ? text : '', accessLevel);
|
|
225
244
|
}, [hideActions, accessLevel, id, provider, text]);
|
|
@@ -260,14 +279,14 @@ var UserProfileCardContent = function UserProfileCardContent(_ref8) {
|
|
|
260
279
|
isRenderedInPortal: expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)
|
|
261
280
|
}));
|
|
262
281
|
};
|
|
263
|
-
var AgentProfileCardContent = function AgentProfileCardContent(
|
|
264
|
-
var accountId =
|
|
265
|
-
provider =
|
|
266
|
-
text =
|
|
267
|
-
onChatClick =
|
|
268
|
-
hideActions =
|
|
282
|
+
var AgentProfileCardContent = function AgentProfileCardContent(_ref0) {
|
|
283
|
+
var accountId = _ref0.accountId,
|
|
284
|
+
provider = _ref0.provider,
|
|
285
|
+
text = _ref0.text,
|
|
286
|
+
onChatClick = _ref0.onChatClick,
|
|
287
|
+
hideActions = _ref0.hideActions;
|
|
269
288
|
var agentName = (text !== null && text !== void 0 ? text : '').replace(LEADING_AT_SIGN_RE, '');
|
|
270
|
-
return expVal('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(
|
|
289
|
+
return expVal('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? /*#__PURE__*/React.createElement(AgentProfileCardResourced, {
|
|
271
290
|
accountId: accountId,
|
|
272
291
|
cloudId: provider.cloudId,
|
|
273
292
|
resourceClient: provider.resourceClient,
|
|
@@ -278,7 +297,7 @@ var AgentProfileCardContent = function AgentProfileCardContent(_ref9) {
|
|
|
278
297
|
hideStarButton: hideActions,
|
|
279
298
|
hideAiDisclaimer: hideActions,
|
|
280
299
|
showCreatorNameWithoutLink: hideActions
|
|
281
|
-
}) : /*#__PURE__*/React.createElement(
|
|
300
|
+
}) : /*#__PURE__*/React.createElement(AgentProfileCardResourced, {
|
|
282
301
|
accountId: accountId,
|
|
283
302
|
cloudId: provider.cloudId,
|
|
284
303
|
resourceClient: provider.resourceClient,
|
|
@@ -14,9 +14,9 @@ import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
|
14
14
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
15
15
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
16
16
|
import Lozenge from '@atlaskit/lozenge/lozenge';
|
|
17
|
-
import { MENTION_ITEM_HEIGHT, MENTION_ITEM_HEIGHT_REFRESHED } from '@atlaskit/mention/mention-item/styles';
|
|
18
|
-
import MentionItem from '@atlaskit/mention/mention-item';
|
|
19
17
|
import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
|
|
18
|
+
import MentionItem from '@atlaskit/mention/mention-item';
|
|
19
|
+
import { MENTION_ITEM_HEIGHT, MENTION_ITEM_HEIGHT_REFRESHED } from '@atlaskit/mention/mention-item/styles';
|
|
20
20
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
22
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
@@ -26,8 +26,8 @@ import { ACTIONS } from '../../pm-plugins/main';
|
|
|
26
26
|
import { getMentionPluginState } from '../../pm-plugins/utils';
|
|
27
27
|
import InviteItem, { INVITE_ITEM_DESCRIPTION } from '../InviteItem';
|
|
28
28
|
import InviteItemWithEmailDomain from '../InviteItem/InviteItemWithEmailDomain';
|
|
29
|
-
import { buildTypeAheadCancelPayload, buildTypeAheadInsertedPayload, buildTypeAheadInviteItemClickedPayload, buildTypeAheadInviteItemViewedPayload, buildTypeAheadRenderedPayload } from './analytics';
|
|
30
29
|
import { AgentMentionLoadErrorItem } from './AgentMentionLoadErrorItem';
|
|
30
|
+
import { buildTypeAheadCancelPayload, buildTypeAheadInsertedPayload, buildTypeAheadInviteItemClickedPayload, buildTypeAheadInviteItemViewedPayload, buildTypeAheadRenderedPayload } from './analytics';
|
|
31
31
|
import { MentionItemWithProfileCard } from './MentionItemWithProfileCard';
|
|
32
32
|
import { isAgentMention, isAgentMentionLoadError, isBotOrTeamMention, isExplicitAgentMention, isInviteItem, isTeamStats, isTeamType, orderMentionsForDisplay, shouldKeepInviteItem } from './utils';
|
|
33
33
|
var isAgentTypeAheadItem = function isAgentTypeAheadItem(item) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { MentionNodeDataProvider } from '../providers/mention-node-data-provider';
|
|
2
|
-
export type { FetchMentionNodeData } from '../providers/mention-node-data-provider';
|
|
2
|
+
export type { FetchMentionNodeData, ResolveMentionNodeData, } from '../providers/mention-node-data-provider';
|
|
@@ -3,9 +3,9 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
3
3
|
import type { BasePlugin } from '@atlaskit/editor-plugin-base';
|
|
4
4
|
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
5
5
|
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
6
|
-
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry';
|
|
7
6
|
import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead/type-ahead-plugin-type';
|
|
8
7
|
import type { TypeAheadInputMethod } from '@atlaskit/editor-plugin-type-ahead/types';
|
|
8
|
+
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry';
|
|
9
9
|
import type { MentionProvider } from '@atlaskit/mention/types';
|
|
10
10
|
import type { InsertMentionParameters } from './editor-commands';
|
|
11
11
|
import type { AgentRunStateByLocalId, MentionChange, MentionPluginOptions, MentionSharedState } from './types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MentionAttributes } from '@atlaskit/adf-schema/mention';
|
|
2
1
|
import type { DocNode } from '@atlaskit/adf-schema/doc';
|
|
2
|
+
import type { MentionAttributes } from '@atlaskit/adf-schema/mention';
|
|
3
3
|
import type { ProfilecardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { Placement } from '@atlaskit/popper/main';
|
|
5
5
|
import type { ProfileCardClientData, TeamCentralReportingLinesData } from '@atlaskit/profilecard/types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-mentions",
|
|
3
|
-
"version": "21.0
|
|
3
|
+
"version": "21.1.0",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/section-message": "^10.2.0",
|
|
48
48
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
49
49
|
"@atlaskit/theme": "^28.2.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^201.0.0",
|
|
51
51
|
"@atlaskit/tokens": "^18.2.0",
|
|
52
52
|
"@atlaskit/tooltip": "^24.3.0",
|
|
53
53
|
"@atlaskit/user-picker": "^13.13.0",
|
|
@@ -56,17 +56,18 @@
|
|
|
56
56
|
"bind-event-listener": "^3.0.0",
|
|
57
57
|
"focus-trap": "^2.4.5",
|
|
58
58
|
"react-loadable": "^5.1.0",
|
|
59
|
+
"react-loosely-lazy": "^1.0.0",
|
|
59
60
|
"uuid": "^11.1.1"
|
|
60
61
|
},
|
|
61
62
|
"peerDependencies": {
|
|
62
|
-
"@atlaskit/editor-common": "^123.
|
|
63
|
+
"@atlaskit/editor-common": "^123.4.0",
|
|
63
64
|
"react": "^18.2.0 || ^19.2.0",
|
|
64
65
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
65
66
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
68
|
-
"@atlaskit/button": "^25.
|
|
69
|
-
"@atlaskit/editor-core": "^229.
|
|
69
|
+
"@atlaskit/button": "^25.4.0",
|
|
70
|
+
"@atlaskit/editor-core": "^229.1.0",
|
|
70
71
|
"@atlassian/workbench": "workspace:*",
|
|
71
72
|
"@testing-library/react": "^16.3.0",
|
|
72
73
|
"react": "^19.2.0",
|