@seafile/seafile-editor 2.0.36-beta3 → 2.0.36-beta5

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.
@@ -22,7 +22,7 @@ function SlateViewer(_ref) {
22
22
  isShowOutline,
23
23
  scrollRef: externalScrollRef,
24
24
  onLinkClick,
25
- ...params
25
+ options
26
26
  } = _ref;
27
27
  const scrollRef = (0, _react.useRef)(null);
28
28
  const {
@@ -71,7 +71,7 @@ function SlateViewer(_ref) {
71
71
  readOnly: true,
72
72
  decorate: decorate,
73
73
  renderElement: props => (0, _extension.renderElement)({
74
- ...params,
74
+ options,
75
75
  ...props
76
76
  }),
77
77
  renderLeaf: _extension.renderLeaf
@@ -21,14 +21,14 @@ const renderDefinition = (_ref, editor) => {
21
21
  const {
22
22
  render
23
23
  } = option || {};
24
- const onHrefClick = (0, _react.useCallback)((event, element) => {
24
+ const onHrefClick = (0, _react.useCallback)(event => {
25
25
  event.preventDefault();
26
26
  if (element.url.startsWith(window.location.origin)) {
27
27
  window.open(element.url);
28
28
  return;
29
29
  }
30
30
  setIsShowConfirmDialog(true);
31
- }, []);
31
+ }, [element]);
32
32
  const onToggle = (0, _react.useCallback)(() => {
33
33
  setIsShowConfirmDialog(!isShowConfirmDialog);
34
34
  }, [isShowConfirmDialog]);
@@ -50,7 +50,7 @@ const renderDefinition = (_ref, editor) => {
50
50
  }, attributes), /*#__PURE__*/_react.default.createElement("span", null, element.identifier + '. '), /*#__PURE__*/_react.default.createElement("a", {
51
51
  href: element.url,
52
52
  "data-url": element.url,
53
- onClick: event => onHrefClick(event, element)
53
+ onClick: onHrefClick
54
54
  }, children)), isShowConfirmDialog && /*#__PURE__*/_react.default.createElement(_components.LinkVerifiedDialog, {
55
55
  link: element.url,
56
56
  onToggle: onToggle
@@ -20,7 +20,7 @@ function MarkdownViewer(_ref) {
20
20
  scrollRef,
21
21
  onLinkClick,
22
22
  beforeRenderCallback,
23
- ...params
23
+ options
24
24
  } = _ref;
25
25
  const [richValue, setRichValue] = (0, _react.useState)([]);
26
26
  const [isLoading, setIsLoading] = (0, _react.useState)(true);
@@ -40,7 +40,7 @@ function MarkdownViewer(_ref) {
40
40
  // eslint-disable-next-line react-hooks/exhaustive-deps
41
41
  }, [isFetching, value]);
42
42
  const props = {
43
- ...params,
43
+ options,
44
44
  isSupportFormula: !!mathJaxSource,
45
45
  value: richValue,
46
46
  isShowOutline: isShowOutline,
@@ -48,9 +48,6 @@ function MarkdownViewer(_ref) {
48
48
  onLinkClick: onLinkClick
49
49
  };
50
50
  if (isFetching || isLoading || isLoadingMathJax) {
51
- const {
52
- options
53
- } = params;
54
51
  const loadingOption = (options === null || options === void 0 ? void 0 : options.loading) || {};
55
52
  const {
56
53
  render
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "2.0.36beta3",
3
+ "version": "2.0.36beta5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {