add planet interface

This commit is contained in:
Michael Zhang 2023-12-31 17:37:01 -06:00
parent f0bef1a2f3
commit a59a320c85
11 changed files with 834 additions and 48 deletions

View file

@ -23,6 +23,8 @@ use self::map::generate_map;
pub async fn generate_initial_game_state(
client: &PrismaClient,
) -> Result<GameCoreState> {
let mut counter = 0;
// Generate a seed
let mut seed = [0; 32];
{
@ -82,20 +84,20 @@ pub async fn generate_initial_game_state(
star_system.owned_by_empire_id = Some(id);
// Generate a planet to put inside the star system
let planet = client
.planet()
.create(
universe::UniqueWhereParam::IdEquals(universe.id),
star_system::UniqueWhereParam::UniverseIdIndexEquals(
universe.id,
star_system.id.0,
),
vec![],
)
.exec()
.await?;
let planet_id = PlanetId(planet.id);
let planet_state = PlanetCoreState {};
let planet_id = PlanetId(counter);
counter += 1;
let planet_state = PlanetCoreState {
buildings: json!([
{ "type": "building.capital" },
{ "type": "building.research", "level": 1 },
{ "type": "district.housing" },
{ "type": "district.industrial" },
{ "type": "district.mining" },
{ "type": "district.generator" },
{ "type": "district.farming" },
]),
};
star_system.planets.insert(planet_id, planet_state);
}

View file

@ -6,7 +6,7 @@ use prisma_client_rust::Direction;
use serde_json::Value;
use crate::{
prisma::{empire, star_system, star_system_edges},
prisma::{empire, planet, star_system, star_system_edges},
state::UniverseId,
AppState,
};
@ -65,8 +65,17 @@ pub async fn universe_map(
.await
.unwrap();
let planets = state
.prisma
.planet()
.find_many(vec![planet::universe_id::equals(universe_id)])
.exec()
.await
.unwrap();
Json(json!({
"points": points,
"edges": edges,
"planets": planets,
}))
}

View file

@ -5,7 +5,7 @@ use chrono::{DateTime, Utc};
use petgraph::graphmap::UnGraphMap;
use crate::{
prisma::{empire, star_system, star_system_edges, PrismaClient},
prisma::{empire, planet, star_system, star_system_edges, PrismaClient},
utils::format_color,
};
@ -56,6 +56,29 @@ impl GameCoreState {
.exec()
.await?;
// Save planets to database
client
.planet()
.create_many(
self
.star_systems
.iter()
.flat_map(|(star_system_id, star_system)| {
star_system.planets.iter().map(|(planet_id, planet)| {
planet::create_unchecked(
self.universe_id.0,
planet.buildings.clone(),
star_system_id.0,
vec![planet::id::set(planet_id.0)],
)
})
})
.collect(),
)
.skip_duplicates()
.exec()
.await?;
// Insert edges into database
client
.star_system_edges()

View file

@ -1,8 +1,12 @@
use serde_json::Value;
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PlanetId(pub i32);
#[derive(Debug)]
pub struct PlanetCoreState {}
pub struct PlanetCoreState {
pub buildings: Value,
}
#[derive(Debug)]
pub struct PlanetDerivedState {}

View file

@ -16,13 +16,18 @@
"@blueprintjs/core": "^5.7.2",
"@blueprintjs/icons": "^5.5.0",
"@blueprintjs/table": "^5.0.20",
"@floating-ui/react": "^0.26.4",
"@react-three/drei": "^9.92.7",
"@react-three/fiber": "^8.15.12",
"@react-three/postprocessing": "^2.15.11",
"@reduxjs/toolkit": "^2.0.1",
"@types/three": "^0.160.0",
"classnames": "^2.5.1",
"leva": "^0.9.35",
"normalize.css": "^8.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-draggable": "^4.4.6",
"react-query": "^3.39.3",
"react-redux": "^9.0.4",
"react-router-dom": "^6.21.1",

View file

@ -14,18 +14,30 @@ dependencies:
'@blueprintjs/table':
specifier: ^5.0.20
version: 5.0.20(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@floating-ui/react':
specifier: ^0.26.4
version: 0.26.4(react-dom@18.2.0)(react@18.2.0)
'@react-three/drei':
specifier: ^9.92.7
version: 9.92.7(@react-three/fiber@8.15.12)(@types/three@0.160.0)(react-dom@18.2.0)(react@18.2.0)(three@0.160.0)
'@react-three/fiber':
specifier: ^8.15.12
version: 8.15.12(react-dom@18.2.0)(react@18.2.0)(three@0.160.0)
'@react-three/postprocessing':
specifier: ^2.15.11
version: 2.15.11(@react-three/fiber@8.15.12)(@types/three@0.160.0)(react@18.2.0)(three@0.160.0)
'@reduxjs/toolkit':
specifier: ^2.0.1
version: 2.0.1(react-redux@9.0.4)(react@18.2.0)
'@types/three':
specifier: ^0.160.0
version: 0.160.0
classnames:
specifier: ^2.5.1
version: 2.5.1
leva:
specifier: ^0.9.35
version: 0.9.35(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
normalize.css:
specifier: ^8.0.1
version: 8.0.1
@ -35,6 +47,9 @@ dependencies:
react-dom:
specifier: ^18.2.0
version: 18.2.0(react@18.2.0)
react-draggable:
specifier: ^4.4.6
version: 4.4.6(react-dom@18.2.0)(react@18.2.0)
react-query:
specifier: ^3.39.3
version: 3.39.3(react-dom@18.2.0)(react@18.2.0)
@ -408,6 +423,47 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/@floating-ui/core@1.5.2:
resolution: {integrity: sha512-Ii3MrfY/GAIN3OhXNzpCKaLxHQfJF9qvwq/kEJYdqDxeIHa01K8sldugal6TmeeXl+WMvhv9cnVzUTaFFJF09A==}
dependencies:
'@floating-ui/utils': 0.1.6
dev: false
/@floating-ui/dom@1.5.3:
resolution: {integrity: sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==}
dependencies:
'@floating-ui/core': 1.5.2
'@floating-ui/utils': 0.1.6
dev: false
/@floating-ui/react-dom@2.0.4(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-CF8k2rgKeh/49UrnIBs4BdxPUV6vize/Db1d/YbCLyp9GiVZ0BEwf5AiDSxJRCr6yOkGqTFHtmrULxkEfYZ7dQ==}
peerDependencies:
react: '>=16.8.0'
react-dom: '>=16.8.0'
dependencies:
'@floating-ui/dom': 1.5.3
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/@floating-ui/react@0.26.4(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-pRiEz+SiPyfTcckAtLkEf3KJ/sUbB4X4fWMcDm27HT2kfAq+dH+hMc2VoOkNaGpDE35a2PKo688ugWeHaToL3g==}
peerDependencies:
react: '>=16.8.0'
react-dom: '>=16.8.0'
dependencies:
'@floating-ui/react-dom': 2.0.4(react-dom@18.2.0)(react@18.2.0)
'@floating-ui/utils': 0.1.6
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
tabbable: 6.2.0
dev: false
/@floating-ui/utils@0.1.6:
resolution: {integrity: sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==}
dev: false
/@humanwhocodes/config-array@0.11.13:
resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==}
engines: {node: '>=10.10.0'}
@ -457,6 +513,357 @@ packages:
resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==}
dev: false
/@radix-ui/primitive@1.0.1:
resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==}
dependencies:
'@babel/runtime': 7.23.7
dev: false
/@radix-ui/react-arrow@1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@types/react': 18.2.46
'@types/react-dom': 18.2.18
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/@radix-ui/react-compose-refs@1.0.1(@types/react@18.2.46)(react@18.2.0):
resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@types/react': 18.2.46
react: 18.2.0
dev: false
/@radix-ui/react-context@1.0.1(@types/react@18.2.46)(react@18.2.0):
resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@types/react': 18.2.46
react: 18.2.0
dev: false
/@radix-ui/react-dismissable-layer@1.0.5(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/primitive': 1.0.1
'@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-use-escape-keydown': 1.0.3(@types/react@18.2.46)(react@18.2.0)
'@types/react': 18.2.46
'@types/react-dom': 18.2.18
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/@radix-ui/react-id@1.0.1(@types/react@18.2.46)(react@18.2.0):
resolution: {integrity: sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@types/react': 18.2.46
react: 18.2.0
dev: false
/@radix-ui/react-popper@1.1.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@floating-ui/react-dom': 2.0.4(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-arrow': 1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-context': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-use-rect': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-use-size': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/rect': 1.0.1
'@types/react': 18.2.46
'@types/react-dom': 18.2.18
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/@radix-ui/react-portal@1.0.4(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@types/react': 18.2.46
'@types/react-dom': 18.2.18
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/@radix-ui/react-presence@1.0.1(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@types/react': 18.2.46
'@types/react-dom': 18.2.18
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/@radix-ui/react-primitive@1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/react-slot': 1.0.2(@types/react@18.2.46)(react@18.2.0)
'@types/react': 18.2.46
'@types/react-dom': 18.2.18
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/@radix-ui/react-slot@1.0.2(@types/react@18.2.46)(react@18.2.0):
resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@types/react': 18.2.46
react: 18.2.0
dev: false
/@radix-ui/react-tooltip@1.0.7(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-lPh5iKNFVQ/jav/j6ZrWq3blfDJ0OH9R6FlNUHPMqdLuQ9vwDgFsRxvl8b7Asuy5c8xmoojHUxKHQSOAvMHxyw==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/primitive': 1.0.1
'@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-context': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-id': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-popper': 1.1.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-portal': 1.0.4(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-slot': 1.0.2(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@radix-ui/react-visually-hidden': 1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@types/react': 18.2.46
'@types/react-dom': 18.2.18
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/@radix-ui/react-use-callback-ref@1.0.1(@types/react@18.2.46)(react@18.2.0):
resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@types/react': 18.2.46
react: 18.2.0
dev: false
/@radix-ui/react-use-controllable-state@1.0.1(@types/react@18.2.46)(react@18.2.0):
resolution: {integrity: sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@types/react': 18.2.46
react: 18.2.0
dev: false
/@radix-ui/react-use-escape-keydown@1.0.3(@types/react@18.2.46)(react@18.2.0):
resolution: {integrity: sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@types/react': 18.2.46
react: 18.2.0
dev: false
/@radix-ui/react-use-layout-effect@1.0.1(@types/react@18.2.46)(react@18.2.0):
resolution: {integrity: sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@types/react': 18.2.46
react: 18.2.0
dev: false
/@radix-ui/react-use-rect@1.0.1(@types/react@18.2.46)(react@18.2.0):
resolution: {integrity: sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/rect': 1.0.1
'@types/react': 18.2.46
react: 18.2.0
dev: false
/@radix-ui/react-use-size@1.0.1(@types/react@18.2.46)(react@18.2.0):
resolution: {integrity: sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g==}
peerDependencies:
'@types/react': '*'
react: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.46)(react@18.2.0)
'@types/react': 18.2.46
react: 18.2.0
dev: false
/@radix-ui/react-visually-hidden@1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA==}
peerDependencies:
'@types/react': '*'
'@types/react-dom': '*'
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
peerDependenciesMeta:
'@types/react':
optional: true
'@types/react-dom':
optional: true
dependencies:
'@babel/runtime': 7.23.7
'@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@types/react': 18.2.46
'@types/react-dom': 18.2.18
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/@radix-ui/rect@1.0.1:
resolution: {integrity: sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ==}
dependencies:
'@babel/runtime': 7.23.7
dev: false
/@react-spring/animated@9.6.1(react@18.2.0):
resolution: {integrity: sha512-ls/rJBrAqiAYozjLo5EPPLLOb1LM0lNVQcXODTC1SMtS6DbuBCPaKco5svFUQFMP2dso3O+qcC4k9FsKc0KxMQ==}
peerDependencies:
@ -597,6 +1004,25 @@ packages:
zustand: 3.7.2(react@18.2.0)
dev: false
/@react-three/postprocessing@2.15.11(@react-three/fiber@8.15.12)(@types/three@0.160.0)(react@18.2.0)(three@0.160.0):
resolution: {integrity: sha512-XQJxhk/hsbzUCLagd8V4pg28iy+UMkYeFFL7BOdlSM1TgAorNzMim+Wu5zI6fbAaGMpmwk7PCbOZN5YPgD0BRQ==}
peerDependencies:
'@react-three/fiber': '>=8.0'
react: '>=18.0'
three: '>= 0.138.0'
dependencies:
'@react-three/fiber': 8.15.12(react-dom@18.2.0)(react@18.2.0)(three@0.160.0)
buffer: 6.0.3
maath: 0.6.0(@types/three@0.160.0)(three@0.160.0)
n8ao: 1.7.2(postprocessing@6.34.1)(three@0.160.0)
postprocessing: 6.34.1(three@0.160.0)
react: 18.2.0
three: 0.160.0
three-stdlib: 2.28.9(three@0.160.0)
transitivePeerDependencies:
- '@types/three'
dev: false
/@reduxjs/toolkit@2.0.1(react-redux@9.0.4)(react@18.2.0):
resolution: {integrity: sha512-fxIjrR9934cmS8YXIGd9e7s1XRsEU++aFc9DVNMFMRTM5Vtsg2DCRMj21eslGtDt43IUf9bJL3h5bwUlZleibA==}
peerDependencies:
@ -725,6 +1151,14 @@ packages:
dev: true
optional: true
/@stitches/react@1.2.8(react@18.2.0):
resolution: {integrity: sha512-9g9dWI4gsSVe8bNLlb+lMkBYsnIKCZTmvqvDG+Avnn69XfmHZKiaMrx7cgTaddq7aTPPmXiTsbFcUy0xgI4+wA==}
peerDependencies:
react: '>= 16.3.0'
dependencies:
react: 18.2.0
dev: false
/@swc/core-darwin-arm64@1.3.101:
resolution: {integrity: sha512-mNFK+uHNPRXSnfTOG34zJOeMl2waM4hF4a2NY7dkMXrPqw9CoJn4MwTXJcyMiSz1/BnNjjTCHF3Yhj0jPxmkzQ==}
engines: {node: '>=10'}
@ -867,7 +1301,6 @@ packages:
resolution: {integrity: sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==}
dependencies:
'@types/react': 18.2.46
dev: true
/@types/react-reconciler@0.26.7:
resolution: {integrity: sha512-mBDYl8x+oyPX/VBb3E638N0B7xG+SPk/EAMcVPeexqus/5aTpTphQi0curhhshOqRrc9t6OPoJfEUkbymse/lQ==}
@ -1128,6 +1561,16 @@ packages:
engines: {node: '>=8'}
dev: true
/assign-symbols@1.0.0:
resolution: {integrity: sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==}
engines: {node: '>=0.10.0'}
dev: false
/attr-accept@2.2.2:
resolution: {integrity: sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg==}
engines: {node: '>=4'}
dev: false
/balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
@ -1262,6 +1705,11 @@ packages:
resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==}
dev: false
/clsx@1.2.1:
resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==}
engines: {node: '>=6'}
dev: false
/color-convert@2.0.1:
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
engines: {node: '>=7.0.0'}
@ -1273,6 +1721,10 @@ packages:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
dev: true
/colord@2.9.3:
resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==}
dev: false
/concat-map@0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
@ -1323,6 +1775,11 @@ packages:
resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
dev: true
/dequal@2.0.3:
resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
engines: {node: '>=6'}
dev: false
/detect-gpu@5.0.37:
resolution: {integrity: sha512-EraWs84faI4iskB4qvE39bevMIazEvd1RpoyGLOBesRLbiz6eMeJqqRPHjEFClfRByYZzi9IzU35rBXIO76oDw==}
dependencies:
@ -1511,6 +1968,21 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/extend-shallow@2.0.1:
resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==}
engines: {node: '>=0.10.0'}
dependencies:
is-extendable: 0.1.1
dev: false
/extend-shallow@3.0.2:
resolution: {integrity: sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==}
engines: {node: '>=0.10.0'}
dependencies:
assign-symbols: 1.0.0
is-extendable: 1.0.1
dev: false
/fast-deep-equal@3.1.3:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
dev: true
@ -1551,6 +2023,13 @@ packages:
flat-cache: 3.2.0
dev: true
/file-selector@0.5.0:
resolution: {integrity: sha512-s8KNnmIDTBoD0p9uJ9uD0XY38SCeBOtj0UMXyQSLg1Ypfrfj8+dAvwsLjYQkQ2GjhVtp2HrnF5cJzMhBjfD8HA==}
engines: {node: '>= 10'}
dependencies:
tslib: 2.6.2
dev: false
/fill-range@7.0.1:
resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
engines: {node: '>=8'}
@ -1579,6 +2058,11 @@ packages:
resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==}
dev: true
/for-in@1.0.2:
resolution: {integrity: sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==}
engines: {node: '>=0.10.0'}
dev: false
/fs.realpath@1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
@ -1590,6 +2074,11 @@ packages:
dev: true
optional: true
/get-value@2.0.6:
resolution: {integrity: sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==}
engines: {node: '>=0.10.0'}
dev: false
/glob-parent@5.1.2:
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
engines: {node: '>= 6'}
@ -1699,6 +2188,18 @@ packages:
binary-extensions: 2.2.0
dev: true
/is-extendable@0.1.1:
resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==}
engines: {node: '>=0.10.0'}
dev: false
/is-extendable@1.0.1:
resolution: {integrity: sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==}
engines: {node: '>=0.10.0'}
dependencies:
is-plain-object: 2.0.4
dev: false
/is-extglob@2.1.1:
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
engines: {node: '>=0.10.0'}
@ -1721,9 +2222,21 @@ packages:
engines: {node: '>=8'}
dev: true
/is-plain-object@2.0.4:
resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==}
engines: {node: '>=0.10.0'}
dependencies:
isobject: 3.0.1
dev: false
/isexe@2.0.0:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
/isobject@3.0.1:
resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==}
engines: {node: '>=0.10.0'}
dev: false
/its-fine@1.1.1(react@18.2.0):
resolution: {integrity: sha512-v1Ia1xl20KbuSGlwoaGsW0oxsw8Be+TrXweidxD9oT/1lAh6O3K3/GIM95Tt6WCiv6W+h2M7RB1TwdoAjQyyKw==}
peerDependencies:
@ -1766,6 +2279,30 @@ packages:
json-buffer: 3.0.1
dev: true
/leva@0.9.35(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-sp/ZbHGrrzM+eq+wIAc9X7C5qFagNERYkwaulKI/xy0XrDPV67jLUSSqTCFSoSc0Uk96j3oephYoO/6I8mZNuw==}
peerDependencies:
react: '>=16.8.0'
react-dom: '>=16.8.0'
dependencies:
'@radix-ui/react-portal': 1.0.4(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-tooltip': 1.0.7(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@stitches/react': 1.2.8(react@18.2.0)
'@use-gesture/react': 10.3.0(react@18.2.0)
colord: 2.9.3
dequal: 2.0.3
merge-value: 1.0.0
react: 18.2.0
react-colorful: 5.6.1(react-dom@18.2.0)(react@18.2.0)
react-dom: 18.2.0(react@18.2.0)
react-dropzone: 12.1.0(react@18.2.0)
v8n: 1.5.1
zustand: 3.7.2(react@18.2.0)
transitivePeerDependencies:
- '@types/react'
- '@types/react-dom'
dev: false
/levn@0.4.1:
resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
engines: {node: '>= 0.8.0'}
@ -1827,6 +2364,16 @@ packages:
three: 0.160.0
dev: false
/maath@0.6.0(@types/three@0.160.0)(three@0.160.0):
resolution: {integrity: sha512-dSb2xQuP7vDnaYqfoKzlApeRcR2xtN8/f7WV/TMAkBC8552TwTLtOO0JTcSygkYMjNDPoo6V01jTw/aPi4JrMw==}
peerDependencies:
'@types/three': '>=0.144.0'
three: '>=0.144.0'
dependencies:
'@types/three': 0.160.0
three: 0.160.0
dev: false
/match-sorter@6.3.1:
resolution: {integrity: sha512-mxybbo3pPNuA+ZuCUhm5bwNkXrJTbsk5VWbR5wiwz/GC6LIiegBGn2w3O08UG/jdbYLinw51fSQ5xNU1U3MgBw==}
dependencies:
@ -1834,6 +2381,16 @@ packages:
remove-accents: 0.4.2
dev: false
/merge-value@1.0.0:
resolution: {integrity: sha512-fJMmvat4NeKz63Uv9iHWcPDjCWcCkoiRoajRTEO8hlhUC6rwaHg0QCF9hBOTjZmm4JuglPckPSTtcuJL5kp0TQ==}
engines: {node: '>=0.10.0'}
dependencies:
get-value: 2.0.6
is-extendable: 1.0.1
mixin-deep: 1.3.2
set-value: 2.0.1
dev: false
/merge2@1.4.1:
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
engines: {node: '>= 8'}
@ -1875,10 +2432,28 @@ packages:
brace-expansion: 2.0.1
dev: true
/mixin-deep@1.3.2:
resolution: {integrity: sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==}
engines: {node: '>=0.10.0'}
dependencies:
for-in: 1.0.2
is-extendable: 1.0.1
dev: false
/ms@2.1.2:
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
dev: true
/n8ao@1.7.2(postprocessing@6.34.1)(three@0.160.0):
resolution: {integrity: sha512-S+su++t4/2hw22tdRKdxLND3mT7ZA3xyH1HkhJpTseepCIaoVS8kE/9PPP9PMkXI/ny9WsfVC9x5m86kvxNvsA==}
peerDependencies:
postprocessing: '>=6.30.0'
three: '>=0.137'
dependencies:
postprocessing: 6.34.1(three@0.160.0)
three: 0.160.0
dev: false
/nano-time@1.0.0:
resolution: {integrity: sha512-flnngywOoQ0lLQOTRNexn2gGSNuM9bKj9RZAWSzhQ+UJYaAFG9bac4DW9VHjUAzrOaIcajHybCTHe/bkvozQqA==}
dependencies:
@ -2015,6 +2590,15 @@ packages:
source-map-js: 1.0.2
dev: true
/postprocessing@6.34.1(three@0.160.0):
resolution: {integrity: sha512-xae6A2XNs61V3ohGHR+i9sQDvB4dWaoG/AICw0hg8sOYQWAYDlf+esWMRmO4hixMaYo3AJBJ9WAA7JF7OiGakw==}
engines: {node: '>= 0.13.2'}
peerDependencies:
three: '>= 0.138.0 < 0.161.0'
dependencies:
three: 0.160.0
dev: false
/potpack@1.0.2:
resolution: {integrity: sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==}
dev: false
@ -2041,6 +2625,16 @@ packages:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
dev: true
/react-colorful@5.6.1(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-1exovf0uGTGyq5mXQT0zgQ80uvj2PCwvF8zY1RN9/vbJVSjSo3fsB/4L3ObbF7u70NduSiK4xu4Y6q1MHoUGEw==}
peerDependencies:
react: '>=16.8.0'
react-dom: '>=16.8.0'
dependencies:
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/react-composer@5.0.3(react@18.2.0):
resolution: {integrity: sha512-1uWd07EME6XZvMfapwZmc7NgCZqDemcvicRi3wMJzXsQLvZ3L7fTHVyPy1bZdnWXM4iPjYuNE+uJ41MLKeTtnA==}
peerDependencies:
@ -2060,6 +2654,30 @@ packages:
scheduler: 0.23.0
dev: false
/react-draggable@4.4.6(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-LtY5Xw1zTPqHkVmtM3X8MUOxNDOUhv/khTgBgrUvwaS064bwVvxT+q5El0uUFNx5IEPKXuRejr7UqLwBIg5pdw==}
peerDependencies:
react: '>= 16.3.0'
react-dom: '>= 16.3.0'
dependencies:
clsx: 1.2.1
prop-types: 15.8.1
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/react-dropzone@12.1.0(react@18.2.0):
resolution: {integrity: sha512-iBYHA1rbopIvtzokEX4QubO6qk5IF/x3BtKGu74rF2JkQDXnwC4uO/lHKpaw4PJIV6iIAYOlwLv2FpiGyqHNog==}
engines: {node: '>= 10.13'}
peerDependencies:
react: '>= 16.8'
dependencies:
attr-accept: 2.2.2
file-selector: 0.5.0
prop-types: 15.8.1
react: 18.2.0
dev: false
/react-fast-compare@3.2.2:
resolution: {integrity: sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==}
dev: false
@ -2320,6 +2938,16 @@ packages:
upper-case-first: 2.0.2
dev: false
/set-value@2.0.1:
resolution: {integrity: sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==}
engines: {node: '>=0.10.0'}
dependencies:
extend-shallow: 2.0.1
is-extendable: 0.1.1
is-plain-object: 2.0.4
split-string: 3.1.0
dev: false
/shebang-command@2.0.0:
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
engines: {node: '>=8'}
@ -2347,6 +2975,13 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/split-string@3.1.0:
resolution: {integrity: sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==}
engines: {node: '>=0.10.0'}
dependencies:
extend-shallow: 3.0.2
dev: false
/stats-gl@2.0.1:
resolution: {integrity: sha512-EhFm1AxoSBK3MflkFawZ4jmOX1dWu0nBAtCpvGxGsondEvCpsohbpRpM8pi8UAcxG5eRsDsCiRcxdH20j3Rp9A==}
dev: false
@ -2382,6 +3017,10 @@ packages:
react: 18.2.0
dev: false
/tabbable@6.2.0:
resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==}
dev: false
/text-table@0.2.0:
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
dev: true
@ -2517,6 +3156,10 @@ packages:
hasBin: true
dev: false
/v8n@1.5.1:
resolution: {integrity: sha512-LdabyT4OffkyXFCe9UT+uMkxNBs5rcTVuZClvxQr08D5TUgo1OFKkoT65qYRCsiKBl/usHjpXvP4hHMzzDRj3A==}
dev: false
/vite@5.0.10(sass@1.69.6):
resolution: {integrity: sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==}
engines: {node: ^18.0.0 || >=20.0.0}

View file

@ -5,6 +5,10 @@ import styles from "./MapView.module.scss";
import { useParams } from "react-router-dom";
import { MapControls, Text } from "@react-three/drei";
import { ColorRepresentation, DoubleSide, TextureLoader } from "three";
import { Bloom, EffectComposer } from "@react-three/postprocessing";
import Windows from "./Windows";
import { useAppDispatch } from "../store";
import { addWindow } from "../store/someShit";
export default function MapView({}) {
const { universeId } = useParams();
@ -23,7 +27,7 @@ export default function MapView({}) {
);
if (isLoading || isEmpireLoading) return <>...</>;
console.log("data", empireData);
console.log("data", mapData);
const empireMap = new Map(
empireData.empires.map((empire) => [empire.id, empire]),
@ -33,7 +37,11 @@ export default function MapView({}) {
<main className={styles.main}>
<Canvas camera={{ position: [0, 20, 0] }}>
<ambientLight />
<MapControls />
<MapControls makeDefault />
<EffectComposer>
<Bloom />
</EffectComposer>
<mesh>
<sphereGeometry args={[100.0, 32, 32]} />
@ -41,15 +49,8 @@ export default function MapView({}) {
</mesh>
{mapData.points.map((point) => {
const x = point.coordX / 80;
const y = point.coordY / 80;
return (
<StarSystem
key={point.index}
system={point}
empires={empireMap}
position={[x, 0, y]}
/>
<StarSystem key={point.index} system={point} empires={empireMap} />
);
})}
@ -62,20 +63,22 @@ export default function MapView({}) {
/>
);
})}
{/* {empireData.empires.map((empire) => {
return <EmpireMarker empire={empire} points={mapData.points} />;
})} */}
</Canvas>
<Windows />
</main>
);
}
function StarSystem({ system, position, empires, ...props }: MeshProps) {
const dispatch = useAppDispatch();
const meshRef = useRef();
const [hovered, setHover] = useState(false);
const [active, setActive] = useState(false);
const x = system.coordX / 80;
const y = system.coordY / 80;
let color: ColorRepresentation = "skyblue";
let owner;
if (system.ownedByEmpireId !== null) {
@ -84,32 +87,40 @@ function StarSystem({ system, position, empires, ...props }: MeshProps) {
}
return (
<mesh
{...props}
position={position}
ref={meshRef}
scale={active ? 1.5 : 1}
onClick={(_event) => setActive(!active)}
onPointerOver={(_event) => setHover(true)}
onPointerOut={(_event) => setHover(false)}
>
<sphereGeometry args={[0.05]} />
<>
<mesh
{...props}
position={[x, 0, y]}
ref={meshRef}
scale={active ? 1.5 : 1}
onClick={(_event) => {
setActive(!active);
dispatch(addWindow(["planet", { type: "planet" }]));
}}
onPointerOver={(_event) => setHover(true)}
onPointerOut={(_event) => setHover(false)}
>
<sphereGeometry args={[0.05]} />
<meshStandardMaterial
color={hovered ? "white" : color}
emissive="white"
emissiveIntensity={hovered ? 2 : 0.8}
/>
</mesh>
{owner && (
<Text
color="white"
// fontSize={0.18}
fontSize={0.48}
anchorX="center"
anchorY="middle"
position={[0, 0.2, 0]}
position={[x, 0.2, y]}
>
{owner.name}
<meshStandardMaterial color={"pink"} />
</Text>
)}
<meshStandardMaterial color={hovered ? "white" : color} />
</mesh>
</>
);
}

View file

@ -0,0 +1,3 @@
.draggableHeader {
cursor: move;
}

View file

@ -0,0 +1,68 @@
import { createPlugin, Components } from "leva/plugin";
import { useControls } from "leva";
import { useAppDispatch, useAppSelector } from "../store";
import styles from "./Windows.module.scss";
import classNames from "classnames";
import Draggable from "react-draggable";
import { closeWindow } from "../store/someShit";
import { Tab, Tabs, TabsExpander } from "@blueprintjs/core";
const { Row, Label } = Components;
export default function Windows() {
const windowsRaw = useAppSelector((state) => state.someShit.windows);
const windows = Object.fromEntries(
Object.entries(windowsRaw).map(([name, windowDef]) => {
return [name, windowDef];
}),
);
return Object.entries(windows).map(([name, windowDef]) => {
return <Window key={name} name={name}></Window>;
});
}
function Window({ name }) {
const dispatch = useAppDispatch();
return (
<Draggable handle={`.${styles.draggableHeader}`}>
<div
className="bp5-dialog"
style={{ position: "absolute", bottom: "0", left: "0" }}
>
<div
className={classNames("bp5-dialog-header", styles.draggableHeader)}
>
<span className="bp5-icon-large bp5-icon-globe" />
<h5 className="bp5-heading">Planet</h5>
<button
type="button"
aria-label="Close"
className="bp5-dialog-close-button bp5-button bp5-minimal bp5-icon-cross"
onClick={() => dispatch(closeWindow(name))}
/>
</div>
<div className="bp5-dialog-body">
<Tabs vertical id="ouaic">
<input className="bp5-input" type="text" placeholder="Search..." />
<Tab title="Summary" panel={<>Helloge</>} />
<Tab title="Jobs" panel={<>Helloge</>} />
<Tab title="Armies" panel={<>Helloge</>} />
<TabsExpander />
</Tabs>
</div>
{/* <div className="bp5-dialog-footer">
<div className="bp5-dialog-footer-actions">
<button type="button" className="bp5-button">
Secondary button
</button>
<button type="submit" className="bp5-button bp5-intent-primary">
Primary button
</button>
</div>
</div> */}
</div>
</Draggable>
);
}

View file

@ -1,14 +1,20 @@
import { createSlice } from "@reduxjs/toolkit";
import type { PayloadAction } from "@reduxjs/toolkit";
type WindowDef = {
type: "planet";
};
// Define a type for the slice state
interface SomeShitState {
activeEmpireId: number | null;
windows: { [_: string]: WindowDef };
}
// Define the initial state using that type
const initialState: SomeShitState = {
activeEmpireId: null,
windows: {},
};
export const someShitSlice = createSlice({
@ -18,9 +24,19 @@ export const someShitSlice = createSlice({
changeActiveEmpire: (state, action: PayloadAction<number>) => {
state.activeEmpireId = action.payload;
},
addWindow: (state, action: PayloadAction<[string, WindowDef]>) => {
const [name, def] = action.payload;
state.windows = { ...state.windows, [name]: def };
},
closeWindow: (state, action: PayloadAction<string>) => {
delete state.windows[action.payload];
},
},
});
export const { changeActiveEmpire } = someShitSlice.actions;
export const { changeActiveEmpire, addWindow, closeWindow } =
someShitSlice.actions;
export default someShitSlice.reducer;

View file

@ -116,6 +116,8 @@ model Planet {
universeId Int
universe Universe @relation(fields: [universeId], references: [id])
buildings Json
surroundingStarSystemId Int
surroundingStarSystem StarSystem @relation(fields: [universeId, surroundingStarSystemId], references: [universeId, index])