@seafile/seafile-editor 0.4.2 → 0.4.4

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.
Files changed (54) hide show
  1. package/dist/index.js +10 -36
  2. package/package.json +4 -5
  3. package/dist/assets/css/new-editor.css +0 -9
  4. package/dist/new-editors/editor.js +0 -81
  5. package/dist/slate-extension/constants/index.js +0 -38
  6. package/dist/slate-extension/core/index.js +0 -3
  7. package/dist/slate-extension/core/queries/index.js +0 -298
  8. package/dist/slate-extension/core/transforms/focus-editor.js +0 -11
  9. package/dist/slate-extension/core/transforms/index.js +0 -2
  10. package/dist/slate-extension/core/transforms/move-children.js +0 -28
  11. package/dist/slate-extension/core/utils/index.js +0 -17
  12. package/dist/slate-extension/index.js +0 -15
  13. package/dist/slate-extension/menu/index.js +0 -3
  14. package/dist/slate-extension/menu/menu-group.js +0 -24
  15. package/dist/slate-extension/menu/menu-item.js +0 -81
  16. package/dist/slate-extension/plugins/blockquote/index.js +0 -14
  17. package/dist/slate-extension/plugins/blockquote/menu/index.js +0 -86
  18. package/dist/slate-extension/plugins/blockquote/model.js +0 -11
  19. package/dist/slate-extension/plugins/blockquote/plugin.js +0 -50
  20. package/dist/slate-extension/plugins/blockquote/render-elem.js +0 -7
  21. package/dist/slate-extension/plugins/check-list/helper.js +0 -8
  22. package/dist/slate-extension/plugins/check-list/index.js +0 -7
  23. package/dist/slate-extension/plugins/check-list/plugin.js +0 -26
  24. package/dist/slate-extension/plugins/check-list/render-elem.js +0 -69
  25. package/dist/slate-extension/plugins/header/index.js +0 -10
  26. package/dist/slate-extension/plugins/header/plugin.js +0 -51
  27. package/dist/slate-extension/plugins/header/render-elem.js +0 -9
  28. package/dist/slate-extension/plugins/index.js +0 -8
  29. package/dist/slate-extension/plugins/list/index.js +0 -11
  30. package/dist/slate-extension/plugins/list/menu/index.js +0 -104
  31. package/dist/slate-extension/plugins/list/model.js +0 -11
  32. package/dist/slate-extension/plugins/list/plugin/insert-break-list.js +0 -23
  33. package/dist/slate-extension/plugins/list/plugin/normalize-list.js +0 -88
  34. package/dist/slate-extension/plugins/list/plugin/on-tab-handle.js +0 -45
  35. package/dist/slate-extension/plugins/list/plugin/toggle-list.js +0 -160
  36. package/dist/slate-extension/plugins/list/queries/index.js +0 -47
  37. package/dist/slate-extension/plugins/list/render-elem.js +0 -22
  38. package/dist/slate-extension/plugins/list/transforms/index.js +0 -10
  39. package/dist/slate-extension/plugins/list/transforms/insert-list-item.js +0 -98
  40. package/dist/slate-extension/plugins/list/transforms/move-list-item-down.js +0 -46
  41. package/dist/slate-extension/plugins/list/transforms/move-list-item-up.js +0 -127
  42. package/dist/slate-extension/plugins/list/transforms/move-list-items-to-list.js +0 -56
  43. package/dist/slate-extension/plugins/list/transforms/move-list-items.js +0 -67
  44. package/dist/slate-extension/plugins/list/transforms/normalize-list-item.js +0 -123
  45. package/dist/slate-extension/plugins/list/transforms/normalize-nested-list.js +0 -33
  46. package/dist/slate-extension/plugins/list/transforms/remove-first-list-item.js +0 -17
  47. package/dist/slate-extension/plugins/list/transforms/unwrap-list.js +0 -55
  48. package/dist/slate-extension/plugins/list/with-list.js +0 -34
  49. package/dist/slate-extension/plugins/text-style/index.js +0 -5
  50. package/dist/slate-extension/plugins/text-style/model.js +0 -11
  51. package/dist/slate-extension/plugins/text-style/render-elem.js +0 -29
  52. package/dist/slate-extension/render/render-element.js +0 -55
  53. package/dist/slate-extension/render/render-leaf.js +0 -8
  54. package/dist/slate-extension/toolbar/index.js +0 -37
@@ -1,56 +0,0 @@
1
- import { Editor, Path, Transforms } from 'slate';
2
- import { findDescendant, getLastChildPath, moveChildren } from '../../../core';
3
- import { getListTypes } from '../queries';
4
- export var moveListItemsToList = function moveListItemsToList(editor, _ref) {
5
- var fromList = _ref.fromList,
6
- fromListItem = _ref.fromListItem,
7
- fromStartIndex = _ref.fromStartIndex,
8
- _to = _ref.to,
9
- toList = _ref.toList,
10
- _ref$toListIndex = _ref.toListIndex,
11
- toListIndex = _ref$toListIndex === void 0 ? null : _ref$toListIndex,
12
- _ref$deleteFromList = _ref.deleteFromList,
13
- deleteFromList = _ref$deleteFromList === void 0 ? true : _ref$deleteFromList;
14
- var fromListPath = null;
15
- var moved = false;
16
- Editor.withoutNormalizing(editor, function () {
17
- if (fromListItem) {
18
- var fromListItemSubList = findDescendant(editor, {
19
- at: fromListItem[1],
20
- match: {
21
- type: getListTypes()
22
- }
23
- });
24
- if (!fromListItemSubList) return;
25
- fromListPath = fromListItemSubList === null || fromListItemSubList === void 0 ? void 0 : fromListItemSubList[1];
26
- } else if (fromList) {
27
- fromListPath = fromList[1];
28
- } else {
29
- return;
30
- }
31
- var to = null;
32
- if (_to) to = _to;
33
- if (toList) {
34
- if (toListIndex !== null) {
35
- to = toList[1].concat([toListIndex]);
36
- } else {
37
- var lastChildPath = getLastChildPath(toList);
38
- to = Path.next(lastChildPath);
39
- }
40
- }
41
- if (!to) return;
42
- moved = moveChildren(editor, {
43
- at: fromListPath,
44
- to: to,
45
- fromStartIndex: fromStartIndex
46
- });
47
-
48
- // Remove the empty list
49
- if (deleteFromList) {
50
- Transforms.delete(editor, {
51
- at: fromListPath
52
- });
53
- }
54
- });
55
- return moved;
56
- };
@@ -1,67 +0,0 @@
1
- import { Editor, Path } from 'slate';
2
- import { LIST_LIC } from '../../../constants';
3
- import { getNodeEntries } from '../../../core';
4
- import { isListNested } from '../queries';
5
- import { movedListItemDown } from './move-list-item-down';
6
- import { movedListItemUp } from './move-list-item-up';
7
- import { removeFirstListItem } from './remove-first-list-item';
8
- export var moveListItems = function moveListItems(editor) {
9
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
10
- _ref$increase = _ref.increase,
11
- increase = _ref$increase === void 0 ? true : _ref$increase,
12
- _ref$at = _ref.at,
13
- at = _ref$at === void 0 ? editor.selection : _ref$at,
14
- enableResetOnShiftTab = _ref.enableResetOnShiftTab;
15
- var _nodes = getNodeEntries(editor, {
16
- at: at,
17
- match: {
18
- type: [LIST_LIC]
19
- }
20
- });
21
- var lics = Array.from(_nodes);
22
- if (!lics.length) return;
23
- var highestLicPaths = [];
24
- var highestLicPathRefs = [];
25
- lics.forEach(function (lic) {
26
- var licPath = lic[1];
27
- var liPath = Path.parent(licPath);
28
- var isAncestor = highestLicPaths.some(function (path) {
29
- var highestLiPath = Path.parent(path);
30
- return Path.isAncestor(highestLiPath, liPath);
31
- });
32
- if (!isAncestor) {
33
- highestLicPaths.push(licPath);
34
- highestLicPathRefs.push(Editor.pathRef(editor, licPath));
35
- }
36
- });
37
- var licPathRefsToMove = increase ? highestLicPathRefs : highestLicPathRefs.reverse();
38
- var moved = false;
39
- licPathRefsToMove.forEach(function (licPathRef) {
40
- var licPath = licPathRef.unref();
41
- if (!licPath) return;
42
- var listItem = Editor.parent(editor, licPath);
43
- if (!listItem) return;
44
- var parentList = Editor.parent(editor, listItem[1]);
45
- if (!parentList) return;
46
- var _moved = false;
47
- if (increase) {
48
- _moved = movedListItemDown(editor, {
49
- list: parentList,
50
- listItem: listItem
51
- });
52
- } else if (isListNested(editor, parentList[1])) {
53
- _moved = movedListItemUp(editor, {
54
- list: parentList,
55
- listItem: listItem
56
- });
57
- return _moved;
58
- } else if (enableResetOnShiftTab) {
59
- _moved = removeFirstListItem(editor, {
60
- list: parentList,
61
- listItem: listItem
62
- });
63
- }
64
- moved = _moved || moved;
65
- });
66
- return moved;
67
- };
@@ -1,123 +0,0 @@
1
- import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
4
- import { Transforms, Editor, Path } from 'slate';
5
- import { LIST_LIC } from '../../../constants';
6
- import { getChildren, getDeepInlineChildren, match } from '../../../core';
7
- import { getListTypes } from '../queries';
8
- import { movedListItemUp } from './move-list-item-up';
9
- export var normalizeListItem = function normalizeListItem(editor, _ref) {
10
- var listItem = _ref.listItem;
11
- var changed = false;
12
- var validLiChildrenTypes = [].concat(_toConsumableArray(getListTypes()), [LIST_LIC]);
13
- var _listItem = _slicedToArray(listItem, 2),
14
- liPath = _listItem[1];
15
- var liChildren = getChildren(listItem);
16
- var invalidLiChildrenPathRefs = liChildren.filter(function (_ref2) {
17
- var _ref3 = _slicedToArray(_ref2, 1),
18
- child = _ref3[0];
19
- return !validLiChildrenTypes.includes(child.type);
20
- }).map(function (_ref4) {
21
- var _ref5 = _slicedToArray(_ref4, 2),
22
- childPath = _ref5[1];
23
- return Editor.pathRef(editor, childPath);
24
- });
25
- var firstLiChild = liChildren[0];
26
- var _ref6 = firstLiChild !== null && firstLiChild !== void 0 ? firstLiChild : [],
27
- _ref7 = _slicedToArray(_ref6, 2),
28
- firstLiChildNode = _ref7[0],
29
- firstLiChildPath = _ref7[1];
30
- if (!firstLiChild || !Editor.isBlock(editor, firstLiChildNode)) {
31
- var emptyLic = {
32
- type: LIST_LIC,
33
- children: [{
34
- text: ''
35
- }]
36
- };
37
- Transforms.insertNodes(editor, emptyLic, {
38
- at: liPath.concat([0])
39
- });
40
- return true;
41
- }
42
- if (Editor.isBlock(editor, firstLiChildNode) && !match(firstLiChildNode, [], {
43
- type: [LIST_LIC]
44
- })) {
45
- if (match(firstLiChildNode, [], {
46
- type: getListTypes()
47
- })) {
48
- var parent = Editor.parent(editor, listItem[1]);
49
- var subList = firstLiChild;
50
- var children = getChildren(firstLiChild).reverse();
51
- children.forEach(function (c) {
52
- movedListItemUp(editor, {
53
- list: subList,
54
- listItem: c
55
- });
56
- });
57
- Transforms.removeNodes(editor, {
58
- at: [].concat(_toConsumableArray(parent[1]), [0])
59
- });
60
- return true;
61
- }
62
- if (validLiChildrenTypes.includes(firstLiChildNode.type)) {
63
- return true;
64
- }
65
- Transforms.setNodes(editor, {
66
- type: LIST_LIC
67
- }, {
68
- at: firstLiChildPath
69
- });
70
- changed = true;
71
- }
72
- var licChildren = getChildren(firstLiChild);
73
- if (licChildren.length) {
74
- var _licChildren;
75
- var blockPathRefs = [];
76
- var inlineChildren = [];
77
- var _iterator = _createForOfIteratorHelper(licChildren),
78
- _step;
79
- try {
80
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
81
- var licChild = _step.value;
82
- if (!Editor.isBlock(editor, licChild[0])) {
83
- break;
84
- }
85
- blockPathRefs.push(Editor.pathRef(editor, licChild[1]));
86
- inlineChildren.push.apply(inlineChildren, _toConsumableArray(getDeepInlineChildren(editor, {
87
- children: getChildren(licChild)
88
- })));
89
- }
90
- } catch (err) {
91
- _iterator.e(err);
92
- } finally {
93
- _iterator.f();
94
- }
95
- var to = Path.next((_licChildren = licChildren[licChildren.length - 1]) === null || _licChildren === void 0 ? void 0 : _licChildren[1]);
96
- inlineChildren.reverse().forEach(function (_ref8) {
97
- var _ref9 = _slicedToArray(_ref8, 2),
98
- path = _ref9[1];
99
- Transforms.moveNodes(editor, {
100
- at: path,
101
- to: to
102
- });
103
- });
104
- blockPathRefs.forEach(function (pathRef) {
105
- var path = pathRef.unref();
106
- path && Transforms.removeNodes(editor, {
107
- at: path
108
- });
109
- });
110
- if (blockPathRefs.length) {
111
- changed = true;
112
- }
113
- }
114
- if (changed) return true;
115
- invalidLiChildrenPathRefs.reverse().forEach(function (ref) {
116
- var path = ref.unref();
117
- path && Transforms.moveNodes(editor, {
118
- at: path,
119
- to: firstLiChildPath.concat([0])
120
- });
121
- });
122
- return !!invalidLiChildrenPathRefs.length;
123
- };
@@ -1,33 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import { Transforms, Path, Editor } from 'slate';
3
- import { ORDERED_LIST, UNORDERED_LIST } from '../../../constants';
4
- import { match } from '../../../core';
5
- export var normalizeNestedList = function normalizeNestedList(editor) {
6
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
7
- nestedListItem = _ref.nestedListItem;
8
- var _nestedListItem = _slicedToArray(nestedListItem, 2),
9
- path = _nestedListItem[1];
10
- var parentNodeEntry = Editor.parent(editor, path);
11
- var hasParentList = parentNodeEntry && match(parentNodeEntry[0], [], {
12
- type: [ORDERED_LIST, UNORDERED_LIST]
13
- });
14
- if (!hasParentList) return false;
15
- var previousListItemPath = null;
16
- try {
17
- previousListItemPath = Path.previous(path);
18
- } catch (e) {
19
- return false;
20
- }
21
- var previousSiblingItem = Editor.node(editor, previousListItemPath);
22
- if (previousSiblingItem) {
23
- var _previousSiblingItem = _slicedToArray(previousSiblingItem, 2),
24
- previousPath = _previousSiblingItem[1];
25
- var newPath = previousPath.concat([1]);
26
- Transforms.moveNodes(editor, {
27
- at: path,
28
- to: newPath
29
- });
30
- return true;
31
- }
32
- return false;
33
- };
@@ -1,17 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import { isListNested } from '../queries';
3
- import { movedListItemUp } from './move-list-item-up';
4
- export var removeFirstListItem = function removeFirstListItem(editor, _ref) {
5
- var list = _ref.list,
6
- listItem = _ref.listItem;
7
- var _list = _slicedToArray(list, 2),
8
- listPath = _list[1];
9
- if (!isListNested(editor, listPath)) {
10
- movedListItemUp(editor, {
11
- list: list,
12
- listItem: listItem
13
- });
14
- return true;
15
- }
16
- return false;
17
- };
@@ -1,55 +0,0 @@
1
- import { Editor, Transforms, Element, Node } from 'slate';
2
- import { LIST_ITEM, LIST_LIC, PARAGRAPH } from '../../../constants';
3
- import { getAboveBlockNode, getAboveNode, getNodeType } from '../../../core';
4
- import { getListTypes } from '../queries';
5
- export var unwrapList = function unwrapList(editor) {
6
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
7
- at = _ref.at;
8
- var ancestorListTypeCheck = function ancestorListTypeCheck() {
9
- if (getAboveNode(editor, {
10
- match: {
11
- type: getListTypes()
12
- }
13
- })) {
14
- return true;
15
- }
16
-
17
- // The selection's common node might be a list type
18
- if (!at && editor.selection) {
19
- var commonNode = Node.common(editor, editor.selection.anchor.path, editor.selection.focus.path);
20
- if (Element.isElement(commonNode[0]) && getListTypes().includes(commonNode[0].type)) {
21
- return true;
22
- }
23
- }
24
- return false;
25
- };
26
- Editor.withoutNormalizing(editor, function () {
27
- do {
28
- var licEntry = getAboveBlockNode(editor, {
29
- at: at,
30
- match: {
31
- type: LIST_LIC
32
- }
33
- });
34
- if (licEntry) {
35
- Transforms.setNodes(editor, {
36
- type: PARAGRAPH
37
- });
38
- }
39
- Transforms.unwrapNodes(editor, {
40
- at: at,
41
- match: function match(n) {
42
- return getNodeType(n) === LIST_ITEM;
43
- },
44
- split: true
45
- });
46
- Transforms.unwrapNodes(editor, {
47
- at: at,
48
- match: function match(n) {
49
- return getListTypes().includes(getNodeType(n));
50
- },
51
- split: true
52
- });
53
- } while (ancestorListTypeCheck());
54
- });
55
- };
@@ -1,34 +0,0 @@
1
- import { insertBreakList } from './plugin/insert-break-list';
2
- import { onTabHandle } from './plugin/on-tab-handle';
3
- import { normalizeList } from './plugin/normalize-list';
4
- var withList = function withList(editor) {
5
- var insertBreak = editor.insertBreak,
6
- deleteBackWord = editor.deleteBackWord,
7
- handleTab = editor.handleTab;
8
- var newEditor = editor;
9
- newEditor.insertBreak = function () {
10
- if (insertBreakList(editor)) return;
11
- insertBreak();
12
- return;
13
- };
14
- newEditor.deleteBackWord = function (unit) {
15
- var selection = newEditor.selection;
16
- if (selection === null) {
17
- deleteBackWord(unit);
18
- return;
19
- }
20
- // nothing todo
21
- deleteBackWord(unit);
22
- };
23
- newEditor.handleTab = function (event) {
24
- if (!newEditor.selection) {
25
- handleTab && handleTab();
26
- return;
27
- }
28
- if (onTabHandle(newEditor, event)) return;
29
- handleTab && handleTab();
30
- };
31
- newEditor.normalizeNode = normalizeList(editor);
32
- return newEditor;
33
- };
34
- export default withList;
@@ -1,5 +0,0 @@
1
- import renderText from "./render-elem";
2
- var TextPlugin = {
3
- renderElements: [renderText]
4
- };
5
- export default TextPlugin;
@@ -1,11 +0,0 @@
1
- import _createClass from "@babel/runtime/helpers/esm/createClass";
2
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
- import { BLOCKQUOTE } from '../../constants';
4
- var Blockquote = /*#__PURE__*/_createClass(function Blockquote(options) {
5
- _classCallCheck(this, Blockquote);
6
- this.type = options.type || BLOCKQUOTE;
7
- this.children = options.children || [{
8
- text: ''
9
- }];
10
- });
11
- export default Blockquote;
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- var renderText = function renderText(props, editor) {
3
- var attributes = props.attributes,
4
- children = props.children,
5
- leaf = props.leaf;
6
- var markedChildren = React.cloneElement(children);
7
- if (leaf.BOLD) {
8
- markedChildren = /*#__PURE__*/React.createElement("strong", null, markedChildren);
9
- }
10
- if (leaf.CODE) {
11
- markedChildren = /*#__PURE__*/React.createElement("code", null, markedChildren);
12
- }
13
- if (leaf.ITALIC) {
14
- markedChildren = /*#__PURE__*/React.createElement("i", null, markedChildren);
15
- }
16
- if (leaf.DELETE) {
17
- markedChildren = /*#__PURE__*/React.createElement("del", null, markedChildren);
18
- }
19
- if (leaf.ADD) {
20
- markedChildren = /*#__PURE__*/React.createElement("ins", null, markedChildren);
21
- }
22
- if (leaf.decoration) {
23
- markedChildren = /*#__PURE__*/React.createElement("span", {
24
- className: "token ".concat(leaf.type)
25
- }, markedChildren);
26
- }
27
- return /*#__PURE__*/React.createElement("span", attributes, markedChildren);
28
- };
29
- export default renderText;
@@ -1,55 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import React from 'react';
3
- import { BLOCKQUOTE, CHECK_LIST_ITEM, HEADER, LIST_ITEM, LIST_ITEM_WRAPPER, LIST_LIC, ORDERED_LIST, UNORDERED_LIST } from '../constants';
4
- import { BlockquotePlugin, CheckListPlugin, HeaderPlugin, ListPlugin } from '../plugins';
5
- var renderElement = function renderElement(props, editor) {
6
- var attributes = props.attributes,
7
- children = props.children,
8
- element = props.element;
9
- switch (element.type) {
10
- case HEADER:
11
- {
12
- var _HeaderPlugin$renderE = _slicedToArray(HeaderPlugin.renderElements, 1),
13
- renderHeader = _HeaderPlugin$renderE[0];
14
- return renderHeader(props, editor);
15
- }
16
- case BLOCKQUOTE:
17
- {
18
- var _BlockquotePlugin$ren = _slicedToArray(BlockquotePlugin.renderElements, 1),
19
- renderBlockquote = _BlockquotePlugin$ren[0];
20
- return renderBlockquote(props, editor);
21
- }
22
- case ORDERED_LIST:
23
- case UNORDERED_LIST:
24
- {
25
- var _ListPlugin$renderEle = _slicedToArray(ListPlugin.renderElements, 1),
26
- renderList = _ListPlugin$renderEle[0];
27
- return renderList(props, editor);
28
- }
29
- case LIST_ITEM:
30
- {
31
- var _ListPlugin$renderEle2 = _slicedToArray(ListPlugin.renderElements, 2),
32
- renderListItem = _ListPlugin$renderEle2[1];
33
- return renderListItem(props, editor);
34
- }
35
- case LIST_LIC:
36
- {
37
- var _ListPlugin$renderEle3 = _slicedToArray(ListPlugin.renderElements, 3),
38
- renderListLic = _ListPlugin$renderEle3[2];
39
- return renderListLic(props, editor);
40
- }
41
- case CHECK_LIST_ITEM:
42
- {
43
- var _CheckListPlugin$rend = _slicedToArray(CheckListPlugin.renderElements, 2),
44
- CheckListItem = _CheckListPlugin$rend[1];
45
- return /*#__PURE__*/React.createElement(CheckListItem, Object.assign({}, props, {
46
- editor: editor
47
- }));
48
- }
49
- default:
50
- {
51
- return /*#__PURE__*/React.createElement("p", attributes, children);
52
- }
53
- }
54
- };
55
- export default renderElement;
@@ -1,8 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import { TextPlugin } from '../plugins';
3
- var renderLeaf = function renderLeaf(props, editor) {
4
- var _TextPlugin$renderEle = _slicedToArray(TextPlugin.renderElements, 1),
5
- renderText = _TextPlugin$renderEle[0];
6
- return renderText(props, editor);
7
- };
8
- export default renderLeaf;
@@ -1,37 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _inherits from "@babel/runtime/helpers/esm/inherits";
4
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- import React from 'react';
6
- import QuoteMenu from '../plugins/blockquote/menu';
7
- import ListMenu from '../plugins/list/menu';
8
- import { ORDERED_LIST, UNORDERED_LIST } from '../constants';
9
- var Toolbar = /*#__PURE__*/function (_React$Component) {
10
- _inherits(Toolbar, _React$Component);
11
- var _super = _createSuper(Toolbar);
12
- function Toolbar() {
13
- _classCallCheck(this, Toolbar);
14
- return _super.apply(this, arguments);
15
- }
16
- _createClass(Toolbar, [{
17
- key: "render",
18
- value: function render() {
19
- return /*#__PURE__*/React.createElement("div", {
20
- style: {
21
- display: 'flex',
22
- 'justifyContent': 'center'
23
- }
24
- }, /*#__PURE__*/React.createElement(QuoteMenu, {
25
- editor: this.props.editor
26
- }), /*#__PURE__*/React.createElement(ListMenu, {
27
- editor: this.props.editor,
28
- type: UNORDERED_LIST
29
- }), /*#__PURE__*/React.createElement(ListMenu, {
30
- editor: this.props.editor,
31
- type: ORDERED_LIST
32
- }));
33
- }
34
- }]);
35
- return Toolbar;
36
- }(React.Component);
37
- export default Toolbar;