@seafile/sdoc-editor 1.0.36-alpha.6 → 1.0.36-alpha.8
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/layout/layout.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
const _excluded = ["children", "className"
|
|
2
|
+
const _excluded = ["children", "className"];
|
|
3
3
|
import React, { useEffect } from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import context from '../context';
|
|
@@ -7,14 +7,14 @@ import { LocalStorage } from '../utils';
|
|
|
7
7
|
const Layout = _ref => {
|
|
8
8
|
let {
|
|
9
9
|
children,
|
|
10
|
-
className
|
|
11
|
-
pageType
|
|
10
|
+
className
|
|
12
11
|
} = _ref,
|
|
13
12
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
14
13
|
const cacheHistoryfiles = () => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
console.log('
|
|
14
|
+
const isPublished = context.getSetting('isPublished') || false;
|
|
15
|
+
const isSdocRevision = context.getSetting('isSdocRevision') || false;
|
|
16
|
+
console.log('isPublished', isPublished);
|
|
17
|
+
console.log('isSdocRevision', isSdocRevision);
|
|
18
18
|
const docUuid = context.getSetting('docUuid');
|
|
19
19
|
const docName = context.getSetting('docName');
|
|
20
20
|
const rencentFiles = LocalStorage.getItem('sdoc-recent-files', []);
|
|
@@ -65,9 +65,7 @@ const PublishedRevisionViewer = () => {
|
|
|
65
65
|
className: "error-tip"
|
|
66
66
|
}, t(errorMessage)));
|
|
67
67
|
}
|
|
68
|
-
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Layout, {
|
|
69
|
-
pageType: "revision-viewer"
|
|
70
|
-
}, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(DocInfo, {
|
|
68
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(DocInfo, {
|
|
71
69
|
isEditMode: false,
|
|
72
70
|
isPublished: true
|
|
73
71
|
}), /*#__PURE__*/React.createElement(DocOperations, {
|
|
@@ -99,6 +99,7 @@ const SimpleEditor = _ref => {
|
|
|
99
99
|
}, [setErrorMessage]);
|
|
100
100
|
const renderEditor = useCallback(() => {
|
|
101
101
|
if (!isSdocRevision) {
|
|
102
|
+
console.log('!isSdocRevision');
|
|
102
103
|
return /*#__PURE__*/React.createElement(SDocEditor, {
|
|
103
104
|
ref: editorRef,
|
|
104
105
|
isReloading: isReloading,
|
|
@@ -107,12 +108,14 @@ const SimpleEditor = _ref => {
|
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
if (isPublished) {
|
|
111
|
+
console.log('isPublished');
|
|
110
112
|
return /*#__PURE__*/React.createElement(PublishedRevisionDiffViewer, {
|
|
111
113
|
isShowChanges: isShowChanges,
|
|
112
114
|
revisionContent: revisionContent,
|
|
113
115
|
didMountCallback: setDiffChanges
|
|
114
116
|
});
|
|
115
117
|
}
|
|
118
|
+
console.log('11111111');
|
|
116
119
|
return /*#__PURE__*/React.createElement(RevisionEditor, {
|
|
117
120
|
ref: editorRef,
|
|
118
121
|
isShowChanges: isShowChanges,
|
|
@@ -132,9 +135,7 @@ const SimpleEditor = _ref => {
|
|
|
132
135
|
className: "error-tip"
|
|
133
136
|
}, t(errorMessage)));
|
|
134
137
|
}
|
|
135
|
-
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Layout, {
|
|
136
|
-
pageType: "simple"
|
|
137
|
-
}, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(DocInfo, {
|
|
138
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(DocInfo, {
|
|
138
139
|
isStarred: isStarred,
|
|
139
140
|
isDraft: isDraft,
|
|
140
141
|
showFileTags: showFileTags,
|
|
@@ -65,9 +65,7 @@ class SimpleViewer extends React.Component {
|
|
|
65
65
|
downloadURL
|
|
66
66
|
} = context.getSettings();
|
|
67
67
|
if (isMobile) {
|
|
68
|
-
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Layout, {
|
|
69
|
-
pageType: "simple-view11"
|
|
70
|
-
}, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement("div", {
|
|
71
69
|
className: "doc-info"
|
|
72
70
|
}, /*#__PURE__*/React.createElement("h2", {
|
|
73
71
|
className: "doc-name my-0"
|
|
@@ -87,9 +85,7 @@ class SimpleViewer extends React.Component {
|
|
|
87
85
|
showComment: false
|
|
88
86
|
}))));
|
|
89
87
|
}
|
|
90
|
-
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Layout, {
|
|
91
|
-
pageType: "simple-view22"
|
|
92
|
-
}, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement("div", {
|
|
93
89
|
className: "doc-info"
|
|
94
90
|
}, /*#__PURE__*/React.createElement("h2", {
|
|
95
91
|
className: "doc-name my-0"
|