@atlaskit/editor-plugin-insert-block 18.0.5 → 18.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 +28 -0
- package/dist/cjs/ui/ToolbarInsertBlock/block-insert-element-browser.js +21 -3
- package/dist/cjs/ui/ToolbarInsertBlock/block-insert-menu.js +3 -1
- package/dist/cjs/ui/ToolbarInsertBlock/index.js +3 -1
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertButton.js +122 -0
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenu.compiled.css +11 -0
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenu.js +154 -0
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenuContent.js +53 -0
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenuItem.js +59 -0
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenuList.compiled.css +4 -0
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenuList.js +205 -0
- package/dist/cjs/ui/toolbar-components.js +5 -1
- package/dist/es2019/ui/ToolbarInsertBlock/block-insert-element-browser.js +21 -2
- package/dist/es2019/ui/ToolbarInsertBlock/block-insert-menu.js +3 -1
- package/dist/es2019/ui/ToolbarInsertBlock/index.js +3 -1
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertButton.js +107 -0
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenu.compiled.css +11 -0
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenu.js +117 -0
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenuContent.js +43 -0
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenuItem.js +49 -0
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenuList.compiled.css +4 -0
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenuList.js +161 -0
- package/dist/es2019/ui/toolbar-components.js +5 -1
- package/dist/esm/ui/ToolbarInsertBlock/block-insert-element-browser.js +21 -2
- package/dist/esm/ui/ToolbarInsertBlock/block-insert-menu.js +3 -1
- package/dist/esm/ui/ToolbarInsertBlock/index.js +3 -1
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertButton.js +113 -0
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenu.compiled.css +11 -0
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenu.js +145 -0
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenuContent.js +44 -0
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenuItem.js +51 -0
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenuList.compiled.css +4 -0
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenuList.js +196 -0
- package/dist/esm/ui/toolbar-components.js +5 -1
- package/dist/types/types/index.d.ts +3 -1
- package/dist/types/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -0
- package/dist/types/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -0
- package/dist/types/ui/registered-insert-menu/RegisteredInsertButton.d.ts +12 -0
- package/dist/types/ui/registered-insert-menu/RegisteredInsertMenu.d.ts +12 -0
- package/dist/types/ui/registered-insert-menu/RegisteredInsertMenuContent.d.ts +15 -0
- package/dist/types/ui/registered-insert-menu/RegisteredInsertMenuItem.d.ts +15 -0
- package/dist/types/ui/registered-insert-menu/RegisteredInsertMenuList.d.ts +23 -0
- package/package.json +11 -5
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/* RegisteredInsertMenuList.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
+
import "./RegisteredInsertMenuList.compiled.css";
|
|
6
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
|
+
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; } } }; }
|
|
8
|
+
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; } }
|
|
9
|
+
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; }
|
|
10
|
+
import React, { useCallback, useLayoutEffect, useMemo, useRef } from 'react';
|
|
11
|
+
import { CellMeasurer, CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
|
|
12
|
+
import { List } from 'react-virtualized/dist/commonjs/List';
|
|
13
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
14
|
+
import { RegisteredInsertMenuItem } from './RegisteredInsertMenuItem';
|
|
15
|
+
var ESTIMATED_ROW_HEIGHT = 56;
|
|
16
|
+
var MENU_FOOTER_HEIGHT = 52;
|
|
17
|
+
var MENU_SEARCH_HEIGHT = 64;
|
|
18
|
+
var LIST_WIDTH = 350;
|
|
19
|
+
var listAriaProps = {
|
|
20
|
+
// @ts-expect-error react-virtualized forwards null to omit its grid-only default; its types exclude null.
|
|
21
|
+
'aria-readonly': null
|
|
22
|
+
};
|
|
23
|
+
var styles = {
|
|
24
|
+
footer: "_1rjc1b66 _1i531l7x _15a5nqa1 _uwhke4h9 _1o9zidpf"
|
|
25
|
+
};
|
|
26
|
+
export var RegisteredInsertMenuList = function RegisteredInsertMenuList(_ref) {
|
|
27
|
+
var _model$root$component, _model$root;
|
|
28
|
+
var editorView = _ref.editorView,
|
|
29
|
+
isOffline = _ref.isOffline,
|
|
30
|
+
listId = _ref.listId,
|
|
31
|
+
listLabel = _ref.listLabel,
|
|
32
|
+
maxHeight = _ref.maxHeight,
|
|
33
|
+
menuOpenId = _ref.menuOpenId,
|
|
34
|
+
model = _ref.model,
|
|
35
|
+
onClose = _ref.onClose,
|
|
36
|
+
onItemHover = _ref.onItemHover,
|
|
37
|
+
onRenderedItemsChange = _ref.onRenderedItemsChange,
|
|
38
|
+
selectedItemIndex = _ref.selectedItemIndex,
|
|
39
|
+
surfaceContext = _ref.surfaceContext;
|
|
40
|
+
var Root = (_model$root$component = (_model$root = model.root) === null || _model$root === void 0 ? void 0 : _model$root.component) !== null && _model$root$component !== void 0 ? _model$root$component : React.Fragment;
|
|
41
|
+
var listRef = useRef(null);
|
|
42
|
+
var rows = useMemo(function () {
|
|
43
|
+
return model.sections.flat();
|
|
44
|
+
}, [model.sections]);
|
|
45
|
+
var cache = useMemo(function () {
|
|
46
|
+
return new CellMeasurerCache({
|
|
47
|
+
defaultHeight: ESTIMATED_ROW_HEIGHT,
|
|
48
|
+
fixedWidth: true
|
|
49
|
+
});
|
|
50
|
+
}, []);
|
|
51
|
+
var itemIndexByRowIndex = useMemo(function () {
|
|
52
|
+
var indexes = new Map();
|
|
53
|
+
var itemIndex = 0;
|
|
54
|
+
rows.forEach(function (registration, rowIndex) {
|
|
55
|
+
if (registration.type === 'menu-item') {
|
|
56
|
+
indexes.set(rowIndex, itemIndex++);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return indexes;
|
|
60
|
+
}, [rows]);
|
|
61
|
+
var selectedRowIndex = useMemo(function () {
|
|
62
|
+
var _iterator = _createForOfIteratorHelper(itemIndexByRowIndex),
|
|
63
|
+
_step;
|
|
64
|
+
try {
|
|
65
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
66
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
67
|
+
rowIndex = _step$value[0],
|
|
68
|
+
itemIndex = _step$value[1];
|
|
69
|
+
if (itemIndex === selectedItemIndex) {
|
|
70
|
+
return rowIndex;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
} catch (err) {
|
|
74
|
+
_iterator.e(err);
|
|
75
|
+
} finally {
|
|
76
|
+
_iterator.f();
|
|
77
|
+
}
|
|
78
|
+
return -1;
|
|
79
|
+
}, [itemIndexByRowIndex, selectedItemIndex]);
|
|
80
|
+
var rowKeySignature = useMemo(function () {
|
|
81
|
+
return rows.map(function (_ref2) {
|
|
82
|
+
var key = _ref2.key,
|
|
83
|
+
type = _ref2.type;
|
|
84
|
+
return "".concat(type, ":").concat(key);
|
|
85
|
+
}).join('\0');
|
|
86
|
+
}, [rows]);
|
|
87
|
+
useLayoutEffect(function () {
|
|
88
|
+
var _listRef$current, _listRef$current2;
|
|
89
|
+
cache.clearAll();
|
|
90
|
+
(_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.recomputeRowHeights();
|
|
91
|
+
(_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 || _listRef$current2.scrollToPosition(0);
|
|
92
|
+
}, [cache, rowKeySignature]);
|
|
93
|
+
var onRowsRendered = useCallback(function (_ref3) {
|
|
94
|
+
var _indexes$, _indexes;
|
|
95
|
+
var overscanStartIndex = _ref3.overscanStartIndex,
|
|
96
|
+
overscanStopIndex = _ref3.overscanStopIndex;
|
|
97
|
+
var indexes = _toConsumableArray(itemIndexByRowIndex).filter(function (_ref4) {
|
|
98
|
+
var _ref5 = _slicedToArray(_ref4, 1),
|
|
99
|
+
rowIndex = _ref5[0];
|
|
100
|
+
return rowIndex >= overscanStartIndex && rowIndex <= overscanStopIndex;
|
|
101
|
+
}).map(function (_ref6) {
|
|
102
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
103
|
+
itemIndex = _ref7[1];
|
|
104
|
+
return itemIndex;
|
|
105
|
+
});
|
|
106
|
+
onRenderedItemsChange({
|
|
107
|
+
startIndex: (_indexes$ = indexes[0]) !== null && _indexes$ !== void 0 ? _indexes$ : -1,
|
|
108
|
+
stopIndex: (_indexes = indexes[indexes.length - 1]) !== null && _indexes !== void 0 ? _indexes : -1
|
|
109
|
+
});
|
|
110
|
+
}, [itemIndexByRowIndex, onRenderedItemsChange]);
|
|
111
|
+
var renderRow = useCallback(function (_ref8) {
|
|
112
|
+
var _registration$compone;
|
|
113
|
+
var index = _ref8.index,
|
|
114
|
+
key = _ref8.key,
|
|
115
|
+
parent = _ref8.parent,
|
|
116
|
+
style = _ref8.style;
|
|
117
|
+
var registration = rows[index];
|
|
118
|
+
if (!registration) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
var itemIndex = itemIndexByRowIndex.get(index);
|
|
122
|
+
var rowContent = registration.type === 'menu-section' ? ( /*#__PURE__*/React.createElement((_registration$compone = registration.component) !== null && _registration$compone !== void 0 ? _registration$compone : React.Fragment, null, null)) : /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
onMouseMove: function onMouseMove() {
|
|
124
|
+
return onItemHover(itemIndex !== null && itemIndex !== void 0 ? itemIndex : 0);
|
|
125
|
+
}
|
|
126
|
+
}, /*#__PURE__*/React.createElement(RegisteredInsertMenuItem, {
|
|
127
|
+
editorView: editorView,
|
|
128
|
+
id: "".concat(listId, "-").concat(itemIndex),
|
|
129
|
+
isOffline: isOffline,
|
|
130
|
+
isSelected: itemIndex === selectedItemIndex,
|
|
131
|
+
menuOpenId: menuOpenId,
|
|
132
|
+
onClose: onClose,
|
|
133
|
+
registration: registration,
|
|
134
|
+
surfaceContext: surfaceContext
|
|
135
|
+
}));
|
|
136
|
+
return /*#__PURE__*/React.createElement(CellMeasurer, {
|
|
137
|
+
key: key,
|
|
138
|
+
cache: cache,
|
|
139
|
+
parent: parent,
|
|
140
|
+
columnIndex: 0,
|
|
141
|
+
rowIndex: index
|
|
142
|
+
}, function (_ref9) {
|
|
143
|
+
var registerChild = _ref9.registerChild;
|
|
144
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
145
|
+
ref: function ref(element) {
|
|
146
|
+
return registerChild === null || registerChild === void 0 ? void 0 : registerChild(element !== null && element !== void 0 ? element : undefined);
|
|
147
|
+
},
|
|
148
|
+
"data-index": index
|
|
149
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
150
|
+
,
|
|
151
|
+
style: style
|
|
152
|
+
}, rowContent);
|
|
153
|
+
});
|
|
154
|
+
}, [cache, editorView, isOffline, itemIndexByRowIndex, listId, menuOpenId, onClose, onItemHover, rows, selectedItemIndex, surfaceContext]);
|
|
155
|
+
var footerItemIndex = itemIndexByRowIndex.size;
|
|
156
|
+
var listMaxHeight = Math.max(0, maxHeight - MENU_SEARCH_HEIGHT - (model.footer ? MENU_FOOTER_HEIGHT : 0));
|
|
157
|
+
var onFooterItemHover = useCallback(function () {
|
|
158
|
+
return onItemHover(footerItemIndex);
|
|
159
|
+
}, [footerItemIndex, onItemHover]);
|
|
160
|
+
if (!model.root) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
return /*#__PURE__*/React.createElement(Root, null, /*#__PURE__*/React.createElement(Box, {
|
|
164
|
+
"aria-label": listLabel,
|
|
165
|
+
id: listId,
|
|
166
|
+
role: "listbox"
|
|
167
|
+
}, rows.length > 0 && /*#__PURE__*/React.createElement(List
|
|
168
|
+
// eslint-disable-next-line react/jsx-props-no-spreading -- Omits the library's grid-only ARIA default without declaring it on the group role.
|
|
169
|
+
, _extends({}, listAriaProps, {
|
|
170
|
+
tabIndex: null,
|
|
171
|
+
containerRole: "presentation",
|
|
172
|
+
height: Math.min(rows.length * ESTIMATED_ROW_HEIGHT, listMaxHeight),
|
|
173
|
+
overscanRowCount: 3,
|
|
174
|
+
onRowsRendered: onRowsRendered,
|
|
175
|
+
ref: listRef,
|
|
176
|
+
role: "group",
|
|
177
|
+
rowCount: rows.length,
|
|
178
|
+
rowHeight: cache.rowHeight,
|
|
179
|
+
rowRenderer: renderRow,
|
|
180
|
+
scrollToAlignment: "auto",
|
|
181
|
+
scrollToIndex: selectedRowIndex,
|
|
182
|
+
width: LIST_WIDTH
|
|
183
|
+
})), model.footer && /*#__PURE__*/React.createElement(Box, {
|
|
184
|
+
xcss: styles.footer,
|
|
185
|
+
onMouseMove: onFooterItemHover
|
|
186
|
+
}, /*#__PURE__*/React.createElement(RegisteredInsertMenuItem, {
|
|
187
|
+
editorView: editorView,
|
|
188
|
+
id: "".concat(listId, "-").concat(footerItemIndex),
|
|
189
|
+
isOffline: isOffline,
|
|
190
|
+
isSelected: footerItemIndex === selectedItemIndex,
|
|
191
|
+
menuOpenId: menuOpenId,
|
|
192
|
+
onClose: onClose,
|
|
193
|
+
registration: model.footer,
|
|
194
|
+
surfaceContext: surfaceContext
|
|
195
|
+
}))));
|
|
196
|
+
};
|
|
@@ -6,6 +6,8 @@ import { resolveToolbarConfig } from './toolbar-components/config-resolver';
|
|
|
6
6
|
import { EmojiButton } from './toolbar-components/EmojiButton';
|
|
7
7
|
import { ImageButton } from './toolbar-components/ImageButton';
|
|
8
8
|
import { InsertButton } from './toolbar-components/InsertButton';
|
|
9
|
+
import { RegisteredInsertButton } from './registered-insert-menu/RegisteredInsertButton';
|
|
10
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
11
|
import { LayoutButton } from './toolbar-components/LayoutButton';
|
|
10
12
|
import { MediaButton } from './toolbar-components/MediaButton';
|
|
11
13
|
import { MentionButton } from './toolbar-components/MentionButton';
|
|
@@ -256,7 +258,9 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
256
258
|
if ((_config$insert = config.insert) !== null && _config$insert !== void 0 && _config$insert.enabled) {
|
|
257
259
|
var createInsertButtonComponent = function createInsertButtonComponent(breakpoint) {
|
|
258
260
|
return function () {
|
|
259
|
-
return /*#__PURE__*/React.createElement(
|
|
261
|
+
return isExperimentEnabled('platform_editor_slash_command') ? /*#__PURE__*/React.createElement(RegisteredInsertButton, {
|
|
262
|
+
api: api
|
|
263
|
+
}) : /*#__PURE__*/React.createElement(InsertButton, {
|
|
260
264
|
api: api,
|
|
261
265
|
breakpoint: breakpoint,
|
|
262
266
|
toolbarConfig: config,
|
|
@@ -27,6 +27,7 @@ import type { TablePlugin } from '@atlaskit/editor-plugin-table';
|
|
|
27
27
|
import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
|
|
28
28
|
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
29
29
|
import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
30
|
+
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry/ui-control-registry-plugin-type';
|
|
30
31
|
export type InsertBlockPluginDependencies = [
|
|
31
32
|
TypeAheadPlugin,
|
|
32
33
|
OptionalPlugin<TablePlugin>,
|
|
@@ -54,7 +55,8 @@ export type InsertBlockPluginDependencies = [
|
|
|
54
55
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
55
56
|
OptionalPlugin<ContextPanelPlugin>,
|
|
56
57
|
OptionalPlugin<ConnectivityPlugin>,
|
|
57
|
-
OptionalPlugin<ToolbarPlugin
|
|
58
|
+
OptionalPlugin<ToolbarPlugin>,
|
|
59
|
+
OptionalPlugin<UiControlRegistryPlugin>
|
|
58
60
|
];
|
|
59
61
|
type PluginToolbarComponentsConfig<T extends string> = {
|
|
60
62
|
[componentName in T]?: PluginToolbarComponentConfig;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { InsertBlockPlugin } from '../../insertBlockPluginType';
|
|
4
|
+
type Props = {
|
|
5
|
+
api?: ExtractInjectionAPI<InsertBlockPlugin>;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The toolbar owns its popup lifecycle, but renders the same registered items
|
|
9
|
+
* and menu model as slash command.
|
|
10
|
+
*/
|
|
11
|
+
export declare const RegisteredInsertButton: ({ api }: Props) => React.JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RegisterComponent } from '@atlaskit/editor-ui-control-model/types';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
type Props = {
|
|
5
|
+
components: RegisterComponent[];
|
|
6
|
+
editorView: EditorView;
|
|
7
|
+
isOffline: boolean;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onSelect: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const RegisteredInsertMenu: ({ components, editorView, isOffline, onClose, onSelect, }: Props) => React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { InsertBlockPlugin } from '../../insertBlockPluginType';
|
|
5
|
+
type Props = {
|
|
6
|
+
api?: ExtractInjectionAPI<InsertBlockPlugin>;
|
|
7
|
+
editorView: EditorView;
|
|
8
|
+
isOffline: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onDismiss: () => void;
|
|
11
|
+
onSelect: () => void;
|
|
12
|
+
target?: HTMLElement | null;
|
|
13
|
+
};
|
|
14
|
+
export declare const RegisteredInsertMenuContent: ({ api, editorView, isOffline, onClose, onDismiss, onSelect, target, }: Props) => React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SurfaceContext, RegisterMenuItem } from '@atlaskit/editor-ui-control-model/types';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
type Props = {
|
|
5
|
+
editorView: EditorView;
|
|
6
|
+
id: string;
|
|
7
|
+
isOffline: boolean;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
menuOpenId: symbol;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
registration: RegisterMenuItem;
|
|
12
|
+
surfaceContext: SurfaceContext;
|
|
13
|
+
};
|
|
14
|
+
export declare const RegisteredInsertMenuItem: ({ editorView, id, isOffline, isSelected, menuOpenId, onClose, registration, surfaceContext, }: Props) => React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuickInsertMenuModel } from '@atlaskit/editor-common/quick-insert/registered-menu-model';
|
|
3
|
+
import type { SurfaceContext } from '@atlaskit/editor-ui-control-model/types';
|
|
4
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
type Props = {
|
|
6
|
+
editorView: EditorView;
|
|
7
|
+
isOffline: boolean;
|
|
8
|
+
listId: string;
|
|
9
|
+
listLabel: string;
|
|
10
|
+
maxHeight: number;
|
|
11
|
+
menuOpenId: symbol;
|
|
12
|
+
model: QuickInsertMenuModel;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
onItemHover: (index: number) => void;
|
|
15
|
+
onRenderedItemsChange: (range: {
|
|
16
|
+
startIndex: number;
|
|
17
|
+
stopIndex: number;
|
|
18
|
+
}) => void;
|
|
19
|
+
selectedItemIndex: number;
|
|
20
|
+
surfaceContext: SurfaceContext;
|
|
21
|
+
};
|
|
22
|
+
export declare const RegisteredInsertMenuList: ({ editorView, isOffline, listId, listLabel, maxHeight, menuOpenId, model, onClose, onItemHover, onRenderedItemsChange, selectedItemIndex, surfaceContext, }: Props) => React.JSX.Element | null;
|
|
23
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "18.0
|
|
3
|
+
"version": "18.1.0",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"atlaskit:src": "src/index.ts",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@atlaskit/browser-apis": "^1.2.0",
|
|
25
|
+
"@atlaskit/css": "^1.1.0",
|
|
25
26
|
"@atlaskit/editor-plugin-analytics": "^17.0.0",
|
|
26
27
|
"@atlaskit/editor-plugin-block-type": "^21.0.0",
|
|
27
28
|
"@atlaskit/editor-plugin-code-block": "^19.0.0",
|
|
@@ -48,16 +49,21 @@
|
|
|
48
49
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^20.0.0",
|
|
49
50
|
"@atlaskit/editor-plugin-toolbar": "^14.0.0",
|
|
50
51
|
"@atlaskit/editor-plugin-type-ahead": "^18.0.0",
|
|
52
|
+
"@atlaskit/editor-plugin-ui-control-registry": "^11.0.0",
|
|
51
53
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
52
|
-
"@atlaskit/editor-shared-styles": "^4.
|
|
54
|
+
"@atlaskit/editor-shared-styles": "^4.2.0",
|
|
53
55
|
"@atlaskit/editor-toolbar": "^2.6.0",
|
|
54
56
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
57
|
+
"@atlaskit/editor-ui-control-model": "^2.9.0",
|
|
55
58
|
"@atlaskit/emoji": "^72.3.0",
|
|
56
59
|
"@atlaskit/icon": "^37.6.0",
|
|
57
60
|
"@atlaskit/icon-lab": "^7.8.0",
|
|
61
|
+
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
58
62
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
59
|
-
"@atlaskit/
|
|
60
|
-
"@atlaskit/
|
|
63
|
+
"@atlaskit/primitives": "^22.5.0",
|
|
64
|
+
"@atlaskit/textfield": "^10.2.0",
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^186.0.0",
|
|
66
|
+
"@atlaskit/tokens": "^16.12.0",
|
|
61
67
|
"@babel/runtime": "^7.0.0",
|
|
62
68
|
"@emotion/react": "^11.7.1",
|
|
63
69
|
"bind-event-listener": "^3.0.0",
|
|
@@ -66,7 +72,7 @@
|
|
|
66
72
|
"react-virtualized": "^9.22.6"
|
|
67
73
|
},
|
|
68
74
|
"peerDependencies": {
|
|
69
|
-
"@atlaskit/editor-common": "^121.
|
|
75
|
+
"@atlaskit/editor-common": "^121.4.0",
|
|
70
76
|
"react": "^18.2.0 || ^19.2.0",
|
|
71
77
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
72
78
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|