@seafile/seafile-editor 0.3.110 → 0.3.112

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.
@@ -207,6 +207,9 @@ var Plugin = function Plugin(_editor) {
207
207
  };
208
208
 
209
209
  this.onCopy = function (event, editor) {
210
+ event.stopPropagation();
211
+ event.nativeEvent.stopImmediatePropagation();
212
+
210
213
  if (_this.tableUtils.isInTable()) {
211
214
  event.preventDefault();
212
215
 
@@ -1,23 +1,7 @@
1
- .big-image-cover {
2
- position: relative;
1
+ .sf-editor-image-previewer .ril__closeButton {
2
+ background-image: none !important;
3
3
  }
4
4
 
5
- .big-image-cover .image-container-close {
6
- position: absolute;
7
- top: 10px;
8
- right: 10px;
9
- cursor: pointer;
10
- width: 30px;
11
- height: 30px;
12
- display: flex;
13
- justify-content: center;
14
- align-items: center;
15
- }
16
-
17
- .big-image-cover .image-container-close .icon-close {
18
- color: rgba(0, 0, 0, 0.5);
19
- }
20
-
21
- .big-image-cover .image-container-close .icon-close:hover {
22
- color: rgba(0, 0, 0, 0.75);
5
+ .sf-editor-image-previewer .ril__caption {
6
+ justify-content: center !important;
23
7
  }
@@ -3,8 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
- import ModalPortal from '../components/modal-portal';
7
- import { Modal } from 'reactstrap';
6
+ import Lightbox from '@seafile/react-image-lightbox';
8
7
  import './viewer-image.css';
9
8
 
10
9
  var ViewerImage = /*#__PURE__*/function (_React$Component) {
@@ -28,9 +27,16 @@ var ViewerImage = /*#__PURE__*/function (_React$Component) {
28
27
  };
29
28
 
30
29
  _this.renderBigImage = function (src) {
31
- return /*#__PURE__*/React.createElement(BigImage, {
32
- src: src,
33
- toggleBigImage: _this.toggleBigImage
30
+ return /*#__PURE__*/React.createElement(Lightbox, {
31
+ wrapperClassName: "sf-editor-image-previewer",
32
+ mainSrc: src,
33
+ imagePadding: 70,
34
+ onCloseRequest: _this.toggleBigImage,
35
+ reactModalStyle: {
36
+ overlay: {
37
+ zIndex: 1051
38
+ }
39
+ }
34
40
  });
35
41
  };
36
42
 
@@ -49,7 +55,12 @@ var ViewerImage = /*#__PURE__*/function (_React$Component) {
49
55
  var data = node.data;
50
56
  var isShowBigImage = this.state.isShowBigImage;
51
57
  var src = data.src;
52
- var dom = /*#__PURE__*/React.createElement("span", {
58
+
59
+ if (!src) {
60
+ return /*#__PURE__*/React.createElement("span", attributes, "Loading...");
61
+ }
62
+
63
+ return /*#__PURE__*/React.createElement("span", {
53
64
  className: "seafile-ed-image seafile-ed-image-viwer"
54
65
  }, /*#__PURE__*/React.createElement("img", Object.assign({
55
66
  draggable: false,
@@ -64,38 +75,10 @@ var ViewerImage = /*#__PURE__*/function (_React$Component) {
64
75
  }, /*#__PURE__*/React.createElement("i", {
65
76
  className: 'iconfont icon-fullscreen'
66
77
  })), isShowBigImage && this.renderBigImage(src));
67
- return src ? dom : /*#__PURE__*/React.createElement("span", attributes, "Loading...");
68
78
  }
69
79
  }]);
70
80
 
71
81
  return ViewerImage;
72
82
  }(React.Component);
73
83
 
74
- var BigImage = function BigImage(props) {
75
- return /*#__PURE__*/React.createElement(ModalPortal, null, /*#__PURE__*/React.createElement(Modal, {
76
- isOpen: true,
77
- centered: true,
78
- toggle: function toggle() {
79
- props.toggleBigImage();
80
- }
81
- }, /*#__PURE__*/React.createElement("div", {
82
- className: "big-image-cover",
83
- onClick: function onClick(event) {
84
- return props.toggleBigImage(event);
85
- }
86
- }, /*#__PURE__*/React.createElement("div", {
87
- className: "big-image-container"
88
- }, /*#__PURE__*/React.createElement("img", {
89
- src: props.src,
90
- alt: ""
91
- })), /*#__PURE__*/React.createElement("div", {
92
- onClick: function onClick(event) {
93
- return props.toggleBigImage(event);
94
- },
95
- className: "image-container-close"
96
- }, /*#__PURE__*/React.createElement("i", {
97
- className: "iconfont icon-close"
98
- })))));
99
- };
100
-
101
84
  export { ViewerImage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "0.3.110",
3
+ "version": "0.3.112",
4
4
  "private": false,
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^0.0.9",