@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.
@@ -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;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- declare const Replay: () => React.JSX.Element | null;
2
+ export declare const Replay: () => React.JSX.Element | null;
3
3
  export default Replay;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- declare const Scoreboard: () => React.JSX.Element | null;
2
+ export declare const Scoreboard: () => React.JSX.Element | null;
3
3
  export default Scoreboard;
@@ -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;
@@ -3,5 +3,5 @@ import { Team } from "./types";
3
3
  interface ScoreboardTeamProps {
4
4
  team: Team;
5
5
  }
6
- declare const ScoreboardTeam: React.FC<ScoreboardTeamProps>;
6
+ export declare const ScoreboardTeam: React.FC<ScoreboardTeamProps>;
7
7
  export default ScoreboardTeam;
@@ -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;
@@ -1,3 +1,4 @@
1
1
  import React from "react";
2
+ export declare const TargetBoost: () => React.JSX.Element | null;
2
3
  declare const _default: React.MemoExoticComponent<() => React.JSX.Element | null>;
3
4
  export default _default;
@@ -1,3 +1,4 @@
1
1
  import React from "react";
2
+ export declare const TargetPlayer: () => React.JSX.Element | null;
2
3
  declare const _default: React.MemoExoticComponent<() => React.JSX.Element | null>;
3
4
  export default _default;
@@ -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;
@@ -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: Team["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;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- declare const Teams: () => React.JSX.Element;
2
+ export declare const Teams: () => React.JSX.Element;
3
3
  export default Teams;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- declare const Timer: React.NamedExoticComponent<{}>;
2
+ export declare const Timer: React.NamedExoticComponent<{}>;
3
3
  export default Timer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@four-leaf-studios/rl-overlay",
3
- "version": "1.0.1",
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.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
@@ -7,7 +7,7 @@ type Props = {
7
7
  player: PlayerState;
8
8
  };
9
9
 
10
- const Player = ({ player }: Props) => {
10
+ export const Player = ({ player }: Props) => {
11
11
  const modifier = player.team === 0 ? "left" : "right";
12
12
 
13
13
  return (
@@ -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
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import useReplay from "./hooks/useReplay";
3
3
 
4
- const Replay = () => {
4
+ export const Replay = () => {
5
5
  const { active: replayActive } = useReplay();
6
6
 
7
7
  if (!replayActive) {
@@ -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> = ({ broadcast }) => {
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<ScoreboardSeriesBoxProps> = ({
11
- team,
12
- seriesNumber,
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);
@@ -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,
@@ -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
@@ -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: Team["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
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import Team from "./Team";
3
3
 
4
- const Teams = () => {
4
+ export const Teams = () => {
5
5
  return (
6
6
  <>
7
7
  <Team id={"0"} />
package/src/Timer.tsx CHANGED
@@ -19,6 +19,6 @@ const TimerComponent: React.FC = () => {
19
19
  return <span className="time_box">{formattedTime}</span>;
20
20
  };
21
21
 
22
- const Timer = memo(TimerComponent);
22
+ export const Timer = memo(TimerComponent);
23
23
  Timer.displayName = "Timer";
24
24
  export default Timer;
@@ -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
+ }