@atlaskit/editor-common 123.5.1 → 123.6.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 +13 -0
- package/dist/cjs/analytics/types/insert-events.js +3 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +2 -0
- package/dist/cjs/ui/Mention/mention-with-providers.js +68 -8
- package/dist/es2019/analytics/types/insert-events.js +2 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +2 -0
- package/dist/es2019/ui/Mention/mention-with-providers.js +35 -2
- package/dist/esm/analytics/types/insert-events.js +2 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Mention/mention-with-profilecard.js +2 -0
- package/dist/esm/ui/Mention/mention-with-providers.js +67 -7
- package/dist/types/analytics/types/insert-events.d.ts +3 -2
- package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 123.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ca3c3208ca55b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ca3c3208ca55b) -
|
|
8
|
+
EDITOR-8673 Add template gallery snippet insertion through the editor snippets plugin, with
|
|
9
|
+
completion callbacks and a template gallery input source, behind
|
|
10
|
+
`platform_editor_snippets_plugin_confluence`.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 123.5.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.USER_CONTEXT = exports.LINK_STATUS = exports.LINK_RESOURCE = exports.LINK_REPRESENTATION = void 0;
|
|
6
|
+
exports.USER_CONTEXT = exports.TEMPLATE_GALLERY_INPUT_SOURCE = exports.LINK_STATUS = exports.LINK_RESOURCE = exports.LINK_REPRESENTATION = void 0;
|
|
7
7
|
var USER_CONTEXT = exports.USER_CONTEXT = /*#__PURE__*/function (USER_CONTEXT) {
|
|
8
8
|
USER_CONTEXT["EDIT"] = "edit";
|
|
9
9
|
USER_CONTEXT["NEW"] = "new";
|
|
@@ -37,4 +37,5 @@ var LINK_RESOURCE = exports.LINK_RESOURCE = /*#__PURE__*/function (LINK_RESOURCE
|
|
|
37
37
|
LINK_RESOURCE["TWITTER"] = "twitterTweet";
|
|
38
38
|
LINK_RESOURCE["OTHER"] = "other";
|
|
39
39
|
return LINK_RESOURCE;
|
|
40
|
-
}({});
|
|
40
|
+
}({});
|
|
41
|
+
var TEMPLATE_GALLERY_INPUT_SOURCE = exports.TEMPLATE_GALLERY_INPUT_SOURCE = 'templateGallery';
|
|
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
27
27
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
28
28
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
29
29
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
30
|
-
var packageVersion = "123.5.
|
|
30
|
+
var packageVersion = "123.5.1";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "123.5.
|
|
27
|
+
var packageVersion = "123.5.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -56,6 +56,7 @@ function MentionWithProfileCard(_ref) {
|
|
|
56
56
|
onMouseEnter = _ref.onMouseEnter,
|
|
57
57
|
onMouseLeave = _ref.onMouseLeave,
|
|
58
58
|
renderAvatarSlot = _ref.renderAvatarSlot,
|
|
59
|
+
isRovoChat = _ref.isRovoChat,
|
|
59
60
|
localId = _ref.localId,
|
|
60
61
|
ssrPlaceholderId = _ref.ssrPlaceholderId,
|
|
61
62
|
userType = _ref.userType;
|
|
@@ -78,6 +79,7 @@ function MentionWithProfileCard(_ref) {
|
|
|
78
79
|
onMouseEnter: onMouseEnter,
|
|
79
80
|
onMouseLeave: onMouseLeave,
|
|
80
81
|
renderAvatarSlot: renderAvatarSlot,
|
|
82
|
+
isRovoChat: isRovoChat,
|
|
81
83
|
ssrPlaceholderId: ssrPlaceholderId
|
|
82
84
|
});
|
|
83
85
|
|
|
@@ -8,12 +8,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.MentionWithProviders = exports.MentionWithAvatarProviders = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
15
|
var _resourcedMention = _interopRequireDefault(require("@atlaskit/mention/resourced-mention"));
|
|
16
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
14
17
|
var _mentionWithProfilecard = _interopRequireDefault(require("./mention-with-profilecard"));
|
|
15
18
|
var _excluded = ["id", "mentionNodeDataProvider", "userType"];
|
|
16
|
-
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
|
|
19
|
+
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 _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); }
|
|
17
20
|
var GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
|
|
18
21
|
var useMentionNodeData = function useMentionNodeData(_ref) {
|
|
19
22
|
var _state$data;
|
|
@@ -77,6 +80,10 @@ var MentionWithProviders = exports.MentionWithProviders = /*#__PURE__*/_react.de
|
|
|
77
80
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
78
81
|
profilecardProvider = _useState4[0],
|
|
79
82
|
setProfilecardProvider = _useState4[1];
|
|
83
|
+
var _useState5 = (0, _react.useState)((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_rovo') && Boolean(mentionNodeData === null || mentionNodeData === void 0 ? void 0 : mentionNodeData.isRovoChat)),
|
|
84
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
85
|
+
isRovoChat = _useState6[0],
|
|
86
|
+
setIsRovoChat = _useState6[1];
|
|
80
87
|
var mountedRef = (0, _react.useRef)(true);
|
|
81
88
|
(0, _react.useLayoutEffect)(function () {
|
|
82
89
|
mountedRef.current = true;
|
|
@@ -99,6 +106,57 @@ var MentionWithProviders = exports.MentionWithProviders = /*#__PURE__*/_react.de
|
|
|
99
106
|
}
|
|
100
107
|
});
|
|
101
108
|
}, [profilecardProviderResolver]);
|
|
109
|
+
(0, _react.useEffect)(function () {
|
|
110
|
+
if (mentionNodeData !== null && mentionNodeData !== void 0 && mentionNodeData.isRovoChat) {
|
|
111
|
+
setIsRovoChat((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_rovo'));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (!(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_rovo') || !mentionProvider) {
|
|
115
|
+
setIsRovoChat(false);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
var isActive = true;
|
|
119
|
+
var resolveRovoChatIdentity = /*#__PURE__*/function () {
|
|
120
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
121
|
+
var _provider$getRovoChat, provider, identityAccountId, _t;
|
|
122
|
+
return _regenerator.default.wrap(function (_context) {
|
|
123
|
+
while (1) switch (_context.prev = _context.next) {
|
|
124
|
+
case 0:
|
|
125
|
+
_context.prev = 0;
|
|
126
|
+
_context.next = 1;
|
|
127
|
+
return mentionProvider;
|
|
128
|
+
case 1:
|
|
129
|
+
provider = _context.sent;
|
|
130
|
+
_context.next = 2;
|
|
131
|
+
return (_provider$getRovoChat = provider.getRovoChatAgentIdentityAccountId) === null || _provider$getRovoChat === void 0 ? void 0 : _provider$getRovoChat.call(provider);
|
|
132
|
+
case 2:
|
|
133
|
+
identityAccountId = _context.sent;
|
|
134
|
+
if (isActive) {
|
|
135
|
+
setIsRovoChat(identityAccountId !== undefined && identityAccountId === id);
|
|
136
|
+
}
|
|
137
|
+
_context.next = 4;
|
|
138
|
+
break;
|
|
139
|
+
case 3:
|
|
140
|
+
_context.prev = 3;
|
|
141
|
+
_t = _context["catch"](0);
|
|
142
|
+
if (isActive) {
|
|
143
|
+
setIsRovoChat(false);
|
|
144
|
+
}
|
|
145
|
+
case 4:
|
|
146
|
+
case "end":
|
|
147
|
+
return _context.stop();
|
|
148
|
+
}
|
|
149
|
+
}, _callee, null, [[0, 3]]);
|
|
150
|
+
}));
|
|
151
|
+
return function resolveRovoChatIdentity() {
|
|
152
|
+
return _ref3.apply(this, arguments);
|
|
153
|
+
};
|
|
154
|
+
}();
|
|
155
|
+
void resolveRovoChatIdentity();
|
|
156
|
+
return function () {
|
|
157
|
+
isActive = false;
|
|
158
|
+
};
|
|
159
|
+
}, [id, mentionNodeData === null || mentionNodeData === void 0 ? void 0 : mentionNodeData.isRovoChat, mentionProvider]);
|
|
102
160
|
var MentionComponent = profilecardProvider && profilecardProviderResolver && GENERIC_USER_IDS.indexOf(id) === -1 ? _mentionWithProfilecard.default : _resourcedMention.default;
|
|
103
161
|
var ssrPlaceholderId = "mention-".concat(id);
|
|
104
162
|
|
|
@@ -120,7 +178,8 @@ var MentionWithProviders = exports.MentionWithProviders = /*#__PURE__*/_react.de
|
|
|
120
178
|
onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
|
|
121
179
|
onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
|
|
122
180
|
renderAvatarSlot: renderAvatarSlot,
|
|
123
|
-
ssrPlaceholderId: ssrPlaceholderId
|
|
181
|
+
ssrPlaceholderId: ssrPlaceholderId,
|
|
182
|
+
isRovoChat: isRovoChat
|
|
124
183
|
});
|
|
125
184
|
}
|
|
126
185
|
return /*#__PURE__*/_react.default.createElement(MentionComponent, {
|
|
@@ -141,14 +200,15 @@ var MentionWithProviders = exports.MentionWithProviders = /*#__PURE__*/_react.de
|
|
|
141
200
|
onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
|
|
142
201
|
onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
|
|
143
202
|
renderAvatarSlot: renderAvatarSlot,
|
|
144
|
-
ssrPlaceholderId: ssrPlaceholderId
|
|
203
|
+
ssrPlaceholderId: ssrPlaceholderId,
|
|
204
|
+
isRovoChat: isRovoChat
|
|
145
205
|
});
|
|
146
206
|
});
|
|
147
|
-
var MentionWithAvatarProviders = exports.MentionWithAvatarProviders = /*#__PURE__*/_react.default.memo(function (
|
|
148
|
-
var id =
|
|
149
|
-
mentionNodeDataProvider =
|
|
150
|
-
userType =
|
|
151
|
-
props = (0, _objectWithoutProperties2.default)(
|
|
207
|
+
var MentionWithAvatarProviders = exports.MentionWithAvatarProviders = /*#__PURE__*/_react.default.memo(function (_ref4) {
|
|
208
|
+
var id = _ref4.id,
|
|
209
|
+
mentionNodeDataProvider = _ref4.mentionNodeDataProvider,
|
|
210
|
+
userType = _ref4.userType,
|
|
211
|
+
props = (0, _objectWithoutProperties2.default)(_ref4, _excluded);
|
|
152
212
|
var mentionNodeData = useMentionNodeData({
|
|
153
213
|
id: id,
|
|
154
214
|
mentionNodeDataProvider: mentionNodeDataProvider,
|
|
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
13
13
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
14
14
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
15
15
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
16
|
-
const packageVersion = "123.5.
|
|
16
|
+
const packageVersion = "123.5.1";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "123.5.
|
|
17
|
+
const packageVersion = "123.5.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -40,6 +40,7 @@ export default function MentionWithProfileCard({
|
|
|
40
40
|
onMouseEnter,
|
|
41
41
|
onMouseLeave,
|
|
42
42
|
renderAvatarSlot,
|
|
43
|
+
isRovoChat,
|
|
43
44
|
localId,
|
|
44
45
|
ssrPlaceholderId,
|
|
45
46
|
userType
|
|
@@ -63,6 +64,7 @@ export default function MentionWithProfileCard({
|
|
|
63
64
|
onMouseEnter: onMouseEnter,
|
|
64
65
|
onMouseLeave: onMouseLeave,
|
|
65
66
|
renderAvatarSlot: renderAvatarSlot,
|
|
67
|
+
isRovoChat: isRovoChat,
|
|
66
68
|
ssrPlaceholderId: ssrPlaceholderId
|
|
67
69
|
});
|
|
68
70
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import ResourcedMention from '@atlaskit/mention/resourced-mention';
|
|
4
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
4
5
|
import ResourcedMentionWithProfilecard from './mention-with-profilecard';
|
|
5
6
|
const GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
|
|
6
7
|
const useMentionNodeData = ({
|
|
@@ -54,6 +55,7 @@ export const MentionWithProviders = /*#__PURE__*/React.memo(({
|
|
|
54
55
|
userType
|
|
55
56
|
}) => {
|
|
56
57
|
const [profilecardProvider, setProfilecardProvider] = useState(null);
|
|
58
|
+
const [isRovoChat, setIsRovoChat] = useState(isExperimentEnabled('platform_editor_mention_rovo') && Boolean(mentionNodeData === null || mentionNodeData === void 0 ? void 0 : mentionNodeData.isRovoChat));
|
|
57
59
|
const mountedRef = useRef(true);
|
|
58
60
|
useLayoutEffect(() => {
|
|
59
61
|
mountedRef.current = true;
|
|
@@ -76,6 +78,35 @@ export const MentionWithProviders = /*#__PURE__*/React.memo(({
|
|
|
76
78
|
}
|
|
77
79
|
});
|
|
78
80
|
}, [profilecardProviderResolver]);
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (mentionNodeData !== null && mentionNodeData !== void 0 && mentionNodeData.isRovoChat) {
|
|
83
|
+
setIsRovoChat(isExperimentEnabled('platform_editor_mention_rovo'));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (!isExperimentEnabled('platform_editor_mention_rovo') || !mentionProvider) {
|
|
87
|
+
setIsRovoChat(false);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
let isActive = true;
|
|
91
|
+
const resolveRovoChatIdentity = async () => {
|
|
92
|
+
try {
|
|
93
|
+
var _provider$getRovoChat;
|
|
94
|
+
const provider = await mentionProvider;
|
|
95
|
+
const identityAccountId = await ((_provider$getRovoChat = provider.getRovoChatAgentIdentityAccountId) === null || _provider$getRovoChat === void 0 ? void 0 : _provider$getRovoChat.call(provider));
|
|
96
|
+
if (isActive) {
|
|
97
|
+
setIsRovoChat(identityAccountId !== undefined && identityAccountId === id);
|
|
98
|
+
}
|
|
99
|
+
} catch {
|
|
100
|
+
if (isActive) {
|
|
101
|
+
setIsRovoChat(false);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
void resolveRovoChatIdentity();
|
|
106
|
+
return () => {
|
|
107
|
+
isActive = false;
|
|
108
|
+
};
|
|
109
|
+
}, [id, mentionNodeData === null || mentionNodeData === void 0 ? void 0 : mentionNodeData.isRovoChat, mentionProvider]);
|
|
79
110
|
const MentionComponent = profilecardProvider && profilecardProviderResolver && GENERIC_USER_IDS.indexOf(id) === -1 ? ResourcedMentionWithProfilecard : ResourcedMention;
|
|
80
111
|
const ssrPlaceholderId = `mention-${id}`;
|
|
81
112
|
|
|
@@ -97,7 +128,8 @@ export const MentionWithProviders = /*#__PURE__*/React.memo(({
|
|
|
97
128
|
onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
|
|
98
129
|
onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
|
|
99
130
|
renderAvatarSlot: renderAvatarSlot,
|
|
100
|
-
ssrPlaceholderId: ssrPlaceholderId
|
|
131
|
+
ssrPlaceholderId: ssrPlaceholderId,
|
|
132
|
+
isRovoChat: isRovoChat
|
|
101
133
|
});
|
|
102
134
|
}
|
|
103
135
|
return /*#__PURE__*/React.createElement(MentionComponent, {
|
|
@@ -118,7 +150,8 @@ export const MentionWithProviders = /*#__PURE__*/React.memo(({
|
|
|
118
150
|
onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
|
|
119
151
|
onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
|
|
120
152
|
renderAvatarSlot: renderAvatarSlot,
|
|
121
|
-
ssrPlaceholderId: ssrPlaceholderId
|
|
153
|
+
ssrPlaceholderId: ssrPlaceholderId,
|
|
154
|
+
isRovoChat: isRovoChat
|
|
122
155
|
});
|
|
123
156
|
});
|
|
124
157
|
export const MentionWithAvatarProviders = /*#__PURE__*/React.memo(({
|
|
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
19
19
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "123.5.
|
|
22
|
+
var packageVersion = "123.5.1";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "123.5.
|
|
24
|
+
var packageVersion = "123.5.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -46,6 +46,7 @@ export default function MentionWithProfileCard(_ref) {
|
|
|
46
46
|
onMouseEnter = _ref.onMouseEnter,
|
|
47
47
|
onMouseLeave = _ref.onMouseLeave,
|
|
48
48
|
renderAvatarSlot = _ref.renderAvatarSlot,
|
|
49
|
+
isRovoChat = _ref.isRovoChat,
|
|
49
50
|
localId = _ref.localId,
|
|
50
51
|
ssrPlaceholderId = _ref.ssrPlaceholderId,
|
|
51
52
|
userType = _ref.userType;
|
|
@@ -68,6 +69,7 @@ export default function MentionWithProfileCard(_ref) {
|
|
|
68
69
|
onMouseEnter: onMouseEnter,
|
|
69
70
|
onMouseLeave: onMouseLeave,
|
|
70
71
|
renderAvatarSlot: renderAvatarSlot,
|
|
72
|
+
isRovoChat: isRovoChat,
|
|
71
73
|
ssrPlaceholderId: ssrPlaceholderId
|
|
72
74
|
});
|
|
73
75
|
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
5
|
var _excluded = ["id", "mentionNodeDataProvider", "userType"];
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
7
|
import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
8
|
import ResourcedMention from '@atlaskit/mention/resourced-mention';
|
|
9
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
7
10
|
import ResourcedMentionWithProfilecard from './mention-with-profilecard';
|
|
8
11
|
var GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
|
|
9
12
|
var useMentionNodeData = function useMentionNodeData(_ref) {
|
|
@@ -68,6 +71,10 @@ export var MentionWithProviders = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
68
71
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
69
72
|
profilecardProvider = _useState4[0],
|
|
70
73
|
setProfilecardProvider = _useState4[1];
|
|
74
|
+
var _useState5 = useState(isExperimentEnabled('platform_editor_mention_rovo') && Boolean(mentionNodeData === null || mentionNodeData === void 0 ? void 0 : mentionNodeData.isRovoChat)),
|
|
75
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
76
|
+
isRovoChat = _useState6[0],
|
|
77
|
+
setIsRovoChat = _useState6[1];
|
|
71
78
|
var mountedRef = useRef(true);
|
|
72
79
|
useLayoutEffect(function () {
|
|
73
80
|
mountedRef.current = true;
|
|
@@ -90,6 +97,57 @@ export var MentionWithProviders = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
90
97
|
}
|
|
91
98
|
});
|
|
92
99
|
}, [profilecardProviderResolver]);
|
|
100
|
+
useEffect(function () {
|
|
101
|
+
if (mentionNodeData !== null && mentionNodeData !== void 0 && mentionNodeData.isRovoChat) {
|
|
102
|
+
setIsRovoChat(isExperimentEnabled('platform_editor_mention_rovo'));
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (!isExperimentEnabled('platform_editor_mention_rovo') || !mentionProvider) {
|
|
106
|
+
setIsRovoChat(false);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
var isActive = true;
|
|
110
|
+
var resolveRovoChatIdentity = /*#__PURE__*/function () {
|
|
111
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
112
|
+
var _provider$getRovoChat, provider, identityAccountId, _t;
|
|
113
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
114
|
+
while (1) switch (_context.prev = _context.next) {
|
|
115
|
+
case 0:
|
|
116
|
+
_context.prev = 0;
|
|
117
|
+
_context.next = 1;
|
|
118
|
+
return mentionProvider;
|
|
119
|
+
case 1:
|
|
120
|
+
provider = _context.sent;
|
|
121
|
+
_context.next = 2;
|
|
122
|
+
return (_provider$getRovoChat = provider.getRovoChatAgentIdentityAccountId) === null || _provider$getRovoChat === void 0 ? void 0 : _provider$getRovoChat.call(provider);
|
|
123
|
+
case 2:
|
|
124
|
+
identityAccountId = _context.sent;
|
|
125
|
+
if (isActive) {
|
|
126
|
+
setIsRovoChat(identityAccountId !== undefined && identityAccountId === id);
|
|
127
|
+
}
|
|
128
|
+
_context.next = 4;
|
|
129
|
+
break;
|
|
130
|
+
case 3:
|
|
131
|
+
_context.prev = 3;
|
|
132
|
+
_t = _context["catch"](0);
|
|
133
|
+
if (isActive) {
|
|
134
|
+
setIsRovoChat(false);
|
|
135
|
+
}
|
|
136
|
+
case 4:
|
|
137
|
+
case "end":
|
|
138
|
+
return _context.stop();
|
|
139
|
+
}
|
|
140
|
+
}, _callee, null, [[0, 3]]);
|
|
141
|
+
}));
|
|
142
|
+
return function resolveRovoChatIdentity() {
|
|
143
|
+
return _ref3.apply(this, arguments);
|
|
144
|
+
};
|
|
145
|
+
}();
|
|
146
|
+
void resolveRovoChatIdentity();
|
|
147
|
+
return function () {
|
|
148
|
+
isActive = false;
|
|
149
|
+
};
|
|
150
|
+
}, [id, mentionNodeData === null || mentionNodeData === void 0 ? void 0 : mentionNodeData.isRovoChat, mentionProvider]);
|
|
93
151
|
var MentionComponent = profilecardProvider && profilecardProviderResolver && GENERIC_USER_IDS.indexOf(id) === -1 ? ResourcedMentionWithProfilecard : ResourcedMention;
|
|
94
152
|
var ssrPlaceholderId = "mention-".concat(id);
|
|
95
153
|
|
|
@@ -111,7 +169,8 @@ export var MentionWithProviders = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
111
169
|
onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
|
|
112
170
|
onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
|
|
113
171
|
renderAvatarSlot: renderAvatarSlot,
|
|
114
|
-
ssrPlaceholderId: ssrPlaceholderId
|
|
172
|
+
ssrPlaceholderId: ssrPlaceholderId,
|
|
173
|
+
isRovoChat: isRovoChat
|
|
115
174
|
});
|
|
116
175
|
}
|
|
117
176
|
return /*#__PURE__*/React.createElement(MentionComponent, {
|
|
@@ -132,14 +191,15 @@ export var MentionWithProviders = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
132
191
|
onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
|
|
133
192
|
onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
|
|
134
193
|
renderAvatarSlot: renderAvatarSlot,
|
|
135
|
-
ssrPlaceholderId: ssrPlaceholderId
|
|
194
|
+
ssrPlaceholderId: ssrPlaceholderId,
|
|
195
|
+
isRovoChat: isRovoChat
|
|
136
196
|
});
|
|
137
197
|
});
|
|
138
|
-
export var MentionWithAvatarProviders = /*#__PURE__*/React.memo(function (
|
|
139
|
-
var id =
|
|
140
|
-
mentionNodeDataProvider =
|
|
141
|
-
userType =
|
|
142
|
-
props = _objectWithoutProperties(
|
|
198
|
+
export var MentionWithAvatarProviders = /*#__PURE__*/React.memo(function (_ref4) {
|
|
199
|
+
var id = _ref4.id,
|
|
200
|
+
mentionNodeDataProvider = _ref4.mentionNodeDataProvider,
|
|
201
|
+
userType = _ref4.userType,
|
|
202
|
+
props = _objectWithoutProperties(_ref4, _excluded);
|
|
143
203
|
var mentionNodeData = useMentionNodeData({
|
|
144
204
|
id: id,
|
|
145
205
|
mentionNodeDataProvider: mentionNodeDataProvider,
|
|
@@ -164,7 +164,8 @@ type InsertReferenceSyncedBlockPayload = InsertAEP<ACTION_SUBJECT_ID.SYNCED_BLOC
|
|
|
164
164
|
export type InsertSourceSyncedBlockPayload = InsertAEP<ACTION_SUBJECT_ID.BODIED_SYNCED_BLOCK, {
|
|
165
165
|
resourceId: string;
|
|
166
166
|
}, undefined>;
|
|
167
|
-
export
|
|
167
|
+
export declare const TEMPLATE_GALLERY_INPUT_SOURCE: 'templateGallery';
|
|
168
|
+
export type InsertSnippetInputMethod = INPUT_METHOD.ELEMENT_BROWSER | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | typeof TEMPLATE_GALLERY_INPUT_SOURCE;
|
|
168
169
|
type InsertSnippetAEP = InsertAEP<ACTION_SUBJECT_ID.SNIPPET, {
|
|
169
170
|
hadMedia?: boolean;
|
|
170
171
|
inputMethod: InsertSnippetInputMethod;
|
|
@@ -172,7 +173,7 @@ type InsertSnippetAEP = InsertAEP<ACTION_SUBJECT_ID.SNIPPET, {
|
|
|
172
173
|
templateType?: 'atlassian' | 'user';
|
|
173
174
|
}, undefined>;
|
|
174
175
|
type FailedToInsertSnippetAEP = OperationalAEP<ACTION.FAILED_TO_INSERT, ACTION_SUBJECT.DOCUMENT, ACTION_SUBJECT_ID.SNIPPET, {
|
|
175
|
-
reason: 'emptyBody' | 'parseError';
|
|
176
|
+
reason: 'emptyBody' | 'insertError' | 'parseError';
|
|
176
177
|
snippetId: string;
|
|
177
178
|
templateType?: 'atlassian' | 'user';
|
|
178
179
|
} | {
|
|
@@ -17,6 +17,7 @@ export interface Props {
|
|
|
17
17
|
onMouseLeave?: MentionEventHandler;
|
|
18
18
|
profilecardProvider: ProfilecardProvider;
|
|
19
19
|
renderAvatarSlot?: boolean;
|
|
20
|
+
isRovoChat?: boolean;
|
|
20
21
|
ssrPlaceholderId?: string;
|
|
21
22
|
text: string;
|
|
22
23
|
userType?: MentionUserType;
|
|
@@ -26,4 +27,4 @@ export interface Props {
|
|
|
26
27
|
* 1. Agent mentions (`userType === 'APP'`, behind the `rovo_chat_mention_agents` experiment) open the Rovo agent profile card on click.
|
|
27
28
|
* 2. Otherwise renders the person profile card (either via the provider's `renderUserMentionCard`/link fallback or the default user `ProfileCardTrigger`).
|
|
28
29
|
*/
|
|
29
|
-
export default function MentionWithProfileCard({ autoFocus, id, text, accessLevel, appType, avatarUrl, isAvatarImagePreShaped, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, renderAvatarSlot, localId, ssrPlaceholderId, userType, }: Props): React.JSX.Element;
|
|
30
|
+
export default function MentionWithProfileCard({ autoFocus, id, text, accessLevel, appType, avatarUrl, isAvatarImagePreShaped, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, renderAvatarSlot, isRovoChat, localId, ssrPlaceholderId, userType, }: Props): React.JSX.Element;
|
package/package.json
CHANGED