@seafile/seafile-editor 1.0.118-beta → 1.0.118-beta1

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.
@@ -59,7 +59,7 @@ const Outline = _ref => {
59
59
  setOutlineSetting(nextState);
60
60
  setIsShown(nextState);
61
61
  const eventBus = _eventBus.default.getInstance();
62
- eventBus.dispatch(_eventTypes.INTERNAL_EVENTS.OUTLINE_STATE_CHANGED, nextState);
62
+ eventBus.dispatch(_eventTypes.INTERNAL_EVENTS.OUTLINE_STATE_CHANGED);
63
63
  }, []);
64
64
  const toggleShow = (0, _react.useCallback)(() => {
65
65
  const nextState = !isShown;
@@ -77,8 +77,10 @@ const Outline = _ref => {
77
77
  }, [scrollRef]);
78
78
  (0, _react.useEffect)(() => {
79
79
  const outlineState = getOutlineSetting();
80
+ console.log(outlineState);
80
81
  updateOutlineState(outlineState);
81
- }, [updateOutlineState]);
82
+ // eslint-disable-next-line react-hooks/exhaustive-deps
83
+ }, []);
82
84
  return /*#__PURE__*/_react.default.createElement("div", {
83
85
  className: (0, _classnames.default)('sf-editor-outline-wrapper', {
84
86
  'active': isShown
@@ -18,7 +18,7 @@ var _core = require("../../extension/core");
18
18
  var _useScrollContext = require("../../hooks/use-scroll-context");
19
19
  var _useInsertImage = _interopRequireDefault(require("../../hooks/use-insert-image"));
20
20
  var _common = require("../../utils/common");
21
- var _outline = _interopRequireDefault(require("../../containers/outline"));
21
+ var _outline = _interopRequireWildcard(require("../../containers/outline"));
22
22
  var _eventTypes = require("../../constants/event-types");
23
23
  require("./style.css");
24
24
  const isMacOS = (0, _common.isMac)();
@@ -46,11 +46,12 @@ function SlateEditor(_ref) {
46
46
  const decorate = (0, _extension.useHighlight)(editor);
47
47
 
48
48
  // Adjust article container margin-left value according to isShown of the outline and width of window
49
- const handleWindowResize = (0, _react.useCallback)(newIsShown => {
49
+ const handleWindowResize = (0, _react.useCallback)(() => {
50
50
  const rect = scrollRef.current.getBoundingClientRect();
51
51
  const articleElement = document.querySelector('.article');
52
52
  const articleRect = articleElement ? articleElement.getBoundingClientRect() : null;
53
- if (newIsShown && articleRect && (rect.width - articleRect.width) / 2 < 280) {
53
+ const isOutlineShow = (0, _outline.getOutlineSetting)();
54
+ if (isOutlineShow && articleRect && (rect.width - articleRect.width) / 2 < 280) {
54
55
  setContainerStyle({
55
56
  marginLeft: 280
56
57
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "1.0.118beta",
3
+ "version": "1.0.118beta1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {