@seafile/sdoc-editor 2.0.37-alpg-0.0.6 → 2.0.37-alpg-0.0.8

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.
@@ -11,6 +11,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _slateReact = require("@seafile/slate-react");
12
12
  var _hooks = require("./hooks");
13
13
  var _menu = require("../menu");
14
+ /* eslint-disable react-hooks/exhaustive-deps */
15
+
14
16
  const TableRoot = _ref => {
15
17
  let {
16
18
  editor,
@@ -26,14 +28,18 @@ const TableRoot = _ref => {
26
28
  const onScroll = (0, _react.useCallback)(event => {
27
29
  setScrollLeft(event.target.scrollLeft);
28
30
  }, []);
29
- const w2 = editor.width;
30
- console.log(3, w2);
31
31
  const {
32
32
  isShowContextMenu,
33
33
  menuPosition,
34
34
  onContextMenu
35
35
  } = (0, _hooks.useContextMenu)(tableScrollWrapper);
36
36
  console.log(2, editor, editor.width, columns, allWidth);
37
+ let editorWidth = editor.width;
38
+ (0, _react.useEffect)(() => {
39
+ editorWidth = editor.width;
40
+ console.log(5, editorWidth);
41
+ }, [editor]);
42
+ console.log(6, editorWidth);
37
43
  return /*#__PURE__*/_react.default.createElement(_hooks.TableRootContext.Provider, {
38
44
  value: tableScrollWrapper.current
39
45
  }, /*#__PURE__*/_react.default.createElement(_hooks.TableRootScrollLeftContext.Provider, {
@@ -44,7 +50,7 @@ const TableRoot = _ref => {
44
50
  }),
45
51
  style: {
46
52
  ...attributes.style,
47
- maxWidth: editor.width ? editor.width : '100%'
53
+ maxWidth: editorWidth ? editorWidth : '100%'
48
54
  }
49
55
  }), /*#__PURE__*/_react.default.createElement("div", {
50
56
  className: (0, _classnames.default)('sdoc-table-scroll-wrapper', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "2.0.37-alpg-0.0.6",
3
+ "version": "2.0.37-alpg-0.0.8",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",