mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
fix: more imports
This commit is contained in:
1 parent
25cfb7db74
commit
4f24db0956
182 files changed
+456
-452
No files matched your search
@@ -3,7 +3,7 @@
|
||||
import { Flex, Heading, Text } from '@radix-ui/themes';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useEffect } from 'react';
|
||||
import PageWrapper from '../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import * as App from '../../../stores/app';
|
||||
|
||||
export const PROVIDERS = ['wargaming', 'patreon'];
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Flex, Heading } from '@radix-ui/themes';
|
||||
import { compareVersions } from 'compare-versions';
|
||||
import versions from '../../../../public/assets/versions.json';
|
||||
import { Link } from '../../../components/Link';
|
||||
import PageWrapper from '../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
|
||||
@@ -6,10 +6,10 @@ import {
|
||||
checkConsumableProvisionInclusivity,
|
||||
consumableDefinitions,
|
||||
equipmentDefinitions,
|
||||
permanentSkills,
|
||||
provisionDefinitions,
|
||||
skillDefinitions,
|
||||
} from '@blitzkit/core';
|
||||
import { permanentSkills } from '@blitzkit/core/src/blitz/permanentSkills';
|
||||
import { ComponentPlaceholderIcon } from '@radix-ui/react-icons';
|
||||
import { Button, Flex, Popover, Slider, Table, Text } from '@radix-ui/themes';
|
||||
import { debounce, times } from 'lodash';
|
||||
|
||||
@@ -13,7 +13,7 @@ import { PlusIcon } from '@radix-ui/react-icons';
|
||||
import { Box, Flex, Heading, IconButton, Text } from '@radix-ui/themes';
|
||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { use, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import PageWrapper from '../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { tankToCompareMember } from '../../../core/blitzkit/tankToCompareMember';
|
||||
import * as CompareEphemeral from '../../../stores/compareEphemeral';
|
||||
import { CompareTable } from './components/CompareTable';
|
||||
|
||||
@@ -15,7 +15,7 @@ import { capitalize, startCase } from 'lodash';
|
||||
import { ReactNode, useEffect, useRef, useState } from 'react';
|
||||
import { stringify } from 'urlon';
|
||||
import { CopyButton } from '../../../../components/CopyButton';
|
||||
import PageWrapper from '../../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import * as App from '../../../../stores/app';
|
||||
import * as EmbedState from '../../../../stores/embedState';
|
||||
import { EmbedConfig } from '../../../../stores/embedState';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import PageWrapper from '../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
|
||||
export default function Page() {
|
||||
export function Page() {
|
||||
return <PageWrapper></PageWrapper>;
|
||||
}
|
||||
@@ -6,11 +6,7 @@ import { usePathname } from 'next/navigation';
|
||||
import { ReactNode } from 'react';
|
||||
import { TOOLS } from '../../constants/tools';
|
||||
|
||||
interface ToolsLayoutProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export default function ToolsLayout({ children }: ToolsLayoutProps) {
|
||||
export default function Layout({ children }: { children: ReactNode }) {
|
||||
const pathname = usePathname();
|
||||
const pathSplit = pathname.split('/');
|
||||
const toolId = pathSplit.at(2);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import PageWrapper from '../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { Controls } from './components/Controls';
|
||||
import { Info } from './components/Info';
|
||||
import { TankTable } from './components/Table';
|
||||
|
||||
@@ -4,12 +4,17 @@ import {
|
||||
FIRST_MINIMAL_ARCHIVED_RATING_SEASON,
|
||||
LEAGUES,
|
||||
RatingInfo,
|
||||
RatingPlayer,
|
||||
Region,
|
||||
REGIONS,
|
||||
UNLOCALIZED_REGION_NAMES,
|
||||
Var,
|
||||
} from '@blitzkit/core';
|
||||
import { RatingPlayer } from '@blitzkit/core/src/statistics/deltaBkrlBlitzStats';
|
||||
import { fetchBlitz } from '@blitzkit/core/src/blitz/fetchBlitz';
|
||||
import { getArchivedLatestSeasonNumber } from '@blitzkit/core/src/blitz/getArchivedLatestSeasonNumber';
|
||||
import { getRatingInfo } from '@blitzkit/core/src/blitz/getRatingInfo';
|
||||
import { getArchivedRatingInfo } from '@blitzkit/core/src/blitzkit/getArchivedRatingInfo';
|
||||
import { getArchivedRatingLeaderboard } from '@blitzkit/core/src/blitzkit/getArchivedRatingLeaderboard';
|
||||
import { blackA, orangeDark } from '@radix-ui/colors';
|
||||
import { MagnifyingGlassIcon } from '@radix-ui/react-icons';
|
||||
import {
|
||||
@@ -17,6 +22,7 @@ import {
|
||||
Dialog,
|
||||
Flex,
|
||||
Select,
|
||||
Skeleton,
|
||||
Table,
|
||||
Text,
|
||||
TextField,
|
||||
@@ -25,11 +31,8 @@ import { produce } from 'immer';
|
||||
import { debounce, range } from 'lodash';
|
||||
import { ChangeEvent, useEffect, useRef, useState } from 'react';
|
||||
import { create } from 'zustand';
|
||||
import PageWrapper from '../../../components/PageWrapper';
|
||||
import { Skeleton } from '../../../components/Skeleton';
|
||||
import fetchBlitz from '../../../core/blitz/fetchBlitz';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { getClanAccountInfo } from '../../../core/blitz/getClanAccountInfo';
|
||||
import getRatingInfo from '../../../core/blitz/getRatingInfo';
|
||||
import { getRatingLeague } from '../../../core/blitz/getRatingLeague';
|
||||
import { getRatingNeighbors } from '../../../core/blitz/getRatingNeighbors';
|
||||
import { searchCurrentRatingPlayers } from '../../../core/blitz/searchCurrentRatingPlayers';
|
||||
@@ -37,9 +40,6 @@ import {
|
||||
AccountList,
|
||||
AccountListItem,
|
||||
} from '../../../core/blitz/searchPlayersAcrossRegions';
|
||||
import { getArchivedLatestSeasonNumber } from '../../../core/blitzkit/getArchivedLatestSeasonNumber';
|
||||
import getArchivedRatingInfo from '../../../core/blitzkit/getArchivedRatingInfo';
|
||||
import { getArchivedRatingLeaderboard } from '../../../core/blitzkit/getArchivedRatingLeaderboard';
|
||||
import { PageTurner } from './components/PageTurner';
|
||||
|
||||
const ROWS_PER_PAGE = Math.floor(100 / 3);
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
import {
|
||||
IndividualTankStats,
|
||||
UNLOCALIZED_REGION_NAMES_SHORT,
|
||||
blitzStarsTankAverages,
|
||||
deltaTankStats,
|
||||
idToRegion,
|
||||
tankDefinitions,
|
||||
} from '@blitzkit/core';
|
||||
import { blitzStarsTankAverages } from '@blitzkit/core/src/blitzstars/tankAverages';
|
||||
import {
|
||||
ArrowDownIcon,
|
||||
MagnifyingGlassIcon,
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
} from '@radix-ui/themes';
|
||||
import { debounce } from 'lodash';
|
||||
import { use, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import PageWrapper from '../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { TankRowHeaderCell } from '../../../components/TankRowHeaderCell';
|
||||
import {
|
||||
STAT_KEYS,
|
||||
@@ -42,9 +42,10 @@ import {
|
||||
IndividualAccountInfo,
|
||||
getAccountInfo,
|
||||
} from '../../../core/blitz/getAccountInfo';
|
||||
import getTankStats from '../../../core/blitz/getTankStats';
|
||||
import searchPlayersAcrossRegions, {
|
||||
import { getTankStats } from '../../../core/blitz/getTankStats';
|
||||
import {
|
||||
AccountListWithServer,
|
||||
searchPlayersAcrossRegions,
|
||||
} from '../../../core/blitz/searchPlayersAcrossRegions';
|
||||
import * as Session from '../../../stores/session';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import strings from '@blitzkit/core/lang/en-US.json';
|
||||
import { invalidate } from '@react-three/fiber';
|
||||
import { useEffect } from 'react';
|
||||
import { AdMidSectionResponsive } from '../../../../../components/AdMidSectionResponsive';
|
||||
import PageWrapper from '../../../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../../../components/PageWrapper';
|
||||
import { useAdExempt } from '../../../../../hooks/useAdExempt';
|
||||
import * as Duel from '../../../../../stores/duel';
|
||||
import * as TankopediaEphemeral from '../../../../../stores/tankopediaEphemeral';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Heading, Text } from '@radix-ui/themes';
|
||||
import PageWrapper from '../../../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../../../components/PageWrapper';
|
||||
import * as Duel from '../../../../../stores/duel';
|
||||
|
||||
export function HistorySection() {
|
||||
|
||||
@@ -17,7 +17,7 @@ import { applyPitchYawLimits } from '../../../../../../core/blitz/applyPitchYawL
|
||||
import { modelTransformEvent } from '../../../../../../core/blitzkit/modelTransform';
|
||||
import { Pose, poseEvent } from '../../../../../../core/blitzkit/pose';
|
||||
import { useEquipment } from '../../../../../../hooks/useEquipment';
|
||||
import useOnScreen from '../../../../../../hooks/useOnScreen';
|
||||
import { useOnScreen } from '../../../../../../hooks/useOnScreen';
|
||||
import { useTankModelDefinition } from '../../../../../../hooks/useTankModelDefinition';
|
||||
import * as Duel from '../../../../../../stores/duel';
|
||||
import * as TankopediaEphemeral from '../../../../../../stores/tankopediaEphemeral';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Separator } from '@radix-ui/themes';
|
||||
import PageWrapper from '../../../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../../../components/PageWrapper';
|
||||
|
||||
export function TankopediaSeparator() {
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { provisionDefinitions } from '@blitzkit/core';
|
||||
import { TREE_TYPE_ICONS } from '@blitzkit/core/src/blitzkit/tankDefinitions/constants';
|
||||
import { provisionDefinitions, TREE_TYPE_ICONS } from '@blitzkit/core';
|
||||
import { CaretRightIcon, UpdateIcon } from '@radix-ui/react-icons';
|
||||
import { Button, Dialog, Flex, Heading } from '@radix-ui/themes';
|
||||
import Link from 'next/link';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { reviews, Var, youtubers } from '@blitzkit/core';
|
||||
import { Box, Flex, Heading, Text } from '@radix-ui/themes';
|
||||
import { use } from 'react';
|
||||
import { Link } from '../../../../../components/Link';
|
||||
import PageWrapper from '../../../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../../../components/PageWrapper';
|
||||
import { VerifiedIcon } from '../../../../../components/VerifiedIcon';
|
||||
import * as Duel from '../../../../../stores/duel';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import strings from '@blitzkit/core/lang/en-US.json';
|
||||
import { invalidate } from '@react-three/fiber';
|
||||
import { useEffect } from 'react';
|
||||
import { AdMidSectionResponsive } from '../../../../components/AdMidSectionResponsive';
|
||||
import PageWrapper from '../../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../../components/PageWrapper';
|
||||
import { useAdExempt } from '../../../../hooks/useAdExempt';
|
||||
import * as Duel from '../../../../stores/duel';
|
||||
import * as TankopediaEphemeral from '../../../../stores/tankopediaEphemeral';
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import PageWrapper from '../../../components/PageWrapper';
|
||||
import { PageWrapper } from '../../../components/PageWrapper';
|
||||
import { TankSearch } from './components/TankSearch';
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<PageWrapper color="purple" size={1028}>
|
||||
<TankSearch />
|
||||
</PageWrapper>
|
||||
<PageWrapper color="purple" size={1028}>
|
||||
<TankSearch />
|
||||
</PageWrapper>
|
||||
);
|
||||
}
|
||||
+6
-3
@@ -1,6 +1,9 @@
|
||||
import { ShellDefinition, resolveNearPenetration } from '@blitzkit/core';
|
||||
import { isExplosive } from '@blitzkit/core/src/blitzkit/isExplosive';
|
||||
import { resolvePenetrationCoefficient } from '@blitzkit/core/src/blitzkit/resolvePenetrationCoefficient';
|
||||
import {
|
||||
ShellDefinition,
|
||||
isExplosive,
|
||||
resolveNearPenetration,
|
||||
resolvePenetrationCoefficient,
|
||||
} from '@blitzkit/core';
|
||||
import { useFrame } from '@react-three/fiber';
|
||||
import { useEffect } from 'react';
|
||||
import { MeshBasicMaterial, Object3D, ShaderMaterial, Vector2 } from 'three';
|
||||
|
||||
+5
-2
@@ -1,5 +1,8 @@
|
||||
import { ShellDefinition, resolveNearPenetration } from '@blitzkit/core';
|
||||
import { resolvePenetrationCoefficient } from '@blitzkit/core/src/blitzkit/resolvePenetrationCoefficient';
|
||||
import {
|
||||
ShellDefinition,
|
||||
resolveNearPenetration,
|
||||
resolvePenetrationCoefficient,
|
||||
} from '@blitzkit/core';
|
||||
import { useEffect } from 'react';
|
||||
import {
|
||||
AdditiveBlending,
|
||||
|
||||
+6
-3
@@ -1,6 +1,9 @@
|
||||
import { ShellDefinition, resolveNearPenetration } from '@blitzkit/core';
|
||||
import { isExplosive } from '@blitzkit/core/src/blitzkit/isExplosive';
|
||||
import { resolvePenetrationCoefficient } from '@blitzkit/core/src/blitzkit/resolvePenetrationCoefficient';
|
||||
import {
|
||||
ShellDefinition,
|
||||
isExplosive,
|
||||
resolveNearPenetration,
|
||||
resolvePenetrationCoefficient,
|
||||
} from '@blitzkit/core';
|
||||
import { useEffect } from 'react';
|
||||
import {
|
||||
AdditiveBlending,
|
||||
|
||||
+10
-7
@@ -1,6 +1,9 @@
|
||||
import { ShellType, resolveNearPenetration } from '@blitzkit/core';
|
||||
import { isExplosive } from '@blitzkit/core/src/blitzkit/isExplosive';
|
||||
import { resolvePenetrationCoefficient } from '@blitzkit/core/src/blitzkit/resolvePenetrationCoefficient';
|
||||
import {
|
||||
ShellType,
|
||||
isExplosive,
|
||||
resolveNearPenetration,
|
||||
resolvePenetrationCoefficient,
|
||||
} from '@blitzkit/core';
|
||||
import { useThree } from '@react-three/fiber';
|
||||
import { useCallback } from 'react';
|
||||
import {
|
||||
@@ -189,8 +192,8 @@ export function SpacedArmorSceneComponent({
|
||||
shell.type === ShellType.HE
|
||||
? 'blocked'
|
||||
: blocked
|
||||
? 'blocked'
|
||||
: 'penetration',
|
||||
? 'blocked'
|
||||
: 'penetration',
|
||||
variant: layer.variant,
|
||||
});
|
||||
} else {
|
||||
@@ -240,8 +243,8 @@ export function SpacedArmorSceneComponent({
|
||||
shell.type === ShellType.HE && layer.type !== ArmorType.Primary
|
||||
? 'blocked'
|
||||
: blocked
|
||||
? 'blocked'
|
||||
: 'penetration',
|
||||
? 'blocked'
|
||||
: 'penetration',
|
||||
angle,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { normalizeAngleRad } from '@blitzkit/core/src/math/normalizeAngleRad';
|
||||
import { normalizeAngleRad } from '@blitzkit/core';
|
||||
import { ThreeEvent, useThree } from '@react-three/fiber';
|
||||
import { memo, useRef } from 'react';
|
||||
import { Group, Plane, Vector2, Vector3 } from 'three';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { I_HAT, J_HAT } from '@blitzkit/core/src/math/axis';
|
||||
import { I_HAT, J_HAT } from '@blitzkit/core';
|
||||
import { MeshProps, useThree } from '@react-three/fiber';
|
||||
import { clamp } from 'lodash';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ConsumableEntry } from '@blitzkit/core/src/blitzkit/consumableDefinitions';
|
||||
import { ConsumableEntry } from '@blitzkit/core';
|
||||
import { Flex, FlexProps } from '@radix-ui/themes';
|
||||
import { ConsumableButton } from './ModuleButtons/ConsumableButton';
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { asset, Tier, TIER_ROMAN_NUMERALS } from '@blitzkit/core';
|
||||
import { permanentSkills } from '@blitzkit/core/src/blitz/permanentSkills';
|
||||
import { skillDefinitions } from '@blitzkit/core/src/blitzkit/skillDefinitions';
|
||||
import {
|
||||
asset,
|
||||
permanentSkills,
|
||||
skillDefinitions,
|
||||
Tier,
|
||||
TIER_ROMAN_NUMERALS,
|
||||
} from '@blitzkit/core';
|
||||
import { Flex } from '@radix-ui/themes';
|
||||
import { use } from 'react';
|
||||
import { GenericTankComponentButton } from './ModuleButtons/GenericTankComponentButton';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EquipmentPreset } from '@blitzkit/core/src/blitzkit/equipmentDefinitions';
|
||||
import { EquipmentPreset } from '@blitzkit/core';
|
||||
import { Flex } from '@radix-ui/themes';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { EquipmentMatrix } from '../stores/duel';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { asset } from '@blitzkit/core';
|
||||
import { consumableDefinitions } from '@blitzkit/core/src/blitzkit/consumableDefinitions';
|
||||
import { asset, consumableDefinitions } from '@blitzkit/core';
|
||||
import { ClockIcon, ReloadIcon } from '@radix-ui/react-icons';
|
||||
import { Flex, Text } from '@radix-ui/themes';
|
||||
import { use } from 'react';
|
||||
@@ -39,8 +38,8 @@ export function ConsumableButton({
|
||||
durationDelta > 0
|
||||
? 'green'
|
||||
: durationDelta < 0
|
||||
? 'tomato'
|
||||
: undefined
|
||||
? 'tomato'
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<Flex align="center" gap="1" style={{ marginBottom: -4 }}>
|
||||
@@ -56,8 +55,8 @@ export function ConsumableButton({
|
||||
cooldownDelta < 0
|
||||
? 'green'
|
||||
: cooldownDelta > 0
|
||||
? 'tomato'
|
||||
: undefined
|
||||
? 'tomato'
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<Flex align="center" gap="1">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { asset } from '@blitzkit/core';
|
||||
import { equipmentDefinitions } from '@blitzkit/core/src/blitzkit/equipmentDefinitions';
|
||||
import { asset, equipmentDefinitions } from '@blitzkit/core';
|
||||
import { use } from 'react';
|
||||
import { GenericTankComponentButton } from './GenericTankComponentButton';
|
||||
import { TankComponentButtonProps } from './TankComponentButton';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { asset } from '@blitzkit/core';
|
||||
import { provisionDefinitions } from '@blitzkit/core/src/blitzkit/provisionDefinitions';
|
||||
import { asset, provisionDefinitions } from '@blitzkit/core';
|
||||
import { use } from 'react';
|
||||
import { GenericTankComponentButton } from './GenericTankComponentButton';
|
||||
import { TankComponentButtonProps } from './TankComponentButton';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { asset } from '@blitzkit/core/src/blitzkit/asset';
|
||||
import { asset } from '@blitzkit/core';
|
||||
import { GenericTankComponentButton } from './GenericTankComponentButton';
|
||||
import { TankComponentButtonProps } from './TankComponentButton';
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
'use client';
|
||||
|
||||
import { assertSecret } from '@blitzkit/core/src/blitzkit/assertSecret';
|
||||
import { imgur, ImgurSize } from '@blitzkit/core/src/imgur/imgur';
|
||||
import { patreonLoginUrl } from '@blitzkit/core/src/patreon/patreonLoginUrl';
|
||||
import {
|
||||
assertSecret,
|
||||
imgur,
|
||||
ImgurSize,
|
||||
patreonLoginUrl,
|
||||
} from '@blitzkit/core';
|
||||
import {
|
||||
Cross1Icon,
|
||||
DiscordLogoIcon,
|
||||
|
||||
@@ -11,7 +11,7 @@ type PageWrapperProps = FlexProps & {
|
||||
padding?: RadixSize;
|
||||
};
|
||||
|
||||
export default function PageWrapper({
|
||||
export function PageWrapper({
|
||||
style,
|
||||
color,
|
||||
size = 800,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { TankDefinition } from '@blitzkit/core';
|
||||
import { tankIcon } from '@blitzkit/core/src/blitzkit/tankIcon';
|
||||
import { TankDefinition, tankIcon } from '@blitzkit/core';
|
||||
import { classIcons } from './ClassIcon';
|
||||
import { ExperimentIcon } from './ExperimentIcon';
|
||||
import { Link } from './Link';
|
||||
@@ -36,8 +35,8 @@ export function TankRowHeaderCell({ tank }: TankRowHeaderCellProps) {
|
||||
tank.treeType === 'collector'
|
||||
? 'blue'
|
||||
: tank.treeType === 'premium'
|
||||
? 'amber'
|
||||
: 'gray'
|
||||
? 'amber'
|
||||
: 'gray'
|
||||
}
|
||||
highContrast={tank.treeType === 'researchable'}
|
||||
underline="hover"
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
PitchLimits,
|
||||
YawLimits,
|
||||
} from '@blitzkit/core/src/blitzkit/modelDefinitions';
|
||||
import { normalizeAngleRad } from '@blitzkit/core/src/math/normalizeAngleRad';
|
||||
import { normalizeAngleRad, PitchLimits, YawLimits } from '@blitzkit/core';
|
||||
import { clamp } from 'lodash';
|
||||
import { degToRad } from 'three/src/math/MathUtils';
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
import { assertSecret, Region } from '@blitzkit/core';
|
||||
import { EventManager } from '@blitzkit/core/src/blitzkit/eventManager';
|
||||
import { patientFetch } from '../blitzkit/patientFetch';
|
||||
|
||||
const RETRY_ERRORS = ['REQUEST_LIMIT_EXCEEDED', 'SOURCE_NOT_AVAILABLE'];
|
||||
|
||||
export const retryAbleBlitzFetchEvent = new EventManager();
|
||||
export const blitzFetchQueueAvailableEvent = new EventManager();
|
||||
|
||||
type BlitzResponse<Data extends object> =
|
||||
| {
|
||||
status: 'error';
|
||||
error: { field: string; message: string; code: 402; value: null };
|
||||
}
|
||||
| {
|
||||
status: 'ok';
|
||||
data: Data;
|
||||
};
|
||||
|
||||
const MAX_CALLS_PER_SECOND = 10;
|
||||
|
||||
const queue: { url: string; resolve: (data: object) => void }[] = [];
|
||||
let inProgress = 0;
|
||||
|
||||
function decrement() {
|
||||
inProgress--;
|
||||
blitzFetchQueueAvailableEvent.emit(undefined);
|
||||
manageQueue();
|
||||
}
|
||||
|
||||
async function manageQueue() {
|
||||
if (queue.length > 0 && inProgress < MAX_CALLS_PER_SECOND) {
|
||||
inProgress++;
|
||||
|
||||
const timeout = setTimeout(decrement, 1000);
|
||||
const request = queue.shift()!;
|
||||
const data = (await patientFetch(request.url)
|
||||
.then((response) => response.json())
|
||||
.catch((error) => ({ status: 'error', error }))) as BlitzResponse<
|
||||
typeof request.resolve
|
||||
>;
|
||||
|
||||
if (data.status === 'ok') {
|
||||
request.resolve(data.data);
|
||||
} else {
|
||||
if (RETRY_ERRORS.includes(data.error.message)) {
|
||||
retryAbleBlitzFetchEvent.emit(undefined);
|
||||
clearTimeout(timeout);
|
||||
setTimeout(() => {
|
||||
queue.push(request);
|
||||
decrement();
|
||||
}, 1000 / MAX_CALLS_PER_SECOND);
|
||||
} else {
|
||||
clearTimeout(timeout);
|
||||
decrement();
|
||||
|
||||
throw new Error(`Wargaming response error status: "${data.status}"`, {
|
||||
cause: `Message: "${data.error.message}"\nURL: "${request.url}"`,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type FetchBlitzParams = Record<string, string | number | undefined>;
|
||||
|
||||
export default function fetchBlitz<Data extends object>(
|
||||
region: Region,
|
||||
path: string,
|
||||
params: FetchBlitzParams = {},
|
||||
) {
|
||||
return new Promise<Data>((resolve) => {
|
||||
queue.push({
|
||||
url: `https://api.wotblitz.${region}/wotb/${path}/?${Object.entries({
|
||||
application_id: assertSecret(
|
||||
process.env.NEXT_PUBLIC_WARGAMING_APPLICATION_ID,
|
||||
),
|
||||
...params,
|
||||
})
|
||||
.filter(([_, value]) => value !== undefined)
|
||||
.map(([key, value]) => `${key}=${encodeURIComponent(value!)}`)
|
||||
.join('&')}`,
|
||||
resolve(data) {
|
||||
resolve(data as Data);
|
||||
},
|
||||
});
|
||||
manageQueue();
|
||||
});
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import { BlitzStats } from '@blitzkit/core';
|
||||
import calculateWN8 from '@blitzkit/core/src/statistics/calculateWN8';
|
||||
import { BlitzStats, calculateWN8 } from '@blitzkit/core';
|
||||
|
||||
export type Stat = keyof ReturnType<typeof generateStats>;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import fetchBlitz from './fetchBlitz';
|
||||
import { fetchBlitz } from '@blitzkit/core/src/blitz/fetchBlitz';
|
||||
import { normalizeIds } from './normalizeIds';
|
||||
|
||||
interface IndividualAccountAchievements {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { BlitzStats, Region } from '@blitzkit/core';
|
||||
import fetchBlitz, { FetchBlitzParams } from './fetchBlitz';
|
||||
import {
|
||||
FetchBlitzParams,
|
||||
fetchBlitz,
|
||||
} from '@blitzkit/core/src/blitz/fetchBlitz';
|
||||
import { normalizeIds } from './normalizeIds';
|
||||
|
||||
export interface SupplementaryStats {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import fetchBlitz from './fetchBlitz';
|
||||
import { fetchBlitz } from '@blitzkit/core/src/blitz/fetchBlitz';
|
||||
import { normalizeIds } from './normalizeIds';
|
||||
|
||||
type IndividualClanAccountInfo = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import fetchBlitz from './fetchBlitz';
|
||||
import { fetchBlitz } from '@blitzkit/core/src/blitz/fetchBlitz';
|
||||
import { normalizeIds } from './normalizeIds';
|
||||
|
||||
interface IndividualClanInfo {
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { LEAGUES } from '@blitzkit/core';
|
||||
|
||||
export function getLeagueFromScore(score: number) {
|
||||
return LEAGUES.find(({ minScore }) => score >= minScore)!;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import { RatingInfo, Region } from '@blitzkit/core';
|
||||
import { context } from '../blitzkit/context';
|
||||
import { patientFetch } from '../blitzkit/patientFetch';
|
||||
import regionToRegionSubdomain from './regionToRegionSubdomain';
|
||||
|
||||
const cache: Partial<Record<Region, RatingInfo>> = {};
|
||||
|
||||
export default async function getRatingInfo(region: Region) {
|
||||
if (cache[region]) return cache[region]!;
|
||||
|
||||
const response = await patientFetch(
|
||||
context === 'website'
|
||||
? `/api/${region}/rating/current/info`
|
||||
: `https://${regionToRegionSubdomain(
|
||||
region,
|
||||
)}.wotblitz.com/en/api/rating-leaderboards/season/`,
|
||||
undefined,
|
||||
);
|
||||
const data = (await response.json()) as RatingInfo;
|
||||
|
||||
cache[region] = data;
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import { LeagueTop } from '@blitzkit/core/src/blitz/rating';
|
||||
import { RatingPlayer } from '@blitzkit/core/src/statistics/deltaBkrlBlitzStats';
|
||||
import { LeagueTop, RatingPlayer, Region } from '@blitzkit/core';
|
||||
import { context } from '../blitzkit/context';
|
||||
import { patientFetch } from '../blitzkit/patientFetch';
|
||||
import regionToRegionSubdomain from './regionToRegionSubdomain';
|
||||
import { regionToRegionSubdomain } from './regionToRegionSubdomain';
|
||||
|
||||
export async function getRatingLeague(
|
||||
region: Region,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { RatingNeighbors, Region } from '@blitzkit/core';
|
||||
import { patientFetch } from '../blitzkit/patientFetch';
|
||||
import { withCORSProxy } from '../blitzkit/withCORSProxy';
|
||||
import regionToRegionSubdomain from './regionToRegionSubdomain';
|
||||
import { regionToRegionSubdomain } from './regionToRegionSubdomain';
|
||||
|
||||
export async function getRatingNeighbors(
|
||||
region: Region,
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { Region, TanksStats } from '@blitzkit/core';
|
||||
import fetchBlitz, { FetchBlitzParams } from './fetchBlitz';
|
||||
import {
|
||||
fetchBlitz,
|
||||
FetchBlitzParams,
|
||||
} from '@blitzkit/core/src/blitz/fetchBlitz';
|
||||
|
||||
export default async function getTankStats(
|
||||
export async function getTankStats(
|
||||
region: Region,
|
||||
id: number,
|
||||
params?: FetchBlitzParams,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import getRatingInfo from './getRatingInfo';
|
||||
import { getRatingInfo } from '@blitzkit/core/src/blitz/getRatingInfo';
|
||||
|
||||
export async function isOnGoingRatingSeason() {
|
||||
const ratingInfo = await getRatingInfo('com');
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export function normalizeLeagueIcon(url: string) {
|
||||
return url.startsWith('http') ? url : `https:${url}`;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { Region, RegionSubdomain } from "@blitzkit/core";
|
||||
|
||||
export default function regionSubdomainToRegion(
|
||||
regionDomain: RegionSubdomain,
|
||||
): Region {
|
||||
return regionDomain === 'na' ? 'com' : regionDomain;
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
import { Region, RegionSubdomain } from "@blitzkit/core";
|
||||
import { Region, RegionSubdomain } from '@blitzkit/core';
|
||||
|
||||
export default function regionToRegionSubdomain(
|
||||
regionDomain: Region,
|
||||
): RegionSubdomain {
|
||||
export function regionToRegionSubdomain(regionDomain: Region): RegionSubdomain {
|
||||
return regionDomain === 'com' ? 'na' : regionDomain;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { I_HAT } from '@blitzkit/core/src/math/axis';
|
||||
import { I_HAT } from '@blitzkit/core';
|
||||
import { Vector3 } from 'three';
|
||||
|
||||
export function rotateDavaVector(vector: Vector3) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import { context } from '../blitzkit/context';
|
||||
import regionToRegionSubdomain from './regionToRegionSubdomain';
|
||||
import { regionToRegionSubdomain } from './regionToRegionSubdomain';
|
||||
|
||||
type CurrentRatingPlayerSearch = Record<
|
||||
number,
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
export const usernamePattern = /^[a-zA-Z0-9_]{3,24}$/;
|
||||
export const usernamePatternWithoutPosition = /[a-zA-Z0-9_]{3,24}/;
|
||||
@@ -1,64 +0,0 @@
|
||||
import { Region } from '@blitzkit/core';
|
||||
import fetchBlitz from '../fetchBlitz';
|
||||
import { usernamePattern } from './constants';
|
||||
|
||||
export interface AccountListItem {
|
||||
nickname: string;
|
||||
account_id: number;
|
||||
}
|
||||
export type AccountList = AccountListItem[];
|
||||
export type AccountListWithServer = (AccountListItem & {
|
||||
region: Region;
|
||||
})[];
|
||||
|
||||
export default async function searchPlayersAcrossRegions(
|
||||
search: string,
|
||||
limit = 25,
|
||||
) {
|
||||
const trimmedSearch = search.trim();
|
||||
const normalizedLimit = Math.floor(limit / 3);
|
||||
|
||||
if (usernamePattern.test(trimmedSearch)) {
|
||||
return (
|
||||
await Promise.all([
|
||||
fetchBlitz<AccountList>('com', 'account/list', {
|
||||
search,
|
||||
limit: normalizedLimit,
|
||||
}).then(
|
||||
(value) =>
|
||||
value &&
|
||||
value.map((account) => ({
|
||||
...account,
|
||||
region: 'com' as Region,
|
||||
})),
|
||||
),
|
||||
fetchBlitz<AccountList>('eu', 'account/list', {
|
||||
search,
|
||||
limit: normalizedLimit,
|
||||
}).then(
|
||||
(value) =>
|
||||
value &&
|
||||
value.map((account) => ({
|
||||
...account,
|
||||
region: 'eu' as Region,
|
||||
})),
|
||||
),
|
||||
fetchBlitz<AccountList>('asia', 'account/list', {
|
||||
search,
|
||||
limit: normalizedLimit,
|
||||
}).then(
|
||||
(value) =>
|
||||
value &&
|
||||
value.map((account) => ({
|
||||
...account,
|
||||
region: 'asia' as Region,
|
||||
})),
|
||||
),
|
||||
])
|
||||
)
|
||||
.filter(Boolean)
|
||||
.flat() as AccountListWithServer;
|
||||
} else {
|
||||
return [] as AccountListWithServer;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { I_HAT } from '@blitzkit/core/src/math/axis';
|
||||
import { I_HAT } from '@blitzkit/core';
|
||||
import { Vector3 } from 'three';
|
||||
|
||||
export function unrotateDavaVector(vector: Vector3) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { asset } from '@blitzkit/core/src/blitzkit/asset';
|
||||
import { asset } from '@blitzkit/core';
|
||||
|
||||
export interface DiscoveredIdsDefinitions {
|
||||
time: number;
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
import { assertSecret } from '@blitzkit/core';
|
||||
import getRatingInfo from '../blitz/getRatingInfo';
|
||||
|
||||
interface GitHubTrees {
|
||||
tree: { path: string; url: string }[];
|
||||
}
|
||||
|
||||
let cachedLatestArchivedSeasonNumber: number | null = null;
|
||||
|
||||
export async function getArchivedLatestSeasonNumber() {
|
||||
if (cachedLatestArchivedSeasonNumber !== null) {
|
||||
return cachedLatestArchivedSeasonNumber;
|
||||
}
|
||||
|
||||
const ratingInfo = await getRatingInfo('com');
|
||||
|
||||
if (ratingInfo.detail) {
|
||||
const regionsURL = (
|
||||
(await fetch(
|
||||
`https://api.github.com/repos/tresabhi/${assertSecret(
|
||||
process.env.NEXT_PUBLIC_ASSET_REPO,
|
||||
)}/git/trees/main`,
|
||||
).then((response) => response.json())) as GitHubTrees
|
||||
).tree.find(({ path }) => path === 'regions')!.url;
|
||||
const comURL = (
|
||||
(await fetch(regionsURL).then((response) =>
|
||||
response.json(),
|
||||
)) as GitHubTrees
|
||||
).tree.find(({ path }) => path === 'com')!.url;
|
||||
const ratingURL = (
|
||||
(await fetch(comURL).then((response) => response.json())) as {
|
||||
tree: [{ url: string }];
|
||||
}
|
||||
).tree[0].url;
|
||||
const latestSeason = Math.max(
|
||||
...(
|
||||
(await fetch(ratingURL).then((response) => response.json())) as {
|
||||
tree: { path: string }[];
|
||||
}
|
||||
).tree.map(({ path }) => Number(path)),
|
||||
);
|
||||
|
||||
cachedLatestArchivedSeasonNumber = latestSeason;
|
||||
} else {
|
||||
cachedLatestArchivedSeasonNumber = ratingInfo.current_season - 1;
|
||||
}
|
||||
|
||||
return cachedLatestArchivedSeasonNumber;
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
import { RatingInfo, Region, asset } from '@blitzkit/core';
|
||||
import { superDecompress } from '@blitzkit/core/src/blitzkit/superDecompress';
|
||||
|
||||
const cache: Record<
|
||||
Region,
|
||||
Record<
|
||||
number,
|
||||
RatingInfo & {
|
||||
detail: undefined;
|
||||
}
|
||||
>
|
||||
> = {
|
||||
com: {},
|
||||
eu: {},
|
||||
asia: {},
|
||||
};
|
||||
|
||||
export default async function getArchivedRatingInfo(
|
||||
region: Region,
|
||||
season: number,
|
||||
) {
|
||||
if (!cache[region][season]) {
|
||||
const info = await fetch(
|
||||
asset(`regions/${region}/rating/${season}/info.cdon.lz4`),
|
||||
)
|
||||
.then((response) => response.arrayBuffer())
|
||||
.then((buffer) =>
|
||||
superDecompress<RatingInfo & { detail: undefined }>(buffer),
|
||||
);
|
||||
cache[region][season] = info;
|
||||
}
|
||||
|
||||
return cache[region][season];
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
import {
|
||||
asset,
|
||||
BkrlDiscriminatedEntries,
|
||||
BkrlReadStream,
|
||||
Region,
|
||||
} from '@blitzkit/core';
|
||||
|
||||
const cache: Record<Region, Record<number, BkrlDiscriminatedEntries>> = {
|
||||
asia: {},
|
||||
eu: {},
|
||||
com: {},
|
||||
};
|
||||
|
||||
export async function getArchivedRatingLeaderboard(
|
||||
region: Region,
|
||||
season: number,
|
||||
) {
|
||||
if (!cache[region][season]) {
|
||||
const info = await fetch(
|
||||
asset(`regions/${region}/rating/${season}/latest.bkrl`),
|
||||
)
|
||||
.then((response) => response.arrayBuffer())
|
||||
.then((buffer) => new BkrlReadStream(buffer).bkrl());
|
||||
cache[region][season] = info;
|
||||
}
|
||||
|
||||
return cache[region][season];
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import {
|
||||
asset,
|
||||
BkrlDiscriminatedEntries,
|
||||
BkrlReadStream,
|
||||
Region,
|
||||
} from '@blitzkit/core';
|
||||
|
||||
const cache: Record<Region, Record<number, BkrlDiscriminatedEntries | null>> = {
|
||||
com: {},
|
||||
eu: {},
|
||||
asia: {},
|
||||
};
|
||||
|
||||
export default async function getArchivedRatingMidnightLeaderboard(
|
||||
region: Region,
|
||||
season: number,
|
||||
) {
|
||||
if (!cache[region][season]) {
|
||||
const info = await fetch(
|
||||
asset(`regions/${region}/rating/${season}/midnight.bkrl`),
|
||||
)
|
||||
.then((response) =>
|
||||
response.status === 404 ? null : response.arrayBuffer(),
|
||||
)
|
||||
.then((buffer) =>
|
||||
buffer === null ? null : new BkrlReadStream(buffer).bkrl(),
|
||||
);
|
||||
cache[region][season] = info;
|
||||
}
|
||||
|
||||
return cache[region][season];
|
||||
}
|
||||
@@ -6,7 +6,7 @@ const TIME_ZONE_MAPPINGS: Record<Region, number> = {
|
||||
asia: +7, // Central Asia Standard Time
|
||||
};
|
||||
|
||||
export default function getTimeDaysAgo(region: Region, daysAgo: number) {
|
||||
export function getTimeDaysAgo(region: Region, daysAgo: number) {
|
||||
const now = new Date();
|
||||
if (daysAgo === 0) now.getTime() / 1000;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { equipmentDefinitions } from '@blitzkit/core/src/blitzkit/equipmentDefinitions';
|
||||
import { equipmentDefinitions } from '@blitzkit/core';
|
||||
import { EquipmentMatrix } from '../../stores/duel';
|
||||
|
||||
export async function hasEquipment(
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { asset } from '@blitzkit/core/src/blitzkit/asset';
|
||||
import { fetchCdonLz4 } from '@blitzkit/core/src/blitzkit/fetchCdonLz4';
|
||||
import { asset, fetchCdonLz4 } from '@blitzkit/core';
|
||||
|
||||
export interface MapDefinitions {
|
||||
[id: number]: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EventManager } from '@blitzkit/core/src/blitzkit/eventManager';
|
||||
import { EventManager } from '@blitzkit/core';
|
||||
import { invalidate } from '@react-three/fiber';
|
||||
|
||||
export interface ModelTransformEventData {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { BKNI_COLORS, BkniPercentile } from '@blitzkit/core';
|
||||
import getBkniPercentile from '@blitzkit/core/src/statistics/getBkniPercentile';
|
||||
import { BKNI_COLORS, BkniPercentile, getBkniPercentile } from '@blitzkit/core';
|
||||
|
||||
export function parseBkni(bkni: number) {
|
||||
const bkniFraction = (bkni + 1) / 2;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EventManager } from '@blitzkit/core/src/blitzkit/eventManager';
|
||||
import { EventManager } from '@blitzkit/core';
|
||||
|
||||
export enum Pose {
|
||||
HullDown,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ModelArmor } from '@blitzkit/core/src/blitzkit/modelDefinitions';
|
||||
import { ModelArmor } from '@blitzkit/core';
|
||||
|
||||
export function resolveArmor(armor: ModelArmor, index: number) {
|
||||
const spaced = armor.spaced?.includes(index) ?? false;
|
||||
const thickness = index === -1 ? 0 : armor.thickness[index] ?? 0;
|
||||
const thickness = index === -1 ? 0 : (armor.thickness[index] ?? 0);
|
||||
|
||||
return { spaced, thickness };
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { tankIcon } from '@blitzkit/core/src/blitzkit/tankIcon';
|
||||
import { tankIcon } from '@blitzkit/core';
|
||||
import { iconPng } from './iconPng';
|
||||
|
||||
export function tankIconPng(id: number) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { TankDefinition } from '@blitzkit/core';
|
||||
import { ProvisionDefinitions } from '@blitzkit/core/src/blitzkit/provisionDefinitions';
|
||||
import { ProvisionDefinitions, TankDefinition } from '@blitzkit/core';
|
||||
import { uniqueId } from 'lodash';
|
||||
import { CompareMember } from '../../stores/compareEphemeral';
|
||||
import { tankToDuelMember } from './tankToDuelMember';
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { TankDefinition } from '@blitzkit/core';
|
||||
import { availableProvisions } from '@blitzkit/core/src/blitzkit/availableProvisions';
|
||||
import { ProvisionDefinitions } from '@blitzkit/core/src/blitzkit/provisionDefinitions';
|
||||
import {
|
||||
availableProvisions,
|
||||
ProvisionDefinitions,
|
||||
TankDefinition,
|
||||
} from '@blitzkit/core';
|
||||
import { DuelMember } from '../../stores/duel';
|
||||
import { genericDefaultEquipmentMatrix } from '../../stores/duel/constants';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { RefObject, useEffect, useRef, useState } from 'react';
|
||||
*
|
||||
* https://stackoverflow.com/a/65008608/12294756
|
||||
*/
|
||||
export default function useOnScreen(ref: RefObject<HTMLElement>) {
|
||||
export function useOnScreen(ref: RefObject<HTMLElement>) {
|
||||
const [isIntersecting, setIntersecting] = useState(false);
|
||||
const observer = useRef<IntersectionObserver>();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { createNextSafeStore } from '@blitzkit/core/src/zustand/createNextSafeStore';
|
||||
import { createNextSafeStore } from '@blitzkit/core';
|
||||
import { create } from 'zustand';
|
||||
import { DuelMember } from './duel';
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
'use client';
|
||||
|
||||
import {
|
||||
createNextSafeStore,
|
||||
EngineDefinition,
|
||||
GunDefinition,
|
||||
ProvisionDefinitions,
|
||||
ShellDefinition,
|
||||
TankDefinition,
|
||||
TrackDefinition,
|
||||
TurretDefinition,
|
||||
} from '@blitzkit/core';
|
||||
import { ProvisionDefinitions } from '@blitzkit/core/src/blitzkit/provisionDefinitions';
|
||||
import { createNextSafeStore } from '@blitzkit/core/src/zustand/createNextSafeStore';
|
||||
import { create } from 'zustand';
|
||||
import { subscribeWithSelector } from 'zustand/middleware';
|
||||
import { tankToDuelMember } from '../../core/blitzkit/tankToDuelMember';
|
||||
|
||||
@@ -9,6 +9,14 @@
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
".next/types/**/*.ts"
|
||||
]
|
||||
".next/types/**/*.ts",
|
||||
"../core/src/blitz/getRatingInfo.ts",
|
||||
"../core/src/blitz/getLeagueFromScore.ts",
|
||||
"../bot/src/core/blitz/normalizeLeagueIcon.ts",
|
||||
"../core/src/blitzkit/getArchivedLatestSeasonNumber.ts",
|
||||
"../core/src/blitzkit/getArchivedRatingInfo.ts",
|
||||
"../core/src/blitzkit/getArchivedRatingLeaderboard.ts",
|
||||
"../core/src/blitzkit/getArchivedRatingMidnightLeaderboard.ts",
|
||||
"../core/src/blitz/fetchBlitz.ts"
|
||||
, "../core/src/blitz/regionSubdomainToRegion.ts" ]
|
||||
}
|
||||
Reference in new issue
Block a user