patch da code

This commit is contained in:
tresabhi committed 2026-05-15 18:43:08 -05:00
1 parent b298874f0d
commit a00411919d
80 files changed
+131 -112

No files matched your search

+3 -3
View File
@@ -21,7 +21,7 @@ if (typeof window !== "undefined") {
throw new Error("ServerAPI is being evaluated in the browser"); throw new Error("ServerAPI is being evaluated in the browser");
} }
const globbedStrings = import.meta.glob("../../../../i18n/strings/*.json", { const globbedStrings = import.meta.glob("../../../i18n/strings/*.json", {
import: "default", import: "default",
}); });
const tankSlugPattern = /^(\/\w+)?\/tanks\/([a-z0-9-]+)\/$/; const tankSlugPattern = /^(\/\w+)?\/tanks\/([a-z0-9-]+)\/$/;
@@ -229,10 +229,10 @@ export class ServerAPI extends AbstractAPI {
@Cache(true) @Cache(true)
async strings(locale: string) { async strings(locale: string) {
const localized = (await globbedStrings[ const localized = (await globbedStrings[
`../../../../i18n/strings/${locale}.json` `../../../i18n/strings/${locale}.json`
]()) as DeepPartial<Strings>; ]()) as DeepPartial<Strings>;
const defaults = (await globbedStrings[ const defaults = (await globbedStrings[
`../../../../i18n/strings/${locales.default}.json` `../../../i18n/strings/${locales.default}.json`
]()) as Strings; ]()) as Strings;
const strings = merge({}, defaults, localized); const strings = merge({}, defaults, localized);
@@ -1,6 +1,6 @@
--- ---
import type { CollectionEntry } from "astro:content"; import type { CollectionEntry } from "astro:content";
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import ApiDescription from "./ApiDescription.astro"; import ApiDescription from "./ApiDescription.astro";
import { ApiTester } from "./ApiTester"; import { ApiTester } from "./ApiTester";
@@ -14,7 +14,7 @@ import {
type Symbol, type Symbol,
type TypeNode, type TypeNode,
} from "typescript"; } from "typescript";
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { Code } from "./Code"; import { Code } from "./Code";
import HighlightedCodeBlock from "./HighlightedCodeBlock.astro"; import HighlightedCodeBlock from "./HighlightedCodeBlock.astro";
import { Link } from "./Link"; import { Link } from "./Link";
@@ -2,10 +2,10 @@ import { literals } from "@blitzkit/i18n";
import type { Avatar } from "@protos/blitzkit/avatar"; import type { Avatar } from "@protos/blitzkit/avatar";
import { Grade } from "@protos/game/proto/legacy/blitz_static_standard_grades_enum"; import { Grade } from "@protos/game/proto/legacy/blitz_static_standard_grades_enum";
import { DownloadIcon, StarFilledIcon } from "@radix-ui/react-icons"; import { DownloadIcon, StarFilledIcon } from "@radix-ui/react-icons";
import type { Color } from "../../core/ui/color";
import { useGameStrings } from "../../hooks/useGameStrings"; import { useGameStrings } from "../../hooks/useGameStrings";
import { useStrings } from "../../hooks/useStrings"; import { useStrings } from "../../hooks/useStrings";
import type { PropsWithSkeleton } from "../../types/propsWithSkeleton"; import type { PropsWithSkeleton } from "../../types/propsWithSkeleton";
import type { Color } from "../../ui/color";
import { Badge } from "../Badge"; import { Badge } from "../Badge";
import { Button } from "../Button"; import { Button } from "../Button";
import { Dialog } from "../Dialog"; import { Dialog } from "../Dialog";
@@ -1,6 +1,6 @@
import fuzzysort from "fuzzysort"; import fuzzysort from "fuzzysort";
import { useMemo } from "react"; import { useMemo } from "react";
import { api } from "../../core/api/dynamic"; import { api } from "../../api/dynamic";
import { useAwait } from "../../hooks/useAwait"; import { useAwait } from "../../hooks/useAwait";
import { useGameStrings } from "../../hooks/useGameStrings"; import { useGameStrings } from "../../hooks/useGameStrings";
import { useLocale } from "../../hooks/useLocale"; import { useLocale } from "../../hooks/useLocale";
@@ -1,6 +1,6 @@
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import type { Color } from "../../core/ui/color"; import type { Color } from "../../ui/color";
import { LIGHT_TEXT_COLORS } from "../Button"; import { LIGHT_TEXT_COLORS } from "../Button";
import styles from "./index.module.css"; import styles from "./index.module.css";
@@ -1,6 +1,6 @@
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import type { Color } from "../../core/ui/color"; import type { Color } from "../../ui/color";
import styles from "./index.module.css"; import styles from "./index.module.css";
export interface ButtonProps extends ComponentProps<"button"> { export interface ButtonProps extends ComponentProps<"button"> {
@@ -1,6 +1,6 @@
--- ---
import { ExclamationTriangleIcon } from "@radix-ui/react-icons"; import { ExclamationTriangleIcon } from "@radix-ui/react-icons";
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { Heading } from "./Heading"; import { Heading } from "./Heading";
import { Section } from "./Section"; import { Section } from "./Section";
import { Text } from "./Text"; import { Text } from "./Text";
@@ -1,5 +1,5 @@
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import styles from "./index.module.css"; import styles from "./index.module.css";
export interface CodeProps extends ComponentProps<"code"> { export interface CodeProps extends ComponentProps<"code"> {
@@ -1,5 +1,5 @@
--- ---
import type { Color } from "../core/ui/color"; import type { Color } from "../ui/color";
interface Props { interface Props {
color: Color; color: Color;
@@ -1,6 +1,6 @@
--- ---
import * as colors from "@radix-ui/colors"; import * as colors from "@radix-ui/colors";
import type { Color } from "../core/ui/color"; import type { Color } from "../ui/color";
interface Props { interface Props {
color: Color | AlphaOnlyColor; color: Color | AlphaOnlyColor;
@@ -1,7 +1,7 @@
--- ---
import { DiscordLogoIcon, GitHubLogoIcon } from "@radix-ui/react-icons"; import { DiscordLogoIcon, GitHubLogoIcon } from "@radix-ui/react-icons";
import packageJson from "../../../../package.json"; import packageJson from "../../../../package.json";
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { BlitzKitIcon } from "../icons/BlitzKit"; import { BlitzKitIcon } from "../icons/BlitzKit";
import { Code } from "./Code"; import { Code } from "./Code";
import { Link } from "./Link"; import { Link } from "./Link";
@@ -1,4 +1,4 @@
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import { Text, type TextProps } from "../Text"; import { Text, type TextProps } from "../Text";
import "./index.css"; import "./index.css";
@@ -1,6 +1,6 @@
--- ---
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { tools } from "../core/tools/tools"; import { tools } from "../config/tools";
import { Heading } from "./Heading"; import { Heading } from "./Heading";
import { Section } from "./Section"; import { Section } from "./Section";
import ToolCard from "./ToolCard.astro"; import ToolCard from "./ToolCard.astro";
@@ -1,6 +1,6 @@
--- ---
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { tools } from "../core/tools/tools"; import { tools } from "../config/tools";
import { Heading } from "./Heading"; import { Heading } from "./Heading";
import { Section } from "./Section"; import { Section } from "./Section";
import ToolCard from "./ToolCard.astro"; import ToolCard from "./ToolCard.astro";
@@ -1,6 +1,6 @@
--- ---
import { MagnifyingGlassIcon } from "@radix-ui/react-icons"; import { MagnifyingGlassIcon } from "@radix-ui/react-icons";
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { BlitzKitIcon } from "../icons/BlitzKit"; import { BlitzKitIcon } from "../icons/BlitzKit";
import { Code } from "./Code"; import { Code } from "./Code";
import { Text } from "./Text"; import { Text } from "./Text";
@@ -1,6 +1,6 @@
--- ---
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { tools } from "../core/tools/tools"; import { tools } from "../config/tools";
import { Heading } from "./Heading"; import { Heading } from "./Heading";
import { Section } from "./Section"; import { Section } from "./Section";
import ToolCard from "./ToolCard.astro"; import ToolCard from "./ToolCard.astro";
@@ -1,6 +1,6 @@
--- ---
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { tools } from "../core/tools/tools"; import { tools } from "../config/tools";
import { Heading } from "./Heading"; import { Heading } from "./Heading";
import { HomeTanksPopular } from "./HomeTanksPopular"; import { HomeTanksPopular } from "./HomeTanksPopular";
import { Section } from "./Section"; import { Section } from "./Section";
@@ -1,4 +1,4 @@
import { api } from "../../core/api/dynamic"; import { api } from "../../api/dynamic";
import { useAwait } from "../../hooks/useAwait"; import { useAwait } from "../../hooks/useAwait";
import { import {
LocaleProvider, LocaleProvider,
@@ -1,6 +1,6 @@
--- ---
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { tools } from "../core/tools/tools"; import { tools } from "../config/tools";
import { Heading } from "./Heading"; import { Heading } from "./Heading";
import { Section } from "./Section"; import { Section } from "./Section";
import ToolCard from "./ToolCard.astro"; import ToolCard from "./ToolCard.astro";
@@ -1,4 +1,4 @@
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import { Button, type ButtonProps } from "../Button"; import { Button, type ButtonProps } from "../Button";
import styles from "./index.module.css"; import styles from "./index.module.css";
@@ -1,4 +1,4 @@
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import { Skeleton, type SkeletonProps } from "../Skeleton"; import { Skeleton, type SkeletonProps } from "../Skeleton";
import "./index.css"; import "./index.css";
@@ -1,6 +1,6 @@
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import type { Color } from "../../core/ui/color"; import type { Color } from "../../ui/color";
import styles from "./index.module.css"; import styles from "./index.module.css";
export interface LinkProps extends ComponentProps<"a"> { export interface LinkProps extends ComponentProps<"a"> {
@@ -1,6 +1,6 @@
import type { ComponentProps, FunctionComponent } from "react"; import type { ComponentProps, FunctionComponent } from "react";
import Markdown from "react-markdown"; import Markdown from "react-markdown";
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import { Code } from "../Code"; import { Code } from "../Code";
import { Text } from "../Text"; import { Text } from "../Text";
import styles from "./index.module.css"; import styles from "./index.module.css";
@@ -2,8 +2,8 @@ import { formatCompact } from "@blitzkit/core";
import type { StandardPrice } from "@protos/game/proto/legacy/blitz_static_standard_price"; import type { StandardPrice } from "@protos/game/proto/legacy/blitz_static_standard_price";
import type { StandardSinglePrice } from "@protos/game/proto/legacy/blitz_static_standard_single_price"; import type { StandardSinglePrice } from "@protos/game/proto/legacy/blitz_static_standard_single_price";
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import { classNames } from "../../core/ui/classNames";
import { useLocale } from "../../hooks/useLocale"; import { useLocale } from "../../hooks/useLocale";
import { classNames } from "../../ui/classNames";
import { Text } from "../Text"; import { Text } from "../Text";
import styles from "./index.module.css"; import styles from "./index.module.css";
@@ -1,6 +1,6 @@
import { useEffect, useRef, type ComponentProps } from "react"; import { useEffect, useRef, type ComponentProps } from "react";
import { clamp } from "three/src/math/MathUtils.js"; import { clamp } from "three/src/math/MathUtils.js";
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import styles from "./index.module.css"; import styles from "./index.module.css";
interface ScrollerProps extends ComponentProps<"div"> {} interface ScrollerProps extends ComponentProps<"div"> {}
@@ -1,6 +1,6 @@
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import { classNames } from "../../core/ui/classNames";
import type { Space } from "../../types/space"; import type { Space } from "../../types/space";
import { classNames } from "../../ui/classNames";
import styles from "./index.module.css"; import styles from "./index.module.css";
export interface SectionProps extends ComponentProps<"div"> { export interface SectionProps extends ComponentProps<"div"> {
@@ -1,5 +1,5 @@
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import styles from "./index.module.css"; import styles from "./index.module.css";
export interface SkeletonProps extends ComponentProps<"div"> {} export interface SkeletonProps extends ComponentProps<"div"> {}
@@ -1,5 +1,5 @@
import { api } from "../../core/api/dynamic"; import { api } from "../../api/dynamic";
import { clientUnmounted } from "../../core/game/unmounted"; import { clientUnmounted } from "../../game/unmounted";
import { useAwait } from "../../hooks/useAwait"; import { useAwait } from "../../hooks/useAwait";
import { useGameStrings } from "../../hooks/useGameStrings"; import { useGameStrings } from "../../hooks/useGameStrings";
import { useLocale } from "../../hooks/useLocale"; import { useLocale } from "../../hooks/useLocale";
@@ -1,6 +1,6 @@
import type { CharacteristicOutput } from "../core/tankopedia/characteristics";
import type { CharacteristicRenderConfig } from "../core/tankopedia/characteristicsOrder";
import { renderCharacteristic } from "../hooks/useCharacteristicRenderer"; import { renderCharacteristic } from "../hooks/useCharacteristicRenderer";
import type { CharacteristicOutput } from "../tankopedia/characteristics";
import type { CharacteristicRenderConfig } from "../tankopedia/characteristicsOrder";
interface Props { interface Props {
characteristic: CharacteristicOutput; characteristic: CharacteristicOutput;
@@ -4,6 +4,10 @@ import type { StandardPrice } from "@protos/game/proto/legacy/blitz_static_stand
import type { UpgradeLine } from "@protos/game/proto/legacy/blitz_static_tank_upgrade_line"; import type { UpgradeLine } from "@protos/game/proto/legacy/blitz_static_tank_upgrade_line";
import type { StageParameters } from "@protos/game/proto/legacy/blitz_static_tank_upgrade_single_stage"; import type { StageParameters } from "@protos/game/proto/legacy/blitz_static_tank_upgrade_single_stage";
import { useMemo } from "react"; import { useMemo } from "react";
import {
alternativeLines,
isAlternativeLine,
} from "../../config/alternativeLines";
import { useProtagonist } from "../../hooks/useProtagonist"; import { useProtagonist } from "../../hooks/useProtagonist";
import { useStrings } from "../../hooks/useStrings"; import { useStrings } from "../../hooks/useStrings";
import { useUpgradePreset } from "../../hooks/useUpgradePreset"; import { useUpgradePreset } from "../../hooks/useUpgradePreset";
@@ -46,9 +50,14 @@ function Line({ name, lines }: LineProps) {
const combinedLines = useMemo(() => { const combinedLines = useMemo(() => {
const names: string[] = [name]; const names: string[] = [name];
for (const key in mergeLines) { for (const originalLine in alternativeLines) {
if (mergeLines[key] === name && lines.some((line) => line.name === key)) { const alternativeLine = alternativeLines[originalLine];
names.push(key);
if (
originalLine === name &&
lines.some((line) => line.name === alternativeLine)
) {
names.push(alternativeLine);
} }
} }
@@ -57,7 +66,7 @@ function Line({ name, lines }: LineProps) {
return ( return (
<div className={styles.line}> <div className={styles.line}>
{!(name in mergeLines) && {!isAlternativeLine(name) &&
combinedLines.map((name) => ( combinedLines.map((name) => (
<LineInner key={name} name={name} lines={lines} /> <LineInner key={name} name={name} lines={lines} />
))} ))}
@@ -173,7 +182,7 @@ function LineElement({ index, lineName, stage }: LineElementProps) {
{/* {stage.display_name} */} {/* {stage.display_name} */}
<Text lowContrast size="minor" className={styles.tier}> <Text lowContrast size="minor" className={styles.tier}>
{lineName in mergeLines {isAlternativeLine(lineName)
? strings.tanks.loadout.alternative ? strings.tanks.loadout.alternative
: romanize(stage.number)} : romanize(stage.number)}
</Text> </Text>
@@ -1,6 +1,6 @@
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import type { ColorWithBW } from "../../core/ui/color"; import type { ColorWithBW } from "../../ui/color";
import styles from "./index.module.css"; import styles from "./index.module.css";
export interface TextProps extends ComponentProps<"span"> { export interface TextProps extends ComponentProps<"span"> {
@@ -7,7 +7,7 @@ import {
type ComponentProps, type ComponentProps,
type ReactNode, type ReactNode,
} from "react"; } from "react";
import { classNames } from "../../core/ui/classNames"; import { classNames } from "../../ui/classNames";
import styles from "./index.module.css"; import styles from "./index.module.css";
export interface TextFieldProps extends ComponentProps<"input"> { export interface TextFieldProps extends ComponentProps<"input"> {
@@ -1,6 +1,6 @@
--- ---
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import type { Tool } from "../core/tools/tools"; import type { Tool } from "../config/tools";
import { Heading } from "./Heading"; import { Heading } from "./Heading";
import { Text } from "./Text"; import { Text } from "./Text";
@@ -1,7 +1,7 @@
--- ---
import { CaretRightIcon } from "@radix-ui/react-icons"; import { CaretRightIcon } from "@radix-ui/react-icons";
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { type Tool } from "../core/tools/tools"; import { type Tool } from "../config/tools";
import { Button } from "./Button"; import { Button } from "./Button";
import { LinkI18n } from "./LinkI18n"; import { LinkI18n } from "./LinkI18n";
import { Text } from "./Text"; import { Text } from "./Text";
@@ -1,3 +1,13 @@
export const alternativeLines: Record<string, string> = { export const alternativeLines: Record<string, string> = {
guns: "alternative_guns", guns: "alternative_guns",
}; };
export function isAlternativeLine(line: string) {
for (const key in alternativeLines) {
if (alternativeLines[key] === line) {
return true;
}
}
return false;
}
@@ -1,9 +1,9 @@
import { useMemo, type ReactNode } from "react"; import { useMemo, type ReactNode } from "react";
import type { CharacteristicOutput } from "../core/tankopedia/characteristics"; import type { CharacteristicOutput } from "../tankopedia/characteristics";
import { import {
characteristicsOrder, characteristicsOrder,
type CharacteristicRenderConfig, type CharacteristicRenderConfig,
} from "../core/tankopedia/characteristicsOrder"; } from "../tankopedia/characteristicsOrder";
import { useGameStrings } from "./useGameStrings"; import { useGameStrings } from "./useGameStrings";
import { useStrings } from "./useStrings"; import { useStrings } from "./useStrings";
@@ -1,4 +1,4 @@
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { useAwait } from "./useAwait"; import { useAwait } from "./useAwait";
import { useLocale } from "./useLocale"; import { useLocale } from "./useLocale";
@@ -1,4 +1,4 @@
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { Tankopedia } from "../stores/tankopedia"; import { Tankopedia } from "../stores/tankopedia";
import { useAwait } from "./useAwait"; import { useAwait } from "./useAwait";
@@ -1,5 +1,5 @@
import { deburr } from "lodash-es"; import { deburr } from "lodash-es";
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { useAwait } from "./useAwait"; import { useAwait } from "./useAwait";
import { useGameStrings } from "./useGameStrings"; import { useGameStrings } from "./useGameStrings";
+1 -1
View File
@@ -1,4 +1,4 @@
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { useAwait } from "./useAwait"; import { useAwait } from "./useAwait";
import { useLocale } from "./useLocale"; import { useLocale } from "./useLocale";
@@ -1,4 +1,4 @@
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { useAwait } from "./useAwait"; import { useAwait } from "./useAwait";
export function useTierCompare() { export function useTierCompare() {
@@ -1,4 +1,4 @@
import { api } from "../core/api/dynamic"; import { api } from "../api/dynamic";
import { useAwait } from "./useAwait"; import { useAwait } from "./useAwait";
export function useUpgradePreset(name: string) { export function useUpgradePreset(name: string) {
@@ -5,7 +5,7 @@ import ColorAlias from "../components/ColorAlias.astro";
import ColorScale from "../components/ColorScale.astro"; import ColorScale from "../components/ColorScale.astro";
import Footer from "../components/Footer.astro"; import Footer from "../components/Footer.astro";
import Navbar from "../components/Navbar.astro"; import Navbar from "../components/Navbar.astro";
import type { Color } from "../core/ui/color"; import type { Color } from "../ui/color";
interface Props { interface Props {
locale: string; locale: string;
@@ -6,7 +6,7 @@ import ColorScale from "../../../components/ColorScale.astro";
import { Section } from "../../../components/Section"; import { Section } from "../../../components/Section";
import SyntaxStyles from "../../../components/SyntaxStyles.astro"; import SyntaxStyles from "../../../components/SyntaxStyles.astro";
import ToolBanner from "../../../components/ToolBanner.astro"; import ToolBanner from "../../../components/ToolBanner.astro";
import { tools } from "../../../core/tools/tools"; import { tools } from "../../../config/tools";
import BaseLayout from "../../../layouts/BaseLayout.astro"; import BaseLayout from "../../../layouts/BaseLayout.astro";
export { getStaticPaths } from "../index.astro"; export { getStaticPaths } from "../index.astro";
@@ -1,7 +1,7 @@
--- ---
import ColorScale from "../../../components/ColorScale.astro"; import ColorScale from "../../../components/ColorScale.astro";
import ToolBanner from "../../../components/ToolBanner.astro"; import ToolBanner from "../../../components/ToolBanner.astro";
import { tools } from "../../../core/tools/tools"; import { tools } from "../../../config/tools";
import BaseLayout from "../../../layouts/BaseLayout.astro"; import BaseLayout from "../../../layouts/BaseLayout.astro";
import { Page } from "./_index"; import { Page } from "./_index";
@@ -1,6 +1,6 @@
--- ---
import { Grade } from "@protos/blitz_static_standard_grades_enum"; import { Grade } from "@protos/blitz_static_standard_grades_enum";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
import BaseLayout from "../../../layouts/BaseLayout.astro"; import BaseLayout from "../../../layouts/BaseLayout.astro";
export { getStaticPaths } from "../index.astro"; export { getStaticPaths } from "../index.astro";
@@ -9,8 +9,8 @@ import HomeHero from "../../components/HomeHero.astro";
import HomePlayers from "../../components/HomePlayers.astro"; import HomePlayers from "../../components/HomePlayers.astro";
import HomeTanks from "../../components/HomeTanks.astro"; import HomeTanks from "../../components/HomeTanks.astro";
import HomeTechnical from "../../components/HomeTechnical.astro"; import HomeTechnical from "../../components/HomeTechnical.astro";
import { clientUnmounted } from "../../core/game/unmounted"; import { tools } from "../../config/tools";
import { tools } from "../../core/tools/tools"; import { clientUnmounted } from "../../game/unmounted";
import BaseLayout from "../../layouts/BaseLayout.astro"; import BaseLayout from "../../layouts/BaseLayout.astro";
export const getStaticPaths = (() => { export const getStaticPaths = (() => {
@@ -1,13 +1,13 @@
import { Fragment, useMemo } from "react"; import { Fragment, useMemo } from "react";
import { api } from "../../../../api/dynamic";
import { TankopediaLoadout } from "../../../../components/TankopediaLoadout"; import { TankopediaLoadout } from "../../../../components/TankopediaLoadout";
import { api } from "../../../../core/api/dynamic";
import { characteristicsOrder } from "../../../../core/tankopedia/characteristicsOrder";
import { computeCharacteristics } from "../../../../core/tankopedia/computeCharacteristics";
import { useAwait } from "../../../../hooks/useAwait"; import { useAwait } from "../../../../hooks/useAwait";
import { useCharacteristicRenderer } from "../../../../hooks/useCharacteristicRenderer"; import { useCharacteristicRenderer } from "../../../../hooks/useCharacteristicRenderer";
import { useGameStrings } from "../../../../hooks/useGameStrings"; import { useGameStrings } from "../../../../hooks/useGameStrings";
import { LocaleProvider } from "../../../../hooks/useLocale"; import { LocaleProvider } from "../../../../hooks/useLocale";
import { Tankopedia } from "../../../../stores/tankopedia"; import { Tankopedia } from "../../../../stores/tankopedia";
import { characteristicsOrder } from "../../../../tankopedia/characteristicsOrder";
import { computeCharacteristics } from "../../../../tankopedia/computeCharacteristics";
interface PageProps { interface PageProps {
id: string; id: string;
@@ -1,7 +1,7 @@
--- ---
import "@radix-ui/colors/violet-dark.css"; import "@radix-ui/colors/violet-dark.css";
import { api } from "../../../../core/api/dynamic"; import { api } from "../../../../api/dynamic";
import { mixStaticPaths } from "../../../../core/astro/mixStaticPaths"; import { mixStaticPaths } from "../../../../astro/mixStaticPaths";
import BaseLayout from "../../../../layouts/BaseLayout.astro"; import BaseLayout from "../../../../layouts/BaseLayout.astro";
import { getStaticPaths as _getStaticPaths } from "../index.astro"; import { getStaticPaths as _getStaticPaths } from "../index.astro";
import { Page } from "./_index"; import { Page } from "./_index";
@@ -1,10 +1,10 @@
import fuzzysort from "fuzzysort"; import fuzzysort from "fuzzysort";
import { useMemo } from "react"; import { useMemo } from "react";
import { api } from "../../../api/dynamic";
import { IncrementalLoader } from "../../../components/IncrementalLoader"; import { IncrementalLoader } from "../../../components/IncrementalLoader";
import { TankCard } from "../../../components/TankCard"; import { TankCard } from "../../../components/TankCard";
import { TankCards } from "../../../components/TankCards"; import { TankCards } from "../../../components/TankCards";
import { TankSearch } from "../../../components/TankSearch"; import { TankSearch } from "../../../components/TankSearch";
import { api } from "../../../core/api/dynamic";
import { useAwait } from "../../../hooks/useAwait"; import { useAwait } from "../../../hooks/useAwait";
import { LocaleProvider } from "../../../hooks/useLocale"; import { LocaleProvider } from "../../../hooks/useLocale";
import { useSearchableTanks } from "../../../hooks/useSearchableTanks"; import { useSearchableTanks } from "../../../hooks/useSearchableTanks";
@@ -2,7 +2,7 @@
import "@radix-ui/colors/violet-dark.css"; import "@radix-ui/colors/violet-dark.css";
import { Section } from "../../../components/Section"; import { Section } from "../../../components/Section";
import ToolBanner from "../../../components/ToolBanner.astro"; import ToolBanner from "../../../components/ToolBanner.astro";
import { tools } from "../../../core/tools/tools"; import { tools } from "../../../config/tools";
import BaseLayout from "../../../layouts/BaseLayout.astro"; import BaseLayout from "../../../layouts/BaseLayout.astro";
import { Page } from "./_index"; import { Page } from "./_index";
@@ -1,5 +1,5 @@
import type { APIContext, GetStaticPaths } from "astro"; import type { APIContext, GetStaticPaths } from "astro";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
export const getStaticPaths = (async () => { export const getStaticPaths = (async () => {
const { avatars } = await api.avatars(); const { avatars } = await api.avatars();
@@ -1,6 +1,6 @@
import type { APIContext } from "astro"; import type { APIContext } from "astro";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
import { imageProxy } from "../../../core/api/imageProxy"; import { imageProxy } from "../../../api/imageProxy";
export { getStaticPaths } from "./[id].json"; export { getStaticPaths } from "./[id].json";
@@ -1,4 +1,4 @@
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
/** /**
* Identical to `avatars/[id].json`, but returns data on all avatars at once, * Identical to `avatars/[id].json`, but returns data on all avatars at once,
@@ -1,5 +1,5 @@
import { Avatars } from "@protos/blitzkit/avatars"; import { Avatars } from "@protos/blitzkit/avatars";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
export async function GET() { export async function GET() {
const avatars = await api.avatars(); const avatars = await api.avatars();
@@ -1,4 +1,4 @@
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
/** /**
* Returns a list of all avatars ids. * Returns a list of all avatars ids.
@@ -1,5 +1,5 @@
import type { APIContext, GetStaticPaths } from "astro"; import type { APIContext, GetStaticPaths } from "astro";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
export const getStaticPaths = (async () => { export const getStaticPaths = (async () => {
const { backgrounds } = await api.backgrounds(); const { backgrounds } = await api.backgrounds();
@@ -1,6 +1,6 @@
import type { APIContext } from "astro"; import type { APIContext } from "astro";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
import { imageProxy } from "../../../core/api/imageProxy"; import { imageProxy } from "../../../api/imageProxy";
export { getStaticPaths } from "./[id].json"; export { getStaticPaths } from "./[id].json";
@@ -1,4 +1,4 @@
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
export async function GET() { export async function GET() {
const { backgrounds } = await api.backgrounds(); const { backgrounds } = await api.backgrounds();
@@ -1,4 +1,4 @@
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
export async function GET() { export async function GET() {
const { backgrounds } = await api.backgrounds(); const { backgrounds } = await api.backgrounds();
@@ -1,6 +1,6 @@
import type { GetStaticPaths } from "astro"; import type { GetStaticPaths } from "astro";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
import { imageProxy } from "../../../core/api/imageProxy"; import { imageProxy } from "../../../api/imageProxy";
export const getStaticPaths = (async () => { export const getStaticPaths = (async () => {
const group = api.metadata.group("CurrencyEntity"); const group = api.metadata.group("CurrencyEntity");
@@ -1,7 +1,7 @@
import { TankClass, TankType } from "@blitzkit/core"; import { TankClass, TankType } from "@blitzkit/core";
import { Nation } from "@protos/blitz_static_tank_component"; import { Nation } from "@protos/blitz_static_tank_component";
import type { APIContext, GetStaticPaths } from "astro"; import type { APIContext, GetStaticPaths } from "astro";
import { GunType } from "../../../core/tankopedia/characteristics"; import { GunType } from "../../../tankopedia/characteristics";
import { GET as _GET } from "./all.json"; import { GET as _GET } from "./all.json";
export const ENUMS = { export const ENUMS = {
@@ -1,6 +1,6 @@
import locales from "@blitzkit/i18n/locales.json"; import locales from "@blitzkit/i18n/locales.json";
import type { GetStaticPaths, GetStaticPathsResult } from "astro"; import type { GetStaticPaths, GetStaticPathsResult } from "astro";
import { api } from "../../../../core/api/dynamic"; import { api } from "../../../../api/dynamic";
export const getStaticPaths = (async () => { export const getStaticPaths = (async () => {
const paths: GetStaticPathsResult = []; const paths: GetStaticPathsResult = [];
@@ -1,8 +1,8 @@
import { Nation } from "@protos/game/proto/legacy/blitz_static_tank_component"; import { Nation } from "@protos/game/proto/legacy/blitz_static_tank_component";
import type { APIContext, GetStaticPaths } from "astro"; import type { APIContext, GetStaticPaths } from "astro";
import { clientUnmountedResponse } from "../../../../core/api/responses"; import { clientUnmountedResponse } from "../../../../api/responses";
import { game } from "../../../../core/game/game"; import { game } from "../../../../game/game";
import { clientUnmounted } from "../../../../core/game/unmounted"; import { clientUnmounted } from "../../../../game/unmounted";
export const getStaticPaths = (async () => { export const getStaticPaths = (async () => {
return Object.values(Nation) return Object.values(Nation)
@@ -1,6 +1,6 @@
import locales from "@blitzkit/i18n/locales.json"; import locales from "@blitzkit/i18n/locales.json";
import type { APIContext, GetStaticPaths } from "astro"; import type { APIContext, GetStaticPaths } from "astro";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
export const getStaticPaths = (() => { export const getStaticPaths = (() => {
return locales.supported.map(({ locale }) => ({ params: { locale } })); return locales.supported.map(({ locale }) => ({ params: { locale } }));
@@ -1,5 +1,5 @@
import type { APIContext, GetStaticPaths } from "astro"; import type { APIContext, GetStaticPaths } from "astro";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
export const getStaticPaths = (async () => { export const getStaticPaths = (async () => {
const { list } = await api.tankList(); const { list } = await api.tankList();
@@ -1,11 +1,11 @@
import type { APIContext } from "astro"; import type { APIContext } from "astro";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
import { import {
clientUnmountedResponse, clientUnmountedResponse,
notFoundResponse, notFoundResponse,
} from "../../../core/api/responses"; } from "../../../api/responses";
import { game } from "../../../core/game/game"; import { game } from "../../../game/game";
import { clientUnmounted } from "../../../core/game/unmounted"; import { clientUnmounted } from "../../../game/unmounted";
export { getStaticPaths } from "./[id].json"; export { getStaticPaths } from "./[id].json";
@@ -1,4 +1,4 @@
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
/** /**
* Literally all the tanks in one place lmao. * Literally all the tanks in one place lmao.
@@ -1,5 +1,5 @@
import { Tanks } from "@protos/blitzkit/tanks"; import { Tanks } from "@protos/blitzkit/tanks";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
/** /**
* Literally all the tanks in one place lmao. * Literally all the tanks in one place lmao.
@@ -1,4 +1,4 @@
import { characteristicsOrder } from "../../../core/tankopedia/characteristicsOrder"; import { characteristicsOrder } from "../../../tankopedia/characteristicsOrder";
/** /**
* The naked man fears no pickpocket. * The naked man fears no pickpocket.
@@ -1,4 +1,4 @@
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
/** /**
* List! * List!
@@ -1,5 +1,5 @@
import { TankList } from "@protos/blitzkit/tank_list"; import { TankList } from "@protos/blitzkit/tank_list";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
/** /**
* List!! * List!!
@@ -1,4 +1,4 @@
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
export async function GET() { export async function GET() {
const popular = await api.popularTanks(); const popular = await api.popularTanks();
@@ -1,5 +1,5 @@
import { PopularTanks } from "@protos/blitzkit/popular_tanks"; import { PopularTanks } from "@protos/blitzkit/popular_tanks";
import { api } from "../../../core/api/dynamic"; import { api } from "../../../api/dynamic";
export async function GET() { export async function GET() {
const popular = await api.popularTanks(); const popular = await api.popularTanks();
@@ -1,6 +1,6 @@
import { TankUpgradePricePresetComponent } from "@protos/game/proto/legacy/blitz_static_tank_upgrade_price_preset_component"; import { TankUpgradePricePresetComponent } from "@protos/game/proto/legacy/blitz_static_tank_upgrade_price_preset_component";
import type { APIContext, GetStaticPaths } from "astro"; import type { APIContext, GetStaticPaths } from "astro";
import { api } from "../../../../../core/api/dynamic"; import { api } from "../../../../../api/dynamic";
export const getStaticPaths = (async () => { export const getStaticPaths = (async () => {
return api.metadata return api.metadata
@@ -1,4 +1,4 @@
import { api } from "../../core/api/dynamic"; import { api } from "../../api/dynamic";
/** /**
* Woah! test. * Woah! test.
@@ -1,5 +1,5 @@
import { Tiers } from "@protos/blitzkit/tiers"; import { Tiers } from "@protos/blitzkit/tiers";
import { api } from "../../core/api/dynamic"; import { api } from "../../api/dynamic";
/** /**
* Woah! * Woah!
+2 -2
View File
@@ -1,7 +1,7 @@
import type { Tank } from "@protos/blitzkit/tank"; import type { Tank } from "@protos/blitzkit/tank";
import { Varuna } from "varuna"; import { Varuna } from "varuna";
import { createTankState } from "../core/tankopedia/createTankState"; import { createTankState } from "../tankopedia/createTankState";
import { type TankState } from "../core/tankopedia/tankState"; import { type TankState } from "../tankopedia/tankState";
interface Tankopedia { interface Tankopedia {
compare: TankopediaCompare; compare: TankopediaCompare;
@@ -5,7 +5,7 @@ import {
TankType, TankType,
} from "@protos/game/proto/legacy/blitz_static_tank_component"; } from "@protos/game/proto/legacy/blitz_static_tank_component";
import type { ReactNode } from "react"; import type { ReactNode } from "react";
import { VintageIcon } from "../../icons/Vintage"; import { VintageIcon } from "../icons/Vintage";
import { import {
GunType, GunType,
type CharacteristicName, type CharacteristicName,