@atlaskit/editor-common 123.5.1 → 123.7.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 +40 -0
- package/dist/cjs/analytics/types/insert-events.js +3 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/get-matching-quick-insert-components.js +30 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +3 -0
- package/dist/cjs/ui/Mention/mention-with-providers.js +68 -8
- package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +3 -3
- package/dist/es2019/analytics/types/insert-events.js +2 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/get-matching-quick-insert-components.js +20 -2
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +3 -0
- package/dist/es2019/ui/Mention/mention-with-providers.js +35 -2
- package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +3 -3
- package/dist/esm/analytics/types/insert-events.js +2 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/get-matching-quick-insert-components.js +30 -4
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Mention/mention-with-profilecard.js +3 -0
- package/dist/esm/ui/Mention/mention-with-providers.js +67 -7
- package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +3 -3
- package/dist/types/analytics/types/insert-events.d.ts +3 -2
- package/dist/types/quick-insert/build-quick-insert-menu-model.d.ts +1 -0
- package/dist/types/types/empty-state-handler.d.ts +1 -0
- package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 123.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`a1df9dd2d8f02`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a1df9dd2d8f02) -
|
|
8
|
+
Add the optional `showNoResultsMessage` empty-state handler parameter and
|
|
9
|
+
`platform_editor_slash_command`-gated Ask Rovo and View more recovery for registered quick insert
|
|
10
|
+
searches with no matches. Respect registry visibility and keep Marketplace content separate from
|
|
11
|
+
listbox navigation while preserving its native keyboard controls.
|
|
12
|
+
|
|
13
|
+
Show the registered Ask Rovo action alongside Marketplace suggestions in the element browser's
|
|
14
|
+
no-match state, with a divider separating the fallback action from Marketplace content. Keep the
|
|
15
|
+
toolbar's View more footer visible while Marketplace content scrolls and preserve native Tab
|
|
16
|
+
navigation.
|
|
17
|
+
|
|
18
|
+
Respect `data-keyboard-navigation-independent` containers in both toolbar keyboard navigation
|
|
19
|
+
providers. Apply the attribute to the registered insert menu, whose rendering is gated by
|
|
20
|
+
`platform_editor_slash_command`, so its controls retain their own key handling and native tab
|
|
21
|
+
stops.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [`f11db7a4b4188`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f11db7a4b4188) -
|
|
26
|
+
Fix comment renderer agent mention profile cards, behind experiment
|
|
27
|
+
`platform_editor_comment_mention_card_fixes`
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
|
|
30
|
+
## 123.6.0
|
|
31
|
+
|
|
32
|
+
### Minor Changes
|
|
33
|
+
|
|
34
|
+
- [`ca3c3208ca55b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ca3c3208ca55b) -
|
|
35
|
+
EDITOR-8673 Add template gallery snippet insertion through the editor snippets plugin, with
|
|
36
|
+
completion callbacks and a template gallery input source, behind
|
|
37
|
+
`platform_editor_snippets_plugin_confluence`.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
|
|
3
43
|
## 123.5.1
|
|
4
44
|
|
|
5
45
|
### 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.
|
|
30
|
+
var packageVersion = "123.6.0";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -7,6 +7,7 @@ exports.getMatchingQuickInsertComponents = void 0;
|
|
|
7
7
|
var _surfaceRenderer = require("@atlaskit/editor-ui-control-model/surface-renderer");
|
|
8
8
|
var _isMenuFooterSectionKey = require("../type-ahead/isMenuFooterSectionKey");
|
|
9
9
|
var _isSectionOverflowItemKey = require("../type-ahead/isSectionOverflowItemKey");
|
|
10
|
+
var _keys = require("./keys");
|
|
10
11
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
11
12
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
13
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -25,6 +26,7 @@ var compareMatchedItems = function compareMatchedItems(a, b) {
|
|
|
25
26
|
* no empty-query path so browse behavior remains owned by buildQuickInsertMenuModel.
|
|
26
27
|
*/
|
|
27
28
|
var getMatchingQuickInsertComponents = exports.getMatchingQuickInsertComponents = function getMatchingQuickInsertComponents(_ref) {
|
|
29
|
+
var _childrenMap$get2;
|
|
28
30
|
var components = _ref.components,
|
|
29
31
|
rootComponent = _ref.rootComponent,
|
|
30
32
|
query = _ref.query,
|
|
@@ -46,12 +48,12 @@ var getMatchingQuickInsertComponents = exports.getMatchingQuickInsertComponents
|
|
|
46
48
|
_step;
|
|
47
49
|
try {
|
|
48
50
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
49
|
-
var _childrenMap$
|
|
51
|
+
var _childrenMap$get3;
|
|
50
52
|
var section = _step.value;
|
|
51
53
|
if (section.type !== 'menu-section' || (0, _isMenuFooterSectionKey.isMenuFooterSectionKey)(section.key) || !(0, _surfaceRenderer.willComponentRender)(section, childrenMap, surfaceContext)) {
|
|
52
54
|
continue;
|
|
53
55
|
}
|
|
54
|
-
var _iterator3 = _createForOfIteratorHelper((_childrenMap$
|
|
56
|
+
var _iterator3 = _createForOfIteratorHelper((_childrenMap$get3 = childrenMap.get((0, _surfaceRenderer.getComponentIdentity)(section))) !== null && _childrenMap$get3 !== void 0 ? _childrenMap$get3 : []),
|
|
55
57
|
_step3;
|
|
56
58
|
try {
|
|
57
59
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -109,9 +111,33 @@ var getMatchingQuickInsertComponents = exports.getMatchingQuickInsertComponents
|
|
|
109
111
|
} finally {
|
|
110
112
|
_iterator2.f();
|
|
111
113
|
}
|
|
114
|
+
var sections = Array.from(sectionsByKey.values());
|
|
115
|
+
if (sections.length > 0 || query === '') {
|
|
116
|
+
return {
|
|
117
|
+
footer: undefined,
|
|
118
|
+
root: root,
|
|
119
|
+
sections: sections
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
var fallbackItem = topLevelChildren.filter(function (section) {
|
|
123
|
+
return section.type === 'menu-section' && !(0, _isMenuFooterSectionKey.isMenuFooterSectionKey)(section.key) && (0, _surfaceRenderer.willComponentRender)(section, childrenMap, surfaceContext);
|
|
124
|
+
}).flatMap(function (section) {
|
|
125
|
+
var _childrenMap$get;
|
|
126
|
+
return (_childrenMap$get = childrenMap.get((0, _surfaceRenderer.getComponentIdentity)(section))) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : [];
|
|
127
|
+
}).find(function (component) {
|
|
128
|
+
return component.type === _keys.ASK_ROVO_MENU_ITEM.type && component.key === _keys.ASK_ROVO_MENU_ITEM.key && (0, _surfaceRenderer.willComponentRender)(component, childrenMap, surfaceContext);
|
|
129
|
+
});
|
|
130
|
+
var fallbackItems = fallbackItem ? [fallbackItem] : [];
|
|
131
|
+
var footerSection = topLevelChildren.find(function (section) {
|
|
132
|
+
return section.type === 'menu-section' && (0, _isMenuFooterSectionKey.isMenuFooterSectionKey)(section.key) && (0, _surfaceRenderer.willComponentRender)(section, childrenMap, surfaceContext);
|
|
133
|
+
});
|
|
134
|
+
var footer = footerSection ? ((_childrenMap$get2 = childrenMap.get((0, _surfaceRenderer.getComponentIdentity)(footerSection))) !== null && _childrenMap$get2 !== void 0 ? _childrenMap$get2 : []).find(function (child) {
|
|
135
|
+
return child.type === 'menu-item' && (0, _surfaceRenderer.willComponentRender)(child, childrenMap, surfaceContext);
|
|
136
|
+
}) : undefined;
|
|
112
137
|
return {
|
|
113
|
-
|
|
138
|
+
fallbackItems: fallbackItems,
|
|
139
|
+
footer: footer,
|
|
114
140
|
root: root,
|
|
115
|
-
sections:
|
|
141
|
+
sections: sections
|
|
116
142
|
};
|
|
117
143
|
};
|
|
@@ -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.
|
|
27
|
+
var packageVersion = "123.6.0";
|
|
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
|
|
|
@@ -85,6 +87,7 @@ function MentionWithProfileCard(_ref) {
|
|
|
85
87
|
if (userType === 'APP' && cloudId && (0, _isExperimentEnabled.isExperimentEnabled)('rovo_chat_mention_agents')) {
|
|
86
88
|
return /*#__PURE__*/_react.default.createElement(AgentProfileCardTrigger, {
|
|
87
89
|
agentId: id,
|
|
90
|
+
agentIdType: (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_comment_mention_card_fixes') ? 'identity' : undefined,
|
|
88
91
|
cloudId: cloudId,
|
|
89
92
|
resourceClient: resourceClient,
|
|
90
93
|
trigger: "click"
|
|
@@ -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,
|
|
@@ -133,7 +133,7 @@ var ToolbarArrowKeyNavigationProvider = exports.ToolbarArrowKeyNavigationProvide
|
|
|
133
133
|
if (targetElement instanceof HTMLElement && !targetElement.closest("".concat(childComponentSelector))) {
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
|
-
if (targetElement instanceof HTMLElement && (_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || targetElement instanceof HTMLElement && (_document$querySelect2 = document.querySelector('[data-test-id="color-picker-menu"]')) !== null && _document$querySelect2 !== void 0 && _document$querySelect2.contains(targetElement) || event.key === 'ArrowUp' || event.key === 'ArrowDown' || disableArrowKeyNavigation) {
|
|
136
|
+
if (targetElement instanceof HTMLElement && (_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || targetElement instanceof HTMLElement && (_document$querySelect2 = document.querySelector('[data-test-id="color-picker-menu"]')) !== null && _document$querySelect2 !== void 0 && _document$querySelect2.contains(targetElement) || targetElement instanceof HTMLElement && targetElement.closest('[data-keyboard-navigation-independent]') || event.key === 'ArrowUp' || event.key === 'ArrowDown' || disableArrowKeyNavigation) {
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
139
|
var menuWrapper = document.querySelector('.menu-key-handler-wrapper');
|
|
@@ -270,10 +270,10 @@ function isElementOrAncestorHiddenOrDisabled(element, rootNode) {
|
|
|
270
270
|
return false;
|
|
271
271
|
}
|
|
272
272
|
function getFilteredFocusableElements(rootNode) {
|
|
273
|
-
//
|
|
273
|
+
// Independent containers and child popups own their key handling and tab stops.
|
|
274
274
|
return getFocusableElements(rootNode).filter(function (elm) {
|
|
275
275
|
// Check if element or any ancestor is hidden or disabled
|
|
276
276
|
var isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
|
|
277
|
-
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
|
|
277
|
+
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('[data-keyboard-navigation-independent]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
|
|
278
278
|
});
|
|
279
279
|
}
|
|
@@ -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.
|
|
16
|
+
const packageVersion = "123.6.0";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getComponentIdentity, resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
|
|
2
2
|
import { isMenuFooterSectionKey } from '../type-ahead/isMenuFooterSectionKey';
|
|
3
3
|
import { isSectionOverflowItemKey } from '../type-ahead/isSectionOverflowItemKey';
|
|
4
|
+
import { ASK_ROVO_MENU_ITEM } from './keys';
|
|
4
5
|
const getRank = (component, parentKey) => {
|
|
5
6
|
var _component$parents$fi, _component$parents, _component$parents$fi2;
|
|
6
7
|
return (_component$parents$fi = (_component$parents = component.parents) === null || _component$parents === void 0 ? void 0 : (_component$parents$fi2 = _component$parents.find(parent => parent.key === parentKey)) === null || _component$parents$fi2 === void 0 ? void 0 : _component$parents$fi2.rank) !== null && _component$parents$fi !== void 0 ? _component$parents$fi : Number.MAX_SAFE_INTEGER;
|
|
@@ -18,6 +19,7 @@ export const getMatchingQuickInsertComponents = ({
|
|
|
18
19
|
formatMessage,
|
|
19
20
|
surfaceContext
|
|
20
21
|
}) => {
|
|
22
|
+
var _childrenMap$get3;
|
|
21
23
|
const {
|
|
22
24
|
childrenMap,
|
|
23
25
|
root,
|
|
@@ -70,9 +72,25 @@ export const getMatchingQuickInsertComponents = ({
|
|
|
70
72
|
sectionsByKey.set(match.section.key, [match.section, match.item]);
|
|
71
73
|
}
|
|
72
74
|
}
|
|
75
|
+
const sections = Array.from(sectionsByKey.values());
|
|
76
|
+
if (sections.length > 0 || query === '') {
|
|
77
|
+
return {
|
|
78
|
+
footer: undefined,
|
|
79
|
+
root,
|
|
80
|
+
sections
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const fallbackItem = topLevelChildren.filter(section => section.type === 'menu-section' && !isMenuFooterSectionKey(section.key) && willComponentRender(section, childrenMap, surfaceContext)).flatMap(section => {
|
|
84
|
+
var _childrenMap$get2;
|
|
85
|
+
return (_childrenMap$get2 = childrenMap.get(getComponentIdentity(section))) !== null && _childrenMap$get2 !== void 0 ? _childrenMap$get2 : [];
|
|
86
|
+
}).find(component => component.type === ASK_ROVO_MENU_ITEM.type && component.key === ASK_ROVO_MENU_ITEM.key && willComponentRender(component, childrenMap, surfaceContext));
|
|
87
|
+
const fallbackItems = fallbackItem ? [fallbackItem] : [];
|
|
88
|
+
const footerSection = topLevelChildren.find(section => section.type === 'menu-section' && isMenuFooterSectionKey(section.key) && willComponentRender(section, childrenMap, surfaceContext));
|
|
89
|
+
const footer = footerSection ? ((_childrenMap$get3 = childrenMap.get(getComponentIdentity(footerSection))) !== null && _childrenMap$get3 !== void 0 ? _childrenMap$get3 : []).find(child => child.type === 'menu-item' && willComponentRender(child, childrenMap, surfaceContext)) : undefined;
|
|
73
90
|
return {
|
|
74
|
-
|
|
91
|
+
fallbackItems,
|
|
92
|
+
footer,
|
|
75
93
|
root,
|
|
76
|
-
sections
|
|
94
|
+
sections
|
|
77
95
|
};
|
|
78
96
|
};
|
|
@@ -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.
|
|
17
|
+
const packageVersion = "123.6.0";
|
|
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
|
|
|
@@ -70,6 +72,7 @@ export default function MentionWithProfileCard({
|
|
|
70
72
|
if (userType === 'APP' && cloudId && isExperimentEnabled('rovo_chat_mention_agents')) {
|
|
71
73
|
return /*#__PURE__*/React.createElement(AgentProfileCardTrigger, {
|
|
72
74
|
agentId: id,
|
|
75
|
+
agentIdType: isExperimentEnabled('platform_editor_comment_mention_card_fixes') ? 'identity' : undefined,
|
|
73
76
|
cloudId: cloudId,
|
|
74
77
|
resourceClient: resourceClient,
|
|
75
78
|
trigger: "click"
|
|
@@ -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(({
|
|
@@ -125,7 +125,7 @@ export const ToolbarArrowKeyNavigationProvider = ({
|
|
|
125
125
|
if (targetElement instanceof HTMLElement && !targetElement.closest(`${childComponentSelector}`)) {
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
if (targetElement instanceof HTMLElement && (_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || targetElement instanceof HTMLElement && (_document$querySelect2 = document.querySelector('[data-test-id="color-picker-menu"]')) !== null && _document$querySelect2 !== void 0 && _document$querySelect2.contains(targetElement) || event.key === 'ArrowUp' || event.key === 'ArrowDown' || disableArrowKeyNavigation) {
|
|
128
|
+
if (targetElement instanceof HTMLElement && (_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || targetElement instanceof HTMLElement && (_document$querySelect2 = document.querySelector('[data-test-id="color-picker-menu"]')) !== null && _document$querySelect2 !== void 0 && _document$querySelect2.contains(targetElement) || targetElement instanceof HTMLElement && targetElement.closest('[data-keyboard-navigation-independent]') || event.key === 'ArrowUp' || event.key === 'ArrowDown' || disableArrowKeyNavigation) {
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
const menuWrapper = document.querySelector('.menu-key-handler-wrapper');
|
|
@@ -262,10 +262,10 @@ function isElementOrAncestorHiddenOrDisabled(element, rootNode) {
|
|
|
262
262
|
return false;
|
|
263
263
|
}
|
|
264
264
|
function getFilteredFocusableElements(rootNode) {
|
|
265
|
-
//
|
|
265
|
+
// Independent containers and child popups own their key handling and tab stops.
|
|
266
266
|
return getFocusableElements(rootNode).filter(elm => {
|
|
267
267
|
// Check if element or any ancestor is hidden or disabled
|
|
268
268
|
const isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
|
|
269
|
-
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
|
|
269
|
+
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('[data-keyboard-navigation-independent]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
|
|
270
270
|
});
|
|
271
271
|
}
|
|
@@ -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.
|
|
22
|
+
var packageVersion = "123.6.0";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -4,6 +4,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
4
4
|
import { getComponentIdentity, resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
|
|
5
5
|
import { isMenuFooterSectionKey } from '../type-ahead/isMenuFooterSectionKey';
|
|
6
6
|
import { isSectionOverflowItemKey } from '../type-ahead/isSectionOverflowItemKey';
|
|
7
|
+
import { ASK_ROVO_MENU_ITEM } from './keys';
|
|
7
8
|
var getRank = function getRank(component, parentKey) {
|
|
8
9
|
var _component$parents$fi, _component$parents;
|
|
9
10
|
return (_component$parents$fi = (_component$parents = component.parents) === null || _component$parents === void 0 || (_component$parents = _component$parents.find(function (parent) {
|
|
@@ -19,6 +20,7 @@ var compareMatchedItems = function compareMatchedItems(a, b) {
|
|
|
19
20
|
* no empty-query path so browse behavior remains owned by buildQuickInsertMenuModel.
|
|
20
21
|
*/
|
|
21
22
|
export var getMatchingQuickInsertComponents = function getMatchingQuickInsertComponents(_ref) {
|
|
23
|
+
var _childrenMap$get2;
|
|
22
24
|
var components = _ref.components,
|
|
23
25
|
rootComponent = _ref.rootComponent,
|
|
24
26
|
query = _ref.query,
|
|
@@ -40,12 +42,12 @@ export var getMatchingQuickInsertComponents = function getMatchingQuickInsertCom
|
|
|
40
42
|
_step;
|
|
41
43
|
try {
|
|
42
44
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
43
|
-
var _childrenMap$
|
|
45
|
+
var _childrenMap$get3;
|
|
44
46
|
var section = _step.value;
|
|
45
47
|
if (section.type !== 'menu-section' || isMenuFooterSectionKey(section.key) || !willComponentRender(section, childrenMap, surfaceContext)) {
|
|
46
48
|
continue;
|
|
47
49
|
}
|
|
48
|
-
var _iterator3 = _createForOfIteratorHelper((_childrenMap$
|
|
50
|
+
var _iterator3 = _createForOfIteratorHelper((_childrenMap$get3 = childrenMap.get(getComponentIdentity(section))) !== null && _childrenMap$get3 !== void 0 ? _childrenMap$get3 : []),
|
|
49
51
|
_step3;
|
|
50
52
|
try {
|
|
51
53
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -103,9 +105,33 @@ export var getMatchingQuickInsertComponents = function getMatchingQuickInsertCom
|
|
|
103
105
|
} finally {
|
|
104
106
|
_iterator2.f();
|
|
105
107
|
}
|
|
108
|
+
var sections = Array.from(sectionsByKey.values());
|
|
109
|
+
if (sections.length > 0 || query === '') {
|
|
110
|
+
return {
|
|
111
|
+
footer: undefined,
|
|
112
|
+
root: root,
|
|
113
|
+
sections: sections
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
var fallbackItem = topLevelChildren.filter(function (section) {
|
|
117
|
+
return section.type === 'menu-section' && !isMenuFooterSectionKey(section.key) && willComponentRender(section, childrenMap, surfaceContext);
|
|
118
|
+
}).flatMap(function (section) {
|
|
119
|
+
var _childrenMap$get;
|
|
120
|
+
return (_childrenMap$get = childrenMap.get(getComponentIdentity(section))) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : [];
|
|
121
|
+
}).find(function (component) {
|
|
122
|
+
return component.type === ASK_ROVO_MENU_ITEM.type && component.key === ASK_ROVO_MENU_ITEM.key && willComponentRender(component, childrenMap, surfaceContext);
|
|
123
|
+
});
|
|
124
|
+
var fallbackItems = fallbackItem ? [fallbackItem] : [];
|
|
125
|
+
var footerSection = topLevelChildren.find(function (section) {
|
|
126
|
+
return section.type === 'menu-section' && isMenuFooterSectionKey(section.key) && willComponentRender(section, childrenMap, surfaceContext);
|
|
127
|
+
});
|
|
128
|
+
var footer = footerSection ? ((_childrenMap$get2 = childrenMap.get(getComponentIdentity(footerSection))) !== null && _childrenMap$get2 !== void 0 ? _childrenMap$get2 : []).find(function (child) {
|
|
129
|
+
return child.type === 'menu-item' && willComponentRender(child, childrenMap, surfaceContext);
|
|
130
|
+
}) : undefined;
|
|
106
131
|
return {
|
|
107
|
-
|
|
132
|
+
fallbackItems: fallbackItems,
|
|
133
|
+
footer: footer,
|
|
108
134
|
root: root,
|
|
109
|
-
sections:
|
|
135
|
+
sections: sections
|
|
110
136
|
};
|
|
111
137
|
};
|
|
@@ -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.
|
|
24
|
+
var packageVersion = "123.6.0";
|
|
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
|
|
|
@@ -75,6 +77,7 @@ export default function MentionWithProfileCard(_ref) {
|
|
|
75
77
|
if (userType === 'APP' && cloudId && isExperimentEnabled('rovo_chat_mention_agents')) {
|
|
76
78
|
return /*#__PURE__*/React.createElement(AgentProfileCardTrigger, {
|
|
77
79
|
agentId: id,
|
|
80
|
+
agentIdType: isExperimentEnabled('platform_editor_comment_mention_card_fixes') ? 'identity' : undefined,
|
|
78
81
|
cloudId: cloudId,
|
|
79
82
|
resourceClient: resourceClient,
|
|
80
83
|
trigger: "click"
|
|
@@ -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,
|
|
@@ -125,7 +125,7 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
|
|
|
125
125
|
if (targetElement instanceof HTMLElement && !targetElement.closest("".concat(childComponentSelector))) {
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
if (targetElement instanceof HTMLElement && (_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || targetElement instanceof HTMLElement && (_document$querySelect2 = document.querySelector('[data-test-id="color-picker-menu"]')) !== null && _document$querySelect2 !== void 0 && _document$querySelect2.contains(targetElement) || event.key === 'ArrowUp' || event.key === 'ArrowDown' || disableArrowKeyNavigation) {
|
|
128
|
+
if (targetElement instanceof HTMLElement && (_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || targetElement instanceof HTMLElement && (_document$querySelect2 = document.querySelector('[data-test-id="color-picker-menu"]')) !== null && _document$querySelect2 !== void 0 && _document$querySelect2.contains(targetElement) || targetElement instanceof HTMLElement && targetElement.closest('[data-keyboard-navigation-independent]') || event.key === 'ArrowUp' || event.key === 'ArrowDown' || disableArrowKeyNavigation) {
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
var menuWrapper = document.querySelector('.menu-key-handler-wrapper');
|
|
@@ -262,10 +262,10 @@ function isElementOrAncestorHiddenOrDisabled(element, rootNode) {
|
|
|
262
262
|
return false;
|
|
263
263
|
}
|
|
264
264
|
function getFilteredFocusableElements(rootNode) {
|
|
265
|
-
//
|
|
265
|
+
// Independent containers and child popups own their key handling and tab stops.
|
|
266
266
|
return getFocusableElements(rootNode).filter(function (elm) {
|
|
267
267
|
// Check if element or any ancestor is hidden or disabled
|
|
268
268
|
var isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
|
|
269
|
-
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
|
|
269
|
+
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('[data-keyboard-navigation-independent]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
|
|
270
270
|
});
|
|
271
271
|
}
|
|
@@ -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
|
} | {
|
|
@@ -3,6 +3,7 @@ import type { RegisterComponent, RegisterMenuItem, RegisterMenuSection, SurfaceC
|
|
|
3
3
|
import type { QuickInsertCategoryItemSelectionPolicy } from './selectQuickInsertCategoryItems';
|
|
4
4
|
export type QuickInsertMenuSection = [RegisterMenuSection, ...RegisterMenuItem[]];
|
|
5
5
|
export type QuickInsertMenuModel = {
|
|
6
|
+
fallbackItems?: RegisterMenuItem[];
|
|
6
7
|
footer: RegisterMenuItem | undefined;
|
|
7
8
|
root: RegisterComponent | undefined;
|
|
8
9
|
sections: QuickInsertMenuSection[];
|
|
@@ -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "123.
|
|
3
|
+
"version": "123.7.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
79
79
|
"@atlaskit/react-ufo": "^7.13.0",
|
|
80
80
|
"@atlaskit/section-message": "^10.2.0",
|
|
81
|
-
"@atlaskit/smart-card": "^45.
|
|
81
|
+
"@atlaskit/smart-card": "^45.26.0",
|
|
82
82
|
"@atlaskit/smart-user-picker": "^11.8.0",
|
|
83
83
|
"@atlaskit/spinner": "^20.4.0",
|
|
84
84
|
"@atlaskit/task-decision": "^21.10.0",
|