@seafile/sdoc-editor 0.1.124 → 0.1.125-beta
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/comment/comment/editor-comment.js +11 -2
- package/dist/basic-sdk/comment/comment/style.css +1 -0
- package/dist/basic-sdk/editor.js +25 -171
- package/dist/basic-sdk/extension/plugins/blockquote/helpers.js +2 -1
- package/dist/basic-sdk/extension/plugins/blockquote/menu/index.js +7 -5
- package/dist/basic-sdk/extension/plugins/check-list/helpers.js +2 -1
- package/dist/basic-sdk/extension/plugins/check-list/index.js +2 -2
- package/dist/basic-sdk/extension/plugins/check-list/menu/index.js +7 -5
- package/dist/basic-sdk/extension/plugins/check-list/render-elem.js +5 -9
- package/dist/basic-sdk/extension/plugins/clear-format/helpers.js +2 -0
- package/dist/basic-sdk/extension/plugins/clear-format/menu/index.js +3 -2
- package/dist/basic-sdk/extension/plugins/code-block/helpers.js +2 -1
- package/dist/basic-sdk/extension/plugins/code-block/menu/index.js +7 -4
- package/dist/basic-sdk/extension/plugins/code-block/plugin.js +9 -1
- package/dist/basic-sdk/extension/plugins/code-block/render-elem.js +13 -21
- package/dist/basic-sdk/extension/plugins/font/helpers.js +2 -1
- package/dist/basic-sdk/extension/plugins/font/menu/font-family/index.js +3 -2
- package/dist/basic-sdk/extension/plugins/font/menu/font-size/index.js +3 -2
- package/dist/basic-sdk/extension/plugins/font/menu/index.js +6 -3
- package/dist/basic-sdk/extension/plugins/header/helpers.js +2 -0
- package/dist/basic-sdk/extension/plugins/header/menu/index.js +4 -2
- package/dist/basic-sdk/extension/plugins/image/helpers.js +2 -1
- package/dist/basic-sdk/extension/plugins/image/menu/index.js +8 -6
- package/dist/basic-sdk/extension/plugins/link/helpers.js +2 -1
- package/dist/basic-sdk/extension/plugins/link/menu/index.js +8 -6
- package/dist/basic-sdk/extension/plugins/list/helpers.js +2 -1
- package/dist/basic-sdk/extension/plugins/list/menu/index.js +11 -9
- package/dist/basic-sdk/extension/plugins/sdoc-link/dialogs/select-sdoc-file-dialog/index.css +55 -0
- package/dist/basic-sdk/extension/plugins/sdoc-link/{menu/sdoc-link-file-dialog.js → dialogs/select-sdoc-file-dialog/index.js} +36 -29
- package/dist/basic-sdk/extension/plugins/sdoc-link/dialogs/select-sdoc-file-dialog/local-files/index.css +75 -0
- package/dist/basic-sdk/extension/plugins/sdoc-link/{menu/local-files.js → dialogs/select-sdoc-file-dialog/local-files/index.js} +42 -32
- package/dist/basic-sdk/extension/plugins/sdoc-link/helpers.js +2 -1
- package/dist/basic-sdk/extension/plugins/sdoc-link/{menu/sdoc-link-hover-menu.js → hover-menu/index.js} +1 -1
- package/dist/basic-sdk/extension/plugins/sdoc-link/menu/index.js +7 -6
- package/dist/basic-sdk/extension/plugins/sdoc-link/render-elem.js +3 -2
- package/dist/basic-sdk/extension/plugins/table/helpers.js +2 -1
- package/dist/basic-sdk/extension/plugins/table/menu/active-table-menu/cell-text-align-menu.js +6 -3
- package/dist/basic-sdk/extension/plugins/table/menu/active-table-menu/common-menu.js +3 -2
- package/dist/basic-sdk/extension/plugins/table/menu/active-table-menu/index.js +12 -6
- package/dist/basic-sdk/extension/plugins/table/menu/active-table-menu/remove-table-menu.js +5 -3
- package/dist/basic-sdk/extension/plugins/table/menu/active-table-menu/table-column-menu.js +8 -4
- package/dist/basic-sdk/extension/plugins/table/menu/active-table-menu/table-row-menu.js +8 -4
- package/dist/basic-sdk/extension/plugins/table/menu/table-menu/index.js +7 -5
- package/dist/basic-sdk/extension/plugins/text-align/helpers.js +2 -1
- package/dist/basic-sdk/extension/plugins/text-align/menu/index.js +3 -2
- package/dist/basic-sdk/extension/plugins/text-style/helpers.js +2 -1
- package/dist/basic-sdk/extension/plugins/text-style/menu/index.js +5 -4
- package/dist/basic-sdk/extension/render/render-element.js +3 -5
- package/dist/basic-sdk/extension/toolbar/header-toolbar/index.js +37 -17
- package/dist/basic-sdk/extension/toolbar/header-toolbar/redo-undo.js +7 -4
- package/dist/basic-sdk/layout/editor-container.js +26 -0
- package/dist/basic-sdk/layout/editor-content.js +56 -0
- package/dist/basic-sdk/layout/index.js +4 -0
- package/dist/basic-sdk/outline/index.js +6 -7
- package/dist/basic-sdk/outline/style.css +5 -1
- package/dist/basic-sdk/slate-editor.js +149 -0
- package/dist/basic-sdk/socket/with-socket-io.js +1 -0
- package/dist/basic-sdk/utils/diff.js +12 -0
- package/dist/basic-sdk/views/diff-viewer.js +10 -5
- package/dist/basic-sdk/views/viewer.js +20 -20
- package/dist/components/doc-operations/index.js +2 -0
- package/dist/components/doc-operations/revision-operations/changes-count/index.css +34 -0
- package/dist/components/doc-operations/revision-operations/changes-count/index.js +85 -0
- package/dist/components/doc-operations/revision-operations/index.js +5 -1
- package/dist/pages/diff-viewer.js +2 -0
- package/dist/pages/simple-editor.js +16 -3
- package/package.json +1 -1
- package/public/media/sdoc-editor-font/iconfont.eot +0 -0
- package/public/media/sdoc-editor-font/iconfont.svg +4 -0
- package/public/media/sdoc-editor-font/iconfont.ttf +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff2 +0 -0
- package/public/media/sdoc-editor-font.css +14 -6
- package/dist/basic-sdk/extension/plugins/sdoc-link/menu/local-files.css +0 -98
- package/dist/basic-sdk/extension/plugins/sdoc-link/menu/sdoc-link-file-dialog.css +0 -35
- package/dist/pages/diff-viewer/history-version-viewer.js +0 -15
- package/dist/pages/diff-viewer/index.js +0 -35
- /package/dist/basic-sdk/extension/plugins/sdoc-link/{menu/sdoc-link-hover-menu.css → hover-menu/index.css} +0 -0
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
import React, { Fragment, useRef } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
2
3
|
import { Editable, Slate } from '@seafile/slate-react';
|
|
3
4
|
import defaultEditor, { renderLeaf as _renderLeaf, renderElement as _renderElement } from '../extension';
|
|
4
5
|
import withNodeId from '../node-id';
|
|
5
|
-
import {
|
|
6
|
-
import { generateDefaultDocContent, isMobile } from '../../utils';
|
|
6
|
+
import { generateDefaultDocContent } from '../../utils';
|
|
7
7
|
import { SetNodeToDecorations } from '../highlight-decorate/setNodeToDecorations';
|
|
8
8
|
import { usePipDecorate } from '../decorates';
|
|
9
|
-
import ArticleContainer from '../layout
|
|
10
|
-
import '../assets/css/layout.css';
|
|
11
|
-
import '../assets/css/sdoc-editor-plugins.css';
|
|
12
|
-
import '../assets/css/dropdown-menu.css';
|
|
9
|
+
import { ArticleContainer, EditorContainer, EditorContent } from '../layout';
|
|
13
10
|
import '../assets/css/simple-viewer.css';
|
|
14
11
|
var SDocViewer = function SDocViewer(_ref) {
|
|
15
12
|
var document = _ref.document,
|
|
16
13
|
customRenderLeaf = _ref.renderLeaf,
|
|
17
|
-
customRenderElement = _ref.renderElement
|
|
14
|
+
customRenderElement = _ref.renderElement,
|
|
15
|
+
showToolbar = _ref.showToolbar,
|
|
16
|
+
showOutline = _ref.showOutline;
|
|
18
17
|
var editor = withNodeId(defaultEditor);
|
|
18
|
+
editor.readonly = true;
|
|
19
19
|
var slateValue = (document || generateDefaultDocContent()).children;
|
|
20
|
-
var scrollRef = useRef(null);
|
|
21
20
|
var decorate = usePipDecorate(editor);
|
|
22
|
-
return /*#__PURE__*/React.createElement(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, /*#__PURE__*/React.createElement(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
value: {
|
|
31
|
-
scrollRef: scrollRef
|
|
32
|
-
}
|
|
21
|
+
return /*#__PURE__*/React.createElement(EditorContainer, {
|
|
22
|
+
editor: editor,
|
|
23
|
+
showToolbar: showToolbar,
|
|
24
|
+
readonly: true
|
|
25
|
+
}, /*#__PURE__*/React.createElement(EditorContent, {
|
|
26
|
+
docValue: slateValue,
|
|
27
|
+
readonly: true,
|
|
28
|
+
showOutline: showOutline
|
|
33
29
|
}, /*#__PURE__*/React.createElement(Slate, {
|
|
34
30
|
editor: editor,
|
|
35
31
|
value: slateValue
|
|
@@ -47,6 +43,10 @@ var SDocViewer = function SDocViewer(_ref) {
|
|
|
47
43
|
},
|
|
48
44
|
onDOMBeforeInput: function onDOMBeforeInput(event) {},
|
|
49
45
|
decorate: decorate
|
|
50
|
-
}))))))
|
|
46
|
+
}))))));
|
|
47
|
+
};
|
|
48
|
+
SDocViewer.defaultProps = {
|
|
49
|
+
showToolbar: false,
|
|
50
|
+
showOutline: false
|
|
51
51
|
};
|
|
52
52
|
export default SDocViewer;
|
|
@@ -10,12 +10,14 @@ import ShareOperation from './share-operation';
|
|
|
10
10
|
import './style.css';
|
|
11
11
|
var DocOperations = function DocOperations(_ref) {
|
|
12
12
|
var isShowChanges = _ref.isShowChanges,
|
|
13
|
+
changes = _ref.changes,
|
|
13
14
|
toggleViewChanges = _ref.toggleViewChanges;
|
|
14
15
|
var isSdocRevision = context.getSetting('isSdocRevision');
|
|
15
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
17
|
className: "doc-ops"
|
|
17
18
|
}, /*#__PURE__*/React.createElement(RevisionOperations, {
|
|
18
19
|
isShowChanges: isShowChanges,
|
|
20
|
+
changes: changes,
|
|
19
21
|
toggleViewChanges: toggleViewChanges
|
|
20
22
|
}), /*#__PURE__*/React.createElement(CommentsOperation, null), !isSdocRevision && /*#__PURE__*/React.createElement(ShareOperation, null), /*#__PURE__*/React.createElement(HistoryOperation, null), /*#__PURE__*/React.createElement(CollaboratorsOperation, null), !isSdocRevision && /*#__PURE__*/React.createElement(MoreOperations, null));
|
|
21
23
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.sdoc-revision-changes-container {
|
|
2
|
+
height: 32px;
|
|
3
|
+
border: 1px solid #e5e5e5;
|
|
4
|
+
border-radius: 3px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.sdoc-revision-changes-container .sdoc-revision-changes-divider {
|
|
8
|
+
border-right: 1px solid #e5e5e5;
|
|
9
|
+
height: 100%;
|
|
10
|
+
width: 1px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.sdoc-revision-changes-container .sdoc-revision-changes-last,
|
|
14
|
+
.sdoc-revision-changes-container .sdoc-revision-changes-next {
|
|
15
|
+
padding: 0 8px;
|
|
16
|
+
height: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.sdoc-revision-changes-container .sdoc-revision-changes-last .sdocfont,
|
|
20
|
+
.sdoc-revision-changes-container .sdoc-revision-changes-next .sdocfont {
|
|
21
|
+
color: #000;
|
|
22
|
+
opacity: .5;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.sdoc-revision-changes-container .sdoc-revision-changes-last:hover,
|
|
26
|
+
.sdoc-revision-changes-container .sdoc-revision-changes-next:hover {
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
background-color: #f5f5f5;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.sdoc-revision-changes-container .sdoc-revision-changes-last:hover .sdocfont,
|
|
32
|
+
.sdoc-revision-changes-container .sdoc-revision-changes-next:hover .sdocfont {
|
|
33
|
+
opacity: .75;
|
|
34
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import Tooltip from '../../../../basic-sdk/extension/commons/tooltip';
|
|
5
|
+
import './index.css';
|
|
6
|
+
var ChangesCount = function ChangesCount(_ref) {
|
|
7
|
+
var changes = _ref.changes;
|
|
8
|
+
var _useTranslation = useTranslation(),
|
|
9
|
+
t = _useTranslation.t;
|
|
10
|
+
var _useState = useState(0),
|
|
11
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
+
currentDiffIndex = _useState2[0],
|
|
13
|
+
setDiffIndex = _useState2[1];
|
|
14
|
+
var jumpToElement = useCallback(function (currentDiffIndex) {
|
|
15
|
+
setDiffIndex(currentDiffIndex);
|
|
16
|
+
var change = changes[currentDiffIndex];
|
|
17
|
+
var changeElement = document.querySelectorAll("[data-id=".concat(change, "]"))[0];
|
|
18
|
+
if (changeElement) {
|
|
19
|
+
var scrollContainer = document.getElementById('sdoc-scroll-container');
|
|
20
|
+
if (scrollContainer) {
|
|
21
|
+
scrollContainer.scrollTop = changeElement.offsetTop - 10;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
}, [changes, currentDiffIndex]);
|
|
27
|
+
var lastChange = useCallback(function () {
|
|
28
|
+
if (currentDiffIndex === 0) {
|
|
29
|
+
jumpToElement(changes.length - 1);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
jumpToElement(currentDiffIndex - 1);
|
|
33
|
+
|
|
34
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
|
+
}, [changes, currentDiffIndex]);
|
|
36
|
+
var nextChange = useCallback(function () {
|
|
37
|
+
if (currentDiffIndex === changes.length - 1) {
|
|
38
|
+
jumpToElement(0);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
jumpToElement(currentDiffIndex + 1);
|
|
42
|
+
|
|
43
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
|
+
}, [changes, currentDiffIndex]);
|
|
45
|
+
if (!Array.isArray(changes) || changes.length === 0) {
|
|
46
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
className: "sdoc-revision-changes-container d-flex align-items-center pl-2 pr-2 ml-4"
|
|
48
|
+
}, t('No changes'));
|
|
49
|
+
}
|
|
50
|
+
var changesCount = changes.length;
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: "sdoc-revision-changes-container d-flex align-items-center ml-4"
|
|
53
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "sdoc-revision-changes-tip d-flex align-items-center justify-content-center pl-2 pr-2"
|
|
55
|
+
}, "".concat(t('Changes'), " ").concat(currentDiffIndex + 1, "/").concat(changesCount)), /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "sdoc-revision-changes-divider"
|
|
57
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: "sdoc-revision-changes-last d-flex align-items-center justify-content-center",
|
|
59
|
+
id: "sdoc-revision-changes-last",
|
|
60
|
+
onClick: lastChange
|
|
61
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
62
|
+
className: "sdocfont sdoc-next-page",
|
|
63
|
+
style: {
|
|
64
|
+
transform: 'rotate(-90deg)'
|
|
65
|
+
}
|
|
66
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: "sdoc-revision-changes-divider"
|
|
68
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: "sdoc-revision-changes-next d-flex align-items-center justify-content-center",
|
|
70
|
+
id: "sdoc-revision-changes-next",
|
|
71
|
+
onClick: nextChange
|
|
72
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
73
|
+
className: "sdocfont sdoc-previous-page",
|
|
74
|
+
style: {
|
|
75
|
+
transform: 'rotate(-90deg)'
|
|
76
|
+
}
|
|
77
|
+
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
78
|
+
placement: "bottom",
|
|
79
|
+
target: "sdoc-revision-changes-last"
|
|
80
|
+
}, t('Last modification')), /*#__PURE__*/React.createElement(Tooltip, {
|
|
81
|
+
placement: "bottom",
|
|
82
|
+
target: "sdoc-revision-changes-next"
|
|
83
|
+
}, t('Next modification')));
|
|
84
|
+
};
|
|
85
|
+
export default ChangesCount;
|
|
@@ -4,12 +4,16 @@ import PublishRevision from './publish-button';
|
|
|
4
4
|
import ViewChanges from './view-changes';
|
|
5
5
|
import MoreRevisionOperations from './more-revision-operations';
|
|
6
6
|
import Revisions from './revisions';
|
|
7
|
+
import ChangesCount from './changes-count';
|
|
7
8
|
var RevisionOperations = function RevisionOperations(_ref) {
|
|
8
9
|
var isShowChanges = _ref.isShowChanges,
|
|
10
|
+
changes = _ref.changes,
|
|
9
11
|
toggleViewChanges = _ref.toggleViewChanges;
|
|
10
12
|
var isSdocRevision = context.getSetting('isSdocRevision');
|
|
11
13
|
var isPublished = context.getSetting('isPublished');
|
|
12
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, !isSdocRevision && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MoreRevisionOperations, null), /*#__PURE__*/React.createElement(Revisions, null)), isSdocRevision && /*#__PURE__*/React.createElement(
|
|
14
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !isSdocRevision && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MoreRevisionOperations, null), /*#__PURE__*/React.createElement(Revisions, null)), isSdocRevision && isShowChanges && /*#__PURE__*/React.createElement(ChangesCount, {
|
|
15
|
+
changes: changes
|
|
16
|
+
}), isSdocRevision && /*#__PURE__*/React.createElement(ViewChanges, {
|
|
13
17
|
isShowChanges: isShowChanges,
|
|
14
18
|
toggleViewChanges: toggleViewChanges
|
|
15
19
|
}), isSdocRevision && !isPublished && /*#__PURE__*/React.createElement(PublishRevision, null));
|
|
@@ -3,14 +3,13 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { withTranslation } from 'react-i18next';
|
|
5
5
|
import deepCopy from 'deep-copy';
|
|
6
|
-
import { SDocEditor } from '../basic-sdk';
|
|
6
|
+
import { SDocEditor, DiffViewer } from '../basic-sdk';
|
|
7
7
|
import Loading from '../components/loading';
|
|
8
8
|
import DocInfo from '../components/doc-info';
|
|
9
9
|
import DocOperations from '../components/doc-operations';
|
|
10
10
|
import Layout, { Header, Content } from '../layout';
|
|
11
11
|
import { generateDefaultDocContent } from '../utils';
|
|
12
12
|
import context from '../context';
|
|
13
|
-
import DiffViewer from './diff-viewer';
|
|
14
13
|
import ErrorBoundary from './error-boundary';
|
|
15
14
|
import '../assets/css/simple-editor.css';
|
|
16
15
|
var SimpleEditor = function SimpleEditor(_ref) {
|
|
@@ -114,10 +113,20 @@ var SimpleEditor = function SimpleEditor(_ref) {
|
|
|
114
113
|
initChangesData();
|
|
115
114
|
return;
|
|
116
115
|
}
|
|
116
|
+
setChanges([]);
|
|
117
117
|
initDocumentData(false);
|
|
118
118
|
|
|
119
119
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
120
120
|
}, [document]);
|
|
121
|
+
var _useState15 = useState([]),
|
|
122
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
123
|
+
changes = _useState16[0],
|
|
124
|
+
setChanges = _useState16[1];
|
|
125
|
+
var setDiffChanges = useCallback(function (diff) {
|
|
126
|
+
setChanges(diff.changes);
|
|
127
|
+
|
|
128
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
129
|
+
}, [isShowChanges]);
|
|
121
130
|
if (isFirstLoad && !errorMessage) {
|
|
122
131
|
return /*#__PURE__*/React.createElement(Loading, null);
|
|
123
132
|
}
|
|
@@ -134,6 +143,7 @@ var SimpleEditor = function SimpleEditor(_ref) {
|
|
|
134
143
|
isEditMode: !isShowChanges
|
|
135
144
|
}), /*#__PURE__*/React.createElement(DocOperations, {
|
|
136
145
|
isShowChanges: isShowChanges,
|
|
146
|
+
changes: changes,
|
|
137
147
|
toggleViewChanges: toggleViewChanges
|
|
138
148
|
})), /*#__PURE__*/React.createElement(Content, null, isLoadingSdoc && /*#__PURE__*/React.createElement("div", {
|
|
139
149
|
className: "w-100 h-100 d-flex align-items-center justify-content-center"
|
|
@@ -142,8 +152,11 @@ var SimpleEditor = function SimpleEditor(_ref) {
|
|
|
142
152
|
}, /*#__PURE__*/React.createElement("div", {
|
|
143
153
|
className: "error-tip"
|
|
144
154
|
}, t(errorMessage))), !isLoadingSdoc && !errorMessage && /*#__PURE__*/React.createElement(React.Fragment, null, isShowChanges ? /*#__PURE__*/React.createElement(DiffViewer, {
|
|
155
|
+
showToolbar: true,
|
|
156
|
+
showOutline: true,
|
|
145
157
|
currentContent: currentContent,
|
|
146
|
-
lastContent: lastContent
|
|
158
|
+
lastContent: lastContent,
|
|
159
|
+
didMountCallback: setDiffChanges
|
|
147
160
|
}) : /*#__PURE__*/React.createElement(SDocEditor, {
|
|
148
161
|
config: context.getEditorConfig(),
|
|
149
162
|
document: document,
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
/>
|
|
15
15
|
<missing-glyph />
|
|
16
16
|
|
|
17
|
+
<glyph glyph-name="sdoc-next-page" unicode="" d="M342.4 768c12.8 0 28.8-6.4 38.4-16l329.6-329.6c22.4-22.4 22.4-57.6 0-76.8L380.8 16c-22.4-22.4-57.6-22.4-76.8 0-22.4 22.4-22.4 57.6 0 76.8L595.2 384 304 675.2c-22.4 22.4-22.4 57.6 0 76.8 9.6 9.6 25.6 16 38.4 16z" horiz-adv-x="1024" />
|
|
18
|
+
|
|
19
|
+
<glyph glyph-name="sdoc-previous-page" unicode="" d="M672 768c-12.8 0-28.8-6.4-38.4-16L304 422.4c-22.4-22.4-22.4-57.6 0-76.8L633.6 16c22.4-22.4 57.6-22.4 76.8 0 22.4 22.4 22.4 57.6 0 76.8L419.2 384l291.2 291.2c22.4 22.4 22.4 57.6 0 76.8-9.6 9.6-25.6 16-38.4 16z" horiz-adv-x="1024" />
|
|
20
|
+
|
|
17
21
|
<glyph glyph-name="sdoc-save-tip" unicode="" d="M528 800c153.6 0 272-112 284.8-252.8 121.6-9.6 208-137.6 208-291.2 0-160-86.4-284.8-201.6-288H208c-96 0-208 124.8-208 284.8s89.6 294.4 227.2 288c9.6 0 16 0 22.4-3.2C291.2 694.4 374.4 800 528 800z m3.2-96c-99.2 0-179.2-73.6-208-256-48 3.2-76.8 3.2-96 0-73.6-9.6-131.2-86.4-131.2-185.6S166.4 64 227.2 64h582.4c54.4 0 118.4 96 118.4 198.4 0 89.6-35.2 166.4-99.2 185.6-28.8 9.6-67.2 12.8-92.8 6.4-6.4 169.6-99.2 249.6-204.8 249.6z m163.2-252.8l38.4-41.6c6.4-6.4 6.4-16 0-22.4l-256-249.6c-12.8-12.8-32-16-44.8-3.2l-147.2 140.8c-6.4 6.4-6.4 12.8-3.2 19.2l3.2 3.2 38.4 38.4c6.4 6.4 16 6.4 22.4 0l108.8-105.6L672 448c6.4 9.6 16 9.6 22.4 3.2z" horiz-adv-x="1024" />
|
|
18
22
|
|
|
19
23
|
<glyph glyph-name="sdoc-file" unicode="" d="M460.8 723.2H112c-16 0-35.2-12.8-35.2-35.2v-601.6c0-19.2 16-35.2 35.2-35.2h803.2c16 0 35.2 19.2 35.2 35.2V576c0 19.2-16 35.2-35.2 35.2H588.8c-12.8 0-16 6.4-22.4 12.8l-105.6 99.2z m137.6-38.4h313.6c57.6 0 112-48 112-115.2v-489.6c0-60.8-48-115.2-112-115.2h-800C51.2-32 0 16 0 83.2V684.8C0 745.6 48 800 112 800h361.6c12.8 0 16-6.4 22.4-12.8l102.4-102.4z" horiz-adv-x="1024" />
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "sdocfont"; /* Project id 4097705 */
|
|
3
|
-
src: url('./sdoc-editor-font/iconfont.eot?t=
|
|
4
|
-
src: url('./sdoc-editor-font/iconfont.eot?t=
|
|
5
|
-
url('./sdoc-editor-font/iconfont.woff2?t=
|
|
6
|
-
url('./sdoc-editor-font/iconfont.woff?t=
|
|
7
|
-
url('./sdoc-editor-font/iconfont.ttf?t=
|
|
8
|
-
url('./sdoc-editor-font/iconfont.svg?t=
|
|
3
|
+
src: url('./sdoc-editor-font/iconfont.eot?t=1692935854632'); /* IE9 */
|
|
4
|
+
src: url('./sdoc-editor-font/iconfont.eot?t=1692935854632#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
|
5
|
+
url('./sdoc-editor-font/iconfont.woff2?t=1692935854632') format('woff2'),
|
|
6
|
+
url('./sdoc-editor-font/iconfont.woff?t=1692935854632') format('woff'),
|
|
7
|
+
url('./sdoc-editor-font/iconfont.ttf?t=1692935854632') format('truetype'),
|
|
8
|
+
url('./sdoc-editor-font/iconfont.svg?t=1692935854632#sdocfont') format('svg');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.sdocfont {
|
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
-moz-osx-font-smoothing: grayscale;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
.sdoc-next-page:before {
|
|
20
|
+
content: "\e626";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.sdoc-previous-page:before {
|
|
24
|
+
content: "\e651";
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
.sdoc-save-tip:before {
|
|
20
28
|
content: "\e650";
|
|
21
29
|
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
.sdoc-local-files-library {
|
|
2
|
-
color: #212529;
|
|
3
|
-
cursor: pointer;
|
|
4
|
-
font-size: 14px;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .sdoc-local-folder-info {
|
|
8
|
-
display: flex;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .sdoc-local-folder-info > span:nth-child(-n+2) {
|
|
12
|
-
padding-right: 3px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .sdoc-local-folder-info :first-child {
|
|
16
|
-
transform: scale(0.6)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .active {
|
|
20
|
-
background: #ff8000;
|
|
21
|
-
border-radius: 2px;
|
|
22
|
-
box-shadow: inset 0 0 1px #999;
|
|
23
|
-
color: #fff;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .active .sdoc-local-file-icon {
|
|
27
|
-
color: #fff;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .inactive:hover {
|
|
31
|
-
background: #fdefb9;
|
|
32
|
-
border-radius: 2px;
|
|
33
|
-
box-shadow: inset 0 0 1px #999;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .inactive > span:nth-child(-n+2) {
|
|
37
|
-
color: #9aa0ac;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .sdoc-local-folder-info .icon-drop-down-scale {
|
|
41
|
-
transform: scale(1.1) !important;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .sdoc-local-folder-info > span:nth-child(3) {
|
|
45
|
-
padding-left: 3px;
|
|
46
|
-
white-space: nowrap;
|
|
47
|
-
overflow: hidden;
|
|
48
|
-
text-overflow: ellipsis;
|
|
49
|
-
line-height: 24px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .sdoc-local-folder-files {
|
|
53
|
-
padding-left: 24px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .sdoc-local-folder-files .active {
|
|
57
|
-
background: #ff8000;
|
|
58
|
-
border-radius: 2px;
|
|
59
|
-
box-shadow: inset 0 0 1px #999;
|
|
60
|
-
color: #fff;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .sdoc-local-folder-files .inactive:hover {
|
|
64
|
-
background: #fdefb9;
|
|
65
|
-
border-radius: 2px;
|
|
66
|
-
box-shadow: inset 0 0 1px #999;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .sdoc-local-folder-children {
|
|
70
|
-
padding-left: 24px
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.sdoc-local-files-library .sdoc-local-folder-container .sdoc-local-folder .sdoc-local-folder-children .inactive .sdoc-local-file-icon {
|
|
74
|
-
color: #ff9800;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.sdoc-local-files-library .sdoc-local-folder-container .inactive:hover {
|
|
78
|
-
background: #fdefb9;
|
|
79
|
-
border-radius: 2px;
|
|
80
|
-
box-shadow: inset 0 0 1px #999;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.sdoc-local-files-library .sdoc-local-folder-container .active {
|
|
84
|
-
background: #ff8000;
|
|
85
|
-
border-radius: 2px;
|
|
86
|
-
box-shadow: inset 0 0 1px #999;
|
|
87
|
-
color: #fff;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.sdoc-local-files-library .sdoc-local-folder-container .active .sdoc-local-file-icon {
|
|
91
|
-
color: #fff;
|
|
92
|
-
padding-right: 5px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.sdoc-local-files-library .sdoc-local-folder-container .inactive .sdoc-local-file-icon {
|
|
96
|
-
color: #ff9800;
|
|
97
|
-
padding-right: 5px;
|
|
98
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
.sdoc-file-addition-container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: row;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.sdoc-file-addition-left {
|
|
7
|
-
border-right: 1px solid #e9ecef;
|
|
8
|
-
width: 150px;
|
|
9
|
-
padding: 12px 8px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.sdoc-file-addition-left .sdoc-addition-item {
|
|
13
|
-
padding: 5px 0 5px 8px;
|
|
14
|
-
border-radius: 3px;
|
|
15
|
-
display: inline-block;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
width: 100%;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.sdoc-file-addition-left .sdoc-addition-item:hover {
|
|
21
|
-
background-color: #f5f5f5;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.sdoc-file-addition-container .sdoc-file-addition-left .selected-sdoc-addition-item {
|
|
25
|
-
background-color: #ff8000;
|
|
26
|
-
color: #fff;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.sdoc-file-addition-right {
|
|
30
|
-
height: 440px;
|
|
31
|
-
overflow-y: auto;
|
|
32
|
-
overflow-x: hidden;
|
|
33
|
-
padding: 16px 16px;
|
|
34
|
-
width: 470px;
|
|
35
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { SDocViewer } from '../../basic-sdk';
|
|
4
|
-
import { generateDefaultDocContent } from '../../utils';
|
|
5
|
-
import { normalizeChildren } from '../../basic-sdk/utils/document-utils';
|
|
6
|
-
function HistoryVersionViewer(props) {
|
|
7
|
-
var document = props.document;
|
|
8
|
-
var validDocument = document || generateDefaultDocContent();
|
|
9
|
-
return /*#__PURE__*/React.createElement(SDocViewer, {
|
|
10
|
-
document: _objectSpread(_objectSpread({}, validDocument), {}, {
|
|
11
|
-
children: normalizeChildren(validDocument.children)
|
|
12
|
-
})
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
export default HistoryVersionViewer;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
|
-
import HistoryVersionViewer from './history-version-viewer';
|
|
7
|
-
import { DiffViewer } from '../../basic-sdk';
|
|
8
|
-
import context from '../../context';
|
|
9
|
-
var Index = /*#__PURE__*/function (_Component) {
|
|
10
|
-
_inherits(Index, _Component);
|
|
11
|
-
var _super = _createSuper(Index);
|
|
12
|
-
function Index(props) {
|
|
13
|
-
var _this;
|
|
14
|
-
_classCallCheck(this, Index);
|
|
15
|
-
_this = _super.call(this, props);
|
|
16
|
-
context.initSettings();
|
|
17
|
-
return _this;
|
|
18
|
-
}
|
|
19
|
-
_createClass(Index, [{
|
|
20
|
-
key: "render",
|
|
21
|
-
value: function render() {
|
|
22
|
-
var _this$props = this.props,
|
|
23
|
-
currentContent = _this$props.currentContent,
|
|
24
|
-
lastContent = _this$props.lastContent;
|
|
25
|
-
if (!lastContent) {
|
|
26
|
-
return /*#__PURE__*/React.createElement(HistoryVersionViewer, {
|
|
27
|
-
document: currentContent
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return /*#__PURE__*/React.createElement(DiffViewer, this.props);
|
|
31
|
-
}
|
|
32
|
-
}]);
|
|
33
|
-
return Index;
|
|
34
|
-
}(Component);
|
|
35
|
-
export default Index;
|
|
File without changes
|