x-star-editor 0.6.4 → 0.6.6
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.
- package/dist/components/Fade.d.ts +2 -2
- package/dist/components/Fade.js +23 -10
- package/dist/components/Toolbar.js +18 -21
- package/dist/icons/Clear.d.ts +4 -0
- package/dist/icons/Clear.js +20 -0
- package/dist/icons/Eraser.d.ts +4 -0
- package/dist/icons/Eraser.js +15 -0
- package/dist/icons/Pencil.d.ts +4 -0
- package/dist/icons/Pencil.js +15 -0
- package/dist/icons/Screenshot.d.ts +4 -0
- package/dist/icons/Screenshot.js +18 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/en_US.d.ts +18 -7
- package/dist/locales/en_US.js +19 -8
- package/dist/locales/index.d.ts +76 -32
- package/dist/locales/zh_CN.d.ts +19 -8
- package/dist/locales/zh_CN.js +20 -9
- package/dist/styles/index.css +42 -26
- package/dist/utils/markdown.d.ts +8 -0
- package/dist/utils/markdown.js +1 -1
- package/dist/utils/rehype/rehype-math.js +1 -3
- package/dist/utils/slide.d.ts +26 -0
- package/dist/utils/slide.js +24 -0
- package/dist/utils/viewer.d.ts +10 -0
- package/dist/utils/viewer.js +73 -0
- package/dist/x-star-editor/index.d.ts +1 -1
- package/dist/x-star-editor/index.js +4 -9
- package/dist/x-star-md-editor/index.d.ts +1 -1
- package/dist/x-star-md-viewer/index.js +5 -64
- package/dist/x-star-slide-viewer/index.d.ts +9 -0
- package/dist/x-star-slide-viewer/index.js +318 -281
- package/package.json +1 -3
- package/dist/utils/slide/index.d.ts +0 -0
- package/dist/utils/slide/index.js +0 -32
- /package/dist/styles/cursor/{editor-eraser.png → eraser.png} +0 -0
|
@@ -64,12 +64,8 @@ var XStarEditor = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
64
64
|
|
|
65
65
|
// 同步滚动
|
|
66
66
|
useEffect(function () {
|
|
67
|
-
var
|
|
68
|
-
var
|
|
69
|
-
var viewer = (_viewerRef$current = viewerRef.current) === null || _viewerRef$current === void 0 ? void 0 : _viewerRef$current.getViewerContainer();
|
|
70
|
-
if (!editor || !viewer) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
67
|
+
var editor = editorRef.current.getEditorContainer();
|
|
68
|
+
var viewer = viewerRef.current.getViewerContainer();
|
|
73
69
|
|
|
74
70
|
/**
|
|
75
71
|
* 获取两个父元素的子元素到各自父元素顶部的距离
|
|
@@ -92,9 +88,8 @@ var XStarEditor = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
92
88
|
} else if (!(toChild instanceof HTMLElement)) {
|
|
93
89
|
j++;
|
|
94
90
|
} else {
|
|
95
|
-
var
|
|
96
|
-
var
|
|
97
|
-
var toLine = parseInt((_toChild$dataset$line = toChild.dataset.line) !== null && _toChild$dataset$line !== void 0 ? _toChild$dataset$line : '');
|
|
91
|
+
var fromLine = Number(fromChild.dataset.line);
|
|
92
|
+
var toLine = Number(toChild.dataset.line);
|
|
98
93
|
if (!fromLine) {
|
|
99
94
|
i++;
|
|
100
95
|
} else if (!toLine) {
|