@seafile/seafile-editor 0.3.118 → 0.3.120

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.
@@ -237,7 +237,7 @@ var Toolbar = /*#__PURE__*/function (_React$Component) {
237
237
  }), canInsertColumn && /*#__PURE__*/React.createElement(ButtonItem, {
238
238
  disabled: isFormulaActive || isTableActive || isHeadActive,
239
239
  isRichEditor: true,
240
- text: t('insert_column'),
240
+ text: t('Insert_column'),
241
241
  id: 'insertColumn',
242
242
  className: "svg-button",
243
243
  onMouseDown: function onMouseDown(event) {
@@ -29,6 +29,7 @@ var math = require('remark-math/block');
29
29
  function stringify(config) {
30
30
  var settings = xtend(config, this.data('settings'));
31
31
  var schema = deepmerge(gh, {
32
+ 'tagNames': ['input', 'code', 'span', 'div', 'blockquote', 'pre'],
32
33
  'attributes': {
33
34
  'input': ['type'],
34
35
  'li': ['className'],
@@ -36,7 +37,9 @@ function stringify(config) {
36
37
  'span': ['className'],
37
38
  'div': ['className']
38
39
  },
39
- 'tagNames': ['input', 'code', 'span', 'div', 'blockquote', 'pre']
40
+ 'protocols': {
41
+ 'src': ['http', 'https', 'cid']
42
+ }
40
43
  });
41
44
  this.Compiler = compiler;
42
45
 
@@ -1,3 +1,4 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
2
  import { Node, Text } from 'slate';
2
3
  export var Utils = {
3
4
  pathNormalize: function pathNormalize(originalPath) {
@@ -27,7 +28,7 @@ export var isEmptyParagraph = function isEmptyParagraph(node) {
27
28
  return false;
28
29
  }; // root -> paragraph ->
29
30
 
30
- export var replaceColumnData = function replaceColumnData(mdNodes, columns, getCellValue) {
31
+ export var replaceColumnData = function replaceColumnData(mdNodes, columns, getCellValue, updateImgUrl) {
31
32
  for (var i = 0; i < mdNodes.length; i++) {
32
33
  var node = mdNodes[i];
33
34
 
@@ -49,12 +50,29 @@ export var replaceColumnData = function replaceColumnData(mdNodes, columns, getC
49
50
  }();
50
51
 
51
52
  if (_ret === "continue") continue;
53
+ } // replace image node's src
54
+
55
+
56
+ if (node.type === 'image') {
57
+ var data = node.data || {
58
+ src: ''
59
+ };
60
+
61
+ if (updateImgUrl && typeof updateImgUrl === 'function') {
62
+ var src = updateImgUrl(data.src);
63
+
64
+ var newData = _objectSpread(_objectSpread({}, data), {
65
+ src: src
66
+ });
67
+
68
+ node.data = newData;
69
+ }
52
70
  } // if node has children, traverse node's children
53
71
 
54
72
 
55
73
  if (node.children) {
56
74
  var nodes = node.children;
57
- replaceColumnData(nodes, columns, getCellValue);
75
+ replaceColumnData(nodes, columns, getCellValue, updateImgUrl);
58
76
  }
59
77
  }
60
78
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "0.3.118",
3
+ "version": "0.3.120",
4
4
  "private": false,
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^0.0.9",
@@ -221,5 +221,6 @@
221
221
  ]
222
222
  },
223
223
  "Select_field": "Select field",
224
- "Font_style": "Font style"
224
+ "Font_style": "Font style",
225
+ "Insert_column": "Insert column"
225
226
  }