Merge pull request #29 from mitchemmc/chore/dependency-updates
Chore/dependency updates
This commit is contained in:
commit
b214b939df
39
package.json
39
package.json
@ -3,41 +3,42 @@
|
|||||||
"version": "1.6.2",
|
"version": "1.6.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babylonjs/core": "^4.1.0",
|
"@babylonjs/core": "^4.2.0",
|
||||||
"@babylonjs/loaders": "^4.1.0",
|
"@babylonjs/loaders": "^4.2.0",
|
||||||
"@msgpack/msgpack": "^1.12.1",
|
"@msgpack/msgpack": "^2.3.0",
|
||||||
"@sentry/react": "^5.27.1",
|
"@sentry/react": "^5.27.1",
|
||||||
"@stripe/stripe-js": "^1.3.2",
|
"@stripe/stripe-js": "^1.3.2",
|
||||||
"@tensorflow/tfjs": "^2.6.0",
|
"@tensorflow/tfjs": "^2.6.0",
|
||||||
"@testing-library/jest-dom": "^4.2.4",
|
"@testing-library/jest-dom": "^5.11.6",
|
||||||
"@testing-library/react": "^9.3.2",
|
"@testing-library/react": "^11.2.0",
|
||||||
"@testing-library/user-event": "^7.1.2",
|
"@testing-library/user-event": "^12.2.2",
|
||||||
"ammo.js": "kripken/ammo.js#aab297a4164779c3a9d8dc8d9da26958de3cb778",
|
"ammo.js": "kripken/ammo.js#aab297a4164779c3a9d8dc8d9da26958de3cb778",
|
||||||
"case": "^1.6.3",
|
"case": "^1.6.3",
|
||||||
"dexie": "^2.0.4",
|
"dexie": "^3.0.3",
|
||||||
"fake-indexeddb": "^3.0.0",
|
"err-code": "^2.0.3",
|
||||||
|
"fake-indexeddb": "^3.1.2",
|
||||||
"fuse.js": "^6.4.1",
|
"fuse.js": "^6.4.1",
|
||||||
"interactjs": "^1.9.7",
|
"interactjs": "^1.9.7",
|
||||||
"konva": "^6.0.0",
|
"konva": "^7.1.8",
|
||||||
"lodash.get": "^4.4.2",
|
"lodash.get": "^4.4.2",
|
||||||
"lodash.set": "^4.3.2",
|
"lodash.set": "^4.3.2",
|
||||||
"normalize-wheel": "^1.0.1",
|
"normalize-wheel": "^1.0.1",
|
||||||
"polygon-clipping": "^0.14.3",
|
"polygon-clipping": "^0.15.1",
|
||||||
"raw.macro": "^0.3.0",
|
"raw.macro": "^0.4.2",
|
||||||
"react": "^16.13.0",
|
"react": "^17.0.1",
|
||||||
"react-dom": "^16.13.0",
|
"react-dom": "^17.0.1",
|
||||||
"react-konva": "^16.13.0-3",
|
"react-konva": "^17.0.0-0",
|
||||||
"react-markdown": "^4.3.1",
|
"react-markdown": "^5.0.2",
|
||||||
"react-media": "^2.0.0-rc.1",
|
"react-media": "^2.0.0-rc.1",
|
||||||
"react-modal": "^3.11.2",
|
"react-modal": "^3.11.2",
|
||||||
"react-resize-detector": "^4.2.3",
|
"react-resize-detector": "4.2.3",
|
||||||
"react-router-dom": "^5.1.2",
|
"react-router-dom": "^5.1.2",
|
||||||
"react-router-hash-link": "^1.2.2",
|
"react-router-hash-link": "^2.2.2",
|
||||||
"react-scripts": "3.4.0",
|
"react-scripts": "4.0.0",
|
||||||
"react-select": "^3.1.0",
|
"react-select": "^3.1.0",
|
||||||
"react-spring": "^8.0.27",
|
"react-spring": "^8.0.27",
|
||||||
"react-toast-notifications": "^2.4.0",
|
"react-toast-notifications": "^2.4.0",
|
||||||
"react-use-gesture": "^7.0.15",
|
"react-use-gesture": "^8.0.1",
|
||||||
"shortid": "^2.2.15",
|
"shortid": "^2.2.15",
|
||||||
"simple-peer": "feross/simple-peer#694/head",
|
"simple-peer": "feross/simple-peer#694/head",
|
||||||
"simplebar-react": "^2.1.0",
|
"simplebar-react": "^2.1.0",
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<img src="404.png" alt="404 bear not found" />
|
<img src="/404.png" alt="404 bear not found" />
|
||||||
<h4>
|
<h4>
|
||||||
Unable to find the page you're looking for try heading back to
|
Unable to find the page you're looking for try heading back to
|
||||||
<a href="https://owlbear.rodeo">owlbear.rodeo</a>
|
<a href="https://owlbear.rodeo">owlbear.rodeo</a>
|
||||||
|
@ -44,7 +44,7 @@ function MapPointer({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleBrushMove() {
|
function handleBrushMove() {
|
||||||
onPointerMove && onPointerMove(getBrushPosition());
|
onPointerMove && visible && onPointerMove(getBrushPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleBrushUp() {
|
function handleBrushUp() {
|
||||||
|
@ -21,131 +21,141 @@ function useStageInteraction(
|
|||||||
const pinchPreviousDistanceRef = useRef();
|
const pinchPreviousDistanceRef = useRef();
|
||||||
const pinchPreviousOriginRef = useRef();
|
const pinchPreviousOriginRef = useRef();
|
||||||
|
|
||||||
const bind = useGesture({
|
const bind = useGesture(
|
||||||
...gesture,
|
{
|
||||||
onWheelStart: (props) => {
|
...gesture,
|
||||||
const { event } = props;
|
onWheelStart: (props) => {
|
||||||
isInteractingWithCanvas.current =
|
const { event } = props;
|
||||||
event.target === layer.getCanvas()._canvas;
|
isInteractingWithCanvas.current =
|
||||||
gesture.onWheelStart && gesture.onWheelStart(props);
|
event.target === layer.getCanvas()._canvas;
|
||||||
},
|
gesture.onWheelStart && gesture.onWheelStart(props);
|
||||||
onWheel: (props) => {
|
},
|
||||||
const { event } = props;
|
onWheel: (props) => {
|
||||||
event.persist();
|
const { event } = props;
|
||||||
const { pixelY } = normalizeWheel(event);
|
event.persist();
|
||||||
if (preventInteraction || !isInteractingWithCanvas.current) {
|
const { pixelY } = normalizeWheel(event);
|
||||||
return;
|
if (preventInteraction || !isInteractingWithCanvas.current) {
|
||||||
}
|
return;
|
||||||
const newScale = Math.min(
|
}
|
||||||
Math.max(
|
const newScale = Math.min(
|
||||||
stageScale +
|
Math.max(
|
||||||
(pixelY * wheelZoomSpeed * stageScale) / window.innerHeight,
|
stageScale +
|
||||||
minZoom
|
(pixelY * wheelZoomSpeed * stageScale) / window.innerHeight,
|
||||||
),
|
minZoom
|
||||||
maxZoom
|
),
|
||||||
);
|
maxZoom
|
||||||
|
);
|
||||||
|
|
||||||
// Center on pointer
|
// Center on pointer
|
||||||
const pointer = stage.getPointerPosition();
|
const pointer = stage.getPointerPosition();
|
||||||
const newTranslate = {
|
|
||||||
x: pointer.x - ((pointer.x - stage.x()) / stageScale) * newScale,
|
|
||||||
y: pointer.y - ((pointer.y - stage.y()) / stageScale) * newScale,
|
|
||||||
};
|
|
||||||
|
|
||||||
stage.position(newTranslate);
|
|
||||||
stageTranslateRef.current = newTranslate;
|
|
||||||
|
|
||||||
onStageScaleChange(newScale);
|
|
||||||
gesture.onWheel && gesture.onWheel(props);
|
|
||||||
},
|
|
||||||
onPinchStart: (props) => {
|
|
||||||
const { event } = props;
|
|
||||||
isInteractingWithCanvas.current =
|
|
||||||
event.target === layer.getCanvas()._canvas;
|
|
||||||
const { da, origin } = props;
|
|
||||||
const [distance] = da;
|
|
||||||
const [originX, originY] = origin;
|
|
||||||
pinchPreviousDistanceRef.current = distance;
|
|
||||||
pinchPreviousOriginRef.current = { x: originX, y: originY };
|
|
||||||
gesture.onPinchStart && gesture.onPinchStart(props);
|
|
||||||
},
|
|
||||||
onPinch: (props) => {
|
|
||||||
if (preventInteraction || !isInteractingWithCanvas.current) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const { da, origin } = props;
|
|
||||||
const [distance] = da;
|
|
||||||
const [originX, originY] = origin;
|
|
||||||
|
|
||||||
// Apply scale
|
|
||||||
const distanceDelta = distance - pinchPreviousDistanceRef.current;
|
|
||||||
const originXDelta = originX - pinchPreviousOriginRef.current.x;
|
|
||||||
const originYDelta = originY - pinchPreviousOriginRef.current.y;
|
|
||||||
const newScale = Math.min(
|
|
||||||
Math.max(
|
|
||||||
stageScale + distanceDelta * touchZoomSpeed * stageScale,
|
|
||||||
minZoom
|
|
||||||
),
|
|
||||||
maxZoom
|
|
||||||
);
|
|
||||||
|
|
||||||
const canvasRect = layer.getCanvas()._canvas.getBoundingClientRect();
|
|
||||||
const relativeOrigin = {
|
|
||||||
x: originX - canvasRect.left,
|
|
||||||
y: originY - canvasRect.top,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Center on pinch origin
|
|
||||||
const centeredTranslate = {
|
|
||||||
x:
|
|
||||||
relativeOrigin.x -
|
|
||||||
((relativeOrigin.x - stage.x()) / stageScale) * newScale,
|
|
||||||
y:
|
|
||||||
relativeOrigin.y -
|
|
||||||
((relativeOrigin.y - stage.y()) / stageScale) * newScale,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Add pinch movement
|
|
||||||
const newTranslate = {
|
|
||||||
x: centeredTranslate.x + originXDelta,
|
|
||||||
y: centeredTranslate.y + originYDelta,
|
|
||||||
};
|
|
||||||
|
|
||||||
stage.position(newTranslate);
|
|
||||||
stageTranslateRef.current = newTranslate;
|
|
||||||
|
|
||||||
onStageScaleChange(newScale);
|
|
||||||
|
|
||||||
pinchPreviousDistanceRef.current = distance;
|
|
||||||
pinchPreviousOriginRef.current = { x: originX, y: originY };
|
|
||||||
gesture.onPinch && gesture.onPinch(props);
|
|
||||||
},
|
|
||||||
onDragStart: (props) => {
|
|
||||||
const { event } = props;
|
|
||||||
isInteractingWithCanvas.current =
|
|
||||||
event.target === layer.getCanvas()._canvas;
|
|
||||||
gesture.onDragStart && gesture.onDragStart(props);
|
|
||||||
},
|
|
||||||
onDrag: (props) => {
|
|
||||||
const { delta, pinching } = props;
|
|
||||||
if (preventInteraction || pinching || !isInteractingWithCanvas.current) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const [dx, dy] = delta;
|
|
||||||
const stageTranslate = stageTranslateRef.current;
|
|
||||||
if (tool === "pan") {
|
|
||||||
const newTranslate = {
|
const newTranslate = {
|
||||||
x: stageTranslate.x + dx,
|
x: pointer.x - ((pointer.x - stage.x()) / stageScale) * newScale,
|
||||||
y: stageTranslate.y + dy,
|
y: pointer.y - ((pointer.y - stage.y()) / stageScale) * newScale,
|
||||||
};
|
};
|
||||||
|
|
||||||
stage.position(newTranslate);
|
stage.position(newTranslate);
|
||||||
stage.draw();
|
|
||||||
stageTranslateRef.current = newTranslate;
|
stageTranslateRef.current = newTranslate;
|
||||||
}
|
|
||||||
gesture.onDrag && gesture.onDrag(props);
|
onStageScaleChange(newScale);
|
||||||
|
gesture.onWheel && gesture.onWheel(props);
|
||||||
|
},
|
||||||
|
onPinchStart: (props) => {
|
||||||
|
const { event } = props;
|
||||||
|
isInteractingWithCanvas.current =
|
||||||
|
event.target === layer.getCanvas()._canvas;
|
||||||
|
const { da, origin } = props;
|
||||||
|
const [distance] = da;
|
||||||
|
const [originX, originY] = origin;
|
||||||
|
pinchPreviousDistanceRef.current = distance;
|
||||||
|
pinchPreviousOriginRef.current = { x: originX, y: originY };
|
||||||
|
gesture.onPinchStart && gesture.onPinchStart(props);
|
||||||
|
},
|
||||||
|
onPinch: (props) => {
|
||||||
|
if (preventInteraction || !isInteractingWithCanvas.current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { da, origin } = props;
|
||||||
|
const [distance] = da;
|
||||||
|
const [originX, originY] = origin;
|
||||||
|
|
||||||
|
// Apply scale
|
||||||
|
const distanceDelta = distance - pinchPreviousDistanceRef.current;
|
||||||
|
const originXDelta = originX - pinchPreviousOriginRef.current.x;
|
||||||
|
const originYDelta = originY - pinchPreviousOriginRef.current.y;
|
||||||
|
const newScale = Math.min(
|
||||||
|
Math.max(
|
||||||
|
stageScale + distanceDelta * touchZoomSpeed * stageScale,
|
||||||
|
minZoom
|
||||||
|
),
|
||||||
|
maxZoom
|
||||||
|
);
|
||||||
|
|
||||||
|
const canvasRect = layer.getCanvas()._canvas.getBoundingClientRect();
|
||||||
|
const relativeOrigin = {
|
||||||
|
x: originX - canvasRect.left,
|
||||||
|
y: originY - canvasRect.top,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Center on pinch origin
|
||||||
|
const centeredTranslate = {
|
||||||
|
x:
|
||||||
|
relativeOrigin.x -
|
||||||
|
((relativeOrigin.x - stage.x()) / stageScale) * newScale,
|
||||||
|
y:
|
||||||
|
relativeOrigin.y -
|
||||||
|
((relativeOrigin.y - stage.y()) / stageScale) * newScale,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Add pinch movement
|
||||||
|
const newTranslate = {
|
||||||
|
x: centeredTranslate.x + originXDelta,
|
||||||
|
y: centeredTranslate.y + originYDelta,
|
||||||
|
};
|
||||||
|
|
||||||
|
stage.position(newTranslate);
|
||||||
|
stageTranslateRef.current = newTranslate;
|
||||||
|
|
||||||
|
onStageScaleChange(newScale);
|
||||||
|
|
||||||
|
pinchPreviousDistanceRef.current = distance;
|
||||||
|
pinchPreviousOriginRef.current = { x: originX, y: originY };
|
||||||
|
gesture.onPinch && gesture.onPinch(props);
|
||||||
|
},
|
||||||
|
onDragStart: (props) => {
|
||||||
|
const { event } = props;
|
||||||
|
isInteractingWithCanvas.current =
|
||||||
|
event.target === layer.getCanvas()._canvas;
|
||||||
|
gesture.onDragStart && gesture.onDragStart(props);
|
||||||
|
},
|
||||||
|
onDrag: (props) => {
|
||||||
|
const { delta, pinching } = props;
|
||||||
|
if (
|
||||||
|
preventInteraction ||
|
||||||
|
pinching ||
|
||||||
|
!isInteractingWithCanvas.current
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [dx, dy] = delta;
|
||||||
|
const stageTranslate = stageTranslateRef.current;
|
||||||
|
if (tool === "pan") {
|
||||||
|
const newTranslate = {
|
||||||
|
x: stageTranslate.x + dx,
|
||||||
|
y: stageTranslate.y + dy,
|
||||||
|
};
|
||||||
|
stage.position(newTranslate);
|
||||||
|
stage.draw();
|
||||||
|
stageTranslateRef.current = newTranslate;
|
||||||
|
}
|
||||||
|
gesture.onDrag && gesture.onDrag(props);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
{
|
||||||
|
// Fix drawing using old pointer end position on touch devices when drawing new shapes
|
||||||
|
drag: { delay: 300 },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
return bind;
|
return bind;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user