mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-06 09:20:35 +01:00
fix linting errors
This commit is contained in:
1 parent
af58b4614d
commit
b8742bae66
19 files changed
+36
-39
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkit",
|
"name": "blitzkit",
|
||||||
"version": "1.30.8",
|
"version": "1.31.0",
|
||||||
"license": "BlitzKit License",
|
"license": "BlitzKit License",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Switch } from "@radix-ui/themes";
|
import { Switch } from "@radix-ui/themes";
|
||||||
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
import type { EmbedPreviewControllerProps } from "../../pages/[...chunk_default]/[...locale]/embed/[embed]/_index";
|
||||||
import { EmbedState } from "../../stores/embedState";
|
import { EmbedState } from "../../stores/embedState";
|
||||||
|
|
||||||
export function Boolean({ configKey }: EmbedPreviewControllerProps) {
|
export function Boolean({ configKey }: EmbedPreviewControllerProps) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
import type { EmbedPreviewControllerProps } from "../../pages/[...chunk_default]/[...locale]/embed/[embed]/_index";
|
||||||
import { EmbedState } from "../../stores/embedState";
|
import { EmbedState } from "../../stores/embedState";
|
||||||
import { ColorControllerRaw } from "./ColorControllerRaw";
|
import { ColorControllerRaw } from "./ColorControllerRaw";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Select } from "@radix-ui/themes";
|
import { Select } from "@radix-ui/themes";
|
||||||
import { useLocale } from "../../hooks/useLocale";
|
import { useLocale } from "../../hooks/useLocale";
|
||||||
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
import type { EmbedPreviewControllerProps } from "../../pages/[...chunk_default]/[...locale]/embed/[embed]/_index";
|
||||||
import { EmbedState } from "../../stores/embedState";
|
import { EmbedState } from "../../stores/embedState";
|
||||||
import type {
|
import type {
|
||||||
EmbedConfigItemType,
|
EmbedConfigItemType,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Slider } from "@radix-ui/themes";
|
import { Slider } from "@radix-ui/themes";
|
||||||
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
import type { EmbedPreviewControllerProps } from "../../pages/[...chunk_default]/[...locale]/embed/[embed]/_index";
|
||||||
import { EmbedState, type RadixRadius } from "../../stores/embedState";
|
import { EmbedState, type RadixRadius } from "../../stores/embedState";
|
||||||
|
|
||||||
export function Radius({ configKey }: EmbedPreviewControllerProps) {
|
export function Radius({ configKey }: EmbedPreviewControllerProps) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { FontBoldIcon, FontSizeIcon } from "@radix-ui/react-icons";
|
import { FontBoldIcon, FontSizeIcon } from "@radix-ui/react-icons";
|
||||||
import { Flex, Slider, Text } from "@radix-ui/themes";
|
import { Flex, Slider, Text } from "@radix-ui/themes";
|
||||||
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
import type { EmbedPreviewControllerProps } from "../../pages/[...chunk_default]/[...locale]/embed/[embed]/_index";
|
||||||
import { EmbedState, type RadixSizeWithout0 } from "../../stores/embedState";
|
import { EmbedState, type RadixSizeWithout0 } from "../../stores/embedState";
|
||||||
import {
|
import {
|
||||||
radixTextWeights,
|
radixTextWeights,
|
||||||
@@ -12,7 +12,9 @@ import { ColorControllerRaw } from "./ColorControllerRaw";
|
|||||||
export function RichText({ configKey }: EmbedPreviewControllerProps) {
|
export function RichText({ configKey }: EmbedPreviewControllerProps) {
|
||||||
const state = EmbedState.use(
|
const state = EmbedState.use(
|
||||||
(state) =>
|
(state) =>
|
||||||
state[configKey] as EmbedConfigItemType<EmbedItemType.RichText>["default"]
|
state[
|
||||||
|
configKey
|
||||||
|
] as EmbedConfigItemType<EmbedItemType.RichText>["default"],
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Slider } from "@radix-ui/themes";
|
import { Slider } from "@radix-ui/themes";
|
||||||
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
import type { EmbedPreviewControllerProps } from "../../pages/[...chunk_default]/[...locale]/embed/[embed]/_index";
|
||||||
import { EmbedState, type RadixSize } from "../../stores/embedState";
|
import { EmbedState, type RadixSize } from "../../stores/embedState";
|
||||||
|
|
||||||
export function Size({ configKey }: EmbedPreviewControllerProps) {
|
export function Size({ configKey }: EmbedPreviewControllerProps) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Slider } from "@radix-ui/themes";
|
import { Slider } from "@radix-ui/themes";
|
||||||
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
import type { EmbedPreviewControllerProps } from "../../pages/[...chunk_default]/[...locale]/embed/[embed]/_index";
|
||||||
import { EmbedState, type RadixSizeWithout0 } from "../../stores/embedState";
|
import { EmbedState, type RadixSizeWithout0 } from "../../stores/embedState";
|
||||||
|
|
||||||
export function SizeWithout0({ configKey }: EmbedPreviewControllerProps) {
|
export function SizeWithout0({ configKey }: EmbedPreviewControllerProps) {
|
||||||
@@ -10,7 +10,7 @@ export function SizeWithout0({ configKey }: EmbedPreviewControllerProps) {
|
|||||||
max={9}
|
max={9}
|
||||||
value={[
|
value={[
|
||||||
EmbedState.use((state) =>
|
EmbedState.use((state) =>
|
||||||
parseInt(state[configKey] as RadixSizeWithout0)
|
parseInt(state[configKey] as RadixSizeWithout0),
|
||||||
),
|
),
|
||||||
]}
|
]}
|
||||||
onValueChange={([value]) => {
|
onValueChange={([value]) => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Slider as RadixSlider } from "@radix-ui/themes";
|
import { Slider as RadixSlider } from "@radix-ui/themes";
|
||||||
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
import type { EmbedPreviewControllerProps } from "../../pages/[...chunk_default]/[...locale]/embed/[embed]/_index";
|
||||||
import { EmbedState, type RadixSize } from "../../stores/embedState";
|
import { EmbedState, type RadixSize } from "../../stores/embedState";
|
||||||
import type {
|
import type {
|
||||||
EmbedConfigItemType,
|
EmbedConfigItemType,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { TextField } from "@radix-ui/themes";
|
import { TextField } from "@radix-ui/themes";
|
||||||
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
import type { EmbedPreviewControllerProps } from "../../pages/[...chunk_default]/[...locale]/embed/[embed]/_index";
|
||||||
import { EmbedState } from "../../stores/embedState";
|
import { EmbedState } from "../../stores/embedState";
|
||||||
|
|
||||||
export function TextController({ configKey }: EmbedPreviewControllerProps) {
|
export function TextController({ configKey }: EmbedPreviewControllerProps) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { literals } from "@blitzkit/i18n/src/literals";
|
|||||||
import { EyeOpenIcon } from "@radix-ui/react-icons";
|
import { EyeOpenIcon } from "@radix-ui/react-icons";
|
||||||
import { Box, Flex, Heading, Text } from "@radix-ui/themes";
|
import { Box, Flex, Heading, Text } from "@radix-ui/themes";
|
||||||
import { awaitablePopularTanks } from "../core/awaitables/popularTanks";
|
import { awaitablePopularTanks } from "../core/awaitables/popularTanks";
|
||||||
import { awaitableTankDefinitions } from "../core/awaitables/tankDefinitions";
|
import { api } from "../core/blitzkit/api";
|
||||||
import {
|
import {
|
||||||
LocaleProvider,
|
LocaleProvider,
|
||||||
useLocale,
|
useLocale,
|
||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
import { TankCard } from "./TankCard";
|
import { TankCard } from "./TankCard";
|
||||||
|
|
||||||
const [tankDefinitions, popularTanks] = await Promise.all([
|
const [tankDefinitions, popularTanks] = await Promise.all([
|
||||||
awaitableTankDefinitions,
|
api.tankDefinitions(),
|
||||||
awaitablePopularTanks,
|
awaitablePopularTanks,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { asset } from '@blitzkit/core';
|
import { GenericTankComponentButton } from "./GenericTankComponentButton";
|
||||||
import { GenericTankComponentButton } from './GenericTankComponentButton';
|
import type { TankComponentButtonProps } from "./TankComponentButton";
|
||||||
import type { TankComponentButtonProps } from './TankComponentButton';
|
|
||||||
|
|
||||||
interface ShellButtonProps extends TankComponentButtonProps {
|
interface ShellButtonProps extends TankComponentButtonProps {
|
||||||
shell: string;
|
shell: string;
|
||||||
@@ -9,7 +8,7 @@ interface ShellButtonProps extends TankComponentButtonProps {
|
|||||||
export function ShellButton({ shell, ...props }: ShellButtonProps) {
|
export function ShellButton({ shell, ...props }: ShellButtonProps) {
|
||||||
return (
|
return (
|
||||||
<GenericTankComponentButton
|
<GenericTankComponentButton
|
||||||
icon={asset(`icons/shells/${shell}.webp`)}
|
icon={`/api/icons/shells/${shell}.webp`}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-2
@@ -1,4 +1,3 @@
|
|||||||
import { asset } from "@blitzkit/core";
|
|
||||||
import { Flex, type FlexProps, Progress } from "@radix-ui/themes";
|
import { Flex, type FlexProps, Progress } from "@radix-ui/themes";
|
||||||
import { useProgress } from "@react-three/drei";
|
import { useProgress } from "@react-three/drei";
|
||||||
|
|
||||||
@@ -12,7 +11,7 @@ export function TankSandboxLoader({ id, ...props }: TankSandboxLoaderProps) {
|
|||||||
return (
|
return (
|
||||||
<Flex width="100%" height="100%" align="center" justify="center" {...props}>
|
<Flex width="100%" height="100%" align="center" justify="center" {...props}>
|
||||||
<img
|
<img
|
||||||
src={asset(`icons/tanks/big/${id}.webp`)}
|
src={`/api/tanks/${id}/icons/big.webp`}
|
||||||
style={{ height: "75%", filter: "blur(1rem)" }}
|
style={{ height: "75%", filter: "blur(1rem)" }}
|
||||||
/>
|
/>
|
||||||
<Progress
|
<Progress
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
export function isHalloween() {
|
export function isHalloween() {
|
||||||
const data = new Date();
|
const data = new Date();
|
||||||
return false;
|
|
||||||
return data.getMonth() === 9 && data.getDate() === 31;
|
return data.getMonth() === 9 && data.getDate() === 31;
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
import { TankDefinition } from '@blitzkit/core';
|
import { TankDefinition } from "@blitzkit/core";
|
||||||
import { sumBy } from 'lodash-es';
|
import { sumBy } from "lodash-es";
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from "react";
|
||||||
import { awaitableTankDefinitions } from '../core/awaitables/tankDefinitions';
|
import { api } from "../core/blitzkit/api";
|
||||||
import { Duel } from '../stores/duel';
|
import { Duel } from "../stores/duel";
|
||||||
|
|
||||||
export enum UseEccentricityMode {
|
export enum UseEccentricityMode {
|
||||||
Tier,
|
Tier,
|
||||||
Class,
|
Class,
|
||||||
}
|
}
|
||||||
|
|
||||||
const tankDefinitions = await awaitableTankDefinitions;
|
const tankDefinitions = await api.tankDefinitions();
|
||||||
|
|
||||||
export function useEccentricity(mode: UseEccentricityMode) {
|
export function useEccentricity(mode: UseEccentricityMode) {
|
||||||
const tank = Duel.use((state) => state.protagonist.tank);
|
const tank = Duel.use((state) => state.protagonist.tank);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { awaitableEquipmentDefinitions } from "../core/awaitables/equipmentDefinitions";
|
import { api } from "../core/blitzkit/api";
|
||||||
|
|
||||||
const equipmentDefinitions = await awaitableEquipmentDefinitions;
|
const equipmentDefinitions = await api.equipmentDefinitions();
|
||||||
|
|
||||||
export function useEquipmentPreset(preset: string) {
|
export function useEquipmentPreset(preset: string) {
|
||||||
return equipmentDefinitions.presets[preset];
|
return equipmentDefinitions.presets[preset];
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ async function extractModel(vfs: AbstractVFS, path: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (textures) {
|
if (textures) {
|
||||||
const { image: baseColor, hasAlpha } = await readBaseColor(
|
const baseColor = await readBaseColor(
|
||||||
`Data/3d/${dirname(path)}/${textures.baseColorMap ?? textures.albedo}`,
|
`Data/3d/${dirname(path)}/${textures.baseColorMap ?? textures.albedo}`,
|
||||||
textures.miscMap
|
textures.miscMap
|
||||||
? `Data/3d/${dirname(path)}/${textures.miscMap}`
|
? `Data/3d/${dirname(path)}/${textures.miscMap}`
|
||||||
@@ -369,7 +369,6 @@ async function extractModel(vfs: AbstractVFS, path: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function readBaseColor(path: string, occlusionPath?: string) {
|
async function readBaseColor(path: string, occlusionPath?: string) {
|
||||||
let hasAlpha = false;
|
|
||||||
const baseRaw = await readTexture(path);
|
const baseRaw = await readTexture(path);
|
||||||
const occlusionRaw = occlusionPath
|
const occlusionRaw = occlusionPath
|
||||||
? await readTexture(occlusionPath)
|
? await readTexture(occlusionPath)
|
||||||
@@ -399,7 +398,6 @@ async function readBaseColor(path: string, occlusionPath?: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const alpha = base[i * 4 + 3];
|
const alpha = base[i * 4 + 3];
|
||||||
hasAlpha ||= alpha < 255;
|
|
||||||
|
|
||||||
combined[i * 4 + 0] = Math.round(base[i * 4 + 0] * c);
|
combined[i * 4 + 0] = Math.round(base[i * 4 + 0] * c);
|
||||||
combined[i * 4 + 1] = Math.round(base[i * 4 + 1] * c);
|
combined[i * 4 + 1] = Math.round(base[i * 4 + 1] * c);
|
||||||
@@ -413,7 +411,7 @@ async function readBaseColor(path: string, occlusionPath?: string) {
|
|||||||
.webp()
|
.webp()
|
||||||
.toBuffer();
|
.toBuffer();
|
||||||
|
|
||||||
return { hasAlpha, image };
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function readRoughnessMetallic(path: string) {
|
async function readRoughnessMetallic(path: string) {
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { App } from "../../../../stores/app";
|
import { App } from "../../../../../stores/app";
|
||||||
|
|
||||||
export const AUTH_PROVIDERS = ["wargaming"] as const;
|
export const AUTH_PROVIDERS = ["wargaming"] as const;
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -1,22 +1,22 @@
|
|||||||
import { Box } from "@radix-ui/themes";
|
import { Box } from "@radix-ui/themes";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { parse } from "urlon";
|
import { parse } from "urlon";
|
||||||
import { BlitzKitTheme } from "../../../../../components/BlitzKitTheme";
|
import { BlitzKitTheme } from "../../../../../../components/BlitzKitTheme";
|
||||||
import {
|
import {
|
||||||
embedConfigurations,
|
embedConfigurations,
|
||||||
embedRenderers,
|
embedRenderers,
|
||||||
extractEmbedConfigDefaults,
|
extractEmbedConfigDefaults,
|
||||||
} from "../../../../../constants/embeds";
|
} from "../../../../../../constants/embeds";
|
||||||
import {
|
import {
|
||||||
LocaleProvider,
|
LocaleProvider,
|
||||||
type LocaleAcceptorProps,
|
type LocaleAcceptorProps,
|
||||||
} from "../../../../../hooks/useLocale";
|
} from "../../../../../../hooks/useLocale";
|
||||||
import {
|
import {
|
||||||
EmbedState,
|
EmbedState,
|
||||||
type EmbedConfig,
|
type EmbedConfig,
|
||||||
type ExtractEmbedConfigTypes,
|
type ExtractEmbedConfigTypes,
|
||||||
} from "../../../../../stores/embedState";
|
} from "../../../../../../stores/embedState";
|
||||||
import { useEmbedStateCurry } from "../../../../../stores/embedState/utilities";
|
import { useEmbedStateCurry } from "../../../../../../stores/embedState/utilities";
|
||||||
|
|
||||||
interface PageProps {
|
interface PageProps {
|
||||||
embed: keyof typeof embedConfigurations;
|
embed: keyof typeof embedConfigurations;
|
||||||
|
|||||||
Reference in new issue
Block a user