@atlaskit/editor-plugin-floating-toolbar 0.6.1 → 0.6.3
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 +12 -0
- package/dist/cjs/plugin.js +5 -8
- package/dist/cjs/pm-plugins/force-focus/index.js +3 -6
- package/dist/cjs/pm-plugins/toolbar-data/commands.js +3 -5
- package/dist/cjs/pm-plugins/toolbar-data/plugin-factory.js +3 -6
- package/dist/cjs/pm-plugins/toolbar-data/plugin-key.js +1 -2
- package/dist/cjs/pm-plugins/toolbar-data/plugin.js +2 -3
- package/dist/cjs/pm-plugins/toolbar-data/reducer.js +2 -3
- package/dist/cjs/ui/CheckboxModal.js +3 -4
- package/dist/cjs/ui/ConfirmationModal.js +1 -2
- package/dist/cjs/ui/Dropdown.js +3 -4
- package/dist/cjs/ui/DropdownMenu.js +9 -11
- package/dist/cjs/ui/EmojiPickerButton.js +4 -5
- package/dist/cjs/ui/ExtensionsPlaceholder.js +2 -3
- package/dist/cjs/ui/Input.js +2 -3
- package/dist/cjs/ui/ScrollButtons.js +7 -8
- package/dist/cjs/ui/Select.js +2 -2
- package/dist/cjs/ui/Separator.js +1 -2
- package/dist/cjs/ui/SimpleModal.js +2 -3
- package/dist/cjs/ui/Toolbar.js +6 -7
- package/dist/cjs/ui/ToolbarLoader.js +2 -3
- package/dist/cjs/ui/messages.js +2 -3
- package/dist/cjs/ui/styles.js +3 -5
- package/dist/esm/plugin.js +2 -2
- package/dist/esm/ui/CheckboxModal.js +1 -1
- package/dist/esm/ui/Dropdown.js +1 -1
- package/dist/esm/ui/DropdownMenu.js +5 -5
- package/dist/esm/ui/EmojiPickerButton.js +2 -2
- package/dist/esm/ui/ScrollButtons.js +5 -5
- package/dist/esm/ui/Select.js +2 -2
- package/dist/esm/ui/Toolbar.js +5 -5
- package/package.json +5 -5
- package/dist/types-ts4.5/index.d.ts +0 -2
- package/dist/types-ts4.5/plugin.d.ts +0 -12
- package/dist/types-ts4.5/pm-plugins/force-focus/index.d.ts +0 -21
- package/dist/types-ts4.5/pm-plugins/toolbar-data/commands.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/toolbar-data/plugin-factory.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/toolbar-data/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/toolbar-data/plugin.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/toolbar-data/reducer.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/toolbar-data/types.d.ts +0 -8
- package/dist/types-ts4.5/types.d.ts +0 -42
- package/dist/types-ts4.5/ui/CheckboxModal.d.ts +0 -4
- package/dist/types-ts4.5/ui/ConfirmationModal.d.ts +0 -6
- package/dist/types-ts4.5/ui/Dropdown.d.ts +0 -41
- package/dist/types-ts4.5/ui/DropdownMenu.d.ts +0 -29
- package/dist/types-ts4.5/ui/EditorEmojiAddIcon.d.ts +0 -2
- package/dist/types-ts4.5/ui/EmojiPickerButton.d.ts +0 -16
- package/dist/types-ts4.5/ui/ExtensionsPlaceholder.d.ts +0 -16
- package/dist/types-ts4.5/ui/Input.d.ts +0 -23
- package/dist/types-ts4.5/ui/ScrollButtons.d.ts +0 -13
- package/dist/types-ts4.5/ui/Select.d.ts +0 -21
- package/dist/types-ts4.5/ui/Separator.d.ts +0 -2
- package/dist/types-ts4.5/ui/SimpleModal.d.ts +0 -4
- package/dist/types-ts4.5/ui/Toolbar.d.ts +0 -44
- package/dist/types-ts4.5/ui/ToolbarLoader.d.ts +0 -4
- package/dist/types-ts4.5/ui/messages.d.ts +0 -48
- package/dist/types-ts4.5/ui/styles.d.ts +0 -20
- package/dist/types-ts4.5/utils.d.ts +0 -2
- package/tmp/api-report-tmp.d.ts +0 -64
package/dist/esm/ui/Dropdown.js
CHANGED
|
@@ -88,7 +88,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
88
88
|
var _document$querySelect;
|
|
89
89
|
// Focus the trigger button only on Escape
|
|
90
90
|
// Focus is done before hiding to ensure onBlur is called
|
|
91
|
-
(_document$querySelect = document.querySelector("[data-testid=".concat(_this.props.buttonTestId, "]"))) === null || _document$querySelect === void 0
|
|
91
|
+
(_document$querySelect = document.querySelector("[data-testid=".concat(_this.props.buttonTestId, "]"))) === null || _document$querySelect === void 0 || _document$querySelect.focus();
|
|
92
92
|
_this.hide();
|
|
93
93
|
});
|
|
94
94
|
_defineProperty(_assertThisInitialized(_this), "onOpenChanged", function (openChangedEvent) {
|
|
@@ -105,7 +105,7 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
105
105
|
dispatchCommand(item.onClick);
|
|
106
106
|
hide();
|
|
107
107
|
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
108
|
-
editorView === null || editorView === void 0
|
|
108
|
+
editorView === null || editorView === void 0 || editorView.focus();
|
|
109
109
|
}
|
|
110
110
|
}, [dispatchCommand, item.onClick, hide, editorView]);
|
|
111
111
|
|
|
@@ -120,14 +120,14 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
120
120
|
useEffect(function () {
|
|
121
121
|
var labelRefCurrent = labelRef.current;
|
|
122
122
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
123
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
123
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.addEventListener('click', handleTitleWrapperMouseEvent);
|
|
124
124
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
125
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
125
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.addEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
126
126
|
return function () {
|
|
127
127
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
128
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
128
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.removeEventListener('click', handleTitleWrapperMouseEvent);
|
|
129
129
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
130
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
130
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.removeEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
131
131
|
};
|
|
132
132
|
});
|
|
133
133
|
var itemContent = jsx(DropdownButtonItem, {
|
|
@@ -36,7 +36,7 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
36
36
|
props.onChange && props.onChange(emoji);
|
|
37
37
|
requestAnimationFrame(function () {
|
|
38
38
|
var _props$editorView;
|
|
39
|
-
(_props$editorView = props.editorView) === null || _props$editorView === void 0
|
|
39
|
+
(_props$editorView = props.editorView) === null || _props$editorView === void 0 || _props$editorView.focus();
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
var isDetachedElement = function isDetachedElement(el) {
|
|
@@ -54,7 +54,7 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
54
54
|
var handleEmojiPressEscape = function handleEmojiPressEscape() {
|
|
55
55
|
var _buttonRef$current;
|
|
56
56
|
setIsPopupOpen(false);
|
|
57
|
-
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0
|
|
57
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
58
58
|
};
|
|
59
59
|
var renderPicker = function renderPicker(providers) {
|
|
60
60
|
if (!providers.emojiProvider) {
|
|
@@ -58,7 +58,7 @@ export var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
58
58
|
|
|
59
59
|
// scroll to current position - scroll container width
|
|
60
60
|
var scrollTo = scrollLeft - scrollContainerWidth;
|
|
61
|
-
(_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0
|
|
61
|
+
(_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0 || _scrollContainerRef$c4.scrollTo({
|
|
62
62
|
top: 0,
|
|
63
63
|
left: scrollTo,
|
|
64
64
|
behavior: 'smooth'
|
|
@@ -73,16 +73,16 @@ export var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
73
73
|
|
|
74
74
|
// scroll to current position + scroll container width
|
|
75
75
|
var scrollTo = scrollLeft + scrollContainerWidth;
|
|
76
|
-
(_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0
|
|
76
|
+
(_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0 || _scrollContainerRef$c7.scrollTo({
|
|
77
77
|
top: 0,
|
|
78
78
|
left: scrollTo,
|
|
79
79
|
behavior: 'smooth'
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
var resizeObserver = new ResizeObserver(function (t) {
|
|
83
|
-
var _scrollContainerRef$c8, _scrollContainerRef$c9
|
|
83
|
+
var _scrollContainerRef$c8, _scrollContainerRef$c9;
|
|
84
84
|
var widthNeededToShowAllItems = ((_scrollContainerRef$c8 = scrollContainerRef.current) === null || _scrollContainerRef$c8 === void 0 ? void 0 : _scrollContainerRef$c8.scrollWidth) || 0;
|
|
85
|
-
var availableSpace = (_scrollContainerRef$c9 = scrollContainerRef.current) === null || _scrollContainerRef$c9 === void 0
|
|
85
|
+
var availableSpace = (_scrollContainerRef$c9 = scrollContainerRef.current) === null || _scrollContainerRef$c9 === void 0 || (_scrollContainerRef$c9 = _scrollContainerRef$c9.parentNode) === null || _scrollContainerRef$c9 === void 0 ? void 0 : _scrollContainerRef$c9.offsetWidth;
|
|
86
86
|
if (availableSpace >= widthNeededToShowAllItems) {
|
|
87
87
|
setNeedScroll(false);
|
|
88
88
|
} else {
|
|
@@ -117,7 +117,7 @@ export var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
117
117
|
var _scrollContainerRefCu;
|
|
118
118
|
// reset scroll position when switching from one node with toolbar to another
|
|
119
119
|
// scroll to made optional as it may not be rendered in testing env
|
|
120
|
-
(_scrollContainerRefCu = scrollContainerRefCurrent.scrollTo) === null || _scrollContainerRefCu === void 0
|
|
120
|
+
(_scrollContainerRefCu = scrollContainerRefCurrent.scrollTo) === null || _scrollContainerRefCu === void 0 || _scrollContainerRefCu.call(scrollContainerRefCurrent, {
|
|
121
121
|
left: 0
|
|
122
122
|
});
|
|
123
123
|
}
|
package/dist/esm/ui/Select.js
CHANGED
|
@@ -15,13 +15,13 @@ export default function Search(props) {
|
|
|
15
15
|
});
|
|
16
16
|
},
|
|
17
17
|
menuPortal: function menuPortal(base) {
|
|
18
|
-
var _selectRef$current, _selectRef$
|
|
18
|
+
var _selectRef$current, _selectRef$current2;
|
|
19
19
|
// ED:16095: We add two possible getter paths for safely reaching into the underlying
|
|
20
20
|
// react-select element. We first try a getter that conforms with react-select v5 APIs,
|
|
21
21
|
// Failing that, we try a getter consistent with react-select v4 APIs. (We
|
|
22
22
|
// handle both as consumers may control the time of the actual dependency version
|
|
23
23
|
// cutover).
|
|
24
|
-
var controlWrapper = (selectRef === null || selectRef === void 0
|
|
24
|
+
var controlWrapper = (selectRef === null || selectRef === void 0 || (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 || (_selectRef$current = _selectRef$current.select) === null || _selectRef$current === void 0 || (_selectRef$current = _selectRef$current.controlRef) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.parentNode) || (selectRef === null || selectRef === void 0 || (_selectRef$current2 = selectRef.current) === null || _selectRef$current2 === void 0 || (_selectRef$current2 = _selectRef$current2.select) === null || _selectRef$current2 === void 0 || (_selectRef$current2 = _selectRef$current2.select) === null || _selectRef$current2 === void 0 || (_selectRef$current2 = _selectRef$current2.controlRef) === null || _selectRef$current2 === void 0 ? void 0 : _selectRef$current2.parentNode);
|
|
25
25
|
var menuPortalStyles = controlWrapper && props.setDisableParentScroll ? {
|
|
26
26
|
// since the portal is now outside, we need to position it as before
|
|
27
27
|
top: controlWrapper.offsetTop,
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -67,7 +67,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
67
67
|
} else {
|
|
68
68
|
dispatchCommand(item.onClick);
|
|
69
69
|
if (item.focusEditoronEnter && !(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
70
|
-
editorView === null || editorView === void 0
|
|
70
|
+
editorView === null || editorView === void 0 || editorView.focus();
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
};
|
|
@@ -222,8 +222,8 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
222
222
|
editorView: editorView,
|
|
223
223
|
extensionProvider: extensionsProvider,
|
|
224
224
|
separator: item.separator,
|
|
225
|
-
applyChangeToContextPanel: api === null || api === void 0
|
|
226
|
-
extensionApi: api === null || api === void 0
|
|
225
|
+
applyChangeToContextPanel: api === null || api === void 0 || (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange,
|
|
226
|
+
extensionApi: api === null || api === void 0 || (_api$extension = api.extension) === null || _api$extension === void 0 ? void 0 : _api$extension.actions.api()
|
|
227
227
|
});
|
|
228
228
|
case 'separator':
|
|
229
229
|
return jsx(Separator, {
|
|
@@ -279,7 +279,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
279
279
|
if (isDropdownOpen || isSelectMenuOpen) {
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
|
-
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0
|
|
282
|
+
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 || _this$props$editorVie.focus();
|
|
283
283
|
event.preventDefault();
|
|
284
284
|
event.stopPropagation();
|
|
285
285
|
});
|
|
@@ -306,7 +306,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
306
306
|
if (table) {
|
|
307
307
|
return clearHoverSelection()(state, dispatch);
|
|
308
308
|
}
|
|
309
|
-
(_this$props$api = this.props.api) === null || _this$props$api === void 0
|
|
309
|
+
(_this$props$api = this.props.api) === null || _this$props$api === void 0 || _this$props$api.decorations.actions.removeDecoration(state, dispatch);
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
27
27
|
"@atlaskit/button": "^16.10.0",
|
|
28
28
|
"@atlaskit/checkbox": "^12.6.0",
|
|
29
|
-
"@atlaskit/editor-common": "^76.
|
|
29
|
+
"@atlaskit/editor-common": "^76.8.0",
|
|
30
30
|
"@atlaskit/editor-palette": "1.5.1",
|
|
31
31
|
"@atlaskit/editor-plugin-context-panel": "^0.2.0",
|
|
32
|
-
"@atlaskit/editor-plugin-copy-button": "^0.
|
|
32
|
+
"@atlaskit/editor-plugin-copy-button": "^1.0.0",
|
|
33
33
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
34
34
|
"@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
|
|
35
35
|
"@atlaskit/editor-plugin-extension": "^0.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
37
|
-
"@atlaskit/editor-plugin-table": "^
|
|
37
|
+
"@atlaskit/editor-plugin-table": "^5.0.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
39
39
|
"@atlaskit/emoji": "^67.5.0",
|
|
40
40
|
"@atlaskit/icon": "^21.12.0",
|
|
41
41
|
"@atlaskit/menu": "^1.11.0",
|
|
42
|
-
"@atlaskit/modal-dialog": "^12.
|
|
42
|
+
"@atlaskit/modal-dialog": "^12.8.0",
|
|
43
43
|
"@atlaskit/select": "^16.7.0",
|
|
44
44
|
"@atlaskit/theme": "^12.6.0",
|
|
45
45
|
"@atlaskit/tokens": "^1.25.0",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { ConfigWithNodeInfo, FloatingToolbarPlugin, FloatingToolbarPluginState } from './types';
|
|
5
|
-
export declare const getRelevantConfig: (selection: Selection, configs: Array<FloatingToolbarConfig>) => ConfigWithNodeInfo | undefined;
|
|
6
|
-
export declare const floatingToolbarPlugin: FloatingToolbarPlugin;
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* ProseMirror Plugin
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export declare const pluginKey: PluginKey<FloatingToolbarPluginState>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
export declare const forceFocusStateKey: PluginKey<any>;
|
|
6
|
-
/**
|
|
7
|
-
* Used in cases where a floating toolbar button opens a submenu which destroys
|
|
8
|
-
* the button, but the user has pressed ESC to close the submenu and focus needs
|
|
9
|
-
* to move back to the button. */
|
|
10
|
-
declare const _default: () => SafePlugin<{
|
|
11
|
-
selector: null;
|
|
12
|
-
}>;
|
|
13
|
-
export default _default;
|
|
14
|
-
/**
|
|
15
|
-
* The provided selector should be the floating toolbar button that needs focus.
|
|
16
|
-
*/
|
|
17
|
-
export declare const forceFocusSelector: (selector: string | null) => (tr: Transaction) => Transaction;
|
|
18
|
-
/**
|
|
19
|
-
* If a selector is set and the element exists, focus it.
|
|
20
|
-
*/
|
|
21
|
-
export declare function checkShouldForceFocusAndApply(view?: EditorView): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("../..").FloatingToolbarPluginData | ((state: import("prosemirror-state").EditorState) => import("../..").FloatingToolbarPluginData)) => import("prosemirror-state").SafeStateField<import("../..").FloatingToolbarPluginData>, createCommand: <A = import("./types").FloatingToolbarPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../..").FloatingToolbarPluginData;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { FloatingToolbarConfig, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
3
|
-
import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
|
|
4
|
-
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
-
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
6
|
-
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
7
|
-
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
8
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
9
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
10
|
-
export type ConfigWithNodeInfo = {
|
|
11
|
-
config: FloatingToolbarConfig | undefined;
|
|
12
|
-
pos: number;
|
|
13
|
-
node: Node;
|
|
14
|
-
};
|
|
15
|
-
export type FloatingToolbarPluginState = {
|
|
16
|
-
getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
|
|
17
|
-
};
|
|
18
|
-
export type FloatingToolbarPluginData = {
|
|
19
|
-
confirmDialogForItem?: number;
|
|
20
|
-
};
|
|
21
|
-
export type ForceFocusSelector = (selector: string | null) => (tr: Transaction) => Transaction;
|
|
22
|
-
/**
|
|
23
|
-
* Floating toolbar plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
24
|
-
* from `@atlaskit/editor-core`.
|
|
25
|
-
*/
|
|
26
|
-
export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
27
|
-
dependencies: [
|
|
28
|
-
FeatureFlagsPlugin,
|
|
29
|
-
DecorationsPlugin,
|
|
30
|
-
OptionalPlugin<ContextPanelPlugin>,
|
|
31
|
-
OptionalPlugin<ExtensionPlugin>,
|
|
32
|
-
CopyButtonPlugin,
|
|
33
|
-
EditorDisabledPlugin
|
|
34
|
-
];
|
|
35
|
-
actions: {
|
|
36
|
-
forceFocusSelector: ForceFocusSelector;
|
|
37
|
-
};
|
|
38
|
-
sharedState: {
|
|
39
|
-
configWithNodeInfo: ConfigWithNodeInfo | undefined;
|
|
40
|
-
floatingToolbarData: FloatingToolbarPluginData | undefined;
|
|
41
|
-
} | undefined;
|
|
42
|
-
}>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
-
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types';
|
|
4
|
-
export declare const CheckboxModal: (props: ConfirmationDialogProps & WrappedComponentProps) => JSX.Element;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
-
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types';
|
|
4
|
-
export declare const ConfirmationModal: React.FC<import("react-intl-next").WithIntlProps<ConfirmationDialogProps & WrappedComponentProps<"intl">>> & {
|
|
5
|
-
WrappedComponent: React.ComponentType<ConfirmationDialogProps & WrappedComponentProps<"intl">>;
|
|
6
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import type { ReactElement } from 'react';
|
|
3
|
-
import React, { Component } from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
5
|
-
import type { DropdownOptions } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
export interface Props {
|
|
8
|
-
title: string;
|
|
9
|
-
icon?: ReactElement<any>;
|
|
10
|
-
hideExpandIcon?: boolean;
|
|
11
|
-
options: DropdownOptions<Function>;
|
|
12
|
-
dispatchCommand: (command: Function) => void;
|
|
13
|
-
mountPoint?: HTMLElement;
|
|
14
|
-
boundariesElement?: HTMLElement;
|
|
15
|
-
scrollableElement?: HTMLElement;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
tooltip?: string;
|
|
18
|
-
buttonTestId?: string;
|
|
19
|
-
dropdownWidth?: number;
|
|
20
|
-
showSelected?: boolean;
|
|
21
|
-
setDisableParentScroll?: (disable: boolean) => void;
|
|
22
|
-
editorView?: EditorView;
|
|
23
|
-
dropdownListId?: string;
|
|
24
|
-
alignDropdownWithToolbar?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface State {
|
|
27
|
-
isOpen: boolean;
|
|
28
|
-
isOpenedByKeyboard: boolean;
|
|
29
|
-
}
|
|
30
|
-
export default class Dropdown extends Component<Props, State> {
|
|
31
|
-
state: State;
|
|
32
|
-
triggerRef: React.RefObject<HTMLDivElement>;
|
|
33
|
-
render(): jsx.JSX.Element;
|
|
34
|
-
private renderArrayOptions;
|
|
35
|
-
private toggleOpen;
|
|
36
|
-
private toggleOpenByKeyboard;
|
|
37
|
-
private hide;
|
|
38
|
-
private hideOnEsc;
|
|
39
|
-
private onOpenChanged;
|
|
40
|
-
componentDidUpdate(prevProps: Props, prevState: State): void;
|
|
41
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
-
import type { DropdownOptionT } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { ButtonItemProps } from '@atlaskit/menu';
|
|
6
|
-
export declare const menuItemDimensions: {
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
};
|
|
10
|
-
export declare const itemSpacing: number;
|
|
11
|
-
export interface Props {
|
|
12
|
-
hide: Function;
|
|
13
|
-
dispatchCommand: Function;
|
|
14
|
-
items: Array<DropdownOptionT<Function>>;
|
|
15
|
-
showSelected?: boolean;
|
|
16
|
-
editorView?: EditorView;
|
|
17
|
-
}
|
|
18
|
-
export interface DropdownButtonItemProps extends ButtonItemProps {
|
|
19
|
-
onMouseEnter?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
20
|
-
onMouseOver?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
21
|
-
onMouseLeave?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
22
|
-
onMouseOut?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
23
|
-
onFocus?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
24
|
-
onBlur?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
25
|
-
}
|
|
26
|
-
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
27
|
-
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
28
|
-
};
|
|
29
|
-
export default _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { EmojiId } from '@atlaskit/emoji';
|
|
6
|
-
export declare const EmojiPickerButton: React.FunctionComponent<{
|
|
7
|
-
className?: string;
|
|
8
|
-
editorView?: EditorView;
|
|
9
|
-
idx?: number;
|
|
10
|
-
providerFactory?: ProviderFactory;
|
|
11
|
-
title?: string;
|
|
12
|
-
onChange?: (emoji: EmojiId) => void;
|
|
13
|
-
isSelected?: boolean;
|
|
14
|
-
mountPoint?: HTMLElement;
|
|
15
|
-
setDisableParentScroll?: (disable: boolean) => void;
|
|
16
|
-
}>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
3
|
-
import type { ExtensionAPI } from '@atlaskit/editor-common/extensions';
|
|
4
|
-
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
5
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
interface Props {
|
|
8
|
-
node: PMNode;
|
|
9
|
-
extensionProvider: Promise<ExtensionProvider>;
|
|
10
|
-
editorView: EditorView;
|
|
11
|
-
separator?: 'start' | 'end' | 'both';
|
|
12
|
-
applyChangeToContextPanel: ApplyChangeHandler | undefined;
|
|
13
|
-
extensionApi: ExtensionAPI | undefined;
|
|
14
|
-
}
|
|
15
|
-
export declare const ExtensionsPlaceholder: (props: Props) => JSX.Element | null;
|
|
16
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Component } from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
5
|
-
export interface Props {
|
|
6
|
-
mountPoint?: HTMLElement;
|
|
7
|
-
boundariesElement?: HTMLElement;
|
|
8
|
-
defaultValue?: string;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
onBlur?: (text: string) => void;
|
|
11
|
-
onSubmit?: (text: string) => void;
|
|
12
|
-
}
|
|
13
|
-
export interface State {
|
|
14
|
-
text: string;
|
|
15
|
-
}
|
|
16
|
-
export default class TextField extends Component<Props, State> {
|
|
17
|
-
constructor(props: Props);
|
|
18
|
-
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
19
|
-
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
20
|
-
handleSubmit: (e: React.FormEvent) => void;
|
|
21
|
-
handleBlur: (e: React.FocusEvent<{}>) => void;
|
|
22
|
-
render(): jsx.JSX.Element;
|
|
23
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import type { IntlShape } from 'react-intl-next';
|
|
5
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
interface ScrollButtonsProps {
|
|
7
|
-
intl: IntlShape;
|
|
8
|
-
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
9
|
-
node: Node;
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare const ScrollButtons: ({ intl, scrollContainerRef, node, disabled, }: ScrollButtonsProps) => jsx.JSX.Element | null;
|
|
13
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { RenderOptionsPropsT, SelectOption } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { ValueType } from '@atlaskit/select';
|
|
4
|
-
export type { RenderOptionsPropsT, SelectOption };
|
|
5
|
-
export interface Props {
|
|
6
|
-
hideExpandIcon?: boolean;
|
|
7
|
-
options: SelectOption[];
|
|
8
|
-
dispatchCommand: (command: Function) => void;
|
|
9
|
-
mountPoint?: HTMLElement;
|
|
10
|
-
boundariesElement?: HTMLElement;
|
|
11
|
-
scrollableElement?: HTMLElement;
|
|
12
|
-
defaultValue?: SelectOption | null;
|
|
13
|
-
placeholder?: string;
|
|
14
|
-
onChange?: (change: ValueType<SelectOption>) => void;
|
|
15
|
-
width?: number;
|
|
16
|
-
filterOption?: ((option: SelectOption, rawInput: string) => boolean) | null;
|
|
17
|
-
setDisableParentScroll?: (disable: boolean) => void;
|
|
18
|
-
ariaLabel?: string;
|
|
19
|
-
classNamePrefix?: string;
|
|
20
|
-
}
|
|
21
|
-
export default function Search(props: Props): JSX.Element;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
-
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types';
|
|
4
|
-
export declare const SimpleModal: (props: ConfirmationDialogProps & WrappedComponentProps) => JSX.Element;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
6
|
-
import type { Item } from '@atlaskit/editor-common/floating-toolbar';
|
|
7
|
-
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
8
|
-
import type { FeatureFlags, OptionalPlugin, PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
9
|
-
import type { contextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
10
|
-
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
11
|
-
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
12
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
13
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
|
-
export type { Item };
|
|
15
|
-
export interface Props {
|
|
16
|
-
items: Array<Item>;
|
|
17
|
-
dispatchCommand: (command?: Function) => void;
|
|
18
|
-
popupsMountPoint?: HTMLElement;
|
|
19
|
-
popupsBoundariesElement?: HTMLElement;
|
|
20
|
-
popupsScrollableElement?: HTMLElement;
|
|
21
|
-
providerFactory?: ProviderFactory;
|
|
22
|
-
className?: string;
|
|
23
|
-
focusEditor?: () => void;
|
|
24
|
-
editorView?: EditorView;
|
|
25
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
26
|
-
target?: HTMLElement;
|
|
27
|
-
node: Node;
|
|
28
|
-
extensionsProvider?: Promise<ExtensionProvider>;
|
|
29
|
-
scrollable?: boolean;
|
|
30
|
-
featureFlags: FeatureFlags;
|
|
31
|
-
api: PluginInjectionAPIWithDependencies<[
|
|
32
|
-
typeof decorationsPlugin,
|
|
33
|
-
OptionalPlugin<typeof contextPanelPlugin>,
|
|
34
|
-
OptionalPlugin<ExtensionPlugin>
|
|
35
|
-
]> | undefined;
|
|
36
|
-
}
|
|
37
|
-
export interface State {
|
|
38
|
-
scrollDisabled: boolean;
|
|
39
|
-
mounted: boolean;
|
|
40
|
-
}
|
|
41
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
42
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
43
|
-
};
|
|
44
|
-
export default _default;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
confirmModalDefaultHeading: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
confirmModalOK: {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
confirmModalCancel: {
|
|
13
|
-
id: string;
|
|
14
|
-
defaultMessage: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
confirmModalListUnit: {
|
|
18
|
-
id: string;
|
|
19
|
-
defaultMessage: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
confirmDeleteLinkedModalMessage: {
|
|
23
|
-
id: string;
|
|
24
|
-
defaultMessage: string;
|
|
25
|
-
description: string;
|
|
26
|
-
};
|
|
27
|
-
floatingToolbarAriaLabel: {
|
|
28
|
-
id: string;
|
|
29
|
-
defaultMessage: string;
|
|
30
|
-
description: string;
|
|
31
|
-
};
|
|
32
|
-
floatingToolbarAnnouncer: {
|
|
33
|
-
id: string;
|
|
34
|
-
defaultMessage: string;
|
|
35
|
-
description: string;
|
|
36
|
-
};
|
|
37
|
-
floatingToolbarScrollLeft: {
|
|
38
|
-
id: string;
|
|
39
|
-
defaultMessage: string;
|
|
40
|
-
description: string;
|
|
41
|
-
};
|
|
42
|
-
floatingToolbarScrollRight: {
|
|
43
|
-
id: string;
|
|
44
|
-
defaultMessage: string;
|
|
45
|
-
description: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export default _default;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare const iconOnlySpacing: {
|
|
2
|
-
'&&': {
|
|
3
|
-
padding: string;
|
|
4
|
-
/**
|
|
5
|
-
Increased specificity here because css for .hyperlink-open-link defined in
|
|
6
|
-
packages/editor/editor-core/src/ui/ContentStyles/index.tsx file
|
|
7
|
-
overrides padding left-right 2px with 4px.
|
|
8
|
-
*/
|
|
9
|
-
'&&[href]': {
|
|
10
|
-
padding: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
'& > span': {
|
|
14
|
-
margin: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare const getButtonStyles: (props: any) => {
|
|
18
|
-
background: any;
|
|
19
|
-
color: any;
|
|
20
|
-
};
|