@seafile/sdoc-editor 0.2.25-beta → 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.
@@ -2,30 +2,3 @@
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,7 +5,6 @@ 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';
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];
11
10
  var TipDialog = function TipDialog(_ref) {
@@ -46,48 +45,6 @@ var TipDialog = function TipDialog(_ref) {
46
45
  };
47
46
  }
48
47
  }, [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]);
91
48
  return /*#__PURE__*/React.createElement(Modal, {
92
49
  isOpen: true,
93
50
  autoFocus: false,
@@ -96,6 +53,23 @@ var TipDialog = function TipDialog(_ref) {
96
53
  toggle: closeDialog,
97
54
  className: classnames('sdoc-tip-dialog', className),
98
55
  contentClassName: "sdoc-tip-modal"
99
- }, renderTip());
56
+ }, /*#__PURE__*/React.createElement(ModalHeader, {
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'))));
100
74
  };
101
75
  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') || false;
40
+ var initIsPublished = context.getSetting('isPublished');
41
41
  var _useState7 = useState(initIsPublished),
42
42
  _useState8 = _slicedToArray(_useState7, 2),
43
43
  isPublished = _useState8[0],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.2.25beta",
3
+ "version": "0.2.25",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",