@seafile/seafile-editor 0.3.116 → 0.3.118
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/assets/editor/seatable-editor.css +77 -0
- package/dist/components/add-image-dialog.js +2 -1
- package/dist/components/add-link-dialog.js +2 -1
- package/dist/components/context-menu.js +1 -1
- package/dist/components/shortcut-dialog.js +2 -1
- package/dist/editor/controller/inline-element-controller.js +1 -0
- package/dist/editor/editor-builder.js +5 -3
- package/dist/editor/editor-component/image.js +1 -1
- package/dist/editor/editor-component/textlink-hovermenu.js +1 -1
- package/dist/editor/seatable-editor.js +2 -2
- package/dist/utils/seafile-markdown2html.js +1 -1
- package/dist/utils/slate2markdown/serialize.js +9 -0
- package/dist/viewer/viewer-image.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
.seatable-simple-editor {
|
|
2
|
+
flex: 1;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
height: 100%;
|
|
6
|
+
min-width: 768px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
border: 1px solid #e5e5e5;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.seatable-simple-editor .seafile-editor-topbar {
|
|
12
|
+
width: 100%;
|
|
13
|
+
background-color: #fff;
|
|
14
|
+
border-bottom: 1px solid #e5e5e5;
|
|
15
|
+
box-shadow: 0 3px 2px -2px rgba(200,200,200,.15);
|
|
16
|
+
user-select: none;
|
|
17
|
+
position: relative;
|
|
18
|
+
z-index: 3;
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.seatable-simple-editor .seafile-editor-topbar .use-help-icon {
|
|
24
|
+
background-color: #fff;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.seatable-simple-editor .seafile-editor-topbar .editor-btn-group {
|
|
29
|
+
height: 100%;
|
|
30
|
+
padding: 5px 0 5px 5px;
|
|
31
|
+
font-size: 0.75rem;
|
|
32
|
+
border-right: 1px solid #e5e5e5;
|
|
33
|
+
color: #555555;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.seatable-simple-editor .header-list-container {
|
|
37
|
+
border-left: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.seatable-simple-editor .editor {
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding: 10px;
|
|
43
|
+
height: 100%;
|
|
44
|
+
border: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/*set scroll bar*/
|
|
48
|
+
.editor-container::-webkit-scrollbar{
|
|
49
|
+
width: 8px;
|
|
50
|
+
height: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.editor-container::-webkit-scrollbar-button {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.editor-container::-webkit-scrollbar-thumb {
|
|
58
|
+
background-color: rgb(206, 206, 212);
|
|
59
|
+
border-radius: 10px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.editor-container {
|
|
63
|
+
/* this container is needed to show the scroll bar */
|
|
64
|
+
height: 100%;
|
|
65
|
+
overflow-y: auto;
|
|
66
|
+
flex: 1 1 auto;
|
|
67
|
+
position: relative;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.editor {
|
|
71
|
+
min-height: calc(100% - 40px);
|
|
72
|
+
background: #fff;
|
|
73
|
+
padding: 40px 60px;
|
|
74
|
+
margin: 20px 40px;
|
|
75
|
+
border: 1px solid rgb(230,230,221);
|
|
76
|
+
overflow-x: hidden;
|
|
77
|
+
}
|
|
@@ -53,7 +53,8 @@ var AddImageDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
53
53
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
54
54
|
isOpen: true,
|
|
55
55
|
toggle: this.props.onToggleImageDialog,
|
|
56
|
-
className: this.props.className
|
|
56
|
+
className: this.props.className,
|
|
57
|
+
zIndex: 1071
|
|
57
58
|
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
58
59
|
toggle: this.props.onToggleImageDialog
|
|
59
60
|
}, this.props.t('insert_image')), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(FormGroup, null, /*#__PURE__*/React.createElement(Label, {
|
|
@@ -104,7 +104,8 @@ var AddLinkDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
104
104
|
isOpen: true,
|
|
105
105
|
autoFocus: false,
|
|
106
106
|
toggle: this.props.toggleLinkDialog,
|
|
107
|
-
className: this.props.className
|
|
107
|
+
className: this.props.className,
|
|
108
|
+
zIndex: 1071
|
|
108
109
|
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
109
110
|
toggle: this.props.toggleLinkDialog
|
|
110
111
|
}, this.props.t('insert_link')), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -59,7 +59,8 @@ var KeyboardShortcuts = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
59
59
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
60
60
|
isOpen: true,
|
|
61
61
|
toggle: toggleShortcutDialog,
|
|
62
|
-
className: "keyboard-shortcut-dialog"
|
|
62
|
+
className: "keyboard-shortcut-dialog",
|
|
63
|
+
zIndex: 1071
|
|
63
64
|
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
64
65
|
toggle: toggleShortcutDialog
|
|
65
66
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -17,6 +17,7 @@ var EditorBuilder = /*#__PURE__*/function () {
|
|
|
17
17
|
_classCallCheck(this, EditorBuilder);
|
|
18
18
|
|
|
19
19
|
this.editor = null;
|
|
20
|
+
this.slateEditor = null;
|
|
20
21
|
this.plugin = null;
|
|
21
22
|
this.tableUtils = null;
|
|
22
23
|
this.editorUtils = null;
|
|
@@ -59,14 +60,15 @@ var EditorBuilder = /*#__PURE__*/function () {
|
|
|
59
60
|
}, {
|
|
60
61
|
key: "getSlateEditor",
|
|
61
62
|
value: function getSlateEditor() {
|
|
62
|
-
if (this.
|
|
63
|
-
this.
|
|
64
|
-
return this.
|
|
63
|
+
if (this.slateEditor) return this.slateEditor;
|
|
64
|
+
this.slateEditor = withInline(withVoid(withReact(createEditor())));
|
|
65
|
+
return this.slateEditor;
|
|
65
66
|
}
|
|
66
67
|
}, {
|
|
67
68
|
key: "resetEditor",
|
|
68
69
|
value: function resetEditor() {
|
|
69
70
|
this.editor = null;
|
|
71
|
+
this.slateEditor = null;
|
|
70
72
|
this.plugin = null;
|
|
71
73
|
this.editorUtils = null;
|
|
72
74
|
this.tableUtils = null;
|
|
@@ -18,7 +18,7 @@ import EditorBuilder from './editor-builder';
|
|
|
18
18
|
import AddLinkDialog from '../components/add-link-dialog';
|
|
19
19
|
import ErrorBoundary from '../components/error-boundary';
|
|
20
20
|
import './code-highlight-package';
|
|
21
|
-
import '../assets/editor/
|
|
21
|
+
import '../assets/editor/seatable-editor.css';
|
|
22
22
|
import '../assets/css/image.css';
|
|
23
23
|
import '../assets/css/link.css';
|
|
24
24
|
import '../assets/css/navbar-imgbutton.css';
|
|
@@ -171,7 +171,7 @@ var SeatableEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
171
171
|
var supportInsertColumn = canInsertColumn && columns.length > 0;
|
|
172
172
|
var selectionCollapsed = isRangeCollapsed(editor.selection);
|
|
173
173
|
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement("div", {
|
|
174
|
-
className: "
|
|
174
|
+
className: "seatable-simple-editor"
|
|
175
175
|
}, /*#__PURE__*/React.createElement("div", {
|
|
176
176
|
className: "seafile-editor-topbar"
|
|
177
177
|
}, /*#__PURE__*/React.createElement(Toolbar, {
|
|
@@ -367,6 +367,15 @@ function _slateNodeToMD(node) {
|
|
|
367
367
|
value: data.formula
|
|
368
368
|
};
|
|
369
369
|
|
|
370
|
+
case 'column':
|
|
371
|
+
{
|
|
372
|
+
var _data = node.data;
|
|
373
|
+
var newNode = {
|
|
374
|
+
text: "{".concat(_data.name, "}")
|
|
375
|
+
};
|
|
376
|
+
return _text2MdNodes(newNode);
|
|
377
|
+
}
|
|
378
|
+
|
|
370
379
|
default:
|
|
371
380
|
// turn the block to paragraph default when it`s type is unknown
|
|
372
381
|
mdNodes = parseChildren(node);
|