@four-leaf-studios/rl-overlay 1.0.1 → 1.0.3
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.
- package/dist/index.cjs.js +161 -97
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +150 -100
- package/dist/index.esm.js.map +1 -1
- package/dist/types/Player.d.ts +1 -0
- package/dist/types/PlayerBoost.d.ts +1 -0
- package/dist/types/Replay.d.ts +1 -1
- package/dist/types/Scoreboard.d.ts +1 -1
- package/dist/types/ScoreboardGameBox.d.ts +1 -1
- package/dist/types/ScoreboardSeriesBox.d.ts +1 -0
- package/dist/types/ScoreboardTeam.d.ts +1 -1
- package/dist/types/StatItem.d.ts +1 -1
- package/dist/types/TargetBoost.d.ts +1 -0
- package/dist/types/TargetPlayer.d.ts +1 -0
- package/dist/types/TargetPlayerLocation.d.ts +1 -0
- package/dist/types/TargetPlayerStats.d.ts +1 -0
- package/dist/types/Team.d.ts +3 -3
- package/dist/types/Teams.d.ts +1 -1
- package/dist/types/Timer.d.ts +1 -1
- package/package.json +2 -2
- package/src/Player.tsx +1 -1
- package/src/PlayerBoost.tsx +1 -1
- package/src/Replay.tsx +1 -1
- package/src/Scoreboard.tsx +1 -1
- package/src/ScoreboardGameBox.tsx +3 -1
- package/src/ScoreboardSeriesBox.tsx +3 -4
- package/src/ScoreboardTeam.tsx +1 -1
- package/src/StatItem.tsx +1 -1
- package/src/TargetBoost.tsx +1 -1
- package/src/TargetPlayer.tsx +1 -2
- package/src/TargetPlayerLocation.tsx +1 -1
- package/src/TargetPlayerStats.tsx +1 -1
- package/src/Team.tsx +3 -3
- package/src/Teams.tsx +1 -1
- package/src/Timer.tsx +1 -1
- package/test-overlay/package.json +27 -27
package/dist/types/Player.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ import { PlayerState } from "@four-leaf-studios/rl-socket-hook";
|
|
|
3
3
|
type Props = {
|
|
4
4
|
player: PlayerState;
|
|
5
5
|
};
|
|
6
|
+
export declare const Player: ({ player }: Props) => React.JSX.Element;
|
|
6
7
|
declare const _default: React.MemoExoticComponent<({ player }: Props) => React.JSX.Element>;
|
|
7
8
|
export default _default;
|
|
@@ -4,5 +4,6 @@ type Props = {
|
|
|
4
4
|
team: PlayerState["team"];
|
|
5
5
|
boost: PlayerState["boost"];
|
|
6
6
|
};
|
|
7
|
+
export declare const PlayerBoost: ({ team, boost }: Props) => React.JSX.Element;
|
|
7
8
|
declare const _default: React.MemoExoticComponent<({ team, boost }: Props) => React.JSX.Element>;
|
|
8
9
|
export default _default;
|
package/dist/types/Replay.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { Broadcast } from "./types";
|
|
|
3
3
|
interface ScoreboardGameBoxProps {
|
|
4
4
|
broadcast: Broadcast;
|
|
5
5
|
}
|
|
6
|
-
declare const ScoreboardGameBox: React.FC<ScoreboardGameBoxProps>;
|
|
6
|
+
export declare const ScoreboardGameBox: React.FC<ScoreboardGameBoxProps>;
|
|
7
7
|
export default ScoreboardGameBox;
|
|
@@ -3,5 +3,6 @@ interface ScoreboardSeriesBoxProps {
|
|
|
3
3
|
team: any;
|
|
4
4
|
seriesNumber: number;
|
|
5
5
|
}
|
|
6
|
+
export declare const ScoreboardSeriesBoxComponent: React.FC<ScoreboardSeriesBoxProps>;
|
|
6
7
|
declare const ScoreboardSeriesBox: React.NamedExoticComponent<ScoreboardSeriesBoxProps>;
|
|
7
8
|
export default ScoreboardSeriesBox;
|
package/dist/types/StatItem.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ type StatItemProps<K extends PrimitiveKeys<PlayerState>> = {
|
|
|
9
9
|
label: string;
|
|
10
10
|
value: PlayerState[K];
|
|
11
11
|
};
|
|
12
|
-
declare const StatItem: <K extends PrimitiveKeys<PlayerState>>({ id, label, value, }: StatItemProps<K>) => React.JSX.Element;
|
|
12
|
+
export declare const StatItem: <K extends PrimitiveKeys<PlayerState>>({ id, label, value, }: StatItemProps<K>) => React.JSX.Element;
|
|
13
13
|
export default StatItem;
|
|
@@ -3,5 +3,6 @@ import { PlayerState } from "@four-leaf-studios/rl-socket-hook";
|
|
|
3
3
|
type Props = {
|
|
4
4
|
location: PlayerState["location"];
|
|
5
5
|
};
|
|
6
|
+
export declare const TargetPlayerLocation: ({ location }: Props) => React.JSX.Element;
|
|
6
7
|
declare const _default: React.MemoExoticComponent<({ location }: Props) => React.JSX.Element>;
|
|
7
8
|
export default _default;
|
|
@@ -3,5 +3,6 @@ import { PlayerState } from "@four-leaf-studios/rl-socket-hook";
|
|
|
3
3
|
type Props = {
|
|
4
4
|
targetPlayer: PlayerState;
|
|
5
5
|
};
|
|
6
|
+
export declare const TargetPlayerStats: ({ targetPlayer }: Props) => React.JSX.Element;
|
|
6
7
|
declare const _default: React.MemoExoticComponent<({ targetPlayer }: Props) => React.JSX.Element>;
|
|
7
8
|
export default _default;
|
package/dist/types/Team.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Team } from "./types";
|
|
2
|
+
import { Team as TeamType } from "./types";
|
|
3
3
|
type Props = {
|
|
4
|
-
id:
|
|
4
|
+
id: TeamType["id"];
|
|
5
5
|
};
|
|
6
|
-
declare const Team: ({ id }: Props) => React.JSX.Element | null;
|
|
6
|
+
export declare const Team: ({ id }: Props) => React.JSX.Element | null;
|
|
7
7
|
declare const MemoizedTeam: React.MemoExoticComponent<({ id }: Props) => React.JSX.Element | null>;
|
|
8
8
|
export default MemoizedTeam;
|
package/dist/types/Teams.d.ts
CHANGED
package/dist/types/Timer.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@four-leaf-studios/rl-overlay",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"typescript": "^5.8.3"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@four-leaf-studios/rl-socket-hook": "^1.2.
|
|
46
|
+
"@four-leaf-studios/rl-socket-hook": "^1.2.4",
|
|
47
47
|
"@rysh/json-to-css": "^1.0.0",
|
|
48
48
|
"framer-motion": "^12.9.4"
|
|
49
49
|
}
|
package/src/Player.tsx
CHANGED
package/src/PlayerBoost.tsx
CHANGED
|
@@ -7,7 +7,7 @@ type Props = {
|
|
|
7
7
|
boost: PlayerState["boost"];
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
const PlayerBoost = ({ team, boost }: Props) => {
|
|
10
|
+
export const PlayerBoost = ({ team, boost }: Props) => {
|
|
11
11
|
const boostPercent = Math.min(Math.max(boost, 0), 100);
|
|
12
12
|
const modifier = team === 0 ? "left" : "right";
|
|
13
13
|
|
package/src/Replay.tsx
CHANGED
package/src/Scoreboard.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import ScoreboardSeriesBox from "./ScoreboardSeriesBox";
|
|
|
8
8
|
import ScoreboardGameBox from "./ScoreboardGameBox";
|
|
9
9
|
import useReplay from "./hooks/useReplay";
|
|
10
10
|
|
|
11
|
-
const Scoreboard = () => {
|
|
11
|
+
export const Scoreboard = () => {
|
|
12
12
|
const broadcast = useBroadcast();
|
|
13
13
|
const showGameComponents = useShowGameComponents();
|
|
14
14
|
const { active: replayActive } = useReplay();
|
|
@@ -7,7 +7,9 @@ interface ScoreboardGameBoxProps {
|
|
|
7
7
|
broadcast: Broadcast;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const ScoreboardGameBox: React.FC<ScoreboardGameBoxProps> = ({
|
|
10
|
+
export const ScoreboardGameBox: React.FC<ScoreboardGameBoxProps> = ({
|
|
11
|
+
broadcast,
|
|
12
|
+
}) => {
|
|
11
13
|
const gameNumber = useMemo(() => {
|
|
12
14
|
if (!broadcast.teams || broadcast.teams.length < 2) return 1;
|
|
13
15
|
const team0Score = broadcast.teams[0].series_score || 0;
|
|
@@ -7,10 +7,9 @@ interface ScoreboardSeriesBoxProps {
|
|
|
7
7
|
seriesNumber: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const ScoreboardSeriesBoxComponent: React.FC<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}) => {
|
|
10
|
+
export const ScoreboardSeriesBoxComponent: React.FC<
|
|
11
|
+
ScoreboardSeriesBoxProps
|
|
12
|
+
> = ({ team, seriesNumber }) => {
|
|
14
13
|
if (!seriesNumber) return null;
|
|
15
14
|
|
|
16
15
|
const bestOf = Number(seriesNumber);
|
package/src/ScoreboardTeam.tsx
CHANGED
|
@@ -6,7 +6,7 @@ interface ScoreboardTeamProps {
|
|
|
6
6
|
team: Team;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const ScoreboardTeam: React.FC<ScoreboardTeamProps> = ({ team }) => {
|
|
9
|
+
export const ScoreboardTeam: React.FC<ScoreboardTeamProps> = ({ team }) => {
|
|
10
10
|
const score = useEventSelector(
|
|
11
11
|
"game:update_state",
|
|
12
12
|
(state) => state?.game.teams?.[team.id]?.score
|
package/src/StatItem.tsx
CHANGED
|
@@ -17,7 +17,7 @@ type StatItemProps<K extends PrimitiveKeys<PlayerState>> = {
|
|
|
17
17
|
value: PlayerState[K]; // guaranteed to be string|number|boolean
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
const StatItem = <K extends PrimitiveKeys<PlayerState>>({
|
|
20
|
+
export const StatItem = <K extends PrimitiveKeys<PlayerState>>({
|
|
21
21
|
id,
|
|
22
22
|
label,
|
|
23
23
|
value,
|
package/src/TargetBoost.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { AnimatePresence, motion } from "framer-motion";
|
|
|
3
3
|
import React, { memo } from "react";
|
|
4
4
|
import useTargetPlayer from "./hooks/useTargetPlayer";
|
|
5
5
|
|
|
6
|
-
const TargetBoost = () => {
|
|
6
|
+
export const TargetBoost = () => {
|
|
7
7
|
const initialized = useEventSelector(
|
|
8
8
|
"game:update_state",
|
|
9
9
|
(state) => state?.hasGame
|
package/src/TargetPlayer.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useEventSelector } from "@four-leaf-studios/rl-socket-hook";
|
|
2
1
|
import { AnimatePresence, motion } from "framer-motion";
|
|
3
2
|
import React, { memo } from "react";
|
|
4
3
|
import { useBroadcast } from "./context/BroadcastContext";
|
|
@@ -6,7 +5,7 @@ import PlayerBoost from "./PlayerBoost";
|
|
|
6
5
|
import TargetPlayerStats from "./TargetPlayerStats";
|
|
7
6
|
import useTargetPlayer from "./hooks/useTargetPlayer";
|
|
8
7
|
|
|
9
|
-
const TargetPlayer = () => {
|
|
8
|
+
export const TargetPlayer = () => {
|
|
10
9
|
const broadcast = useBroadcast();
|
|
11
10
|
const targetPlayer = useTargetPlayer();
|
|
12
11
|
|
|
@@ -6,7 +6,7 @@ type Props = {
|
|
|
6
6
|
location: PlayerState["location"];
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
const TargetPlayerLocation = ({ location }: Props) => {
|
|
9
|
+
export const TargetPlayerLocation = ({ location }: Props) => {
|
|
10
10
|
return (
|
|
11
11
|
<motion.div
|
|
12
12
|
className="stat_box_statistic stat_box_statistic_player_location"
|
|
@@ -8,7 +8,7 @@ type Props = {
|
|
|
8
8
|
targetPlayer: PlayerState;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
const TargetPlayerStats = ({ targetPlayer }: Props) => (
|
|
11
|
+
export const TargetPlayerStats = ({ targetPlayer }: Props) => (
|
|
12
12
|
<ul className="stat_box_statistics">
|
|
13
13
|
<StatItem id="id" label="ID" value={targetPlayer.id} />
|
|
14
14
|
<StatItem id="team" label="Team" value={targetPlayer.team} />
|
package/src/Team.tsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useEventSelector } from "@four-leaf-studios/rl-socket-hook";
|
|
2
2
|
import { motion, AnimatePresence } from "framer-motion";
|
|
3
3
|
import React, { memo } from "react";
|
|
4
|
-
import { Team } from "./types";
|
|
4
|
+
import { Team as TeamType } from "./types";
|
|
5
5
|
import Player from "./Player";
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
8
|
-
id:
|
|
8
|
+
id: TeamType["id"];
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
const Team = ({ id }: Props) => {
|
|
11
|
+
export const Team = ({ id }: Props) => {
|
|
12
12
|
const players = useEventSelector("game:update_state", (state) => {
|
|
13
13
|
return (
|
|
14
14
|
state?.players &&
|
package/src/Teams.tsx
CHANGED
package/src/Timer.tsx
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "test-overlay",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "vite build",
|
|
9
|
-
"lint": "eslint .",
|
|
10
|
-
"preview": "vite preview"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"react": "^19.0.0",
|
|
14
|
-
"react-dom": "^19.0.0"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@eslint/js": "^9.22.0",
|
|
18
|
-
"@types/react": "^19.0.10",
|
|
19
|
-
"@types/react-dom": "^19.0.4",
|
|
20
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
21
|
-
"eslint": "^9.22.0",
|
|
22
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
23
|
-
"eslint-plugin-react-refresh": "^0.4.19",
|
|
24
|
-
"globals": "^16.0.0",
|
|
25
|
-
"vite": "^6.3.1"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "test-overlay",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"preview": "vite preview"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"react": "^19.0.0",
|
|
14
|
+
"react-dom": "^19.0.0"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@eslint/js": "^9.22.0",
|
|
18
|
+
"@types/react": "^19.0.10",
|
|
19
|
+
"@types/react-dom": "^19.0.4",
|
|
20
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
21
|
+
"eslint": "^9.22.0",
|
|
22
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
23
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
24
|
+
"globals": "^16.0.0",
|
|
25
|
+
"vite": "^6.3.1"
|
|
26
|
+
}
|
|
27
|
+
}
|