@seafile/seafile-sdoc-editor 2.0.57 → 2.0.59
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.
|
@@ -51,12 +51,13 @@ var MoreOperations = function MoreOperations(_ref) {
|
|
|
51
51
|
setIsDropdownOpen(!isDropdownOpen);
|
|
52
52
|
}, []);
|
|
53
53
|
var handlePrint = (0, _react.useCallback)(function () {
|
|
54
|
+
var pageStyle = "\n @page {\n size: auto A4 landscape;\n margin: 20px 0px;\n padding: 0;\n }\n .d-print-none {\n display:none !important;\n }\n .article {\n border: none !important;\n box-shadow: none !important;\n }\n html, body {\n margin: 0;\n padding: 0\n }\n body {\n min-width: 673px !important;\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n height: auto;\n }\n .d-print-none {\n display:none !important;\n }\n .article {\n width: 673px !important;\n margin: 40px 0px;\n border: none !important;\n box-shadow: none !important;\n padding: 0 !important;\n }\n @media print {\n img {\n page-break-inside: avoid;\n height: auto !important;\n max-width: 100% !important;\n }\n }\n ";
|
|
54
55
|
(0, _printJs["default"])({
|
|
55
56
|
printable: 'sdoc-editor-print-wrapper',
|
|
56
57
|
type: 'html',
|
|
57
|
-
scanStyles:
|
|
58
|
-
targetStyles: ['*'],
|
|
59
|
-
style:
|
|
58
|
+
scanStyles: false,
|
|
59
|
+
// targetStyles: ['*'],
|
|
60
|
+
style: pageStyle,
|
|
60
61
|
css: cssUrls
|
|
61
62
|
});
|
|
62
63
|
}, [cssUrls]);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
|
-
var
|
|
9
|
+
var _regenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regenerator"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactI18next = require("react-i18next");
|
|
@@ -15,23 +15,22 @@ var _sdocEditor = require("@seafile/sdoc-editor");
|
|
|
15
15
|
require("./error-page.css");
|
|
16
16
|
function ErrorPage(_ref) {
|
|
17
17
|
var t = _ref.t;
|
|
18
|
-
var normalizeSdoc = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/(0,
|
|
18
|
+
var normalizeSdoc = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regenerator2["default"])().m(function _callee() {
|
|
19
19
|
var res, success;
|
|
20
|
-
return (0,
|
|
21
|
-
while (1) switch (_context.
|
|
20
|
+
return (0, _regenerator2["default"])().w(function (_context) {
|
|
21
|
+
while (1) switch (_context.n) {
|
|
22
22
|
case 0:
|
|
23
|
-
_context.
|
|
23
|
+
_context.n = 1;
|
|
24
24
|
return _sdocEditor.context.normalizeSdocContent();
|
|
25
|
-
case
|
|
26
|
-
res = _context.
|
|
25
|
+
case 1:
|
|
26
|
+
res = _context.v;
|
|
27
27
|
success = res.data.success;
|
|
28
28
|
if (success) {
|
|
29
29
|
// eslint-disable-next-line no-restricted-globals
|
|
30
30
|
location.reload(true);
|
|
31
31
|
}
|
|
32
|
-
case
|
|
33
|
-
|
|
34
|
-
return _context.stop();
|
|
32
|
+
case 2:
|
|
33
|
+
return _context.a(2);
|
|
35
34
|
}
|
|
36
35
|
}, _callee);
|
|
37
36
|
})), []);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
|
-
var
|
|
9
|
+
var _regenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regenerator"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
11
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
12
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
@@ -35,39 +35,38 @@ var SimpleViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
35
35
|
return (0, _createClass2["default"])(SimpleViewer, [{
|
|
36
36
|
key: "componentDidMount",
|
|
37
37
|
value: function () {
|
|
38
|
-
var _componentDidMount = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0,
|
|
39
|
-
var contentRes, result;
|
|
40
|
-
return (0,
|
|
41
|
-
while (1) switch (_context.
|
|
38
|
+
var _componentDidMount = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regenerator2["default"])().m(function _callee() {
|
|
39
|
+
var contentRes, result, _t;
|
|
40
|
+
return (0, _regenerator2["default"])().w(function (_context) {
|
|
41
|
+
while (1) switch (_context.p = _context.n) {
|
|
42
42
|
case 0:
|
|
43
43
|
_sdocEditor.context.initApi();
|
|
44
|
-
_context.
|
|
45
|
-
_context.
|
|
44
|
+
_context.p = 1;
|
|
45
|
+
_context.n = 2;
|
|
46
46
|
return _sdocEditor.context.getFileContent();
|
|
47
|
-
case
|
|
48
|
-
contentRes = _context.
|
|
47
|
+
case 2:
|
|
48
|
+
contentRes = _context.v;
|
|
49
49
|
result = contentRes.data || null;
|
|
50
50
|
this.setState({
|
|
51
51
|
isContextInit: true,
|
|
52
52
|
document: result
|
|
53
53
|
});
|
|
54
|
-
_context.
|
|
54
|
+
_context.n = 4;
|
|
55
55
|
break;
|
|
56
|
-
case
|
|
57
|
-
_context.
|
|
58
|
-
|
|
56
|
+
case 3:
|
|
57
|
+
_context.p = 3;
|
|
58
|
+
_t = _context.v;
|
|
59
59
|
// eslint-disable-next-line
|
|
60
|
-
console.log(
|
|
60
|
+
console.log(_t);
|
|
61
61
|
this.setState({
|
|
62
62
|
isContextInit: true,
|
|
63
63
|
errorMessage: 'Load_doc_content_error',
|
|
64
64
|
document: null
|
|
65
65
|
});
|
|
66
|
-
case
|
|
67
|
-
|
|
68
|
-
return _context.stop();
|
|
66
|
+
case 4:
|
|
67
|
+
return _context.a(2);
|
|
69
68
|
}
|
|
70
|
-
}, _callee, this, [[1,
|
|
69
|
+
}, _callee, this, [[1, 3]]);
|
|
71
70
|
}));
|
|
72
71
|
function componentDidMount() {
|
|
73
72
|
return _componentDidMount.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/seafile-sdoc-editor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.59",
|
|
4
4
|
"author": "shuntian <978987373@qq.com>",
|
|
5
5
|
"homepage": "https://github.com/seafileltd/sea-sdoc-editor#readme",
|
|
6
6
|
"license": "ISC",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"description": "",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@seafile/print-js": "1.6.6",
|
|
32
|
-
"@seafile/sdoc-editor": "^2.0.
|
|
32
|
+
"@seafile/sdoc-editor": "^2.0.142",
|
|
33
33
|
"classnames": "2.3.2",
|
|
34
34
|
"dayjs": "1.10.7"
|
|
35
35
|
},
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "c87830290c47474115650164e718b15209cf7f82"
|
|
49
49
|
}
|