@seafile/sdoc-editor 0.2.24-beta2 → 0.2.25-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.
|
Binary file
|
|
@@ -2,3 +2,30 @@
|
|
|
2
2
|
background-color: #FF8000;
|
|
3
3
|
border-color: #FF8000;
|
|
4
4
|
}
|
|
5
|
+
|
|
6
|
+
.sdoc-tip-dialog .sdoc-tip-dialog-custom-container {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
align-items: center;
|
|
10
|
+
padding-top: 46px;
|
|
11
|
+
padding-bottom: 40px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.sdoc-tip-dialog .sdoc-tip-dialog-custom-container .sdoc-tip-img-container {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
width: 140px;
|
|
19
|
+
height: 140px;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.sdoc-tip-dialog .sdoc-tip-dialog-custom-container .sdoc-tip-content {
|
|
24
|
+
width: 100%;
|
|
25
|
+
padding: 10px 16px 64px 16px;
|
|
26
|
+
text-align: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.sdoc-tip-dialog .sdoc-tip-dialog-custom-container .sdoc-tip-operation-btn {
|
|
30
|
+
min-width: 140px;
|
|
31
|
+
}
|
|
@@ -5,6 +5,7 @@ import { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap';
|
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import { TIP_TYPE, TIP_TITLE, TIP_CONTENT } from '../../constants';
|
|
7
7
|
import CommonLoading from '../common-loading';
|
|
8
|
+
import ContentReplaced from '../../assets/images/content-replaced.png';
|
|
8
9
|
import './index.css';
|
|
9
10
|
var NOT_CLOSE_DIALOG_TIP_TYPE = [TIP_TYPE.HAS_BEEN_REPLACED, TIP_TYPE.HAS_BEEN_PUBLISHED, TIP_TYPE.CHECKING, TIP_TYPE.PUBLISHING];
|
|
10
11
|
var TipDialog = function TipDialog(_ref) {
|
|
@@ -45,6 +46,48 @@ var TipDialog = function TipDialog(_ref) {
|
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
48
|
}, [isSubmitting]);
|
|
49
|
+
var refreshPage = useCallback(function () {
|
|
50
|
+
window.location.reload();
|
|
51
|
+
}, []);
|
|
52
|
+
var renderTip = useCallback(function () {
|
|
53
|
+
if (tipType === TIP_TYPE.HAS_BEEN_REPLACED) {
|
|
54
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: "sdoc-tip-dialog-custom-container"
|
|
56
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: "sdoc-tip-img-container"
|
|
58
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
59
|
+
src: ContentReplaced,
|
|
60
|
+
alt: "",
|
|
61
|
+
height: "140"
|
|
62
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: "sdoc-tip-content"
|
|
64
|
+
}, t(TIP_CONTENT[tipType])), /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: "sdoc-tip-operations-container"
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
67
|
+
color: "primary",
|
|
68
|
+
className: "highlight-bg-color sdoc-tip-operation-btn",
|
|
69
|
+
onClick: refreshPage
|
|
70
|
+
}, t('Refresh'))));
|
|
71
|
+
}
|
|
72
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
73
|
+
toggle: NOT_CLOSE_DIALOG_TIP_TYPE.includes(tipType) ? undefined : closeDialog
|
|
74
|
+
}, t(TIP_TITLE[tipType])), /*#__PURE__*/React.createElement(ModalBody, {
|
|
75
|
+
className: "sdoc-tip-body"
|
|
76
|
+
}, 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, {
|
|
77
|
+
color: "secondary",
|
|
78
|
+
className: "mr-2",
|
|
79
|
+
onClick: closeDialog
|
|
80
|
+
}, t('Cancel')), /*#__PURE__*/React.createElement(Button, {
|
|
81
|
+
color: "primary",
|
|
82
|
+
className: classnames('highlight-bg-color', {
|
|
83
|
+
'd-flex align-items-center': isSubmitting
|
|
84
|
+
}),
|
|
85
|
+
disabled: isSubmitting,
|
|
86
|
+
onClick: onSubmit
|
|
87
|
+
}, isSubmitting && /*#__PURE__*/React.createElement("span", {
|
|
88
|
+
className: "submit-loading-container mr-2"
|
|
89
|
+
}, /*#__PURE__*/React.createElement(CommonLoading, null)), t('Confirm'))));
|
|
90
|
+
}, [children, closeDialog, isSubmitting, onSubmit, t, tipType, refreshPage]);
|
|
48
91
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
49
92
|
isOpen: true,
|
|
50
93
|
autoFocus: false,
|
|
@@ -53,23 +96,6 @@ var TipDialog = function TipDialog(_ref) {
|
|
|
53
96
|
toggle: closeDialog,
|
|
54
97
|
className: classnames('sdoc-tip-dialog', className),
|
|
55
98
|
contentClassName: "sdoc-tip-modal"
|
|
56
|
-
},
|
|
57
|
-
toggle: NOT_CLOSE_DIALOG_TIP_TYPE.includes(tipType) ? undefined : closeDialog
|
|
58
|
-
}, t(TIP_TITLE[tipType])), /*#__PURE__*/React.createElement(ModalBody, {
|
|
59
|
-
className: "sdoc-tip-body"
|
|
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, {
|
|
61
|
-
color: "secondary",
|
|
62
|
-
className: "mr-2",
|
|
63
|
-
onClick: closeDialog
|
|
64
|
-
}, t('Cancel')), /*#__PURE__*/React.createElement(Button, {
|
|
65
|
-
color: "primary",
|
|
66
|
-
className: classnames('highlight-bg-color', {
|
|
67
|
-
'd-flex align-items-center': isSubmitting
|
|
68
|
-
}),
|
|
69
|
-
disabled: isSubmitting,
|
|
70
|
-
onClick: onSubmit
|
|
71
|
-
}, isSubmitting && /*#__PURE__*/React.createElement("span", {
|
|
72
|
-
className: "submit-loading-container mr-2"
|
|
73
|
-
}, /*#__PURE__*/React.createElement(CommonLoading, null)), t('Confirm'))));
|
|
99
|
+
}, renderTip());
|
|
74
100
|
};
|
|
75
101
|
export default TipDialog;
|
|
@@ -37,7 +37,7 @@ var SimpleEditor = function SimpleEditor(_ref) {
|
|
|
37
37
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
38
38
|
changes = _useState6[0],
|
|
39
39
|
setChanges = _useState6[1];
|
|
40
|
-
var initIsPublished = context.getSetting('isPublished');
|
|
40
|
+
var initIsPublished = context.getSetting('isPublished') || false;
|
|
41
41
|
var _useState7 = useState(initIsPublished),
|
|
42
42
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
43
43
|
isPublished = _useState8[0],
|