@seafile/seafile-editor 1.0.90 → 1.0.91
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.
|
@@ -287,6 +287,7 @@ const withTable = editor => {
|
|
|
287
287
|
const tableCell = (0, _core.getSelectedNodeByType)(newEditor, _elementTypes.TABLE_CELL);
|
|
288
288
|
if (tableCell) {
|
|
289
289
|
const selection = window.getSelection();
|
|
290
|
+
const selectedText = selection.toString();
|
|
290
291
|
const range = selection.getRangeAt(0);
|
|
291
292
|
const selectedContent = range.cloneContents();
|
|
292
293
|
const div = document.createElement('div');
|
|
@@ -299,6 +300,7 @@ const withTable = editor => {
|
|
|
299
300
|
}
|
|
300
301
|
div.appendChild(node.cloneNode(true));
|
|
301
302
|
});
|
|
303
|
+
(0, _setEventTransfer.default)(event, 'text', selectedText);
|
|
302
304
|
(0, _setEventTransfer.default)(event, 'html', div.innerHTML.toString());
|
|
303
305
|
return true;
|
|
304
306
|
}
|
|
@@ -93,3 +93,11 @@
|
|
|
93
93
|
.sf-long-text-inline-editor-container .sf-image-wrapper .full-screen .iconfont {
|
|
94
94
|
color: #fff;
|
|
95
95
|
}
|
|
96
|
+
|
|
97
|
+
.sf-long-text-inline-editor-container .empty-loading-page {
|
|
98
|
+
position: relative;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.sf-long-text-inline-editor-container .sf-simple-slate-editor-container .sf-slate-editor-content {
|
|
102
|
+
border-radius: 3px;
|
|
103
|
+
}
|
|
@@ -324,6 +324,15 @@ const transformFormula = node => {
|
|
|
324
324
|
value: data.formula
|
|
325
325
|
};
|
|
326
326
|
};
|
|
327
|
+
const transformAsParagraph = node => {
|
|
328
|
+
const paragraph = {
|
|
329
|
+
type: 'paragraph',
|
|
330
|
+
children: [{
|
|
331
|
+
text: _slate.Node.string(node)
|
|
332
|
+
}]
|
|
333
|
+
};
|
|
334
|
+
return transformParagraph(paragraph);
|
|
335
|
+
};
|
|
327
336
|
const elementHandlers = {
|
|
328
337
|
'paragraph': transformParagraph,
|
|
329
338
|
'header1': transformHeader,
|
|
@@ -341,10 +350,15 @@ const elementHandlers = {
|
|
|
341
350
|
'formula': transformFormula
|
|
342
351
|
};
|
|
343
352
|
const formatSlateToMd = children => {
|
|
344
|
-
const validChildren = children.filter(child => elementHandlers[child.type]);
|
|
353
|
+
// const validChildren = children.filter(child => elementHandlers[child.type]);
|
|
354
|
+
const validChildren = children;
|
|
345
355
|
return validChildren.map(child => {
|
|
346
356
|
const handler = elementHandlers[child.type];
|
|
347
|
-
|
|
357
|
+
if (handler) {
|
|
358
|
+
return handler(child);
|
|
359
|
+
} else {
|
|
360
|
+
return transformAsParagraph(child);
|
|
361
|
+
}
|
|
348
362
|
}).flat();
|
|
349
363
|
};
|
|
350
364
|
exports.formatSlateToMd = formatSlateToMd;
|