@seafile/sdoc-editor 2.0.37-alpg-0.1.5 → 2.0.38-alph-0.0.1

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.
@@ -121,7 +121,6 @@ const generateEmptyTable = (editor, tableProps) => {
121
121
  const tableRow = generateTableRow(editor, colsCount, i);
122
122
  children.push(tableRow);
123
123
  }
124
- console.log(1, editor, editor.width, _constants3.PAGE_EDIT_AREA_WIDTH);
125
124
  const columnWidth = Math.max(_constants2.TABLE_CELL_MIN_WIDTH, parseInt(editor.width / colsCount));
126
125
  let columns = [];
127
126
  for (let i = 0; i < colsCount; i++) {
@@ -895,7 +894,6 @@ const getTableColumns = (editor, element) => {
895
894
  if (columns) return columns;
896
895
  const columnsCount = children[0].children.length;
897
896
  let initColumns = [];
898
- console.log(3, editor.width);
899
897
  const pageEditAreaWidth = editor.width || _constants3.PAGE_EDIT_AREA_WIDTH;
900
898
  for (let i = 0; i < columnsCount; i++) {
901
899
  const column = {
@@ -249,16 +249,12 @@ function renderTable(props) {
249
249
  } = props;
250
250
  // eslint-disable-next-line react-hooks/rules-of-hooks
251
251
  const editor = (0, _slateReact.useSlateStatic)();
252
- console.log(0, editor, editor.width);
253
252
  const columns = (0, _helpers.getTableColumns)(editor, element);
254
- console.log(1, editor, editor.width, element);
255
253
  let style = element.style ? {
256
254
  ...element.style
257
255
  } : {};
258
256
  const columnWidthList = columns.map(item => `${item.width}px`);
259
257
  style.gridTemplateColumns = columnWidthList.join(' ');
260
- const w2 = editor.width;
261
- console.log(3, w2);
262
258
  const rowHeightList = element.children.map((item, index) => (0, _helpers.getRowHeight)(item, index));
263
259
  style.gridAutoRows = rowHeightList.map(item => `minmax(${item}px, auto)`).join(' ');
264
260
  return /*#__PURE__*/_react.default.createElement(_tableRoot.default, {
@@ -21,7 +21,6 @@ const TableRoot = _ref => {
21
21
  const readonly = (0, _slateReact.useReadOnly)();
22
22
  const tableScrollWrapper = (0, _react.useRef)(null);
23
23
  const [scrollLeft, setScrollLeft] = (0, _react.useState)(0);
24
- // const [editorWidth, setEditorWidth] = useState(editor.width);
25
24
  const allWidth = columns.reduce((pre, cur) => pre + cur.width, 0);
26
25
  const onScroll = (0, _react.useCallback)(event => {
27
26
  setScrollLeft(event.target.scrollLeft);
@@ -31,14 +30,6 @@ const TableRoot = _ref => {
31
30
  menuPosition,
32
31
  onContextMenu
33
32
  } = (0, _hooks.useContextMenu)(tableScrollWrapper);
34
- console.log(2, editor, editor.width, columns, allWidth);
35
-
36
- // useLayoutEffect(() => {
37
- // if (readonly) {
38
- // setEditorWidth(editor.width);
39
- // }
40
- // }, [editor.width, readonly]);
41
- // console.log(6, editorWidth);
42
33
  return /*#__PURE__*/_react.default.createElement(_hooks.TableRootContext.Provider, {
43
34
  value: tableScrollWrapper.current
44
35
  }, /*#__PURE__*/_react.default.createElement(_hooks.TableRootScrollLeftContext.Provider, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "2.0.37-alpg-0.1.5",
3
+ "version": "2.0.38-alph-0.0.1",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "remark-parse": "11.0.0",
39
39
  "remark-rehype": "11.0.0",
40
40
  "remark-stringify": "11.0.0",
41
- "sea-chart": "^2.0.5",
41
+ "sea-chart": "2.0.7",
42
42
  "slugid": "3.2.0",
43
43
  "socket.io-client": "4.8.1",
44
44
  "type-of": "2.0.1",