gaesup-world 0.8.23 → 0.8.24

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,7 +11,6 @@ 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";
15
14
  import { useContext, useEffect, useRef } from "react";
16
15
  import * as THREE from "three";
17
16
  import { useClicker } from "../hooks/useClicker";
@@ -43,9 +42,21 @@ export function GaeSupProps(_a) {
43
42
  });
44
43
  }
45
44
  }, []);
46
- var moveClickerThrottle = throttle(moveClicker, clickerOption.throttle || 0);
45
+ var lastClickTime = 0;
46
+ function handleClick(e, cb, gap) {
47
+ var currentTime = new Date().getTime();
48
+ var timeDiff = currentTime - lastClickTime;
49
+ if (timeDiff < gap) {
50
+ e.preventDefault();
51
+ return;
52
+ }
53
+ else {
54
+ cb(e);
55
+ lastClickTime = currentTime;
56
+ }
57
+ }
47
58
  return (_jsx("group", { ref: groupRef, position: position, onPointerDown: function (e) {
48
- moveClickerThrottle(e, false, type);
59
+ handleClick(e, moveClicker, clickerOption.throttle || 100);
49
60
  }, onDoubleClick: function (e) {
50
61
  e.stopPropagation();
51
62
  }, children: children }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.8.23",
3
+ "version": "0.8.24",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",