@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.
@@ -199,7 +199,7 @@ export const MENUS_CONFIG_MAP = {
199
199
  },
200
200
  [SEATABLE_VIEW]: {
201
201
  id: SEATABLE_VIEW,
202
- iconClass: 'sdocfont sdoc-header4',
202
+ iconClass: 'sdocfont sdoc-seatable-view',
203
203
  type: SEATABLE_VIEW,
204
204
  text: 'SeaTable_view'
205
205
  }
@@ -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;
@@ -1,6 +1,7 @@
1
1
  .seatable-view-container {
2
2
  width: 100%;
3
- height: 400px;
3
+ min-height: 200px;
4
+ max-height: 400px;
4
5
  overflow: auto;
5
6
  }
6
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.5.72",
3
+ "version": "0.5.74",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",
@@ -14,6 +14,8 @@
14
14
  />
15
15
  <missing-glyph />
16
16
 
17
+ <glyph glyph-name="sdoc-seatable-view" unicode="&#58991;" 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="&#58990;" 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="&#58989;" 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" />
@@ -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=1716446789113');
4
+ src: url('./sdoc-editor-font/iconfont.eot?t=1718674664011');
5
5
  /* IE9 */
6
- src: url('./sdoc-editor-font/iconfont.eot?t=1716446789113#iefix') format('embedded-opentype'),
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=1716446789113') format('woff2'),
9
- url('./sdoc-editor-font/iconfont.woff?t=1716446789113') format('woff'),
10
- url('./sdoc-editor-font/iconfont.ttf?t=1716446789113') format('truetype'),
11
- url('./sdoc-editor-font/iconfont.svg?t=1716446789113#sdocfont') format('svg');
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
  }