gaesup-world 0.0.652 → 0.0.653

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.
@@ -15,7 +15,7 @@ export var GameBoyDirections = [
15
15
  ];
16
16
  export default function GameBoy() {
17
17
  var _a = useContext(GaesupToolsContext).gameboy, gameboyStyle = _a.gameboyStyle, gameboyInnerStyle = _a.gameboyInnerStyle;
18
- return (_jsx("div", { className: style.gameBoy, style: gameboyStyle, children: _jsx("div", { className: style.gameBoyInner, style: gameboyInnerStyle, children: GameBoyDirections.map(function (item, key) {
18
+ return (_jsx("div", { className: style.gameBoy, children: _jsx("div", { className: style.gameBoyInner, children: GameBoyDirections.map(function (item, key) {
19
19
  return (_jsx(GameBoyButton, { tag: item.tag, value: item.value, icon: item.icon }, key));
20
20
  }) }) }));
21
21
  }
@@ -18,6 +18,7 @@ export var gameBoyInner = style([
18
18
  row: "center",
19
19
  }),
20
20
  {
21
+ display: "grid",
21
22
  margin: "5rem",
22
23
  padding: "1rem",
23
24
  borderRadius: "50%",
@@ -21,5 +21,5 @@ export default function GamePadButton(_a) {
21
21
  }), onMouseDown: function () { return onMouseDown(); }, onMouseUp: function () { return onMouseLeave(); }, onMouseLeave: function () { return onMouseLeave(); }, onContextMenu: function (e) {
22
22
  e.preventDefault();
23
23
  onMouseLeave();
24
- }, onPointerDown: function () { return onMouseDown(); }, onPointerUp: function () { return onMouseLeave(); }, style: gamepadButtonStyle, children: name }));
24
+ }, onPointerDown: function () { return onMouseDown(); }, onPointerUp: function () { return onMouseLeave(); }, children: name }));
25
25
  }
@@ -24,7 +24,7 @@ export default function GamePad() {
24
24
  .filter(function (item) {
25
25
  return !(item.tag === "run" && mode.controller === "joystick");
26
26
  });
27
- return (_jsx("div", { className: style.gamePad, style: gamepadStyle, children: _jsx("div", { className: style.gamePadGrid, style: gamepadGridStyle, children: GamePadDirections.map(function (item, key) {
27
+ return (_jsx("div", { className: style.gamePad, children: _jsx("div", { className: style.gamePadGrid, children: GamePadDirections.map(function (item, key) {
28
28
  return (_jsx(GamePadButton, { value: item.value, name: item.name }, key));
29
29
  }) }) }));
30
30
  }
@@ -8,7 +8,6 @@ import GamePad from "./gamepad";
8
8
  import { gamepadDefault } from "./gamepad/default";
9
9
  import JoyStick from "./joystick";
10
10
  import { joyStickDefault } from "./joystick/default";
11
- import JumpPoint from "./jumpPoint";
12
11
  import KeyBoardToolTip from "./keyBoardToolTip";
13
12
  import { keyboardToolTipDefault } from "./keyBoardToolTip/default";
14
13
  import MiniMap from "./minimap";
@@ -36,8 +35,8 @@ export function GaeSupTools(_a) {
36
35
  tools.gameboy,
37
36
  tools.gamepad,
38
37
  ]);
39
- return (_jsx(GaesupToolsContext.Provider, { value: gaesupTool.value, children: _jsxs(GaesupToolsDispatchContext.Provider, { value: gaesupTool.dispatch, children: [_jsxs("div", { className: style.footer, children: [_jsx("div", { className: style.footerUpper, children: (mode.controller === "joystick" ||
40
- mode.controller === "gameboy") &&
41
- gaesupTool.value.gamepad.on && _jsx(GamePad, {}) }), _jsxs("div", { className: style.footerLower, children: [mode.controller === "joystick" && gaesupTool.value.joystick.on && (_jsx(JoyStick, {})), mode.controller === "gameboy" && gaesupTool.value.gameboy.on && (_jsx(GameBoy, {})), mode.controller === "keyboard" &&
42
- gaesupTool.value.keyboardToolTip.on && _jsx(KeyBoardToolTip, {}), gaesupTool.value.minimap.on && _jsx(MiniMap, {})] })] }), _jsx(JumpPoint, {})] }) }));
38
+ return (_jsx(GaesupToolsContext.Provider, { value: gaesupTool.value, children: _jsx(GaesupToolsDispatchContext.Provider, { value: gaesupTool.dispatch, children: _jsxs("div", { className: style.footer, children: [_jsx("div", { className: style.footerUpper, children: (mode.controller === "joystick" ||
39
+ mode.controller === "gameboy") &&
40
+ gaesupTool.value.gamepad.on && _jsx(GamePad, {}) }), _jsxs("div", { className: style.footerLower, children: [mode.controller === "joystick" && gaesupTool.value.joystick.on && (_jsx(JoyStick, {})), mode.controller === "gameboy" && gaesupTool.value.gameboy.on && (_jsx(GameBoy, {})), mode.controller === "keyboard" &&
41
+ gaesupTool.value.keyboardToolTip.on && _jsx(KeyBoardToolTip, {}), gaesupTool.value.minimap.on && _jsx(MiniMap, {})] })] }) }) }));
43
42
  }
@@ -17,7 +17,7 @@ import useJoyStick from "./default";
17
17
  import * as style from "./style.css";
18
18
  export default function JoyStick() {
19
19
  var joyStickStyle = useContext(GaesupToolsContext).joystick.joyStickStyle;
20
- return (_jsx("div", { className: style.joyStick, style: joyStickStyle, children: _jsx(JoyBall, {}) }));
20
+ return (_jsx("div", { className: style.joyStick, children: _jsx(JoyBall, {}) }));
21
21
  }
22
22
  export function JoyBall() {
23
23
  var outerRef = useRef(null);
@@ -1,21 +1,23 @@
1
1
  import { style } from "@vanilla-extract/css";
2
- import { fixed, flex } from "../../../styles/recipe/index.css";
3
2
  export var joyStick = style([
4
- fixed({
5
- south_east: true,
6
- }),
7
- flex({
8
- column: "7",
9
- }),
10
3
  {
4
+ position: "fixed",
5
+ bottom: "0",
6
+ right: "0",
7
+ display: "flex",
8
+ flexDirection: "column",
9
+ justifyContent: "flex-end",
10
+ alignItems: "flex-start",
11
+ textAlign: "center",
11
12
  width: "100%",
12
13
  },
13
14
  ]);
14
15
  export var joyStickInner = style([
15
- flex({
16
- row: "center",
17
- }),
18
16
  {
17
+ display: "flex",
18
+ alignItems: "center",
19
+ justifyContent: "center",
20
+ textAlign: "center",
19
21
  margin: "5rem",
20
22
  padding: "1rem",
21
23
  width: "12rem",
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx } from "react/jsx-runtime";
13
2
  import { assignInlineVars } from "@vanilla-extract/dynamic";
14
3
  import { useContext } from "react";
@@ -39,7 +28,7 @@ export default function KeyBoardToolTip() {
39
28
  });
40
29
  return maps;
41
30
  }, {});
42
- return (_jsx("div", { className: style.keyBoardToolTip, style: keyBoardToolTipStyle, children: _jsx("div", { className: style.keyBoardTooInner, style: keyBoardToolTipInnerStyle, children: keyArray.map(function (item, key) {
31
+ return (_jsx("div", { className: style.keyBoardToolTip, children: _jsx("div", { className: style.keyBoardTooInner, children: keyArray.map(function (item, key) {
43
32
  var background = "rgba(0, 0, 0, 0.1)";
44
33
  var boxShadow = "0 0 5px rgba(0, 0, 0, 0.2)";
45
34
  if (codeToActionObj[item.code]) {
@@ -57,12 +46,12 @@ export default function KeyBoardToolTip() {
57
46
  animations.keyControl[codeToActionObj[item.code]]) {
58
47
  color = "black";
59
48
  }
60
- return (_jsx("div", { className: style.keyCap, style: __assign(__assign({}, assignInlineVars({
49
+ return (_jsx("div", { className: style.keyCap, style: assignInlineVars({
61
50
  background: background,
62
51
  boxShadow: boxShadow,
63
52
  color: color,
64
53
  gridRow: item.gridRow,
65
54
  gridColumn: item.gridColumn,
66
- })), keyCapStyle), children: item.name }, key));
55
+ }), children: item.name }, key));
67
56
  }) }) }));
68
57
  }
@@ -42,16 +42,18 @@ export default function MiniMap() {
42
42
  else
43
43
  setRatio(function (prev) { return prev - 0.1; });
44
44
  }, [setRatio, ratio]);
45
- return (_jsxs("div", { className: style.minimap, style: minimap.minimapStyle || {}, onWheel: function (e) {
45
+ return (_jsxs("div", { className: style.minimap,
46
+ // style={assignInlineVars(minimap.minimapStyle || {})}
47
+ onWheel: function (e) {
46
48
  if (e.deltaY > 0)
47
49
  downRatio();
48
50
  else
49
51
  upRatio();
50
- }, children: [_jsx("div", { className: style.minimapOuter, style: minimap.objectStyle || {} }), _jsxs("div", { className: style.minimapInner, style: minimap.innerStyle || {}, children: [Object.values(minimapInner.props).map(function (obj, key) {
51
- return (_jsx("div", { className: style.minimapObject, style: __assign(__assign({}, assignInlineVars({
52
+ }, children: [_jsx("div", { className: style.minimapOuter }), _jsxs("div", { className: style.minimapInner, children: [Object.values(minimapInner.props).map(function (obj, key) {
53
+ return (_jsx("div", { className: style.minimapObject, style: assignInlineVars({
52
54
  width: "".concat(obj.size.x, "rem"),
53
55
  height: "".concat(obj.size.z, "rem"),
54
56
  transform: "translate(".concat(-obj.center.x + activeState.position.x * ratio, "rem, ").concat(-obj.center.z + activeState.position.z * ratio, "rem)"),
55
- })), minimap.objectStyle), children: _jsx("div", { className: style.text, style: minimap.textStyle, children: obj.text }) }, key));
57
+ }), children: _jsx("div", { className: style.text, children: obj.text }) }, key));
56
58
  }), _jsx("div", { className: style.avatar, style: minimap.avatarStyle })] })] }));
57
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.0.652",
3
+ "version": "0.0.653",
4
4
  "description": "Web 3D Character Controller and World Platform Library",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -19,8 +19,14 @@ export default function GameBoy() {
19
19
  gameboy: { gameboyStyle, gameboyInnerStyle },
20
20
  } = useContext(GaesupToolsContext);
21
21
  return (
22
- <div className={style.gameBoy} style={gameboyStyle}>
23
- <div className={style.gameBoyInner} style={gameboyInnerStyle}>
22
+ <div
23
+ className={style.gameBoy}
24
+ // style={gameboyStyle}
25
+ >
26
+ <div
27
+ className={style.gameBoyInner}
28
+ // style={gameboyInnerStyle}
29
+ >
24
30
  {GameBoyDirections.map((item: gameBoyButtonType, key: number) => {
25
31
  return (
26
32
  <GameBoyButton
@@ -26,6 +26,7 @@ export const gameBoyInner = style([
26
26
  row: "center",
27
27
  }),
28
28
  {
29
+ display: "grid",
29
30
  margin: "5rem",
30
31
  padding: "1rem",
31
32
  borderRadius: "50%",
@@ -41,7 +41,7 @@ export default function GamePadButton({
41
41
  }}
42
42
  onPointerDown={() => onMouseDown()}
43
43
  onPointerUp={() => onMouseLeave()}
44
- style={gamepadButtonStyle}
44
+ // style={gamepadButtonStyle}
45
45
  >
46
46
  {name}
47
47
  </button>
@@ -40,8 +40,14 @@ export default function GamePad() {
40
40
  );
41
41
 
42
42
  return (
43
- <div className={style.gamePad} style={gamepadStyle}>
44
- <div className={style.gamePadGrid} style={gamepadGridStyle}>
43
+ <div
44
+ className={style.gamePad}
45
+ // style={gamepadStyle}
46
+ >
47
+ <div
48
+ className={style.gamePadGrid}
49
+ // style={gamepadGridStyle}
50
+ >
45
51
  {GamePadDirections.map((item: gameBoyDirectionType, key: number) => {
46
52
  return (
47
53
  <GamePadButton key={key} value={item.value} name={item.name} />
@@ -7,7 +7,6 @@ import GamePad from "./gamepad";
7
7
  import { gamepadDefault } from "./gamepad/default";
8
8
  import JoyStick from "./joystick";
9
9
  import { joyStickDefault } from "./joystick/default";
10
- import JumpPoint from "./jumpPoint";
11
10
  import KeyBoardToolTip from "./keyBoardToolTip";
12
11
  import { keyboardToolTipDefault } from "./keyBoardToolTip/default";
13
12
  import MiniMap from "./minimap";
@@ -72,7 +71,7 @@ export function GaeSupTools({
72
71
  </div>
73
72
  </div>
74
73
 
75
- <JumpPoint />
74
+ {/* <JumpPoint /> */}
76
75
  </GaesupToolsDispatchContext.Provider>
77
76
  </GaesupToolsContext.Provider>
78
77
  );
@@ -17,7 +17,10 @@ export default function JoyStick() {
17
17
  joystick: { joyStickStyle },
18
18
  } = useContext(GaesupToolsContext);
19
19
  return (
20
- <div className={style.joyStick} style={joyStickStyle}>
20
+ <div
21
+ className={style.joyStick}
22
+ // style={joyStickStyle}
23
+ >
21
24
  <JoyBall />
22
25
  </div>
23
26
  );
@@ -1,23 +1,25 @@
1
1
  import { style } from "@vanilla-extract/css";
2
- import { fixed, flex } from "../../../styles/recipe/index.css";
3
2
 
4
3
  export const joyStick = style([
5
- fixed({
6
- south_east: true,
7
- }),
8
- flex({
9
- column: "7",
10
- }),
11
4
  {
5
+ position: "fixed",
6
+ bottom: "0",
7
+ right: "0",
8
+ display: "flex",
9
+ flexDirection: "column",
10
+ justifyContent: "flex-end",
11
+ alignItems: "flex-start",
12
+ textAlign: "center",
12
13
  width: "100%",
13
14
  },
14
15
  ]);
15
16
 
16
17
  export const joyStickInner = style([
17
- flex({
18
- row: "center",
19
- }),
20
18
  {
19
+ display: "flex",
20
+ alignItems: "center",
21
+ justifyContent: "center",
22
+ textAlign: "center",
21
23
  margin: "5rem",
22
24
  padding: "1rem",
23
25
  width: "12rem",
@@ -44,8 +44,14 @@ export default function KeyBoardToolTip() {
44
44
  }, {});
45
45
 
46
46
  return (
47
- <div className={style.keyBoardToolTip} style={keyBoardToolTipStyle}>
48
- <div className={style.keyBoardTooInner} style={keyBoardToolTipInnerStyle}>
47
+ <div
48
+ className={style.keyBoardToolTip}
49
+ // style={keyBoardToolTipStyle}
50
+ >
51
+ <div
52
+ className={style.keyBoardTooInner}
53
+ // style={keyBoardToolTipInnerStyle}
54
+ >
49
55
  {keyArray.map((item: keyArrayItemType, key: number) => {
50
56
  let background = "rgba(0, 0, 0, 0.1)";
51
57
  let boxShadow = "0 0 5px rgba(0, 0, 0, 0.2)";
@@ -70,16 +76,13 @@ export default function KeyBoardToolTip() {
70
76
  return (
71
77
  <div
72
78
  className={style.keyCap}
73
- style={{
74
- ...assignInlineVars({
75
- background,
76
- boxShadow,
77
- color,
78
- gridRow: item.gridRow,
79
- gridColumn: item.gridColumn,
80
- }),
81
- ...keyCapStyle,
82
- }}
79
+ style={assignInlineVars({
80
+ background,
81
+ boxShadow,
82
+ color,
83
+ gridRow: item.gridRow,
84
+ gridColumn: item.gridColumn,
85
+ })}
83
86
  key={key}
84
87
  >
85
88
  {item.name}
@@ -41,31 +41,37 @@ export default function MiniMap() {
41
41
  return (
42
42
  <div
43
43
  className={style.minimap}
44
- style={minimap.minimapStyle || {}}
44
+ // style={assignInlineVars(minimap.minimapStyle || {})}
45
45
  onWheel={(e) => {
46
46
  if (e.deltaY > 0) downRatio();
47
47
  else upRatio();
48
48
  }}
49
49
  >
50
- <div className={style.minimapOuter} style={minimap.objectStyle || {}} />
51
- <div className={style.minimapInner} style={minimap.innerStyle || {}}>
50
+ <div
51
+ className={style.minimapOuter}
52
+ // style={minimap.objectStyle || {}}
53
+ />
54
+ <div
55
+ className={style.minimapInner}
56
+ // style={minimap.innerStyle || {}}
57
+ >
52
58
  {Object.values(minimapInner.props).map((obj, key) => {
53
59
  return (
54
60
  <div
55
61
  key={key}
56
62
  className={style.minimapObject}
57
- style={{
58
- ...assignInlineVars({
59
- width: `${obj.size.x}rem`,
60
- height: `${obj.size.z}rem`,
61
- transform: `translate(${
62
- -obj.center.x + activeState.position.x * ratio
63
- }rem, ${-obj.center.z + activeState.position.z * ratio}rem)`,
64
- }),
65
- ...minimap.objectStyle,
66
- }}
63
+ style={assignInlineVars({
64
+ width: `${obj.size.x}rem`,
65
+ height: `${obj.size.z}rem`,
66
+ transform: `translate(${
67
+ -obj.center.x + activeState.position.x * ratio
68
+ }rem, ${-obj.center.z + activeState.position.z * ratio}rem)`,
69
+ })}
67
70
  >
68
- <div className={style.text} style={minimap.textStyle}>
71
+ <div
72
+ className={style.text}
73
+ // style={minimap.textStyle}
74
+ >
69
75
  {obj.text}
70
76
  </div>
71
77
  </div>
package/tsconfig.json CHANGED
@@ -18,5 +18,5 @@
18
18
  "declaration": true,
19
19
  "outDir": "./dist"
20
20
  },
21
- "include": ["./src/**/*.tsx", "./src/**/*.ts"]
21
+ "include": ["./src/**/*.tsx", "./src/**/*.ts", "./src/**/*.css.ts"]
22
22
  }