@seafile/sdoc-editor 2.0.210 → 2.0.211
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.
|
@@ -37,7 +37,7 @@ var LinkHover = function LinkHover(_ref) {
|
|
|
37
37
|
var onMouseDown = (0, _react.useCallback)(function (event) {
|
|
38
38
|
if (!(0, _isUrl["default"])(element.href)) {
|
|
39
39
|
event.preventDefault();
|
|
40
|
-
_toast["default"].danger('The_link_is_invalid');
|
|
40
|
+
_toast["default"].danger(t('The_link_is_invalid'));
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
event.stopPropagation();
|
|
@@ -12,6 +12,7 @@ var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/cal
|
|
|
12
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
var _reactI18next = require("react-i18next");
|
|
15
16
|
var _slate = require("@seafile/slate");
|
|
16
17
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
18
|
var _isUrl = _interopRequireDefault(require("is-url"));
|
|
@@ -94,10 +95,12 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
94
95
|
(0, _helpers.unWrapLinkNode)(editor);
|
|
95
96
|
});
|
|
96
97
|
(0, _defineProperty2["default"])(_this, "onOpenLink", function (event) {
|
|
97
|
-
var
|
|
98
|
+
var _this$props = _this.props,
|
|
99
|
+
element = _this$props.element,
|
|
100
|
+
t = _this$props.t;
|
|
98
101
|
if (!(0, _isUrl["default"])(element.href)) {
|
|
99
102
|
event.preventDefault();
|
|
100
|
-
_toast["default"].danger('The_link_is_invalid');
|
|
103
|
+
_toast["default"].danger(t('The_link_is_invalid'));
|
|
101
104
|
return;
|
|
102
105
|
}
|
|
103
106
|
if (!(0, _helpers.isWeChat)()) {
|
|
@@ -134,12 +137,12 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
134
137
|
key: "render",
|
|
135
138
|
value: function render() {
|
|
136
139
|
var _element$children$2;
|
|
137
|
-
var _this$
|
|
138
|
-
attributes = _this$
|
|
139
|
-
children = _this$
|
|
140
|
-
element = _this$
|
|
141
|
-
editor = _this$
|
|
142
|
-
readonly = _this$
|
|
140
|
+
var _this$props2 = this.props,
|
|
141
|
+
attributes = _this$props2.attributes,
|
|
142
|
+
children = _this$props2.children,
|
|
143
|
+
element = _this$props2.element,
|
|
144
|
+
editor = _this$props2.editor,
|
|
145
|
+
readonly = _this$props2.readonly;
|
|
143
146
|
var _this$state = this.state,
|
|
144
147
|
isShowLinkMenu = _this$state.isShowLinkMenu,
|
|
145
148
|
menuPosition = _this$state.menuPosition;
|
|
@@ -175,8 +178,9 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
175
178
|
}]);
|
|
176
179
|
}(_react["default"].Component);
|
|
177
180
|
(0, _defineProperty2["default"])(Link, "contextType", _useScrollContext.ScrollContext);
|
|
181
|
+
var SdocLink = (0, _reactI18next.withTranslation)('sdoc-editor')(Link);
|
|
178
182
|
var renderLink = function renderLink(props, editor, readonly) {
|
|
179
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
183
|
+
return /*#__PURE__*/_react["default"].createElement(SdocLink, Object.assign({}, props, {
|
|
180
184
|
editor: editor,
|
|
181
185
|
readonly: readonly
|
|
182
186
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.211",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "0012aa81d40fe7abc7aa0592421d26dc1a12eae8"
|
|
75
75
|
}
|