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