gaesup-world 0.4.3 → 0.4.4

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.
Files changed (28) hide show
  1. package/dist/gaesup/animation/actions.d.ts +6 -5
  2. package/dist/gaesup/camera/type.d.ts +1 -0
  3. package/dist/gaesup/component/active/airplane/index.d.ts +1 -0
  4. package/dist/gaesup/component/active/vehicle/index.d.ts +1 -0
  5. package/dist/gaesup/component/inner/character/index.d.ts +1 -0
  6. package/dist/gaesup/component/inner/common/OuterGroupRef.d.ts +2 -1
  7. package/dist/gaesup/component/inner/common/RigidbodyRef.d.ts +1 -0
  8. package/dist/gaesup/component/inner/common/type.d.ts +1 -0
  9. package/dist/gaesup/component/inner/vehicle/collider.d.ts +1 -0
  10. package/dist/gaesup/component/inner/vehicle/wheels.d.ts +1 -0
  11. package/dist/gaesup/component/passive/airplane/index.d.ts +1 -0
  12. package/dist/gaesup/component/passive/character/index.d.ts +1 -0
  13. package/dist/gaesup/component/passive/vehicle/index.d.ts +1 -0
  14. package/dist/gaesup/component/type.d.ts +1 -0
  15. package/dist/gaesup/controller/context/type.d.ts +1 -0
  16. package/dist/gaesup/controller/initialize/callback/index.d.ts +1 -0
  17. package/dist/gaesup/controller/initialize/callback/type.d.ts +1 -0
  18. package/dist/gaesup/hooks/useFocus/index.d.ts +1 -0
  19. package/dist/gaesup/hooks/useFocus/index.js +70 -80
  20. package/dist/gaesup/hooks/useTeleport/index.d.ts +1 -0
  21. package/dist/gaesup/physics/type.d.ts +1 -0
  22. package/dist/gaesup/tools/jumpPortal/index.d.ts +1 -0
  23. package/dist/gaesup/tools/zoomButton/index.d.ts +1 -0
  24. package/dist/gaesup/utils/debug.d.ts +1 -0
  25. package/dist/gaesup/world/context/type.d.ts +1 -0
  26. package/dist/gaesup/world/type.d.ts +1 -0
  27. package/package.json +18 -18
  28. package/yarn-error.log +0 -12152
@@ -1,4 +1,5 @@
1
1
  import { Ref } from "react";
2
+ import * as THREE from "three";
2
3
  import { AnimationAction, AnimationClip, AnimationMixer, Object3D, Object3DEventMap } from "three";
3
4
  import { groundRayType } from "../controller/type";
4
5
  export type Api<T extends AnimationClip> = {
@@ -29,17 +30,17 @@ export type playResultType = {
29
30
  };
30
31
  export declare function subscribeActions({ type, groundRay, animations, }: subscribeActionsType): {
31
32
  animationResult: {
32
- ref: import("react").MutableRefObject<Object3D<Object3DEventMap>>;
33
- clips: AnimationClip[];
34
- mixer: AnimationMixer;
33
+ ref: import("react").MutableRefObject<THREE.Object3D<THREE.Object3DEventMap>>;
34
+ clips: THREE.AnimationClip[];
35
+ mixer: THREE.AnimationMixer;
35
36
  names: string[];
36
37
  actions: {
37
- [x: string]: AnimationAction;
38
+ [x: string]: THREE.AnimationAction;
38
39
  };
39
40
  };
40
41
  };
41
42
  export default function playActions({ type, animationResult, currentAnimation, }: playActionsType): {
42
- animationRef: import("react").MutableRefObject<Object3D<Object3DEventMap>>;
43
+ animationRef: import("react").MutableRefObject<THREE.Object3D<THREE.Object3DEventMap>>;
43
44
  currentAnimation: string;
44
45
  };
45
46
  export declare const setAnimation: ({ currentAnimation, actions, type, }: {
@@ -1,3 +1,4 @@
1
+ import * as THREE from "three";
1
2
  export type cameraRayType = {
2
3
  origin: THREE.Vector3;
3
4
  hit: THREE.Raycaster;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from "react";
2
+ import * as THREE from "three";
2
3
  import { controllerInnerType, groundRayType, refsType } from "../../../controller/type";
3
4
  import { urlsType } from "../../../world/context/type";
4
5
  export declare function AirplaneRef({ children, props, groundRay, enableRiding, isRiderOn, offset, refs, urls, }: {
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from "react";
2
+ import * as THREE from "three";
2
3
  import { controllerInnerType, groundRayType, refsType } from "../../../controller/type";
3
4
  import { urlsType } from "../../../world/context/type";
4
5
  export declare function VehicleRef({ children, props, groundRay, enableRiding, isRiderOn, offset, refs, urls, }: {
@@ -1,5 +1,6 @@
1
1
  import { refsType } from "../../../controller/type";
2
2
  import { ReactNode, Ref } from "react";
3
+ import * as THREE from "three";
3
4
  import { Object3D, Object3DEventMap } from "three";
4
5
  import { urlsType } from "../../../world/context/type";
5
6
  export declare const calcCharacterColliderProps: (characterSize: THREE.Vector3) => {
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from "react";
2
+ import * as THREE from "three";
2
3
  export declare const OuterGroupRef: import("react").ForwardRefExoticComponent<{
3
4
  children: ReactNode;
4
- } & import("react").RefAttributes<import("three").Group<import("three").Object3DEventMap>>>;
5
+ } & import("react").RefAttributes<THREE.Group<THREE.Object3DEventMap>>>;
@@ -1,5 +1,6 @@
1
1
  import { CollisionEnterPayload, RapierRigidBody } from "@react-three/rapier";
2
2
  import { ReactNode } from "react";
3
+ import * as THREE from "three";
3
4
  export declare const RigidBodyRef: import("react").ForwardRefExoticComponent<{
4
5
  children: ReactNode;
5
6
  name?: string;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CollisionEnterPayload } from "@react-three/rapier";
3
+ import * as THREE from "three";
3
4
  import { refsType } from "../../../controller/type";
4
5
  import { urlsType } from "../../../world/context/type";
5
6
  export type refPropsType = {
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { Collider } from "@dimforge/rapier3d-compat";
3
+ import * as THREE from "three";
3
4
  import { urlsType } from "../../../world/context/type";
4
5
  export declare const VehicleWheelCollider: import("react").ForwardRefExoticComponent<{
5
6
  urls: urlsType;
@@ -1,3 +1,4 @@
1
+ import * as THREE from "three";
1
2
  import { refsType } from "../../../controller/type";
2
3
  import { urlsType } from "../../../world/context/type";
3
4
  export declare function WheelsRef({ vehicleSize, refs, urls, }: {
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CollisionEnterPayload } from "@react-three/rapier";
3
+ import * as THREE from "three";
3
4
  import { urlsType } from "../../../world/context/type";
4
5
  export type passiveAirplanePropsType = {
5
6
  position: THREE.Vector3;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import * as THREE from "three";
2
3
  import { urlsType } from "../../../world/context/type";
3
4
  export type passiveCharacterPropsType = {
4
5
  position: THREE.Vector3;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CollisionEnterPayload } from "@react-three/rapier";
3
+ import * as THREE from "three";
3
4
  import { urlsType } from "../../../world/context/type";
4
5
  export type passiveVehiclePropsType = {
5
6
  position: THREE.Vector3;
@@ -1,6 +1,7 @@
1
1
  import { ObjectMap } from "@react-three/fiber";
2
2
  import { RapierRigidBody } from "@react-three/rapier";
3
3
  import { RefObject } from "react";
4
+ import * as THREE from "three";
4
5
  import { GLTF } from "three-stdlib";
5
6
  export type GLTFResult = GLTF & {
6
7
  nodes: {
@@ -1,4 +1,5 @@
1
1
  import { GroupProps } from "@react-three/fiber";
2
+ import * as THREE from "three";
2
3
  import { dispatchType } from "../../utils/type";
3
4
  import { callbackType } from "../initialize/callback/type";
4
5
  import { gaesupControllerContextPropType, refsType } from "../type";
@@ -1,3 +1,4 @@
1
+ import * as THREE from "three";
1
2
  import { Api } from "../../../animation/actions";
2
3
  import { controllerInnerType } from "../../type";
3
4
  export default function initCallback({ props, animationResult, type, }: {
@@ -1,4 +1,5 @@
1
1
  import { RootState } from "@react-three/fiber";
2
+ import * as THREE from "three";
2
3
  import { cameraRayType } from "../../../camera/type";
3
4
  import { activeStateType, animationAtomType, animationStateType, keyControlType, statesType } from "../../../world/context/type";
4
5
  import { actionsType, groundRayType } from "../../type";
@@ -1,3 +1,4 @@
1
+ import * as THREE from "three";
1
2
  export declare function useFocus(): {
2
3
  open: () => Promise<void>;
3
4
  close: () => Promise<void>;
@@ -102,91 +102,81 @@ export function useFocus() {
102
102
  return [2 /*return*/];
103
103
  });
104
104
  }); };
105
- var focus = function (_a) {
106
- var zoom = _a.zoom, target = _a.target, position = _a.position;
107
- return __awaiter(_this, void 0, void 0, function () {
108
- return __generator(this, function (_b) {
109
- if (zoom)
110
- cameraOption.zoom = zoom;
111
- cameraOption.position.lerp(position, 0.1);
112
- cameraOption.target.lerp(target, 0.1);
113
- return [2 /*return*/];
114
- });
105
+ var focus = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
106
+ var zoom = _b.zoom, target = _b.target, position = _b.position;
107
+ return __generator(this, function (_c) {
108
+ if (zoom)
109
+ cameraOption.zoom = zoom;
110
+ cameraOption.position.lerp(position, 0.1);
111
+ cameraOption.target.lerp(target, 0.1);
112
+ return [2 /*return*/];
115
113
  });
116
- };
117
- var free = function (_a) {
118
- var zoom = _a.zoom;
119
- return __awaiter(_this, void 0, void 0, function () {
120
- return __generator(this, function (_b) {
121
- if (zoom)
122
- cameraOption.zoom = zoom;
123
- cameraOption.position.lerp(makeNormalCameraPosition(activeState, cameraOption), 0.1);
124
- cameraOption.target.lerp(activeState.position.clone(), 0.1);
125
- return [2 /*return*/];
126
- });
114
+ }); };
115
+ var free = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
116
+ var zoom = _b.zoom;
117
+ return __generator(this, function (_c) {
118
+ if (zoom)
119
+ cameraOption.zoom = zoom;
120
+ cameraOption.position.lerp(makeNormalCameraPosition(activeState, cameraOption), 0.1);
121
+ cameraOption.target.lerp(activeState.position.clone(), 0.1);
122
+ return [2 /*return*/];
127
123
  });
128
- };
129
- var move = function (_a) {
130
- var newPosition = _a.newPosition;
131
- return __awaiter(_this, void 0, void 0, function () {
132
- return __generator(this, function (_b) {
133
- cameraOption.position.lerp(newPosition.clone(), 0.1);
134
- return [2 /*return*/];
135
- });
124
+ }); };
125
+ var move = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
126
+ var newPosition = _b.newPosition;
127
+ return __generator(this, function (_c) {
128
+ cameraOption.position.lerp(newPosition.clone(), 0.1);
129
+ return [2 /*return*/];
136
130
  });
137
- };
138
- var focusOn = function (_a) {
139
- var zoom = _a.zoom, target = _a.target, position = _a.position;
140
- return __awaiter(_this, void 0, void 0, function () {
141
- return __generator(this, function (_b) {
142
- switch (_b.label) {
143
- case 0: return [4 /*yield*/, close()];
144
- case 1:
145
- _b.sent();
146
- return [4 /*yield*/, on()];
147
- case 2:
148
- _b.sent();
149
- return [4 /*yield*/, move({ newPosition: position })];
150
- case 3:
151
- _b.sent();
152
- return [4 /*yield*/, focus({ zoom: zoom, target: target, position: position })];
153
- case 4:
154
- _b.sent();
155
- return [4 /*yield*/, dispatchAsync()];
156
- case 5:
157
- _b.sent();
158
- return [2 /*return*/];
159
- }
160
- });
131
+ }); };
132
+ var focusOn = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
133
+ var zoom = _b.zoom, target = _b.target, position = _b.position;
134
+ return __generator(this, function (_c) {
135
+ switch (_c.label) {
136
+ case 0: return [4 /*yield*/, close()];
137
+ case 1:
138
+ _c.sent();
139
+ return [4 /*yield*/, on()];
140
+ case 2:
141
+ _c.sent();
142
+ return [4 /*yield*/, move({ newPosition: position })];
143
+ case 3:
144
+ _c.sent();
145
+ return [4 /*yield*/, focus({ zoom: zoom, target: target, position: position })];
146
+ case 4:
147
+ _c.sent();
148
+ return [4 /*yield*/, dispatchAsync()];
149
+ case 5:
150
+ _c.sent();
151
+ return [2 /*return*/];
152
+ }
161
153
  });
162
- };
163
- var focusOff = function (_a) {
164
- var zoom = _a.zoom;
165
- return __awaiter(_this, void 0, void 0, function () {
166
- return __generator(this, function (_b) {
167
- switch (_b.label) {
168
- case 0: return [4 /*yield*/, open()];
169
- case 1:
170
- _b.sent();
171
- return [4 /*yield*/, off()];
172
- case 2:
173
- _b.sent();
174
- return [4 /*yield*/, move({
175
- newPosition: makeNormalCameraPosition(activeState, cameraOption),
176
- })];
177
- case 3:
178
- _b.sent();
179
- return [4 /*yield*/, free({ zoom: zoom })];
180
- case 4:
181
- _b.sent();
182
- return [4 /*yield*/, dispatchAsync()];
183
- case 5:
184
- _b.sent();
185
- return [2 /*return*/];
186
- }
187
- });
154
+ }); };
155
+ var focusOff = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
156
+ var zoom = _b.zoom;
157
+ return __generator(this, function (_c) {
158
+ switch (_c.label) {
159
+ case 0: return [4 /*yield*/, open()];
160
+ case 1:
161
+ _c.sent();
162
+ return [4 /*yield*/, off()];
163
+ case 2:
164
+ _c.sent();
165
+ return [4 /*yield*/, move({
166
+ newPosition: makeNormalCameraPosition(activeState, cameraOption),
167
+ })];
168
+ case 3:
169
+ _c.sent();
170
+ return [4 /*yield*/, free({ zoom: zoom })];
171
+ case 4:
172
+ _c.sent();
173
+ return [4 /*yield*/, dispatchAsync()];
174
+ case 5:
175
+ _c.sent();
176
+ return [2 /*return*/];
177
+ }
188
178
  });
189
- };
179
+ }); };
190
180
  return {
191
181
  open: open,
192
182
  close: close,
@@ -1,3 +1,4 @@
1
+ import * as THREE from "three";
1
2
  export declare function useTeleport(): {
2
3
  Teleport: (position: THREE.Vector3) => void;
3
4
  };
@@ -1,5 +1,6 @@
1
1
  import { RootState } from "@react-three/fiber";
2
2
  import { World } from "@dimforge/rapier3d-compat";
3
+ import * as THREE from "three";
3
4
  import { gaesupControllerType } from "../controller/context/type";
4
5
  import { controllerInnerType, refsType } from "../controller/type";
5
6
  import { dispatchType } from "../utils/type";
@@ -1,4 +1,5 @@
1
1
  import { CSSProperties } from "react";
2
+ import * as THREE from "three";
2
3
  import "./style.css";
3
4
  export type JumpPortalType = {
4
5
  text?: string;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import * as THREE from "three";
2
3
  import "./style.css";
3
4
  export type zoomButtonPropsType = {
4
5
  children?: React.ReactNode;
@@ -1,3 +1,4 @@
1
+ import * as THREE from "three";
1
2
  type valueType = string | boolean | number | THREE.Vector3 | THREE.Quaternion | THREE.Euler;
2
3
  type constantType = {
3
4
  [key: string]: valueType;
@@ -1,5 +1,6 @@
1
1
  import { CSSProperties } from "react";
2
2
  import { actionsType, refsType } from "../../controller/type";
3
+ import * as THREE from "three";
3
4
  import { joyStickInnerType } from "../../tools/joyStick/type";
4
5
  import { keyboardMapType } from "../../tools/keyBoardToolTip/type";
5
6
  import { minimapInnerType } from "../../tools/miniMap/type";
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from "react";
2
+ import * as THREE from "three";
2
3
  import { keyboardMapType } from "../tools/keyBoardToolTip/type";
3
4
  import { dispatchType } from "../utils/type";
4
5
  import { blockType, cameraOptionType, gaesupWorldContextType, modeType, urlsType } from "./context/type";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,10 +19,10 @@
19
19
  "dependencies": {
20
20
  "@dimforge/rapier3d": "^0.12.0",
21
21
  "@react-icons/all-files": "^4.1.0",
22
- "@react-three/drei": "9.97.0",
23
- "@react-three/fiber": "8.15.16",
24
- "@react-three/rapier": "^1.2.1",
25
- "@types/three": "^0.161.2",
22
+ "@react-three/drei": "9.102.6",
23
+ "@react-three/fiber": "8.16.1",
24
+ "@react-three/rapier": "^1.3.0",
25
+ "@types/three": "^0.162.0",
26
26
  "gh-pages": "^6.1.1",
27
27
  "leva": "0.9.35",
28
28
  "node-fetch": "3.3.2",
@@ -31,29 +31,29 @@
31
31
  "react-dom": "^18.2.0",
32
32
  "react-icons": "^5.0.1",
33
33
  "react-use-refs": "^1.0.1",
34
- "three": "^0.161.0"
34
+ "three": "^0.163.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@types/react": "^18.2.52",
38
- "@types/react-dom": "^18.2.18",
39
- "@typescript-eslint/eslint-plugin": "^6.20.0",
40
- "@typescript-eslint/parser": "^6.20.0",
41
- "@vanilla-extract/css": "^1.14.1",
37
+ "@types/react": "^18.2.73",
38
+ "@types/react-dom": "^18.2.23",
39
+ "@typescript-eslint/eslint-plugin": "^7.4.0",
40
+ "@typescript-eslint/parser": "^7.4.0",
41
+ "@vanilla-extract/css": "^1.14.2",
42
42
  "@vanilla-extract/dynamic": "^2.1.0",
43
- "@vanilla-extract/recipes": "^0.5.1",
43
+ "@vanilla-extract/recipes": "^0.5.2",
44
44
  "@vanilla-extract/sprinkles": "^1.6.1",
45
- "@vanilla-extract/vite-plugin": "^4.0.2",
45
+ "@vanilla-extract/vite-plugin": "^4.0.7",
46
46
  "@vitejs/plugin-react-swc": "^3.6.0",
47
47
  "copyfiles": "^2.4.1",
48
48
  "css-loader": "^6.10.0",
49
- "eslint": "^8.56.0",
49
+ "eslint": "^8.57.0",
50
50
  "eslint-plugin-react-hooks": "^4.6.0",
51
- "eslint-plugin-react-refresh": "^0.4.5",
51
+ "eslint-plugin-react-refresh": "^0.4.6",
52
52
  "path": "^0.12.7",
53
- "prettier": "^3.2.4",
53
+ "prettier": "^3.2.5",
54
54
  "rimraf": "^5.0.5",
55
- "typescript": "^5.3.3",
56
- "vite": "^5.0.12",
55
+ "typescript": "^5.4.3",
56
+ "vite": "^5.2.7",
57
57
  "vite-plugin-svgr": "^4.2.0"
58
58
  },
59
59
  "description": "Web 3D Character Controller and World Platform Library",