@seafile/sdoc-editor 0.2.24 → 0.2.25
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/components/doc-info/index.js +5 -4
- package/dist/components/doc-operations/index.js +5 -1
- package/dist/components/doc-operations/revision-operations/index.js +14 -12
- package/dist/components/doc-operations/revision-operations/revisions/revisions-dialog/index.js +3 -2
- package/dist/components/doc-operations/revision-operations/view-changes/index.js +1 -1
- package/dist/components/doc-operations/style.css +12 -0
- package/dist/components/doc-operations/tag-operation/file-tag-quick-view/index.js +0 -1
- package/dist/components/tip-dialog/index.js +2 -5
- package/dist/hooks/use-document.js +2 -1
- package/dist/pages/published-revision-viewer.js +3 -1
- package/dist/pages/simple-editor.js +50 -7
- package/package.json +1 -1
- package/public/locales/cs/sdoc-editor.json +4 -2
- package/public/locales/de/sdoc-editor.json +4 -2
- package/public/locales/en/sdoc-editor.json +3 -2
- package/public/locales/es/sdoc-editor.json +4 -2
- package/public/locales/fr/sdoc-editor.json +4 -2
- package/public/locales/it/sdoc-editor.json +4 -2
- package/public/locales/ru/sdoc-editor.json +6 -4
- package/public/locales/zh_CN/sdoc-editor.json +3 -2
- package/dist/components/tip-dialog/tip-content.js +0 -47
|
@@ -13,7 +13,9 @@ var DocInfo = function DocInfo(_ref) {
|
|
|
13
13
|
var t = _ref.t,
|
|
14
14
|
isStarred = _ref.isStarred,
|
|
15
15
|
isDraft = _ref.isDraft,
|
|
16
|
-
isEditMode = _ref.isEditMode
|
|
16
|
+
isEditMode = _ref.isEditMode,
|
|
17
|
+
_ref$isPublished = _ref.isPublished,
|
|
18
|
+
isPublished = _ref$isPublished === void 0 ? false : _ref$isPublished;
|
|
17
19
|
var onInternalLinkClick = useCallback(function () {
|
|
18
20
|
var eventBus = EventBus.getInstance();
|
|
19
21
|
eventBus.dispatch(EXTERNAL_EVENT.INTERNAL_LINK_CLICK);
|
|
@@ -51,7 +53,6 @@ var DocInfo = function DocInfo(_ref) {
|
|
|
51
53
|
var revisionCreatedAt = context.getSetting('revisionCreatedAt');
|
|
52
54
|
var oldDocName = context.getSetting('originFilename');
|
|
53
55
|
var revisionId = context.getSetting('revisionId');
|
|
54
|
-
var isPublished = context.getSetting('isPublished');
|
|
55
56
|
return /*#__PURE__*/React.createElement("div", {
|
|
56
57
|
className: "sdoc-revision-info doc-info"
|
|
57
58
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -68,8 +69,8 @@ var DocInfo = function DocInfo(_ref) {
|
|
|
68
69
|
}, oldDocName), /*#__PURE__*/React.createElement("div", {
|
|
69
70
|
className: "sdoc-revision-order"
|
|
70
71
|
}, t('Revision') + ' ' + revisionId), isPublished && /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
className: "sdoc-revision-
|
|
72
|
-
}, t('Published')), /*#__PURE__*/React.createElement(TipMessage, {
|
|
72
|
+
className: "sdoc-revision-published-tip"
|
|
73
|
+
}, t('Published')), !isPublished && /*#__PURE__*/React.createElement(TipMessage, {
|
|
73
74
|
isEditMode: isEditMode
|
|
74
75
|
})), /*#__PURE__*/React.createElement("div", {
|
|
75
76
|
className: "doc-state"
|
|
@@ -12,11 +12,13 @@ import { isMobile } from '../../utils';
|
|
|
12
12
|
import './style.css';
|
|
13
13
|
var DocOperations = function DocOperations(_ref) {
|
|
14
14
|
var isShowChanges = _ref.isShowChanges,
|
|
15
|
+
_ref$isPublished = _ref.isPublished,
|
|
16
|
+
isPublished = _ref$isPublished === void 0 ? false : _ref$isPublished,
|
|
15
17
|
changes = _ref.changes,
|
|
16
18
|
handleViewChangesToggle = _ref.handleViewChangesToggle,
|
|
19
|
+
handleRevisionMerged = _ref.handleRevisionMerged,
|
|
17
20
|
handleRevisionPublished = _ref.handleRevisionPublished;
|
|
18
21
|
var isSdocRevision = context.getSetting('isSdocRevision');
|
|
19
|
-
var isPublished = context.getSetting('isPublished');
|
|
20
22
|
if (isMobile) {
|
|
21
23
|
return /*#__PURE__*/React.createElement("div", {
|
|
22
24
|
className: "doc-ops"
|
|
@@ -26,8 +28,10 @@ var DocOperations = function DocOperations(_ref) {
|
|
|
26
28
|
className: "doc-ops"
|
|
27
29
|
}, /*#__PURE__*/React.createElement(RevisionOperations, {
|
|
28
30
|
isShowChanges: isShowChanges,
|
|
31
|
+
isPublished: isPublished,
|
|
29
32
|
changes: changes,
|
|
30
33
|
handleViewChangesToggle: handleViewChangesToggle,
|
|
34
|
+
handleRevisionMerged: handleRevisionMerged,
|
|
31
35
|
handleRevisionPublished: handleRevisionPublished
|
|
32
36
|
}), !isPublished && /*#__PURE__*/React.createElement(TagOperation, null), !isPublished && /*#__PURE__*/React.createElement(CommentsOperation, null), !isSdocRevision && /*#__PURE__*/React.createElement(ShareOperation, null), /*#__PURE__*/React.createElement(HistoryOperation, null), !isPublished && /*#__PURE__*/React.createElement(CollaboratorsOperation, null), !isSdocRevision && /*#__PURE__*/React.createElement(MoreOperations, null));
|
|
33
37
|
};
|
|
@@ -3,8 +3,8 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
import { EventBus } from '../../../basic-sdk';
|
|
4
4
|
import { getRebase, hasConflict } from '../../../basic-sdk/utils/rebase';
|
|
5
5
|
import context from '../../../context';
|
|
6
|
-
import { EXTERNAL_EVENT, TIP_TYPE } from '../../../constants';
|
|
7
|
-
import { useDocument } from '../../../hooks
|
|
6
|
+
import { EXTERNAL_EVENT, TIP_CONTENT, TIP_TYPE } from '../../../constants';
|
|
7
|
+
import { useDocument } from '../../../hooks';
|
|
8
8
|
import toaster from '../../toast';
|
|
9
9
|
import TipDialog from '../../tip-dialog';
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
@@ -15,18 +15,20 @@ import Revisions from './revisions';
|
|
|
15
15
|
import ChangesCount from './changes-count';
|
|
16
16
|
var RevisionOperations = function RevisionOperations(_ref) {
|
|
17
17
|
var isShowChanges = _ref.isShowChanges,
|
|
18
|
+
_ref$isPublished = _ref.isPublished,
|
|
19
|
+
isPublished = _ref$isPublished === void 0 ? false : _ref$isPublished,
|
|
18
20
|
changes = _ref.changes,
|
|
19
21
|
handleViewChangesToggle = _ref.handleViewChangesToggle,
|
|
22
|
+
handleRevisionMerged = _ref.handleRevisionMerged,
|
|
20
23
|
handleRevisionPublished = _ref.handleRevisionPublished;
|
|
21
24
|
var isSdocRevision = context.getSetting('isSdocRevision');
|
|
22
|
-
var isPublished = context.getSetting('isPublished');
|
|
23
25
|
var _useTranslation = useTranslation(),
|
|
24
26
|
t = _useTranslation.t;
|
|
25
27
|
var _useState = useState(false),
|
|
26
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
29
|
isShowTip = _useState2[0],
|
|
28
30
|
setShowTip = _useState2[1];
|
|
29
|
-
var _useState3 = useState(
|
|
31
|
+
var _useState3 = useState(''),
|
|
30
32
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
31
33
|
tipType = _useState4[0],
|
|
32
34
|
setTipType = _useState4[1];
|
|
@@ -34,16 +36,17 @@ var RevisionOperations = function RevisionOperations(_ref) {
|
|
|
34
36
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
35
37
|
mergeValue = _useState6[0],
|
|
36
38
|
setMergeValue = _useState6[1];
|
|
39
|
+
var _useDocument = useDocument(),
|
|
40
|
+
loadDocument = _useDocument.loadDocument;
|
|
37
41
|
var onDocumentReplaced = useCallback(function () {
|
|
38
42
|
if (isShowTip) return;
|
|
39
43
|
setTipType(TIP_TYPE.HAS_BEEN_REPLACED);
|
|
40
44
|
setShowTip(true);
|
|
41
45
|
}, [isShowTip]);
|
|
42
46
|
var hasPublishRevision = useCallback(function () {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}, [isShowTip]);
|
|
47
|
+
handleRevisionPublished();
|
|
48
|
+
toaster.success(t(TIP_CONTENT[TIP_TYPE.HAS_BEEN_PUBLISHED]));
|
|
49
|
+
}, [handleRevisionPublished, t]);
|
|
47
50
|
var onDocumentRemoved = useCallback(function () {
|
|
48
51
|
if (isShowTip) return;
|
|
49
52
|
setTipType(TIP_TYPE.HAS_BEEN_REMOVED);
|
|
@@ -73,8 +76,6 @@ var RevisionOperations = function RevisionOperations(_ref) {
|
|
|
73
76
|
|
|
74
77
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
75
78
|
}, []);
|
|
76
|
-
var _useDocument = useDocument(),
|
|
77
|
-
loadDocument = _useDocument.loadDocument;
|
|
78
79
|
|
|
79
80
|
// solve show change view in revision editor
|
|
80
81
|
var onViewChangesToggle = useCallback(function (isShowChanges) {
|
|
@@ -122,7 +123,8 @@ var RevisionOperations = function RevisionOperations(_ref) {
|
|
|
122
123
|
if (canMerge && isNeedReplaceMaster) {
|
|
123
124
|
setTipType(TIP_TYPE.PUBLISHING);
|
|
124
125
|
context.publishRevision().then(function (res) {
|
|
125
|
-
|
|
126
|
+
setShowTip(false);
|
|
127
|
+
setTipType('');
|
|
126
128
|
}).catch(function (error) {
|
|
127
129
|
toaster.danger(t('Error'));
|
|
128
130
|
});
|
|
@@ -176,7 +178,7 @@ var RevisionOperations = function RevisionOperations(_ref) {
|
|
|
176
178
|
context.updateSettings({
|
|
177
179
|
'originFileVersion': origin_file_version
|
|
178
180
|
});
|
|
179
|
-
|
|
181
|
+
handleRevisionMerged && handleRevisionMerged(mergeValue);
|
|
180
182
|
setShowTip(false);
|
|
181
183
|
}).catch(function (error) {
|
|
182
184
|
toaster.danger(t('Error'));
|
package/dist/components/doc-operations/revision-operations/revisions/revisions-dialog/index.js
CHANGED
|
@@ -92,7 +92,8 @@ var RevisionsDialog = function RevisionsDialog(_ref) {
|
|
|
92
92
|
var openRevision = useCallback(function (event, revisionId) {
|
|
93
93
|
eventStopPropagation(event);
|
|
94
94
|
if (event.target.className.includes('sdoc-revision-operation-toggle')) return;
|
|
95
|
-
|
|
95
|
+
var url = "".concat(siteRoot, "lib/").concat(repoID, "/revisions/").concat(revisionId, "/");
|
|
96
|
+
window.open(url, '_blank');
|
|
96
97
|
|
|
97
98
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
98
99
|
}, []);
|
|
@@ -251,7 +252,7 @@ var RevisionsDialog = function RevisionsDialog(_ref) {
|
|
|
251
252
|
onClose: closeDeleteTipDialog,
|
|
252
253
|
zIndex: 1071
|
|
253
254
|
}, t(TIP_CONTENT[TIP_TYPE.DELETE_REVISION], {
|
|
254
|
-
content: "".concat(t('
|
|
255
|
+
content: "".concat(t('revision'), " ").concat(operatingRevisionId)
|
|
255
256
|
})));
|
|
256
257
|
};
|
|
257
258
|
export default RevisionsDialog;
|
|
@@ -11,7 +11,7 @@ var ViewChanges = function ViewChanges(_ref) {
|
|
|
11
11
|
var onViewChangesToggle = useCallback(function () {
|
|
12
12
|
propsOnViewChangesToggle(!isShowChanges);
|
|
13
13
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
-
}, [isShowChanges]);
|
|
14
|
+
}, [isShowChanges, propsOnViewChangesToggle]);
|
|
15
15
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
16
16
|
id: "sdoc-toggle-revision-changes-container",
|
|
17
17
|
className: "h-100 ml-4 d-flex align-items-center "
|
|
@@ -39,3 +39,15 @@
|
|
|
39
39
|
cursor: default;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
.doc-info .sdoc-revision-published-tip {
|
|
43
|
+
display: inline-block;
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
color: #55A900;
|
|
46
|
+
background: #E6F4D6;
|
|
47
|
+
padding: 0 8px;
|
|
48
|
+
height: 20px;
|
|
49
|
+
line-height: 20px;
|
|
50
|
+
border-radius: 3px;
|
|
51
|
+
margin-left: 0.5rem;
|
|
52
|
+
cursor: default;
|
|
53
|
+
}
|
|
@@ -3,8 +3,7 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
|
-
import { TIP_TYPE, TIP_TITLE } from '../../constants';
|
|
7
|
-
import TipContent from './tip-content';
|
|
6
|
+
import { TIP_TYPE, TIP_TITLE, TIP_CONTENT } from '../../constants';
|
|
8
7
|
import CommonLoading from '../common-loading';
|
|
9
8
|
import './index.css';
|
|
10
9
|
var NOT_CLOSE_DIALOG_TIP_TYPE = [TIP_TYPE.HAS_BEEN_REPLACED, TIP_TYPE.HAS_BEEN_PUBLISHED, TIP_TYPE.CHECKING, TIP_TYPE.PUBLISHING];
|
|
@@ -58,9 +57,7 @@ var TipDialog = function TipDialog(_ref) {
|
|
|
58
57
|
toggle: NOT_CLOSE_DIALOG_TIP_TYPE.includes(tipType) ? undefined : closeDialog
|
|
59
58
|
}, t(TIP_TITLE[tipType])), /*#__PURE__*/React.createElement(ModalBody, {
|
|
60
59
|
className: "sdoc-tip-body"
|
|
61
|
-
}, children ? children : /*#__PURE__*/React.createElement(
|
|
62
|
-
tipType: tipType
|
|
63
|
-
})), !NOT_CLOSE_DIALOG_TIP_TYPE.includes(tipType) && /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
60
|
+
}, children ? children : /*#__PURE__*/React.createElement(React.Fragment, null, t(TIP_CONTENT[tipType]))), !NOT_CLOSE_DIALOG_TIP_TYPE.includes(tipType) && /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
64
61
|
color: "secondary",
|
|
65
62
|
className: "mr-2",
|
|
66
63
|
onClick: closeDialog
|
|
@@ -78,10 +78,12 @@ var PublishedRevisionViewer = function PublishedRevisionViewer() {
|
|
|
78
78
|
}, t(errorMessage)));
|
|
79
79
|
}
|
|
80
80
|
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(DocInfo, {
|
|
81
|
-
isEditMode: false
|
|
81
|
+
isEditMode: false,
|
|
82
|
+
isPublished: true
|
|
82
83
|
}), /*#__PURE__*/React.createElement(DocOperations, {
|
|
83
84
|
isShowChanges: isShowChanges,
|
|
84
85
|
changes: changes,
|
|
86
|
+
isPublished: true,
|
|
85
87
|
handleViewChangesToggle: handleViewChangesToggle
|
|
86
88
|
})), /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(PublishedRevisionDiffViewer, {
|
|
87
89
|
isShowChanges: isShowChanges,
|
|
@@ -8,7 +8,7 @@ import Layout, { Header, Content } from '../layout';
|
|
|
8
8
|
import context from '../context';
|
|
9
9
|
import ErrorBoundary from './error-boundary';
|
|
10
10
|
import { SDocEditor } from '../basic-sdk';
|
|
11
|
-
import { RevisionDiffViewer } from '../basic-sdk/views';
|
|
11
|
+
import { PublishedRevisionDiffViewer, RevisionDiffViewer } from '../basic-sdk/views';
|
|
12
12
|
import { useDocument } from '../hooks';
|
|
13
13
|
import { resetWebTitleAndURL } from '../utils';
|
|
14
14
|
import '../assets/css/simple-editor.css';
|
|
@@ -23,7 +23,8 @@ var SimpleEditor = function SimpleEditor(_ref) {
|
|
|
23
23
|
isReloading = _useDocument.isReloading,
|
|
24
24
|
errorMessage = _useDocument.errorMessage,
|
|
25
25
|
document = _useDocument.document,
|
|
26
|
-
reloadDocument = _useDocument.reloadDocument
|
|
26
|
+
reloadDocument = _useDocument.reloadDocument,
|
|
27
|
+
setErrorMessage = _useDocument.setErrorMessage;
|
|
27
28
|
var _useState = useState(false),
|
|
28
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
30
|
isShowChanges = _useState2[0],
|
|
@@ -36,6 +37,11 @@ var SimpleEditor = function SimpleEditor(_ref) {
|
|
|
36
37
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
37
38
|
changes = _useState6[0],
|
|
38
39
|
setChanges = _useState6[1];
|
|
40
|
+
var initIsPublished = context.getSetting('isPublished');
|
|
41
|
+
var _useState7 = useState(initIsPublished),
|
|
42
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
43
|
+
isPublished = _useState8[0],
|
|
44
|
+
setPublished = _useState8[1];
|
|
39
45
|
|
|
40
46
|
// useMount: reset title
|
|
41
47
|
useEffect(function () {
|
|
@@ -47,6 +53,10 @@ var SimpleEditor = function SimpleEditor(_ref) {
|
|
|
47
53
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
54
|
}, [isShowChanges]);
|
|
49
55
|
var handleViewChangesToggle = useCallback(function (isShowChanges) {
|
|
56
|
+
if (isPublished) {
|
|
57
|
+
setShowChanges(isShowChanges);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
50
60
|
if (!isShowChanges) {
|
|
51
61
|
setShowChanges(isShowChanges);
|
|
52
62
|
reloadDocument();
|
|
@@ -58,12 +68,38 @@ var SimpleEditor = function SimpleEditor(_ref) {
|
|
|
58
68
|
setRevisionContent(revisionContent);
|
|
59
69
|
setShowChanges(isShowChanges);
|
|
60
70
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
-
}, [document, editorRef.current]);
|
|
62
|
-
var
|
|
71
|
+
}, [document, editorRef.current, isPublished]);
|
|
72
|
+
var handleRevisionMerged = useCallback(function (value) {
|
|
63
73
|
setShowChanges(false);
|
|
64
74
|
editorRef.current.setSlateValue(value);
|
|
65
75
|
editorRef.current.updateDocumentVersion(value);
|
|
66
76
|
}, []);
|
|
77
|
+
var handleRevisionPublished = useCallback(function () {
|
|
78
|
+
context.getPublishedRevisionContent().then(function (res) {
|
|
79
|
+
var revisionContentString = res.data.content;
|
|
80
|
+
var document = JSON.parse(revisionContentString);
|
|
81
|
+
setRevisionContent(document);
|
|
82
|
+
setPublished(true);
|
|
83
|
+
context.settings['isPublished'] = true;
|
|
84
|
+
var oldAssetsUrl = context.getSetting('assetsUrl');
|
|
85
|
+
var docUuid = context.getSetting('docUuid');
|
|
86
|
+
var originDocUuid = context.getSetting('originDocUuid');
|
|
87
|
+
context.settings['assetsUrl'] = oldAssetsUrl.replace(docUuid, originDocUuid);
|
|
88
|
+
}).catch(function (error) {
|
|
89
|
+
// eslint-disable-next-line
|
|
90
|
+
console.log(error);
|
|
91
|
+
var errorMessage = 'Load_doc_content_error';
|
|
92
|
+
if (error && error.response) {
|
|
93
|
+
var _ref2 = error.response.data || {},
|
|
94
|
+
error_type = _ref2.error_type;
|
|
95
|
+
if (error_type === 'content_invalid') {
|
|
96
|
+
errorMessage = 'Sdoc_format_invalid';
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
setErrorMessage(errorMessage);
|
|
100
|
+
setPublished(true);
|
|
101
|
+
});
|
|
102
|
+
}, [setErrorMessage]);
|
|
67
103
|
if (isFirstLoading) {
|
|
68
104
|
return /*#__PURE__*/React.createElement(Loading, null);
|
|
69
105
|
}
|
|
@@ -77,17 +113,24 @@ var SimpleEditor = function SimpleEditor(_ref) {
|
|
|
77
113
|
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(DocInfo, {
|
|
78
114
|
isStarred: isStarred,
|
|
79
115
|
isDraft: isDraft,
|
|
80
|
-
|
|
116
|
+
isPublished: isPublished,
|
|
117
|
+
isEditMode: isPublished ? false : !isShowChanges
|
|
81
118
|
}), /*#__PURE__*/React.createElement(DocOperations, {
|
|
82
119
|
isShowChanges: isShowChanges,
|
|
120
|
+
isPublished: isPublished,
|
|
83
121
|
changes: changes,
|
|
84
122
|
handleViewChangesToggle: handleViewChangesToggle,
|
|
123
|
+
handleRevisionMerged: handleRevisionMerged,
|
|
85
124
|
handleRevisionPublished: handleRevisionPublished
|
|
86
|
-
})), /*#__PURE__*/React.createElement(Content, null,
|
|
125
|
+
})), /*#__PURE__*/React.createElement(Content, null, isPublished && /*#__PURE__*/React.createElement(PublishedRevisionDiffViewer, {
|
|
126
|
+
isShowChanges: isShowChanges,
|
|
127
|
+
revisionContent: revisionContent,
|
|
128
|
+
didMountCallback: setDiffChanges
|
|
129
|
+
}), !isPublished && !isShowChanges && /*#__PURE__*/React.createElement(SDocEditor, {
|
|
87
130
|
ref: editorRef,
|
|
88
131
|
isReloading: isReloading,
|
|
89
132
|
document: document
|
|
90
|
-
}), isShowChanges && /*#__PURE__*/React.createElement(RevisionDiffViewer, {
|
|
133
|
+
}), !isPublished && isShowChanges && /*#__PURE__*/React.createElement(RevisionDiffViewer, {
|
|
91
134
|
revisionContent: revisionContent,
|
|
92
135
|
didMountCallback: setDiffChanges
|
|
93
136
|
}))));
|
package/package.json
CHANGED
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
"Tip": "Tip",
|
|
380
380
|
"Rebase_delete_no_change_revision_tip": "Revision has not made any change compared to original document. Do you want to delete this revision?",
|
|
381
381
|
"Has_been_replaced_tip": "Document content has been replaced. Please refresh the page.",
|
|
382
|
-
"Has_been_published_tip": "Revision
|
|
382
|
+
"Has_been_published_tip": "Revision published",
|
|
383
383
|
"Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
|
|
384
384
|
"Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
|
|
385
385
|
"Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
|
|
@@ -406,5 +406,7 @@
|
|
|
406
406
|
"Search_tags": "Search tags",
|
|
407
407
|
"No_options_available": "Tag not found",
|
|
408
408
|
"Add_option": "Vytvořit nový štítek",
|
|
409
|
-
"Find_an_option": "Search tags"
|
|
409
|
+
"Find_an_option": "Search tags",
|
|
410
|
+
"Copy_link_of_section": "Copy link of section",
|
|
411
|
+
"revision": "revision"
|
|
410
412
|
}
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
"Tip": "Tip",
|
|
380
380
|
"Rebase_delete_no_change_revision_tip": "Revision has not made any change compared to original document. Do you want to delete this revision?",
|
|
381
381
|
"Has_been_replaced_tip": "Document content has been replaced. Please refresh the page.",
|
|
382
|
-
"Has_been_published_tip": "Revision
|
|
382
|
+
"Has_been_published_tip": "Revision published",
|
|
383
383
|
"Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
|
|
384
384
|
"Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
|
|
385
385
|
"Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
|
|
@@ -406,5 +406,7 @@
|
|
|
406
406
|
"Search_tags": "Search tags",
|
|
407
407
|
"No_options_available": "Tag not found",
|
|
408
408
|
"Add_option": "Neues Tag erstellen",
|
|
409
|
-
"Find_an_option": "Search tags"
|
|
409
|
+
"Find_an_option": "Search tags",
|
|
410
|
+
"Copy_link_of_section": "Copy link of section",
|
|
411
|
+
"revision": "revision"
|
|
410
412
|
}
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
"Tip": "Tip",
|
|
380
380
|
"Rebase_delete_no_change_revision_tip": "Revision has not made any change compared to original document. Do you want to delete this revision?",
|
|
381
381
|
"Has_been_replaced_tip": "Document content has been replaced. Please refresh the page.",
|
|
382
|
-
"Has_been_published_tip": "Revision
|
|
382
|
+
"Has_been_published_tip": "Revision published",
|
|
383
383
|
"Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
|
|
384
384
|
"Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
|
|
385
385
|
"Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
|
|
@@ -407,5 +407,6 @@
|
|
|
407
407
|
"No_options_available": "Tag not found",
|
|
408
408
|
"Add_option": "Create a new tag",
|
|
409
409
|
"Find_an_option": "Search tags",
|
|
410
|
-
"Copy_link_of_section": "Copy link of section"
|
|
410
|
+
"Copy_link_of_section": "Copy link of section",
|
|
411
|
+
"revision": "revision"
|
|
411
412
|
}
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
"Tip": "Tip",
|
|
380
380
|
"Rebase_delete_no_change_revision_tip": "Revision has not made any change compared to original document. Do you want to delete this revision?",
|
|
381
381
|
"Has_been_replaced_tip": "Document content has been replaced. Please refresh the page.",
|
|
382
|
-
"Has_been_published_tip": "Revision
|
|
382
|
+
"Has_been_published_tip": "Revision published",
|
|
383
383
|
"Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
|
|
384
384
|
"Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
|
|
385
385
|
"Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
|
|
@@ -406,5 +406,7 @@
|
|
|
406
406
|
"Search_tags": "Search tags",
|
|
407
407
|
"No_options_available": "Tag not found",
|
|
408
408
|
"Add_option": "Cear una nueva etiqueta",
|
|
409
|
-
"Find_an_option": "Search tags"
|
|
409
|
+
"Find_an_option": "Search tags",
|
|
410
|
+
"Copy_link_of_section": "Copy link of section",
|
|
411
|
+
"revision": "revision"
|
|
410
412
|
}
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
"Tip": "Tip",
|
|
380
380
|
"Rebase_delete_no_change_revision_tip": "Revision has not made any change compared to original document. Do you want to delete this revision?",
|
|
381
381
|
"Has_been_replaced_tip": "Document content has been replaced. Please refresh the page.",
|
|
382
|
-
"Has_been_published_tip": "Revision
|
|
382
|
+
"Has_been_published_tip": "Revision published",
|
|
383
383
|
"Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
|
|
384
384
|
"Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
|
|
385
385
|
"Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
|
|
@@ -406,5 +406,7 @@
|
|
|
406
406
|
"Search_tags": "Search tags",
|
|
407
407
|
"No_options_available": "Tag not found",
|
|
408
408
|
"Add_option": "Créer un nouveau Tag",
|
|
409
|
-
"Find_an_option": "Search tags"
|
|
409
|
+
"Find_an_option": "Search tags",
|
|
410
|
+
"Copy_link_of_section": "Copy link of section",
|
|
411
|
+
"revision": "revision"
|
|
410
412
|
}
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
"Tip": "Tip",
|
|
380
380
|
"Rebase_delete_no_change_revision_tip": "Revision has not made any change compared to original document. Do you want to delete this revision?",
|
|
381
381
|
"Has_been_replaced_tip": "Document content has been replaced. Please refresh the page.",
|
|
382
|
-
"Has_been_published_tip": "Revision
|
|
382
|
+
"Has_been_published_tip": "Revision published",
|
|
383
383
|
"Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
|
|
384
384
|
"Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
|
|
385
385
|
"Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
|
|
@@ -406,5 +406,7 @@
|
|
|
406
406
|
"Search_tags": "Search tags",
|
|
407
407
|
"No_options_available": "Tag not found",
|
|
408
408
|
"Add_option": "Crea un nuovo tag",
|
|
409
|
-
"Find_an_option": "Search tags"
|
|
409
|
+
"Find_an_option": "Search tags",
|
|
410
|
+
"Copy_link_of_section": "Copy link of section",
|
|
411
|
+
"revision": "revision"
|
|
410
412
|
}
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
"Tip": "Совет",
|
|
380
380
|
"Rebase_delete_no_change_revision_tip": "Редакция не внесла никаких изменений по сравнению с исходным документом. Вы хотите удалить эту редакцию?",
|
|
381
381
|
"Has_been_replaced_tip": "Содержимое документа было заменено. Обновите страницу.",
|
|
382
|
-
"Has_been_published_tip": "
|
|
382
|
+
"Has_been_published_tip": "Revision published",
|
|
383
383
|
"Has_conflict_before_publish_tip": "В документе есть конфликты, разрешите их перед публикацией!",
|
|
384
384
|
"Merge_tip": "В документах есть конфликты. Вы хотите объединить их?",
|
|
385
385
|
"Has_conflict_before_view_changes_tip": "В документе есть конфликты. Разрешите конфликт перед просмотром изменений!",
|
|
@@ -400,11 +400,13 @@
|
|
|
400
400
|
"Insert_caption": "Вставить подпись",
|
|
401
401
|
"No_collaborators_available": "Нет доступных соавторов",
|
|
402
402
|
"Find_a_collaborator": "Найти соавтора",
|
|
403
|
-
"Doc_comments": "
|
|
403
|
+
"Doc_comments": "Комментарии к документу",
|
|
404
404
|
"Tag_not_found": "Тег не найден",
|
|
405
405
|
"Create_a_new_tag": "Создать новый тег",
|
|
406
|
-
"Search_tags": "
|
|
406
|
+
"Search_tags": "Поиск тегов",
|
|
407
407
|
"No_options_available": "Тег не найден",
|
|
408
408
|
"Add_option": "Создать новый тег",
|
|
409
|
-
"Find_an_option": "
|
|
409
|
+
"Find_an_option": "Поиск тегов",
|
|
410
|
+
"Copy_link_of_section": "Копировать ссылку на раздел",
|
|
411
|
+
"revision": "revision"
|
|
410
412
|
}
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
"Tip": "提示",
|
|
380
380
|
"Rebase_delete_no_change_revision_tip": "修订改没有更改,是否删除修订稿?",
|
|
381
381
|
"Has_been_replaced_tip": "文档内容已经被替换,请刷新页面。",
|
|
382
|
-
"Has_been_published_tip": "
|
|
382
|
+
"Has_been_published_tip": "修订稿已发布",
|
|
383
383
|
"Has_conflict_before_publish_tip": "文档有冲突,请解决冲突后再发布!",
|
|
384
384
|
"Merge_tip": "文档有冲突,是否合并?",
|
|
385
385
|
"Has_conflict_before_view_changes_tip": "文档有冲突,请解决冲突后再查看更改!",
|
|
@@ -407,5 +407,6 @@
|
|
|
407
407
|
"No_options_available": "标签未找到",
|
|
408
408
|
"Add_option": "新建标签",
|
|
409
409
|
"Find_an_option": "查找标签",
|
|
410
|
-
"Copy_link_of_section": "拷贝章节的链接"
|
|
410
|
+
"Copy_link_of_section": "拷贝章节的链接",
|
|
411
|
+
"revision": "修订稿"
|
|
411
412
|
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { TIP_TYPE, TIP_CONTENT } from '../../constants';
|
|
6
|
-
import context from '../../context';
|
|
7
|
-
var TipContent = function TipContent(_ref) {
|
|
8
|
-
var tipType = _ref.tipType;
|
|
9
|
-
var _useState = useState(3),
|
|
10
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
11
|
-
time = _useState2[0],
|
|
12
|
-
setTime = _useState2[1];
|
|
13
|
-
useEffect(function () {
|
|
14
|
-
if (tipType === TIP_TYPE.HAS_BEEN_PUBLISHED) {
|
|
15
|
-
var _time = 3;
|
|
16
|
-
var timer = setInterval(function () {
|
|
17
|
-
_time--;
|
|
18
|
-
setTime(_time);
|
|
19
|
-
if (_time === 0) {
|
|
20
|
-
clearInterval(timer);
|
|
21
|
-
timer = null;
|
|
22
|
-
}
|
|
23
|
-
}, 1000);
|
|
24
|
-
return function () {
|
|
25
|
-
timer && clearInterval(timer);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
}, [tipType]);
|
|
29
|
-
useEffect(function () {
|
|
30
|
-
if (time === 0) {
|
|
31
|
-
var originFileURL = context.getSetting('originFileURL');
|
|
32
|
-
window.location.href = originFileURL;
|
|
33
|
-
}
|
|
34
|
-
}, [time]);
|
|
35
|
-
var _useTranslation = useTranslation(),
|
|
36
|
-
t = _useTranslation.t;
|
|
37
|
-
if (tipType === TIP_TYPE.HAS_BEEN_PUBLISHED) {
|
|
38
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, t(TIP_CONTENT[tipType], {
|
|
39
|
-
time: time
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, t(TIP_CONTENT[tipType]));
|
|
43
|
-
};
|
|
44
|
-
TipContent.propTypes = {
|
|
45
|
-
tipType: PropTypes.string
|
|
46
|
-
};
|
|
47
|
-
export default TipContent;
|