@seafile/seafile-editor 0.3.81 → 0.3.85
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/components/add-formula-dialog.js +0 -0
- package/dist/components/add-image-dialog.js +0 -0
- package/dist/components/add-link-dialog.js +0 -0
- package/dist/components/click-outside.js +0 -0
- package/dist/components/comment-dialog.js +0 -0
- package/dist/components/comment-panel.js +0 -0
- package/dist/components/context-menu.js +0 -0
- package/dist/components/detail-list-view.js +0 -0
- package/dist/components/generate-share-link.js +0 -0
- package/dist/components/internal-link-dialog.js +0 -0
- package/dist/components/loading.js +0 -0
- package/dist/components/markdown-lint.js +0 -0
- package/dist/components/modal-portal.js +0 -0
- package/dist/components/outline.js +0 -0
- package/dist/components/participants-list.js +0 -0
- package/dist/components/related-files-list.js +0 -0
- package/dist/components/shortcut-dialog.js +0 -0
- package/dist/components/side-panel.js +0 -0
- package/dist/components/table-button.js +18 -19
- package/dist/components/toast/alert.js +0 -0
- package/dist/components/toast/index.js +0 -0
- package/dist/components/toast/toast.js +0 -0
- package/dist/components/toast/toastManager.js +0 -0
- package/dist/components/toast/toaster.js +0 -0
- package/dist/components/toolbar.js +0 -0
- package/dist/components/topbar-component/button-group.js +0 -0
- package/dist/components/topbar-component/editor-toolbar.js +0 -0
- package/dist/components/topbar-component/file-info.js +0 -0
- package/dist/components/topbar-component/header-list.js +0 -0
- package/dist/components/topbar-component/icon-button.js +0 -0
- package/dist/components/topbar-component/insert-file.js +0 -0
- package/dist/components/topbar-component/table-toolbar.js +0 -0
- package/dist/components/topbar-component/upload-img.js +0 -0
- package/dist/components/user-help.js +0 -0
- package/dist/css/diff-viewer.css +0 -0
- package/dist/css/history-viewer.css +0 -0
- package/dist/css/keyboard-shortcuts.css +0 -0
- package/dist/css/layout.css +0 -0
- package/dist/css/markdown-viewer-slate/file-tags-list.css +0 -0
- package/dist/css/markdown-viewer.css +0 -0
- package/dist/css/plaineditor/markdown-editor.css +0 -0
- package/dist/css/react-mentions-default-style.js +0 -0
- package/dist/css/related-files-list.css +0 -0
- package/dist/css/richeditor/comments-list.css +0 -0
- package/dist/css/richeditor/detail-list-view.css +0 -0
- package/dist/css/richeditor/document-info.css +0 -0
- package/dist/css/richeditor/formula.css +0 -0
- package/dist/css/richeditor/image.css +29 -32
- package/dist/css/richeditor/link.css +0 -0
- package/dist/css/richeditor/navbar-imgbutton.css +0 -0
- package/dist/css/richeditor/participants-list.css +0 -0
- package/dist/css/richeditor/rich-editor-main.css +0 -0
- package/dist/css/richeditor/right-panel.css +0 -0
- package/dist/css/richeditor/side-panel.css +0 -0
- package/dist/css/richeditor/table.css +0 -0
- package/dist/css/richeditor/textlink-hovermenu.css +0 -0
- package/dist/css/richeditor/tree-view.css +0 -0
- package/dist/css/topbar.css +0 -0
- package/dist/editor/code-highlight-package.js +0 -0
- package/dist/editor/controller/block-element-controller.js +0 -0
- package/dist/editor/controller/inline-element-controller.js +0 -0
- package/dist/editor/controller/normalize-controller.js +0 -0
- package/dist/editor/controller/shortcut-controller.js +0 -0
- package/dist/editor/controller/void-element-controller.js +0 -0
- package/dist/editor/custom/custom.js +0 -0
- package/dist/editor/custom/get-event-transfer.js +0 -0
- package/dist/editor/custom/getNodesByTypeAtRange.js +0 -0
- package/dist/editor/custom/insertNodes.js +0 -0
- package/dist/editor/custom/is-empty-paragraph.js +0 -0
- package/dist/editor/custom/set-event-transfer.js +0 -0
- package/dist/editor/custom/split-nodes-at-point.js +0 -0
- package/dist/editor/custom/unwrap-node-by-type-at-range.js +0 -0
- package/dist/editor/editor-component/check-list-item.js +0 -0
- package/dist/editor/editor-component/code-block.js +0 -0
- package/dist/editor/editor-component/formula.js +0 -0
- package/dist/editor/editor-component/image.js +96 -32
- package/dist/editor/editor-component/link.js +0 -0
- package/dist/editor/editor-component/table.js +0 -0
- package/dist/editor/editor-component/textlink-hovermenu.js +0 -0
- package/dist/editor/editor-plugin.js +27 -31
- package/dist/editor/editor-utils/block-element-utils/blockquote-utils.js +0 -0
- package/dist/editor/editor-utils/block-element-utils/code-utils.js +0 -0
- package/dist/editor/editor-utils/block-element-utils/formula-utils.js +0 -0
- package/dist/editor/editor-utils/block-element-utils/index.js +0 -0
- package/dist/editor/editor-utils/block-element-utils/list-utils.js +0 -0
- package/dist/editor/editor-utils/block-element-utils/table-utils.js +0 -0
- package/dist/editor/editor-utils/common-editor-utils.js +0 -0
- package/dist/editor/editor-utils/inline-element-utils/index.js +0 -0
- package/dist/editor/editor-utils/mark-utils.js +0 -0
- package/dist/editor/editor-utils/range-utils.js +0 -0
- package/dist/editor/editor-utils/selection-utils.js +0 -0
- package/dist/editor/editor-utils/text-utils.js +0 -0
- package/dist/editor/editor.js +0 -0
- package/dist/editor/element-model/blockquote.js +0 -0
- package/dist/editor/element-model/image.js +0 -0
- package/dist/editor/element-model/link.js +0 -0
- package/dist/editor/element-model/table.js +0 -0
- package/dist/editor/element-model/text.js +0 -0
- package/dist/editor/load-script.js +0 -0
- package/dist/editor/plain-markdown-editor.js +0 -0
- package/dist/editor/rich-markdown-editor.js +0 -0
- package/dist/editor/seafile-editor.js +0 -0
- package/dist/editor/simple-editor.js +0 -0
- package/dist/editor-api.js +0 -0
- package/dist/index.css +0 -0
- package/dist/lib/slate-hyperscript/creators.js +0 -0
- package/dist/lib/slate-hyperscript/hyperscript.js +0 -0
- package/dist/lib/slate-hyperscript/index.js +0 -0
- package/dist/lib/slate-hyperscript/tokens.js +0 -0
- package/dist/lib/unified/index.js +0 -0
- package/dist/lib/vfile/core.js +0 -0
- package/dist/lib/vfile/index.js +0 -0
- package/dist/seafile-editor-chooser.js +0 -0
- package/dist/seafile-markdown-editor.js +0 -0
- package/dist/seafile-markdown-viewer.js +0 -0
- package/dist/seafile-simple-editor.js +0 -0
- package/dist/utils/copy-to-clipboard.js +0 -0
- package/dist/utils/deserialize-html.js +0 -0
- package/dist/utils/diff/compare-strings.js +0 -0
- package/dist/utils/diff/diff.js +0 -0
- package/dist/utils/diff/index.js +0 -0
- package/dist/utils/render-slate.js +0 -0
- package/dist/utils/seafile-markdown2html.js +0 -0
- package/dist/utils/slate2markdown/deserialize.js +1 -1
- package/dist/utils/slate2markdown/index.js +0 -0
- package/dist/utils/slate2markdown/serialize.js +0 -0
- package/dist/utils/utils.js +0 -0
- package/dist/viewer/diff-viewer.js +0 -0
- package/dist/viewer/markdown-viewer.js +0 -0
- package/dist/viewer/slate-viewer.js +0 -0
- package/dist/viewer/viewer-formula.js +0 -0
- package/dist/viewer/viewer-image.js +0 -0
- package/dist/viewer/viewer-outline.js +0 -0
- package/package.json +2 -1
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -0
- package/public/locales/cs/seafile-editor.json +0 -0
- package/public/locales/de/seafile-editor.json +0 -0
- package/public/locales/en/seafile-editor.json +0 -0
- package/public/locales/es/seafile-editor.json +0 -0
- package/public/locales/es-AR/seafile-editor.json +0 -0
- package/public/locales/es-MX/seafile-editor.json +0 -0
- package/public/locales/fr/seafile-editor.json +0 -0
- package/public/locales/it/seafile-editor.json +0 -0
- package/public/locales/ru/seafile-editor.json +0 -0
- package/public/locales/zh-CN/seafile-editor.json +0 -0
- package/public/manifest.json +0 -0
- package/public/media/scripts/mathjax/tex-svg.js +0 -0
- package/public/media/seafile-editor-font/iconfont.eot +0 -0
- package/public/media/seafile-editor-font/iconfont.svg +117 -162
- package/public/media/seafile-editor-font/iconfont.ttf +0 -0
- package/public/media/seafile-editor-font/iconfont.woff +0 -0
- package/public/media/seafile-editor-font/iconfont.woff2 +0 -0
- package/public/media/seafile-editor-font.css +24 -7
- package/public/media/seafile-logo.png +0 -0
- package/public/media/seafile-ui.css +0 -0
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -79,25 +79,26 @@ var TableButton = /*#__PURE__*/function (_Component) {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
_this.onTableCellMouseEnter = function (rowIndex, columnIndex) {
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
var columnCount = columnIndex + 1,
|
|
83
|
+
rowCount = rowIndex + 1;
|
|
84
|
+
var currentMaxRowCount = rowCount + 1,
|
|
85
|
+
currentMaxColumnCount = columnCount + 1;
|
|
86
|
+
|
|
87
|
+
if (currentMaxColumnCount > 10) {
|
|
88
|
+
currentMaxColumnCount = 10;
|
|
89
|
+
} else if (currentMaxColumnCount < 4) {
|
|
90
|
+
currentMaxColumnCount = 4;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
if (
|
|
93
|
-
currentMaxRowCount
|
|
94
|
-
} else if (
|
|
95
|
-
currentMaxRowCount
|
|
93
|
+
if (currentMaxRowCount > 10) {
|
|
94
|
+
currentMaxRowCount = 10;
|
|
95
|
+
} else if (currentMaxRowCount < 4) {
|
|
96
|
+
currentMaxRowCount = 4;
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
_this.setState({
|
|
99
|
-
columnCount:
|
|
100
|
-
rowCount:
|
|
100
|
+
columnCount: columnCount,
|
|
101
|
+
rowCount: rowCount,
|
|
101
102
|
currentMaxColumnCount: currentMaxColumnCount,
|
|
102
103
|
currentMaxRowCount: currentMaxRowCount
|
|
103
104
|
});
|
|
@@ -110,17 +111,15 @@ var TableButton = /*#__PURE__*/function (_Component) {
|
|
|
110
111
|
columnCount: -1,
|
|
111
112
|
rowCount: -1
|
|
112
113
|
};
|
|
113
|
-
_this.maxColumnCount = 10;
|
|
114
|
-
_this.maxRowCount = 10;
|
|
115
114
|
return _this;
|
|
116
115
|
}
|
|
117
116
|
|
|
118
117
|
_createClass(TableButton, [{
|
|
119
118
|
key: "createTableScaleCard",
|
|
120
119
|
value: function createTableScaleCard(props) {
|
|
121
|
-
var _this$
|
|
122
|
-
columnCount = _this$
|
|
123
|
-
rowCount = _this$
|
|
120
|
+
var _this$state2 = this.state,
|
|
121
|
+
columnCount = _this$state2.columnCount,
|
|
122
|
+
rowCount = _this$state2.rowCount;
|
|
124
123
|
return /*#__PURE__*/React.createElement("div", {
|
|
125
124
|
className: "sf-editor-table-count-card"
|
|
126
125
|
}, /*#__PURE__*/React.createElement("div", {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/css/diff-viewer.css
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/css/layout.css
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -98,44 +98,41 @@
|
|
|
98
98
|
display: inline;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
z-index: 1049;
|
|
109
|
-
text-align: center;
|
|
101
|
+
/* set button font style in image previewer */
|
|
102
|
+
.sf-editor-image-previewer .dtable-icon-left {
|
|
103
|
+
font-family: "iconfont" !important;
|
|
104
|
+
font-size: 16px;
|
|
105
|
+
font-style: normal;
|
|
106
|
+
-webkit-font-smoothing: antialiased;
|
|
107
|
+
-moz-osx-font-smoothing: grayscale;
|
|
110
108
|
}
|
|
111
109
|
|
|
112
|
-
.
|
|
113
|
-
|
|
114
|
-
width: 100%;
|
|
115
|
-
top: 50px;
|
|
116
|
-
bottom: 0;
|
|
117
|
-
overflow-y: auto;
|
|
118
|
-
padding: 0 30px 10px 30px;
|
|
110
|
+
.sf-editor-image-previewer .dtable-icon-left:before {
|
|
111
|
+
content: "\e756";
|
|
119
112
|
}
|
|
120
113
|
|
|
121
|
-
.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
z-index: 10000;
|
|
129
|
-
font-size: 20px;
|
|
130
|
-
color: hsla(0,0%,100%,.6);
|
|
131
|
-
line-height: 26px;
|
|
132
|
-
text-align: center;
|
|
114
|
+
.sf-editor-image-previewer .dtable-icon-right {
|
|
115
|
+
font-family: "iconfont" !important;
|
|
116
|
+
font-size: 16px;
|
|
117
|
+
font-style: normal;
|
|
118
|
+
-webkit-font-smoothing: antialiased;
|
|
119
|
+
-moz-osx-font-smoothing: grayscale;
|
|
120
|
+
line-height: normal;
|
|
133
121
|
}
|
|
134
122
|
|
|
135
|
-
.image-
|
|
136
|
-
|
|
123
|
+
.sf-editor-image-previewer .dtable-icon-right:before {
|
|
124
|
+
content: "\e755";
|
|
137
125
|
}
|
|
138
126
|
|
|
139
|
-
.
|
|
140
|
-
|
|
127
|
+
.sf-editor-image-previewer button.dtable-icon-fork-number {
|
|
128
|
+
font-family: "iconfont" !important;
|
|
129
|
+
font-size: 16px;
|
|
130
|
+
font-style: normal;
|
|
131
|
+
-webkit-font-smoothing: antialiased;
|
|
132
|
+
-moz-osx-font-smoothing: grayscale;
|
|
133
|
+
line-height: normal;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.sf-editor-image-previewer .dtable-icon-fork-number:before {
|
|
137
|
+
content: "\e6ce";
|
|
141
138
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/css/topbar.css
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
5
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
6
|
import React from 'react';
|
|
6
7
|
import { withTranslation } from 'react-i18next';
|
|
8
|
+
import Lightbox from '@seafile/react-image-lightbox';
|
|
7
9
|
import { Utils } from '../../utils/utils';
|
|
8
10
|
import InlineElementUtils from '../editor-utils/inline-element-utils';
|
|
9
|
-
import
|
|
11
|
+
import '@seafile/react-image-lightbox/style.css';
|
|
10
12
|
|
|
11
13
|
var Image = /*#__PURE__*/function (_React$Component) {
|
|
12
14
|
_inherits(Image, _React$Component);
|
|
@@ -86,10 +88,10 @@ var Image = /*#__PURE__*/function (_React$Component) {
|
|
|
86
88
|
_this.imgSrc = src;
|
|
87
89
|
};
|
|
88
90
|
|
|
89
|
-
_this.
|
|
90
|
-
return /*#__PURE__*/React.createElement(
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
_this.renderImagePreviewer = function () {
|
|
92
|
+
return /*#__PURE__*/React.createElement(ImagePreviewer, {
|
|
93
|
+
imageUrl: _this.imgSrc,
|
|
94
|
+
toggleImagePreviewer: _this.toggleBigImage
|
|
93
95
|
});
|
|
94
96
|
};
|
|
95
97
|
|
|
@@ -164,7 +166,7 @@ var Image = /*#__PURE__*/function (_React$Component) {
|
|
|
164
166
|
src: src,
|
|
165
167
|
alt: ' ',
|
|
166
168
|
ref: "image"
|
|
167
|
-
}), children, this.state.isShowBigImage && this.
|
|
169
|
+
}), children, this.state.isShowBigImage && this.renderImagePreviewer());
|
|
168
170
|
return src ? dom : /*#__PURE__*/React.createElement("span", attributes, "Loading...");
|
|
169
171
|
}
|
|
170
172
|
}]);
|
|
@@ -172,44 +174,106 @@ var Image = /*#__PURE__*/function (_React$Component) {
|
|
|
172
174
|
return Image;
|
|
173
175
|
}(React.Component);
|
|
174
176
|
|
|
175
|
-
var
|
|
176
|
-
_inherits(
|
|
177
|
+
var ImagePreviewer = /*#__PURE__*/function (_React$Component2) {
|
|
178
|
+
_inherits(ImagePreviewer, _React$Component2);
|
|
177
179
|
|
|
178
|
-
var _super2 = _createSuper(
|
|
180
|
+
var _super2 = _createSuper(ImagePreviewer);
|
|
179
181
|
|
|
180
|
-
function
|
|
181
|
-
|
|
182
|
+
function ImagePreviewer(props) {
|
|
183
|
+
var _this2;
|
|
182
184
|
|
|
183
|
-
|
|
185
|
+
_classCallCheck(this, ImagePreviewer);
|
|
186
|
+
|
|
187
|
+
_this2 = _super2.call(this, props);
|
|
188
|
+
|
|
189
|
+
_this2.getImageNodes = function (nodes) {
|
|
190
|
+
var nodeIndex = 0;
|
|
191
|
+
var list = [];
|
|
192
|
+
|
|
193
|
+
while (nodes && nodeIndex <= nodes.length - 1) {
|
|
194
|
+
var currentNode = nodes[nodeIndex];
|
|
195
|
+
|
|
196
|
+
if (currentNode.type === 'image') {
|
|
197
|
+
currentNode.data.src && list.push(currentNode.data.src);
|
|
198
|
+
} else {
|
|
199
|
+
list.push.apply(list, _toConsumableArray(_this2.getImageNodes(currentNode.children)));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
nodeIndex++;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return list;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
_this2.moveToPrevImage = function () {
|
|
209
|
+
_this2.setState(function (prevState) {
|
|
210
|
+
return {
|
|
211
|
+
imageIndex: (prevState.imageIndex + _this2.images.length - 1) % _this2.images.length
|
|
212
|
+
};
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
_this2.moveToNextImage = function () {
|
|
217
|
+
_this2.setState(function (prevState) {
|
|
218
|
+
return {
|
|
219
|
+
imageIndex: (prevState.imageIndex + 1) % _this2.images.length
|
|
220
|
+
};
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
_this2.images = _this2.getImageNodes(window.editor.children);
|
|
225
|
+
_this2.state = {
|
|
226
|
+
imageIndex: _this2.images.findIndex(function (item) {
|
|
227
|
+
return item === props.imageUrl;
|
|
228
|
+
})
|
|
229
|
+
};
|
|
230
|
+
return _this2;
|
|
184
231
|
}
|
|
185
232
|
|
|
186
|
-
_createClass(
|
|
233
|
+
_createClass(ImagePreviewer, [{
|
|
187
234
|
key: "render",
|
|
188
235
|
value: function render() {
|
|
189
|
-
var
|
|
236
|
+
var imageUrl = this.props.imageUrl;
|
|
237
|
+
var imageIndex = this.state.imageIndex;
|
|
238
|
+
var imageItemsLength = this.images.length;
|
|
239
|
+
var imageTitle = '';
|
|
240
|
+
|
|
241
|
+
try {
|
|
242
|
+
imageTitle = imageUrl ? decodeURI(imageUrl.slice(imageUrl.lastIndexOf('/') + 1)) : '';
|
|
243
|
+
} catch (error) {
|
|
244
|
+
// eslint-disable-next-line no-console
|
|
245
|
+
console.log(error);
|
|
246
|
+
}
|
|
190
247
|
|
|
191
|
-
|
|
192
|
-
className:
|
|
193
|
-
|
|
194
|
-
|
|
248
|
+
var imageTitleEl = /*#__PURE__*/React.createElement("span", {
|
|
249
|
+
className: "d-flex"
|
|
250
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
251
|
+
className: "text-truncate"
|
|
252
|
+
}, imageTitle), /*#__PURE__*/React.createElement("span", {
|
|
253
|
+
className: "flex-shrink-0"
|
|
254
|
+
}, "(", imageIndex + 1, "/", this.images.length, ")"));
|
|
255
|
+
var mainSrc = this.images[imageIndex];
|
|
256
|
+
return /*#__PURE__*/React.createElement(Lightbox, {
|
|
257
|
+
wrapperClassName: "sf-editor-image-previewer",
|
|
258
|
+
imageTitle: imageTitleEl,
|
|
259
|
+
mainSrc: mainSrc,
|
|
260
|
+
toolbarButtons: [],
|
|
261
|
+
nextSrc: this.images[(imageIndex + 1) % imageItemsLength],
|
|
262
|
+
prevSrc: this.images[(imageIndex + imageItemsLength - 1) % imageItemsLength],
|
|
263
|
+
onCloseRequest: this.props.toggleImagePreviewer,
|
|
264
|
+
onMovePrevRequest: this.moveToPrevImage,
|
|
265
|
+
onMoveNextRequest: this.moveToNextImage,
|
|
266
|
+
imagePadding: 70,
|
|
267
|
+
reactModalStyle: {
|
|
268
|
+
overlay: {
|
|
269
|
+
zIndex: 1051
|
|
270
|
+
}
|
|
195
271
|
}
|
|
196
|
-
}
|
|
197
|
-
className: 'big-image-container'
|
|
198
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
199
|
-
src: this.props.bigImageSrc,
|
|
200
|
-
alt: ""
|
|
201
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
202
|
-
onClick: function onClick(event) {
|
|
203
|
-
return _this2.props.toggleBigImage(event);
|
|
204
|
-
},
|
|
205
|
-
className: 'image-container-close'
|
|
206
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
207
|
-
className: 'iconfont icon-close'
|
|
208
|
-
}))));
|
|
272
|
+
});
|
|
209
273
|
}
|
|
210
274
|
}]);
|
|
211
275
|
|
|
212
|
-
return
|
|
276
|
+
return ImagePreviewer;
|
|
213
277
|
}(React.Component);
|
|
214
278
|
|
|
215
279
|
export default withTranslation('seafile-editor')(Image);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -210,43 +210,39 @@ var Plugin = function Plugin(_editor) {
|
|
|
210
210
|
|
|
211
211
|
var table = _this.tableUtils.getSelectedTableCells();
|
|
212
212
|
|
|
213
|
-
if (
|
|
214
|
-
setEventTransfer(event, '
|
|
213
|
+
if (table) {
|
|
214
|
+
setEventTransfer(event, 'fragment', table);
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
|
-
|
|
218
|
-
setEventTransfer(event, 'fragment', table);
|
|
219
|
-
return;
|
|
220
217
|
}
|
|
221
218
|
|
|
222
|
-
if (
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
var
|
|
226
|
-
|
|
219
|
+
if (editor.selection && !Range.isCollapsed(editor.selection)) {
|
|
220
|
+
// get block deepest block node.
|
|
221
|
+
// for example: code line in a code block, paragraph in a list
|
|
222
|
+
var blockList = Editor.nodes(editor, {
|
|
223
|
+
at: editor.selection,
|
|
224
|
+
match: 'block'
|
|
227
225
|
});
|
|
228
|
-
var focusCodeBlock = Editor.match(_this.editor, focusPoint, {
|
|
229
|
-
type: 'code_block'
|
|
230
|
-
});
|
|
231
|
-
/*
|
|
232
|
-
If the selection is within the range of the selected code block
|
|
233
|
-
copy the selected code line as paragraph
|
|
234
|
-
*/
|
|
235
226
|
|
|
236
|
-
if (
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
227
|
+
if (blockList) {
|
|
228
|
+
var nodeList = Array.from(blockList);
|
|
229
|
+
/**
|
|
230
|
+
* if only one block element selected, write the selected content as paragraph or text to clipboard
|
|
231
|
+
* instead of use slate default behavior which write the outest element to clipboard
|
|
232
|
+
*/
|
|
233
|
+
|
|
234
|
+
if (nodeList.length === 1) {
|
|
235
|
+
event.preventDefault();
|
|
236
|
+
var node = nodeList[0][0];
|
|
237
|
+
|
|
238
|
+
if (node && node.type === 'paragraph') {
|
|
239
|
+
setEventTransfer(event, 'fragment', [node]);
|
|
240
|
+
} else {
|
|
241
|
+
setEventTransfer(event, 'text', SfEditor.text(editor, editor.selection));
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
250
246
|
}
|
|
251
247
|
}
|
|
252
248
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/editor/editor.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|