Skip to content

Commit

Permalink
Merge branch 'dev' into jwrigh/1669/ui-components
Browse files Browse the repository at this point in the history
  • Loading branch information
HunterBarclay committed Jun 19, 2024
2 parents fe9ccda + 71a598c commit c353420
Show file tree
Hide file tree
Showing 64 changed files with 265 additions and 232 deletions.
94 changes: 47 additions & 47 deletions fission/src/Synthesis.tsx
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
import Scene from "./components/Scene.tsx"
import MirabufSceneObject from "./mirabuf/MirabufSceneObject.ts"
import { LoadMirabufRemote } from "./mirabuf/MirabufLoader.ts"
import { mirabuf } from "./proto/mirabuf"
import MirabufParser, { ParseErrorSeverity } from "./mirabuf/MirabufParser.ts"
import MirabufInstance from "./mirabuf/MirabufInstance.ts"
import Scene from '@/components/Scene.tsx';
import MirabufSceneObject from './mirabuf/MirabufSceneObject.ts';
import { LoadMirabufRemote } from './mirabuf/MirabufLoader.ts';
import { mirabuf } from './proto/mirabuf';
import MirabufParser, { ParseErrorSeverity } from './mirabuf/MirabufParser.ts';
import MirabufInstance from './mirabuf/MirabufInstance.ts';
import { AnimatePresence } from "framer-motion"
import { ReactElement, useEffect } from "react"
import { ModalControlProvider, useModalManager } from "./ModalContext"
import { PanelControlProvider, usePanelManager } from "./PanelContext"
import { useTheme } from "./ThemeContext"
import { ToastContainer, ToastProvider } from "./ToastContext"
import { ModalControlProvider, useModalManager } from "@/ui/ModalContext"
import { PanelControlProvider, usePanelManager } from "@/ui/PanelContext"
import { useTheme } from "@/ui/ThemeContext"
import { ToastContainer, ToastProvider } from "@/ui/ToastContext"
import {
TOOLTIP_DURATION,
TooltipControl,
TooltipControlProvider,
TooltipType,
useTooltipManager,
} from "./TooltipContext"
import MainHUD from "./components/MainHUD"
import DownloadAssetsModal from "./modals/DownloadAssetsModal"
import ExitSynthesisModal from "./modals/ExitSynthesisModal"
import MatchResultsModal from "./modals/MatchResultsModal"
import UpdateAvailableModal from "./modals/UpdateAvailableModal"
import ViewModal from "./modals/ViewModal"
import ConnectToMultiplayerModal from "./modals/aether/ConnectToMultiplayerModal"
import ServerHostingModal from "./modals/aether/ServerHostingModal"
import ChangeInputsModal from "./modals/configuring/ChangeInputsModal"
import ChooseMultiplayerModeModal from "./modals/configuring/ChooseMultiplayerModeModal"
import ChooseSingleplayerModeModal from "./modals/configuring/ChooseSingleplayerModeModal"
import ConfigMotorModal from "./modals/configuring/ConfigMotorModal"
import DrivetrainModal from "./modals/configuring/DrivetrainModal"
import PracticeSettingsModal from "./modals/configuring/PracticeSettingsModal"
import RoboRIOModal from "./modals/configuring/RoboRIOModal"
import SettingsModal from "./modals/configuring/SettingsModal"
import RCConfigEncoderModal from "./modals/configuring/rio-config/RCConfigEncoderModal"
import RCConfigPwmGroupModal from "./modals/configuring/rio-config/RCConfigPwmGroupModal"
import RCCreateDeviceModal from "./modals/configuring/rio-config/RCCreateDeviceModal"
import DeleteAllThemesModal from "./modals/configuring/theme-editor/DeleteAllThemesModal"
import DeleteThemeModal from "./modals/configuring/theme-editor/DeleteThemeModal"
import NewThemeModal from "./modals/configuring/theme-editor/NewThemeModal"
import ThemeEditorModal from "./modals/configuring/theme-editor/ThemeEditorModal"
import MatchModeModal from "./modals/spawning/MatchModeModal"
import RobotSwitchPanel from "./panels/RobotSwitchPanel"
import SpawnLocationsPanel from "./panels/SpawnLocationPanel"
import ConfigureGamepiecePickupPanel from "./panels/configuring/ConfigureGamepiecePickupPanel"
import ConfigureShotTrajectoryPanel from "./panels/configuring/ConfigureShotTrajectoryPanel"
import ScoringZonesPanel from "./panels/configuring/scoring/ScoringZonesPanel"
import ZoneConfigPanel from "./panels/configuring/scoring/ZoneConfigPanel"
import ScoreboardPanel from "./panels/information/ScoreboardPanel"
import DriverStationPanel from "./panels/simulation/DriverStationPanel"
import ManageAssembliesModal from "./modals/spawning/ManageAssembliesModal.tsx"
import World from "./systems/World.ts"
import { AddRobotsModal, AddFieldsModal, SpawningModal } from "./modals/spawning/SpawningModals.tsx"
import ImportMirabufModal from "./modals/mirabuf/ImportMirabufModal.tsx"
} from "@/ui/TooltipContext"
import MainHUD from "@/components/MainHUD"
import DownloadAssetsModal from "@/modals/DownloadAssetsModal"
import ExitSynthesisModal from "@/modals/ExitSynthesisModal"
import MatchResultsModal from "@/modals/MatchResultsModal"
import UpdateAvailableModal from "@/modals/UpdateAvailableModal"
import ViewModal from "@/modals/ViewModal"
import ConnectToMultiplayerModal from "@/modals/aether/ConnectToMultiplayerModal"
import ServerHostingModal from "@/modals/aether/ServerHostingModal"
import ChangeInputsModal from "@/modals/configuring/ChangeInputsModal"
import ChooseMultiplayerModeModal from "@/modals/configuring/ChooseMultiplayerModeModal"
import ChooseSingleplayerModeModal from "@/modals/configuring/ChooseSingleplayerModeModal"
import ConfigMotorModal from "@/modals/configuring/ConfigMotorModal"
import DrivetrainModal from "@/modals/configuring/DrivetrainModal"
import PracticeSettingsModal from "@/modals/configuring/PracticeSettingsModal"
import RoboRIOModal from "@/modals/configuring/RoboRIOModal"
import SettingsModal from "@/modals/configuring/SettingsModal"
import RCConfigEncoderModal from "@/modals/configuring/rio-config/RCConfigEncoderModal"
import RCConfigPwmGroupModal from "@/modals/configuring/rio-config/RCConfigPwmGroupModal"
import RCCreateDeviceModal from "@/modals/configuring/rio-config/RCCreateDeviceModal"
import DeleteAllThemesModal from "@/modals/configuring/theme-editor/DeleteAllThemesModal"
import DeleteThemeModal from "@/modals/configuring/theme-editor/DeleteThemeModal"
import NewThemeModal from "@/modals/configuring/theme-editor/NewThemeModal"
import ThemeEditorModal from "@/modals/configuring/theme-editor/ThemeEditorModal"
import MatchModeModal from "@/modals/spawning/MatchModeModal"
import RobotSwitchPanel from "@/panels/RobotSwitchPanel"
import SpawnLocationsPanel from "@/panels/SpawnLocationPanel"
import ConfigureGamepiecePickupPanel from "@/panels/configuring/ConfigureGamepiecePickupPanel"
import ConfigureShotTrajectoryPanel from "@/panels/configuring/ConfigureShotTrajectoryPanel"
import ScoringZonesPanel from "@/panels/configuring/scoring/ScoringZonesPanel"
import ZoneConfigPanel from "@/panels/configuring/scoring/ZoneConfigPanel"
import ScoreboardPanel from "@/panels/information/ScoreboardPanel"
import DriverStationPanel from "@/panels/simulation/DriverStationPanel"
import ManageAssembliesModal from '@/modals/spawning/ManageAssembliesModal.tsx';
import World from '@/systems/World.ts';
import { AddRobotsModal, AddFieldsModal, SpawningModal } from '@/modals/spawning/SpawningModals.tsx';
import ImportMirabufModal from '@/modals/mirabuf/ImportMirabufModal.tsx';

const DEFAULT_MIRA_PATH = "/api/mira/Robots/Team 2471 (2018)_v7.mira"

Expand Down
2 changes: 1 addition & 1 deletion fission/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ReactDOM from "react-dom/client"
import { Theme, ThemeProvider } from "./ThemeContext"
import { Theme, ThemeProvider } from "@/ui/ThemeContext"
import Synthesis from "./Synthesis"
import "./index.css"

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactNode, createContext, useContext, useState } from "react"
import { RgbaColor } from "react-colorful"
import { addGlobalFunc } from "./util/dom"
import { addGlobalFunc } from "@/util/dom"

export const defaultThemeName = "Default"
export type ColorName =
Expand Down
10 changes: 8 additions & 2 deletions fission/src/ToastContext.tsx → fission/src/ui/ToastContext.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import React, { createContext, useState, useContext, useCallback, ReactNode } from "react"
import Toast from "./components/Toast"
import React, {
createContext,
useState,
useContext,
useCallback,
ReactNode,
} from "react"
import Toast from "@/components/Toast"
import { AnimatePresence, motion } from "framer-motion"

export type ToastType = "info" | "warning" | "error"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { GrFormClose } from "react-icons/gr"
import { GiSteeringWheel } from "react-icons/gi"
import { HiDownload } from "react-icons/hi"
import { IoGameControllerOutline, IoPeople } from "react-icons/io5"
import { useModalControlContext } from "../ModalContext"
import { usePanelControlContext } from "../PanelContext"
import { useModalControlContext } from "@/ui/ModalContext"
import { usePanelControlContext } from "@/ui/PanelContext"
import { motion } from "framer-motion"
import logo from "../assets/autodesk_logo.png"
import { ToastType, useToastContext } from "../ToastContext"
import logo from "@/assets/autodesk_logo.png"
import { ToastType, useToastContext } from "@/ui/ToastContext"
import { Random } from "@/util/Random"
import APS, { APS_USER_INFO_UPDATE_EVENT } from "@/aps/APS"
import { UserIcon } from "./UserIcon"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactNode } from "react"
import { useModalControlContext } from "../ModalContext"
import { ClickAwayListener } from "@mui/base/ClickAwayListener"
import { useModalControlContext } from "@/ui/ModalContext"

export type ModalPropsImpl = {
modalId: string
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactNode } from "react"
import { usePanelControlContext } from "../PanelContext"
import { usePanelControlContext } from "@/ui/PanelContext"

export type OpenLocation =
| "top-left"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import "./Scene.css"
import { useEffect, useRef } from "react"
import Stats from "stats.js"
import { OrbitControls } from "three/addons/controls/OrbitControls.js"
import SceneObject from "../systems/scene/SceneObject"
import World from "@/systems/World"
import './Scene.css';
import { useEffect, useRef } from "react";
import Stats from 'stats.js';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import SceneObject from "@/systems/scene/SceneObject";
import World from '@/systems/World';

let stats: Stats | null

Expand Down Expand Up @@ -64,4 +64,4 @@ function Scene({ useStats }: SceneProps) {
)
}

export default Scene
export default Scene;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactElement, useEffect } from "react"
import { ToastData, useToastContext } from "../ToastContext"
import { ToastData, useToastContext } from "@/ui/ToastContext"
import { GrFormClose } from "react-icons/gr"
import { BsFillWrenchAdjustableCircleFill } from "react-icons/bs"
import { AiFillWarning } from "react-icons/ai"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TooltipControl, TooltipType } from "@/TooltipContext"
import { TooltipControl, TooltipType } from "@/ui/TooltipContext"
import { FaInfoCircle } from "react-icons/fa"
import Label, { LabelSize } from "./Label"
import Stack, { StackDirection } from "./Stack"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import Modal, { ModalPropsImpl } from "../components/Modal"
import Stack, { StackDirection } from "../components/Stack"
import Label, { LabelSize } from "../components/Label"
import LabeledButton, { LabelPlacement } from "../components/LabeledButton"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import Stack, { StackDirection } from "@/components/Stack"
import Label, { LabelSize } from "@/components/Label"
import LabeledButton, { LabelPlacement } from "@/components/LabeledButton"
import { HiDownload } from "react-icons/hi"

const DownloadAssetsModal: React.FC<ModalPropsImpl> = ({ modalId }) => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import Modal, { ModalPropsImpl } from "../components/Modal"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { GrFormClose } from "react-icons/gr"
import Label from "../components/Label"
import Label from "@/components/Label"

const ExitSynthesisModal: React.FC<ModalPropsImpl> = ({ modalId }) => {
const isOnMainMenu = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import Modal, { ModalPropsImpl } from "../components/Modal"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { GrFormClose } from "react-icons/gr"
import Stack, { StackDirection } from "../components/Stack"
import Label from "../components/Label"
import Stack, { StackDirection } from "@/components/Stack"
import Label from "@/components/Label"

type Entry = {
name: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import Modal, { ModalPropsImpl } from "../components/Modal"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { GrFormClose } from "react-icons/gr"
import Label from "../components/Label"
import Label from "@/components/Label"

const UpdateAvailableModal: React.FC<ModalPropsImpl> = ({ modalId }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from "react"
import Modal, { ModalPropsImpl } from "../components/Modal"
import Dropdown from "../components/Dropdown"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import Dropdown from "@/components/Dropdown"
import { FaMagnifyingGlass } from "react-icons/fa6"
import { TooltipControl, useTooltipControlContext } from "@/TooltipContext"
import { TooltipControl, useTooltipControlContext } from "@/ui/TooltipContext"

type ViewType = "Orbit" | "Freecam" | "Overview" | "Driver Station"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from "react"
import Modal, { ModalPropsImpl } from "../../components/Modal"
import Button from "../../components/Button"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import Button from "@/components/Button"
import { FaGear } from "react-icons/fa6"
import Stack, { StackDirection } from "../../components/Stack"
import Dropdown from "../../components/Dropdown"
import Label from "../../components/Label"
import Stack, { StackDirection } from "@/components/Stack"
import Dropdown from "@/components/Dropdown"
import Label from "@/components/Label"

const ConnectToMultiplayerModal: React.FC<ModalPropsImpl> = ({ modalId }) => (
<Modal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useEffect, useState } from "react"
import Modal, { ModalPropsImpl } from "../../components/Modal"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { FaPlus } from "react-icons/fa6"
import Label from "../../components/Label"
import Stack, { StackDirection } from "../../components/Stack"
import Label from "@/components/Label"
import Stack, { StackDirection } from "@/components/Stack"

type Client = {
name: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useEffect, useState } from "react"
import Modal, { ModalPropsImpl } from "../../components/Modal"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { FaGamepad } from "react-icons/fa6"
import Stack, { StackDirection } from "../../components/Stack"
import Label, { LabelSize } from "../../components/Label"
import LabeledButton, { LabelPlacement } from "../../components/LabeledButton"
import Stack, { StackDirection } from "@/components/Stack"
import Label, { LabelSize } from "@/components/Label"
import LabeledButton, { LabelPlacement } from "@/components/LabeledButton"

type ModifierState = {
alt?: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import Modal, { ModalPropsImpl } from "../../components/Modal"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { FaGear } from "react-icons/fa6"
import Button from "../../components/Button"
import Button from "@/components/Button"

const ChooseMultiplayerModeModal: React.FC<ModalPropsImpl> = ({ modalId }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import Modal, { ModalPropsImpl } from "../../components/Modal"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { FaGear } from "react-icons/fa6"
import Button from "../../components/Button"
import Button from "@/components/Button"

const ChooseSingleplayerModeModal: React.FC<ModalPropsImpl> = ({ modalId }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FaGear } from "react-icons/fa6"
import Modal, { ModalPropsImpl } from "../../components/Modal"
import Slider from "../../components/Slider"
import Label, { LabelSize } from "../../components/Label"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import Slider from "@/components/Slider"
import Label, { LabelSize } from "@/components/Label"
import { useState } from "react"

type Motor = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from "react"
import Modal, { ModalPropsImpl } from "../../components/Modal"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { FaCar } from "react-icons/fa6"
import Dropdown from "../../components/Dropdown"
import { TooltipControl, useTooltipControlContext } from "@/TooltipContext"
import Dropdown from "@/components/Dropdown"
import { TooltipControl, useTooltipControlContext } from "@/ui/TooltipContext"

type DrivetrainType = "None" | "Tank" | "Arcade" | "Swerve"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from "react"
import Modal, { ModalPropsImpl } from "../../components/Modal"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { FaGear } from "react-icons/fa6"
import Button from "../../components/Button"
import Label, { LabelSize } from "../../components/Label"
import Stack, { StackDirection } from "../../components/Stack"
import Dropdown from "../../components/Dropdown"
import Button from "@/components/Button"
import Label, { LabelSize } from "@/components/Label"
import Stack, { StackDirection } from "@/components/Stack"
import Dropdown from "@/components/Dropdown"

const PracticeSettingsModal: React.FC<ModalPropsImpl> = ({ modalId }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import Modal, { ModalPropsImpl } from "../../components/Modal"
import LabeledButton, { LabelPlacement } from "../../components/LabeledButton"
import { useModalControlContext } from "../../ModalContext"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import LabeledButton, { LabelPlacement } from "@/components/LabeledButton"
import { useModalControlContext } from "@/ui/ModalContext"
import { BsCodeSquare } from "react-icons/bs"

const RoboRIOModal: React.FC<ModalPropsImpl> = ({ modalId }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from "react"
import { useModalControlContext } from "../../ModalContext"
import Modal, { ModalPropsImpl } from "../../components/Modal"
import { useModalControlContext } from "@/ui/ModalContext"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { FaGear } from "react-icons/fa6"
import Label, { LabelSize } from "../../components/Label"
import Dropdown from "../../components/Dropdown"
import Button from "../../components/Button"
import Slider from "../../components/Slider"
import Checkbox from "../../components/Checkbox"
import Label, { LabelSize } from "@/components/Label"
import Dropdown from "@/components/Dropdown"
import Button from "@/components/Button"
import Slider from "@/components/Slider"
import Checkbox from "@/components/Checkbox"

const SettingsModal: React.FC<ModalPropsImpl> = ({ modalId }) => {
const { openModal } = useModalControlContext()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from "react"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { useModalControlContext } from "@/ModalContext"
import { useModalControlContext } from "@/ui/ModalContext"
import { FaPlus } from "react-icons/fa6"
import Label, { LabelSize } from "@/components/Label"
import Input from "@/components/Input"
Expand Down
Loading

0 comments on commit c353420

Please sign in to comment.