@seafile/seafile-editor 2.0.39 → 2.0.40

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.
@@ -20,23 +20,22 @@ const LinkVerifiedDialog = _ref => {
20
20
  onToggle,
21
21
  link
22
22
  } = _ref;
23
- const url = (0, _react.useMemo)(() => decodeURIComponent(link), [link]);
24
23
  const {
25
24
  t
26
25
  } = (0, _reactI18next.useTranslation)(_constants.TRANSLATE_NAMESPACE);
27
26
  const copyLink = (0, _react.useCallback)(() => {
28
- (0, _copyToClipboard.default)(url);
27
+ (0, _copyToClipboard.default)(link);
29
28
  onToggle && onToggle();
30
- }, [url, onToggle]);
29
+ }, [link, onToggle]);
31
30
  const openLink = (0, _react.useCallback)(() => {
32
- window.open(url);
31
+ window.open(link);
33
32
  onToggle && onToggle();
34
- }, [url, onToggle]);
33
+ }, [link, onToggle]);
35
34
  const {
36
35
  host,
37
36
  protocol,
38
37
  pathname
39
- } = new URL(url);
38
+ } = new URL(link);
40
39
  return /*#__PURE__*/_react.default.createElement(_reactstrap.Modal, {
41
40
  isOpen: true,
42
41
  toggle: onToggle,
@@ -54,7 +53,7 @@ const LinkVerifiedDialog = _ref => {
54
53
  className: "sf-tip-default"
55
54
  }, protocol + '//'), /*#__PURE__*/_react.default.createElement("span", null, host), /*#__PURE__*/_react.default.createElement("span", {
56
55
  className: "sf-tip-default"
57
- }, pathname ? decodeURIComponent(pathname) : ''))), /*#__PURE__*/_react.default.createElement(_reactstrap.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
56
+ }, decodeURIComponent(pathname)))), /*#__PURE__*/_react.default.createElement(_reactstrap.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
58
57
  onClick: copyLink,
59
58
  className: "m-0 mr-2"
60
59
  }, t('Copy_link')), /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
@@ -23,9 +23,8 @@ const renderDefinition = (_ref, editor) => {
23
23
  } = option || {};
24
24
  const onHrefClick = (0, _react.useCallback)(event => {
25
25
  event.preventDefault();
26
- const url = decodeURIComponent(element.url);
27
- if (url.startsWith(window.location.origin)) {
28
- window.open(url);
26
+ if (element.url.startsWith(window.location.origin)) {
27
+ window.open(element.url);
29
28
  return;
30
29
  }
31
30
  setIsShowConfirmDialog(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "2.0.39",
3
+ "version": "2.0.40",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {