@reearth/core 0.0.7-alpha.25 → 0.0.7-alpha.27

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.25",
3
+ "version": "0.0.7-alpha.27",
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.",
@@ -43,9 +43,9 @@
43
43
  "@radix-ui/react-switch": "1.1.0",
44
44
  "@radix-ui/react-toggle": "1.1.0",
45
45
  "@reearth/cesium-mvt-imagery-provider": "1.6.0",
46
+ "@reearth/spatial-id-sdk": "0.0.0",
46
47
  "@rot1024/use-transition": "1.0.0",
47
48
  "@seznam/compose-react-refs": "1.0.6",
48
- "@spatial-id/javascript-sdk": "https://github.com/spatial-id/javascript-sdk",
49
49
  "@turf/invariant": "6.5.0",
50
50
  "@turf/turf": "6.5.0",
51
51
  "@types/proj4": "2.5.5",
@@ -385,13 +385,9 @@ export default function ({
385
385
  interactionModeRef.current = interactionMode;
386
386
 
387
387
  useEffect(() => {
388
- overrideInteractionModeRef.current?.(
389
- type || sketchEditingFeature
390
- ? "sketch"
391
- : interactionModeRef.current === "sketch"
392
- ? "default"
393
- : interactionModeRef.current,
394
- );
388
+ if ((sketchEditingFeature || type) && interactionModeRef.current !== "sketch") {
389
+ overrideInteractionModeRef.current?.("sketch");
390
+ }
395
391
  }, [type, sketchEditingFeature]);
396
392
 
397
393
  const isEditingRef = useRef(isEditing);
@@ -404,6 +400,9 @@ export default function ({
404
400
  if (isEditingRef.current) {
405
401
  cancelEditRef.current();
406
402
  }
403
+ if (type === undefined) {
404
+ overrideInteractionModeRef.current?.("default");
405
+ }
407
406
  }, [type]);
408
407
 
409
408
  const typeRef = useRef(type);
@@ -413,8 +412,6 @@ export default function ({
413
412
  if (interactionMode !== "sketch") {
414
413
  if (isEditingRef.current) {
415
414
  cancelEditRef.current();
416
- } else if (typeRef.current !== undefined) {
417
- updateType(undefined);
418
415
  }
419
416
  }
420
417
  }, [interactionMode, updateType]);
@@ -1,4 +1,4 @@
1
- import { Space } from "@spatial-id/javascript-sdk";
1
+ import { Space } from "@reearth/spatial-id-sdk";
2
2
 
3
3
  export type SpatialIdSpaceType = {
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { Space } from "@spatial-id/javascript-sdk";
1
+ import { Space } from "@reearth/spatial-id-sdk";
2
2
  import { v4 as uuid } from "uuid";
3
3
 
4
4
  import { SPATIALID_DEFAULT_COLOR, SPATIALID_DEFAULT_MAX_HEIGHT } from "./hooks";