@reearth/core 0.0.7-alpha.2 → 0.0.7-alpha.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reearth/core",
3
- "version": "0.0.7-alpha.2",
3
+ "version": "0.0.7-alpha.3",
4
4
  "author": "Re:Earth contributors <community@reearth.io>",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A library that abstracts a map engine as one common API.",
@@ -27,9 +27,9 @@
27
27
  "node": ">=20"
28
28
  },
29
29
  "peerDependencies": {
30
+ "cesium": "1.x",
30
31
  "react": "^18.2.0",
31
- "react-dom": "^18.2.0",
32
- "cesium": "1.x"
32
+ "react-dom": "^18.2.0"
33
33
  },
34
34
  "dependencies": {
35
35
  "@reearth/cesium-mvt-imagery-provider": "1.5.4",
@@ -61,7 +61,7 @@
61
61
  "react-error-boundary": "4.0.11",
62
62
  "react-nl2br": "1.0.4",
63
63
  "react-use": "17.5.0",
64
- "resium": "1.17.4",
64
+ "resium": "^1.18.0",
65
65
  "suspend-react": "0.1.3",
66
66
  "tiny-invariant": "1.3.3",
67
67
  "use-callback-ref": "1.3.2",
@@ -411,7 +411,16 @@ export const useClippingBox = ({
411
411
  eventHandler.setInputAction(handleMouseUp, ScreenSpaceEventType.LEFT_UP);
412
412
  }, [eventHandler, handleMouseDown, handleRawMouseMove, handleMouseUp]);
413
413
 
414
- useEffect(() => () => eventHandler.destroy(), [eventHandler]);
414
+ useEffect(
415
+ () => () => {
416
+ requestAnimationFrame(() => {
417
+ if (!eventHandler.isDestroyed()) {
418
+ eventHandler.destroy();
419
+ }
420
+ });
421
+ },
422
+ [eventHandler],
423
+ );
415
424
 
416
425
  const boxProperty = useMemo(
417
426
  () => ({ ...boxState, ...dimensions, allowEnterGround }),
@@ -666,16 +666,15 @@ export default ({
666
666
  [selectionReason, engineAPI, onLayerEdit, onLayerVisibility, onLayerLoad, timelineManagerRef],
667
667
  );
668
668
 
669
- const globe = cesium.current?.cesiumElement?.scene.globe;
670
-
671
669
  useEffect(() => {
670
+ const globe = cesium.current?.cesiumElement?.scene.globe;
672
671
  if (globe) {
673
672
  const surface = (globe as any)._surface as CustomGlobeSurface;
674
673
  if (surface) {
675
674
  surface.tileProvider._debug.wireframe = property?.debug?.showGlobeWireframe ?? false;
676
675
  }
677
676
  }
678
- }, [globe, property?.debug?.showGlobeWireframe]);
677
+ }, [property?.debug?.showGlobeWireframe]);
679
678
 
680
679
  useEffect(() => {
681
680
  if (!time) return;