@atlaskit/editor-plugin-quick-insert 30.0.3 → 30.0.5
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 +24 -0
- package/dist/cjs/ui/RegistryElementBrowser/RegistryElementBrowser.js +1 -8
- package/dist/cjs/ui/RegistryElementBrowser/model.js +2 -4
- package/dist/cjs/ui/normalizeQuickInsertMatchResult.js +14 -0
- package/dist/cjs/ui/registered-menu/QuickInsertMenuRoot.js +6 -3
- package/dist/cjs/ui/registered-menu/ToolbarQuickInsertMenu.js +3 -1
- package/dist/cjs/ui/registered-menu/TypeAheadQuickInsertMenu.js +2 -0
- package/dist/cjs/ui/registered-menu/get-quick-insert-menu-model.js +7 -6
- package/dist/es2019/ui/RegistryElementBrowser/RegistryElementBrowser.js +1 -8
- package/dist/es2019/ui/RegistryElementBrowser/model.js +2 -2
- package/dist/es2019/ui/normalizeQuickInsertMatchResult.js +8 -0
- package/dist/es2019/ui/registered-menu/QuickInsertMenuRoot.js +5 -2
- package/dist/es2019/ui/registered-menu/ToolbarQuickInsertMenu.js +3 -1
- package/dist/es2019/ui/registered-menu/TypeAheadQuickInsertMenu.js +2 -0
- package/dist/es2019/ui/registered-menu/get-quick-insert-menu-model.js +4 -3
- package/dist/esm/ui/RegistryElementBrowser/RegistryElementBrowser.js +1 -8
- package/dist/esm/ui/RegistryElementBrowser/model.js +2 -4
- package/dist/esm/ui/normalizeQuickInsertMatchResult.js +8 -0
- package/dist/esm/ui/registered-menu/QuickInsertMenuRoot.js +6 -3
- package/dist/esm/ui/registered-menu/ToolbarQuickInsertMenu.js +3 -1
- package/dist/esm/ui/registered-menu/TypeAheadQuickInsertMenu.js +2 -0
- package/dist/esm/ui/registered-menu/get-quick-insert-menu-model.js +7 -6
- package/dist/types/ui/normalizeQuickInsertMatchResult.d.ts +3 -0
- package/dist/types/ui/registered-menu/ToolbarQuickInsertMenu.d.ts +3 -2
- package/dist/types/ui/registered-menu/TypeAheadQuickInsertMenu.d.ts +3 -2
- package/package.json +6 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-quick-insert
|
|
2
2
|
|
|
3
|
+
## 30.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`92255b30e6242`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/92255b30e6242) -
|
|
8
|
+
Keep Quick Insert match scores consistent across menus. Recommend Jira work items followed by Jira
|
|
9
|
+
work item creation for `ji`, `jir`, and `jira`. Add `task` as a search keyword for Jira work item
|
|
10
|
+
creation under `platform_editor_slash_command`.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 30.0.4
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`fc6a743d65633`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fc6a743d65633) -
|
|
18
|
+
Remove unused @atlaskit/platform-feature-flags and @atlaskit/tmp-editor-statsig dependencies
|
|
19
|
+
- [`7efec208f3bb4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7efec208f3bb4) -
|
|
20
|
+
Remove unused runtime dependencies
|
|
21
|
+
- [`b199ccfabf69b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b199ccfabf69b) -
|
|
22
|
+
EDITOR-9784: Under the platform_editor_slash_command experiment, the quick insert registered menus
|
|
23
|
+
pass the menu's selection source to RegisteredMenuList, so hovering an item no longer scrolls a
|
|
24
|
+
partially clipped item into view.
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 30.0.3
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -19,7 +19,6 @@ var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
|
19
19
|
var _surfaceContext = require("@atlaskit/editor-common/registered-menu/surface-context");
|
|
20
20
|
var _typeAheadGetMenuFooterSectionKey = require("@atlaskit/editor-common/type-ahead-get-menu-footer-section-key");
|
|
21
21
|
var _typeAheadGetSectionOverflowItemKey = require("@atlaskit/editor-common/type-ahead-get-section-overflow-item-key");
|
|
22
|
-
var _heading = _interopRequireDefault(require("@atlaskit/heading/heading"));
|
|
23
22
|
var _cross = _interopRequireDefault(require("@atlaskit/icon/core/cross"));
|
|
24
23
|
var _modalBody = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-body"));
|
|
25
24
|
var _modalDialog = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-dialog"));
|
|
@@ -27,7 +26,6 @@ var _modalFooter = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-
|
|
|
27
26
|
var _modalHeader = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-header"));
|
|
28
27
|
var _modalTitle = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-title"));
|
|
29
28
|
var _modalTransition = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-transition"));
|
|
30
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
31
29
|
var _textField = _interopRequireDefault(require("@atlaskit/textfield/text-field"));
|
|
32
30
|
var _useQuickInsertSearchAnalytics = require("../registered-menu/useQuickInsertSearchAnalytics");
|
|
33
31
|
var _model = require("./model");
|
|
@@ -337,12 +335,7 @@ var RegistryElementBrowser = exports.RegistryElementBrowser = function RegistryE
|
|
|
337
335
|
width: "min(968px, calc(100vw - 32px))"
|
|
338
336
|
}, /*#__PURE__*/_react.default.createElement(_modalHeader.default, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
339
337
|
className: (0, _runtime.ax)(["_zulp1fka _1e0c11p5 _yv0e1xuv _1bsb1osq _lk4ji47z"])
|
|
340
|
-
},
|
|
341
|
-
defaultMessage: 'Insert elements',
|
|
342
|
-
id: 'editor.quick-insert.title'
|
|
343
|
-
})) : /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
344
|
-
size: "medium"
|
|
345
|
-
}, formatMessage({
|
|
338
|
+
}, /*#__PURE__*/_react.default.createElement(_modalTitle.default, null, formatMessage({
|
|
346
339
|
defaultMessage: 'Insert elements',
|
|
347
340
|
id: 'editor.quick-insert.title'
|
|
348
341
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _createQuickInsertMatcher = require("@atlaskit/editor-common/quick-insert/create-quick-insert-matcher");
|
|
11
11
|
var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
12
|
+
var _normalizeQuickInsertMatchResult = require("../normalizeQuickInsertMatchResult");
|
|
12
13
|
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; }
|
|
13
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
15
|
var compareRanks = function compareRanks(left, right) {
|
|
@@ -134,10 +135,7 @@ var getRegistryElementBrowserItems = exports.getRegistryElementBrowserItems = fu
|
|
|
134
135
|
itemKey: item.registration.key,
|
|
135
136
|
query: normalizedQuery
|
|
136
137
|
});
|
|
137
|
-
return result ? [_objectSpread(_objectSpread({}, item),
|
|
138
|
-
priorityGroup: result.priorityGroup !== undefined && Number.isFinite(result.priorityGroup) ? result.priorityGroup : undefined,
|
|
139
|
-
score: Math.min(1, Math.max(0, result.score))
|
|
140
|
-
})] : [];
|
|
138
|
+
return result ? [_objectSpread(_objectSpread({}, item), (0, _normalizeQuickInsertMatchResult.normalizeQuickInsertMatchResult)(result))] : [];
|
|
141
139
|
});
|
|
142
140
|
var prioritized = matches.filter(function (_ref4) {
|
|
143
141
|
var priorityGroup = _ref4.priorityGroup;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.normalizeQuickInsertMatchResult = void 0;
|
|
7
|
+
/** Keeps score and priority handling consistent across Quick Insert search models. */
|
|
8
|
+
var normalizeQuickInsertMatchResult = exports.normalizeQuickInsertMatchResult = function normalizeQuickInsertMatchResult(match) {
|
|
9
|
+
var _match$score;
|
|
10
|
+
return {
|
|
11
|
+
priorityGroup: Number.isFinite(match === null || match === void 0 ? void 0 : match.priorityGroup) ? match === null || match === void 0 ? void 0 : match.priorityGroup : undefined,
|
|
12
|
+
score: Math.min(1, Math.max(0, (_match$score = match === null || match === void 0 ? void 0 : match.score) !== null && _match$score !== void 0 ? _match$score : 0))
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -27,7 +27,7 @@ var _selectQuickInsertCategoryItems = require("./selectQuickInsertCategoryItems"
|
|
|
27
27
|
var _ToolbarQuickInsertMenu = require("./ToolbarQuickInsertMenu");
|
|
28
28
|
var _TypeAheadQuickInsertMenu = require("./TypeAheadQuickInsertMenu");
|
|
29
29
|
var _useQuickInsertSearchAnalytics = require("./useQuickInsertSearchAnalytics");
|
|
30
|
-
var _excluded = ["rows", "selectableItems", "selectedItemIndex", "activeItemKey"];
|
|
30
|
+
var _excluded = ["rows", "selectableItems", "selectedItemIndex", "activeItemKey", "selectionSource"];
|
|
31
31
|
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); }
|
|
32
32
|
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; }
|
|
33
33
|
var DEFAULT_MENU_MAX_HEIGHT = 480;
|
|
@@ -112,6 +112,7 @@ var QuickInsertMenuRoot = function QuickInsertMenuRoot(_ref) {
|
|
|
112
112
|
selectableItems = _useRegisteredMenu.selectableItems,
|
|
113
113
|
selectedItemIndex = _useRegisteredMenu.selectedItemIndex,
|
|
114
114
|
activeItemKey = _useRegisteredMenu.activeItemKey,
|
|
115
|
+
selectionSource = _useRegisteredMenu.selectionSource,
|
|
115
116
|
listEvents = (0, _objectWithoutProperties2.default)(_useRegisteredMenu, _excluded);
|
|
116
117
|
var listId = (0, _react.useId)();
|
|
117
118
|
var _useState = (0, _react.useState)({
|
|
@@ -198,7 +199,8 @@ var QuickInsertMenuRoot = function QuickInsertMenuRoot(_ref) {
|
|
|
198
199
|
onRenderedItemsChange: setRenderedItems,
|
|
199
200
|
query: query,
|
|
200
201
|
rows: rows,
|
|
201
|
-
selectedItemIndex: selectedItemIndex
|
|
202
|
+
selectedItemIndex: selectedItemIndex,
|
|
203
|
+
selectionSource: selectionSource
|
|
202
204
|
}) : /*#__PURE__*/_react.default.createElement(_ToolbarQuickInsertMenu.ToolbarQuickInsertMenu, {
|
|
203
205
|
Item: _RegisteredQuickInsertMenuItem.RegisteredQuickInsertMenuItem,
|
|
204
206
|
activePreviewItemKey: activeItemKey,
|
|
@@ -216,7 +218,8 @@ var QuickInsertMenuRoot = function QuickInsertMenuRoot(_ref) {
|
|
|
216
218
|
onRenderedItemsChange: setRenderedItems,
|
|
217
219
|
query: query,
|
|
218
220
|
rows: rows,
|
|
219
|
-
selectedItemIndex: selectedItemIndex
|
|
221
|
+
selectedItemIndex: selectedItemIndex,
|
|
222
|
+
selectionSource: selectionSource
|
|
220
223
|
}))));
|
|
221
224
|
};
|
|
222
225
|
var _default = exports.default = QuickInsertMenuRoot;
|
|
@@ -40,7 +40,8 @@ var ToolbarQuickInsertMenu = exports.ToolbarQuickInsertMenu = function ToolbarQu
|
|
|
40
40
|
onItemVisibilityChange = _ref.onItemVisibilityChange,
|
|
41
41
|
onRenderedItemsChange = _ref.onRenderedItemsChange,
|
|
42
42
|
query = _ref.query,
|
|
43
|
-
selectedItemIndex = _ref.selectedItemIndex
|
|
43
|
+
selectedItemIndex = _ref.selectedItemIndex,
|
|
44
|
+
selectionSource = _ref.selectionSource;
|
|
44
45
|
var footerItemIndex = itemCount - 1;
|
|
45
46
|
var footerItemId = (0, _getQuickInsertMenuItemId.getQuickInsertMenuItemId)(listId, footerItemIndex);
|
|
46
47
|
var isEmptySearch = query !== '' && model.sections.length === 0;
|
|
@@ -91,6 +92,7 @@ var ToolbarQuickInsertMenu = exports.ToolbarQuickInsertMenu = function ToolbarQu
|
|
|
91
92
|
getItemId: getItemId,
|
|
92
93
|
activeItemKey: activePreviewItemKey,
|
|
93
94
|
selectedItemIndex: selectedItemIndex,
|
|
95
|
+
selectionSource: selectionSource,
|
|
94
96
|
scrollResetKey: query,
|
|
95
97
|
onItemHover: onItemHover,
|
|
96
98
|
onItemFocus: onItemFocus,
|
|
@@ -38,6 +38,7 @@ var TypeAheadQuickInsertMenu = exports.TypeAheadQuickInsertMenu = function TypeA
|
|
|
38
38
|
_ref$query = _ref.query,
|
|
39
39
|
query = _ref$query === void 0 ? '' : _ref$query,
|
|
40
40
|
selectedItemIndex = _ref.selectedItemIndex,
|
|
41
|
+
selectionSource = _ref.selectionSource,
|
|
41
42
|
_ref$hasScrollPadding = _ref.hasScrollPadding,
|
|
42
43
|
hasScrollPadding = _ref$hasScrollPadding === void 0 ? false : _ref$hasScrollPadding;
|
|
43
44
|
var footerItemIndex = itemCount - 1;
|
|
@@ -65,6 +66,7 @@ var TypeAheadQuickInsertMenu = exports.TypeAheadQuickInsertMenu = function TypeA
|
|
|
65
66
|
getItemId: getItemId,
|
|
66
67
|
activeItemKey: activeItemKey,
|
|
67
68
|
selectedItemIndex: selectedItemIndex,
|
|
69
|
+
selectionSource: selectionSource,
|
|
68
70
|
scrollResetKey: query,
|
|
69
71
|
hasScrollPadding: hasScrollPadding,
|
|
70
72
|
scrollTo: "top-on-reset",
|
|
@@ -12,6 +12,7 @@ var _itemRank = require("@atlaskit/editor-common/registered-menu/item-rank");
|
|
|
12
12
|
var _typeAheadIsMenuFooterSectionKey = require("@atlaskit/editor-common/type-ahead-is-menu-footer-section-key");
|
|
13
13
|
var _typeAheadIsSectionOverflowItemKey = require("@atlaskit/editor-common/type-ahead-is-section-overflow-item-key");
|
|
14
14
|
var _surfaceRenderer = require("@atlaskit/editor-ui-control-model/surface-renderer");
|
|
15
|
+
var _normalizeQuickInsertMatchResult = require("../normalizeQuickInsertMatchResult");
|
|
15
16
|
var _QuickInsertSearchResultsSection = require("./QuickInsertSearchResultsSection");
|
|
16
17
|
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; }
|
|
17
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -187,7 +188,7 @@ var buildSearchSections = function buildSearchSections(_ref5) {
|
|
|
187
188
|
_step5;
|
|
188
189
|
try {
|
|
189
190
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
190
|
-
var _item$match,
|
|
191
|
+
var _item$match, _sourceIndexByCompone;
|
|
191
192
|
var item = _step5.value;
|
|
192
193
|
if (item.key === _keys.ASK_ROVO_MENU_ITEM.key) {
|
|
193
194
|
fallbackItem !== null && fallbackItem !== void 0 ? fallbackItem : fallbackItem = item;
|
|
@@ -200,15 +201,15 @@ var buildSearchSections = function buildSearchSections(_ref5) {
|
|
|
200
201
|
if (item.match && match === null || getOwnerSectionKey(item, isRecommendedItem) !== section.key) {
|
|
201
202
|
continue;
|
|
202
203
|
}
|
|
203
|
-
var
|
|
204
|
+
var normalizedMatch = (0, _normalizeQuickInsertMatchResult.normalizeQuickInsertMatchResult)(match);
|
|
205
|
+
var candidate = _objectSpread(_objectSpread({
|
|
204
206
|
identity: (0, _surfaceRenderer.getComponentIdentity)(item),
|
|
205
207
|
item: item,
|
|
206
|
-
itemRank: getParentRank(item, section.key)
|
|
207
|
-
|
|
208
|
-
score: Math.min(1, Math.max(0, (_match$score = match === null || match === void 0 ? void 0 : match.score) !== null && _match$score !== void 0 ? _match$score : 0)),
|
|
208
|
+
itemRank: getParentRank(item, section.key)
|
|
209
|
+
}, normalizedMatch), {}, {
|
|
209
210
|
sectionRank: sectionRank,
|
|
210
211
|
sourceIndex: (_sourceIndexByCompone = sourceIndexByComponent.get(item)) !== null && _sourceIndexByCompone !== void 0 ? _sourceIndexByCompone : Number.MAX_SAFE_INTEGER
|
|
211
|
-
};
|
|
212
|
+
});
|
|
212
213
|
var existing = matches.get(candidate.identity);
|
|
213
214
|
if (!existing || compareMatchedItems(candidate, existing) < 0) {
|
|
214
215
|
matches.set(candidate.identity, candidate);
|
|
@@ -10,7 +10,6 @@ import { MENU, RECOMMENDED_SECTION } from '@atlaskit/editor-common/quick-insert/
|
|
|
10
10
|
import { createRegisteredMenuSurfaceContext } from '@atlaskit/editor-common/registered-menu/surface-context';
|
|
11
11
|
import { getMenuFooterSectionKey } from '@atlaskit/editor-common/type-ahead-get-menu-footer-section-key';
|
|
12
12
|
import { getSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-get-section-overflow-item-key';
|
|
13
|
-
import Heading from '@atlaskit/heading/heading';
|
|
14
13
|
import CrossIcon from '@atlaskit/icon/core/cross';
|
|
15
14
|
import ModalBody from '@atlaskit/modal-dialog/modal-body';
|
|
16
15
|
import Modal from '@atlaskit/modal-dialog/modal-dialog';
|
|
@@ -18,7 +17,6 @@ import ModalFooter from '@atlaskit/modal-dialog/modal-footer';
|
|
|
18
17
|
import ModalHeader from '@atlaskit/modal-dialog/modal-header';
|
|
19
18
|
import ModalTitle from '@atlaskit/modal-dialog/modal-title';
|
|
20
19
|
import ModalTransition from '@atlaskit/modal-dialog/modal-transition';
|
|
21
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
20
|
import Textfield from '@atlaskit/textfield/text-field';
|
|
23
21
|
import { useQuickInsertSearchAnalytics } from '../registered-menu/useQuickInsertSearchAnalytics';
|
|
24
22
|
import { createRegistryElementBrowserModel, getInitialRegistryElementBrowserSection, getRegistryElementBrowserItems } from './model';
|
|
@@ -307,12 +305,7 @@ export const RegistryElementBrowser = ({
|
|
|
307
305
|
width: "min(968px, calc(100vw - 32px))"
|
|
308
306
|
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement("div", {
|
|
309
307
|
className: ax(["_zulp1fka _1e0c11p5 _yv0e1xuv _1bsb1osq _lk4ji47z"])
|
|
310
|
-
},
|
|
311
|
-
defaultMessage: 'Insert elements',
|
|
312
|
-
id: 'editor.quick-insert.title'
|
|
313
|
-
})) : /*#__PURE__*/React.createElement(Heading, {
|
|
314
|
-
size: "medium"
|
|
315
|
-
}, formatMessage({
|
|
308
|
+
}, /*#__PURE__*/React.createElement(ModalTitle, null, formatMessage({
|
|
316
309
|
defaultMessage: 'Insert elements',
|
|
317
310
|
id: 'editor.quick-insert.title'
|
|
318
311
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
2
2
|
import { ASK_ROVO_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
|
|
3
|
+
import { normalizeQuickInsertMatchResult } from '../normalizeQuickInsertMatchResult';
|
|
3
4
|
const compareRanks = (left, right) => {
|
|
4
5
|
for (let index = 0; index < Math.max(left.length, right.length); index++) {
|
|
5
6
|
var _left$index, _right$index;
|
|
@@ -105,8 +106,7 @@ export const getRegistryElementBrowserItems = ({
|
|
|
105
106
|
});
|
|
106
107
|
return result ? [{
|
|
107
108
|
...item,
|
|
108
|
-
|
|
109
|
-
score: Math.min(1, Math.max(0, result.score))
|
|
109
|
+
...normalizeQuickInsertMatchResult(result)
|
|
110
110
|
}] : [];
|
|
111
111
|
});
|
|
112
112
|
const prioritized = matches.filter(({
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Keeps score and priority handling consistent across Quick Insert search models. */
|
|
2
|
+
export const normalizeQuickInsertMatchResult = match => {
|
|
3
|
+
var _match$score;
|
|
4
|
+
return {
|
|
5
|
+
priorityGroup: Number.isFinite(match === null || match === void 0 ? void 0 : match.priorityGroup) ? match === null || match === void 0 ? void 0 : match.priorityGroup : undefined,
|
|
6
|
+
score: Math.min(1, Math.max(0, (_match$score = match === null || match === void 0 ? void 0 : match.score) !== null && _match$score !== void 0 ? _match$score : 0))
|
|
7
|
+
};
|
|
8
|
+
};
|
|
@@ -84,6 +84,7 @@ const QuickInsertMenuRoot = ({
|
|
|
84
84
|
selectableItems,
|
|
85
85
|
selectedItemIndex,
|
|
86
86
|
activeItemKey,
|
|
87
|
+
selectionSource,
|
|
87
88
|
...listEvents
|
|
88
89
|
} = useRegisteredMenu({
|
|
89
90
|
model,
|
|
@@ -169,7 +170,8 @@ const QuickInsertMenuRoot = ({
|
|
|
169
170
|
onRenderedItemsChange: setRenderedItems,
|
|
170
171
|
query: query,
|
|
171
172
|
rows: rows,
|
|
172
|
-
selectedItemIndex: selectedItemIndex
|
|
173
|
+
selectedItemIndex: selectedItemIndex,
|
|
174
|
+
selectionSource: selectionSource
|
|
173
175
|
}) : /*#__PURE__*/React.createElement(ToolbarQuickInsertMenu, {
|
|
174
176
|
Item: RegisteredQuickInsertMenuItem,
|
|
175
177
|
activePreviewItemKey: activeItemKey,
|
|
@@ -187,7 +189,8 @@ const QuickInsertMenuRoot = ({
|
|
|
187
189
|
onRenderedItemsChange: setRenderedItems,
|
|
188
190
|
query: query,
|
|
189
191
|
rows: rows,
|
|
190
|
-
selectedItemIndex: selectedItemIndex
|
|
192
|
+
selectedItemIndex: selectedItemIndex,
|
|
193
|
+
selectionSource: selectionSource
|
|
191
194
|
}))));
|
|
192
195
|
};
|
|
193
196
|
export default QuickInsertMenuRoot;
|
|
@@ -32,7 +32,8 @@ export const ToolbarQuickInsertMenu = ({
|
|
|
32
32
|
onItemVisibilityChange,
|
|
33
33
|
onRenderedItemsChange,
|
|
34
34
|
query,
|
|
35
|
-
selectedItemIndex
|
|
35
|
+
selectedItemIndex,
|
|
36
|
+
selectionSource
|
|
36
37
|
}) => {
|
|
37
38
|
const footerItemIndex = itemCount - 1;
|
|
38
39
|
const footerItemId = getQuickInsertMenuItemId(listId, footerItemIndex);
|
|
@@ -79,6 +80,7 @@ export const ToolbarQuickInsertMenu = ({
|
|
|
79
80
|
getItemId: getItemId,
|
|
80
81
|
activeItemKey: activePreviewItemKey,
|
|
81
82
|
selectedItemIndex: selectedItemIndex,
|
|
83
|
+
selectionSource: selectionSource,
|
|
82
84
|
scrollResetKey: query,
|
|
83
85
|
onItemHover: onItemHover,
|
|
84
86
|
onItemFocus: onItemFocus,
|
|
@@ -29,6 +29,7 @@ export const TypeAheadQuickInsertMenu = ({
|
|
|
29
29
|
onRenderedItemsChange,
|
|
30
30
|
query = '',
|
|
31
31
|
selectedItemIndex,
|
|
32
|
+
selectionSource,
|
|
32
33
|
hasScrollPadding = false
|
|
33
34
|
}) => {
|
|
34
35
|
const footerItemIndex = itemCount - 1;
|
|
@@ -53,6 +54,7 @@ export const TypeAheadQuickInsertMenu = ({
|
|
|
53
54
|
getItemId: getItemId,
|
|
54
55
|
activeItemKey: activeItemKey,
|
|
55
56
|
selectedItemIndex: selectedItemIndex,
|
|
57
|
+
selectionSource: selectionSource,
|
|
56
58
|
scrollResetKey: query,
|
|
57
59
|
hasScrollPadding: hasScrollPadding,
|
|
58
60
|
scrollTo: "top-on-reset",
|
|
@@ -3,6 +3,7 @@ import { applyRegisteredItemRanks } from '@atlaskit/editor-common/registered-men
|
|
|
3
3
|
import { isMenuFooterSectionKey } from '@atlaskit/editor-common/type-ahead-is-menu-footer-section-key';
|
|
4
4
|
import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
|
|
5
5
|
import { getComponentIdentity, resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
|
|
6
|
+
import { normalizeQuickInsertMatchResult } from '../normalizeQuickInsertMatchResult';
|
|
6
7
|
import { QuickInsertSearchResultsSection } from './QuickInsertSearchResultsSection';
|
|
7
8
|
const SEARCH_TOP_MATCH_LIMIT = 5;
|
|
8
9
|
const SEARCH_RESULTS_HEADING = {
|
|
@@ -128,7 +129,7 @@ const buildSearchSections = ({
|
|
|
128
129
|
} of contentSections) {
|
|
129
130
|
const sectionRank = getParentRank(section, root.key);
|
|
130
131
|
for (const item of items) {
|
|
131
|
-
var _item$match,
|
|
132
|
+
var _item$match, _sourceIndexByCompone;
|
|
132
133
|
if (item.key === ASK_ROVO_MENU_ITEM.key) {
|
|
133
134
|
fallbackItem ??= item;
|
|
134
135
|
}
|
|
@@ -140,12 +141,12 @@ const buildSearchSections = ({
|
|
|
140
141
|
if (item.match && match === null || getOwnerSectionKey(item, isRecommendedItem) !== section.key) {
|
|
141
142
|
continue;
|
|
142
143
|
}
|
|
144
|
+
const normalizedMatch = normalizeQuickInsertMatchResult(match);
|
|
143
145
|
const candidate = {
|
|
144
146
|
identity: getComponentIdentity(item),
|
|
145
147
|
item,
|
|
146
148
|
itemRank: getParentRank(item, section.key),
|
|
147
|
-
|
|
148
|
-
score: Math.min(1, Math.max(0, (_match$score = match === null || match === void 0 ? void 0 : match.score) !== null && _match$score !== void 0 ? _match$score : 0)),
|
|
149
|
+
...normalizedMatch,
|
|
149
150
|
sectionRank,
|
|
150
151
|
sourceIndex: (_sourceIndexByCompone = sourceIndexByComponent.get(item)) !== null && _sourceIndexByCompone !== void 0 ? _sourceIndexByCompone : Number.MAX_SAFE_INTEGER
|
|
151
152
|
};
|
|
@@ -14,7 +14,6 @@ import { MENU, RECOMMENDED_SECTION } from '@atlaskit/editor-common/quick-insert/
|
|
|
14
14
|
import { createRegisteredMenuSurfaceContext } from '@atlaskit/editor-common/registered-menu/surface-context';
|
|
15
15
|
import { getMenuFooterSectionKey } from '@atlaskit/editor-common/type-ahead-get-menu-footer-section-key';
|
|
16
16
|
import { getSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-get-section-overflow-item-key';
|
|
17
|
-
import Heading from '@atlaskit/heading/heading';
|
|
18
17
|
import CrossIcon from '@atlaskit/icon/core/cross';
|
|
19
18
|
import ModalBody from '@atlaskit/modal-dialog/modal-body';
|
|
20
19
|
import Modal from '@atlaskit/modal-dialog/modal-dialog';
|
|
@@ -22,7 +21,6 @@ import ModalFooter from '@atlaskit/modal-dialog/modal-footer';
|
|
|
22
21
|
import ModalHeader from '@atlaskit/modal-dialog/modal-header';
|
|
23
22
|
import ModalTitle from '@atlaskit/modal-dialog/modal-title';
|
|
24
23
|
import ModalTransition from '@atlaskit/modal-dialog/modal-transition';
|
|
25
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
26
24
|
import Textfield from '@atlaskit/textfield/text-field';
|
|
27
25
|
import { useQuickInsertSearchAnalytics } from '../registered-menu/useQuickInsertSearchAnalytics';
|
|
28
26
|
import { createRegistryElementBrowserModel, getInitialRegistryElementBrowserSection, getRegistryElementBrowserItems } from './model';
|
|
@@ -329,12 +327,7 @@ export var RegistryElementBrowser = function RegistryElementBrowser(_ref) {
|
|
|
329
327
|
width: "min(968px, calc(100vw - 32px))"
|
|
330
328
|
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement("div", {
|
|
331
329
|
className: ax(["_zulp1fka _1e0c11p5 _yv0e1xuv _1bsb1osq _lk4ji47z"])
|
|
332
|
-
},
|
|
333
|
-
defaultMessage: 'Insert elements',
|
|
334
|
-
id: 'editor.quick-insert.title'
|
|
335
|
-
})) : /*#__PURE__*/React.createElement(Heading, {
|
|
336
|
-
size: "medium"
|
|
337
|
-
}, formatMessage({
|
|
330
|
+
}, /*#__PURE__*/React.createElement(ModalTitle, null, formatMessage({
|
|
338
331
|
defaultMessage: 'Insert elements',
|
|
339
332
|
id: 'editor.quick-insert.title'
|
|
340
333
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -4,6 +4,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
6
6
|
import { ASK_ROVO_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
|
|
7
|
+
import { normalizeQuickInsertMatchResult } from '../normalizeQuickInsertMatchResult';
|
|
7
8
|
var compareRanks = function compareRanks(left, right) {
|
|
8
9
|
for (var index = 0; index < Math.max(left.length, right.length); index++) {
|
|
9
10
|
var _left$index, _right$index;
|
|
@@ -127,10 +128,7 @@ export var getRegistryElementBrowserItems = function getRegistryElementBrowserIt
|
|
|
127
128
|
itemKey: item.registration.key,
|
|
128
129
|
query: normalizedQuery
|
|
129
130
|
});
|
|
130
|
-
return result ? [_objectSpread(_objectSpread({}, item),
|
|
131
|
-
priorityGroup: result.priorityGroup !== undefined && Number.isFinite(result.priorityGroup) ? result.priorityGroup : undefined,
|
|
132
|
-
score: Math.min(1, Math.max(0, result.score))
|
|
133
|
-
})] : [];
|
|
131
|
+
return result ? [_objectSpread(_objectSpread({}, item), normalizeQuickInsertMatchResult(result))] : [];
|
|
134
132
|
});
|
|
135
133
|
var prioritized = matches.filter(function (_ref4) {
|
|
136
134
|
var priorityGroup = _ref4.priorityGroup;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Keeps score and priority handling consistent across Quick Insert search models. */
|
|
2
|
+
export var normalizeQuickInsertMatchResult = function normalizeQuickInsertMatchResult(match) {
|
|
3
|
+
var _match$score;
|
|
4
|
+
return {
|
|
5
|
+
priorityGroup: Number.isFinite(match === null || match === void 0 ? void 0 : match.priorityGroup) ? match === null || match === void 0 ? void 0 : match.priorityGroup : undefined,
|
|
6
|
+
score: Math.min(1, Math.max(0, (_match$score = match === null || match === void 0 ? void 0 : match.score) !== null && _match$score !== void 0 ? _match$score : 0))
|
|
7
|
+
};
|
|
8
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _toArray from "@babel/runtime/helpers/toArray";
|
|
4
|
-
var _excluded = ["rows", "selectableItems", "selectedItemIndex", "activeItemKey"];
|
|
4
|
+
var _excluded = ["rows", "selectableItems", "selectedItemIndex", "activeItemKey", "selectionSource"];
|
|
5
5
|
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; }
|
|
6
6
|
import React, { useCallback, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7
7
|
import { useIntl } from 'react-intl';
|
|
@@ -103,6 +103,7 @@ var QuickInsertMenuRoot = function QuickInsertMenuRoot(_ref) {
|
|
|
103
103
|
selectableItems = _useRegisteredMenu.selectableItems,
|
|
104
104
|
selectedItemIndex = _useRegisteredMenu.selectedItemIndex,
|
|
105
105
|
activeItemKey = _useRegisteredMenu.activeItemKey,
|
|
106
|
+
selectionSource = _useRegisteredMenu.selectionSource,
|
|
106
107
|
listEvents = _objectWithoutProperties(_useRegisteredMenu, _excluded);
|
|
107
108
|
var listId = useId();
|
|
108
109
|
var _useState = useState({
|
|
@@ -189,7 +190,8 @@ var QuickInsertMenuRoot = function QuickInsertMenuRoot(_ref) {
|
|
|
189
190
|
onRenderedItemsChange: setRenderedItems,
|
|
190
191
|
query: query,
|
|
191
192
|
rows: rows,
|
|
192
|
-
selectedItemIndex: selectedItemIndex
|
|
193
|
+
selectedItemIndex: selectedItemIndex,
|
|
194
|
+
selectionSource: selectionSource
|
|
193
195
|
}) : /*#__PURE__*/React.createElement(ToolbarQuickInsertMenu, {
|
|
194
196
|
Item: RegisteredQuickInsertMenuItem,
|
|
195
197
|
activePreviewItemKey: activeItemKey,
|
|
@@ -207,7 +209,8 @@ var QuickInsertMenuRoot = function QuickInsertMenuRoot(_ref) {
|
|
|
207
209
|
onRenderedItemsChange: setRenderedItems,
|
|
208
210
|
query: query,
|
|
209
211
|
rows: rows,
|
|
210
|
-
selectedItemIndex: selectedItemIndex
|
|
212
|
+
selectedItemIndex: selectedItemIndex,
|
|
213
|
+
selectionSource: selectionSource
|
|
211
214
|
}))));
|
|
212
215
|
};
|
|
213
216
|
export default QuickInsertMenuRoot;
|
|
@@ -32,7 +32,8 @@ export var ToolbarQuickInsertMenu = function ToolbarQuickInsertMenu(_ref) {
|
|
|
32
32
|
onItemVisibilityChange = _ref.onItemVisibilityChange,
|
|
33
33
|
onRenderedItemsChange = _ref.onRenderedItemsChange,
|
|
34
34
|
query = _ref.query,
|
|
35
|
-
selectedItemIndex = _ref.selectedItemIndex
|
|
35
|
+
selectedItemIndex = _ref.selectedItemIndex,
|
|
36
|
+
selectionSource = _ref.selectionSource;
|
|
36
37
|
var footerItemIndex = itemCount - 1;
|
|
37
38
|
var footerItemId = getQuickInsertMenuItemId(listId, footerItemIndex);
|
|
38
39
|
var isEmptySearch = query !== '' && model.sections.length === 0;
|
|
@@ -83,6 +84,7 @@ export var ToolbarQuickInsertMenu = function ToolbarQuickInsertMenu(_ref) {
|
|
|
83
84
|
getItemId: getItemId,
|
|
84
85
|
activeItemKey: activePreviewItemKey,
|
|
85
86
|
selectedItemIndex: selectedItemIndex,
|
|
87
|
+
selectionSource: selectionSource,
|
|
86
88
|
scrollResetKey: query,
|
|
87
89
|
onItemHover: onItemHover,
|
|
88
90
|
onItemFocus: onItemFocus,
|
|
@@ -30,6 +30,7 @@ export var TypeAheadQuickInsertMenu = function TypeAheadQuickInsertMenu(_ref) {
|
|
|
30
30
|
_ref$query = _ref.query,
|
|
31
31
|
query = _ref$query === void 0 ? '' : _ref$query,
|
|
32
32
|
selectedItemIndex = _ref.selectedItemIndex,
|
|
33
|
+
selectionSource = _ref.selectionSource,
|
|
33
34
|
_ref$hasScrollPadding = _ref.hasScrollPadding,
|
|
34
35
|
hasScrollPadding = _ref$hasScrollPadding === void 0 ? false : _ref$hasScrollPadding;
|
|
35
36
|
var footerItemIndex = itemCount - 1;
|
|
@@ -57,6 +58,7 @@ export var TypeAheadQuickInsertMenu = function TypeAheadQuickInsertMenu(_ref) {
|
|
|
57
58
|
getItemId: getItemId,
|
|
58
59
|
activeItemKey: activeItemKey,
|
|
59
60
|
selectedItemIndex: selectedItemIndex,
|
|
61
|
+
selectionSource: selectionSource,
|
|
60
62
|
scrollResetKey: query,
|
|
61
63
|
hasScrollPadding: hasScrollPadding,
|
|
62
64
|
scrollTo: "top-on-reset",
|
|
@@ -10,6 +10,7 @@ import { applyRegisteredItemRanks } from '@atlaskit/editor-common/registered-men
|
|
|
10
10
|
import { isMenuFooterSectionKey } from '@atlaskit/editor-common/type-ahead-is-menu-footer-section-key';
|
|
11
11
|
import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
|
|
12
12
|
import { getComponentIdentity, resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
|
|
13
|
+
import { normalizeQuickInsertMatchResult } from '../normalizeQuickInsertMatchResult';
|
|
13
14
|
import { QuickInsertSearchResultsSection } from './QuickInsertSearchResultsSection';
|
|
14
15
|
var SEARCH_TOP_MATCH_LIMIT = 5;
|
|
15
16
|
var SEARCH_RESULTS_HEADING = {
|
|
@@ -180,7 +181,7 @@ var buildSearchSections = function buildSearchSections(_ref5) {
|
|
|
180
181
|
_step5;
|
|
181
182
|
try {
|
|
182
183
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
183
|
-
var _item$match,
|
|
184
|
+
var _item$match, _sourceIndexByCompone;
|
|
184
185
|
var item = _step5.value;
|
|
185
186
|
if (item.key === ASK_ROVO_MENU_ITEM.key) {
|
|
186
187
|
fallbackItem !== null && fallbackItem !== void 0 ? fallbackItem : fallbackItem = item;
|
|
@@ -193,15 +194,15 @@ var buildSearchSections = function buildSearchSections(_ref5) {
|
|
|
193
194
|
if (item.match && match === null || getOwnerSectionKey(item, isRecommendedItem) !== section.key) {
|
|
194
195
|
continue;
|
|
195
196
|
}
|
|
196
|
-
var
|
|
197
|
+
var normalizedMatch = normalizeQuickInsertMatchResult(match);
|
|
198
|
+
var candidate = _objectSpread(_objectSpread({
|
|
197
199
|
identity: getComponentIdentity(item),
|
|
198
200
|
item: item,
|
|
199
|
-
itemRank: getParentRank(item, section.key)
|
|
200
|
-
|
|
201
|
-
score: Math.min(1, Math.max(0, (_match$score = match === null || match === void 0 ? void 0 : match.score) !== null && _match$score !== void 0 ? _match$score : 0)),
|
|
201
|
+
itemRank: getParentRank(item, section.key)
|
|
202
|
+
}, normalizedMatch), {}, {
|
|
202
203
|
sectionRank: sectionRank,
|
|
203
204
|
sourceIndex: (_sourceIndexByCompone = sourceIndexByComponent.get(item)) !== null && _sourceIndexByCompone !== void 0 ? _sourceIndexByCompone : Number.MAX_SAFE_INTEGER
|
|
204
|
-
};
|
|
205
|
+
});
|
|
205
206
|
var existing = matches.get(candidate.identity);
|
|
206
207
|
if (!existing || compareMatchedItems(candidate, existing) < 0) {
|
|
207
208
|
matches.set(candidate.identity, candidate);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { MenuItemMatchResult } from '@atlaskit/editor-ui-control-model/types';
|
|
2
|
+
/** Keeps score and priority handling consistent across Quick Insert search models. */
|
|
3
|
+
export declare const normalizeQuickInsertMatchResult: (match: MenuItemMatchResult | null | undefined) => MenuItemMatchResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { RegisteredMenuModel, RegisteredMenuItemProps } from '@atlaskit/editor-common/registered-menu';
|
|
2
|
+
import type { RegisteredMenuModel, RegisteredMenuItemProps, RegisteredMenuSelectionSource } from '@atlaskit/editor-common/registered-menu';
|
|
3
3
|
import type { EmptyStateHandler } from '@atlaskit/editor-common/types/empty-state-handler';
|
|
4
4
|
import type { RegisterMenuItem, RegisterMenuSection } from '@atlaskit/editor-ui-control-model/types';
|
|
5
5
|
type Props = {
|
|
@@ -23,6 +23,7 @@ type Props = {
|
|
|
23
23
|
query: string;
|
|
24
24
|
rows: Array<RegisterMenuItem | RegisterMenuSection>;
|
|
25
25
|
selectedItemIndex: number;
|
|
26
|
+
selectionSource?: RegisteredMenuSelectionSource;
|
|
26
27
|
};
|
|
27
|
-
export declare const ToolbarQuickInsertMenu: ({ Item, model, emptyStateHandler, listLabel, activePreviewItemKey, itemCount, listId, maxHeight, rows, onItemBlur, onItemFocus, onItemHover, onItemLeave, onItemVisibilityChange, onRenderedItemsChange, query, selectedItemIndex, }: Props) => React.JSX.Element | null;
|
|
28
|
+
export declare const ToolbarQuickInsertMenu: ({ Item, model, emptyStateHandler, listLabel, activePreviewItemKey, itemCount, listId, maxHeight, rows, onItemBlur, onItemFocus, onItemHover, onItemLeave, onItemVisibilityChange, onRenderedItemsChange, query, selectedItemIndex, selectionSource, }: Props) => React.JSX.Element | null;
|
|
28
29
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { RegisteredMenuItemProps, RegisteredMenuModel } from '@atlaskit/editor-common/registered-menu';
|
|
2
|
+
import type { RegisteredMenuItemProps, RegisteredMenuModel, RegisteredMenuSelectionSource } from '@atlaskit/editor-common/registered-menu';
|
|
3
3
|
import type { RegisterMenuItem, RegisterMenuSection } from '@atlaskit/editor-ui-control-model/types';
|
|
4
4
|
type Props = {
|
|
5
5
|
activeItemKey?: string;
|
|
@@ -22,6 +22,7 @@ type Props = {
|
|
|
22
22
|
query?: string;
|
|
23
23
|
rows: Array<RegisterMenuItem | RegisterMenuSection>;
|
|
24
24
|
selectedItemIndex: number;
|
|
25
|
+
selectionSource?: RegisteredMenuSelectionSource;
|
|
25
26
|
};
|
|
26
|
-
export declare const TypeAheadQuickInsertMenu: ({ Item, rows, activeItemKey, itemCount, listId, listLabel, maxHeight, model, onItemFocus, onItemBlur, onItemHover, onItemLeave, onItemVisibilityChange, onRenderedItemsChange, query, selectedItemIndex, hasScrollPadding, }: Props) => React.JSX.Element | null;
|
|
27
|
+
export declare const TypeAheadQuickInsertMenu: ({ Item, rows, activeItemKey, itemCount, listId, listLabel, maxHeight, model, onItemFocus, onItemBlur, onItemHover, onItemLeave, onItemVisibilityChange, onRenderedItemsChange, query, selectedItemIndex, selectionSource, hasScrollPadding, }: Props) => React.JSX.Element | null;
|
|
27
28
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-quick-insert",
|
|
3
|
-
"version": "30.0.
|
|
3
|
+
"version": "30.0.5",
|
|
4
4
|
"description": "Quick insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"atlaskit:src": "src/index.ts",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@atlaskit/button": "^25.
|
|
29
|
+
"@atlaskit/button": "^25.7.0",
|
|
30
30
|
"@atlaskit/css": "^1.1.0",
|
|
31
31
|
"@atlaskit/docs": "^12.3.0",
|
|
32
32
|
"@atlaskit/editor-plugin-analytics": "^30.0.0",
|
|
@@ -36,19 +36,17 @@
|
|
|
36
36
|
"@atlaskit/editor-plugin-type-ahead": "^31.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-ui-control-registry": "^24.0.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
39
|
-
"@atlaskit/editor-shared-styles": "^4.6.0",
|
|
40
39
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
41
40
|
"@atlaskit/editor-ui-control-model": "^3.0.0",
|
|
42
41
|
"@atlaskit/heading": "^8.0.0",
|
|
43
42
|
"@atlaskit/icon": "^38.0.0",
|
|
44
43
|
"@atlaskit/menu": "^11.0.0",
|
|
45
|
-
"@atlaskit/modal-dialog": "^17.
|
|
44
|
+
"@atlaskit/modal-dialog": "^17.2.0",
|
|
46
45
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
47
46
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
48
47
|
"@atlaskit/primitives": "^22.6.0",
|
|
49
48
|
"@atlaskit/textfield": "^10.3.0",
|
|
50
|
-
"@atlaskit/
|
|
51
|
-
"@atlaskit/tokens": "^20.8.0",
|
|
49
|
+
"@atlaskit/tokens": "^20.9.0",
|
|
52
50
|
"@atlaskit/tooltip": "^24.4.0",
|
|
53
51
|
"@babel/runtime": "^7.0.0",
|
|
54
52
|
"@compiled/react": "^1.0.2",
|
|
@@ -56,14 +54,14 @@
|
|
|
56
54
|
"react-loosely-lazy": "^1.0.0"
|
|
57
55
|
},
|
|
58
56
|
"peerDependencies": {
|
|
59
|
-
"@atlaskit/editor-common": "^134.
|
|
57
|
+
"@atlaskit/editor-common": "^134.6.0",
|
|
60
58
|
"react": "^18.2.0 || ^19.2.0",
|
|
61
59
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
62
60
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
63
61
|
},
|
|
64
62
|
"devDependencies": {
|
|
63
|
+
"@atlaskit/editor-common": "^134.6.0",
|
|
65
64
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
66
|
-
"@testing-library/react": "^16.3.0",
|
|
67
65
|
"react": "^19.2.0",
|
|
68
66
|
"react-dom": "^19.2.0",
|
|
69
67
|
"react-intl": "^7.0.0"
|
|
@@ -71,10 +69,6 @@
|
|
|
71
69
|
"platform-feature-flags": {
|
|
72
70
|
"platform_editor_ease_of_use_metrics": {
|
|
73
71
|
"type": "boolean"
|
|
74
|
-
},
|
|
75
|
-
"platform_dst_modal-dialog-use-modal-title": {
|
|
76
|
-
"type": "boolean",
|
|
77
|
-
"referenceOnly": true
|
|
78
72
|
}
|
|
79
73
|
}
|
|
80
74
|
}
|