@seafile/sdoc-editor 1.0.198-test1.2 → 1.0.198-test1.4

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.
@@ -1,5 +1,23 @@
1
1
  .sdoc-whiteboard-container {
2
+ position: relative;
2
3
  width: 670px;
3
4
  height: 300px;
4
5
  border: 1px solid #ccc;
5
- }
6
+ }
7
+
8
+ .sodoc-whiteboard-title {
9
+ font-size: 14px;
10
+ color: #333;
11
+ text-align: center;
12
+ margin: 5px;
13
+ width: 670px;
14
+ position: absolute;
15
+ top: 0;
16
+ left: 0%;
17
+ z-index: 2;
18
+ }
19
+
20
+ .sdoc-whiteboard-container .tldraw-editor-container {
21
+ position: absolute !important;
22
+ }
23
+
@@ -23,23 +23,37 @@ const Whiteboard = _ref => {
23
23
  } = element;
24
24
  const whiteboardRef = (0, _react.useRef)();
25
25
  console.log(33, repoID, filePath);
26
- const containerId = `whiteboard-${title}-draw`;
26
+ const containerId = `whiteboard-${title}`;
27
+ // Set default whiteboard readonly as true
28
+ const readOnly = true;
29
+ const handleDoubleClick = event => {
30
+ event.preventDefault();
31
+ const url = `/lib/${repoID}/file${filePath}`;
32
+ console.log('doubleclick', url1);
33
+ window.open(url, '_blank');
34
+ return;
35
+ };
27
36
  (0, _react.useEffect)(() => {
28
37
  const eventBus = _eventBus.default.getInstance();
29
38
  eventBus.dispatch(_constants.EXTERNAL_EVENT.TLDRAW_EDITOR, {
30
39
  containerId,
31
40
  props: {
32
41
  filePath,
33
- repoID
42
+ repoID,
43
+ readOnly
34
44
  }
35
45
  });
36
- console.log('dispatch', containerId);
37
- }, [filePath, repoID]);
46
+ }, [filePath, repoID, readOnly, containerId]);
38
47
  return /*#__PURE__*/_react.default.createElement("div", {
39
- id: containerId,
40
48
  className: "sdoc-whiteboard-container",
41
- ref: whiteboardRef
42
- });
49
+ ref: whiteboardRef,
50
+ onDoubleClick: handleDoubleClick
51
+ }, /*#__PURE__*/_react.default.createElement("div", {
52
+ className: "sodoc-whiteboard-title"
53
+ }, title), /*#__PURE__*/_react.default.createElement("div", {
54
+ id: containerId,
55
+ className: "sdoc-whiteboard-wrapper"
56
+ }));
43
57
  };
44
58
  function renderWhiteboard(props, editor) {
45
59
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "1.0.198-test1.2",
3
+ "version": "1.0.198-test1.4",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",