@atlaskit/editor-plugin-quick-insert 26.0.4 → 26.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/cjs/app-category-analytics.js +4 -4
- package/dist/cjs/pm-plugins/experiences/quick-insert-open-experience.js +9 -5
- package/dist/cjs/quickInsertPlugin.js +13 -9
- package/dist/cjs/ui/BlockControlQuickInsertButton.js +2 -2
- package/dist/cjs/ui/ModalElementBrowser/ModalElementBrowser.js +7 -7
- package/dist/cjs/ui/ModalElementBrowser/categories.js +13 -13
- package/dist/cjs/ui/ModalElementBrowser/index.js +4 -4
- package/dist/cjs/ui/QuickInsertMenuFooterItem.js +3 -3
- package/dist/cjs/ui/QuickInsertSectionOverflowMenuItem.js +2 -2
- package/dist/cjs/ui/RegistryElementBrowser/index.js +9 -9
- package/dist/cjs/ui/getLegacyCompatibleComponents.js +5 -0
- package/dist/cjs/ui/getRecommendedComponents.js +3 -3
- package/dist/cjs/ui/search.js +4 -4
- package/dist/es2019/app-category-analytics.js +1 -1
- package/dist/es2019/pm-plugins/experiences/quick-insert-open-experience.js +6 -2
- package/dist/es2019/quickInsertPlugin.js +7 -3
- package/dist/es2019/ui/BlockControlQuickInsertButton.js +1 -1
- package/dist/es2019/ui/ModalElementBrowser/ModalElementBrowser.js +2 -2
- package/dist/es2019/ui/ModalElementBrowser/categories.js +1 -1
- package/dist/es2019/ui/ModalElementBrowser/index.js +2 -2
- package/dist/es2019/ui/QuickInsertMenuFooterItem.js +1 -1
- package/dist/es2019/ui/QuickInsertSectionOverflowMenuItem.js +1 -1
- package/dist/es2019/ui/RegistryElementBrowser/index.js +2 -2
- package/dist/es2019/ui/getLegacyCompatibleComponents.js +5 -0
- package/dist/es2019/ui/getRecommendedComponents.js +1 -1
- package/dist/es2019/ui/search.js +2 -2
- package/dist/esm/app-category-analytics.js +1 -1
- package/dist/esm/pm-plugins/experiences/quick-insert-open-experience.js +6 -2
- package/dist/esm/quickInsertPlugin.js +7 -3
- package/dist/esm/ui/BlockControlQuickInsertButton.js +1 -1
- package/dist/esm/ui/ModalElementBrowser/ModalElementBrowser.js +2 -2
- package/dist/esm/ui/ModalElementBrowser/categories.js +1 -1
- package/dist/esm/ui/ModalElementBrowser/index.js +2 -2
- package/dist/esm/ui/QuickInsertMenuFooterItem.js +1 -1
- package/dist/esm/ui/QuickInsertSectionOverflowMenuItem.js +1 -1
- package/dist/esm/ui/RegistryElementBrowser/index.js +2 -2
- package/dist/esm/ui/getLegacyCompatibleComponents.js +5 -0
- package/dist/esm/ui/getRecommendedComponents.js +1 -1
- package/dist/esm/ui/search.js +2 -2
- package/dist/types/app-category-analytics.d.ts +2 -2
- package/dist/types/pm-plugins/commands/index.d.ts +4 -3
- package/dist/types/pm-plugins/experiences/quick-insert-open-experience.d.ts +1 -1
- package/dist/types/pm-plugins/plugin-key.d.ts +1 -1
- package/dist/types/quickInsertPluginType.d.ts +16 -7
- package/dist/types/ui/BlockControlQuickInsertButton.d.ts +1 -1
- package/dist/types/ui/ModalElementBrowser/ModalElementBrowser.d.ts +2 -2
- package/dist/types/ui/ModalElementBrowser/index.d.ts +1 -1
- package/dist/types/ui/QuickInsertMenuFooterItem.d.ts +1 -1
- package/dist/types/ui/QuickInsertSectionOverflowMenuItem.d.ts +1 -1
- package/dist/types/ui/RegistryElementBrowser/RegistryElementBrowser.d.ts +1 -1
- package/dist/types/ui/RegistryElementBrowser/RegistryElementBrowserSearchResults.d.ts +1 -1
- package/dist/types/ui/RegistryElementBrowser/index.d.ts +1 -1
- package/dist/types/ui/block-control-quick-insert.d.ts +1 -1
- package/dist/types/ui/getLegacyCompatibleComponents.d.ts +1 -1
- package/dist/types/ui/getQuickInsertComponents.d.ts +1 -1
- package/dist/types/ui/getRecommendedComponents.d.ts +1 -1
- package/dist/types/ui/search.d.ts +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-quick-insert
|
|
2
2
|
|
|
3
|
+
## 26.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`1c4db454a74a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c4db454a74a2) -
|
|
8
|
+
Registered menu hosts can override section and item ranks through getItemRank in the shared
|
|
9
|
+
ordering used by Quick Insert, type-ahead, and insert menus. Rovo editor presets group these
|
|
10
|
+
settings under quickInsertOptions. Typeahead handlers expose getRegisteredItemRank with a
|
|
11
|
+
RegisteredItemRankResolver that receives the registered component and its ranked parent. Skill
|
|
12
|
+
manifests and adapters accept visibility predicates that follow current chat state without
|
|
13
|
+
rebuilding registrations.
|
|
14
|
+
|
|
15
|
+
Under platform_editor_slash_command, main and inline Rovo chat show Rovo commands first and use
|
|
16
|
+
specialist placeholders. The chat skills layer receives selectedAgentId and respects the existing
|
|
17
|
+
enableSkillsInSpecialistPromptInput setting. Treatment keeps registrations and evaluates
|
|
18
|
+
visibility per item. Control keeps the legacy full-or-empty manifest and the same host opt-in.
|
|
19
|
+
Search mode and an existing prompt skill still prevent insertion.
|
|
20
|
+
|
|
21
|
+
Affected Jira, JSM, and Confluence skills require the signed-in user's product access at the site,
|
|
22
|
+
in addition to backend filtering of declared site entitlements. Skill Builder needs Studio and the
|
|
23
|
+
signed-in user's Rovo AI entitlement for that site. Eligibility requests follow site changes; user
|
|
24
|
+
identity remains stable during the signed-in session. Visibility reads committed React state and
|
|
25
|
+
supports server rendering.
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
|
|
31
|
+
## 26.0.5
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
|
|
3
37
|
## 26.0.4
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.createQuickInsertItemsAnalyticsScheduler = exports.calculateQuickInsertItemsAttributes = exports.QUICK_INSERT_ITEMS_ANALYTICS_DELAY_MS = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
9
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
10
10
|
var _getMenuItemParents = require("@atlaskit/editor-common/quick-insert/get-menu-item-parents");
|
|
11
11
|
var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
12
12
|
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; } } }; }
|
|
@@ -191,10 +191,10 @@ var createQuickInsertItemsAnalyticsScheduler = exports.createQuickInsertItemsAna
|
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
193
|
dispatchAnalyticsEvent({
|
|
194
|
-
action:
|
|
195
|
-
actionSubject:
|
|
194
|
+
action: _enums.ACTION.QUICK_INSERT_INFORMATION,
|
|
195
|
+
actionSubject: _enums.ACTION_SUBJECT.QUICK_INSERT,
|
|
196
196
|
attributes: calculateQuickInsertItemsAttributes(options),
|
|
197
|
-
eventType:
|
|
197
|
+
eventType: _enums.EVENT_TYPE.OPERATIONAL
|
|
198
198
|
});
|
|
199
199
|
};
|
|
200
200
|
return {
|
|
@@ -6,8 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getQuickInsertOpenExperiencePlugin = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
-
var
|
|
9
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
10
10
|
var _experiences = require("@atlaskit/editor-common/experiences");
|
|
11
|
+
var _consts = require("@atlaskit/editor-common/experiences/consts");
|
|
12
|
+
var _Experience = require("@atlaskit/editor-common/experiences/Experience");
|
|
13
|
+
var _ExperienceCheckDomMutation = require("@atlaskit/editor-common/experiences/ExperienceCheckDomMutation");
|
|
14
|
+
var _ExperienceCheckTimeout = require("@atlaskit/editor-common/experiences/ExperienceCheckTimeout");
|
|
11
15
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
12
16
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
17
|
var pluginKey = new _state.PluginKey('quickInsertOpenExperience');
|
|
@@ -40,12 +44,12 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
|
|
|
40
44
|
}
|
|
41
45
|
return targetEl;
|
|
42
46
|
};
|
|
43
|
-
var experience = new
|
|
44
|
-
actionSubjectId:
|
|
47
|
+
var experience = new _Experience.Experience(_consts.EXPERIENCE_ID.MENU_OPEN, {
|
|
48
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.QUICK_INSERT,
|
|
45
49
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
46
|
-
checks: [new
|
|
50
|
+
checks: [new _ExperienceCheckTimeout.ExperienceCheckTimeout({
|
|
47
51
|
durationMs: TIMEOUT_DURATION
|
|
48
|
-
}), new
|
|
52
|
+
}), new _ExperienceCheckDomMutation.ExperienceCheckDomMutation({
|
|
49
53
|
onDomMutation: function onDomMutation(_ref2) {
|
|
50
54
|
var mutations = _ref2.mutations;
|
|
51
55
|
if (mutations.some(isQuickInsertMenuAddedInMutation)) {
|
|
@@ -11,9 +11,10 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
var _reactIntl = require("react-intl");
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
14
|
+
var _isSsr = require("@atlaskit/editor-common/is-ssr");
|
|
15
|
+
var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
|
|
16
|
+
var _quickInsertRank = require("@atlaskit/editor-common/quick-insert/quick-insert-rank");
|
|
17
|
+
var _utils = require("@atlaskit/editor-common/quick-insert/utils");
|
|
17
18
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
18
19
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
19
20
|
var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
|
|
@@ -40,8 +41,10 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
40
41
|
options === null || options === void 0 || (_options$onInsert = options.onInsert) === null || _options$onInsert === void 0 || _options$onInsert.call(options, item);
|
|
41
42
|
};
|
|
42
43
|
var typeAheadPrioritySortingFn = (0, _search.withLayoutQuickInsertPrioritySorting)(options === null || options === void 0 ? void 0 : options.prioritySortingFn);
|
|
44
|
+
var getItemRank = (0, _quickInsertRank.createQuickInsertRankResolver)(options === null || options === void 0 ? void 0 : options.getItemRank);
|
|
43
45
|
var typeAhead = {
|
|
44
46
|
id: _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT,
|
|
47
|
+
getRegisteredItemRank: getItemRank,
|
|
45
48
|
trigger: '/',
|
|
46
49
|
// Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
|
|
47
50
|
customRegex: '[//]',
|
|
@@ -70,8 +73,8 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
70
73
|
getMoreOptionsButtonConfig: options !== null && options !== void 0 && options.enableElementBrowser ? function (_ref3) {
|
|
71
74
|
var formatMessage = _ref3.formatMessage;
|
|
72
75
|
return {
|
|
73
|
-
title: formatMessage(
|
|
74
|
-
ariaLabel: formatMessage(
|
|
76
|
+
title: formatMessage(_insertBlock.toolbarInsertBlockMessages.viewMore),
|
|
77
|
+
ariaLabel: formatMessage(_insertBlock.toolbarInsertBlockMessages.viewMoreAriaLabel),
|
|
75
78
|
onClick: function onClick(props) {
|
|
76
79
|
return openElementBrowser()(props);
|
|
77
80
|
},
|
|
@@ -167,7 +170,7 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
167
170
|
}
|
|
168
171
|
refs.popupsMountPoint = popupsMountPoint || undefined;
|
|
169
172
|
refs.wrapperElement = wrapperElement || undefined;
|
|
170
|
-
if (!editorView || (0,
|
|
173
|
+
if (!editorView || (0, _isSsr.isSSR)()) {
|
|
171
174
|
return null;
|
|
172
175
|
}
|
|
173
176
|
if (options !== null && options !== void 0 && options.enableElementBrowser) {
|
|
@@ -193,6 +196,7 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
193
196
|
}
|
|
194
197
|
return {
|
|
195
198
|
typeAheadHandler: typeAhead,
|
|
199
|
+
getItemRank: getItemRank,
|
|
196
200
|
lazyDefaultItems: quickInsertState.lazyDefaultItems,
|
|
197
201
|
emptyStateHandler: quickInsertState.emptyStateHandler,
|
|
198
202
|
providedItems: quickInsertState.providedItems,
|
|
@@ -257,7 +261,7 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
257
261
|
var _ref0 = (_api$quickInsert$shar2 = api === null || api === void 0 || (_api$quickInsert2 = api.quickInsert) === null || _api$quickInsert2 === void 0 ? void 0 : _api$quickInsert2.sharedState.currentState()) !== null && _api$quickInsert$shar2 !== void 0 ? _api$quickInsert$shar2 : {},
|
|
258
262
|
lazyDefaultItems = _ref0.lazyDefaultItems;
|
|
259
263
|
var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
|
|
260
|
-
var memoisedNewItems = (0,
|
|
264
|
+
var memoisedNewItems = (0, _utils.memoProcessQuickInsertItems)([item], intl);
|
|
261
265
|
return tr.setMeta(_pluginKey.pluginKey, {
|
|
262
266
|
lazyDefaultItems: function lazyDefaultItems() {
|
|
263
267
|
return [].concat((0, _toConsumableArray2.default)(defaultItems), (0, _toConsumableArray2.default)(memoisedNewItems));
|
|
@@ -273,7 +277,7 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
273
277
|
providedItems = _ref10.providedItems,
|
|
274
278
|
lazyDefaultItems = _ref10.lazyDefaultItems;
|
|
275
279
|
var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
|
|
276
|
-
var newItem = (0,
|
|
280
|
+
var newItem = (0, _utils.memoProcessQuickInsertItems)([item], intl);
|
|
277
281
|
var replaceByKey = function replaceByKey(items) {
|
|
278
282
|
return items.flatMap(function (i) {
|
|
279
283
|
return i.key === key ? newItem : i;
|
|
@@ -345,7 +349,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
345
349
|
// memo here to avoid using a singleton cache, avoids editor
|
|
346
350
|
// getting confused when two editors exist within the same page.
|
|
347
351
|
lazyDefaultItems: function lazyDefaultItems() {
|
|
348
|
-
return (0,
|
|
352
|
+
return (0, _utils.memoProcessQuickInsertItems)(defaultItems || [], getIntl());
|
|
349
353
|
}
|
|
350
354
|
};
|
|
351
355
|
},
|
|
@@ -12,7 +12,7 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _reactIntl = require("react-intl");
|
|
14
14
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
15
|
-
var
|
|
15
|
+
var _blockControls = require("@atlaskit/editor-common/messages/block-controls");
|
|
16
16
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
17
17
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
18
18
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
@@ -132,7 +132,7 @@ var BlockControlQuickInsertButton = exports.BlockControlQuickInsertButton = func
|
|
|
132
132
|
view = _ref5.view;
|
|
133
133
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
134
134
|
formatMessage = _useIntl.formatMessage;
|
|
135
|
-
var label = formatMessage(
|
|
135
|
+
var label = formatMessage(_blockControls.messages.insert);
|
|
136
136
|
var handleMouseDown = (0, _react.useCallback)(function () {
|
|
137
137
|
var _api$typeAhead;
|
|
138
138
|
if ((_api$typeAhead = api.typeAhead) !== null && _api$typeAhead !== void 0 && _api$typeAhead.actions.isOpen(view.state)) {
|
|
@@ -10,8 +10,8 @@ var _react = require("react");
|
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _reactIntl = require("react-intl");
|
|
12
12
|
var _button = _interopRequireDefault(require("@atlaskit/button/button"));
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var _ElementBrowserLoader = _interopRequireDefault(require("@atlaskit/editor-common/element-browser/ElementBrowserLoader"));
|
|
14
|
+
var _messages = require("@atlaskit/editor-common/quick-insert/messages");
|
|
15
15
|
var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/core/question-circle"));
|
|
16
16
|
var _closeButton = require("@atlaskit/modal-dialog/close-button");
|
|
17
17
|
var _hooks = require("@atlaskit/modal-dialog/hooks");
|
|
@@ -78,13 +78,13 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
78
78
|
onInsert: function onInsert() {
|
|
79
79
|
return onInsertItem(selectedItem);
|
|
80
80
|
},
|
|
81
|
-
beforeElement: helpUrl ? HelpLink(helpUrl, intl.formatMessage(
|
|
81
|
+
beforeElement: helpUrl ? HelpLink(helpUrl, intl.formatMessage(_messages.messages.help)) : undefined
|
|
82
82
|
});
|
|
83
83
|
}, [onInsertItem, selectedItem, helpUrl, intl]);
|
|
84
84
|
var RenderBody = (0, _react.useCallback)(function () {
|
|
85
85
|
return (0, _react2.jsx)("div", {
|
|
86
86
|
css: wrapperStyles
|
|
87
|
-
}, (0, _react2.jsx)(
|
|
87
|
+
}, (0, _react2.jsx)(_ElementBrowserLoader.default, {
|
|
88
88
|
categories: (0, _categories.getCategories)(props.intl),
|
|
89
89
|
defaultCategory: props.defaultCategory,
|
|
90
90
|
getItems: props.getItems,
|
|
@@ -97,7 +97,7 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
97
97
|
autoFocusSearch: false
|
|
98
98
|
}));
|
|
99
99
|
}, [props.intl, props.defaultCategory, props.getItems, onSelectItem, onInsertItem, props.emptyStateHandler]);
|
|
100
|
-
var label = intl.formatMessage(
|
|
100
|
+
var label = intl.formatMessage(_messages.messages.browse);
|
|
101
101
|
return (0, _react2.jsx)("div", {
|
|
102
102
|
"data-editor-popup": true
|
|
103
103
|
}, (0, _react2.jsx)(_modalTransition.default, null, props.isOpen &&
|
|
@@ -135,13 +135,13 @@ var Footer = function Footer(_ref) {
|
|
|
135
135
|
appearance: "primary",
|
|
136
136
|
onClick: onInsert,
|
|
137
137
|
testId: "ModalElementBrowser__insert-button"
|
|
138
|
-
}, intl.formatMessage(
|
|
138
|
+
}, intl.formatMessage(_messages.messages.insert))), (0, _react2.jsx)("div", {
|
|
139
139
|
css: actionItemStyles
|
|
140
140
|
}, (0, _react2.jsx)(_button.default, {
|
|
141
141
|
appearance: "subtle",
|
|
142
142
|
onClick: onClose,
|
|
143
143
|
testId: "ModalElementBrowser__close-button"
|
|
144
|
-
}, intl.formatMessage(
|
|
144
|
+
}, intl.formatMessage(_messages.messages.close)))));
|
|
145
145
|
};
|
|
146
146
|
var HelpLink = function HelpLink(url, helpText) {
|
|
147
147
|
return (0, _react2.jsx)(_button.default, {
|
|
@@ -4,43 +4,43 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getCategories = getCategories;
|
|
7
|
-
var
|
|
7
|
+
var _messages = require("@atlaskit/editor-common/quick-insert/messages");
|
|
8
8
|
function getCategories(intl) {
|
|
9
9
|
return [{
|
|
10
|
-
title: intl.formatMessage(
|
|
10
|
+
title: intl.formatMessage(_messages.messages.all),
|
|
11
11
|
name: 'all'
|
|
12
12
|
}, {
|
|
13
|
-
title: intl.formatMessage(
|
|
13
|
+
title: intl.formatMessage(_messages.messages.AI),
|
|
14
14
|
name: 'AI'
|
|
15
15
|
}, {
|
|
16
|
-
title: intl.formatMessage(
|
|
16
|
+
title: intl.formatMessage(_messages.messages.formatting),
|
|
17
17
|
name: 'formatting'
|
|
18
18
|
}, {
|
|
19
|
-
title: intl.formatMessage(
|
|
19
|
+
title: intl.formatMessage(_messages.messages['confluence-content']),
|
|
20
20
|
name: 'confluence-content'
|
|
21
21
|
}, {
|
|
22
|
-
title: intl.formatMessage(
|
|
22
|
+
title: intl.formatMessage(_messages.messages.media),
|
|
23
23
|
name: 'media'
|
|
24
24
|
}, {
|
|
25
|
-
title: intl.formatMessage(
|
|
25
|
+
title: intl.formatMessage(_messages.messages.visuals),
|
|
26
26
|
name: 'visuals'
|
|
27
27
|
}, {
|
|
28
|
-
title: intl.formatMessage(
|
|
28
|
+
title: intl.formatMessage(_messages.messages.navigation),
|
|
29
29
|
name: 'navigation'
|
|
30
30
|
}, {
|
|
31
|
-
title: intl.formatMessage(
|
|
31
|
+
title: intl.formatMessage(_messages.messages['external-content']),
|
|
32
32
|
name: 'external-content'
|
|
33
33
|
}, {
|
|
34
|
-
title: intl.formatMessage(
|
|
34
|
+
title: intl.formatMessage(_messages.messages.communication),
|
|
35
35
|
name: 'communication'
|
|
36
36
|
}, {
|
|
37
|
-
title: intl.formatMessage(
|
|
37
|
+
title: intl.formatMessage(_messages.messages.reporting),
|
|
38
38
|
name: 'reporting'
|
|
39
39
|
}, {
|
|
40
|
-
title: intl.formatMessage(
|
|
40
|
+
title: intl.formatMessage(_messages.messages.admin),
|
|
41
41
|
name: 'admin'
|
|
42
42
|
}, {
|
|
43
|
-
title: intl.formatMessage(
|
|
43
|
+
title: intl.formatMessage(_messages.messages.development),
|
|
44
44
|
name: 'development'
|
|
45
45
|
}];
|
|
46
46
|
}
|
|
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var
|
|
11
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
12
12
|
var _isOfflineMode = require("@atlaskit/editor-common/connectivity/isOfflineMode");
|
|
13
|
-
var
|
|
13
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
14
14
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
15
15
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
16
16
|
var _commands = require("../../pm-plugins/commands");
|
|
@@ -80,7 +80,7 @@ var Modal = function Modal(_ref) {
|
|
|
80
80
|
var item = insertableItem.current;
|
|
81
81
|
insertableItem.current = null;
|
|
82
82
|
focusInEditor();
|
|
83
|
-
insertItem === null || insertItem === void 0 || insertItem(item,
|
|
83
|
+
insertItem === null || insertItem === void 0 || insertItem(item, _enums.INPUT_METHOD.ELEMENT_BROWSER)(editorView.state, editorView.dispatch);
|
|
84
84
|
}, [editorView, focusInEditor, insertItem]);
|
|
85
85
|
return /*#__PURE__*/_react.default.createElement(_ModalElementBrowser.default, {
|
|
86
86
|
defaultCategory: defaultCategory,
|
|
@@ -99,7 +99,7 @@ var _default = exports.default = function _default(_ref2) {
|
|
|
99
99
|
var editorView = _ref2.editorView,
|
|
100
100
|
helpUrl = _ref2.helpUrl,
|
|
101
101
|
pluginInjectionAPI = _ref2.pluginInjectionAPI;
|
|
102
|
-
var _useSharedPluginState = (0,
|
|
102
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(pluginInjectionAPI, ['quickInsert', 'connectivity'], function (state) {
|
|
103
103
|
var _state$quickInsertSta, _state$quickInsertSta2, _state$quickInsertSta3, _state$quickInsertSta4, _state$quickInsertSta5, _state$connectivitySt;
|
|
104
104
|
return {
|
|
105
105
|
lazyDefaultItems: (_state$quickInsertSta = state.quickInsertState) === null || _state$quickInsertSta === void 0 ? void 0 : _state$quickInsertSta.lazyDefaultItems,
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.QuickInsertMenuFooterItem = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactIntl = require("react-intl");
|
|
11
|
-
var
|
|
11
|
+
var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
|
|
12
12
|
var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
|
|
13
13
|
var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
|
|
14
14
|
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); }
|
|
@@ -25,7 +25,7 @@ var QuickInsertMenuFooterItem = exports.QuickInsertMenuFooterItem = function Qui
|
|
|
25
25
|
})) !== null && _api$quickInsert$comm !== void 0 ? _api$quickInsert$comm : tr;
|
|
26
26
|
}, [api]);
|
|
27
27
|
return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
|
|
28
|
-
ariaLabel: formatMessage(
|
|
28
|
+
ariaLabel: formatMessage(_insertBlock.toolbarInsertBlockMessages.viewMoreAriaLabel),
|
|
29
29
|
iconBefore: /*#__PURE__*/_react.default.createElement(_showMoreHorizontal.default, {
|
|
30
30
|
label: ""
|
|
31
31
|
}),
|
|
@@ -33,6 +33,6 @@ var QuickInsertMenuFooterItem = exports.QuickInsertMenuFooterItem = function Qui
|
|
|
33
33
|
onSelect: onSelect,
|
|
34
34
|
shouldShowPreview: false,
|
|
35
35
|
shouldWrapIcon: false,
|
|
36
|
-
title: formatMessage(
|
|
36
|
+
title: formatMessage(_insertBlock.toolbarInsertBlockMessages.viewMore)
|
|
37
37
|
});
|
|
38
38
|
};
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.QuickInsertSectionOverflowMenuItem = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactIntl = require("react-intl");
|
|
11
|
-
var
|
|
11
|
+
var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
|
|
12
12
|
var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
|
|
13
13
|
var _add = _interopRequireDefault(require("@atlaskit/icon/core/add"));
|
|
14
14
|
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); }
|
|
@@ -34,6 +34,6 @@ var QuickInsertSectionOverflowMenuItem = exports.QuickInsertSectionOverflowMenuI
|
|
|
34
34
|
isDisabled: !(api !== null && api !== void 0 && api.quickInsert),
|
|
35
35
|
onSelect: onSelect,
|
|
36
36
|
shouldShowPreview: false,
|
|
37
|
-
title: formatMessage(
|
|
37
|
+
title: formatMessage(_insertBlock.toolbarInsertBlockMessages.viewMore)
|
|
38
38
|
});
|
|
39
39
|
};
|
|
@@ -8,11 +8,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.RegistryElementBrowserContainer = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var
|
|
11
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
12
12
|
var _isOfflineMode = require("@atlaskit/editor-common/connectivity/isOfflineMode");
|
|
13
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
14
13
|
var _insert = require("@atlaskit/editor-common/insert");
|
|
15
14
|
var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
15
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
16
16
|
var _commands = require("../../pm-plugins/commands");
|
|
17
17
|
var _pluginKey = require("../../pm-plugins/plugin-key");
|
|
18
18
|
var _RegistryElementBrowser = require("./RegistryElementBrowser");
|
|
@@ -22,7 +22,7 @@ var RegistryElementBrowserContainer = exports.RegistryElementBrowserContainer =
|
|
|
22
22
|
var editorView = _ref.editorView,
|
|
23
23
|
pluginInjectionAPI = _ref.pluginInjectionAPI,
|
|
24
24
|
helpUrl = _ref.helpUrl;
|
|
25
|
-
var _useSharedPluginState = (0,
|
|
25
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(pluginInjectionAPI, ['quickInsert', 'connectivity'], function (state) {
|
|
26
26
|
var _state$quickInsertSta, _state$quickInsertSta2, _state$quickInsertSta3, _state$connectivitySt;
|
|
27
27
|
return {
|
|
28
28
|
isElementBrowserOpen: (_state$quickInsertSta = (_state$quickInsertSta2 = state.quickInsertState) === null || _state$quickInsertSta2 === void 0 ? void 0 : _state$quickInsertSta2.isElementBrowserOpen) !== null && _state$quickInsertSta !== void 0 ? _state$quickInsertSta : false,
|
|
@@ -53,11 +53,11 @@ var RegistryElementBrowserContainer = exports.RegistryElementBrowserContainer =
|
|
|
53
53
|
var _pluginInjectionAPI$a;
|
|
54
54
|
pluginInjectionAPI === null || pluginInjectionAPI === void 0 || (_pluginInjectionAPI$a = pluginInjectionAPI.analytics) === null || _pluginInjectionAPI$a === void 0 || _pluginInjectionAPI$a.actions.fireAnalyticsEvent({
|
|
55
55
|
action: action,
|
|
56
|
-
actionSubject:
|
|
56
|
+
actionSubject: _enums.ACTION_SUBJECT.ELEMENT_BROWSER,
|
|
57
57
|
attributes: {
|
|
58
58
|
mode: 'full'
|
|
59
59
|
},
|
|
60
|
-
eventType:
|
|
60
|
+
eventType: _enums.EVENT_TYPE.UI
|
|
61
61
|
});
|
|
62
62
|
}, [pluginInjectionAPI]);
|
|
63
63
|
(0, _react.useEffect)(function () {
|
|
@@ -71,10 +71,10 @@ var RegistryElementBrowserContainer = exports.RegistryElementBrowserContainer =
|
|
|
71
71
|
});
|
|
72
72
|
isInsertConfirmed.current = false;
|
|
73
73
|
lifecycleOpen.current = true;
|
|
74
|
-
fireLifecycleEvent(
|
|
74
|
+
fireLifecycleEvent(_enums.ACTION.OPENED);
|
|
75
75
|
} else if (!isElementBrowserOpen && wasOpen.current && lifecycleOpen.current) {
|
|
76
76
|
lifecycleOpen.current = false;
|
|
77
|
-
fireLifecycleEvent(
|
|
77
|
+
fireLifecycleEvent(_enums.ACTION.CLOSED);
|
|
78
78
|
}
|
|
79
79
|
wasOpen.current = isElementBrowserOpen;
|
|
80
80
|
}, [currentEmptyStateHandler, fireLifecycleEvent, isElementBrowserOpen, pluginInjectionAPI]);
|
|
@@ -82,7 +82,7 @@ var RegistryElementBrowserContainer = exports.RegistryElementBrowserContainer =
|
|
|
82
82
|
return function () {
|
|
83
83
|
if (lifecycleOpen.current) {
|
|
84
84
|
lifecycleOpen.current = false;
|
|
85
|
-
fireLifecycleEvent(
|
|
85
|
+
fireLifecycleEvent(_enums.ACTION.CLOSED);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
}, [fireLifecycleEvent]);
|
|
@@ -112,7 +112,7 @@ var RegistryElementBrowserContainer = exports.RegistryElementBrowserContainer =
|
|
|
112
112
|
};
|
|
113
113
|
var transaction = handler({
|
|
114
114
|
insert: insert,
|
|
115
|
-
source:
|
|
115
|
+
source: _enums.INPUT_METHOD.ELEMENT_BROWSER
|
|
116
116
|
});
|
|
117
117
|
if (transaction) {
|
|
118
118
|
editorView.dispatch(transaction);
|
|
@@ -81,6 +81,7 @@ var getComponentsFromLegacyItems = function getComponentsFromLegacyItems(items,
|
|
|
81
81
|
legacyCategories: item.categories,
|
|
82
82
|
rank: (_item$priority = item.priority) !== null && _item$priority !== void 0 ? _item$priority : index
|
|
83
83
|
}),
|
|
84
|
+
isHidden: item.isHidden,
|
|
84
85
|
component: function component() {
|
|
85
86
|
return /*#__PURE__*/_react.default.createElement(LegacyQuickInsertProviderMenuItem, {
|
|
86
87
|
item: item,
|
|
@@ -118,6 +119,10 @@ var getLegacyCompatibleComponents = exports.getLegacyCompatibleComponents = func
|
|
|
118
119
|
return getItemIdentity(candidate, index) === component.key;
|
|
119
120
|
});
|
|
120
121
|
return _objectSpread(_objectSpread({}, component), {}, {
|
|
122
|
+
isHidden: item !== null && item !== void 0 && item.isHidden ? function (options) {
|
|
123
|
+
var _component$isHidden, _item$isHidden;
|
|
124
|
+
return ((_component$isHidden = component.isHidden) === null || _component$isHidden === void 0 ? void 0 : _component$isHidden.call(component, options)) === true || ((_item$isHidden = item.isHidden) === null || _item$isHidden === void 0 ? void 0 : _item$isHidden.call(item)) === true;
|
|
125
|
+
} : component.isHidden,
|
|
121
126
|
key: (0, _getProviderMenuItemKey.getQuickInsertProviderMenuItemKey)(component.key, item === null || item === void 0 ? void 0 : item.app),
|
|
122
127
|
component: item ? function (props) {
|
|
123
128
|
return component.component(_objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.resolveMaxRecommendedItems = exports.isRecommendedSlotKey = exports.getRecommendedComponents = exports.createRecommendedSnapshotCache = exports.RECOMMENDED_SLOT_KEY_PREFIX = exports.MAX_RECOMMENDED_ITEMS = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _error = require("@atlaskit/editor-common/monitoring/error");
|
|
8
8
|
var _getProviderMenuItemKey = require("@atlaskit/editor-common/quick-insert/get-provider-menu-item-key");
|
|
9
9
|
var _isRecommendedItem = require("@atlaskit/editor-common/quick-insert/is-recommended-item");
|
|
10
10
|
var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
@@ -28,7 +28,7 @@ var resolveMaxRecommendedItems = exports.resolveMaxRecommendedItems = function r
|
|
|
28
28
|
return MAX_RECOMMENDED_ITEMS;
|
|
29
29
|
}
|
|
30
30
|
if (maxRecommendedItems > MAX_RECOMMENDED_ITEMS) {
|
|
31
|
-
void (0,
|
|
31
|
+
void (0, _error.logException)(new Error('Quick Insert maxRecommendedItems exceeds the available slots'), {
|
|
32
32
|
location: 'editor-plugin-quick-insert/getRecommendedComponents'
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -50,7 +50,7 @@ var getRecommendedComponents = exports.getRecommendedComponents = function getRe
|
|
|
50
50
|
return [];
|
|
51
51
|
}
|
|
52
52
|
if (Number.isNaN(result.rank)) {
|
|
53
|
-
void (0,
|
|
53
|
+
void (0, _error.logException)(new Error('Invalid Quick Insert recommended item rank'), {
|
|
54
54
|
location: 'editor-plugin-quick-insert/getRecommendedComponents'
|
|
55
55
|
});
|
|
56
56
|
return [];
|
package/dist/cjs/ui/search.js
CHANGED
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.withLayoutQuickInsertPrioritySorting = exports.getQuickInsertSuggestions = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
-
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
10
9
|
var _getActiveQuickInsertCategories = require("@atlaskit/editor-common/quick-insert/get-active-quick-insert-categories");
|
|
11
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
|
+
var _utils = require("@atlaskit/editor-common/quick-insert/utils");
|
|
11
|
+
var _dedupe = require("@atlaskit/editor-common/utils/dedupe");
|
|
12
12
|
var isRegisteredLayoutQuickInsertItem = function isRegisteredLayoutQuickInsertItem(item) {
|
|
13
13
|
var _item$keywords, _item$keywords2;
|
|
14
14
|
return Boolean(item.id && item.id !== 'layout' && ((_item$keywords = item.keywords) === null || _item$keywords === void 0 ? void 0 : _item$keywords.includes('layout')) && ((_item$keywords2 = item.keywords) === null || _item$keywords2 === void 0 ? void 0 : _item$keywords2.includes('column')));
|
|
@@ -58,7 +58,7 @@ var getQuickInsertSuggestions = exports.getQuickInsertSuggestions = function get
|
|
|
58
58
|
var _item$description;
|
|
59
59
|
return "".concat(item.title, "-").concat((_item$description = item.description) !== null && _item$description !== void 0 ? _item$description : '');
|
|
60
60
|
};
|
|
61
|
-
var items = providedItems ? (0,
|
|
61
|
+
var items = providedItems ? (0, _dedupe.dedupe)([].concat((0, _toConsumableArray2.default)(defaultItems), (0, _toConsumableArray2.default)(providedItems)), dedupeFn) : defaultItems;
|
|
62
62
|
items = items.filter(function (item) {
|
|
63
63
|
var _item$isHidden;
|
|
64
64
|
return ((_item$isHidden = item.isHidden) === null || _item$isHidden === void 0 ? void 0 : _item$isHidden.call(item)) !== true;
|
|
@@ -73,7 +73,7 @@ var getQuickInsertSuggestions = exports.getQuickInsertSuggestions = function get
|
|
|
73
73
|
return item.featured;
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
return (0,
|
|
76
|
+
return (0, _utils.find)((query === null || query === void 0 ? void 0 : query.trimEnd()) || '', category === 'all' || !category ? items : items.filter(function (item) {
|
|
77
77
|
return (0, _getActiveQuickInsertCategories.getActiveQuickInsertCategories)(item.category, item.categories).includes(category);
|
|
78
78
|
}), prioritySortingFn);
|
|
79
79
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-insert/get-menu-item-parents';
|
|
3
3
|
import { BLOCK_TEMPLATES_SECTION, CREATE_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
|
|
4
4
|
export const QUICK_INSERT_ITEMS_ANALYTICS_DELAY_MS = 10_000;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { containsPopupWithNestedElement,
|
|
1
|
+
import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import { containsPopupWithNestedElement, getPopupContainerFromEditorView } from '@atlaskit/editor-common/experiences';
|
|
3
|
+
import { EXPERIENCE_ID } from '@atlaskit/editor-common/experiences/consts';
|
|
4
|
+
import { Experience } from '@atlaskit/editor-common/experiences/Experience';
|
|
5
|
+
import { ExperienceCheckDomMutation } from '@atlaskit/editor-common/experiences/ExperienceCheckDomMutation';
|
|
6
|
+
import { ExperienceCheckTimeout } from '@atlaskit/editor-common/experiences/ExperienceCheckTimeout';
|
|
3
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
8
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
9
|
const pluginKey = new PluginKey('quickInsertOpenExperience');
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { isSSR } from '@atlaskit/editor-common/
|
|
4
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
-
import {
|
|
3
|
+
import { isSSR } from '@atlaskit/editor-common/is-ssr';
|
|
4
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
5
|
+
import { createQuickInsertRankResolver } from '@atlaskit/editor-common/quick-insert/quick-insert-rank';
|
|
6
|
+
import { memoProcessQuickInsertItems } from '@atlaskit/editor-common/quick-insert/utils';
|
|
6
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
8
|
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
8
9
|
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
@@ -28,8 +29,10 @@ export const quickInsertPlugin = ({
|
|
|
28
29
|
options === null || options === void 0 ? void 0 : (_options$onInsert = options.onInsert) === null || _options$onInsert === void 0 ? void 0 : _options$onInsert.call(options, item);
|
|
29
30
|
};
|
|
30
31
|
const typeAheadPrioritySortingFn = withLayoutQuickInsertPrioritySorting(options === null || options === void 0 ? void 0 : options.prioritySortingFn);
|
|
32
|
+
const getItemRank = createQuickInsertRankResolver(options === null || options === void 0 ? void 0 : options.getItemRank);
|
|
31
33
|
const typeAhead = {
|
|
32
34
|
id: TypeAheadAvailableNodes.QUICK_INSERT,
|
|
35
|
+
getRegisteredItemRank: getItemRank,
|
|
33
36
|
trigger: '/',
|
|
34
37
|
// Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
|
|
35
38
|
customRegex: '[//]',
|
|
@@ -174,6 +177,7 @@ export const quickInsertPlugin = ({
|
|
|
174
177
|
}
|
|
175
178
|
return {
|
|
176
179
|
typeAheadHandler: typeAhead,
|
|
180
|
+
getItemRank,
|
|
177
181
|
lazyDefaultItems: quickInsertState.lazyDefaultItems,
|
|
178
182
|
emptyStateHandler: quickInsertState.emptyStateHandler,
|
|
179
183
|
providedItems: quickInsertState.providedItems,
|
|
@@ -4,7 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
7
|
-
import {
|
|
7
|
+
import { messages } from '@atlaskit/editor-common/messages/block-controls';
|
|
8
8
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { findParentNode, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
10
10
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
@@ -8,8 +8,8 @@ import { useCallback, useState } from 'react';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { injectIntl, useIntl } from 'react-intl';
|
|
10
10
|
import Button from '@atlaskit/button/button';
|
|
11
|
-
import
|
|
12
|
-
import { messages } from '@atlaskit/editor-common/quick-insert';
|
|
11
|
+
import ElementBrowser from '@atlaskit/editor-common/element-browser/ElementBrowserLoader';
|
|
12
|
+
import { messages } from '@atlaskit/editor-common/quick-insert/messages';
|
|
13
13
|
import QuestionCircleIcon from '@atlaskit/icon/core/question-circle';
|
|
14
14
|
import { CloseButton } from '@atlaskit/modal-dialog/close-button';
|
|
15
15
|
import { useModal } from '@atlaskit/modal-dialog/hooks';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
3
|
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
4
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/
|
|
4
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
5
5
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
7
|
import { closeElementBrowser, closeElementBrowserModal } from '../../pm-plugins/commands';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages/insert-block';
|
|
4
4
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
5
5
|
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
6
6
|
export const QuickInsertMenuFooterItem = ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages/insert-block';
|
|
4
4
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
5
5
|
import AddIcon from '@atlaskit/icon/core/add';
|
|
6
6
|
export const QuickInsertSectionOverflowMenuItem = ({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
3
|
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
4
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
4
|
import { insertSelectedItem } from '@atlaskit/editor-common/insert';
|
|
6
5
|
import { MENU } from '@atlaskit/editor-common/quick-insert/keys';
|
|
6
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
7
7
|
import { closeElementBrowser } from '../../pm-plugins/commands';
|
|
8
8
|
import { pluginKey } from '../../pm-plugins/plugin-key';
|
|
9
9
|
import { RegistryElementBrowser } from './RegistryElementBrowser';
|
|
@@ -71,6 +71,7 @@ const getComponentsFromLegacyItems = (items, onInsert) => items.map((item, index
|
|
|
71
71
|
legacyCategories: item.categories,
|
|
72
72
|
rank: (_item$priority = item.priority) !== null && _item$priority !== void 0 ? _item$priority : index
|
|
73
73
|
}),
|
|
74
|
+
isHidden: item.isHidden,
|
|
74
75
|
component: () => /*#__PURE__*/React.createElement(LegacyQuickInsertProviderMenuItem, {
|
|
75
76
|
item: item,
|
|
76
77
|
onInsert: onInsert
|
|
@@ -97,6 +98,10 @@ export const getLegacyCompatibleComponents = ({
|
|
|
97
98
|
const item = filteredItems.find((candidate, index) => getItemIdentity(candidate, index) === component.key);
|
|
98
99
|
return {
|
|
99
100
|
...component,
|
|
101
|
+
isHidden: item !== null && item !== void 0 && item.isHidden ? options => {
|
|
102
|
+
var _component$isHidden, _item$isHidden;
|
|
103
|
+
return ((_component$isHidden = component.isHidden) === null || _component$isHidden === void 0 ? void 0 : _component$isHidden.call(component, options)) === true || ((_item$isHidden = item.isHidden) === null || _item$isHidden === void 0 ? void 0 : _item$isHidden.call(item)) === true;
|
|
104
|
+
} : component.isHidden,
|
|
100
105
|
key: getQuickInsertProviderMenuItemKey(component.key, item === null || item === void 0 ? void 0 : item.app),
|
|
101
106
|
component: item ? props => component.component({
|
|
102
107
|
...props,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
1
|
+
import { logException } from '@atlaskit/editor-common/monitoring/error';
|
|
2
2
|
import { quickInsertProviderMenuItemKey } from '@atlaskit/editor-common/quick-insert/get-provider-menu-item-key';
|
|
3
3
|
import { defaultIsRecommendedItem } from '@atlaskit/editor-common/quick-insert/is-recommended-item';
|
|
4
4
|
import { MENU } from '@atlaskit/editor-common/quick-insert/keys';
|
package/dist/es2019/ui/search.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { find } from '@atlaskit/editor-common/quick-insert';
|
|
2
1
|
import { getActiveQuickInsertCategories } from '@atlaskit/editor-common/quick-insert/get-active-quick-insert-categories';
|
|
3
|
-
import {
|
|
2
|
+
import { find } from '@atlaskit/editor-common/quick-insert/utils';
|
|
3
|
+
import { dedupe } from '@atlaskit/editor-common/utils/dedupe';
|
|
4
4
|
const isRegisteredLayoutQuickInsertItem = item => {
|
|
5
5
|
var _item$keywords, _item$keywords2;
|
|
6
6
|
return Boolean(item.id && item.id !== 'layout' && ((_item$keywords = item.keywords) === null || _item$keywords === void 0 ? void 0 : _item$keywords.includes('layout')) && ((_item$keywords2 = item.keywords) === null || _item$keywords2 === void 0 ? void 0 : _item$keywords2.includes('column')));
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
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; } } }; }
|
|
3
3
|
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; } }
|
|
4
4
|
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; }
|
|
5
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
6
6
|
import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-insert/get-menu-item-parents';
|
|
7
7
|
import { BLOCK_TEMPLATES_SECTION, CREATE_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
|
|
8
8
|
export var QUICK_INSERT_ITEMS_ANALYTICS_DELAY_MS = 10000;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { containsPopupWithNestedElement,
|
|
2
|
+
import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import { containsPopupWithNestedElement, getPopupContainerFromEditorView } from '@atlaskit/editor-common/experiences';
|
|
4
|
+
import { EXPERIENCE_ID } from '@atlaskit/editor-common/experiences/consts';
|
|
5
|
+
import { Experience } from '@atlaskit/editor-common/experiences/Experience';
|
|
6
|
+
import { ExperienceCheckDomMutation } from '@atlaskit/editor-common/experiences/ExperienceCheckDomMutation';
|
|
7
|
+
import { ExperienceCheckTimeout } from '@atlaskit/editor-common/experiences/ExperienceCheckTimeout';
|
|
4
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
9
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
10
|
var pluginKey = new PluginKey('quickInsertOpenExperience');
|
|
@@ -6,9 +6,10 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
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; }
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { useIntl } from 'react-intl';
|
|
9
|
-
import { isSSR } from '@atlaskit/editor-common/
|
|
10
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
-
import {
|
|
9
|
+
import { isSSR } from '@atlaskit/editor-common/is-ssr';
|
|
10
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
11
|
+
import { createQuickInsertRankResolver } from '@atlaskit/editor-common/quick-insert/quick-insert-rank';
|
|
12
|
+
import { memoProcessQuickInsertItems } from '@atlaskit/editor-common/quick-insert/utils';
|
|
12
13
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
13
14
|
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
14
15
|
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
@@ -33,8 +34,10 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
33
34
|
options === null || options === void 0 || (_options$onInsert = options.onInsert) === null || _options$onInsert === void 0 || _options$onInsert.call(options, item);
|
|
34
35
|
};
|
|
35
36
|
var typeAheadPrioritySortingFn = withLayoutQuickInsertPrioritySorting(options === null || options === void 0 ? void 0 : options.prioritySortingFn);
|
|
37
|
+
var getItemRank = createQuickInsertRankResolver(options === null || options === void 0 ? void 0 : options.getItemRank);
|
|
36
38
|
var typeAhead = {
|
|
37
39
|
id: TypeAheadAvailableNodes.QUICK_INSERT,
|
|
40
|
+
getRegisteredItemRank: getItemRank,
|
|
38
41
|
trigger: '/',
|
|
39
42
|
// Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
|
|
40
43
|
customRegex: '[//]',
|
|
@@ -186,6 +189,7 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
186
189
|
}
|
|
187
190
|
return {
|
|
188
191
|
typeAheadHandler: typeAhead,
|
|
192
|
+
getItemRank: getItemRank,
|
|
189
193
|
lazyDefaultItems: quickInsertState.lazyDefaultItems,
|
|
190
194
|
emptyStateHandler: quickInsertState.emptyStateHandler,
|
|
191
195
|
providedItems: quickInsertState.providedItems,
|
|
@@ -4,7 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
7
|
-
import {
|
|
7
|
+
import { messages } from '@atlaskit/editor-common/messages/block-controls';
|
|
8
8
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { findParentNode, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
10
10
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
@@ -9,8 +9,8 @@ import { useCallback, useState } from 'react';
|
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { injectIntl, useIntl } from 'react-intl';
|
|
11
11
|
import Button from '@atlaskit/button/button';
|
|
12
|
-
import
|
|
13
|
-
import { messages } from '@atlaskit/editor-common/quick-insert';
|
|
12
|
+
import ElementBrowser from '@atlaskit/editor-common/element-browser/ElementBrowserLoader';
|
|
13
|
+
import { messages } from '@atlaskit/editor-common/quick-insert/messages';
|
|
14
14
|
import QuestionCircleIcon from '@atlaskit/icon/core/question-circle';
|
|
15
15
|
import { CloseButton } from '@atlaskit/modal-dialog/close-button';
|
|
16
16
|
import { useModal } from '@atlaskit/modal-dialog/hooks';
|
|
@@ -2,9 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
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; }
|
|
3
3
|
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; }
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
5
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
6
6
|
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
7
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/
|
|
7
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
8
8
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
10
|
import { closeElementBrowser, closeElementBrowserModal } from '../../pm-plugins/commands';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages/insert-block';
|
|
4
4
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
5
5
|
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
6
6
|
export var QuickInsertMenuFooterItem = function QuickInsertMenuFooterItem(_ref) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages/insert-block';
|
|
4
4
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
5
5
|
import AddIcon from '@atlaskit/icon/core/add';
|
|
6
6
|
export var QuickInsertSectionOverflowMenuItem = function QuickInsertSectionOverflowMenuItem(_ref) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
4
|
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
5
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
6
5
|
import { insertSelectedItem } from '@atlaskit/editor-common/insert';
|
|
7
6
|
import { MENU } from '@atlaskit/editor-common/quick-insert/keys';
|
|
7
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
8
8
|
import { closeElementBrowser } from '../../pm-plugins/commands';
|
|
9
9
|
import { pluginKey } from '../../pm-plugins/plugin-key';
|
|
10
10
|
import { RegistryElementBrowser } from './RegistryElementBrowser';
|
|
@@ -72,6 +72,7 @@ var getComponentsFromLegacyItems = function getComponentsFromLegacyItems(items,
|
|
|
72
72
|
legacyCategories: item.categories,
|
|
73
73
|
rank: (_item$priority = item.priority) !== null && _item$priority !== void 0 ? _item$priority : index
|
|
74
74
|
}),
|
|
75
|
+
isHidden: item.isHidden,
|
|
75
76
|
component: function component() {
|
|
76
77
|
return /*#__PURE__*/React.createElement(LegacyQuickInsertProviderMenuItem, {
|
|
77
78
|
item: item,
|
|
@@ -109,6 +110,10 @@ export var getLegacyCompatibleComponents = function getLegacyCompatibleComponent
|
|
|
109
110
|
return getItemIdentity(candidate, index) === component.key;
|
|
110
111
|
});
|
|
111
112
|
return _objectSpread(_objectSpread({}, component), {}, {
|
|
113
|
+
isHidden: item !== null && item !== void 0 && item.isHidden ? function (options) {
|
|
114
|
+
var _component$isHidden, _item$isHidden;
|
|
115
|
+
return ((_component$isHidden = component.isHidden) === null || _component$isHidden === void 0 ? void 0 : _component$isHidden.call(component, options)) === true || ((_item$isHidden = item.isHidden) === null || _item$isHidden === void 0 ? void 0 : _item$isHidden.call(item)) === true;
|
|
116
|
+
} : component.isHidden,
|
|
112
117
|
key: getQuickInsertProviderMenuItemKey(component.key, item === null || item === void 0 ? void 0 : item.app),
|
|
113
118
|
component: item ? function (props) {
|
|
114
119
|
return component.component(_objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
1
|
+
import { logException } from '@atlaskit/editor-common/monitoring/error';
|
|
2
2
|
import { quickInsertProviderMenuItemKey } from '@atlaskit/editor-common/quick-insert/get-provider-menu-item-key';
|
|
3
3
|
import { defaultIsRecommendedItem } from '@atlaskit/editor-common/quick-insert/is-recommended-item';
|
|
4
4
|
import { MENU } from '@atlaskit/editor-common/quick-insert/keys';
|
package/dist/esm/ui/search.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { find } from '@atlaskit/editor-common/quick-insert';
|
|
3
2
|
import { getActiveQuickInsertCategories } from '@atlaskit/editor-common/quick-insert/get-active-quick-insert-categories';
|
|
4
|
-
import {
|
|
3
|
+
import { find } from '@atlaskit/editor-common/quick-insert/utils';
|
|
4
|
+
import { dedupe } from '@atlaskit/editor-common/utils/dedupe';
|
|
5
5
|
var isRegisteredLayoutQuickInsertItem = function isRegisteredLayoutQuickInsertItem(item) {
|
|
6
6
|
var _item$keywords, _item$keywords2;
|
|
7
7
|
return Boolean(item.id && item.id !== 'layout' && ((_item$keywords = item.keywords) === null || _item$keywords === void 0 ? void 0 : _item$keywords.includes('layout')) && ((_item$keywords2 = item.keywords) === null || _item$keywords2 === void 0 ? void 0 : _item$keywords2.includes('column')));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics/types/dispatch-analytics-event';
|
|
2
2
|
import type { QuickInsertInformationAttributes } from '@atlaskit/editor-common/analytics/types/quick-insert-events';
|
|
3
|
-
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory/quick-insert-provider';
|
|
4
4
|
export declare const QUICK_INSERT_ITEMS_ANALYTICS_DELAY_MS = 10000;
|
|
5
5
|
export type QuickInsertItemsAnalyticsOptions = {
|
|
6
6
|
providedItems: readonly QuickInsertItem[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { Command
|
|
1
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory/quick-insert-provider';
|
|
3
|
+
import type { Command } from '@atlaskit/editor-common/types/command';
|
|
4
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types/editor-command';
|
|
4
5
|
import type { OpenElementBrowserOptions } from '../../quickInsertPluginType';
|
|
5
6
|
export declare const openElementBrowser: ({ category }?: OpenElementBrowserOptions) => EditorCommand;
|
|
6
7
|
export declare const closeElementBrowser: () => Command;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics/types/dispatch-analytics-event';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
type QuickInsertOpenExperienceOptions = {
|
|
4
4
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QuickInsertPluginState as CommonQuickInsertPluginState } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { QuickInsertPluginState as CommonQuickInsertPluginState } from '@atlaskit/editor-common/types/quick-insert';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export type QuickInsertPluginState = CommonQuickInsertPluginState & {
|
|
4
4
|
elementBrowserInitialCategory?: string;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
1
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory/quick-insert-provider';
|
|
3
3
|
import type { IsRecommendedItem } from '@atlaskit/editor-common/quick-insert/is-recommended-item';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
4
|
+
import type { RegisteredItemRankResolver } from '@atlaskit/editor-common/type-ahead/item-rank';
|
|
5
|
+
import type { Command } from '@atlaskit/editor-common/types/command';
|
|
6
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types/editor-command';
|
|
7
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
8
|
+
import type { QuickInsertPluginOptions as CommonQuickInsertPluginOptions, QuickInsertSharedState as CommonQuickInsertSharedState, QuickInsertHandler, QuickInsertSearchOptions } from '@atlaskit/editor-common/types/quick-insert';
|
|
9
|
+
import type { TypeAheadHandler } from '@atlaskit/editor-common/types/type-ahead';
|
|
10
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics/analyticsPluginType';
|
|
11
|
+
import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity/connectivityPluginType';
|
|
7
12
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode/editorViewmodePluginType';
|
|
8
|
-
import type { MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
|
|
9
|
-
import type {
|
|
13
|
+
import type { MetricsPlugin } from '@atlaskit/editor-plugin-metrics/metrics-plugin-type';
|
|
14
|
+
import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead/type-ahead-plugin-type';
|
|
15
|
+
import type { TypeAheadInputMethod } from '@atlaskit/editor-plugin-type-ahead/types';
|
|
10
16
|
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry/ui-control-registry-plugin-type';
|
|
11
17
|
export type QuickInsertSharedState = CommonQuickInsertSharedState & {
|
|
18
|
+
getItemRank?: RegisteredItemRankResolver;
|
|
12
19
|
typeAheadHandler: TypeAheadHandler;
|
|
13
20
|
};
|
|
14
21
|
export type QuickInsertPluginOptions = CommonQuickInsertPluginOptions & {
|
|
@@ -19,6 +26,8 @@ export type QuickInsertPluginOptions = CommonQuickInsertPluginOptions & {
|
|
|
19
26
|
* and is only available when `platform_editor_block_control_migration` experiment is enabled.
|
|
20
27
|
*/
|
|
21
28
|
blockControlButtonEnabled?: boolean;
|
|
29
|
+
/** Resolves per-editor category and item ranks for registered Quick Insert menus. */
|
|
30
|
+
getItemRank?: RegisteredItemRankResolver;
|
|
22
31
|
/**
|
|
23
32
|
* Selects and ranks the items shown in the Recommended section of the `/` menu.
|
|
24
33
|
* Items that are not registered or are hidden are skipped, so lower-ranked items act as fallbacks.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import type { QuickInsertPlugin } from '../quickInsertPluginType';
|
|
9
9
|
type Props = {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type ComponentType, type FC } from 'react';
|
|
6
6
|
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
7
|
-
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
8
|
-
import type { EmptyStateHandler } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory/quick-insert-provider';
|
|
8
|
+
import type { EmptyStateHandler } from '@atlaskit/editor-common/types/empty-state-handler';
|
|
9
9
|
export declare const MODAL_WRAPPER_PADDING = 16;
|
|
10
10
|
export interface Props {
|
|
11
11
|
defaultCategory?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { QuickInsertPlugin } from '../../quickInsertPluginType';
|
|
5
5
|
type Props = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
3
|
import type { QuickInsertPlugin } from '../quickInsertPluginType';
|
|
4
4
|
type Props = {
|
|
5
5
|
api: ExtractInjectionAPI<QuickInsertPlugin> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
3
|
import type { QuickInsertPlugin } from '../quickInsertPluginType';
|
|
4
4
|
type Props = {
|
|
5
5
|
api: ExtractInjectionAPI<QuickInsertPlugin> | undefined;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { QuickInsertSelectionHandler } from '@atlaskit/editor-common/quick-insert/context';
|
|
7
|
-
import type { EmptyStateHandler } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { EmptyStateHandler } from '@atlaskit/editor-common/types/empty-state-handler';
|
|
8
8
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import type { RegisterComponent } from '@atlaskit/editor-ui-control-model/types';
|
|
10
10
|
type Props = {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { QuickInsertSelectionHandler } from '@atlaskit/editor-common/quick-insert/context';
|
|
7
|
-
import type { EmptyStateHandler } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { EmptyStateHandler } from '@atlaskit/editor-common/types/empty-state-handler';
|
|
8
8
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import type { RegistryElementBrowserItem } from './model';
|
|
10
10
|
type Props = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { QuickInsertPlugin } from '../../quickInsertPluginType';
|
|
5
5
|
export declare const RegistryElementBrowserContainer: ({ editorView, pluginInjectionAPI, helpUrl, }: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { RegisterButton } from '@atlaskit/editor-ui-control-model/types';
|
|
4
4
|
import type { QuickInsertPlugin } from '../quickInsertPluginType';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory/quick-insert-provider';
|
|
3
3
|
import type { CommonComponentProps, RegisterMenuItem } from '@atlaskit/editor-ui-control-model/types';
|
|
4
4
|
type LegacyCompatibleComponentProps = CommonComponentProps & {
|
|
5
5
|
onInsert?: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IsRecommendedItem } from '@atlaskit/editor-common/quick-insert/is-recommended-item';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
3
|
import type { CommonComponentProps, RegisterComponent } from '@atlaskit/editor-ui-control-model/types';
|
|
4
4
|
import type { QuickInsertPlugin } from '../quickInsertPluginType';
|
|
5
5
|
type Params = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IsRecommendedItem } from '@atlaskit/editor-common/quick-insert/is-recommended-item';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
3
|
import type { RegisterComponent, RegisterMenuItem, SurfaceContext } from '@atlaskit/editor-ui-control-model/types';
|
|
4
4
|
import type { QuickInsertPlugin } from '../quickInsertPluginType';
|
|
5
5
|
export declare const MAX_RECOMMENDED_ITEMS = 5;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import type { QuickInsertSearchOptions } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory/quick-insert-provider';
|
|
2
|
+
import type { QuickInsertSearchOptions } from '@atlaskit/editor-common/types/quick-insert';
|
|
3
3
|
type GetQuickInsertSuggestions = (searchOptions: QuickInsertSearchOptions, lazyDefaultItems?: () => QuickInsertItem[], providedItems?: QuickInsertItem[]) => QuickInsertItem[];
|
|
4
4
|
export declare const withLayoutQuickInsertPrioritySorting: (prioritySortingFn?: QuickInsertSearchOptions['prioritySortingFn']) => QuickInsertSearchOptions['prioritySortingFn'];
|
|
5
5
|
export declare const getQuickInsertSuggestions: GetQuickInsertSuggestions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-quick-insert",
|
|
3
|
-
"version": "26.0
|
|
3
|
+
"version": "26.1.0",
|
|
4
4
|
"description": "Quick insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
45
45
|
"@atlaskit/primitives": "^22.5.0",
|
|
46
46
|
"@atlaskit/textfield": "^10.2.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^232.0.0",
|
|
48
48
|
"@atlaskit/tokens": "^20.4.0",
|
|
49
49
|
"@atlaskit/tooltip": "^24.4.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@emotion/react": "^11.7.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@atlaskit/editor-common": "^130.
|
|
55
|
+
"@atlaskit/editor-common": "^130.4.0",
|
|
56
56
|
"react": "^18.2.0 || ^19.2.0",
|
|
57
57
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
58
58
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|