@seafile/sdoc-editor 1.0.29 → 1.0.31
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.
- package/dist/basic-sdk/extension/plugins/callout/helper.js +2 -2
- package/dist/basic-sdk/extension/plugins/link/render-elem.js +1 -1
- package/dist/basic-sdk/extension/plugins/seatable-tables/render-element/record-item.js +7 -1
- package/dist/basic-sdk/extension/plugins/seatable-tables/render-element/record-list.js +4 -1
- package/dist/basic-sdk/extension/plugins/seatable-tables/render-element/seatable-table.js +6 -6
- package/dist/basic-sdk/layout/article-container.js +2 -1
- package/dist/pages/sdoc-wiki-editor.js +0 -2
- package/package.json +2 -1
|
@@ -136,8 +136,8 @@ export const getCalloutMenuPosition = (element, editor) => {
|
|
|
136
136
|
top: menuTop,
|
|
137
137
|
left: left // left = callout left distance
|
|
138
138
|
};
|
|
139
|
-
//
|
|
140
|
-
if (editor.editorType === DOCUMENT_PLUGIN_EDITOR && menuTop <
|
|
139
|
+
// 201 is distance with browser top
|
|
140
|
+
if (editor.editorType === DOCUMENT_PLUGIN_EDITOR && menuTop < 201) {
|
|
141
141
|
newMenuPosition['display'] = 'none';
|
|
142
142
|
}
|
|
143
143
|
return newMenuPosition;
|
|
@@ -44,7 +44,7 @@ class Link extends React.Component {
|
|
|
44
44
|
editor
|
|
45
45
|
} = this.props;
|
|
46
46
|
const menuPosition = getMenuPosition(element);
|
|
47
|
-
if (editor.editorType === DOCUMENT_PLUGIN_EDITOR && menuPosition.top <
|
|
47
|
+
if (editor.editorType === DOCUMENT_PLUGIN_EDITOR && menuPosition.top < 201) {
|
|
48
48
|
menuPosition['display'] = 'none';
|
|
49
49
|
}
|
|
50
50
|
this.setState({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { FORMULA_COLUMN_TYPES } from 'dtable-utils';
|
|
2
3
|
import { getColumnWidth } from '../../seatable-column/helpers';
|
|
3
4
|
import Formatter from '../formatter';
|
|
4
5
|
export default function RecordItem(_ref) {
|
|
@@ -6,6 +7,7 @@ export default function RecordItem(_ref) {
|
|
|
6
7
|
element,
|
|
7
8
|
index,
|
|
8
9
|
record,
|
|
10
|
+
formulaRow,
|
|
9
11
|
columns,
|
|
10
12
|
editor
|
|
11
13
|
} = _ref;
|
|
@@ -15,6 +17,10 @@ export default function RecordItem(_ref) {
|
|
|
15
17
|
className: "seatable-view-body-column-cell first-cell"
|
|
16
18
|
}, index), columns.map(column => {
|
|
17
19
|
const width = getColumnWidth(column);
|
|
20
|
+
let cellValue = record[column.key];
|
|
21
|
+
if (FORMULA_COLUMN_TYPES.includes(column.type)) {
|
|
22
|
+
cellValue = formulaRow[column.key];
|
|
23
|
+
}
|
|
18
24
|
return /*#__PURE__*/React.createElement("td", {
|
|
19
25
|
className: "seatable-view-body-column-cell",
|
|
20
26
|
key: record._id + '_' + column.key,
|
|
@@ -24,7 +30,7 @@ export default function RecordItem(_ref) {
|
|
|
24
30
|
}, /*#__PURE__*/React.createElement(Formatter, {
|
|
25
31
|
isSample: true,
|
|
26
32
|
column: column,
|
|
27
|
-
cellValue:
|
|
33
|
+
cellValue: cellValue,
|
|
28
34
|
collaborators: editor.collaborators
|
|
29
35
|
}));
|
|
30
36
|
}));
|
|
@@ -5,14 +5,17 @@ export default function RecordList(_ref) {
|
|
|
5
5
|
editor,
|
|
6
6
|
records,
|
|
7
7
|
columns,
|
|
8
|
-
element
|
|
8
|
+
element,
|
|
9
|
+
formulaRows
|
|
9
10
|
} = _ref;
|
|
10
11
|
return /*#__PURE__*/React.createElement(React.Fragment, null, records.map((record, index) => {
|
|
12
|
+
const formulaRow = formulaRows[record._id] || {};
|
|
11
13
|
return /*#__PURE__*/React.createElement(RecordItem, {
|
|
12
14
|
key: record._id,
|
|
13
15
|
index: index,
|
|
14
16
|
editor: editor,
|
|
15
17
|
record: record,
|
|
18
|
+
formulaRow: formulaRow,
|
|
16
19
|
columns: columns,
|
|
17
20
|
element: element
|
|
18
21
|
});
|
|
@@ -10,7 +10,7 @@ import OpMenu from '../op-menu';
|
|
|
10
10
|
import { useScrollContext } from '../../../../hooks/use-scroll-context';
|
|
11
11
|
import './index.css';
|
|
12
12
|
function SeaTableTable(_ref) {
|
|
13
|
-
var _tableInfoRef$current;
|
|
13
|
+
var _tableInfoRef$current, _tableInfoRef$current2;
|
|
14
14
|
let {
|
|
15
15
|
element,
|
|
16
16
|
className,
|
|
@@ -135,8 +135,8 @@ function SeaTableTable(_ref) {
|
|
|
135
135
|
top: menuTop,
|
|
136
136
|
left: left // left = code-block left distance
|
|
137
137
|
};
|
|
138
|
-
//
|
|
139
|
-
if (menuTop <
|
|
138
|
+
// 201 is distance with browser top
|
|
139
|
+
if (menuTop < 201) {
|
|
140
140
|
newMenuPosition['display'] = 'none';
|
|
141
141
|
}
|
|
142
142
|
setMenuPosition(newMenuPosition);
|
|
@@ -169,8 +169,8 @@ function SeaTableTable(_ref) {
|
|
|
169
169
|
top: menuTop,
|
|
170
170
|
left: left // left = callout left distance
|
|
171
171
|
};
|
|
172
|
-
//
|
|
173
|
-
if (menuTop
|
|
172
|
+
// 201 is distance with browser top
|
|
173
|
+
if (menuTop <= 201) {
|
|
174
174
|
newMenuPosition['display'] = 'none';
|
|
175
175
|
}
|
|
176
176
|
setMenuPosition(newMenuPosition);
|
|
@@ -202,7 +202,7 @@ function SeaTableTable(_ref) {
|
|
|
202
202
|
editor: editor,
|
|
203
203
|
records: shownRecords,
|
|
204
204
|
columns: columns,
|
|
205
|
-
formulaRows: tableInfoRef === null || tableInfoRef === void 0 ? void 0 : (_tableInfoRef$current = tableInfoRef.current) === null || _tableInfoRef$current === void 0 ? void 0 : _tableInfoRef$current[element.table_id]
|
|
205
|
+
formulaRows: tableInfoRef === null || tableInfoRef === void 0 ? void 0 : (_tableInfoRef$current = tableInfoRef.current) === null || _tableInfoRef$current === void 0 ? void 0 : (_tableInfoRef$current2 = _tableInfoRef$current[element.table_id]) === null || _tableInfoRef$current2 === void 0 ? void 0 : _tableInfoRef$current2.formulaRows
|
|
206
206
|
}))), !readOnly && isShowTipMessage && /*#__PURE__*/React.createElement("div", {
|
|
207
207
|
className: "d-print-none ml-2 m-2"
|
|
208
208
|
}, t('And_x_more_records', {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { INTERNAL_EVENT } from '../constants';
|
|
2
|
+
import { INTERNAL_EVENT, WIKI_EDITOR } from '../constants';
|
|
3
3
|
import { useScrollContext } from '../hooks/use-scroll-context';
|
|
4
4
|
import EventBus from '../utils/event-bus';
|
|
5
5
|
import { getOutlineSetting } from '../outline';
|
|
@@ -48,6 +48,7 @@ export default function ArticleContainer(_ref) {
|
|
|
48
48
|
return unsubscribeOutline;
|
|
49
49
|
}, [handleWindowResize]);
|
|
50
50
|
useEffect(() => {
|
|
51
|
+
if (editor.editorType === WIKI_EDITOR) return;
|
|
51
52
|
handleWindowResize();
|
|
52
53
|
window.addEventListener('resize', handleWindowResize);
|
|
53
54
|
return () => {
|
|
@@ -8,7 +8,6 @@ import withNodeId from '../basic-sdk/node-id';
|
|
|
8
8
|
import { withSocketIO } from '../basic-sdk/socket';
|
|
9
9
|
import { TITLE } from '../basic-sdk/extension/constants';
|
|
10
10
|
import WikiEditor from '../basic-sdk/editor/wiki-editor';
|
|
11
|
-
import { setOutlineSetting } from '../basic-sdk/outline';
|
|
12
11
|
import '../assets/css/simple-viewer.css';
|
|
13
12
|
const SdocWikiEditor = _ref => {
|
|
14
13
|
let {
|
|
@@ -45,7 +44,6 @@ const SdocWikiEditor = _ref => {
|
|
|
45
44
|
}, [docUuid]);
|
|
46
45
|
useEffect(() => {
|
|
47
46
|
validEditor.openConnection();
|
|
48
|
-
setOutlineSetting(false);
|
|
49
47
|
return () => {
|
|
50
48
|
validEditor.closeConnection();
|
|
51
49
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "This is a sdoc editor",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
"css-minimizer-webpack-plugin": "5.0.1",
|
|
101
101
|
"dotenv": "6.2.0",
|
|
102
102
|
"dotenv-expand": "5.1.0",
|
|
103
|
+
"dtable-sdk": "5.0.3",
|
|
103
104
|
"dtable-utils": "5.0.1",
|
|
104
105
|
"ejs": "3.1.10",
|
|
105
106
|
"eslint": "6.8.0",
|