@seafile/sdoc-editor 1.0.1 → 1.0.3

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.
@@ -7,17 +7,19 @@ const listRule = (element, parseChild) => {
7
7
  childNodes
8
8
  } = element;
9
9
  if (nodeName === 'UL') {
10
+ const validChildNodes = Array.from(childNodes).filter(item => item.nodeName === 'LI');
10
11
  return {
11
12
  id: slugid.nice(),
12
13
  type: UNORDERED_LIST,
13
- children: parseChild(childNodes)
14
+ children: parseChild(validChildNodes)
14
15
  };
15
16
  }
16
17
  if (nodeName === 'OL') {
18
+ const validChildNodes = Array.from(childNodes).filter(item => item.nodeName === 'LI');
17
19
  return {
18
20
  id: slugid.nice(),
19
21
  type: ORDERED_LIST,
20
- children: parseChild(childNodes)
22
+ children: parseChild(validChildNodes)
21
23
  };
22
24
  }
23
25
  if (nodeName === 'LI' && PARAGRAPH_TAGS.includes(element.firstChild.nodeName)) {
@@ -35,6 +35,10 @@ const withLink = editor => {
35
35
  if (isUrl(text) && !isImage(text)) {
36
36
  const link = genLinkNode(text, text);
37
37
  Transforms.insertNodes(newEditor, link);
38
+ // Void merging text fron link
39
+ const [, focusPath] = Editor.next(newEditor);
40
+ const focusPoint = Editor.start(newEditor, focusPath);
41
+ Transforms.select(newEditor, focusPoint);
38
42
  if (isSameDomain(text, context.getSetting('serviceUrl'))) {
39
43
  context.getLinkFilesInfo([text]).then(res => {
40
44
  if (isSdocFile(res, text)) {
@@ -1,4 +1,4 @@
1
- .sdocfont.sdoc-check-mark {
1
+ .sdoc-text-align-dropdown .sdocfont.sdoc-check-mark {
2
2
  position: absolute;
3
3
  left: 8px;
4
4
  transform: scale(.8);
@@ -64,7 +64,7 @@ const TextAlignMenu = _ref => {
64
64
  target: buttonId
65
65
  }, t('Alignment_type')), !disabled && /*#__PURE__*/React.createElement(UncontrolledPopover, {
66
66
  target: buttonId,
67
- className: "sdoc-menu-popover sdoc-dropdown-menu",
67
+ className: "sdoc-menu-popover sdoc-dropdown-menu sdoc-text-align-dropdown",
68
68
  trigger: "legacy",
69
69
  placement: "bottom-start",
70
70
  hideArrow: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",