@seafile/sdoc-editor 0.1.89 → 0.1.90
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/dist/basic-sdk/assets/css/layout.css +1 -1
- package/dist/basic-sdk/extension/commons/index.js +5 -0
- package/dist/{components → basic-sdk/extension/commons}/more-dropdown/index.js +3 -3
- package/dist/basic-sdk/extension/constants/index.js +1 -0
- package/dist/basic-sdk/extension/index.js +1 -2
- package/dist/basic-sdk/extension/plugins/blockquote/menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/check-list/menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/clear-format/menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/code-block/hover-menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/code-block/menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/image/menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/link/menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/list/menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/table/helpers.js +1 -2
- package/dist/basic-sdk/extension/plugins/table/menu/active-table-menu/index.js +1 -2
- package/dist/basic-sdk/extension/plugins/table/menu/table-context-menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/table/menu/table-menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/table/plugin.js +1 -2
- package/dist/basic-sdk/extension/plugins/text-style/menu/index.js +1 -3
- package/dist/basic-sdk/extension/toolbar/context-toolbar/index.js +6 -5
- package/dist/basic-sdk/extension/toolbar/header-toolbar/index.js +54 -0
- package/dist/basic-sdk/extension/toolbar/{redo-undo.js → header-toolbar/redo-undo.js} +2 -2
- package/dist/basic-sdk/extension/toolbar/index.js +3 -54
- package/dist/basic-sdk/node-id/index.js +1 -1
- package/dist/layout/layout.css +1 -1
- package/package.json +1 -1
- package/dist/basic-sdk/constants/index.js +0 -1
- /package/dist/basic-sdk/extension/{menu → commons}/color-menu/color-item.js +0 -0
- /package/dist/basic-sdk/extension/{menu → commons}/color-menu/index.css +0 -0
- /package/dist/basic-sdk/extension/{menu → commons}/color-menu/index.js +0 -0
- /package/dist/basic-sdk/extension/{menu → commons/menu}/index.js +0 -0
- /package/dist/basic-sdk/extension/{menu → commons/menu}/menu-group.js +0 -0
- /package/dist/basic-sdk/extension/{menu → commons/menu}/menu-item.js +0 -0
- /package/dist/basic-sdk/extension/{menu → commons/menu}/menu.css +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { UncontrolledPopover } from 'reactstrap';
|
|
4
|
-
var
|
|
4
|
+
var MoreDropdown = function MoreDropdown(_ref) {
|
|
5
5
|
var className = _ref.className,
|
|
6
6
|
disabled = _ref.disabled,
|
|
7
7
|
isRichEditor = _ref.isRichEditor,
|
|
@@ -31,8 +31,8 @@ var MoreDropdownMenu = function MoreDropdownMenu(_ref) {
|
|
|
31
31
|
className: "menu-group"
|
|
32
32
|
}, children)));
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
MoreDropdown.defaultProps = {
|
|
35
35
|
isRichEditor: true,
|
|
36
36
|
className: 'menu-group-item'
|
|
37
37
|
};
|
|
38
|
-
export default
|
|
38
|
+
export default MoreDropdown;
|
|
@@ -151,4 +151,5 @@ export var ADDED_STYLE = {
|
|
|
151
151
|
export var HEADER_TYPE_ARRAY = ['header1', 'header2', 'header3', 'header4', 'header5', 'header6'];
|
|
152
152
|
export var LIST_TYPE_ARRAY = ['unordered_list', 'ordered_list'];
|
|
153
153
|
export var TRANSPARENT = 'transparent';
|
|
154
|
+
export var CLIPBOARD_FORMAT_KEY = 'x-slate-fragment';
|
|
154
155
|
export { BLOCKQUOTE, HEADER, HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6, PARAGRAPH, BOLD, ITALIC, UNDERLINE, STRIKETHROUGH, SUPERSCRIPT, SUBSCRIPT, ORDERED_LIST, UNORDERED_LIST, LIST_ITEM, LIST_LIC, CHECK_LIST, CHECK_LIST_ITEM, LINK, HTML, CODE_BLOCK, CODE_LINE, IMAGE, TABLE, TABLE_CELL, TABLE_ROW, FORMULA, COLUMN, TEXT_STYLE, TEXT_STYLE_MORE, BOLD_ITALIC, TEXT_ALIGN, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER, ELEMENT_TYPE, KEYBOARD, DEFAULT_COLORS, STANDARD_COLORS, DEFAULT_RECENT_USED_COLORS, CLEAR_FORMAT, DEFAULT_FONT_COLOR };
|
|
@@ -4,8 +4,7 @@ import { withHistory } from '@seafile/slate-history';
|
|
|
4
4
|
import Plugins from './plugins';
|
|
5
5
|
import renderElement from './render/render-element';
|
|
6
6
|
import renderLeaf from './render/render-leaf';
|
|
7
|
-
import Toolbar from './toolbar';
|
|
8
|
-
import ContextToolbar from './toolbar/context-toolbar';
|
|
7
|
+
import { Toolbar, ContextToolbar } from './toolbar';
|
|
9
8
|
var baseEditor = withHistory(withReact(createEditor()));
|
|
10
9
|
var defaultEditor = Plugins.reduce(function (editor, pluginItem) {
|
|
11
10
|
var withPlugin = pluginItem.editorPlugin;
|
|
@@ -5,7 +5,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
5
5
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { BLOCKQUOTE, MENUS_CONFIG_MAP } from '../../../constants';
|
|
8
|
-
import { MenuItem } from '../../../
|
|
8
|
+
import { MenuItem } from '../../../commons';
|
|
9
9
|
import { getBlockQuoteType, isMenuDisabled, setBlockQuoteType } from '../helpers';
|
|
10
10
|
var QuoteMenu = /*#__PURE__*/function (_React$Component) {
|
|
11
11
|
_inherits(QuoteMenu, _React$Component);
|
|
@@ -5,7 +5,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
5
5
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { CHECK_LIST, CHECK_LIST_ITEM, MENUS_CONFIG_MAP, PARAGRAPH } from '../../../constants';
|
|
8
|
-
import { MenuItem } from '../../../
|
|
8
|
+
import { MenuItem } from '../../../commons';
|
|
9
9
|
import { isMenuDisabled, setCheckListItemType, getCheckListItemType } from '../helpers';
|
|
10
10
|
var CheckListMenu = /*#__PURE__*/function (_React$Component) {
|
|
11
11
|
_inherits(CheckListMenu, _React$Component);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import React, { useCallback } from 'react';
|
|
3
3
|
import { CLEAR_FORMAT, MENUS_CONFIG_MAP } from '../../../constants';
|
|
4
|
-
import { MenuItem } from '../../../
|
|
4
|
+
import { MenuItem } from '../../../commons';
|
|
5
5
|
import { isMenuDisabled, clearStyles } from '../helpers';
|
|
6
6
|
var menuConfig = MENUS_CONFIG_MAP[CLEAR_FORMAT];
|
|
7
7
|
var ClearFormatMenu = function ClearFormatMenu(_ref) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
3
|
import { withTranslation } from 'react-i18next';
|
|
4
|
-
import ElementPopover from '../../../commons/
|
|
4
|
+
import { ElementPopover } from '../../../commons/';
|
|
5
5
|
import { genCodeLangs } from '../prismjs';
|
|
6
6
|
import './index.css';
|
|
7
7
|
var CodeBlockHoverMenu = function CodeBlockHoverMenu(_ref) {
|
|
@@ -6,7 +6,7 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { focusEditor } from '../../../core';
|
|
8
8
|
import { CODE_BLOCK, MENUS_CONFIG_MAP } from '../../../constants';
|
|
9
|
-
import { MenuItem } from '../../../
|
|
9
|
+
import { MenuItem } from '../../../commons';
|
|
10
10
|
import { getSelectCodeElem, isMenuDisabled, changeToCodeBlock, changeToPlainText } from '../helpers';
|
|
11
11
|
var CodeBlockMenu = /*#__PURE__*/function (_React$Component) {
|
|
12
12
|
_inherits(CodeBlockMenu, _React$Component);
|
|
@@ -8,7 +8,7 @@ import { withTranslation } from 'react-i18next';
|
|
|
8
8
|
import { insertImage, isInsertImageMenuDisabled } from '../helpers';
|
|
9
9
|
import context from '../../../../../context';
|
|
10
10
|
import { IMAGE, MENUS_CONFIG_MAP } from '../../../constants';
|
|
11
|
-
import { MenuItem } from '../../../
|
|
11
|
+
import { MenuItem } from '../../../commons';
|
|
12
12
|
import InsertWebImageDialog from '../dialogs/insert-web-image-dialog';
|
|
13
13
|
import './style.css';
|
|
14
14
|
var ImageMenu = /*#__PURE__*/function (_React$Component) {
|
|
@@ -6,7 +6,7 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { LINK, MENUS_CONFIG_MAP } from '../../../constants';
|
|
8
8
|
import { getEditorString } from '../../../core';
|
|
9
|
-
import { MenuItem } from '../../../
|
|
9
|
+
import { MenuItem } from '../../../commons';
|
|
10
10
|
import { getLinkType, isMenuDisabled } from '../helpers';
|
|
11
11
|
import AddLinkDialog from './add-link-dialog';
|
|
12
12
|
var LinkMenu = /*#__PURE__*/function (_React$Component) {
|
|
@@ -6,7 +6,7 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { MENUS_CONFIG_MAP, ORDERED_LIST, UNORDERED_LIST } from '../../../constants';
|
|
8
8
|
import { focusEditor } from '../../../core';
|
|
9
|
-
import { MenuItem } from '../../../
|
|
9
|
+
import { MenuItem } from '../../../commons';
|
|
10
10
|
import { getListType, isMenuDisabled, setListType } from '../helpers';
|
|
11
11
|
var ListMenu = /*#__PURE__*/function (_React$Component) {
|
|
12
12
|
_inherits(ListMenu, _React$Component);
|
|
@@ -6,13 +6,12 @@ import slugid from 'slugid';
|
|
|
6
6
|
import { Editor, Range, Transforms, Point, Node } from '@seafile/slate';
|
|
7
7
|
import { ReactEditor } from '@seafile/slate-react';
|
|
8
8
|
import { getNodeType, getParentNode, getSelectedNodeByType, isTextNode, getSelectedElems, focusEditor, getNode, findPath, replaceNodeChildren } from '../../core';
|
|
9
|
-
import { ELEMENT_TYPE, KEYBOARD } from '../../constants';
|
|
9
|
+
import { ELEMENT_TYPE, KEYBOARD, CLIPBOARD_FORMAT_KEY } from '../../constants';
|
|
10
10
|
import { TABLE_MAX_ROWS, TABLE_MAX_COLUMNS, EMPTY_SELECTED_RANGE, TABLE_ROW_MIN_HEIGHT, TABLE_CELL_MIN_WIDTH, TABLE_ELEMENT, TABLE_ELEMENT_POSITION } from './constants';
|
|
11
11
|
import EventBus from '../../../utils/event-bus';
|
|
12
12
|
import { EXTERNAL_EVENT, PAGE_EDIT_AREA_WIDTH } from '../../../../constants';
|
|
13
13
|
import ObjectUtils from '../../../utils/object-utils';
|
|
14
14
|
import { replacePastedDataId } from '../../../node-id/helpers';
|
|
15
|
-
import { CLIPBOARD_FORMAT_KEY } from '../../../constants';
|
|
16
15
|
export var isTableMenuDisabled = function isTableMenuDisabled(editor) {
|
|
17
16
|
var selection = editor.selection;
|
|
18
17
|
if (selection === null) return true;
|
|
@@ -7,12 +7,11 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
7
7
|
import React, { Component } from 'react';
|
|
8
8
|
import { withTranslation } from 'react-i18next';
|
|
9
9
|
import classnames from 'classnames';
|
|
10
|
-
import { MenuGroup, MenuItem } from '../../../../
|
|
10
|
+
import { ColorMenu, MenuGroup, MenuItem } from '../../../../commons';
|
|
11
11
|
import CommonMenu from './common-menu';
|
|
12
12
|
import { MENUS_CONFIG_MAP, REMOVE_TABLE, BG_COLOR } from '../../../../constants';
|
|
13
13
|
import { setCellStyle, insertTableElement, removeTableElement, isAllInTable } from '../../helpers';
|
|
14
14
|
import { TABLE_ELEMENT } from '../../constants';
|
|
15
|
-
import ColorMenu from '../../../../menu/color-menu';
|
|
16
15
|
import './index.css';
|
|
17
16
|
var ActiveTableMenu = /*#__PURE__*/function (_Component) {
|
|
18
17
|
_inherits(ActiveTableMenu, _Component);
|
|
@@ -6,7 +6,7 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { withTranslation } from 'react-i18next';
|
|
8
8
|
import ObjectUtils from '../../../../../utils/object-utils';
|
|
9
|
-
import ElementPopover from '../../../../commons
|
|
9
|
+
import { ElementPopover } from '../../../../commons';
|
|
10
10
|
import { ELEMENT_TYPE } from '../../../../constants';
|
|
11
11
|
import { getSelectedNodeByType } from '../../../../core';
|
|
12
12
|
import { TABLE_MAX_COLUMNS, TABLE_MAX_ROWS, TABLE_ELEMENT, TABLE_ELEMENT_POSITION } from '../../constants';
|
|
@@ -7,7 +7,7 @@ import React from 'react';
|
|
|
7
7
|
import { withTranslation } from 'react-i18next';
|
|
8
8
|
import { insertTable, isTableMenuDisabled } from '../../helpers';
|
|
9
9
|
import { TABLE, MENUS_CONFIG_MAP } from '../../../../constants';
|
|
10
|
-
import { MenuItem } from '../../../../
|
|
10
|
+
import { MenuItem } from '../../../../commons';
|
|
11
11
|
import TableSizePopover from '../../popover/table-size-popover';
|
|
12
12
|
var TableMenu = /*#__PURE__*/function (_React$Component) {
|
|
13
13
|
_inherits(TableMenu, _React$Component);
|
|
@@ -4,13 +4,12 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
4
4
|
import isHotkey from 'is-hotkey';
|
|
5
5
|
import { Editor, Transforms, Path } from '@seafile/slate';
|
|
6
6
|
import { getNodeType, getParentNode, getSelectedNodeByType, isLastNode, generateEmptyElement } from '../../core';
|
|
7
|
-
import { ELEMENT_TYPE, KEYBOARD, PARAGRAPH } from '../../constants';
|
|
7
|
+
import { ELEMENT_TYPE, KEYBOARD, PARAGRAPH, CLIPBOARD_FORMAT_KEY } from '../../constants';
|
|
8
8
|
import { TABLE_MAX_ROWS, EMPTY_SELECTED_RANGE, TABLE_ELEMENT, TABLE_ELEMENT_POSITION } from './constants';
|
|
9
9
|
import ObjectUtils from '../../../utils/object-utils';
|
|
10
10
|
import { getSelectedInfo, insertTableElement, removeTable, insertMultipleRowsAndColumns, setTableFragmentData, deleteTableRangeData, focusCell, deleteHandler, isTableLocation, isLastTableCell } from './helpers';
|
|
11
11
|
import EventBus from '../../../utils/event-bus';
|
|
12
12
|
import { EXTERNAL_EVENT } from '../../../../constants';
|
|
13
|
-
import { CLIPBOARD_FORMAT_KEY } from '../../../constants';
|
|
14
13
|
var withTable = function withTable(editor) {
|
|
15
14
|
var insertBreak = editor.insertBreak,
|
|
16
15
|
deleteBackward = editor.deleteBackward,
|
|
@@ -4,10 +4,8 @@ import { withTranslation } from 'react-i18next';
|
|
|
4
4
|
import { Editor } from '@seafile/slate';
|
|
5
5
|
import { TEXT_STYLE, TEXT_STYLE_MORE, MENUS_CONFIG_MAP, ELEMENT_TYPE } from '../../../constants';
|
|
6
6
|
import { focusEditor } from '../../../core';
|
|
7
|
-
import { MenuItem } from '../../../
|
|
7
|
+
import { MenuItem, ColorMenu, MoreDropdown } from '../../../commons';
|
|
8
8
|
import { getValue, isMenuDisabled, addMark, removeMark } from '../helpers';
|
|
9
|
-
import MoreDropdown from '../../../../../components/more-dropdown';
|
|
10
|
-
import ColorMenu from '../../../menu/color-menu';
|
|
11
9
|
var TextStyleMenuList = function TextStyleMenuList(_ref) {
|
|
12
10
|
var editor = _ref.editor,
|
|
13
11
|
t = _ref.t,
|
|
@@ -2,7 +2,7 @@ import React, { useRef, useEffect, useCallback } from 'react';
|
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { useFocused, useSlateStatic, useReadOnly } from '@seafile/slate-react';
|
|
4
4
|
import { Editor, Range } from '@seafile/slate';
|
|
5
|
-
import { MenuGroup } from '../../
|
|
5
|
+
import { MenuGroup } from '../../commons';
|
|
6
6
|
import TextStyleMenuList from '../../plugins/text-style/menu';
|
|
7
7
|
import { useScrollContext } from '../../../hooks/use-scroll-context';
|
|
8
8
|
import { getSelectedNodeByType } from '../../core';
|
|
@@ -41,15 +41,16 @@ var ContextToolbar = function ContextToolbar() {
|
|
|
41
41
|
scrollRef.current && scrollRef.current.addEventListener('scroll', onScroll);
|
|
42
42
|
setContextToolbarPosition();
|
|
43
43
|
});
|
|
44
|
+
var onMouseDown = useCallback(function (event) {
|
|
45
|
+
event.preventDefault(); // prevent toolbar from taking focus away from editor
|
|
46
|
+
}, []);
|
|
44
47
|
return createPortal( /*#__PURE__*/React.createElement("div", {
|
|
45
48
|
ref: ref,
|
|
46
49
|
className: "sdoc-context-toolbar",
|
|
47
|
-
onMouseDown:
|
|
48
|
-
e.preventDefault(); // prevent toolbar from taking focus away from editor
|
|
49
|
-
}
|
|
50
|
+
onMouseDown: onMouseDown
|
|
50
51
|
}, /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(TextStyleMenuList, {
|
|
51
52
|
editor: editor,
|
|
52
|
-
idPrefix: '
|
|
53
|
+
idPrefix: 'sdoc_context_toolbar'
|
|
53
54
|
}))), document.body);
|
|
54
55
|
};
|
|
55
56
|
export default ContextToolbar;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import useSelectionUpdate from '../../../hooks/use-selection-update';
|
|
3
|
+
import { ORDERED_LIST, UNORDERED_LIST } from '../../constants';
|
|
4
|
+
import { MenuGroup } from '../../commons';
|
|
5
|
+
import QuoteMenu from '../../plugins/blockquote/menu';
|
|
6
|
+
import LinkMenu from '../../plugins/link/menu';
|
|
7
|
+
import ListMenu from '../../plugins/list/menu';
|
|
8
|
+
import ImageMenu from '../../plugins/image/menu';
|
|
9
|
+
import HeaderMenu from '../../plugins/header/menu';
|
|
10
|
+
import CheckListMenu from '../../plugins/check-list/menu';
|
|
11
|
+
import TextStyleMenuList from '../../plugins/text-style/menu';
|
|
12
|
+
import CodeBlockMenu from '../../plugins/code-block/menu';
|
|
13
|
+
import TextAlignMenu from '../../plugins/text-align/menu';
|
|
14
|
+
import { TableMenu, ActiveTableMenu } from '../../plugins/table/menu';
|
|
15
|
+
import ClearFormatMenu from '../../plugins/clear-format/menu';
|
|
16
|
+
import HistoryMenu from './redo-undo';
|
|
17
|
+
var Toolbar = function Toolbar(_ref) {
|
|
18
|
+
var editor = _ref.editor;
|
|
19
|
+
useSelectionUpdate();
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: "sdoc-editor-toolbar"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(HistoryMenu, {
|
|
23
|
+
editor: editor
|
|
24
|
+
}), /*#__PURE__*/React.createElement(ClearFormatMenu, {
|
|
25
|
+
editor: editor
|
|
26
|
+
})), /*#__PURE__*/React.createElement(HeaderMenu, {
|
|
27
|
+
editor: editor
|
|
28
|
+
}), /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(TextStyleMenuList, {
|
|
29
|
+
editor: editor
|
|
30
|
+
})), /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(QuoteMenu, {
|
|
31
|
+
editor: editor
|
|
32
|
+
}), /*#__PURE__*/React.createElement(ListMenu, {
|
|
33
|
+
editor: editor,
|
|
34
|
+
type: UNORDERED_LIST
|
|
35
|
+
}), /*#__PURE__*/React.createElement(ListMenu, {
|
|
36
|
+
editor: editor,
|
|
37
|
+
type: ORDERED_LIST
|
|
38
|
+
}), /*#__PURE__*/React.createElement(CheckListMenu, {
|
|
39
|
+
editor: editor
|
|
40
|
+
}), /*#__PURE__*/React.createElement(TextAlignMenu, {
|
|
41
|
+
editor: editor
|
|
42
|
+
})), /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(CodeBlockMenu, {
|
|
43
|
+
editor: editor
|
|
44
|
+
}), /*#__PURE__*/React.createElement(TableMenu, {
|
|
45
|
+
editor: editor
|
|
46
|
+
})), /*#__PURE__*/React.createElement(ActiveTableMenu, {
|
|
47
|
+
editor: editor
|
|
48
|
+
}), /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(ImageMenu, {
|
|
49
|
+
editor: editor
|
|
50
|
+
}), /*#__PURE__*/React.createElement(LinkMenu, {
|
|
51
|
+
editor: editor
|
|
52
|
+
})));
|
|
53
|
+
};
|
|
54
|
+
export default Toolbar;
|
|
@@ -4,8 +4,8 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
5
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import { MenuItem } from '
|
|
8
|
-
import { MENUS_CONFIG_MAP, REDO, UNDO } from '
|
|
7
|
+
import { MenuItem } from '../../commons';
|
|
8
|
+
import { MENUS_CONFIG_MAP, REDO, UNDO } from '../../constants';
|
|
9
9
|
var HistoryMenu = /*#__PURE__*/function (_React$Component) {
|
|
10
10
|
_inherits(HistoryMenu, _React$Component);
|
|
11
11
|
var _super = _createSuper(HistoryMenu);
|
|
@@ -1,54 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { MenuGroup } from '../menu';
|
|
5
|
-
import QuoteMenu from '../plugins/blockquote/menu';
|
|
6
|
-
import LinkMenu from '../plugins/link/menu';
|
|
7
|
-
import ListMenu from '../plugins/list/menu';
|
|
8
|
-
import ImageMenu from '../plugins/image/menu';
|
|
9
|
-
import HeaderMenu from '../plugins/header/menu';
|
|
10
|
-
import CheckListMenu from '../plugins/check-list/menu';
|
|
11
|
-
import TextStyleMenuList from '../plugins/text-style/menu';
|
|
12
|
-
import CodeBlockMenu from '../plugins/code-block/menu';
|
|
13
|
-
import TextAlignMenu from '../plugins/text-align/menu';
|
|
14
|
-
import HistoryMenu from './redo-undo';
|
|
15
|
-
import { TableMenu, ActiveTableMenu } from '../plugins/table/menu';
|
|
16
|
-
import ClearFormatMenu from '../plugins/clear-format/menu';
|
|
17
|
-
var Toolbar = function Toolbar(_ref) {
|
|
18
|
-
var editor = _ref.editor;
|
|
19
|
-
useSelectionUpdate();
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className: "sdoc-editor-toolbar"
|
|
22
|
-
}, /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(HistoryMenu, {
|
|
23
|
-
editor: editor
|
|
24
|
-
})), /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(ClearFormatMenu, {
|
|
25
|
-
editor: editor
|
|
26
|
-
})), /*#__PURE__*/React.createElement(HeaderMenu, {
|
|
27
|
-
editor: editor
|
|
28
|
-
}), /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(TextStyleMenuList, {
|
|
29
|
-
editor: editor
|
|
30
|
-
})), /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(QuoteMenu, {
|
|
31
|
-
editor: editor
|
|
32
|
-
}), /*#__PURE__*/React.createElement(ListMenu, {
|
|
33
|
-
editor: editor,
|
|
34
|
-
type: UNORDERED_LIST
|
|
35
|
-
}), /*#__PURE__*/React.createElement(ListMenu, {
|
|
36
|
-
editor: editor,
|
|
37
|
-
type: ORDERED_LIST
|
|
38
|
-
}), /*#__PURE__*/React.createElement(CheckListMenu, {
|
|
39
|
-
editor: editor
|
|
40
|
-
}), /*#__PURE__*/React.createElement(TextAlignMenu, {
|
|
41
|
-
editor: editor
|
|
42
|
-
})), /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(CodeBlockMenu, {
|
|
43
|
-
editor: editor
|
|
44
|
-
}), /*#__PURE__*/React.createElement(TableMenu, {
|
|
45
|
-
editor: editor
|
|
46
|
-
})), /*#__PURE__*/React.createElement(ActiveTableMenu, {
|
|
47
|
-
editor: editor
|
|
48
|
-
}), /*#__PURE__*/React.createElement(MenuGroup, null, /*#__PURE__*/React.createElement(ImageMenu, {
|
|
49
|
-
editor: editor
|
|
50
|
-
}), /*#__PURE__*/React.createElement(LinkMenu, {
|
|
51
|
-
editor: editor
|
|
52
|
-
})));
|
|
53
|
-
};
|
|
54
|
-
export default Toolbar;
|
|
1
|
+
import Toolbar from './header-toolbar';
|
|
2
|
+
import ContextToolbar from './context-toolbar';
|
|
3
|
+
export { Toolbar, ContextToolbar };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import { decorateOperation, replacePastedDataId } from './helpers';
|
|
3
|
-
import { CLIPBOARD_FORMAT_KEY } from '../constants';
|
|
3
|
+
import { CLIPBOARD_FORMAT_KEY } from '../extension/constants';
|
|
4
4
|
var catchSlateFragment = /data-slate-fragment="(.+?)"/m;
|
|
5
5
|
var getSlateFragmentAttribute = function getSlateFragmentAttribute(dataTransfer) {
|
|
6
6
|
var htmlData = dataTransfer.getData('text/html');
|
package/dist/layout/layout.css
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var CLIPBOARD_FORMAT_KEY = 'x-slate-fragment';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|