@fileverse-dev/fortune-react 1.3.1 → 1.3.2-format-1
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext, useEffect } from "react";
|
|
2
|
-
import { removeEditingComment } from "@fileverse-dev/fortune-core";
|
|
2
|
+
import { removeEditingComment, mouseRender } from "@fileverse-dev/fortune-core";
|
|
3
3
|
import WorkbookContext from "../../context";
|
|
4
4
|
export var useSmoothScroll = function useSmoothScroll(scrollContainerRef) {
|
|
5
5
|
var _a = useContext(WorkbookContext),
|
|
@@ -102,6 +102,22 @@ export var useSmoothScroll = function useSmoothScroll(scrollContainerRef) {
|
|
|
102
102
|
}
|
|
103
103
|
var scale = getPixelScale();
|
|
104
104
|
scrollHandler(velocityX * scale, velocityY * scale);
|
|
105
|
+
setContext(function (draftCtx) {
|
|
106
|
+
var scrollXEl = refs.scrollbarX.current;
|
|
107
|
+
var scrollYEl = refs.scrollbarY.current;
|
|
108
|
+
var cellInputEl = refs.cellInput.current;
|
|
109
|
+
var containerElCtx = refs.cellArea.current;
|
|
110
|
+
var fxInputEl = refs.fxInput.current;
|
|
111
|
+
if (scrollXEl && scrollYEl && cellInputEl && containerElCtx) {
|
|
112
|
+
var syntheticEvent = new MouseEvent("mousemove", {
|
|
113
|
+
bubbles: true,
|
|
114
|
+
clientX: lastX,
|
|
115
|
+
clientY: lastY,
|
|
116
|
+
view: window
|
|
117
|
+
});
|
|
118
|
+
mouseRender(draftCtx, refs.globalCache, syntheticEvent, cellInputEl, scrollXEl, scrollYEl, containerElCtx, fxInputEl !== null && fxInputEl !== void 0 ? fxInputEl : null);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
105
121
|
autoScrollAnimationId = requestAnimationFrame(autoScroll);
|
|
106
122
|
}
|
|
107
123
|
function onMouseDown(e) {
|
|
@@ -109,6 +109,22 @@ var useSmoothScroll = exports.useSmoothScroll = function useSmoothScroll(scrollC
|
|
|
109
109
|
}
|
|
110
110
|
var scale = getPixelScale();
|
|
111
111
|
scrollHandler(velocityX * scale, velocityY * scale);
|
|
112
|
+
setContext(function (draftCtx) {
|
|
113
|
+
var scrollXEl = refs.scrollbarX.current;
|
|
114
|
+
var scrollYEl = refs.scrollbarY.current;
|
|
115
|
+
var cellInputEl = refs.cellInput.current;
|
|
116
|
+
var containerElCtx = refs.cellArea.current;
|
|
117
|
+
var fxInputEl = refs.fxInput.current;
|
|
118
|
+
if (scrollXEl && scrollYEl && cellInputEl && containerElCtx) {
|
|
119
|
+
var syntheticEvent = new MouseEvent("mousemove", {
|
|
120
|
+
bubbles: true,
|
|
121
|
+
clientX: lastX,
|
|
122
|
+
clientY: lastY,
|
|
123
|
+
view: window
|
|
124
|
+
});
|
|
125
|
+
(0, _fortuneCore.mouseRender)(draftCtx, refs.globalCache, syntheticEvent, cellInputEl, scrollXEl, scrollYEl, containerElCtx, fxInputEl !== null && fxInputEl !== void 0 ? fxInputEl : null);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
112
128
|
autoScrollAnimationId = requestAnimationFrame(autoScroll);
|
|
113
129
|
}
|
|
114
130
|
function onMouseDown(e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.3.1",
|
|
3
|
+
"version": "1.3.2-format-1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tsc": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@fileverse-dev/fortune-core": "1.3.1",
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.3.2-format-1",
|
|
20
20
|
"@fileverse/ui": "5.0.0",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|