gaesup-world 0.8.22 → 0.8.23

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.
@@ -11,6 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { vec3 } from "@react-three/rapier";
14
+ import { throttle } from "lodash";
14
15
  import { useContext, useEffect, useRef } from "react";
15
16
  import * as THREE from "three";
16
17
  import { useClicker } from "../hooks/useClicker";
@@ -18,7 +19,7 @@ import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../world/contex
18
19
  export function GaeSupProps(_a) {
19
20
  var _b = _a.type, type = _b === void 0 ? "normal" : _b, text = _a.text, position = _a.position, children = _a.children;
20
21
  var groupRef = useRef(null);
21
- var minimap = useContext(GaesupWorldContext).minimap;
22
+ var _c = useContext(GaesupWorldContext), minimap = _c.minimap, clickerOption = _c.clickerOption;
22
23
  var dispatch = useContext(GaesupWorldDispatchContext);
23
24
  // clicker
24
25
  var moveClicker = useClicker().moveClicker;
@@ -42,5 +43,10 @@ export function GaeSupProps(_a) {
42
43
  });
43
44
  }
44
45
  }, []);
45
- return (_jsx("group", { ref: groupRef, position: position, onPointerDown: function (e) { return moveClicker(e, false, type); }, children: children }));
46
+ var moveClickerThrottle = throttle(moveClicker, clickerOption.throttle || 0);
47
+ return (_jsx("group", { ref: groupRef, position: position, onPointerDown: function (e) {
48
+ moveClickerThrottle(e, false, type);
49
+ }, onDoubleClick: function (e) {
50
+ e.stopPropagation();
51
+ }, children: children }));
46
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.8.22",
3
+ "version": "0.8.23",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",