@atlaskit/editor-core 187.30.10 → 187.31.1
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 +16 -0
- package/dist/cjs/index.js +2 -21
- package/dist/cjs/plugins/block-type/commands/block-type.js +1 -1
- package/dist/cjs/plugins/help-dialog/index.js +3 -6
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -9
- package/dist/cjs/plugins/quick-insert/commands.js +6 -10
- package/dist/cjs/plugins/quick-insert/index.js +49 -52
- package/dist/cjs/plugins/quick-insert/search.js +17 -61
- package/dist/cjs/plugins/quick-insert/ui/ModalElementBrowser/index.js +12 -5
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +54 -54
- package/dist/cjs/utils/index.js +0 -32
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/index.js +7 -4
- package/dist/es2019/plugins/block-type/commands/block-type.js +1 -1
- package/dist/es2019/plugins/help-dialog/index.js +3 -6
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +7 -3
- package/dist/es2019/plugins/quick-insert/commands.js +6 -9
- package/dist/es2019/plugins/quick-insert/index.js +48 -45
- package/dist/es2019/plugins/quick-insert/search.js +15 -42
- package/dist/es2019/plugins/quick-insert/ui/ModalElementBrowser/index.js +11 -4
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +28 -25
- package/dist/es2019/utils/index.js +0 -25
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/index.js +7 -4
- package/dist/esm/plugins/block-type/commands/block-type.js +1 -1
- package/dist/esm/plugins/help-dialog/index.js +3 -6
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +5 -3
- package/dist/esm/plugins/quick-insert/commands.js +6 -10
- package/dist/esm/plugins/quick-insert/index.js +49 -46
- package/dist/esm/plugins/quick-insert/search.js +15 -56
- package/dist/esm/plugins/quick-insert/ui/ModalElementBrowser/index.js +12 -5
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +54 -54
- package/dist/esm/utils/index.js +0 -31
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/index.d.ts +6 -3
- package/dist/types/labs/next/presets/default.d.ts +32 -0
- package/dist/types/plugins/help-dialog/index.d.ts +5 -1
- package/dist/types/plugins/insert-block/types.d.ts +3 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +3 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +3 -0
- package/dist/types/plugins/quick-insert/commands.d.ts +2 -2
- package/dist/types/plugins/quick-insert/index.d.ts +12 -9
- package/dist/types/plugins/quick-insert/search.d.ts +3 -5
- package/dist/types/ui/ElementBrowser/InsertMenu.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/types.d.ts +3 -0
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +6 -3
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +32 -0
- package/dist/types-ts4.5/plugins/help-dialog/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +3 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +3 -0
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +3 -0
- package/dist/types-ts4.5/plugins/quick-insert/commands.d.ts +2 -2
- package/dist/types-ts4.5/plugins/quick-insert/index.d.ts +12 -9
- package/dist/types-ts4.5/plugins/quick-insert/search.d.ts +3 -5
- package/dist/types-ts4.5/ui/ElementBrowser/InsertMenu.d.ts +1 -1
- package/dist/types-ts4.5/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +1 -1
- package/dist/types-ts4.5/ui/ElementBrowser/types.d.ts +3 -0
- package/dist/types-ts4.5/utils/index.d.ts +0 -1
- package/package.json +2 -3
- package/report.api.md +2 -30
- package/tmp/api-report-tmp.d.ts +2 -21
- package/dist/cjs/plugins/quick-insert/api.js +0 -23
- package/dist/cjs/plugins/quick-insert/types.js +0 -5
- package/dist/es2019/plugins/quick-insert/api.js +0 -14
- package/dist/es2019/plugins/quick-insert/types.js +0 -1
- package/dist/esm/plugins/quick-insert/api.js +0 -16
- package/dist/esm/plugins/quick-insert/types.js +0 -1
- package/dist/types/plugins/quick-insert/api.d.ts +0 -6
- package/dist/types/plugins/quick-insert/types.d.ts +0 -4
- package/dist/types-ts4.5/plugins/quick-insert/api.d.ts +0 -6
- package/dist/types-ts4.5/plugins/quick-insert/types.d.ts +0 -4
|
@@ -15,18 +15,16 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
15
15
|
import { DN50, N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
16
16
|
import { IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
17
17
|
import withOuterListeners from '../with-outer-listeners';
|
|
18
|
-
import WithPluginState from '../WithPluginState';
|
|
19
|
-
import { pluginKey } from '../../plugins/quick-insert/plugin-key';
|
|
20
|
-
import { getFeaturedQuickInsertItems, searchQuickInsertItems } from '../../plugins/quick-insert/search';
|
|
21
|
-
import { insertItem } from '../../plugins/quick-insert/commands';
|
|
22
18
|
import ElementBrowser from './components/ElementBrowserLoader';
|
|
23
19
|
import { ELEMENT_ITEM_HEIGHT } from './constants';
|
|
24
20
|
var InsertMenu = function InsertMenu(_ref) {
|
|
21
|
+
var _pluginInjectionApi$d10, _pluginInjectionApi$d11, _pluginInjectionApi$d12, _pluginInjectionApi$d13;
|
|
25
22
|
var editorView = _ref.editorView,
|
|
26
23
|
dropdownItems = _ref.dropdownItems,
|
|
27
24
|
showElementBrowserLink = _ref.showElementBrowserLink,
|
|
28
25
|
onInsert = _ref.onInsert,
|
|
29
|
-
toggleVisiblity = _ref.toggleVisiblity
|
|
26
|
+
toggleVisiblity = _ref.toggleVisiblity,
|
|
27
|
+
pluginInjectionApi = _ref.pluginInjectionApi;
|
|
30
28
|
var _useState = useState(0),
|
|
31
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
30
|
itemCount = _useState2[0],
|
|
@@ -58,62 +56,64 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
58
56
|
var quickInsertDropdownItems = dropdownItems.map(transform);
|
|
59
57
|
var viewMoreItem = showElementBrowserLink ? quickInsertDropdownItems.pop() : undefined;
|
|
60
58
|
var onInsertItem = useCallback(function (item) {
|
|
59
|
+
var _pluginInjectionApi$d;
|
|
61
60
|
toggleVisiblity();
|
|
62
61
|
if (!editorView.hasFocus()) {
|
|
63
62
|
editorView.focus();
|
|
64
63
|
}
|
|
65
|
-
insertItem(item)(editorView.state, editorView.dispatch);
|
|
66
|
-
}, [editorView, toggleVisiblity]);
|
|
67
|
-
var getItems = useCallback(function (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
onInsertItem: onInsertItem,
|
|
96
|
-
showSearch: true,
|
|
97
|
-
showCategories: false
|
|
98
|
-
// On page resize we want the InlineElementBrowser to show updated tools/overflow items
|
|
99
|
-
,
|
|
100
|
-
key: quickInsertDropdownItems.length,
|
|
101
|
-
viewMoreItem: viewMoreItem
|
|
102
|
-
}));
|
|
103
|
-
}, [getItems, onInsertItem, quickInsertDropdownItems.length, toggleVisiblity, viewMoreItem]);
|
|
64
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.quickInsert) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions.insertItem(item)(editorView.state, editorView.dispatch);
|
|
65
|
+
}, [editorView, toggleVisiblity, pluginInjectionApi]);
|
|
66
|
+
var getItems = useCallback(function (query, category) {
|
|
67
|
+
var result;
|
|
68
|
+
/**
|
|
69
|
+
* @warning The results if there is a query are not the same as the results if there is no query.
|
|
70
|
+
* For example: If you have a typed panel and then select the panel item then it will call a different action
|
|
71
|
+
* than is specified on the editor plugins quick insert
|
|
72
|
+
* @see above transform function for more details.
|
|
73
|
+
*/
|
|
74
|
+
if (query) {
|
|
75
|
+
var _pluginInjectionApi$d2, _pluginInjectionApi$d3, _pluginInjectionApi$d4, _pluginInjectionApi$d5;
|
|
76
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies.quickInsert) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.commands.search({
|
|
77
|
+
query: query,
|
|
78
|
+
category: category
|
|
79
|
+
}));
|
|
80
|
+
result = (_pluginInjectionApi$d3 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies.quickInsert) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : (_pluginInjectionApi$d5 = _pluginInjectionApi$d4.sharedState.currentState()) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : _pluginInjectionApi$d5.suggestions) !== null && _pluginInjectionApi$d3 !== void 0 ? _pluginInjectionApi$d3 : [];
|
|
81
|
+
} else {
|
|
82
|
+
var _pluginInjectionApi$d6, _pluginInjectionApi$d7, _pluginInjectionApi$d8, _pluginInjectionApi$d9;
|
|
83
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d6 = pluginInjectionApi.dependencies.quickInsert) === null || _pluginInjectionApi$d6 === void 0 ? void 0 : _pluginInjectionApi$d6.commands.search({
|
|
84
|
+
category: category,
|
|
85
|
+
featuredItems: true
|
|
86
|
+
}));
|
|
87
|
+
var featuredQuickInsertSuggestions = (_pluginInjectionApi$d7 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d8 = pluginInjectionApi.dependencies.quickInsert) === null || _pluginInjectionApi$d8 === void 0 ? void 0 : (_pluginInjectionApi$d9 = _pluginInjectionApi$d8.sharedState.currentState()) === null || _pluginInjectionApi$d9 === void 0 ? void 0 : _pluginInjectionApi$d9.suggestions) !== null && _pluginInjectionApi$d7 !== void 0 ? _pluginInjectionApi$d7 : [];
|
|
88
|
+
result = quickInsertDropdownItems.concat(featuredQuickInsertSuggestions);
|
|
89
|
+
}
|
|
90
|
+
setItemCount(result.length);
|
|
91
|
+
return result;
|
|
92
|
+
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.core.actions, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d10 = pluginInjectionApi.dependencies.quickInsert) === null || _pluginInjectionApi$d10 === void 0 ? void 0 : _pluginInjectionApi$d10.commands, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d11 = pluginInjectionApi.dependencies.quickInsert) === null || _pluginInjectionApi$d11 === void 0 ? void 0 : _pluginInjectionApi$d11.sharedState, quickInsertDropdownItems]);
|
|
93
|
+
var emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d12 = pluginInjectionApi.dependencies.quickInsert) === null || _pluginInjectionApi$d12 === void 0 ? void 0 : (_pluginInjectionApi$d13 = _pluginInjectionApi$d12.sharedState.currentState()) === null || _pluginInjectionApi$d13 === void 0 ? void 0 : _pluginInjectionApi$d13.emptyStateHandler;
|
|
104
94
|
return jsx("div", {
|
|
105
95
|
css: function css(theme) {
|
|
106
96
|
return insertMenuWrapper(theme, itemCount);
|
|
107
97
|
}
|
|
108
|
-
}, jsx(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
98
|
+
}, jsx(ElementBrowserWrapper, {
|
|
99
|
+
handleClickOutside: toggleVisiblity,
|
|
100
|
+
handleEscapeKeydown: toggleVisiblity,
|
|
101
|
+
closeOnTab: true
|
|
102
|
+
}, jsx(ElementBrowser, {
|
|
103
|
+
mode: "inline",
|
|
104
|
+
getItems: getItems,
|
|
105
|
+
emptyStateHandler: emptyStateHandler,
|
|
106
|
+
onInsertItem: onInsertItem,
|
|
107
|
+
showSearch: true,
|
|
108
|
+
showCategories: false
|
|
109
|
+
// On page resize we want the InlineElementBrowser to show updated tools/overflow items
|
|
110
|
+
,
|
|
111
|
+
key: quickInsertDropdownItems.length,
|
|
112
|
+
viewMoreItem: viewMoreItem
|
|
113
|
+
})));
|
|
114
114
|
};
|
|
115
|
-
var getSvgIconForItem = function getSvgIconForItem(
|
|
116
|
-
var name =
|
|
115
|
+
var getSvgIconForItem = function getSvgIconForItem(_ref2) {
|
|
116
|
+
var name = _ref2.name;
|
|
117
117
|
var Icon = {
|
|
118
118
|
codeblock: IconCode,
|
|
119
119
|
panel: IconPanel,
|
|
@@ -128,8 +128,8 @@ var getSvgIconForItem = function getSvgIconForItem(_ref3) {
|
|
|
128
128
|
label: ""
|
|
129
129
|
}) : undefined;
|
|
130
130
|
};
|
|
131
|
-
var getInsertMenuHeight = function getInsertMenuHeight(
|
|
132
|
-
var itemCount =
|
|
131
|
+
var getInsertMenuHeight = function getInsertMenuHeight(_ref3) {
|
|
132
|
+
var itemCount = _ref3.itemCount;
|
|
133
133
|
// Figure based on visuals to exclude the searchbar, padding/margin, and the ViewMore item.
|
|
134
134
|
var EXTRA_SPACE_EXCLUDING_ELEMENTLIST = 112;
|
|
135
135
|
if (itemCount > 0 && itemCount < 6) {
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -113,37 +113,6 @@ export var isInsideBlockQuote = function isInsideBlockQuote(state) {
|
|
|
113
113
|
var blockquote = state.schema.nodes.blockquote;
|
|
114
114
|
return hasParentNodeOfType(blockquote)(state.selection);
|
|
115
115
|
};
|
|
116
|
-
export function dedupe() {
|
|
117
|
-
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
118
|
-
var iteratee = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (p) {
|
|
119
|
-
return p;
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
.,
|
|
123
|
-
. _,'f----.._
|
|
124
|
-
|\ ,-'"/ | ,'
|
|
125
|
-
|,_ ,--. /
|
|
126
|
-
/,-. ,'`. (_
|
|
127
|
-
f o| o|__ "`-.
|
|
128
|
-
,-._.,--'_ `. _.,-`
|
|
129
|
-
`"' ___.,'` j,-'
|
|
130
|
-
`-.__.,--'
|
|
131
|
-
Gotta go fast!
|
|
132
|
-
*/
|
|
133
|
-
|
|
134
|
-
var seen = new Set();
|
|
135
|
-
list.forEach(function (l) {
|
|
136
|
-
return seen.add(iteratee(l));
|
|
137
|
-
});
|
|
138
|
-
return list.filter(function (l) {
|
|
139
|
-
var it = iteratee(l);
|
|
140
|
-
if (seen.has(it)) {
|
|
141
|
-
seen.delete(it);
|
|
142
|
-
return true;
|
|
143
|
-
}
|
|
144
|
-
return false;
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
116
|
export { isTextSelection, isElementInTableCell, isLastItemMediaGroup, nonNullable } from '@atlaskit/editor-common/utils';
|
|
148
117
|
|
|
149
118
|
/** Helper type for single arg function */
|
package/dist/types/index.d.ts
CHANGED
|
@@ -44,7 +44,6 @@ export { pluginKey as datePluginKey } from './plugins/date/pm-plugins/plugin-key
|
|
|
44
44
|
export { commitStatusPicker, setStatusPickerAt, updateStatus, updateStatusWithAnalytics, removeStatus, } from './plugins/status/actions';
|
|
45
45
|
export { typeAheadPluginKey } from './plugins/type-ahead';
|
|
46
46
|
export type { TypeAheadPluginState } from './plugins/type-ahead';
|
|
47
|
-
export { pluginKey as quickInsertPluginKey, memoProcessItems as processQuickInsertItems, } from './plugins/quick-insert';
|
|
48
47
|
export type { TypeAheadItem } from '@atlaskit/editor-common/provider-factory';
|
|
49
48
|
export type {
|
|
50
49
|
/**
|
|
@@ -59,7 +58,12 @@ export { historyPluginKey } from './plugins/history';
|
|
|
59
58
|
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, } from '@atlaskit/editor-common/analytics';
|
|
60
59
|
export type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
61
60
|
export { setKeyboardHeight, setMobilePaddingTop, setIsExpanded, } from './plugins/mobile-dimensions/commands';
|
|
62
|
-
export { setTextSelection,
|
|
61
|
+
export { setTextSelection, getNodesCount, measurements } from './utils';
|
|
62
|
+
export {
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated Use dedupe from @atlaskit/editor-common/utils instead
|
|
65
|
+
*/
|
|
66
|
+
dedupe, } from '@atlaskit/editor-common/utils';
|
|
63
67
|
export { ReactEditorView, BaseReactEditorView } from './create-editor';
|
|
64
68
|
export { getDefaultPresetOptionsFromEditorProps } from './create-editor';
|
|
65
69
|
export type { Command, EditorPlugin, EditorProps, EditorInstance, CommandDispatch, } from './types';
|
|
@@ -79,4 +83,3 @@ export type { PaletteColor } from './ui/ColorPalette/Palettes/type';
|
|
|
79
83
|
export { DEFAULT_BORDER_COLOR } from './ui/ColorPalette/Palettes/common';
|
|
80
84
|
export { default as messages, statusMessages, dateMessages } from './messages';
|
|
81
85
|
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
82
|
-
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
@@ -238,8 +238,24 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
238
238
|
};
|
|
239
239
|
}>, (config?: QuickInsertPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"quickInsert", {
|
|
240
240
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
241
|
+
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
242
|
+
actions: {
|
|
243
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("../../..").Command;
|
|
244
|
+
};
|
|
245
|
+
commands: {
|
|
246
|
+
search: import("../../../plugins/quick-insert/search").QuickInsertSearch;
|
|
247
|
+
openElementBrowserModal: import("@atlaskit/editor-common/types").EditorCommand;
|
|
248
|
+
};
|
|
241
249
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"quickInsert", {
|
|
242
250
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
251
|
+
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
252
|
+
actions: {
|
|
253
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("../../..").Command;
|
|
254
|
+
};
|
|
255
|
+
commands: {
|
|
256
|
+
search: import("../../../plugins/quick-insert/search").QuickInsertSearch;
|
|
257
|
+
openElementBrowserModal: import("@atlaskit/editor-common/types").EditorCommand;
|
|
258
|
+
};
|
|
243
259
|
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"width", {
|
|
244
260
|
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
245
261
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"width", {
|
|
@@ -625,8 +641,24 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
625
641
|
};
|
|
626
642
|
}>, (config?: QuickInsertPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"quickInsert", {
|
|
627
643
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
644
|
+
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
645
|
+
actions: {
|
|
646
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("../../..").Command;
|
|
647
|
+
};
|
|
648
|
+
commands: {
|
|
649
|
+
search: import("../../../plugins/quick-insert/search").QuickInsertSearch;
|
|
650
|
+
openElementBrowserModal: import("@atlaskit/editor-common/types").EditorCommand;
|
|
651
|
+
};
|
|
628
652
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"quickInsert", {
|
|
629
653
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
654
|
+
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
655
|
+
actions: {
|
|
656
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("../../..").Command;
|
|
657
|
+
};
|
|
658
|
+
commands: {
|
|
659
|
+
search: import("../../../plugins/quick-insert/search").QuickInsertSearch;
|
|
660
|
+
openElementBrowserModal: import("@atlaskit/editor-common/types").EditorCommand;
|
|
661
|
+
};
|
|
630
662
|
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"width", {
|
|
631
663
|
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
632
664
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"width", {
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type quickInsertPlugin from '../quick-insert';
|
|
4
5
|
export declare function createPlugin(dispatch: Function, imageEnabled: boolean): SafePlugin<any>;
|
|
5
6
|
declare const helpDialog: NextEditorPlugin<'helpDialog', {
|
|
6
|
-
dependencies: [
|
|
7
|
+
dependencies: [
|
|
8
|
+
OptionalPlugin<typeof analyticsPlugin>,
|
|
9
|
+
OptionalPlugin<typeof quickInsertPlugin>
|
|
10
|
+
];
|
|
7
11
|
pluginConfiguration: boolean;
|
|
8
12
|
}>;
|
|
9
13
|
export default helpDialog;
|
|
@@ -7,6 +7,7 @@ import type { hyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
|
7
7
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
8
8
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
9
|
import type mentionsPlugin from '../mentions';
|
|
10
|
+
import type quickInsertPlugin from '../quick-insert';
|
|
10
11
|
export type InsertBlockPluginDependencies = [
|
|
11
12
|
typeof featureFlagsPlugin,
|
|
12
13
|
OptionalPlugin<typeof tablesPlugin>,
|
|
@@ -15,5 +16,6 @@ export type InsertBlockPluginDependencies = [
|
|
|
15
16
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
16
17
|
OptionalPlugin<ImageUploadPlugin>,
|
|
17
18
|
OptionalPlugin<typeof mentionsPlugin>,
|
|
18
|
-
OptionalPlugin<EmojiPlugin
|
|
19
|
+
OptionalPlugin<EmojiPlugin>,
|
|
20
|
+
OptionalPlugin<typeof quickInsertPlugin>
|
|
19
21
|
];
|
package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { BlockMenuItem } from './create-items';
|
|
4
4
|
import type { OnInsert } from '../../../../ui/ElementBrowser/types';
|
|
5
|
+
import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { InsertBlockPluginDependencies } from '../../types';
|
|
5
7
|
type SimpleEventHandler<T> = (event?: T) => void;
|
|
6
8
|
export interface BlockInsertElementBrowserProps {
|
|
7
9
|
disabled: boolean;
|
|
@@ -20,6 +22,7 @@ export interface BlockInsertElementBrowserProps {
|
|
|
20
22
|
onKeyDown?: React.KeyboardEventHandler;
|
|
21
23
|
onInsert: OnInsert;
|
|
22
24
|
togglePlusMenuVisibility: SimpleEventHandler<MouseEvent | KeyboardEvent>;
|
|
25
|
+
pluginInjectionApi: PluginInjectionAPIWithDependencies<InsertBlockPluginDependencies> | undefined;
|
|
23
26
|
}
|
|
24
27
|
export declare const BlockInsertElementBrowser: React.FC<BlockInsertElementBrowserProps>;
|
|
25
28
|
export {};
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { OnInsert } from '../../../../ui/ElementBrowser/types';
|
|
4
4
|
import type { BlockMenuItem } from './create-items';
|
|
5
|
+
import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { InsertBlockPluginDependencies } from '../../types';
|
|
5
7
|
export interface BlockInsertMenuProps {
|
|
6
8
|
disabled: boolean;
|
|
7
9
|
editorView: EditorView;
|
|
@@ -23,5 +25,6 @@ export interface BlockInsertMenuProps {
|
|
|
23
25
|
onOpenChange(attrs: any): void;
|
|
24
26
|
togglePlusMenuVisibility(): void;
|
|
25
27
|
onKeyDown?: React.KeyboardEventHandler;
|
|
28
|
+
pluginInjectionApi: PluginInjectionAPIWithDependencies<InsertBlockPluginDependencies> | undefined;
|
|
26
29
|
}
|
|
27
30
|
export declare const BlockInsertMenu: React.FC<BlockInsertMenuProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import type { Command } from '
|
|
3
|
-
export declare const openElementBrowserModal:
|
|
2
|
+
import type { EditorCommand, Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
export declare const openElementBrowserModal: EditorCommand;
|
|
4
4
|
export declare const closeElementBrowserModal: () => Command;
|
|
5
5
|
export declare const insertItem: (item: QuickInsertItem) => Command;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl-next';
|
|
2
1
|
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { NextEditorPlugin } from '../../types';
|
|
4
|
-
import {
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
export type { QuickInsertHandler, QuickInsertPluginOptions };
|
|
8
|
-
export { pluginKey };
|
|
2
|
+
import type { NextEditorPlugin, Command } from '../../types';
|
|
3
|
+
import type { QuickInsertSearch } from './search';
|
|
4
|
+
import type { QuickInsertPluginOptions, QuickInsertSharedState, EditorCommand } from '@atlaskit/editor-common/types';
|
|
5
|
+
export type { QuickInsertPluginOptions };
|
|
9
6
|
declare const quickInsertPlugin: NextEditorPlugin<'quickInsert', {
|
|
10
7
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
8
|
+
sharedState: QuickInsertSharedState | null;
|
|
9
|
+
actions: {
|
|
10
|
+
insertItem: (item: QuickInsertItem) => Command;
|
|
11
|
+
};
|
|
12
|
+
commands: {
|
|
13
|
+
search: QuickInsertSearch;
|
|
14
|
+
openElementBrowserModal: EditorCommand;
|
|
15
|
+
};
|
|
11
16
|
}>;
|
|
12
17
|
export default quickInsertPlugin;
|
|
13
|
-
declare const processItems: (items: Array<QuickInsertHandler | QuickInsertItem>, intl: IntlShape, extendedActions?: Record<string, Function>) => QuickInsertItem[];
|
|
14
|
-
export declare const memoProcessItems: typeof processItems;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
export declare const searchQuickInsertItems: (quickInsertState?: QuickInsertPluginState, options?: QuickInsertPluginOptions) => (query?: string, category?: string) => QuickInsertItem[];
|
|
5
|
-
export declare const getFeaturedQuickInsertItems: ({ providedItems, lazyDefaultItems }: QuickInsertPluginState, options?: QuickInsertPluginOptions) => () => QuickInsertItem[];
|
|
1
|
+
import type { EditorCommand, QuickInsertSearchOptions } from '@atlaskit/editor-common/types';
|
|
2
|
+
export type QuickInsertSearch = (searchOptions: QuickInsertSearchOptions) => EditorCommand;
|
|
3
|
+
export declare const search: QuickInsertSearch;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import type { InsertMenuProps } from './types';
|
|
3
|
-
declare const InsertMenu: ({ editorView, dropdownItems, showElementBrowserLink, onInsert, toggleVisiblity, }: InsertMenuProps) => jsx.JSX.Element;
|
|
3
|
+
declare const InsertMenu: ({ editorView, dropdownItems, showElementBrowserLink, onInsert, toggleVisiblity, pluginInjectionApi, }: InsertMenuProps) => jsx.JSX.Element;
|
|
4
4
|
export default InsertMenu;
|
|
@@ -19,5 +19,5 @@ export type StatelessElementBrowserProps = {
|
|
|
19
19
|
emptyStateHandler?: EmptyStateHandler;
|
|
20
20
|
viewMoreItem?: QuickInsertItem;
|
|
21
21
|
} & WithAnalyticsEventsProps;
|
|
22
|
-
declare const MemoizedElementBrowser: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<Omit<StatelessElementBrowserProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "key" | "mode" | "analyticsContext" | "items" | "
|
|
22
|
+
declare const MemoizedElementBrowser: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<Omit<StatelessElementBrowserProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "key" | "mode" | "analyticsContext" | "items" | "emptyStateHandler" | "selectedCategory" | "searchTerm" | "onInsertItem" | "categories" | "onSelectCategory" | "onSearch" | "onSelectItem" | "viewMoreItem" | "showCategories" | "showSearch"> & React.RefAttributes<any>>>;
|
|
23
23
|
export default MemoizedElementBrowser;
|
|
@@ -2,6 +2,8 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
2
2
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { BlockMenuItem } from '../../plugins/insert-block/ui/ToolbarInsertBlock/create-items';
|
|
4
4
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
5
|
+
import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { InsertBlockPluginDependencies } from '../../plugins/insert-block/types';
|
|
5
7
|
type SimpleEventHandler<T> = (event?: T) => void;
|
|
6
8
|
export type Category = {
|
|
7
9
|
title: string;
|
|
@@ -21,6 +23,7 @@ export interface InsertMenuProps {
|
|
|
21
23
|
showElementBrowserLink: boolean;
|
|
22
24
|
toggleVisiblity: SimpleEventHandler<MouseEvent | KeyboardEvent>;
|
|
23
25
|
onInsert: OnInsert;
|
|
26
|
+
pluginInjectionApi: PluginInjectionAPIWithDependencies<InsertBlockPluginDependencies> | undefined;
|
|
24
27
|
}
|
|
25
28
|
export type OnInsert = ({ item }: {
|
|
26
29
|
item: MenuItem;
|
|
@@ -26,7 +26,6 @@ export declare function whichTransitionEvent<TransitionEventName extends string>
|
|
|
26
26
|
export declare const isTemporary: (id: string) => boolean;
|
|
27
27
|
export declare const hasOpenEnd: (slice: Slice) => boolean;
|
|
28
28
|
export declare const isInsideBlockQuote: (state: EditorState) => boolean;
|
|
29
|
-
export declare function dedupe<T>(list?: T[], iteratee?: (p: T) => T[keyof T] | T): T[];
|
|
30
29
|
export { isTextSelection, isElementInTableCell, isLastItemMediaGroup, nonNullable, } from '@atlaskit/editor-common/utils';
|
|
31
30
|
/** Helper type for single arg function */
|
|
32
31
|
type Func<A, B> = (a: A) => B;
|
|
@@ -44,7 +44,6 @@ export { pluginKey as datePluginKey } from './plugins/date/pm-plugins/plugin-key
|
|
|
44
44
|
export { commitStatusPicker, setStatusPickerAt, updateStatus, updateStatusWithAnalytics, removeStatus, } from './plugins/status/actions';
|
|
45
45
|
export { typeAheadPluginKey } from './plugins/type-ahead';
|
|
46
46
|
export type { TypeAheadPluginState } from './plugins/type-ahead';
|
|
47
|
-
export { pluginKey as quickInsertPluginKey, memoProcessItems as processQuickInsertItems, } from './plugins/quick-insert';
|
|
48
47
|
export type { TypeAheadItem } from '@atlaskit/editor-common/provider-factory';
|
|
49
48
|
export type {
|
|
50
49
|
/**
|
|
@@ -59,7 +58,12 @@ export { historyPluginKey } from './plugins/history';
|
|
|
59
58
|
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, } from '@atlaskit/editor-common/analytics';
|
|
60
59
|
export type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
61
60
|
export { setKeyboardHeight, setMobilePaddingTop, setIsExpanded, } from './plugins/mobile-dimensions/commands';
|
|
62
|
-
export { setTextSelection,
|
|
61
|
+
export { setTextSelection, getNodesCount, measurements } from './utils';
|
|
62
|
+
export {
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated Use dedupe from @atlaskit/editor-common/utils instead
|
|
65
|
+
*/
|
|
66
|
+
dedupe, } from '@atlaskit/editor-common/utils';
|
|
63
67
|
export { ReactEditorView, BaseReactEditorView } from './create-editor';
|
|
64
68
|
export { getDefaultPresetOptionsFromEditorProps } from './create-editor';
|
|
65
69
|
export type { Command, EditorPlugin, EditorProps, EditorInstance, CommandDispatch, } from './types';
|
|
@@ -79,4 +83,3 @@ export type { PaletteColor } from './ui/ColorPalette/Palettes/type';
|
|
|
79
83
|
export { DEFAULT_BORDER_COLOR } from './ui/ColorPalette/Palettes/common';
|
|
80
84
|
export { default as messages, statusMessages, dateMessages } from './messages';
|
|
81
85
|
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
82
|
-
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
@@ -287,8 +287,24 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
287
287
|
}>,
|
|
288
288
|
(config?: QuickInsertPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"quickInsert", {
|
|
289
289
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
290
|
+
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
291
|
+
actions: {
|
|
292
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("../../..").Command;
|
|
293
|
+
};
|
|
294
|
+
commands: {
|
|
295
|
+
search: import("../../../plugins/quick-insert/search").QuickInsertSearch;
|
|
296
|
+
openElementBrowserModal: import("@atlaskit/editor-common/types").EditorCommand;
|
|
297
|
+
};
|
|
290
298
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"quickInsert", {
|
|
291
299
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
300
|
+
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
301
|
+
actions: {
|
|
302
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("../../..").Command;
|
|
303
|
+
};
|
|
304
|
+
commands: {
|
|
305
|
+
search: import("../../../plugins/quick-insert/search").QuickInsertSearch;
|
|
306
|
+
openElementBrowserModal: import("@atlaskit/editor-common/types").EditorCommand;
|
|
307
|
+
};
|
|
292
308
|
}>,
|
|
293
309
|
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"width", {
|
|
294
310
|
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
@@ -754,8 +770,24 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
754
770
|
}>,
|
|
755
771
|
(config?: QuickInsertPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"quickInsert", {
|
|
756
772
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
773
|
+
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
774
|
+
actions: {
|
|
775
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("../../..").Command;
|
|
776
|
+
};
|
|
777
|
+
commands: {
|
|
778
|
+
search: import("../../../plugins/quick-insert/search").QuickInsertSearch;
|
|
779
|
+
openElementBrowserModal: import("@atlaskit/editor-common/types").EditorCommand;
|
|
780
|
+
};
|
|
757
781
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"quickInsert", {
|
|
758
782
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
783
|
+
sharedState: import("@atlaskit/editor-common/types").QuickInsertSharedState | null;
|
|
784
|
+
actions: {
|
|
785
|
+
insertItem: (item: import("@atlaskit/editor-common/provider-factory").QuickInsertItem) => import("../../..").Command;
|
|
786
|
+
};
|
|
787
|
+
commands: {
|
|
788
|
+
search: import("../../../plugins/quick-insert/search").QuickInsertSearch;
|
|
789
|
+
openElementBrowserModal: import("@atlaskit/editor-common/types").EditorCommand;
|
|
790
|
+
};
|
|
759
791
|
}>,
|
|
760
792
|
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"width", {
|
|
761
793
|
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type quickInsertPlugin from '../quick-insert';
|
|
4
5
|
export declare function createPlugin(dispatch: Function, imageEnabled: boolean): SafePlugin<any>;
|
|
5
6
|
declare const helpDialog: NextEditorPlugin<'helpDialog', {
|
|
6
7
|
dependencies: [
|
|
7
|
-
OptionalPlugin<typeof analyticsPlugin
|
|
8
|
+
OptionalPlugin<typeof analyticsPlugin>,
|
|
9
|
+
OptionalPlugin<typeof quickInsertPlugin>
|
|
8
10
|
];
|
|
9
11
|
pluginConfiguration: boolean;
|
|
10
12
|
}>;
|
|
@@ -7,6 +7,7 @@ import type { hyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
|
7
7
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
8
8
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
9
|
import type mentionsPlugin from '../mentions';
|
|
10
|
+
import type quickInsertPlugin from '../quick-insert';
|
|
10
11
|
export type InsertBlockPluginDependencies = [
|
|
11
12
|
typeof featureFlagsPlugin,
|
|
12
13
|
OptionalPlugin<typeof tablesPlugin>,
|
|
@@ -15,5 +16,6 @@ export type InsertBlockPluginDependencies = [
|
|
|
15
16
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
16
17
|
OptionalPlugin<ImageUploadPlugin>,
|
|
17
18
|
OptionalPlugin<typeof mentionsPlugin>,
|
|
18
|
-
OptionalPlugin<EmojiPlugin
|
|
19
|
+
OptionalPlugin<EmojiPlugin>,
|
|
20
|
+
OptionalPlugin<typeof quickInsertPlugin>
|
|
19
21
|
];
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { BlockMenuItem } from './create-items';
|
|
4
4
|
import type { OnInsert } from '../../../../ui/ElementBrowser/types';
|
|
5
|
+
import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { InsertBlockPluginDependencies } from '../../types';
|
|
5
7
|
type SimpleEventHandler<T> = (event?: T) => void;
|
|
6
8
|
export interface BlockInsertElementBrowserProps {
|
|
7
9
|
disabled: boolean;
|
|
@@ -20,6 +22,7 @@ export interface BlockInsertElementBrowserProps {
|
|
|
20
22
|
onKeyDown?: React.KeyboardEventHandler;
|
|
21
23
|
onInsert: OnInsert;
|
|
22
24
|
togglePlusMenuVisibility: SimpleEventHandler<MouseEvent | KeyboardEvent>;
|
|
25
|
+
pluginInjectionApi: PluginInjectionAPIWithDependencies<InsertBlockPluginDependencies> | undefined;
|
|
23
26
|
}
|
|
24
27
|
export declare const BlockInsertElementBrowser: React.FC<BlockInsertElementBrowserProps>;
|
|
25
28
|
export {};
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { OnInsert } from '../../../../ui/ElementBrowser/types';
|
|
4
4
|
import type { BlockMenuItem } from './create-items';
|
|
5
|
+
import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { InsertBlockPluginDependencies } from '../../types';
|
|
5
7
|
export interface BlockInsertMenuProps {
|
|
6
8
|
disabled: boolean;
|
|
7
9
|
editorView: EditorView;
|
|
@@ -23,5 +25,6 @@ export interface BlockInsertMenuProps {
|
|
|
23
25
|
onOpenChange(attrs: any): void;
|
|
24
26
|
togglePlusMenuVisibility(): void;
|
|
25
27
|
onKeyDown?: React.KeyboardEventHandler;
|
|
28
|
+
pluginInjectionApi: PluginInjectionAPIWithDependencies<InsertBlockPluginDependencies> | undefined;
|
|
26
29
|
}
|
|
27
30
|
export declare const BlockInsertMenu: React.FC<BlockInsertMenuProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import type { Command } from '
|
|
3
|
-
export declare const openElementBrowserModal:
|
|
2
|
+
import type { EditorCommand, Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
export declare const openElementBrowserModal: EditorCommand;
|
|
4
4
|
export declare const closeElementBrowserModal: () => Command;
|
|
5
5
|
export declare const insertItem: (item: QuickInsertItem) => Command;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl-next';
|
|
2
1
|
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { NextEditorPlugin } from '../../types';
|
|
4
|
-
import {
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
export type { QuickInsertHandler, QuickInsertPluginOptions };
|
|
8
|
-
export { pluginKey };
|
|
2
|
+
import type { NextEditorPlugin, Command } from '../../types';
|
|
3
|
+
import type { QuickInsertSearch } from './search';
|
|
4
|
+
import type { QuickInsertPluginOptions, QuickInsertSharedState, EditorCommand } from '@atlaskit/editor-common/types';
|
|
5
|
+
export type { QuickInsertPluginOptions };
|
|
9
6
|
declare const quickInsertPlugin: NextEditorPlugin<'quickInsert', {
|
|
10
7
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
8
|
+
sharedState: QuickInsertSharedState | null;
|
|
9
|
+
actions: {
|
|
10
|
+
insertItem: (item: QuickInsertItem) => Command;
|
|
11
|
+
};
|
|
12
|
+
commands: {
|
|
13
|
+
search: QuickInsertSearch;
|
|
14
|
+
openElementBrowserModal: EditorCommand;
|
|
15
|
+
};
|
|
11
16
|
}>;
|
|
12
17
|
export default quickInsertPlugin;
|
|
13
|
-
declare const processItems: (items: Array<QuickInsertHandler | QuickInsertItem>, intl: IntlShape, extendedActions?: Record<string, Function>) => QuickInsertItem[];
|
|
14
|
-
export declare const memoProcessItems: typeof processItems;
|