@seafile/sdoc-editor 3.0.76 → 3.0.77
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.
|
@@ -39,7 +39,7 @@ var LinkHover = function LinkHover(_ref) {
|
|
|
39
39
|
var onMouseDown = (0, _react.useCallback)(function (event) {
|
|
40
40
|
if (!(0, _isUrl["default"])(element.href)) {
|
|
41
41
|
event.preventDefault();
|
|
42
|
-
_toast["default"].danger('The_link_is_invalid');
|
|
42
|
+
_toast["default"].danger(t('The_link_is_invalid'));
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
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"));
|
|
@@ -114,10 +115,12 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
114
115
|
(0, _helpers.unWrapLinkNode)(editor);
|
|
115
116
|
});
|
|
116
117
|
(0, _defineProperty2["default"])(_this, "onOpenLink", function (event) {
|
|
117
|
-
var
|
|
118
|
+
var _this$props = _this.props,
|
|
119
|
+
element = _this$props.element,
|
|
120
|
+
t = _this$props.t;
|
|
118
121
|
if (!(0, _isUrl["default"])(element.href)) {
|
|
119
122
|
event.preventDefault();
|
|
120
|
-
_toast["default"].danger('The_link_is_invalid');
|
|
123
|
+
_toast["default"].danger(t('The_link_is_invalid'));
|
|
121
124
|
return;
|
|
122
125
|
}
|
|
123
126
|
if (!(0, _helpers.isWeChat)()) {
|
|
@@ -154,12 +157,12 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
154
157
|
key: "render",
|
|
155
158
|
value: function render() {
|
|
156
159
|
var _element$children$2;
|
|
157
|
-
var _this$
|
|
158
|
-
attributes = _this$
|
|
159
|
-
children = _this$
|
|
160
|
-
element = _this$
|
|
161
|
-
editor = _this$
|
|
162
|
-
readonly = _this$
|
|
160
|
+
var _this$props2 = this.props,
|
|
161
|
+
attributes = _this$props2.attributes,
|
|
162
|
+
children = _this$props2.children,
|
|
163
|
+
element = _this$props2.element,
|
|
164
|
+
editor = _this$props2.editor,
|
|
165
|
+
readonly = _this$props2.readonly;
|
|
163
166
|
var _this$state = this.state,
|
|
164
167
|
isShowLinkMenu = _this$state.isShowLinkMenu,
|
|
165
168
|
menuPosition = _this$state.menuPosition;
|
|
@@ -195,8 +198,9 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
195
198
|
}]);
|
|
196
199
|
}(_react["default"].Component);
|
|
197
200
|
(0, _defineProperty2["default"])(Link, "contextType", _useScrollContext.ScrollContext);
|
|
201
|
+
var SdocLink = (0, _reactI18next.withTranslation)('sdoc-editor')(Link);
|
|
198
202
|
var renderLink = function renderLink(props, editor, readonly) {
|
|
199
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
203
|
+
return /*#__PURE__*/_react["default"].createElement(SdocLink, Object.assign({}, props, {
|
|
200
204
|
editor: editor,
|
|
201
205
|
readonly: readonly
|
|
202
206
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.77",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "14bfeda7b2f52c218fa9ac1a027d75a99338bb90"
|
|
76
76
|
}
|