@atlaskit/editor-plugin-insert-block 9.0.23 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/insertBlockPlugin.js +4 -9
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +5 -9
- package/dist/cjs/ui/toolbar-components/InsertButton.js +5 -11
- package/dist/es2019/insertBlockPlugin.js +4 -9
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +5 -9
- package/dist/es2019/ui/toolbar-components/InsertButton.js +5 -11
- package/dist/esm/insertBlockPlugin.js +4 -9
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +5 -9
- package/dist/esm/ui/toolbar-components/InsertButton.js +5 -11
- package/dist/types/ui/ElementBrowser/InsertMenu.d.ts +1 -5
- package/dist/types-ts4.5/ui/ElementBrowser/InsertMenu.d.ts +1 -5
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 9.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`73ebf54808245`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/73ebf54808245) -
|
|
8
|
+
[ux] Added featured sorting for whiteboard jira quick insert item to the insert menu
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 9.0.24
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`b42704f7ca9d8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b42704f7ca9d8) -
|
|
19
|
+
Clean up stale feature flag `platform_editor_media_insert_check` (final value: `true`). The
|
|
20
|
+
flag-gated code paths are now the default behaviour — media insert popup is shown via
|
|
21
|
+
`mediaInsert` plugin when available, falling back to the legacy `showMediaPicker`.
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 9.0.23
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -271,7 +271,7 @@ var selector = function selector(states) {
|
|
|
271
271
|
};
|
|
272
272
|
};
|
|
273
273
|
function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
274
|
-
var _pluginInjectionApi$i, _pluginInjectionApi$
|
|
274
|
+
var _pluginInjectionApi$i, _pluginInjectionApi$c2, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
|
|
275
275
|
var editorView = _ref4.editorView,
|
|
276
276
|
editorActions = _ref4.editorActions,
|
|
277
277
|
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent,
|
|
@@ -313,16 +313,11 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
313
313
|
exposure: true
|
|
314
314
|
}) ? emojiProviderPromise : getEmojiProvider();
|
|
315
315
|
var onShowMediaPicker = function onShowMediaPicker(mountInfo) {
|
|
316
|
+
var _pluginInjectionApi$m, _pluginInjectionApi$c, _pluginInjectionApi$m2;
|
|
316
317
|
if (!showMediaPicker) {
|
|
317
318
|
return;
|
|
318
319
|
}
|
|
319
|
-
|
|
320
|
-
var _pluginInjectionApi$m, _pluginInjectionApi$c, _pluginInjectionApi$m2;
|
|
321
|
-
pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) !== null && _pluginInjectionApi$m !== void 0 && _pluginInjectionApi$m.commands.showMediaInsertPopup ? pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m2 = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m2 === void 0 ? void 0 : _pluginInjectionApi$m2.commands.showMediaInsertPopup(mountInfo)) : showMediaPicker();
|
|
322
|
-
} else {
|
|
323
|
-
var _pluginInjectionApi$c2, _pluginInjectionApi$m3;
|
|
324
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.core) === null || _pluginInjectionApi$c2 === void 0 || _pluginInjectionApi$c2.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m3 = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m3 === void 0 ? void 0 : _pluginInjectionApi$m3.commands.showMediaInsertPopup(mountInfo));
|
|
325
|
-
}
|
|
320
|
+
pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) !== null && _pluginInjectionApi$m !== void 0 && _pluginInjectionApi$m.commands.showMediaInsertPopup ? pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m2 = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m2 === void 0 ? void 0 : _pluginInjectionApi$m2.commands.showMediaInsertPopup(mountInfo)) : showMediaPicker();
|
|
326
321
|
};
|
|
327
322
|
return /*#__PURE__*/_react.default.createElement(_ToolbarInsertBlock.default, {
|
|
328
323
|
showElementBrowser: showElementBrowser || false,
|
|
@@ -356,7 +351,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
356
351
|
emojiProvider: emojiProvider,
|
|
357
352
|
nativeStatusSupported: options.nativeStatusSupported,
|
|
358
353
|
horizontalRuleEnabled: options.horizontalRuleEnabled,
|
|
359
|
-
onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
354
|
+
onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.codeBlock) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.actions.insertCodeBlock, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$p = pluginInjectionApi.panel) === null || _pluginInjectionApi$p === void 0 ? void 0 : _pluginInjectionApi$p.actions.insertPanel, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$b = pluginInjectionApi.blockType) === null || _pluginInjectionApi$b === void 0 ? void 0 : _pluginInjectionApi$b.actions.insertBlockQuote),
|
|
360
355
|
onInsertMacroFromMacroBrowser: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.extension) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.actions.insertMacroFromMacroBrowser,
|
|
361
356
|
popupsMountPoint: popupsMountPoint,
|
|
362
357
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.sortFeaturedItems = exports.default = exports.DEFAULT_HEIGHT = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -32,15 +32,11 @@ var DEFAULT_HEIGHT = exports.DEFAULT_HEIGHT = 560;
|
|
|
32
32
|
/**
|
|
33
33
|
* Exported helper to allow testing of InsertMenu pinning logic.
|
|
34
34
|
*
|
|
35
|
-
* NOTE: this is *not* the ideal way to approach this. The quick insert plugin provides a
|
|
36
|
-
* `getSuggestions` method that can be used to get suggestions. Once all experiments are cleaned up,
|
|
37
|
-
* they should be unified through `pluginInjectionApi?.quickInsert?.actions.getSuggestions`.
|
|
38
|
-
*
|
|
39
35
|
* The `cc_fd_db_top_editor_toolbar` experiment adds new logic to sort elements by `priority`.
|
|
40
36
|
* This newer implementation matches how the quick insert menu sorts elements.
|
|
41
37
|
*/
|
|
42
|
-
var
|
|
43
|
-
if (['new-description', 'orig-description'].includes((0, _expVal.expVal)('cc_fd_db_top_editor_toolbar', 'cohort', 'control'))) {
|
|
38
|
+
var sortFeaturedItems = exports.sortFeaturedItems = function sortFeaturedItems(featuredItems, formatMessage) {
|
|
39
|
+
if (['new-description', 'orig-description'].includes((0, _expVal.expVal)('cc_fd_db_top_editor_toolbar', 'cohort', 'control')) || (0, _expVal.expValNoExposure)('cc_fd_wb_jira_quick_insert_experiment', 'isEnabled', false)) {
|
|
44
40
|
// Sort by priority (lower first) on the concatenated list so items
|
|
45
41
|
// with "priority" are at the top (e.g. Whiteboard before Database)
|
|
46
42
|
return featuredItems.slice(0).sort(function (a, b) {
|
|
@@ -48,7 +44,7 @@ var sortPrioritizedElements = exports.sortPrioritizedElements = function sortPri
|
|
|
48
44
|
});
|
|
49
45
|
}
|
|
50
46
|
|
|
51
|
-
//
|
|
47
|
+
// NOTE: this is *not* the ideal way to approach this. Old logic sort whiteboards to top
|
|
52
48
|
var DIAGRAM_KEY = 'whiteboard-extension:create-diagram';
|
|
53
49
|
var isDiagram = function isDiagram(item) {
|
|
54
50
|
return item.key === DIAGRAM_KEY;
|
|
@@ -186,7 +182,7 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
186
182
|
})) !== null && _pluginInjectionApi$q4 !== void 0 ? _pluginInjectionApi$q4 : [];
|
|
187
183
|
var unfilteredResult = quickInsertDropdownItems.concat(featuredQuickInsertSuggestions);
|
|
188
184
|
// need to sort on the concatenated list so desired elements are at the top
|
|
189
|
-
result =
|
|
185
|
+
result = sortFeaturedItems(unfilteredResult, formatMessage);
|
|
190
186
|
}
|
|
191
187
|
setItemCount(result.length);
|
|
192
188
|
return result;
|
|
@@ -17,7 +17,6 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
17
17
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
18
18
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
19
19
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
20
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
20
|
var _InsertMenu = _interopRequireWildcard(require("../ElementBrowser/InsertMenu"));
|
|
22
21
|
var _filterDropdownItems = require("./hooks/filterDropdownItems");
|
|
23
22
|
var _useEmojiPickerPopup = require("./hooks/useEmojiPickerPopup");
|
|
@@ -98,7 +97,7 @@ var InsertButton = exports.InsertButton = function InsertButton(_ref) {
|
|
|
98
97
|
toggleInsertMenuOpen(!insertMenuOpen);
|
|
99
98
|
};
|
|
100
99
|
var onItemActivated = function onItemActivated(_ref2) {
|
|
101
|
-
var _api$core, _api$hyperlink, _api$imageUpload, _api$mention, _api$taskDecision, _api$rule, _api$
|
|
100
|
+
var _api$core, _api$hyperlink, _api$imageUpload, _api$mention, _api$taskDecision, _api$rule, _api$core3, _api$date, _api$placeholderText, _api$layout, _api$core4, _api$status, _api$expand;
|
|
102
101
|
var item = _ref2.item,
|
|
103
102
|
inputMethod = _ref2.inputMethod;
|
|
104
103
|
if (!editorView) {
|
|
@@ -140,13 +139,8 @@ var InsertButton = exports.InsertButton = function InsertButton(_ref) {
|
|
|
140
139
|
break;
|
|
141
140
|
case 'media':
|
|
142
141
|
if (showMediaPicker) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
api !== null && api !== void 0 && (_api$mediaInsert = api.mediaInsert) !== null && _api$mediaInsert !== void 0 && _api$mediaInsert.commands.showMediaInsertPopup ? api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions.execute(api === null || api === void 0 || (_api$mediaInsert2 = api.mediaInsert) === null || _api$mediaInsert2 === void 0 ? void 0 : _api$mediaInsert2.commands.showMediaInsertPopup()) : showMediaPicker === null || showMediaPicker === void 0 ? void 0 : showMediaPicker();
|
|
146
|
-
} else {
|
|
147
|
-
var _api$core3, _api$mediaInsert3;
|
|
148
|
-
api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(api === null || api === void 0 || (_api$mediaInsert3 = api.mediaInsert) === null || _api$mediaInsert3 === void 0 ? void 0 : _api$mediaInsert3.commands.showMediaInsertPopup());
|
|
149
|
-
}
|
|
142
|
+
var _api$mediaInsert, _api$core2, _api$mediaInsert2;
|
|
143
|
+
api !== null && api !== void 0 && (_api$mediaInsert = api.mediaInsert) !== null && _api$mediaInsert !== void 0 && _api$mediaInsert.commands.showMediaInsertPopup ? api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions.execute(api === null || api === void 0 || (_api$mediaInsert2 = api.mediaInsert) === null || _api$mediaInsert2 === void 0 ? void 0 : _api$mediaInsert2.commands.showMediaInsertPopup()) : showMediaPicker === null || showMediaPicker === void 0 ? void 0 : showMediaPicker();
|
|
150
144
|
}
|
|
151
145
|
break;
|
|
152
146
|
case 'mention':
|
|
@@ -169,7 +163,7 @@ var InsertButton = exports.InsertButton = function InsertButton(_ref) {
|
|
|
169
163
|
api === null || api === void 0 || (_api$rule = api.rule) === null || _api$rule === void 0 || _api$rule.actions.insertHorizontalRule(inputMethod)(state, dispatch);
|
|
170
164
|
break;
|
|
171
165
|
case 'date':
|
|
172
|
-
api === null || api === void 0 || (_api$
|
|
166
|
+
api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(api === null || api === void 0 || (_api$date = api.date) === null || _api$date === void 0 || (_api$date = _api$date.commands) === null || _api$date === void 0 ? void 0 : _api$date.insertDate({
|
|
173
167
|
inputMethod: inputMethod
|
|
174
168
|
}));
|
|
175
169
|
break;
|
|
@@ -180,7 +174,7 @@ var InsertButton = exports.InsertButton = function InsertButton(_ref) {
|
|
|
180
174
|
api === null || api === void 0 || (_api$layout = api.layout) === null || _api$layout === void 0 || _api$layout.actions.insertLayoutColumns(inputMethod)(state, dispatch);
|
|
181
175
|
break;
|
|
182
176
|
case 'status':
|
|
183
|
-
api === null || api === void 0 || (_api$
|
|
177
|
+
api === null || api === void 0 || (_api$core4 = api.core) === null || _api$core4 === void 0 || _api$core4.actions.execute(api === null || api === void 0 || (_api$status = api.status) === null || _api$status === void 0 || (_api$status = _api$status.commands) === null || _api$status === void 0 ? void 0 : _api$status.insertStatus(inputMethod));
|
|
184
178
|
break;
|
|
185
179
|
case 'expand':
|
|
186
180
|
api === null || api === void 0 || (_api$expand = api.expand) === null || _api$expand === void 0 || _api$expand.actions.insertExpand(state, dispatch);
|
|
@@ -267,7 +267,7 @@ function ToolbarInsertBlockWithInjectionApi({
|
|
|
267
267
|
options,
|
|
268
268
|
appearance
|
|
269
269
|
}) {
|
|
270
|
-
var _pluginInjectionApi$i, _pluginInjectionApi$
|
|
270
|
+
var _pluginInjectionApi$i, _pluginInjectionApi$c2, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
|
|
271
271
|
const buttons = toolbarSizeToButtons(toolbarSize, appearance);
|
|
272
272
|
const {
|
|
273
273
|
emojiProviderSelector,
|
|
@@ -297,16 +297,11 @@ function ToolbarInsertBlockWithInjectionApi({
|
|
|
297
297
|
exposure: true
|
|
298
298
|
}) ? emojiProviderPromise : getEmojiProvider();
|
|
299
299
|
const onShowMediaPicker = mountInfo => {
|
|
300
|
+
var _pluginInjectionApi$m, _pluginInjectionApi$c, _pluginInjectionApi$m2;
|
|
300
301
|
if (!showMediaPicker) {
|
|
301
302
|
return;
|
|
302
303
|
}
|
|
303
|
-
|
|
304
|
-
var _pluginInjectionApi$m, _pluginInjectionApi$c, _pluginInjectionApi$m2;
|
|
305
|
-
pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) !== null && _pluginInjectionApi$m !== void 0 && _pluginInjectionApi$m.commands.showMediaInsertPopup ? pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m2 = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m2 === void 0 ? void 0 : _pluginInjectionApi$m2.commands.showMediaInsertPopup(mountInfo)) : showMediaPicker();
|
|
306
|
-
} else {
|
|
307
|
-
var _pluginInjectionApi$c2, _pluginInjectionApi$m3;
|
|
308
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c2 = pluginInjectionApi.core) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m3 = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m3 === void 0 ? void 0 : _pluginInjectionApi$m3.commands.showMediaInsertPopup(mountInfo));
|
|
309
|
-
}
|
|
304
|
+
pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) !== null && _pluginInjectionApi$m !== void 0 && _pluginInjectionApi$m.commands.showMediaInsertPopup ? pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m2 = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m2 === void 0 ? void 0 : _pluginInjectionApi$m2.commands.showMediaInsertPopup(mountInfo)) : showMediaPicker();
|
|
310
305
|
};
|
|
311
306
|
return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
|
|
312
307
|
showElementBrowser: showElementBrowser || false,
|
|
@@ -340,7 +335,7 @@ function ToolbarInsertBlockWithInjectionApi({
|
|
|
340
335
|
emojiProvider: emojiProvider,
|
|
341
336
|
nativeStatusSupported: options.nativeStatusSupported,
|
|
342
337
|
horizontalRuleEnabled: options.horizontalRuleEnabled,
|
|
343
|
-
onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
338
|
+
onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c2 = pluginInjectionApi.codeBlock) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.actions.insertCodeBlock, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$p = pluginInjectionApi.panel) === null || _pluginInjectionApi$p === void 0 ? void 0 : _pluginInjectionApi$p.actions.insertPanel, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$b = pluginInjectionApi.blockType) === null || _pluginInjectionApi$b === void 0 ? void 0 : _pluginInjectionApi$b.actions.insertBlockQuote),
|
|
344
339
|
onInsertMacroFromMacroBrowser: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e = pluginInjectionApi.extension) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.actions.insertMacroFromMacroBrowser,
|
|
345
340
|
popupsMountPoint: popupsMountPoint,
|
|
346
341
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
@@ -16,27 +16,23 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
16
16
|
import { messages, IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
17
17
|
import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
18
18
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
19
|
-
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
19
|
+
import { expVal, expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
20
20
|
export const DEFAULT_HEIGHT = 560;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Exported helper to allow testing of InsertMenu pinning logic.
|
|
24
24
|
*
|
|
25
|
-
* NOTE: this is *not* the ideal way to approach this. The quick insert plugin provides a
|
|
26
|
-
* `getSuggestions` method that can be used to get suggestions. Once all experiments are cleaned up,
|
|
27
|
-
* they should be unified through `pluginInjectionApi?.quickInsert?.actions.getSuggestions`.
|
|
28
|
-
*
|
|
29
25
|
* The `cc_fd_db_top_editor_toolbar` experiment adds new logic to sort elements by `priority`.
|
|
30
26
|
* This newer implementation matches how the quick insert menu sorts elements.
|
|
31
27
|
*/
|
|
32
|
-
export const
|
|
33
|
-
if (['new-description', 'orig-description'].includes(expVal('cc_fd_db_top_editor_toolbar', 'cohort', 'control'))) {
|
|
28
|
+
export const sortFeaturedItems = (featuredItems, formatMessage) => {
|
|
29
|
+
if (['new-description', 'orig-description'].includes(expVal('cc_fd_db_top_editor_toolbar', 'cohort', 'control')) || expValNoExposure('cc_fd_wb_jira_quick_insert_experiment', 'isEnabled', false)) {
|
|
34
30
|
// Sort by priority (lower first) on the concatenated list so items
|
|
35
31
|
// with "priority" are at the top (e.g. Whiteboard before Database)
|
|
36
32
|
return featuredItems.slice(0).sort((a, b) => (a.priority || Number.POSITIVE_INFINITY) - (b.priority || Number.POSITIVE_INFINITY));
|
|
37
33
|
}
|
|
38
34
|
|
|
39
|
-
//
|
|
35
|
+
// NOTE: this is *not* the ideal way to approach this. Old logic sort whiteboards to top
|
|
40
36
|
const DIAGRAM_KEY = 'whiteboard-extension:create-diagram';
|
|
41
37
|
const isDiagram = item => item.key === DIAGRAM_KEY;
|
|
42
38
|
const featuredWhiteboardsPresent = featuredItems.some(isDiagram);
|
|
@@ -156,7 +152,7 @@ const InsertMenu = ({
|
|
|
156
152
|
} : item)) !== null && _pluginInjectionApi$q5 !== void 0 ? _pluginInjectionApi$q5 : [];
|
|
157
153
|
const unfilteredResult = quickInsertDropdownItems.concat(featuredQuickInsertSuggestions);
|
|
158
154
|
// need to sort on the concatenated list so desired elements are at the top
|
|
159
|
-
result =
|
|
155
|
+
result = sortFeaturedItems(unfilteredResult, formatMessage);
|
|
160
156
|
}
|
|
161
157
|
setItemCount(result.length);
|
|
162
158
|
return result;
|
|
@@ -8,7 +8,6 @@ import { Popup } from '@atlaskit/editor-common/ui';
|
|
|
8
8
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
9
9
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { ToolbarButton, ToolbarTooltip, AddIcon, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
import InsertMenu, { DEFAULT_HEIGHT } from '../ElementBrowser/InsertMenu';
|
|
13
12
|
import { LINK_BUTTON_KEY } from './hooks/filterDropdownItems';
|
|
14
13
|
import { useEmojiPickerPopup } from './hooks/useEmojiPickerPopup';
|
|
@@ -90,7 +89,7 @@ export const InsertButton = ({
|
|
|
90
89
|
item,
|
|
91
90
|
inputMethod
|
|
92
91
|
}) => {
|
|
93
|
-
var _api$core, _api$hyperlink, _api$imageUpload, _api$mention, _api$mention$actions, _api$taskDecision, _api$rule, _api$
|
|
92
|
+
var _api$core, _api$hyperlink, _api$imageUpload, _api$mention, _api$mention$actions, _api$taskDecision, _api$rule, _api$core3, _api$date, _api$date$commands, _api$placeholderText, _api$layout, _api$core4, _api$status, _api$status$commands, _api$expand;
|
|
94
93
|
if (!editorView) {
|
|
95
94
|
return;
|
|
96
95
|
}
|
|
@@ -132,13 +131,8 @@ export const InsertButton = ({
|
|
|
132
131
|
break;
|
|
133
132
|
case 'media':
|
|
134
133
|
if (showMediaPicker) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
api !== null && api !== void 0 && (_api$mediaInsert = api.mediaInsert) !== null && _api$mediaInsert !== void 0 && _api$mediaInsert.commands.showMediaInsertPopup ? api === null || api === void 0 ? void 0 : (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions.execute(api === null || api === void 0 ? void 0 : (_api$mediaInsert2 = api.mediaInsert) === null || _api$mediaInsert2 === void 0 ? void 0 : _api$mediaInsert2.commands.showMediaInsertPopup()) : showMediaPicker === null || showMediaPicker === void 0 ? void 0 : showMediaPicker();
|
|
138
|
-
} else {
|
|
139
|
-
var _api$core3, _api$mediaInsert3;
|
|
140
|
-
api === null || api === void 0 ? void 0 : (_api$core3 = api.core) === null || _api$core3 === void 0 ? void 0 : _api$core3.actions.execute(api === null || api === void 0 ? void 0 : (_api$mediaInsert3 = api.mediaInsert) === null || _api$mediaInsert3 === void 0 ? void 0 : _api$mediaInsert3.commands.showMediaInsertPopup());
|
|
141
|
-
}
|
|
134
|
+
var _api$mediaInsert, _api$core2, _api$mediaInsert2;
|
|
135
|
+
api !== null && api !== void 0 && (_api$mediaInsert = api.mediaInsert) !== null && _api$mediaInsert !== void 0 && _api$mediaInsert.commands.showMediaInsertPopup ? api === null || api === void 0 ? void 0 : (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions.execute(api === null || api === void 0 ? void 0 : (_api$mediaInsert2 = api.mediaInsert) === null || _api$mediaInsert2 === void 0 ? void 0 : _api$mediaInsert2.commands.showMediaInsertPopup()) : showMediaPicker === null || showMediaPicker === void 0 ? void 0 : showMediaPicker();
|
|
142
136
|
}
|
|
143
137
|
break;
|
|
144
138
|
case 'mention':
|
|
@@ -161,7 +155,7 @@ export const InsertButton = ({
|
|
|
161
155
|
api === null || api === void 0 ? void 0 : (_api$rule = api.rule) === null || _api$rule === void 0 ? void 0 : _api$rule.actions.insertHorizontalRule(inputMethod)(state, dispatch);
|
|
162
156
|
break;
|
|
163
157
|
case 'date':
|
|
164
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
158
|
+
api === null || api === void 0 ? void 0 : (_api$core3 = api.core) === null || _api$core3 === void 0 ? void 0 : _api$core3.actions.execute(api === null || api === void 0 ? void 0 : (_api$date = api.date) === null || _api$date === void 0 ? void 0 : (_api$date$commands = _api$date.commands) === null || _api$date$commands === void 0 ? void 0 : _api$date$commands.insertDate({
|
|
165
159
|
inputMethod
|
|
166
160
|
}));
|
|
167
161
|
break;
|
|
@@ -172,7 +166,7 @@ export const InsertButton = ({
|
|
|
172
166
|
api === null || api === void 0 ? void 0 : (_api$layout = api.layout) === null || _api$layout === void 0 ? void 0 : _api$layout.actions.insertLayoutColumns(inputMethod)(state, dispatch);
|
|
173
167
|
break;
|
|
174
168
|
case 'status':
|
|
175
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
169
|
+
api === null || api === void 0 ? void 0 : (_api$core4 = api.core) === null || _api$core4 === void 0 ? void 0 : _api$core4.actions.execute(api === null || api === void 0 ? void 0 : (_api$status = api.status) === null || _api$status === void 0 ? void 0 : (_api$status$commands = _api$status.commands) === null || _api$status$commands === void 0 ? void 0 : _api$status$commands.insertStatus(inputMethod));
|
|
176
170
|
break;
|
|
177
171
|
case 'expand':
|
|
178
172
|
api === null || api === void 0 ? void 0 : (_api$expand = api.expand) === null || _api$expand === void 0 ? void 0 : _api$expand.actions.insertExpand(state, dispatch);
|
|
@@ -261,7 +261,7 @@ var selector = function selector(states) {
|
|
|
261
261
|
};
|
|
262
262
|
};
|
|
263
263
|
function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
264
|
-
var _pluginInjectionApi$i, _pluginInjectionApi$
|
|
264
|
+
var _pluginInjectionApi$i, _pluginInjectionApi$c2, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
|
|
265
265
|
var editorView = _ref4.editorView,
|
|
266
266
|
editorActions = _ref4.editorActions,
|
|
267
267
|
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent,
|
|
@@ -303,16 +303,11 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
303
303
|
exposure: true
|
|
304
304
|
}) ? emojiProviderPromise : getEmojiProvider();
|
|
305
305
|
var onShowMediaPicker = function onShowMediaPicker(mountInfo) {
|
|
306
|
+
var _pluginInjectionApi$m, _pluginInjectionApi$c, _pluginInjectionApi$m2;
|
|
306
307
|
if (!showMediaPicker) {
|
|
307
308
|
return;
|
|
308
309
|
}
|
|
309
|
-
|
|
310
|
-
var _pluginInjectionApi$m, _pluginInjectionApi$c, _pluginInjectionApi$m2;
|
|
311
|
-
pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) !== null && _pluginInjectionApi$m !== void 0 && _pluginInjectionApi$m.commands.showMediaInsertPopup ? pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m2 = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m2 === void 0 ? void 0 : _pluginInjectionApi$m2.commands.showMediaInsertPopup(mountInfo)) : showMediaPicker();
|
|
312
|
-
} else {
|
|
313
|
-
var _pluginInjectionApi$c2, _pluginInjectionApi$m3;
|
|
314
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.core) === null || _pluginInjectionApi$c2 === void 0 || _pluginInjectionApi$c2.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m3 = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m3 === void 0 ? void 0 : _pluginInjectionApi$m3.commands.showMediaInsertPopup(mountInfo));
|
|
315
|
-
}
|
|
310
|
+
pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) !== null && _pluginInjectionApi$m !== void 0 && _pluginInjectionApi$m.commands.showMediaInsertPopup ? pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m2 = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m2 === void 0 ? void 0 : _pluginInjectionApi$m2.commands.showMediaInsertPopup(mountInfo)) : showMediaPicker();
|
|
316
311
|
};
|
|
317
312
|
return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
|
|
318
313
|
showElementBrowser: showElementBrowser || false,
|
|
@@ -346,7 +341,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
346
341
|
emojiProvider: emojiProvider,
|
|
347
342
|
nativeStatusSupported: options.nativeStatusSupported,
|
|
348
343
|
horizontalRuleEnabled: options.horizontalRuleEnabled,
|
|
349
|
-
onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
344
|
+
onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.codeBlock) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.actions.insertCodeBlock, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$p = pluginInjectionApi.panel) === null || _pluginInjectionApi$p === void 0 ? void 0 : _pluginInjectionApi$p.actions.insertPanel, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$b = pluginInjectionApi.blockType) === null || _pluginInjectionApi$b === void 0 ? void 0 : _pluginInjectionApi$b.actions.insertBlockQuote),
|
|
350
345
|
onInsertMacroFromMacroBrowser: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.extension) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.actions.insertMacroFromMacroBrowser,
|
|
351
346
|
popupsMountPoint: popupsMountPoint,
|
|
352
347
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
@@ -23,21 +23,17 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
23
23
|
import { messages, IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
24
24
|
import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
25
25
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
26
|
-
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
26
|
+
import { expVal, expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
27
27
|
export var DEFAULT_HEIGHT = 560;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Exported helper to allow testing of InsertMenu pinning logic.
|
|
31
31
|
*
|
|
32
|
-
* NOTE: this is *not* the ideal way to approach this. The quick insert plugin provides a
|
|
33
|
-
* `getSuggestions` method that can be used to get suggestions. Once all experiments are cleaned up,
|
|
34
|
-
* they should be unified through `pluginInjectionApi?.quickInsert?.actions.getSuggestions`.
|
|
35
|
-
*
|
|
36
32
|
* The `cc_fd_db_top_editor_toolbar` experiment adds new logic to sort elements by `priority`.
|
|
37
33
|
* This newer implementation matches how the quick insert menu sorts elements.
|
|
38
34
|
*/
|
|
39
|
-
export var
|
|
40
|
-
if (['new-description', 'orig-description'].includes(expVal('cc_fd_db_top_editor_toolbar', 'cohort', 'control'))) {
|
|
35
|
+
export var sortFeaturedItems = function sortFeaturedItems(featuredItems, formatMessage) {
|
|
36
|
+
if (['new-description', 'orig-description'].includes(expVal('cc_fd_db_top_editor_toolbar', 'cohort', 'control')) || expValNoExposure('cc_fd_wb_jira_quick_insert_experiment', 'isEnabled', false)) {
|
|
41
37
|
// Sort by priority (lower first) on the concatenated list so items
|
|
42
38
|
// with "priority" are at the top (e.g. Whiteboard before Database)
|
|
43
39
|
return featuredItems.slice(0).sort(function (a, b) {
|
|
@@ -45,7 +41,7 @@ export var sortPrioritizedElements = function sortPrioritizedElements(featuredIt
|
|
|
45
41
|
});
|
|
46
42
|
}
|
|
47
43
|
|
|
48
|
-
//
|
|
44
|
+
// NOTE: this is *not* the ideal way to approach this. Old logic sort whiteboards to top
|
|
49
45
|
var DIAGRAM_KEY = 'whiteboard-extension:create-diagram';
|
|
50
46
|
var isDiagram = function isDiagram(item) {
|
|
51
47
|
return item.key === DIAGRAM_KEY;
|
|
@@ -183,7 +179,7 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
183
179
|
})) !== null && _pluginInjectionApi$q4 !== void 0 ? _pluginInjectionApi$q4 : [];
|
|
184
180
|
var unfilteredResult = quickInsertDropdownItems.concat(featuredQuickInsertSuggestions);
|
|
185
181
|
// need to sort on the concatenated list so desired elements are at the top
|
|
186
|
-
result =
|
|
182
|
+
result = sortFeaturedItems(unfilteredResult, formatMessage);
|
|
187
183
|
}
|
|
188
184
|
setItemCount(result.length);
|
|
189
185
|
return result;
|
|
@@ -9,7 +9,6 @@ import { Popup } from '@atlaskit/editor-common/ui';
|
|
|
9
9
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
10
10
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
11
11
|
import { ToolbarButton, ToolbarTooltip, AddIcon, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import InsertMenu, { DEFAULT_HEIGHT } from '../ElementBrowser/InsertMenu';
|
|
14
13
|
import { LINK_BUTTON_KEY } from './hooks/filterDropdownItems';
|
|
15
14
|
import { useEmojiPickerPopup } from './hooks/useEmojiPickerPopup';
|
|
@@ -90,7 +89,7 @@ export var InsertButton = function InsertButton(_ref) {
|
|
|
90
89
|
toggleInsertMenuOpen(!insertMenuOpen);
|
|
91
90
|
};
|
|
92
91
|
var onItemActivated = function onItemActivated(_ref2) {
|
|
93
|
-
var _api$core, _api$hyperlink, _api$imageUpload, _api$mention, _api$taskDecision, _api$rule, _api$
|
|
92
|
+
var _api$core, _api$hyperlink, _api$imageUpload, _api$mention, _api$taskDecision, _api$rule, _api$core3, _api$date, _api$placeholderText, _api$layout, _api$core4, _api$status, _api$expand;
|
|
94
93
|
var item = _ref2.item,
|
|
95
94
|
inputMethod = _ref2.inputMethod;
|
|
96
95
|
if (!editorView) {
|
|
@@ -132,13 +131,8 @@ export var InsertButton = function InsertButton(_ref) {
|
|
|
132
131
|
break;
|
|
133
132
|
case 'media':
|
|
134
133
|
if (showMediaPicker) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
api !== null && api !== void 0 && (_api$mediaInsert = api.mediaInsert) !== null && _api$mediaInsert !== void 0 && _api$mediaInsert.commands.showMediaInsertPopup ? api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions.execute(api === null || api === void 0 || (_api$mediaInsert2 = api.mediaInsert) === null || _api$mediaInsert2 === void 0 ? void 0 : _api$mediaInsert2.commands.showMediaInsertPopup()) : showMediaPicker === null || showMediaPicker === void 0 ? void 0 : showMediaPicker();
|
|
138
|
-
} else {
|
|
139
|
-
var _api$core3, _api$mediaInsert3;
|
|
140
|
-
api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(api === null || api === void 0 || (_api$mediaInsert3 = api.mediaInsert) === null || _api$mediaInsert3 === void 0 ? void 0 : _api$mediaInsert3.commands.showMediaInsertPopup());
|
|
141
|
-
}
|
|
134
|
+
var _api$mediaInsert, _api$core2, _api$mediaInsert2;
|
|
135
|
+
api !== null && api !== void 0 && (_api$mediaInsert = api.mediaInsert) !== null && _api$mediaInsert !== void 0 && _api$mediaInsert.commands.showMediaInsertPopup ? api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions.execute(api === null || api === void 0 || (_api$mediaInsert2 = api.mediaInsert) === null || _api$mediaInsert2 === void 0 ? void 0 : _api$mediaInsert2.commands.showMediaInsertPopup()) : showMediaPicker === null || showMediaPicker === void 0 ? void 0 : showMediaPicker();
|
|
142
136
|
}
|
|
143
137
|
break;
|
|
144
138
|
case 'mention':
|
|
@@ -161,7 +155,7 @@ export var InsertButton = function InsertButton(_ref) {
|
|
|
161
155
|
api === null || api === void 0 || (_api$rule = api.rule) === null || _api$rule === void 0 || _api$rule.actions.insertHorizontalRule(inputMethod)(state, dispatch);
|
|
162
156
|
break;
|
|
163
157
|
case 'date':
|
|
164
|
-
api === null || api === void 0 || (_api$
|
|
158
|
+
api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(api === null || api === void 0 || (_api$date = api.date) === null || _api$date === void 0 || (_api$date = _api$date.commands) === null || _api$date === void 0 ? void 0 : _api$date.insertDate({
|
|
165
159
|
inputMethod: inputMethod
|
|
166
160
|
}));
|
|
167
161
|
break;
|
|
@@ -172,7 +166,7 @@ export var InsertButton = function InsertButton(_ref) {
|
|
|
172
166
|
api === null || api === void 0 || (_api$layout = api.layout) === null || _api$layout === void 0 || _api$layout.actions.insertLayoutColumns(inputMethod)(state, dispatch);
|
|
173
167
|
break;
|
|
174
168
|
case 'status':
|
|
175
|
-
api === null || api === void 0 || (_api$
|
|
169
|
+
api === null || api === void 0 || (_api$core4 = api.core) === null || _api$core4 === void 0 || _api$core4.actions.execute(api === null || api === void 0 || (_api$status = api.status) === null || _api$status === void 0 || (_api$status = _api$status.commands) === null || _api$status === void 0 ? void 0 : _api$status.insertStatus(inputMethod));
|
|
176
170
|
break;
|
|
177
171
|
case 'expand':
|
|
178
172
|
api === null || api === void 0 || (_api$expand = api.expand) === null || _api$expand === void 0 || _api$expand.actions.insertExpand(state, dispatch);
|
|
@@ -6,13 +6,9 @@ export declare const DEFAULT_HEIGHT = 560;
|
|
|
6
6
|
/**
|
|
7
7
|
* Exported helper to allow testing of InsertMenu pinning logic.
|
|
8
8
|
*
|
|
9
|
-
* NOTE: this is *not* the ideal way to approach this. The quick insert plugin provides a
|
|
10
|
-
* `getSuggestions` method that can be used to get suggestions. Once all experiments are cleaned up,
|
|
11
|
-
* they should be unified through `pluginInjectionApi?.quickInsert?.actions.getSuggestions`.
|
|
12
|
-
*
|
|
13
9
|
* The `cc_fd_db_top_editor_toolbar` experiment adds new logic to sort elements by `priority`.
|
|
14
10
|
* This newer implementation matches how the quick insert menu sorts elements.
|
|
15
11
|
*/
|
|
16
|
-
export declare const
|
|
12
|
+
export declare const sortFeaturedItems: (featuredItems: QuickInsertItem[], formatMessage: (msg: MessageDescriptor) => string) => QuickInsertItem[];
|
|
17
13
|
declare const InsertMenu: ({ editorView, dropdownItems, showElementBrowserLink, onInsert, toggleVisiblity, pluginInjectionApi, }: InsertMenuProps) => jsx.JSX.Element;
|
|
18
14
|
export default InsertMenu;
|
|
@@ -6,13 +6,9 @@ export declare const DEFAULT_HEIGHT = 560;
|
|
|
6
6
|
/**
|
|
7
7
|
* Exported helper to allow testing of InsertMenu pinning logic.
|
|
8
8
|
*
|
|
9
|
-
* NOTE: this is *not* the ideal way to approach this. The quick insert plugin provides a
|
|
10
|
-
* `getSuggestions` method that can be used to get suggestions. Once all experiments are cleaned up,
|
|
11
|
-
* they should be unified through `pluginInjectionApi?.quickInsert?.actions.getSuggestions`.
|
|
12
|
-
*
|
|
13
9
|
* The `cc_fd_db_top_editor_toolbar` experiment adds new logic to sort elements by `priority`.
|
|
14
10
|
* This newer implementation matches how the quick insert menu sorts elements.
|
|
15
11
|
*/
|
|
16
|
-
export declare const
|
|
12
|
+
export declare const sortFeaturedItems: (featuredItems: QuickInsertItem[], formatMessage: (msg: MessageDescriptor) => string) => QuickInsertItem[];
|
|
17
13
|
declare const InsertMenu: ({ editorView, dropdownItems, showElementBrowserLink, onInsert, toggleVisiblity, pluginInjectionApi, }: InsertMenuProps) => jsx.JSX.Element;
|
|
18
14
|
export default InsertMenu;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@atlaskit/icon": "^34.0.0",
|
|
65
65
|
"@atlaskit/icon-lab": "^6.4.0",
|
|
66
66
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
67
|
-
"@atlaskit/tmp-editor-statsig": "^55.
|
|
67
|
+
"@atlaskit/tmp-editor-statsig": "^55.1.0",
|
|
68
68
|
"@atlaskit/tokens": "^11.4.0",
|
|
69
69
|
"@babel/runtime": "^7.0.0",
|
|
70
70
|
"@emotion/react": "^11.7.1",
|
|
@@ -129,9 +129,6 @@
|
|
|
129
129
|
"platform_editor_nov_a11y_fixes": {
|
|
130
130
|
"type": "boolean"
|
|
131
131
|
},
|
|
132
|
-
"platform_editor_media_insert_check": {
|
|
133
|
-
"type": "boolean"
|
|
134
|
-
},
|
|
135
132
|
"platform_editor_experience_tracking_toolbar_button": {
|
|
136
133
|
"type": "boolean"
|
|
137
134
|
}
|