@seafile/sdoc-editor 0.1.37 → 0.1.38
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/assets/css/textlink-hovermenu.css +37 -25
- package/dist/basic-sdk/extension/plugins/link/menu/hover-link-dialog.js +18 -14
- package/dist/basic-sdk/extension/plugins/link/render-elem.js +4 -2
- package/dist/components/doc-info/index.js +2 -1
- package/package.json +1 -1
- package/public/locales/en/sdoc-editor.json +3 -2
- package/public/media/sdoc-editor-font/iconfont.eot +0 -0
- package/public/media/sdoc-editor-font/iconfont.svg +2 -0
- package/public/media/sdoc-editor-font/iconfont.ttf +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff2 +0 -0
- package/public/media/sdoc-editor-font.css +4 -0
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
.link-op-menu {
|
|
2
|
+
height: 36px;
|
|
3
|
+
padding: 7px 8px;
|
|
4
4
|
display: flex;
|
|
5
5
|
position: absolute;
|
|
6
6
|
background-color: #fff;
|
|
7
|
-
border: 1px solid
|
|
8
|
-
|
|
7
|
+
border: 1px solid #e5e5e5;
|
|
8
|
+
border-radius: 3px;
|
|
9
|
+
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
|
|
9
10
|
z-index: 1000;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
.
|
|
13
|
+
.link-op-menu .link-op-menu-triangle {
|
|
13
14
|
width: 8px;
|
|
14
15
|
height: 8px;
|
|
15
16
|
transform: rotate(45deg);
|
|
@@ -17,35 +18,46 @@
|
|
|
17
18
|
border-right: 1px solid rgba(0, 40, 100, 0.12);
|
|
18
19
|
border-bottom: 1px solid rgba(0, 40, 100, 0.12);
|
|
19
20
|
position: absolute;
|
|
20
|
-
top:
|
|
21
|
+
top: 31px;
|
|
21
22
|
right: 50%;
|
|
22
23
|
z-index: 1001;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
padding:
|
|
29
|
-
|
|
30
|
-
line-height: 28px;
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
cursor: pointer;
|
|
26
|
+
.link-op-menu-link {
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
color: #212529;
|
|
29
|
+
padding: 0 5px;
|
|
30
|
+
border-radius: 2px;
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
.link-op-menu-link:hover {
|
|
34
|
+
color: #212529;
|
|
35
|
+
text-decoration: none;
|
|
36
|
+
background: #f1f1f1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.link-op-icons {
|
|
40
|
+
margin-left: 8px;
|
|
41
|
+
border-left: 1px solid #e5e5e5;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.link-op-icon {
|
|
39
45
|
color: #999999;
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
padding: 4px;
|
|
47
|
+
border-radius: 2px;
|
|
48
|
+
margin-left: 8px;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.link-op-icon .iconfont {
|
|
54
|
+
font-size: 12px;
|
|
42
55
|
}
|
|
43
56
|
|
|
44
|
-
.
|
|
45
|
-
|
|
46
|
-
box-shadow: 0;
|
|
57
|
+
.link-op-icon:hover {
|
|
58
|
+
background: #f1f1f1;
|
|
47
59
|
}
|
|
48
60
|
|
|
49
61
|
.seafile-ed-hovermenu-mouseclick {
|
|
50
|
-
background-color: #
|
|
62
|
+
background-color: #e5e5e5;
|
|
51
63
|
}
|
|
@@ -4,6 +4,7 @@ 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
6
|
import { createPortal } from 'react-dom';
|
|
7
|
+
import { withTranslation } from 'react-i18next';
|
|
7
8
|
import '../../../../assets/css/textlink-hovermenu.css';
|
|
8
9
|
var LinkHoverComponent = /*#__PURE__*/function (_React$Component) {
|
|
9
10
|
_inherits(LinkHoverComponent, _React$Component);
|
|
@@ -17,33 +18,36 @@ var LinkHoverComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
17
18
|
value: function render() {
|
|
18
19
|
var _this$props = this.props,
|
|
19
20
|
menuPosition = _this$props.menuPosition,
|
|
20
|
-
href = _this$props.href
|
|
21
|
+
href = _this$props.href,
|
|
22
|
+
t = _this$props.t;
|
|
21
23
|
return /*#__PURE__*/React.createElement(React.Fragment, null, createPortal( /*#__PURE__*/React.createElement("div", {
|
|
22
|
-
id: "
|
|
23
|
-
className: "
|
|
24
|
+
id: "link-op-menu",
|
|
25
|
+
className: "link-op-menu",
|
|
24
26
|
style: menuPosition
|
|
25
27
|
}, /*#__PURE__*/React.createElement("a", {
|
|
26
28
|
href: href,
|
|
27
29
|
target: "_blank",
|
|
28
30
|
rel: "noopener noreferrer",
|
|
29
|
-
className: "
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
className: "link-op-menu-link"
|
|
32
|
+
}, t('Open_link')), /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "link-op-icons d-flex"
|
|
34
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
35
|
+
role: "button",
|
|
36
|
+
className: "link-op-icon",
|
|
33
37
|
onClick: this.props.onDeleteLink
|
|
34
38
|
}, /*#__PURE__*/React.createElement("i", {
|
|
35
39
|
className: "iconfont icon-delete"
|
|
36
|
-
})), /*#__PURE__*/React.createElement("
|
|
37
|
-
|
|
38
|
-
className: "
|
|
40
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
41
|
+
role: "button",
|
|
42
|
+
className: "link-op-icon",
|
|
39
43
|
onClick: this.props.onEditLink
|
|
40
44
|
}, /*#__PURE__*/React.createElement("i", {
|
|
41
|
-
className: "iconfont icon-
|
|
42
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
43
|
-
className: "
|
|
45
|
+
className: "iconfont icon-edit2"
|
|
46
|
+
}))), /*#__PURE__*/React.createElement("span", {
|
|
47
|
+
className: "link-op-menu-triangle"
|
|
44
48
|
})), document.body));
|
|
45
49
|
}
|
|
46
50
|
}]);
|
|
47
51
|
return LinkHoverComponent;
|
|
48
52
|
}(React.Component);
|
|
49
|
-
export default LinkHoverComponent;
|
|
53
|
+
export default withTranslation('sdoc-editor')(LinkHoverComponent);
|
|
@@ -27,14 +27,16 @@ var LinkHoverMenuComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
_this.onLinkClick = function (e) {
|
|
30
|
+
e.stopPropagation();
|
|
31
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
30
32
|
var _e$target$getBounding = e.target.getBoundingClientRect(),
|
|
31
33
|
top = _e$target$getBounding.top,
|
|
32
34
|
left = _e$target$getBounding.left,
|
|
33
35
|
width = _e$target$getBounding.width;
|
|
34
36
|
// top = top distance - menu height
|
|
35
|
-
var menuTop = top -
|
|
37
|
+
var menuTop = top - 42;
|
|
36
38
|
// left = left distance - (menu width / 2) + (link with / 2)
|
|
37
|
-
var menuLeft = left -
|
|
39
|
+
var menuLeft = left - 140 / 2 + width / 2;
|
|
38
40
|
_this.setState({
|
|
39
41
|
isShowLinkMenu: true,
|
|
40
42
|
menuPosition: {
|
|
@@ -29,13 +29,14 @@ var DocInfo = /*#__PURE__*/function (_React$Component) {
|
|
|
29
29
|
value: function render() {
|
|
30
30
|
var t = this.props.t;
|
|
31
31
|
var docName = context.getSetting('docName');
|
|
32
|
+
var isShowInternalLink = context.getSetting('isShowInternalLink');
|
|
32
33
|
return /*#__PURE__*/React.createElement("div", {
|
|
33
34
|
className: "doc-info"
|
|
34
35
|
}, /*#__PURE__*/React.createElement("div", {
|
|
35
36
|
className: "doc-name"
|
|
36
37
|
}, docName), /*#__PURE__*/React.createElement("span", {
|
|
37
38
|
className: "doc-icon"
|
|
38
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
39
|
+
}, isShowInternalLink && /*#__PURE__*/React.createElement("span", {
|
|
39
40
|
className: "internal-link iconfont icon-link",
|
|
40
41
|
title: t('internal_link'),
|
|
41
42
|
onClick: this.onInternalLinkClick
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"insert_file": "Insert File",
|
|
20
20
|
"code": "Inline Code",
|
|
21
21
|
"code_block": "Code Block",
|
|
22
|
-
"insert_link": "Insert
|
|
22
|
+
"insert_link": "Insert link",
|
|
23
23
|
"insert_table": "Insert Table",
|
|
24
24
|
"save": "Save",
|
|
25
25
|
"more": "More",
|
|
@@ -238,5 +238,6 @@
|
|
|
238
238
|
"Headings_you_add_to_the_document_will_appear_here": "Headings you add to the document will appear here",
|
|
239
239
|
"Open_parent_folder": "Open parent folder",
|
|
240
240
|
"redo": "redo",
|
|
241
|
-
"undo": "undo"
|
|
241
|
+
"undo": "undo",
|
|
242
|
+
"Open_link": "Open link"
|
|
242
243
|
}
|
|
Binary file
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
/>
|
|
15
15
|
<missing-glyph />
|
|
16
16
|
|
|
17
|
+
<glyph glyph-name="rename" unicode="" d="M467.2 41.6h105.6V-64H467.2V41.6z m192 0H768V-64H662.4V41.6z m195.2 0H960V-64H854.4V41.6zM156.8 224c-9.6-9.6-16-25.6-19.2-38.4L67.2-25.6c-3.2-9.6 0-25.6 6.4-32 6.4-6.4 19.2-9.6 32-6.4l211.2 70.4c12.8 3.2 28.8 9.6 38.4 19.2l457.6 457.6-198.4 198.4L156.8 224z m777.6 387.2c32 32 28.8 105.6-12.8 150.4l-16 16-16 12.8c-44.8 44.8-121.6 48-153.6 16l-48-48L886.4 560l48 51.2z" horiz-adv-x="1024" />
|
|
18
|
+
|
|
17
19
|
<glyph glyph-name="revoke" unicode="" d="M380.8 438.4c0-41.6-51.2-67.2-86.4-41.6L57.6 550.4c-32 19.2-32 64 0 83.2l236.8 153.6c35.2 25.6 86.4 0 86.4-41.6v-92.8H672c41.6 0 83.2-9.6 121.6-25.6 38.4-16 70.4-38.4 99.2-70.4 28.8-28.8 51.2-64 67.2-102.4 16-38.4 25.6-83.2 25.6-124.8s-6.4-96-22.4-134.4c-16-38.4-38.4-73.6-67.2-102.4-32-28.8-64-51.2-102.4-67.2-38.4-16-80-25.6-121.6-25.6H243.2c-32 0-60.8 28.8-60.8 64s25.6 64 60.8 64H672c105.6 0 188.8 96 188.8 204.8S777.6 528 672 528H380.8v-89.6z" horiz-adv-x="1024" />
|
|
18
20
|
|
|
19
21
|
<glyph glyph-name="redo" unicode="" d="M643.2 438.4c0-41.6 51.2-67.2 86.4-41.6l236.8 153.6c32 19.2 32 64 0 83.2L729.6 787.2c-35.2 25.6-86.4 0-86.4-41.6v-92.8H352c-41.6 0-83.2-9.6-121.6-25.6-38.4-16-70.4-38.4-99.2-70.4C102.4 528 80 492.8 64 454.4 48 416 38.4 371.2 38.4 329.6s6.4-96 22.4-134.4c16-38.4 38.4-73.6 67.2-102.4 32-28.8 64-51.2 102.4-67.2 38.4-16 80-25.6 121.6-25.6h428.8c32 0 60.8 28.8 60.8 64s-25.6 64-60.8 64H352c-105.6 0-188.8 96-188.8 204.8S246.4 528 352 528h291.2v-89.6z" horiz-adv-x="1024" />
|
|
Binary file
|
|
Binary file
|
|
Binary file
|