@seafile/sdoc-editor 0.1.78-beta → 0.1.78-beta1
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/editor.js +1 -1
- package/dist/components/doc-operations/revision-operations/more-revision-operations.js +54 -35
- package/dist/components/doc-operations/revision-operations/publish-button.js +2 -1
- package/dist/components/doc-operations/revision-operations/view-changes/index.css +3 -0
- package/dist/components/doc-operations/revision-operations/view-changes/index.js +26 -0
- package/dist/components/switch/index.js +1 -1
- package/package.json +1 -1
- package/dist/components/doc-operations/revision-operations/view-changes.js +0 -20
package/dist/basic-sdk/editor.js
CHANGED
|
@@ -61,7 +61,6 @@ var SDocEditor = function SDocEditor(_ref) {
|
|
|
61
61
|
// useMount: init socket connection
|
|
62
62
|
useEffect(function () {
|
|
63
63
|
editor.openConnection();
|
|
64
|
-
editor.width = articleRef.current.children[0].clientWidth;
|
|
65
64
|
return function () {
|
|
66
65
|
editor.closeConnection && editor.closeConnection();
|
|
67
66
|
};
|
|
@@ -71,6 +70,7 @@ var SDocEditor = function SDocEditor(_ref) {
|
|
|
71
70
|
// useMount: focus editor
|
|
72
71
|
useEffect(function () {
|
|
73
72
|
var timer = setTimeout(function () {
|
|
73
|
+
editor.width = articleRef.current.children[0].clientWidth;
|
|
74
74
|
focusEditor(editor);
|
|
75
75
|
}, 300);
|
|
76
76
|
return function () {
|
|
@@ -1,41 +1,60 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
2
6
|
import React, { Component, useCallback, useState } from 'react';
|
|
3
7
|
import { withTranslation } from 'react-i18next';
|
|
4
8
|
import { UncontrolledPopover } from 'reactstrap';
|
|
5
|
-
var MoreRevisionOperations = function
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
toggle
|
|
17
|
-
|
|
9
|
+
var MoreRevisionOperations = /*#__PURE__*/function (_Component) {
|
|
10
|
+
_inherits(MoreRevisionOperations, _Component);
|
|
11
|
+
var _super = _createSuper(MoreRevisionOperations);
|
|
12
|
+
function MoreRevisionOperations(props) {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, MoreRevisionOperations);
|
|
15
|
+
_this = _super.call(this, props);
|
|
16
|
+
_this.setRef = function (ref) {
|
|
17
|
+
console.log('click');
|
|
18
|
+
var that = _assertThisInitialized(_this);
|
|
19
|
+
if (!ref) return;
|
|
20
|
+
var toggle = ref.toggle;
|
|
21
|
+
ref.toggle = function (c) {
|
|
22
|
+
console.log(c);
|
|
23
|
+
toggle && toggle();
|
|
24
|
+
that.setState({
|
|
25
|
+
isShowMenu: !that.state.isShowMenu
|
|
26
|
+
});
|
|
27
|
+
};
|
|
18
28
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
_this.state = {
|
|
30
|
+
isShowMenu: false
|
|
31
|
+
};
|
|
32
|
+
_this.id = 'sdoc-revision-more-operations';
|
|
33
|
+
return _this;
|
|
34
|
+
}
|
|
35
|
+
_createClass(MoreRevisionOperations, [{
|
|
36
|
+
key: "render",
|
|
37
|
+
value: function render() {
|
|
38
|
+
var isShowMenu = this.state.isShowMenu;
|
|
39
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
id: this.id,
|
|
41
|
+
className: ""
|
|
42
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
43
|
+
className: "mr-2 sdocfont sdoc-revise"
|
|
44
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
45
|
+
className: "sdocfont sdoc-".concat(isShowMenu ? 'caret-up' : 'drop-down')
|
|
46
|
+
})), /*#__PURE__*/React.createElement(UncontrolledPopover, {
|
|
47
|
+
target: this.id,
|
|
48
|
+
className: "sdoc-common-menu-popover",
|
|
49
|
+
trigger: "legacy",
|
|
50
|
+
placement: "bottom-start",
|
|
51
|
+
hideArrow: true,
|
|
52
|
+
ref: this.setRef
|
|
53
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "sdoc-common-menu-popover-container"
|
|
55
|
+
}, "123")));
|
|
36
56
|
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
57
|
+
}]);
|
|
58
|
+
return MoreRevisionOperations;
|
|
59
|
+
}(Component);
|
|
41
60
|
export default withTranslation('sdoc-editor')(MoreRevisionOperations);
|
|
@@ -25,7 +25,8 @@ var PublishRevision = function PublishRevision(_ref) {
|
|
|
25
25
|
if (isPublished) return null;
|
|
26
26
|
return /*#__PURE__*/React.createElement(Button, {
|
|
27
27
|
color: "success",
|
|
28
|
-
onClick: publish
|
|
28
|
+
onClick: publish,
|
|
29
|
+
className: "ml-4"
|
|
29
30
|
}, t('Publish'));
|
|
30
31
|
};
|
|
31
32
|
export default withTranslation('sdoc-editor')(PublishRevision);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { withTranslation } from 'react-i18next';
|
|
3
|
+
import { UncontrolledTooltip } from 'reactstrap';
|
|
4
|
+
import Switch from '../../../switch';
|
|
5
|
+
import './index.css';
|
|
6
|
+
var ViewChanges = function ViewChanges(_ref) {
|
|
7
|
+
var isShowChanges = _ref.isShowChanges,
|
|
8
|
+
t = _ref.t,
|
|
9
|
+
toggleViewChanges = _ref.toggleViewChanges;
|
|
10
|
+
var onToggleViewCHanges = useCallback(function () {
|
|
11
|
+
toggleViewChanges(!isShowChanges);
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
+
}, [isShowChanges]);
|
|
15
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
id: "sdoc-toggle-revision-changes-container",
|
|
17
|
+
className: "h-100 ml-4 d-flex align-items-center "
|
|
18
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
19
|
+
checked: isShowChanges,
|
|
20
|
+
onChange: onToggleViewCHanges,
|
|
21
|
+
className: "sdoc-toggle-revision-changes d-flex align-items-center"
|
|
22
|
+
})), /*#__PURE__*/React.createElement(UncontrolledTooltip, {
|
|
23
|
+
target: "sdoc-toggle-revision-changes-container"
|
|
24
|
+
}, t('View_changes')));
|
|
25
|
+
};
|
|
26
|
+
export default withTranslation('sdoc-editor')(ViewChanges);
|
|
@@ -19,7 +19,7 @@ function Switch(props) {
|
|
|
19
19
|
onChange: onChange,
|
|
20
20
|
name: "custom-switch-checkbox",
|
|
21
21
|
disabled: disabled
|
|
22
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
22
|
+
}), placeholder && /*#__PURE__*/React.createElement("span", {
|
|
23
23
|
className: "custom-switch-description text-truncate"
|
|
24
24
|
}, placeholder), /*#__PURE__*/React.createElement("span", {
|
|
25
25
|
className: "custom-switch-indicator"
|
package/package.json
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
2
|
-
import { withTranslation } from 'react-i18next';
|
|
3
|
-
import Switch from '../../switch';
|
|
4
|
-
var ViewChanges = function ViewChanges(_ref) {
|
|
5
|
-
var isShowChanges = _ref.isShowChanges,
|
|
6
|
-
t = _ref.t,
|
|
7
|
-
toggleViewChanges = _ref.toggleViewChanges;
|
|
8
|
-
var onToggleViewCHanges = useCallback(function () {
|
|
9
|
-
toggleViewChanges(!isShowChanges);
|
|
10
|
-
}, [isShowChanges]);
|
|
11
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
className: "toggle-revision-changes-container"
|
|
13
|
-
}, /*#__PURE__*/React.createElement(Switch, {
|
|
14
|
-
checked: isShowChanges,
|
|
15
|
-
placeholder: t('View_changes'),
|
|
16
|
-
onChange: onToggleViewCHanges,
|
|
17
|
-
className: "toggle-revision-changes"
|
|
18
|
-
}));
|
|
19
|
-
};
|
|
20
|
-
export default withTranslation('sdoc-editor')(ViewChanges);
|