@seafile/sdoc-editor 2.0.37-alpg-0.1.4 → 2.0.37-alpg-0.1.5
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/constants/index.js +2 -1
- package/dist/basic-sdk/editor/wiki-editor.js +1 -1
- package/dist/basic-sdk/extension/plugins/table/render/index.js +0 -2
- package/dist/basic-sdk/extension/plugins/table/render/table-root.js +9 -10
- package/dist/pages/sdoc-wiki-editor.js +1 -2
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "PLUGIN_DISPLAY_TYPE", {
|
|
|
17
17
|
return _plugin.PLUGIN_DISPLAY_TYPE;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
exports.Z_INDEX = exports.WIKI_OUTLINE = exports.WIKI_EDITOR = exports.SDOC_STORAGE = exports.REVISION_DIFF_VALUE = exports.REVISION_DIFF_KEY = exports.REBASE_TYPES = exports.REBASE_TYPE = exports.REBASE_ORIGIN = exports.REBASE_MARK_KEY = exports.REBASE_MARKS = void 0;
|
|
20
|
+
exports.Z_INDEX = exports.WIKI_OUTLINE = exports.WIKI_EDITOR_EDIT_AREA_WIDTH = exports.WIKI_EDITOR = exports.SDOC_STORAGE = exports.REVISION_DIFF_VALUE = exports.REVISION_DIFF_KEY = exports.REBASE_TYPES = exports.REBASE_TYPE = exports.REBASE_ORIGIN = exports.REBASE_MARK_KEY = exports.REBASE_MARKS = void 0;
|
|
21
21
|
var Z_INDEX = _interopRequireWildcard(require("./z-index"));
|
|
22
22
|
exports.Z_INDEX = Z_INDEX;
|
|
23
23
|
var _plugin = require("./plugin");
|
|
@@ -55,6 +55,7 @@ const REVISION_DIFF_KEY = exports.REVISION_DIFF_KEY = 'diff';
|
|
|
55
55
|
const REVISION_DIFF_VALUE = exports.REVISION_DIFF_VALUE = '1';
|
|
56
56
|
const PAGE_EDIT_AREA_WIDTH = exports.PAGE_EDIT_AREA_WIDTH = 672; // 672 = 794 - 2[borderLeft + borderRight] - 120[paddingLeft + paddingRight]
|
|
57
57
|
const COMMENT_EDITOR_EDIT_AREA_WIDTH = exports.COMMENT_EDITOR_EDIT_AREA_WIDTH = 364;
|
|
58
|
+
const WIKI_EDITOR_EDIT_AREA_WIDTH = exports.WIKI_EDITOR_EDIT_AREA_WIDTH = 714;
|
|
58
59
|
const COMMENT_EDITOR = exports.COMMENT_EDITOR = 'comment_editor';
|
|
59
60
|
const WIKI_EDITOR = exports.WIKI_EDITOR = 'wiki_editor';
|
|
60
61
|
const DOCUMENT_PLUGIN_EDITOR = exports.DOCUMENT_PLUGIN_EDITOR = 'document_plugin_editor';
|
|
@@ -47,7 +47,7 @@ const WikiEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
47
47
|
cursors
|
|
48
48
|
} = document;
|
|
49
49
|
newEditor.cursors = cursors || {};
|
|
50
|
-
newEditor.width = _constants.
|
|
50
|
+
newEditor.width = _constants.WIKI_EDITOR_EDIT_AREA_WIDTH; // default width
|
|
51
51
|
return newEditor;
|
|
52
52
|
|
|
53
53
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -208,7 +208,6 @@ const Table = _ref => {
|
|
|
208
208
|
}, /*#__PURE__*/_react.default.createElement(_hooks.SettingSelectRangeContext.Provider, {
|
|
209
209
|
value: isSettingSelectRange
|
|
210
210
|
}, /*#__PURE__*/_react.default.createElement(_tableRoot.default, {
|
|
211
|
-
editor: editor,
|
|
212
211
|
columns: columns,
|
|
213
212
|
attributes: attributes
|
|
214
213
|
}, isSelected && /*#__PURE__*/_react.default.createElement(_tableHeader.default, {
|
|
@@ -263,7 +262,6 @@ function renderTable(props) {
|
|
|
263
262
|
const rowHeightList = element.children.map((item, index) => (0, _helpers.getRowHeight)(item, index));
|
|
264
263
|
style.gridAutoRows = rowHeightList.map(item => `minmax(${item}px, auto)`).join(' ');
|
|
265
264
|
return /*#__PURE__*/_react.default.createElement(_tableRoot.default, {
|
|
266
|
-
editor: editor,
|
|
267
265
|
columns: columns,
|
|
268
266
|
attributes: attributes
|
|
269
267
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -11,8 +11,6 @@ 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
|
-
|
|
16
14
|
const TableRoot = _ref => {
|
|
17
15
|
let {
|
|
18
16
|
attributes,
|
|
@@ -23,7 +21,7 @@ const TableRoot = _ref => {
|
|
|
23
21
|
const readonly = (0, _slateReact.useReadOnly)();
|
|
24
22
|
const tableScrollWrapper = (0, _react.useRef)(null);
|
|
25
23
|
const [scrollLeft, setScrollLeft] = (0, _react.useState)(0);
|
|
26
|
-
const [editorWidth, setEditorWidth] =
|
|
24
|
+
// const [editorWidth, setEditorWidth] = useState(editor.width);
|
|
27
25
|
const allWidth = columns.reduce((pre, cur) => pre + cur.width, 0);
|
|
28
26
|
const onScroll = (0, _react.useCallback)(event => {
|
|
29
27
|
setScrollLeft(event.target.scrollLeft);
|
|
@@ -34,12 +32,13 @@ const TableRoot = _ref => {
|
|
|
34
32
|
onContextMenu
|
|
35
33
|
} = (0, _hooks.useContextMenu)(tableScrollWrapper);
|
|
36
34
|
console.log(2, editor, editor.width, columns, allWidth);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
35
|
+
|
|
36
|
+
// useLayoutEffect(() => {
|
|
37
|
+
// if (readonly) {
|
|
38
|
+
// setEditorWidth(editor.width);
|
|
39
|
+
// }
|
|
40
|
+
// }, [editor.width, readonly]);
|
|
41
|
+
// console.log(6, editorWidth);
|
|
43
42
|
return /*#__PURE__*/_react.default.createElement(_hooks.TableRootContext.Provider, {
|
|
44
43
|
value: tableScrollWrapper.current
|
|
45
44
|
}, /*#__PURE__*/_react.default.createElement(_hooks.TableRootScrollLeftContext.Provider, {
|
|
@@ -50,7 +49,7 @@ const TableRoot = _ref => {
|
|
|
50
49
|
}),
|
|
51
50
|
style: {
|
|
52
51
|
...attributes.style,
|
|
53
|
-
maxWidth:
|
|
52
|
+
maxWidth: editor.width ? editor.width : '100%'
|
|
54
53
|
}
|
|
55
54
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
56
55
|
className: (0, _classnames.default)('sdoc-table-scroll-wrapper', {
|
|
@@ -42,8 +42,7 @@ const SdocWikiEditor = _ref => {
|
|
|
42
42
|
cursors
|
|
43
43
|
} = document;
|
|
44
44
|
newEditor.cursors = cursors || {};
|
|
45
|
-
newEditor.width =
|
|
46
|
-
console.log(2, newEditor);
|
|
45
|
+
newEditor.width = _constants.WIKI_EDITOR_EDIT_AREA_WIDTH; // default width
|
|
47
46
|
newEditor.editorType = _constants.WIKI_EDITOR;
|
|
48
47
|
return newEditor;
|
|
49
48
|
|