@seafile/sdoc-editor 0.5.72 → 0.5.74
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/basic-sdk/extension/constants/menus-config.js +1 -1
- package/dist/basic-sdk/extension/plugins/seatable-views/plugin.js +22 -3
- package/dist/basic-sdk/extension/plugins/seatable-views/render-element/index.css +2 -1
- package/package.json +1 -1
- package/public/media/sdoc-editor-font/iconfont.eot +0 -0
- package/public/media/sdoc-editor-font/iconfont.svg +2 -0
- package/public/media/sdoc-editor-font/iconfont.ttf +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff2 +0 -0
- package/public/media/sdoc-editor-font.css +10 -6
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Transforms, Path, Editor, Element, Range } from '@seafile/slate';
|
|
2
|
-
import { focusEditor, isBlockAboveEmpty } from '../../core';
|
|
3
|
-
import { SEATABLE_VIEW } from '../../constants/element-type';
|
|
2
|
+
import { focusEditor, generateEmptyElement, getNodeType, isBlockAboveEmpty, isLastNode } from '../../core';
|
|
3
|
+
import { PARAGRAPH, SEATABLE_VIEW } from '../../constants/element-type';
|
|
4
4
|
const withSeaTableView = editor => {
|
|
5
5
|
const {
|
|
6
6
|
isVoid,
|
|
7
|
-
deleteBackward
|
|
7
|
+
deleteBackward,
|
|
8
|
+
normalizeNode
|
|
8
9
|
} = editor;
|
|
9
10
|
const newEditor = editor;
|
|
10
11
|
|
|
@@ -47,6 +48,24 @@ const withSeaTableView = editor => {
|
|
|
47
48
|
}
|
|
48
49
|
deleteBackward(unit);
|
|
49
50
|
};
|
|
51
|
+
|
|
52
|
+
// Rewrite normalizeNode
|
|
53
|
+
newEditor.normalizeNode = _ref => {
|
|
54
|
+
let [node, path] = _ref;
|
|
55
|
+
const type = getNodeType(node);
|
|
56
|
+
if (type !== SEATABLE_VIEW) {
|
|
57
|
+
return normalizeNode([node, path]);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// insert empty node,continue editor
|
|
61
|
+
const isLast = isLastNode(newEditor, node);
|
|
62
|
+
if (isLast) {
|
|
63
|
+
const p = generateEmptyElement(PARAGRAPH);
|
|
64
|
+
Transforms.insertNodes(newEditor, p, {
|
|
65
|
+
at: [path[0] + 1]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
50
69
|
return newEditor;
|
|
51
70
|
};
|
|
52
71
|
export default withSeaTableView;
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
/>
|
|
15
15
|
<missing-glyph />
|
|
16
16
|
|
|
17
|
+
<glyph glyph-name="sdoc-seatable-view" unicode="" d="M384 896c35.2 0 64-28.8 64-64v-320c0-35.2-28.8-64-64-64H64c-35.2 0-64 28.8-64 64V832C0 867.2 28.8 896 64 896h320z m-32-96H96v-256h256V800z m608 96c35.2 0 64-28.8 64-64v-320c0-35.2-28.8-64-64-64H640c-35.2 0-64 28.8-64 64V832c0 35.2 28.8 64 64 64h320z m-32-96h-256v-256h256V800zM384 320c35.2 0 64-28.8 64-64v-320c0-35.2-28.8-64-64-64H64c-35.2 0-64 28.8-64 64V256c0 35.2 28.8 64 64 64h320z m-32-96H96v-256h256v256z m608 96c35.2 0 64-28.8 64-64v-320c0-35.2-28.8-64-64-64H640c-35.2 0-64 28.8-64 64V256c0 35.2 28.8 64 64 64h320z m-32-96h-256v-256h256v256z" horiz-adv-x="1024" />
|
|
18
|
+
|
|
17
19
|
<glyph glyph-name="sdoc-text-style" unicode="" d="M147.2 156.8h160l67.2 153.6h278.4L720 156.8h160L598.4 896H428.8L147.2 156.8z m348.8 512h35.2l83.2-227.2H409.6L496 668.8zM774.4-128V32h160v-160h-160zM419.2 32h160v-160h-160V32zM96 32h160v-160H96V32z" horiz-adv-x="1024" />
|
|
18
20
|
|
|
19
21
|
<glyph glyph-name="sdoc-choose-column" unicode="" d="M620.8 438.4l384-214.4-144-41.6L931.2 32c16-25.6 6.4-60.8-16-80-25.6-16-57.6-16-80 6.4L704 96 592-6.4l28.8 444.8zM464 160c9.6 0 16-6.4 16-16v-128c0-9.6-6.4-16-16-16H48c-9.6 0-16 6.4-16 16V144c0 9.6 6.4 16 16 16h416z m64 320c9.6 0 16-6.4 16-16v-128c0-9.6-6.4-16-16-16H48c-9.6 0-16 6.4-16 16V464c0 9.6 6.4 16 16 16h480zM944 800c9.6 0 16-6.4 16-16v-128c0-9.6-6.4-16-16-16H48c-9.6 0-16 6.4-16 16V784c0 9.6 6.4 16 16 16h896z" horiz-adv-x="1024" />
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "sdocfont";
|
|
3
3
|
/* Project id 4097705 */
|
|
4
|
-
src: url('./sdoc-editor-font/iconfont.eot?t=
|
|
4
|
+
src: url('./sdoc-editor-font/iconfont.eot?t=1718674664011');
|
|
5
5
|
/* IE9 */
|
|
6
|
-
src: url('./sdoc-editor-font/iconfont.eot?t=
|
|
6
|
+
src: url('./sdoc-editor-font/iconfont.eot?t=1718674664011#iefix') format('embedded-opentype'),
|
|
7
7
|
/* IE6-IE8 */
|
|
8
|
-
url('./sdoc-editor-font/iconfont.woff2?t=
|
|
9
|
-
url('./sdoc-editor-font/iconfont.woff?t=
|
|
10
|
-
url('./sdoc-editor-font/iconfont.ttf?t=
|
|
11
|
-
url('./sdoc-editor-font/iconfont.svg?t=
|
|
8
|
+
url('./sdoc-editor-font/iconfont.woff2?t=1718674664011') format('woff2'),
|
|
9
|
+
url('./sdoc-editor-font/iconfont.woff?t=1718674664011') format('woff'),
|
|
10
|
+
url('./sdoc-editor-font/iconfont.ttf?t=1718674664011') format('truetype'),
|
|
11
|
+
url('./sdoc-editor-font/iconfont.svg?t=1718674664011#sdocfont') format('svg');
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.sdocfont {
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
-moz-osx-font-smoothing: grayscale;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
.sdoc-seatable-view:before {
|
|
23
|
+
content: "\e66f";
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
.sdoc-text-style:before {
|
|
23
27
|
content: "\e66e";
|
|
24
28
|
}
|