@seafile/seafile-editor 1.0.2 → 1.0.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.
- package/dist/constants/event-types.js +2 -8
- package/dist/constants/hot-keys.js +1 -7
- package/dist/containers/article-info/index.js +24 -34
- package/dist/containers/custom/get-event-transfer.js +10 -16
- package/dist/containers/custom/set-event-transfer.js +10 -16
- package/dist/containers/hotkeys-helper/classify-hotkeys.js +20 -25
- package/dist/containers/hotkeys-helper/index.js +32 -35
- package/dist/containers/loading/index.js +11 -32
- package/dist/containers/outline/index.js +41 -51
- package/dist/containers/outline/outline-item.js +15 -21
- package/dist/editors/plain-markdown-editor/code-mirror.js +51 -75
- package/dist/editors/plain-markdown-editor/index.js +90 -107
- package/dist/editors/simple-slate-editor /index.js +43 -57
- package/dist/editors/simple-slate-editor /with-props-editor.js +4 -10
- package/dist/editors/slate-editor/editor-help/index.js +24 -37
- package/dist/editors/slate-editor/index.js +50 -64
- package/dist/editors/slate-editor/with-props-editor.js +4 -10
- package/dist/editors/slate-viewer/index.js +25 -31
- package/dist/extension/commons/element-popover/index.js +30 -55
- package/dist/extension/commons/index.js +3 -26
- package/dist/extension/commons/menu/index.js +4 -21
- package/dist/extension/commons/menu/menu-drop-down.js +50 -63
- package/dist/extension/commons/menu/menu-group.js +4 -11
- package/dist/extension/commons/menu/menu-item.js +25 -30
- package/dist/extension/commons/tooltip/index.js +14 -19
- package/dist/extension/constants/element-types.js +22 -28
- package/dist/extension/constants/index.js +15 -37
- package/dist/extension/constants/keyboard.js +3 -9
- package/dist/extension/constants/menus-config.js +118 -105
- package/dist/extension/core/index.js +3 -38
- package/dist/extension/core/queries/index.js +209 -304
- package/dist/extension/core/transforms/focus-editor.js +7 -13
- package/dist/extension/core/transforms/index.js +4 -49
- package/dist/extension/core/transforms/move-children.js +18 -25
- package/dist/extension/core/transforms/remove-node-children.js +8 -27
- package/dist/extension/core/transforms/replace-node-children.js +14 -19
- package/dist/extension/core/utils/index.js +36 -44
- package/dist/extension/editor.js +8 -15
- package/dist/extension/index.js +7 -48
- package/dist/extension/plugins/blockquote/helpers.js +38 -57
- package/dist/extension/plugins/blockquote/index.js +8 -15
- package/dist/extension/plugins/blockquote/menu/index.js +20 -25
- package/dist/extension/plugins/blockquote/plugin.js +35 -41
- package/dist/extension/plugins/blockquote/render-elem.js +9 -14
- package/dist/extension/plugins/check-list/helper.js +14 -24
- package/dist/extension/plugins/check-list/index.js +10 -17
- package/dist/extension/plugins/check-list/menu/index.js +21 -29
- package/dist/extension/plugins/check-list/plugin.js +24 -26
- package/dist/extension/plugins/check-list/render-elem.js +22 -28
- package/dist/extension/plugins/clear-format/helpers.js +25 -47
- package/dist/extension/plugins/clear-format/menu/index.js +22 -29
- package/dist/extension/plugins/code-block/helpers.js +74 -126
- package/dist/extension/plugins/code-block/index.js +10 -18
- package/dist/extension/plugins/code-block/menu/index.js +20 -27
- package/dist/extension/plugins/code-block/plugin.js +123 -144
- package/dist/extension/plugins/code-block/render-elem/constant.js +15 -11
- package/dist/extension/plugins/code-block/render-elem/index.js +30 -39
- package/dist/extension/plugins/code-block/render-elem/language-selector.js +19 -27
- package/dist/extension/plugins/formula/helper.js +39 -45
- package/dist/extension/plugins/formula/index.js +10 -17
- package/dist/extension/plugins/formula/menu/formula-modal.js +37 -52
- package/dist/extension/plugins/formula/menu/index.js +34 -50
- package/dist/extension/plugins/formula/plugin.js +12 -14
- package/dist/extension/plugins/formula/render-elem.js +27 -33
- package/dist/extension/plugins/header/helper.js +35 -48
- package/dist/extension/plugins/header/index.js +10 -17
- package/dist/extension/plugins/header/menu/index.js +52 -66
- package/dist/extension/plugins/header/plugin.js +72 -83
- package/dist/extension/plugins/header/render-elem.js +15 -20
- package/dist/extension/plugins/image/helper.js +28 -37
- package/dist/extension/plugins/image/index.js +10 -17
- package/dist/extension/plugins/image/menu/image-menu-dialog.js +31 -42
- package/dist/extension/plugins/image/menu/image-menu-popover.js +35 -67
- package/dist/extension/plugins/image/menu/index.js +24 -34
- package/dist/extension/plugins/image/plugin.js +18 -18
- package/dist/extension/plugins/image/render-element/image-previewer.js +32 -42
- package/dist/extension/plugins/image/render-element/index.js +58 -74
- package/dist/extension/plugins/index.js +18 -94
- package/dist/extension/plugins/link/helper.js +102 -139
- package/dist/extension/plugins/link/index.js +10 -17
- package/dist/extension/plugins/link/menu/index.js +46 -62
- package/dist/extension/plugins/link/menu/link-modal.js +67 -87
- package/dist/extension/plugins/link/plugin.js +52 -56
- package/dist/extension/plugins/link/render-elem/index.js +39 -54
- package/dist/extension/plugins/link/render-elem/link-popover.js +38 -42
- package/dist/extension/plugins/list/constant.js +2 -8
- package/dist/extension/plugins/list/helpers.js +40 -54
- package/dist/extension/plugins/list/index.js +10 -17
- package/dist/extension/plugins/list/menu/index.js +23 -33
- package/dist/extension/plugins/list/plugin/index.js +28 -31
- package/dist/extension/plugins/list/plugin/insert-break-list.js +9 -15
- package/dist/extension/plugins/list/plugin/insert-fragment-list.js +86 -109
- package/dist/extension/plugins/list/plugin/normalize-list.js +31 -42
- package/dist/extension/plugins/list/plugin/on-tab-handle.js +35 -34
- package/dist/extension/plugins/list/queries/index.js +22 -30
- package/dist/extension/plugins/list/render-elem/index.js +27 -27
- package/dist/extension/plugins/list/transforms/index.js +11 -75
- package/dist/extension/plugins/list/transforms/insert-list-item.js +38 -47
- package/dist/extension/plugins/list/transforms/move-list-item-down.js +22 -32
- package/dist/extension/plugins/list/transforms/move-list-item-up.js +45 -56
- package/dist/extension/plugins/list/transforms/move-list-items-to-list.js +25 -31
- package/dist/extension/plugins/list/transforms/move-list-items.js +37 -44
- package/dist/extension/plugins/list/transforms/normalize-list-item.js +57 -81
- package/dist/extension/plugins/list/transforms/normalize-nested-list.js +17 -26
- package/dist/extension/plugins/list/transforms/remove-first-list-item.js +12 -19
- package/dist/extension/plugins/list/transforms/transforms-to-list.js +60 -84
- package/dist/extension/plugins/list/transforms/unwrap-list.js +20 -29
- package/dist/extension/plugins/node-id/constants.js +9 -15
- package/dist/extension/plugins/node-id/helpers.js +33 -35
- package/dist/extension/plugins/node-id/index.js +4 -11
- package/dist/extension/plugins/node-id/with-node-id.js +18 -26
- package/dist/extension/plugins/paragraph/helper.js +7 -13
- package/dist/extension/plugins/paragraph/index.js +8 -15
- package/dist/extension/plugins/paragraph/plugin.js +25 -27
- package/dist/extension/plugins/paragraph/render-elem.js +9 -14
- package/dist/extension/plugins/table/constant.js +3 -9
- package/dist/extension/plugins/table/helper.js +133 -154
- package/dist/extension/plugins/table/index.js +11 -19
- package/dist/extension/plugins/table/menu/index.js +26 -38
- package/dist/extension/plugins/table/menu/table-operator.js +62 -77
- package/dist/extension/plugins/table/menu/table-size-selector.js +41 -62
- package/dist/extension/plugins/table/model.js +39 -41
- package/dist/extension/plugins/table/plugin.js +95 -102
- package/dist/extension/plugins/table/render-elem/context-menu.js +42 -65
- package/dist/extension/plugins/table/render-elem/index.js +85 -93
- package/dist/extension/plugins/table/table-operations.js +101 -118
- package/dist/extension/plugins/text-style/helpers.js +18 -28
- package/dist/extension/plugins/text-style/index.js +8 -15
- package/dist/extension/plugins/text-style/menu/index.js +19 -25
- package/dist/extension/plugins/text-style/plugin.js +16 -21
- package/dist/extension/plugins/text-style/render-elem.js +28 -33
- package/dist/extension/render/render-element.js +26 -47
- package/dist/extension/render/render-leaf.js +9 -18
- package/dist/extension/toolbar/header-toolbar/index.js +66 -84
- package/dist/extension/toolbar/index.js +2 -13
- package/dist/extension/toolbar/user-help/shortcut-dialog.js +108 -131
- package/dist/hooks/use-mathjax.js +9 -20
- package/dist/hooks/use-scroll-context.js +7 -12
- package/dist/hooks/use-selection-update.js +9 -21
- package/dist/index.js +9 -80
- package/dist/pages/markdown-editor.js +30 -43
- package/dist/pages/markdown-view.js +25 -37
- package/dist/pages/rich-markdown-editor.js +54 -67
- package/dist/pages/simple-editor.js +29 -42
- package/dist/slate-convert/html-to-slate/constants.js +26 -32
- package/dist/slate-convert/html-to-slate/helper.js +1 -7
- package/dist/slate-convert/html-to-slate/index.js +44 -51
- package/dist/slate-convert/html-to-slate/rules/blockquote.js +10 -15
- package/dist/slate-convert/html-to-slate/rules/check-list.js +10 -15
- package/dist/slate-convert/html-to-slate/rules/code-block.js +40 -51
- package/dist/slate-convert/html-to-slate/rules/header.js +11 -16
- package/dist/slate-convert/html-to-slate/rules/image.js +10 -15
- package/dist/slate-convert/html-to-slate/rules/index.js +11 -18
- package/dist/slate-convert/html-to-slate/rules/link.js +11 -16
- package/dist/slate-convert/html-to-slate/rules/list.js +21 -26
- package/dist/slate-convert/html-to-slate/rules/paragraph.js +10 -15
- package/dist/slate-convert/html-to-slate/rules/table.js +14 -19
- package/dist/slate-convert/html-to-slate/rules/text.js +14 -19
- package/dist/slate-convert/index.js +8 -34
- package/dist/slate-convert/md-to-html/index.js +26 -31
- package/dist/slate-convert/md-to-html/sanitize-schema.js +5 -12
- package/dist/slate-convert/md-to-slate/index.js +17 -23
- package/dist/slate-convert/md-to-slate/transform.js +183 -175
- package/dist/slate-convert/slate-to-md/index.js +14 -20
- package/dist/slate-convert/slate-to-md/transform.js +76 -87
- package/dist/utils/common.js +8 -15
- package/dist/utils/deserialize-html.js +118 -166
- package/dist/utils/dom-utils.js +18 -22
- package/dist/utils/event-bus.js +27 -47
- package/dist/utils/event-handler.js +29 -38
- package/dist/utils/object-utils.js +39 -62
- package/package.json +5 -4
|
@@ -1,49 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
id = _ref.id,
|
|
22
|
-
text = _ref.text;
|
|
23
|
-
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
24
|
-
t = _useTranslation.t;
|
|
25
|
-
var onClick = (0, _react.useCallback)(function (event) {
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import Tooltip from '../tooltip';
|
|
5
|
+
const MenuItem = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
disabled,
|
|
8
|
+
isActive,
|
|
9
|
+
isRichEditor,
|
|
10
|
+
type,
|
|
11
|
+
onMouseDown,
|
|
12
|
+
className,
|
|
13
|
+
iconClass,
|
|
14
|
+
id,
|
|
15
|
+
text
|
|
16
|
+
} = _ref;
|
|
17
|
+
const {
|
|
18
|
+
t
|
|
19
|
+
} = useTranslation();
|
|
20
|
+
const onClick = useCallback(event => {
|
|
26
21
|
if (disabled) return;
|
|
27
22
|
onMouseDown(event, type);
|
|
28
23
|
|
|
29
24
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
25
|
}, [disabled, type, onMouseDown]);
|
|
31
|
-
|
|
26
|
+
const validClassName = classnames(className, {
|
|
32
27
|
'sf-rich-editor': isRichEditor,
|
|
33
28
|
'sf-icon-btn': true,
|
|
34
29
|
'sf-icon-btn-disabled': disabled,
|
|
35
30
|
'sf-icon-btn-hover': !disabled
|
|
36
31
|
});
|
|
37
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
|
|
38
33
|
id: id,
|
|
39
34
|
type: "button",
|
|
40
35
|
className: validClassName,
|
|
41
36
|
disabled: disabled,
|
|
42
37
|
"data-active": isActive,
|
|
43
38
|
onClick: onClick
|
|
44
|
-
}, /*#__PURE__*/
|
|
39
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
45
40
|
className: iconClass
|
|
46
|
-
})), /*#__PURE__*/
|
|
41
|
+
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
47
42
|
target: id
|
|
48
43
|
}, t(text)));
|
|
49
44
|
};
|
|
@@ -51,4 +46,4 @@ MenuItem.defaultProps = {
|
|
|
51
46
|
isRichEditor: true,
|
|
52
47
|
className: 'menu-group-item'
|
|
53
48
|
};
|
|
54
|
-
|
|
49
|
+
export default MenuItem;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
children = _ref.children,
|
|
15
|
-
className = _ref.className,
|
|
16
|
-
placement = _ref.placement;
|
|
17
|
-
var popperClassName = (0, _classnames.default)('sdoc-tooltip', className);
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement(_reactstrap.UncontrolledTooltip, {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UncontrolledTooltip } from 'reactstrap';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import './index.css';
|
|
5
|
+
const Tooltip = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
target,
|
|
8
|
+
children,
|
|
9
|
+
className,
|
|
10
|
+
placement
|
|
11
|
+
} = _ref;
|
|
12
|
+
const popperClassName = classnames('sdoc-tooltip', className);
|
|
13
|
+
return /*#__PURE__*/React.createElement(UncontrolledTooltip, {
|
|
19
14
|
popperClassName: popperClassName,
|
|
20
15
|
target: target,
|
|
21
16
|
fade: false,
|
|
@@ -23,4 +18,4 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
23
18
|
delay: 0
|
|
24
19
|
}, children);
|
|
25
20
|
};
|
|
26
|
-
|
|
21
|
+
export default Tooltip;
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.UNORDERED_LIST = exports.TABLE_ROW = exports.TABLE_CELL = exports.TABLE = exports.PARAGRAPH = exports.ORDERED_LIST = exports.LIST_ITEM = exports.LINK = exports.IMAGE = exports.HEADER6 = exports.HEADER5 = exports.HEADER4 = exports.HEADER3 = exports.HEADER2 = exports.HEADER1 = exports.HEADER = exports.FORMULA = exports.COLUMN = exports.CODE_LINE = exports.CODE_BLOCK = exports.CHECK_LIST_ITEM = exports.BLOCKQUOTE = void 0;
|
|
7
|
-
var BLOCKQUOTE = exports.BLOCKQUOTE = 'blockquote';
|
|
8
|
-
var HEADER = exports.HEADER = 'header';
|
|
1
|
+
export const BLOCKQUOTE = 'blockquote';
|
|
2
|
+
export const HEADER = 'header';
|
|
9
3
|
// each header type should be start with HEADER, all of justices should based on HEADER
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
export const HEADER1 = "".concat(HEADER, "1");
|
|
5
|
+
export const HEADER2 = "".concat(HEADER, "2");
|
|
6
|
+
export const HEADER3 = "".concat(HEADER, "3");
|
|
7
|
+
export const HEADER4 = "".concat(HEADER, "4");
|
|
8
|
+
export const HEADER5 = "".concat(HEADER, "5");
|
|
9
|
+
export const HEADER6 = "".concat(HEADER, "6");
|
|
10
|
+
export const ORDERED_LIST = 'ordered_list'; // <ol>
|
|
11
|
+
export const UNORDERED_LIST = 'unordered_list'; // <ul> // unordered_list can not work
|
|
12
|
+
export const LIST_ITEM = 'list_item'; // <li>
|
|
13
|
+
export const CHECK_LIST_ITEM = 'check_list_item';
|
|
14
|
+
export const PARAGRAPH = 'paragraph';
|
|
15
|
+
export const CODE_BLOCK = 'code_block';
|
|
16
|
+
export const CODE_LINE = 'code_line';
|
|
17
|
+
export const TABLE = 'table';
|
|
18
|
+
export const TABLE_ROW = 'table_row';
|
|
19
|
+
export const TABLE_CELL = 'table_cell';
|
|
20
|
+
export const IMAGE = 'image';
|
|
21
|
+
export const LINK = 'link';
|
|
22
|
+
export const FORMULA = 'formula';
|
|
23
|
+
export const COLUMN = 'column';
|
|
@@ -1,45 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
TEXT_ALIGN: true,
|
|
14
|
-
ELementTypes: true
|
|
1
|
+
import { HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6, PARAGRAPH } from './element-types';
|
|
2
|
+
export * as ELementTypes from './element-types';
|
|
3
|
+
export * from './menus-config';
|
|
4
|
+
export const HEADERS = [HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6];
|
|
5
|
+
export const HEADER_TITLE_MAP = {
|
|
6
|
+
[HEADER1]: 'header_one',
|
|
7
|
+
[HEADER2]: 'header_two',
|
|
8
|
+
[HEADER3]: 'header_three',
|
|
9
|
+
[HEADER4]: 'header_four',
|
|
10
|
+
[HEADER5]: 'header_five',
|
|
11
|
+
[HEADER6]: 'header_six',
|
|
12
|
+
[PARAGRAPH]: 'paragraph'
|
|
15
13
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _elementTypes = _interopRequireWildcard(require("./element-types"));
|
|
19
|
-
var _ELementTypes = _elementTypes;
|
|
20
|
-
exports.ELementTypes = _elementTypes;
|
|
21
|
-
var _menusConfig = require("./menus-config");
|
|
22
|
-
Object.keys(_menusConfig).forEach(function (key) {
|
|
23
|
-
if (key === "default" || key === "__esModule") return;
|
|
24
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
25
|
-
if (key in exports && exports[key] === _menusConfig[key]) return;
|
|
26
|
-
Object.defineProperty(exports, key, {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function get() {
|
|
29
|
-
return _menusConfig[key];
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
var _HEADER_TITLE_MAP;
|
|
34
|
-
var HEADERS = exports.HEADERS = [_elementTypes.HEADER1, _elementTypes.HEADER2, _elementTypes.HEADER3, _elementTypes.HEADER4, _elementTypes.HEADER5, _elementTypes.HEADER6];
|
|
35
|
-
var HEADER_TITLE_MAP = exports.HEADER_TITLE_MAP = (_HEADER_TITLE_MAP = {}, (0, _defineProperty2.default)(_HEADER_TITLE_MAP, _elementTypes.HEADER1, 'header_one'), (0, _defineProperty2.default)(_HEADER_TITLE_MAP, _elementTypes.HEADER2, 'header_two'), (0, _defineProperty2.default)(_HEADER_TITLE_MAP, _elementTypes.HEADER3, 'header_three'), (0, _defineProperty2.default)(_HEADER_TITLE_MAP, _elementTypes.HEADER4, 'header_four'), (0, _defineProperty2.default)(_HEADER_TITLE_MAP, _elementTypes.HEADER5, 'header_five'), (0, _defineProperty2.default)(_HEADER_TITLE_MAP, _elementTypes.HEADER6, 'header_six'), (0, _defineProperty2.default)(_HEADER_TITLE_MAP, _elementTypes.PARAGRAPH, 'paragraph'), _HEADER_TITLE_MAP);
|
|
36
|
-
var LIST_TYPE_ARRAY = exports.LIST_TYPE_ARRAY = ['unordered_list', 'ordered_list'];
|
|
37
|
-
var INSERT_POSITION = exports.INSERT_POSITION = {
|
|
14
|
+
export const LIST_TYPE_ARRAY = ['unordered_list', 'ordered_list'];
|
|
15
|
+
export const INSERT_POSITION = {
|
|
38
16
|
BEFORE: 'before',
|
|
39
17
|
CURRENT: 'current',
|
|
40
18
|
AFTER: 'after'
|
|
41
19
|
};
|
|
42
|
-
|
|
20
|
+
export const TEXT_ALIGN = {
|
|
43
21
|
LEFT: 'left',
|
|
44
22
|
CENTER: 'center',
|
|
45
23
|
RIGHT: 'right'
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.WIN_HOTKEYS_EVENT_HEADER = exports.MAC_HOTKEYS_TIP_HEADER = exports.MAC_HOTKEYS_EVENT_HEADER = void 0;
|
|
7
|
-
var MAC_HOTKEYS_TIP_HEADER = exports.MAC_HOTKEYS_TIP_HEADER = {
|
|
1
|
+
export const MAC_HOTKEYS_TIP_HEADER = {
|
|
8
2
|
paragraph: '⌘+⌥+0',
|
|
9
3
|
header1: '⌘+⌥+1',
|
|
10
4
|
header2: '⌘+⌥+2',
|
|
@@ -13,7 +7,7 @@ var MAC_HOTKEYS_TIP_HEADER = exports.MAC_HOTKEYS_TIP_HEADER = {
|
|
|
13
7
|
header5: '⌘+⌥+5',
|
|
14
8
|
header6: '⌘+⌥+6'
|
|
15
9
|
};
|
|
16
|
-
|
|
10
|
+
export const WIN_HOTKEYS_EVENT_HEADER = {
|
|
17
11
|
paragraph: 'ctrl+alt+0',
|
|
18
12
|
header1: 'ctrl+alt+1',
|
|
19
13
|
header2: 'ctrl+alt+2',
|
|
@@ -22,7 +16,7 @@ var WIN_HOTKEYS_EVENT_HEADER = exports.WIN_HOTKEYS_EVENT_HEADER = {
|
|
|
22
16
|
header5: 'ctrl+alt+5',
|
|
23
17
|
header6: 'ctrl+alt+6'
|
|
24
18
|
};
|
|
25
|
-
|
|
19
|
+
export const MAC_HOTKEYS_EVENT_HEADER = {
|
|
26
20
|
paragraph: 'cmd+opt+0',
|
|
27
21
|
header1: 'cmd+opt+1',
|
|
28
22
|
header2: 'cmd+opt+2',
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _MENUS_CONFIG_MAP;
|
|
11
|
-
var BOLD = 'bold';
|
|
12
|
-
var ITALIC = 'italic';
|
|
13
|
-
var UNDERLINE = 'underline';
|
|
14
|
-
var CODE = 'code';
|
|
15
|
-
var DELETE = 'delete';
|
|
16
|
-
var ADD = 'add';
|
|
17
|
-
var CLEAR_FORMAT = exports.CLEAR_FORMAT = 'clear_format';
|
|
18
|
-
var TEXT_STYLE_MAP = exports.TEXT_STYLE_MAP = {
|
|
1
|
+
import { BLOCKQUOTE, ORDERED_LIST, UNORDERED_LIST, CHECK_LIST_ITEM, CODE_BLOCK, TABLE, LINK, IMAGE, FORMULA } from './element-types';
|
|
2
|
+
const BOLD = 'bold';
|
|
3
|
+
const ITALIC = 'italic';
|
|
4
|
+
const UNDERLINE = 'underline';
|
|
5
|
+
const CODE = 'code';
|
|
6
|
+
const DELETE = 'delete';
|
|
7
|
+
const ADD = 'add';
|
|
8
|
+
export const CLEAR_FORMAT = 'clear_format';
|
|
9
|
+
export const TEXT_STYLE_MAP = {
|
|
19
10
|
BOLD: BOLD,
|
|
20
11
|
ITALIC: ITALIC,
|
|
21
12
|
UNDERLINE: UNDERLINE,
|
|
@@ -23,7 +14,7 @@ var TEXT_STYLE_MAP = exports.TEXT_STYLE_MAP = {
|
|
|
23
14
|
DELETE: DELETE,
|
|
24
15
|
ADD: ADD
|
|
25
16
|
};
|
|
26
|
-
|
|
17
|
+
export const TABLE_SUBMENU_MAP = {
|
|
27
18
|
TABLE_ALIGN_LEFT: 'table_align_left',
|
|
28
19
|
TABLE_ALIGN_CENTER: 'table_align_center',
|
|
29
20
|
TABLE_ALIGN_RIGHT: 'table_align_right',
|
|
@@ -33,89 +24,111 @@ var TABLE_SUBMENU_MAP = exports.TABLE_SUBMENU_MAP = {
|
|
|
33
24
|
TABLE_REMOVE_ROW: 'table_remove_row',
|
|
34
25
|
TABLE_DELETE_TABLE: 'table_delete_table'
|
|
35
26
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
27
|
+
export const MENUS_CONFIG_MAP = {
|
|
28
|
+
[BLOCKQUOTE]: {
|
|
29
|
+
id: "seafile_".concat(BLOCKQUOTE),
|
|
30
|
+
iconClass: 'iconfont icon-quote-left',
|
|
31
|
+
text: 'Quote'
|
|
32
|
+
},
|
|
33
|
+
[ORDERED_LIST]: {
|
|
34
|
+
id: "seafile_".concat(ORDERED_LIST),
|
|
35
|
+
iconClass: 'iconfont icon-list-ol',
|
|
36
|
+
text: 'Ordered_list'
|
|
37
|
+
},
|
|
38
|
+
[UNORDERED_LIST]: {
|
|
39
|
+
id: "seafile_".concat(UNORDERED_LIST),
|
|
40
|
+
iconClass: 'iconfont icon-list-ul',
|
|
41
|
+
text: 'Unordered_list'
|
|
42
|
+
},
|
|
43
|
+
[CHECK_LIST_ITEM]: {
|
|
44
|
+
id: "seafle_".concat(CHECK_LIST_ITEM),
|
|
45
|
+
iconClass: 'iconfont icon-check-square',
|
|
46
|
+
text: 'Check_list_item'
|
|
47
|
+
},
|
|
48
|
+
[CODE_BLOCK]: {
|
|
49
|
+
id: "seafile_".concat(CODE_BLOCK),
|
|
50
|
+
iconClass: 'iconfont icon-code-block',
|
|
51
|
+
text: 'Code_block'
|
|
52
|
+
},
|
|
53
|
+
[LINK]: {
|
|
54
|
+
id: "seafile_".concat(LINK),
|
|
55
|
+
iconClass: 'iconfont icon-link',
|
|
56
|
+
text: 'Insert_link'
|
|
57
|
+
},
|
|
58
|
+
[IMAGE]: {
|
|
59
|
+
id: "seafile_".concat(IMAGE),
|
|
60
|
+
iconClass: 'iconfont icon-image',
|
|
61
|
+
text: 'Insert_image'
|
|
62
|
+
},
|
|
63
|
+
[TABLE]: {
|
|
64
|
+
id: "seafile_".concat(TABLE),
|
|
65
|
+
iconClass: 'iconfont icon-table',
|
|
66
|
+
text: 'Insert_table'
|
|
67
|
+
},
|
|
68
|
+
[ITALIC]: {
|
|
69
|
+
id: "seafile_".concat(ITALIC),
|
|
70
|
+
iconClass: 'iconfont icon-italic',
|
|
71
|
+
text: 'Italic',
|
|
72
|
+
type: ITALIC
|
|
73
|
+
},
|
|
74
|
+
[BOLD]: {
|
|
75
|
+
id: "seafile_".concat(BOLD),
|
|
76
|
+
iconClass: 'iconfont icon-bold',
|
|
77
|
+
text: 'Bold',
|
|
78
|
+
type: BOLD
|
|
79
|
+
},
|
|
80
|
+
[CODE]: {
|
|
81
|
+
id: "seafile_".concat(CODE),
|
|
82
|
+
iconClass: 'iconfont icon-code',
|
|
83
|
+
text: 'Code',
|
|
84
|
+
type: CODE
|
|
85
|
+
},
|
|
86
|
+
[TABLE_SUBMENU_MAP.TABLE_ALIGN_LEFT]: {
|
|
87
|
+
id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_ALIGN_LEFT),
|
|
88
|
+
iconClass: 'iconfont icon-left-alignment',
|
|
89
|
+
text: 'Left'
|
|
90
|
+
},
|
|
91
|
+
[TABLE_SUBMENU_MAP.TABLE_ALIGN_CENTER]: {
|
|
92
|
+
id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_ALIGN_CENTER),
|
|
93
|
+
iconClass: 'iconfont icon-center-horizontally',
|
|
94
|
+
text: 'Center'
|
|
95
|
+
},
|
|
96
|
+
[TABLE_SUBMENU_MAP.TABLE_ALIGN_RIGHT]: {
|
|
97
|
+
id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_ALIGN_RIGHT),
|
|
98
|
+
iconClass: 'iconfont icon-align-right',
|
|
99
|
+
text: 'Right'
|
|
100
|
+
},
|
|
101
|
+
[TABLE_SUBMENU_MAP.TABLE_INSERT_COLUMN]: {
|
|
102
|
+
id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_INSERT_COLUMN),
|
|
103
|
+
iconClass: 'iconfont icon-column',
|
|
104
|
+
text: 'Insert_column'
|
|
105
|
+
},
|
|
106
|
+
[TABLE_SUBMENU_MAP.TABLE_REMOVE_COLUMN]: {
|
|
107
|
+
id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_REMOVE_COLUMN),
|
|
108
|
+
text: 'Remove_column'
|
|
109
|
+
},
|
|
110
|
+
[TABLE_SUBMENU_MAP.TABLE_INSERT_ROW]: {
|
|
111
|
+
id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_INSERT_ROW),
|
|
112
|
+
iconClass: 'iconfont icon-row',
|
|
113
|
+
text: 'Insert_row'
|
|
114
|
+
},
|
|
115
|
+
[TABLE_SUBMENU_MAP.TABLE_REMOVE_ROW]: {
|
|
116
|
+
id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_REMOVE_ROW),
|
|
117
|
+
text: 'Remove_row'
|
|
118
|
+
},
|
|
119
|
+
[TABLE_SUBMENU_MAP.TABLE_DELETE_TABLE]: {
|
|
120
|
+
id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_DELETE_TABLE),
|
|
121
|
+
iconClass: 'iconfont icon-delete-table',
|
|
122
|
+
text: 'Remove_table'
|
|
123
|
+
},
|
|
124
|
+
[FORMULA]: {
|
|
125
|
+
id: "seafile_".concat(FORMULA),
|
|
126
|
+
iconClass: 'iconfont icon-formula',
|
|
127
|
+
text: 'Insert_formula'
|
|
128
|
+
},
|
|
129
|
+
[CLEAR_FORMAT]: {
|
|
130
|
+
id: "seafile_".concat(CLEAR_FORMAT),
|
|
131
|
+
iconClass: 'iconfont icon-clear-format',
|
|
132
|
+
text: 'Clear_format'
|
|
133
|
+
}
|
|
134
|
+
};
|
|
@@ -1,38 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _index = require("./queries/index");
|
|
7
|
-
Object.keys(_index).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _index[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _index[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _index2 = require("./transforms/index");
|
|
18
|
-
Object.keys(_index2).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _index2[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return _index2[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _index3 = require("./utils/index");
|
|
29
|
-
Object.keys(_index3).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _index3[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function get() {
|
|
35
|
-
return _index3[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
1
|
+
export * from './queries/index';
|
|
2
|
+
export * from './transforms/index';
|
|
3
|
+
export * from './utils/index';
|