gaesup-world 0.0.653 → 0.0.661

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.
@@ -1,4 +1,3 @@
1
- "use client";
2
1
  var __assign = (this && this.__assign) || function () {
3
2
  __assign = Object.assign || function(t) {
4
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
package/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ export {
2
+ GaeSupProps,
3
+ GaeSupTools,
4
+ GaesupController,
5
+ GaesupWorld,
6
+ playActions,
7
+ } from "./src";
package/package.json CHANGED
@@ -1,56 +1,35 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.0.653",
4
- "description": "Web 3D Character Controller and World Platform Library",
5
- "private": false,
3
+ "version": "0.0.661",
4
+ "type": "commonjs",
6
5
  "main": "dist/index.js",
7
6
  "types": "dist/index.d.ts",
8
- "author": "jigglypop <donghwanyeom@gmail.com>",
9
- "license": "MIT",
10
- "type": "commonjs",
11
7
  "homepage": "https://jigglypop.github.io/gaesup-world/",
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://github.com/jigglypop/gaesup-world.git"
15
- },
16
- "keywords": [
17
- "three.js",
18
- "@react-three/fiber",
19
- "@react-three/drei"
20
- ],
21
- "bugs": {
22
- "url": "https://github.com/jigglypop/gaesup-world/issues"
23
- },
24
8
  "scripts": {
25
9
  "dev": "vite",
26
10
  "build": "vite build",
27
11
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
28
- "prepare": "rm -rf dist && mkdir dist && tsc",
29
12
  "preview": "vite preview",
30
13
  "predeploy": "npm run build",
14
+ "prepare": "rm -rf dist && mkdir dist && tsc -p tsconfig.build.json",
31
15
  "deploy": "gh-pages -d dist"
32
16
  },
33
17
  "dependencies": {
34
18
  "@dimforge/rapier3d": "^0.11.2",
35
- "@mdx-js/loader": "^3.0.0",
36
- "@mdx-js/react": "^3.0.0",
37
19
  "@react-three/drei": "9.88.11",
38
20
  "@react-three/fiber": "8.15.9",
39
21
  "@react-three/rapier": "^1.1.2",
40
22
  "@types/three": "^0.158.1",
41
- "@types/uuid": "^9.0.6",
42
23
  "@vanilla-extract/babel-plugin": "^1.2.0",
43
24
  "@vanilla-extract/css": "^1.13.0",
44
25
  "@vanilla-extract/css-utils": "^0.1.3",
45
26
  "@vanilla-extract/dynamic": "^2.0.3",
27
+ "@vanilla-extract/next-plugin": "^2.3.1",
46
28
  "@vanilla-extract/recipes": "^0.5.0",
47
29
  "@vanilla-extract/sprinkles": "^1.6.1",
48
- "css-loader": "^6.8.1",
49
30
  "gh-pages": "^6.1.0",
50
31
  "leva": "0.9.35",
51
32
  "node-fetch": "3.3.2",
52
- "pluralize": "^8.0.0",
53
- "r3f-perf": "7.1.2",
54
33
  "react": "^18.2.0",
55
34
  "react-device-detect": "^2.2.3",
56
35
  "react-dom": "^18.2.0",
@@ -58,7 +37,6 @@
58
37
  "three": "^0.158.0"
59
38
  },
60
39
  "devDependencies": {
61
- "@types/pluralize": "^0.0.33",
62
40
  "@types/react": "^18.2.37",
63
41
  "@types/react-dom": "^18.2.15",
64
42
  "@typescript-eslint/eslint-plugin": "^6.10.0",
@@ -72,5 +50,20 @@
72
50
  "prettier": "^3.1.1",
73
51
  "typescript": "^5.2.2",
74
52
  "vite": "^5.0.0"
53
+ },
54
+ "description": "Web 3D Character Controller and World Platform Library",
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "git+https://github.com/jigglypop/gaesup-world.git"
58
+ },
59
+ "keywords": [
60
+ "three.js",
61
+ "@react-three/fiber",
62
+ "@react-three/drei"
63
+ ],
64
+ "author": "jigglypop",
65
+ "license": "MIT",
66
+ "bugs": {
67
+ "url": "https://github.com/jigglypop/gaesup-world/issues"
75
68
  }
76
69
  }
@@ -230,203 +230,3 @@ export function JoyBall() {
230
230
  </div>
231
231
  );
232
232
  }
233
-
234
- // import {
235
- // MouseEvent,
236
- // MouseEventHandler,
237
- // TouchEvent,
238
- // TouchEventHandler,
239
- // useCallback,
240
- // useContext,
241
- // useEffect,
242
- // useRef,
243
- // useState,
244
- // } from "react";
245
- // import { vars } from "../../../styles/theme.css";
246
- // import { GaesupToolsContext } from "../context";
247
- // import useJoyStick from "./default";
248
- // import * as style from "./style.css";
249
- //
250
- // export default function JoyStick() {
251
- // return <JoyBall />;
252
- // }
253
- //
254
- // export function JoyBall() {
255
- // const outerRef = useRef<HTMLDivElement>(null);
256
- // const childRef = useRef<HTMLDivElement>(null);
257
- // const {
258
- // joystick: { joyStickBallStyle, joyStickInnerStyle, joyStickStyle },
259
- // } = useContext(GaesupToolsContext);
260
- // const { joyStickBall, joyStickOrigin, setBall, setOrigin } = useJoyStick();
261
- // const [mouseDown, setMouseDown] = useState(false);
262
- // const [touchDown, setTouchDown] = useState(false);
263
- // const [background, setBackground] = useState("rgba(0, 0, 0, 0.5)");
264
- // const [boxShadow, setBoxShadow] = useState("0 0 10px rgba(0, 0, 0, 0.5)");
265
- //
266
- // const calcOriginBall = <T extends MouseEvent | TouchEvent>(
267
- // e: T,
268
- // X: number,
269
- // Y: number
270
- // ) => {
271
- // const outer = e.target as HTMLDivElement;
272
- // const parent = outer.parentElement as HTMLDivElement;
273
- // console.log(parent.getBoundingClientRect());
274
- // const { top, left, bottom, right, width, height } =
275
- // parent.getBoundingClientRect();
276
- //
277
- // if (top > Y || bottom < Y || left > X || right < X) return;
278
- // const normX = (joyStickOrigin.x - X) ** 2;
279
- // const normY = (joyStickOrigin.y - Y) ** 2;
280
- // const currentRadius = Math.sqrt(normX + normY);
281
- // const originRadius = Math.sqrt((width / 2) ** 2 + (height / 2) ** 2);
282
- // setOrigin({
283
- // x: left,
284
- // y: bottom,
285
- // angle: Math.atan2(Y - (bottom - height / 2), X - (left + width / 2)),
286
- // currentRadius,
287
- // originRadius,
288
- // isIn: currentRadius > originRadius / 2,
289
- // isOn: true,
290
- // isCenter: currentRadius < originRadius / 4,
291
- // isUp: top > Y - height / 2,
292
- // });
293
- // setBoxShadow("0 0 10px rgba(99,251,215,1)");
294
- // setBackground(
295
- // currentRadius > originRadius / 2
296
- // ? vars.gradient.lightGreen
297
- // : vars.gradient.green
298
- // );
299
- // setBall({
300
- // top: `${top}px`,
301
- // left: `${left}px`,
302
- // });
303
- // };
304
- //
305
- // const initialize = (e) => {
306
- // const outer = e.target as HTMLDivElement;
307
- // const parent = outer.parentElement as HTMLDivElement;
308
- // const { left, bottom, width, height } = parent.getBoundingClientRect();
309
- // const x = left;
310
- // const y = bottom;
311
- //
312
- // setOrigin({
313
- // x: x,
314
- // y: y,
315
- // angle: Math.PI / 2,
316
- // currentRadius: 0,
317
- // originRadius: 0,
318
- // isIn: true,
319
- // isOn: false,
320
- // isCenter: true,
321
- // isUp: true,
322
- // });
323
- // initBall();
324
- // };
325
- //
326
- // const handleMouseOver: MouseEventHandler = useCallback(
327
- // (e) => {
328
- // if (!mouseDown) return;
329
- // console.log(e.clientX, e.clientY);
330
- // calcOriginBall<MouseEvent<Element>>(e, e.pageX, e.pageY);
331
- // },
332
- // [
333
- // joyStickBall,
334
- // joyStickOrigin,
335
- // setBall,
336
- // setOrigin,
337
- // mouseDown,
338
- // boxShadow,
339
- // background,
340
- // setBoxShadow,
341
- // setBackground,
342
- // ]
343
- // );
344
- //
345
- // const handleTouchMove: TouchEventHandler = useCallback(
346
- // (e) => {
347
- // if (!touchDown) return;
348
- // calcOriginBall<TouchEvent<Element>>(
349
- // e,
350
- // e.touches[0].pageX,
351
- // e.touches[0].pageY
352
- // );
353
- // },
354
- // [touchDown, boxShadow, background, setBoxShadow, setBackground]
355
- // );
356
- //
357
- // const handleTouchEnd: TouchEventHandler = useCallback(
358
- // (e) => {
359
- // setTouchDown(false);
360
- // return initialize(e);
361
- // },
362
- // [
363
- // touchDown,
364
- // setTouchDown,
365
- // boxShadow,
366
- // background,
367
- // setBoxShadow,
368
- // setBackground,
369
- // ]
370
- // );
371
- // const handleMouseOut: MouseEventHandler = useCallback(
372
- // (e) => {
373
- // setMouseDown(false);
374
- // return initialize(e);
375
- // },
376
- // [
377
- // setBall,
378
- // setMouseDown,
379
- // setOrigin,
380
- // mouseDown,
381
- // boxShadow,
382
- // background,
383
- // setBoxShadow,
384
- // setBackground,
385
- // ]
386
- // );
387
- //
388
- // const initBall = () => {
389
- // const { top, left, width, height } = outerRef.current.getClientRects()[0];
390
- // setBoxShadow("0 0 10px rgba(0, 0, 0, 0.5)");
391
- // setBackground("rgba(0, 0, 0, 0.5)");
392
- // setBall({
393
- // top: `${top + height / 2}px`,
394
- // left: `${left + width / 2}px`,
395
- // });
396
- // };
397
- // // window.addEventListener("resize", () => setScreenSize());
398
- //
399
- // useEffect(() => {
400
- // initBall();
401
- // }, []);
402
- //
403
- // return (
404
- // <div className={style.joyStick}>
405
- // <div
406
- // className={style.joyStickInner}
407
- // style={joyStickInnerStyle}
408
- // ref={outerRef}
409
- // onMouseDown={() => setMouseDown(true)}
410
- // onMouseUp={() => setMouseDown(false)}
411
- // onMouseMove={handleMouseOver}
412
- // onMouseLeave={(e) => handleMouseOut(e)}
413
- // onTouchStart={() => setTouchDown(true)}
414
- // onTouchEnd={(e) => handleTouchEnd(e)}
415
- // onTouchMove={handleTouchMove}
416
- // onTouchCancel={handleTouchEnd}
417
- // >
418
- // <div
419
- // className={`${style.joystickBall}`}
420
- // ref={childRef}
421
- // style={{
422
- // background: joyStickBallStyle?.background || background,
423
- // boxShadow: joyStickBallStyle?.boxShadow || boxShadow,
424
- // top: joyStickBall.top,
425
- // left: joyStickBall.left,
426
- // ...joyStickBallStyle,
427
- // }}
428
- // />
429
- // </div>
430
- // </div>
431
- // );
432
- // }
@@ -1,5 +1,3 @@
1
- "use client";
2
-
3
1
  import { assignInlineVars } from "@vanilla-extract/dynamic";
4
2
  import { useCallback, useContext, useEffect, useState } from "react";
5
3
 
package/vite.config.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
2
+ import react from "@vitejs/plugin-react-swc";
3
+ import { defineConfig } from "vite";
4
+
5
+ // https://vitejs.dev/config/
6
+ export default defineConfig({
7
+ base: "/gaesup-world/",
8
+ plugins: [react(), vanillaExtractPlugin()],
9
+ });
package/lib/index.ts DELETED
@@ -1,10 +0,0 @@
1
- import * as pluralize from "pluralize";
2
-
3
- /**
4
- * @Method: Returns the plural form of any noun.
5
- * @Param: {string}
6
- * @Return: {string}
7
- */
8
- export function getPlural(str: any): string {
9
- return pluralize.plural(str);
10
- }
package/tsconfig.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "lib": ["dom", "dom.iterable", "esnext"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "esModuleInterop": true,
8
- "allowSyntheticDefaultImports": true,
9
- "forceConsistentCasingInFileNames": true,
10
- "noFallthroughCasesInSwitch": true,
11
- "module": "esnext",
12
- "moduleResolution": "node",
13
- "resolveJsonModule": true,
14
- "isolatedModules": true,
15
- // publish options
16
- "jsx": "react-jsx",
17
- "noEmit": false,
18
- "declaration": true,
19
- "outDir": "./dist"
20
- },
21
- "include": ["./src/**/*.tsx", "./src/**/*.ts", "./src/**/*.css.ts"]
22
- }