mirror of
https://github.com/vrc-get/vrc-get.git
synced 2026-06-21 09:58:08 +00:00
lint: apply new biome rules
This commit is contained in:
parent
62d3ad81f1
commit
454dd753f3
70 changed files with 326 additions and 429 deletions
|
|
@ -1,7 +1,7 @@
|
|||
"use client"; // Error components must be Client Components
|
||||
import { useEffect } from "react";
|
||||
import { commands } from "@/lib/bindings";
|
||||
import globalInfo from "@/lib/global-info";
|
||||
import { useEffect } from "react";
|
||||
|
||||
export default function ErrorPage({
|
||||
error,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ import { LoaderCircle } from "lucide-react";
|
|||
|
||||
export default function Loading({
|
||||
loadingText = "Loading...",
|
||||
}: { loadingText?: React.ReactNode }) {
|
||||
}: {
|
||||
loadingText?: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center h-full w-full space-y-4">
|
||||
<LoaderCircle className="h-10 w-10 animate-spin" />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { createRootRoute, Outlet } from "@tanstack/react-router";
|
||||
import ErrorPage from "@/app/-error";
|
||||
import { Providers } from "@/components/providers";
|
||||
import { Outlet, createRootRoute } from "@tanstack/react-router";
|
||||
import "./globals.css";
|
||||
import React, { Suspense } from "react";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
"use client";
|
||||
|
||||
import { ScrollPageContainer } from "@/components/ScrollPageContainer";
|
||||
import { ScrollableCardTable } from "@/components/ScrollableCardTable";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { HNavBar, VStack } from "@/components/layout";
|
||||
import { ScrollableCardTable } from "@/components/ScrollableCardTable";
|
||||
import { ScrollPageContainer } from "@/components/ScrollPageContainer";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
|
|
@ -18,7 +19,6 @@ import {
|
|||
} from "@/components/ui/select";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { toastError, toastInfo, toastNormal, toastSuccess } from "@/lib/toast";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_main/dev-palette/")({
|
||||
component: Page,
|
||||
|
|
@ -177,7 +177,7 @@ function UnityTableBody() {
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{unityPaths.map(([path, version, isFromHub]) => (
|
||||
{unityPaths.map(([path, version, _isFromHub]) => (
|
||||
<tr key={path} className="even:bg-secondary/30">
|
||||
<td className={"p-2.5"}>{version}</td>
|
||||
<td className={"p-2.5"}>{path}</td>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { BugOff, CircleX, Info, OctagonAlert } from "lucide-react";
|
||||
import { memo, useEffect, useMemo, useRef } from "react";
|
||||
import { ScrollableCardTable } from "@/components/ScrollableCardTable";
|
||||
import type { LogEntry, LogLevel } from "@/lib/bindings";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { BugOff, CircleX, Info, OctagonAlert } from "lucide-react";
|
||||
import { memo, useEffect, useMemo, useRef } from "react";
|
||||
|
||||
export const LogsListCard = memo(function LogsListCard({
|
||||
logEntry,
|
||||
|
|
@ -81,11 +81,7 @@ export const LogsListCard = memo(function LogsListCard({
|
|||
);
|
||||
});
|
||||
|
||||
const LogRow = memo(function LogRow({
|
||||
log,
|
||||
}: {
|
||||
log: LogEntry;
|
||||
}) {
|
||||
const LogRow = memo(function LogRow({ log }: { log: LogEntry }) {
|
||||
const cellClass = "p-2.5";
|
||||
|
||||
const formatDate = (dateString: string) => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,16 @@
|
|||
"use client";
|
||||
|
||||
import { SearchBox } from "@/components/SearchBox";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { ArrowDownFromLine } from "lucide-react";
|
||||
import { useRef, useState } from "react";
|
||||
import { HNavBar, VStack } from "@/components/layout";
|
||||
import { SearchBox } from "@/components/SearchBox";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import {
|
||||
|
|
@ -23,15 +32,6 @@ import { tc } from "@/lib/i18n";
|
|||
import { toastThrownError } from "@/lib/toast";
|
||||
import { useTauriListen } from "@/lib/use-tauri-listen";
|
||||
import { useSessionStorage } from "@/lib/useSessionStorage";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { ArrowDownFromLine } from "lucide-react";
|
||||
import { useRef, useState } from "react";
|
||||
import { LogsListCard } from "./-logs-list-card";
|
||||
|
||||
export const Route = createFileRoute("/_main/log/")({
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { tc } from "@/lib/i18n";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import { tc } from "@/lib/i18n";
|
||||
|
||||
type PageType =
|
||||
| "/packages/user-packages"
|
||||
|
|
@ -8,11 +8,7 @@ type PageType =
|
|||
|
||||
// Note: For historical reasons, templates page are under packages in route.
|
||||
|
||||
export function HeadingPageName({
|
||||
pageType,
|
||||
}: {
|
||||
pageType: PageType;
|
||||
}) {
|
||||
export function HeadingPageName({ pageType }: { pageType: PageType }) {
|
||||
return (
|
||||
<div className={"-ml-1.5"}>
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
import { queryOptions } from "@tanstack/react-query";
|
||||
import type React from "react";
|
||||
import { useState } from "react";
|
||||
import {
|
||||
ReorderableList,
|
||||
useReorderableList,
|
||||
|
|
@ -15,41 +18,6 @@ import { type DialogApi, type DialogContext, showDialog } from "@/lib/dialog";
|
|||
import { tc, tt } from "@/lib/i18n";
|
||||
import { queryClient } from "@/lib/query-client";
|
||||
import { toastError, toastSuccess } from "@/lib/toast";
|
||||
import { queryOptions } from "@tanstack/react-query";
|
||||
import type React from "react";
|
||||
import { useState } from "react";
|
||||
|
||||
type State =
|
||||
| {
|
||||
type: "normal";
|
||||
}
|
||||
| {
|
||||
type: "enteringRepositoryInfo";
|
||||
}
|
||||
| {
|
||||
type: "loadingRepository";
|
||||
}
|
||||
| {
|
||||
type: "duplicated";
|
||||
reason: TauriDuplicatedReason;
|
||||
duplicatedName: string;
|
||||
}
|
||||
| {
|
||||
type: "confirming";
|
||||
repo: TauriRemoteRepositoryInfo;
|
||||
url: string;
|
||||
headers: { [key: string]: string };
|
||||
};
|
||||
|
||||
interface AddRepository {
|
||||
dialog: React.ReactNode;
|
||||
openAddDialog: () => void;
|
||||
inProgress: boolean;
|
||||
addRepository: (
|
||||
url: string,
|
||||
headers: { [p: string]: string },
|
||||
) => Promise<void>;
|
||||
}
|
||||
|
||||
const environmentRepositoriesInfo = queryOptions({
|
||||
queryKey: ["environmentRepositoriesInfo"],
|
||||
|
|
@ -291,11 +259,7 @@ function EnteringRepositoryInfo({
|
|||
);
|
||||
}
|
||||
|
||||
function LoadingRepository({
|
||||
cancel,
|
||||
}: {
|
||||
cancel: () => void;
|
||||
}) {
|
||||
function LoadingRepository({ cancel }: { cancel: () => void }) {
|
||||
return (
|
||||
<>
|
||||
<DialogDescription>
|
||||
|
|
@ -377,7 +341,7 @@ function Confirming({
|
|||
{tc("vpm repositories:dialog:headers")}
|
||||
</p>
|
||||
<ul className={"list-disc pl-6"}>
|
||||
{Object.entries(headers).map(([key, value], idx) => (
|
||||
{Object.entries(headers).map(([key, value]) => (
|
||||
<li key={key}>
|
||||
{key}: {value}
|
||||
</li>
|
||||
|
|
@ -389,7 +353,7 @@ function Confirming({
|
|||
{tc("vpm repositories:dialog:packages")}
|
||||
</p>
|
||||
<ul className={"list-disc pl-6"}>
|
||||
{repo.packages.map((info, idx) => (
|
||||
{repo.packages.map((info) => (
|
||||
<li key={info.name}>{info.display_name ?? info.name}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
import { queryOptions } from "@tanstack/react-query";
|
||||
import type React from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
Accordion,
|
||||
AccordionContent,
|
||||
|
|
@ -19,10 +22,6 @@ import { tc, tt } from "@/lib/i18n";
|
|||
import { queryClient } from "@/lib/query-client";
|
||||
import { toastSuccess } from "@/lib/toast";
|
||||
import { useEffectEvent } from "@/lib/use-effect-event";
|
||||
import { queryOptions } from "@tanstack/react-query";
|
||||
import type React from "react";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useState } from "react";
|
||||
|
||||
type ParsedRepositories = {
|
||||
repositories: TauriRepositoryDescriptor[];
|
||||
|
|
@ -228,7 +227,7 @@ function ConfirmingPackages({
|
|||
error = false;
|
||||
content = (
|
||||
<ul className={"list-disc pl-6"}>
|
||||
{download.value.packages.map((info, idx) => (
|
||||
{download.value.packages.map((info) => (
|
||||
<li key={info.name}>{info.display_name ?? info.name}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,16 @@
|
|||
"use client";
|
||||
|
||||
import { ScrollableCardTable } from "@/components/ScrollableCardTable";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { ChevronDown, CircleX } from "lucide-react";
|
||||
import { Suspense, useCallback, useEffect, useId, useMemo } from "react";
|
||||
import { HNavBar, VStack } from "@/components/layout";
|
||||
import { ScrollableCardTable } from "@/components/ScrollableCardTable";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import {
|
||||
|
|
@ -28,15 +37,6 @@ import { usePrevPathName } from "@/lib/prev-page";
|
|||
import { toastThrownError } from "@/lib/toast";
|
||||
import { useTauriListen } from "@/lib/use-tauri-listen";
|
||||
import { cn } from "@/lib/utils";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { ChevronDown, CircleX } from "lucide-react";
|
||||
import { Suspense, useCallback, useEffect, useId, useMemo } from "react";
|
||||
import { HeadingPageName } from "../-tab-selector";
|
||||
import { addRepository, openAddRepositoryDialog } from "./-use-add-repository";
|
||||
import { importRepositories } from "./-use-import-repositories";
|
||||
|
|
@ -332,7 +332,11 @@ function RemoveRepositoryDialog({
|
|||
dialog,
|
||||
displayName,
|
||||
id,
|
||||
}: { dialog: DialogContext<void>; displayName: string; id: string }) {
|
||||
}: {
|
||||
dialog: DialogContext<void>;
|
||||
displayName: string;
|
||||
id: string;
|
||||
}) {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const removeRepository = useMutation({
|
||||
|
|
|
|||
|
|
@ -1,12 +1,22 @@
|
|||
import Loading from "@/app/-loading";
|
||||
import {
|
||||
queryOptions,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
useSuspenseQuery,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { ChevronDown, CircleX, Ellipsis } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { Suspense, useId, useState } from "react";
|
||||
import { HeadingPageName } from "@/app/_main/packages/-tab-selector";
|
||||
import Loading from "@/app/-loading";
|
||||
import { HNavBar, VStack } from "@/components/layout";
|
||||
import { Overlay } from "@/components/Overlay";
|
||||
import {
|
||||
ReorderableList,
|
||||
useReorderableList,
|
||||
} from "@/components/ReorderableList";
|
||||
import { ScrollableCardTable } from "@/components/ScrollableCardTable";
|
||||
import { HNavBar, VStack } from "@/components/layout";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DialogDescription,
|
||||
|
|
@ -33,9 +43,9 @@ import {
|
|||
TooltipTrigger,
|
||||
} from "@/components/ui/tooltip";
|
||||
import {
|
||||
commands,
|
||||
type TauriAlcomTemplate,
|
||||
type TauriProjectTemplateInfo,
|
||||
commands,
|
||||
} from "@/lib/bindings";
|
||||
import { dateToString, formatDateOffset } from "@/lib/dateToString";
|
||||
import { type DialogContext, openSingleDialog } from "@/lib/dialog";
|
||||
|
|
@ -49,16 +59,6 @@ import {
|
|||
} from "@/lib/project-template";
|
||||
import { toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { cn } from "@/lib/utils";
|
||||
import {
|
||||
queryOptions,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
useSuspenseQuery,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { ChevronDown, CircleX, Ellipsis } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { Suspense, useId, useState } from "react";
|
||||
|
||||
export const Route = createFileRoute("/_main/packages/templates/")({
|
||||
component: RouteComponent,
|
||||
|
|
@ -286,7 +286,10 @@ function TemplateRow({
|
|||
function RemoveTemplateConfirmDialog({
|
||||
dialog,
|
||||
displayName,
|
||||
}: { dialog: DialogContext<boolean>; displayName: string }) {
|
||||
}: {
|
||||
dialog: DialogContext<boolean>;
|
||||
displayName: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<DialogTitle>{tc("templates:dialog:remove template")}</DialogTitle>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,16 @@
|
|||
"use client";
|
||||
|
||||
import { ScrollableCardTable } from "@/components/ScrollableCardTable";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { CircleX } from "lucide-react";
|
||||
import { Suspense, useId } from "react";
|
||||
import { HNavBar, VStack } from "@/components/layout";
|
||||
import { ScrollableCardTable } from "@/components/ScrollableCardTable";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
|
|
@ -23,15 +32,6 @@ import { tc } from "@/lib/i18n";
|
|||
import { usePrevPathName } from "@/lib/prev-page";
|
||||
import { toastError, toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { toVersionString } from "@/lib/version";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { CircleX } from "lucide-react";
|
||||
import { Suspense, useId } from "react";
|
||||
import { HeadingPageName } from "../-tab-selector";
|
||||
|
||||
export const Route = createFileRoute("/_main/packages/user-packages/")({
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
import { useMutation } from "@tanstack/react-query";
|
||||
import { RefreshCw } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { useEffect, useId, useMemo, useState } from "react";
|
||||
import { VStack } from "@/components/layout";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
|
|
@ -39,13 +43,6 @@ import {
|
|||
} from "@/lib/project-template";
|
||||
import { queryClient } from "@/lib/query-client";
|
||||
import { toastError, toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { RefreshCw } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { useEffect } from "react";
|
||||
import { useMemo } from "react";
|
||||
import { useId } from "react";
|
||||
import { useState } from "react";
|
||||
|
||||
export async function createProject() {
|
||||
const information = await commands.environmentProjectCreationInformation();
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { CircleHelp, CircleUserRound, Ellipsis, Globe } from "lucide-react";
|
||||
import {
|
||||
ButtonDisabledIfInvalid,
|
||||
FavoriteToggleButton,
|
||||
getProjectDisplayInfo,
|
||||
ManageOrMigrateButton,
|
||||
ProjectContext,
|
||||
TooltipTriggerIfInvalid,
|
||||
TooltipTriggerIfValid,
|
||||
getProjectDisplayInfo,
|
||||
useSetProjectFavoriteMutation,
|
||||
} from "@/app/_main/projects/-project-row";
|
||||
import { copyProject } from "@/app/_main/projects/manage/-copy-project";
|
||||
|
|
@ -32,13 +33,6 @@ import { dateToString, formatDateOffset } from "@/lib/dateToString";
|
|||
import { openSingleDialog } from "@/lib/dialog";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { toastThrownError } from "@/lib/toast";
|
||||
import { queryOptions } from "@tanstack/react-query";
|
||||
import { CircleHelp, CircleUserRound, Ellipsis, Globe } from "lucide-react";
|
||||
|
||||
const environmentProjects = queryOptions({
|
||||
queryKey: ["environmentProjects"],
|
||||
queryFn: commands.environmentProjects,
|
||||
});
|
||||
|
||||
export function ProjectGridItem({
|
||||
project,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import {
|
||||
CircleHelp,
|
||||
CircleUserRound,
|
||||
Ellipsis,
|
||||
Globe,
|
||||
Star,
|
||||
} from "lucide-react";
|
||||
import React, { type ComponentProps, useContext } from "react";
|
||||
import { copyProject } from "@/app/_main/projects/manage/-copy-project";
|
||||
import { MigrationCopyingDialog } from "@/app/_main/projects/manage/-unity-migration";
|
||||
import { BackupProjectDialog } from "@/components/BackupProjectDialog";
|
||||
|
|
@ -32,20 +46,6 @@ import { queryClient } from "@/lib/query-client";
|
|||
import { toastError, toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { compareUnityVersionString } from "@/lib/version";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import {
|
||||
CircleHelp,
|
||||
CircleUserRound,
|
||||
Ellipsis,
|
||||
Globe,
|
||||
Star,
|
||||
} from "lucide-react";
|
||||
import React, { type ComponentProps, useContext } from "react";
|
||||
|
||||
export const ProjectDisplayType: Record<
|
||||
TauriProjectType,
|
||||
|
|
@ -272,11 +272,9 @@ export function ProjectRow({
|
|||
);
|
||||
}
|
||||
|
||||
export function ManageOrMigrateButton({
|
||||
project,
|
||||
}: {
|
||||
project: TauriProject;
|
||||
}) {
|
||||
export function ManageOrMigrateButton({ project }: { project: TauriProject }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
if (compareUnityVersionString(project.unity, "2018.0.0f0") < 0) {
|
||||
// No UPM is supported in unity 2017 or older
|
||||
return (
|
||||
|
|
@ -293,7 +291,6 @@ export function ManageOrMigrateButton({
|
|||
);
|
||||
}
|
||||
|
||||
const navigate = useNavigate();
|
||||
switch (project.project_type) {
|
||||
case "LegacySdk2":
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
"use client";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { ArrowDown, ArrowUp } from "lucide-react";
|
||||
import { useMemo } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { ScrollArea } from "@/components/ui/scroll-area";
|
||||
|
|
@ -12,14 +15,11 @@ import {
|
|||
import type { TauriProject } from "@/lib/bindings";
|
||||
import { commands } from "@/lib/bindings";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { ArrowDown, ArrowUp } from "lucide-react";
|
||||
import { useMemo } from "react";
|
||||
import { ProjectGridItem } from "./-project-grid-item";
|
||||
import {
|
||||
isSorting,
|
||||
sortSearchProjects,
|
||||
type sortings,
|
||||
sortSearchProjects,
|
||||
useSetProjectSortingMutation,
|
||||
} from "./-projects-list-card";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
"use client";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { ChevronDown, ChevronsUpDown, ChevronUp, Star } from "lucide-react";
|
||||
import { useMemo } from "react";
|
||||
import { ScrollableCardTable } from "@/components/ScrollableCardTable";
|
||||
import { assertNever } from "@/lib/assert-never";
|
||||
import type { TauriProject, TauriProjectType } from "@/lib/bindings";
|
||||
|
|
@ -6,9 +9,6 @@ import { commands } from "@/lib/bindings";
|
|||
import { tc } from "@/lib/i18n";
|
||||
import { toastThrownError } from "@/lib/toast";
|
||||
import { compareUnityVersionString } from "@/lib/version";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { ChevronDown, ChevronUp, ChevronsUpDown, Star } from "lucide-react";
|
||||
import { useMemo } from "react";
|
||||
import { ProjectRow } from "./-project-row";
|
||||
|
||||
export const sortings = ["lastModified", "name", "unity", "type"] as const;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,19 @@
|
|||
"use client";
|
||||
|
||||
import Loading from "@/app/-loading";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { ChevronDown, LayoutGrid, LayoutList, RefreshCw } from "lucide-react";
|
||||
import { useRef, useState } from "react";
|
||||
import { createProject } from "@/app/_main/projects/-create-project";
|
||||
import { ProjectsGridCard } from "@/app/_main/projects/-projects-grid-card";
|
||||
import { SearchBox } from "@/components/SearchBox";
|
||||
import Loading from "@/app/-loading";
|
||||
import { HNavBar, VStack } from "@/components/layout";
|
||||
import { SearchBox } from "@/components/SearchBox";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import {
|
||||
|
|
@ -24,15 +33,6 @@ import { isFindKey, useDocumentEvent } from "@/lib/events";
|
|||
import { useProjectUpdateInProgress } from "@/lib/global-events";
|
||||
import { tc, tt } from "@/lib/i18n";
|
||||
import { toastError, toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { ChevronDown, LayoutGrid, LayoutList, RefreshCw } from "lucide-react";
|
||||
import { useRef, useState } from "react";
|
||||
import { ProjectsTableCard } from "./-projects-list-card";
|
||||
|
||||
export const Route = createFileRoute("/_main/projects/")({
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
import { useMutation } from "@tanstack/react-query";
|
||||
import type { NavigateFn } from "@tanstack/react-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { VStack } from "@/components/layout";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
|
|
@ -8,7 +11,7 @@ import {
|
|||
import { Input } from "@/components/ui/input";
|
||||
import { Progress } from "@/components/ui/progress";
|
||||
import { assertNever } from "@/lib/assert-never";
|
||||
import { type TauriCopyProjectProgress, commands } from "@/lib/bindings";
|
||||
import { commands, type TauriCopyProjectProgress } from "@/lib/bindings";
|
||||
import { callAsyncCommand } from "@/lib/call-async-command";
|
||||
import { type DialogContext, showDialog } from "@/lib/dialog";
|
||||
import { tc, tt } from "@/lib/i18n";
|
||||
|
|
@ -19,11 +22,6 @@ import {
|
|||
} from "@/lib/project-name-check";
|
||||
import { queryClient } from "@/lib/query-client";
|
||||
import { toastError, toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import type { NavigateFn } from "@tanstack/react-router";
|
||||
import type React from "react";
|
||||
import { useEffect } from "react";
|
||||
import { useState } from "react";
|
||||
|
||||
export async function copyProject(existingPath: string, navigate?: NavigateFn) {
|
||||
using dialog = showDialog();
|
||||
|
|
@ -58,31 +56,6 @@ export async function copyProject(existingPath: string, navigate?: NavigateFn) {
|
|||
});
|
||||
}
|
||||
|
||||
function DialogBase({
|
||||
children,
|
||||
close,
|
||||
createProject,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
close?: () => void;
|
||||
createProject?: () => void;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<DialogTitle>{tc("projects:dialog:copy project")}</DialogTitle>
|
||||
<DialogDescription>{children}</DialogDescription>
|
||||
<DialogFooter className={"gap-2"}>
|
||||
<Button onClick={close} disabled={!close}>
|
||||
{tc("general:button:cancel")}
|
||||
</Button>
|
||||
<Button onClick={createProject} disabled={!createProject}>
|
||||
{tc("projects:button:create")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function CopyProjectNameDialog({
|
||||
dialog,
|
||||
projectPath,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,27 @@
|
|||
// noinspection ExceptionCaughtLocallyJS
|
||||
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import {
|
||||
CircleArrowUp,
|
||||
CircleMinus,
|
||||
CirclePlus,
|
||||
Ellipsis,
|
||||
RefreshCw,
|
||||
} from "lucide-react";
|
||||
import type React from "react";
|
||||
import {
|
||||
memo,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useLayoutEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import { applyChangesMutation } from "@/app/_main/projects/manage/-use-package-change";
|
||||
import { Route } from "@/app/_main/projects/manage/index";
|
||||
import { ExternalLink } from "@/components/ExternalLink";
|
||||
|
|
@ -39,22 +61,6 @@ import { usePackageUpdateInProgress } from "@/lib/global-events";
|
|||
import { tc, tt } from "@/lib/i18n";
|
||||
import { toastThrownError } from "@/lib/toast";
|
||||
import { toVersionString } from "@/lib/version";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import {
|
||||
CircleArrowUp,
|
||||
CircleMinus,
|
||||
CirclePlus,
|
||||
Ellipsis,
|
||||
RefreshCw,
|
||||
} from "lucide-react";
|
||||
import type React from "react";
|
||||
import { useLayoutEffect } from "react";
|
||||
import { useRef } from "react";
|
||||
import { memo, useCallback, useEffect, useMemo, useState } from "react";
|
||||
import type {
|
||||
PackageLatestInfo,
|
||||
PackageRowInfo,
|
||||
|
|
@ -530,13 +536,6 @@ function bulkUpdateModeForPackage(pkg: PackageRowInfo): PackageBulkUpdateMode {
|
|||
};
|
||||
}
|
||||
|
||||
function hasAnyUpdate(pkg: PackageBulkUpdateMode): boolean {
|
||||
for (const kind of possibleUpdateKind) {
|
||||
if (pkg[kind]) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function canBulkUpdate(
|
||||
bulkUpdateMode: BulkUpdateMode,
|
||||
possibleUpdate: PackageBulkUpdateMode,
|
||||
|
|
@ -559,8 +558,6 @@ function BulkUpdateCard({
|
|||
packageRowsData: PackageRowInfo[];
|
||||
cancel?: () => void;
|
||||
}) {
|
||||
if (!bulkUpdateMode.hasPackages) return null;
|
||||
|
||||
const count = bulkUpdatePackageIds.length;
|
||||
const { projectPath } = Route.useSearch();
|
||||
const packageChange = useMutation(applyChangesMutation(projectPath));
|
||||
|
|
@ -617,6 +614,7 @@ function BulkUpdateCard({
|
|||
});
|
||||
};
|
||||
|
||||
if (!bulkUpdateMode.hasPackages) return null;
|
||||
return (
|
||||
<Card
|
||||
className={
|
||||
|
|
@ -1065,11 +1063,7 @@ function PackageVersionList({
|
|||
);
|
||||
}
|
||||
|
||||
function PackageInstalledInfo({
|
||||
pkg,
|
||||
}: {
|
||||
pkg: PackageRowInfo;
|
||||
}) {
|
||||
function PackageInstalledInfo({ pkg }: { pkg: PackageRowInfo }) {
|
||||
if (pkg.installed) {
|
||||
const version = toVersionString(pkg.installed.version);
|
||||
if (pkg.installed.yanked) {
|
||||
|
|
@ -1088,11 +1082,7 @@ function PackageInstalledInfo({
|
|||
}
|
||||
}
|
||||
|
||||
function LatestPackageInfo({
|
||||
info,
|
||||
}: {
|
||||
info: PackageLatestInfo;
|
||||
}) {
|
||||
function LatestPackageInfo({ info }: { info: PackageLatestInfo }) {
|
||||
const { projectPath } = Route.useSearch();
|
||||
const packageChange = useMutation(applyChangesMutation(projectPath));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { type ComponentProps, createContext, useContext } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import { type ComponentProps, createContext, useContext } from "react";
|
||||
|
||||
interface PageContext {
|
||||
isLoading: boolean;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import type { NavigateFn } from "@tanstack/react-router";
|
||||
import React, { Fragment, useEffect, useState } from "react";
|
||||
import { BackupProjectDialog } from "@/components/BackupProjectDialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
|
|
@ -21,8 +23,6 @@ import { tc, tt } from "@/lib/i18n";
|
|||
import { queryClient } from "@/lib/query-client";
|
||||
import { toastError, toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { compareUnityVersionString, parseUnityVersion } from "@/lib/version";
|
||||
import type { NavigateFn } from "@tanstack/react-router";
|
||||
import React, { Fragment, useEffect, useState } from "react";
|
||||
|
||||
export async function unityVersionChange({
|
||||
version: targetUnityVersion,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
import type { DefaultError } from "@tanstack/query-core";
|
||||
import { queryOptions, type UseMutationOptions } from "@tanstack/react-query";
|
||||
import { CircleAlert } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { Fragment } from "react";
|
||||
import { DelayedButton } from "@/components/DelayedButton";
|
||||
import { ExternalLink } from "@/components/ExternalLink";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
|
@ -24,11 +29,6 @@ import { queryClient } from "@/lib/query-client";
|
|||
import { toastInfo, toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { groupBy, keyComparator } from "@/lib/utils";
|
||||
import { compareVersion, toVersionString } from "@/lib/version";
|
||||
import type { DefaultError } from "@tanstack/query-core";
|
||||
import { type UseMutationOptions, queryOptions } from "@tanstack/react-query";
|
||||
import { CircleAlert } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { Fragment } from "react";
|
||||
|
||||
export type RequestedOperation =
|
||||
| {
|
||||
|
|
@ -243,6 +243,12 @@ function showToast(requested: RequestedOperation) {
|
|||
}
|
||||
}
|
||||
|
||||
const TypographyItem = ({ children }: { children: React.ReactNode }) => (
|
||||
<div className={"p-3"}>
|
||||
<p className={"font-normal"}>{children}</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
function ProjectChangesDialog({
|
||||
changes,
|
||||
existingPackages,
|
||||
|
|
@ -260,12 +266,6 @@ function ProjectChangesDialog({
|
|||
([_, c]) => c.unlocked_names,
|
||||
);
|
||||
|
||||
const TypographyItem = ({ children }: { children: React.ReactNode }) => (
|
||||
<div className={"p-3"}>
|
||||
<p className={"font-normal"}>{children}</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
const existingPackageMap = new Map(existingPackages ?? []);
|
||||
|
||||
const categorizedChanges = changes.package_changes.map(([pkgId, change]) =>
|
||||
|
|
@ -760,13 +760,6 @@ function ChangelogButton({ url }: { url?: string | null }) {
|
|||
return null;
|
||||
}
|
||||
|
||||
function comparePackageChangeByName(
|
||||
[aName]: [string, TauriPackageChange],
|
||||
[bName]: [string, TauriPackageChange],
|
||||
): number {
|
||||
return aName.localeCompare(bName);
|
||||
}
|
||||
|
||||
function MissingDependenciesDialog({
|
||||
dependencies,
|
||||
dialog,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,27 @@
|
|||
"use client";
|
||||
|
||||
import {
|
||||
queryOptions,
|
||||
type UseQueryResult,
|
||||
useIsMutating,
|
||||
useMutation,
|
||||
useQueries,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import {
|
||||
createFileRoute,
|
||||
useNavigate,
|
||||
useRouter,
|
||||
} from "@tanstack/react-router";
|
||||
import { ArrowLeft, ChevronDown } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { Suspense, useMemo } from "react";
|
||||
import { copyProject } from "@/app/_main/projects/manage/-copy-project";
|
||||
import { BackupProjectDialog } from "@/components/BackupProjectDialog";
|
||||
import { HNavBar, VStack } from "@/components/layout";
|
||||
import { OpenUnityButton } from "@/components/OpenUnityButton";
|
||||
import { RemoveProjectDialog } from "@/components/RemoveProjectDialog";
|
||||
import { HNavBar, VStack } from "@/components/layout";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import {
|
||||
|
|
@ -44,23 +61,6 @@ import { tc } from "@/lib/i18n";
|
|||
import { nameFromPath } from "@/lib/os";
|
||||
import { toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { compareUnityVersionString, parseUnityVersion } from "@/lib/version";
|
||||
import {
|
||||
type UseQueryResult,
|
||||
queryOptions,
|
||||
useIsMutating,
|
||||
useMutation,
|
||||
useQueries,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import {
|
||||
createFileRoute,
|
||||
useNavigate,
|
||||
useRouter,
|
||||
} from "@tanstack/react-router";
|
||||
import { ArrowLeft, ChevronDown } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { Suspense, useMemo } from "react";
|
||||
import { combinePackagesAndProjectDetails } from "./-collect-package-row-info";
|
||||
import { PackageListCard } from "./-package-list-card";
|
||||
import { PageContextProvider } from "./-page-context";
|
||||
|
|
@ -323,11 +323,7 @@ function UnityVersionSelector({
|
|||
);
|
||||
}
|
||||
|
||||
function SuggestResolveProjectCard({
|
||||
disabled,
|
||||
}: {
|
||||
disabled?: boolean;
|
||||
}) {
|
||||
function SuggestResolveProjectCard({ disabled }: { disabled?: boolean }) {
|
||||
const { projectPath } = Route.useSearch();
|
||||
const packageChange = useMutation(applyChangesMutation(projectPath));
|
||||
|
||||
|
|
@ -591,13 +587,6 @@ function ProjectViewHeader({
|
|||
);
|
||||
}
|
||||
|
||||
function projectGetCustomUnityArgs(projectPath: string) {
|
||||
return queryOptions({
|
||||
queryKey: ["projectGetCustomUnityArgs", projectPath],
|
||||
queryFn: async () => await commands.projectGetCustomUnityArgs(projectPath),
|
||||
});
|
||||
}
|
||||
|
||||
function LaunchSettings({
|
||||
defaultUnityArgs,
|
||||
initialValue,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
"use client";
|
||||
|
||||
import { createFileRoute, Outlet, useLocation } from "@tanstack/react-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { SideBar } from "@/components/SideBar";
|
||||
import { commands } from "@/lib/bindings";
|
||||
import { useDocumentEvent } from "@/lib/events";
|
||||
import { updateCurrentPath, usePrevPathName } from "@/lib/prev-page";
|
||||
import { useEffectEvent } from "@/lib/use-effect-event";
|
||||
import { Outlet, createFileRoute, useLocation } from "@tanstack/react-router";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export const Route = createFileRoute("/_main")({
|
||||
component: MainLayout,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
"use client";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQueryClient,
|
||||
useSuspenseQuery,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute, Link } from "@tanstack/react-router";
|
||||
import { RefreshCw } from "lucide-react";
|
||||
import { Suspense, useEffect, useTransition } from "react";
|
||||
import Loading from "@/app/-loading";
|
||||
import { CheckForUpdateMessage } from "@/components/CheckForUpdateMessage";
|
||||
import { ScrollPageContainer } from "@/components/ScrollPageContainer";
|
||||
import { ScrollableCardTable } from "@/components/ScrollableCardTable";
|
||||
import {
|
||||
BackupFormatSelect,
|
||||
BackupPathWarnings,
|
||||
|
|
@ -13,6 +20,8 @@ import {
|
|||
ThemeSelector,
|
||||
} from "@/components/common-setting-parts";
|
||||
import { HNavBar, VStack } from "@/components/layout";
|
||||
import { ScrollableCardTable } from "@/components/ScrollableCardTable";
|
||||
import { ScrollPageContainer } from "@/components/ScrollPageContainer";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
|
|
@ -44,17 +53,6 @@ import {
|
|||
toastThrownError,
|
||||
} from "@/lib/toast";
|
||||
import { useEffectEvent } from "@/lib/use-effect-event";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQueryClient,
|
||||
useSuspenseQuery,
|
||||
} from "@tanstack/react-query";
|
||||
import { Link, createFileRoute } from "@tanstack/react-router";
|
||||
import { RefreshCw } from "lucide-react";
|
||||
import { Suspense } from "react";
|
||||
import { useTransition } from "react";
|
||||
import { useEffect } from "react";
|
||||
|
||||
export const Route = createFileRoute("/_main/settings/")({
|
||||
component: Page,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
"use client";
|
||||
|
||||
import licenses from "build:licenses.json";
|
||||
import { ScrollPageContainer } from "@/components/ScrollPageContainer";
|
||||
import { ScrollableCard } from "@/components/ScrollableCard";
|
||||
import { VStack } from "@/components/layout";
|
||||
import { ScrollableCard } from "@/components/ScrollableCard";
|
||||
import { ScrollPageContainer } from "@/components/ScrollPageContainer";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { commands } from "@/lib/bindings";
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ export default function RenderPage() {
|
|||
<ul />
|
||||
</Card>
|
||||
|
||||
{licenses.map((license, idx) => (
|
||||
{licenses.map((license) => (
|
||||
<Card className={"p-4"} key={license.text}>
|
||||
<h3>{license.name}</h3>
|
||||
<h4>Used by:</h4>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import licenses from "build:licenses.json";
|
||||
import { ScrollPageContainer } from "@/components/ScrollPageContainer";
|
||||
import { ScrollableCard } from "@/components/ScrollableCard";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { VStack } from "@/components/layout";
|
||||
import { ScrollableCard } from "@/components/ScrollableCard";
|
||||
import { ScrollPageContainer } from "@/components/ScrollPageContainer";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { commands } from "@/lib/bindings";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_main/settings/licenses/")({
|
||||
component: Page,
|
||||
|
|
@ -23,7 +23,7 @@ function Page() {
|
|||
<ul />
|
||||
</Card>
|
||||
|
||||
{licenses.map((license, idx) => (
|
||||
{licenses.map((license) => (
|
||||
<Card className={"p-4"} key={license.text}>
|
||||
<h3>{license.name}</h3>
|
||||
<h4>Used by:</h4>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
"use client";
|
||||
|
||||
import {
|
||||
Outlet,
|
||||
createFileRoute,
|
||||
Outlet,
|
||||
useNavigate,
|
||||
useRouter,
|
||||
} from "@tanstack/react-router";
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import { Circle, CircleCheck, CircleChevronRight } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardFooter, CardHeader } from "@/components/ui/card";
|
||||
import type { SetupPages, TauriEnvironmentSettings } from "@/lib/bindings";
|
||||
import { commands } from "@/lib/bindings";
|
||||
import { useGlobalInfo } from "@/lib/global-info";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import { Circle, CircleCheck, CircleChevronRight } from "lucide-react";
|
||||
import type React from "react";
|
||||
|
||||
export type BodyProps = Readonly<{
|
||||
environment: TauriEnvironmentSettings;
|
||||
|
|
@ -80,11 +80,7 @@ export function SetupPageBase({
|
|||
);
|
||||
}
|
||||
|
||||
function StepCard({
|
||||
current,
|
||||
}: {
|
||||
current: SetupPages | null;
|
||||
}) {
|
||||
function StepCard({ current }: { current: SetupPages | null }) {
|
||||
// TODO: get progress from backend
|
||||
const finisheds = useQuery({
|
||||
queryKey: ["environmentGetFinishedSetupPages"],
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
"use client";
|
||||
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import {
|
||||
GuiAnimationSwitch,
|
||||
LanguageSelector,
|
||||
|
|
@ -7,7 +8,6 @@ import {
|
|||
} from "@/components/common-setting-parts";
|
||||
import { CardDescription } from "@/components/ui/card";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { SetupPageBase } from "../-setup-page-base";
|
||||
|
||||
export const Route = createFileRoute("/_setup/setup/appearance/")({
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import {
|
||||
BackupFormatSelect,
|
||||
BackupPathWarnings,
|
||||
|
|
@ -11,8 +13,6 @@ import { commands } from "@/lib/bindings";
|
|||
import { useGlobalInfo } from "@/lib/global-info";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { toastError, toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { type BodyProps, SetupPageBase } from "../-setup-page-base";
|
||||
|
||||
export const Route = createFileRoute("/_setup/setup/backups/")({
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
"use client";
|
||||
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { CardDescription } from "@/components/ui/card";
|
||||
import { useGlobalInfo } from "@/lib/global-info";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { SetupPageBase } from "../-setup-page-base";
|
||||
|
||||
export const Route = createFileRoute("/_setup/setup/finish/")({
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import {
|
||||
FilePathRow,
|
||||
ProjectPathWarnings,
|
||||
|
|
@ -9,8 +11,6 @@ import { assertNever } from "@/lib/assert-never";
|
|||
import { commands } from "@/lib/bindings";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { toastError, toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { type BodyProps, SetupPageBase } from "../-setup-page-base";
|
||||
|
||||
export const Route = createFileRoute("/_setup/setup/project-path/")({
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
"use client";
|
||||
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { commands } from "@/lib/bindings";
|
||||
import { useGlobalInfo } from "@/lib/global-info";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { toastThrownError } from "@/lib/toast";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
|
|
@ -12,6 +7,11 @@ import {
|
|||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { commands } from "@/lib/bindings";
|
||||
import { useGlobalInfo } from "@/lib/global-info";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { toastThrownError } from "@/lib/toast";
|
||||
import { type BodyProps, SetupPageBase } from "../-setup-page-base";
|
||||
|
||||
export const Route = createFileRoute("/_setup/setup/system-setting/")({
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { FilePathRow } from "@/components/common-setting-parts";
|
||||
import {
|
||||
Accordion,
|
||||
|
|
@ -13,8 +15,6 @@ import { assertNever } from "@/lib/assert-never";
|
|||
import { commands } from "@/lib/bindings";
|
||||
import { tc, tt } from "@/lib/i18n";
|
||||
import { toastError, toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { type BodyProps, SetupPageBase } from "../-setup-page-base";
|
||||
|
||||
export const Route = createFileRoute("/_setup/setup/unity-hub/")({
|
||||
|
|
|
|||
|
|
@ -293,8 +293,9 @@ html {
|
|||
* Add padding end for horizontal scroll bar of scrollable card if vertical scroll bar is invisible
|
||||
* This prevents the horizontal scroll bar hide corner of the card
|
||||
*/
|
||||
.vrc-get-scrollable-card:not(:has(> .vrc-get-scrollable-card-vertical-bar))
|
||||
> div[data-radix-scroll-area-viewport]
|
||||
.vrc-get-scrollable-card:not(
|
||||
:has(> .vrc-get-scrollable-card-vertical-bar)
|
||||
) > div[data-radix-scroll-area-viewport]
|
||||
> div
|
||||
> div.vrc-get-scrollable-card-horizontal-bar {
|
||||
@apply pe-2.5;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { createFileRoute, Outlet } from "@tanstack/react-router";
|
||||
import ErrorPage from "@/app/-error";
|
||||
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/")({
|
||||
component: RouteComponent,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import type React from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DialogDescription,
|
||||
|
|
@ -12,9 +14,6 @@ import type { DialogContext } from "@/lib/dialog";
|
|||
import { tc } from "@/lib/i18n";
|
||||
import { toastNormal, toastSuccess } from "@/lib/toast";
|
||||
import { useEffectEvent } from "@/lib/use-effect-event";
|
||||
import type React from "react";
|
||||
import { useRef } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export function BackupProjectDialog({
|
||||
projectPath,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import React, { useState } from "react";
|
||||
import { ExternalLink } from "@/components/ExternalLink";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
|
|
@ -13,7 +14,6 @@ import { callAsyncCommand } from "@/lib/call-async-command";
|
|||
import type { DialogContext } from "@/lib/dialog";
|
||||
import globalInfo from "@/lib/global-info";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import React, { useState } from "react";
|
||||
|
||||
type ConfirmStatus =
|
||||
| {
|
||||
|
|
@ -160,7 +160,7 @@ export function CheckForUpdateMessage({
|
|||
|
||||
const LinkedText = React.memo(({ text }: { text: string }) => {
|
||||
const urlRegex =
|
||||
/https:\/\/[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)+\/[a-zA-Z0-9$\-_.+!*'()%\/?#]*/g;
|
||||
/https:\/\/[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)+\/[a-zA-Z0-9$\-_.+!*'()%/?#]*/g;
|
||||
const components: React.ReactNode[] = [];
|
||||
let lastMatchEnd = 0;
|
||||
for (const match of text.matchAll(urlRegex)) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Button } from "@/components/ui/button";
|
||||
import type React from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
export function DelayedButton({
|
||||
disabled,
|
||||
delay,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { commands } from "@/lib/bindings";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { ExternalLink as LucideExternalLink } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { commands } from "@/lib/bindings";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export function ExternalLink({
|
||||
children,
|
||||
|
|
@ -25,7 +25,7 @@ export function ExternalLink({
|
|||
<a
|
||||
className={cn(className, "underline inline")}
|
||||
type={"button"}
|
||||
// biome-ignore lint/a11y/useValidAnchor: This is navigation with external browser, not a action
|
||||
href={href}
|
||||
onClick={() => commands.utilOpenUrl(href)}
|
||||
>
|
||||
{body}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import { queryOptions, useQueryClient } from "@tanstack/react-query";
|
||||
import type React from "react";
|
||||
import { useRef, useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { commands } from "@/lib/bindings";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { openUnity } from "@/lib/open-unity";
|
||||
import { queryOptions, useQueryClient } from "@tanstack/react-query";
|
||||
import type React from "react";
|
||||
import { useState } from "react";
|
||||
import { useRef } from "react";
|
||||
|
||||
function PreventDoubleClick({
|
||||
delayMs,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { cn } from "@/lib/utils";
|
||||
import React from "react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
/**
|
||||
* Overlays multiple elements to one place with grid layout
|
||||
|
|
@ -13,10 +13,13 @@ import React from "react";
|
|||
export function Overlay({
|
||||
children,
|
||||
className,
|
||||
}: { className?: string; children?: React.ReactNode }) {
|
||||
}: {
|
||||
className?: string;
|
||||
children?: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div className={cn("grid", className)}>
|
||||
{React.Children.map(children, (child, i) => {
|
||||
{React.Children.map(children, (child) => {
|
||||
if (React.isValidElement(child)) {
|
||||
const childElement = child as React.ReactHTMLElement<HTMLElement>;
|
||||
return React.cloneElement(childElement, {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { useLocation, useRouter } from "@tanstack/react-router";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DialogDescription,
|
||||
|
|
@ -9,8 +11,6 @@ import type { DialogContext } from "@/lib/dialog";
|
|||
import { tc, tt } from "@/lib/i18n";
|
||||
import { nameFromPath } from "@/lib/os";
|
||||
import { toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { useLocation, useRouter } from "@tanstack/react-router";
|
||||
|
||||
type Project = {
|
||||
path: string;
|
||||
|
|
@ -32,7 +32,10 @@ export function RemoveProjectDialog({
|
|||
mutationFn: async ({
|
||||
project,
|
||||
removeDir,
|
||||
}: { project: Project; removeDir: boolean }) => {
|
||||
}: {
|
||||
project: Project;
|
||||
removeDir: boolean;
|
||||
}) => {
|
||||
await commands.environmentRemoveProjectByPath(project.path, removeDir);
|
||||
},
|
||||
onSuccess: () => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import { Button } from "@/components/ui/button";
|
||||
import { assertNever } from "@/lib/assert-never";
|
||||
import { ArrowDown, ArrowUp, CircleMinus, CirclePlus } from "lucide-react";
|
||||
import type React from "react";
|
||||
import {
|
||||
|
|
@ -9,6 +7,8 @@ import {
|
|||
useMemo,
|
||||
useState,
|
||||
} from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { assertNever } from "@/lib/assert-never";
|
||||
|
||||
const internalSymbol: unique symbol = Symbol("ReorderableListContextInternal");
|
||||
const idSymbol: unique symbol = Symbol("IdSymbol");
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type React from "react";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type React from "react";
|
||||
|
||||
export function ScrollableCard({
|
||||
children,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type React from "react";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type React from "react";
|
||||
|
||||
export const ScrollableCardTable = ({
|
||||
children,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Input } from "@/components/ui/input";
|
||||
import { Search } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Input } from "@/components/ui/input";
|
||||
|
||||
type SearchBoxProps = {
|
||||
className?: string;
|
||||
|
|
|
|||
|
|
@ -1,20 +1,5 @@
|
|||
"use client";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import {
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
import { commands } from "@/lib/bindings";
|
||||
import { useGlobalInfo } from "@/lib/global-info";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { toastNormal } from "@/lib/toast";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import {
|
||||
type RegisteredRouter,
|
||||
|
|
@ -30,6 +15,21 @@ import {
|
|||
SwatchBook,
|
||||
} from "lucide-react";
|
||||
import type React from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import {
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
import { commands } from "@/lib/bindings";
|
||||
import { useGlobalInfo } from "@/lib/global-info";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { toastNormal } from "@/lib/toast";
|
||||
|
||||
export function SideBar({ className }: { className?: string }) {
|
||||
"use client";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,11 @@
|
|||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { CircleAlert } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { Input } from "@/components/ui/input";
|
||||
|
|
@ -13,14 +21,6 @@ import { commands } from "@/lib/bindings";
|
|||
import { useGlobalInfo } from "@/lib/global-info";
|
||||
import i18next, { languages, tc } from "@/lib/i18n";
|
||||
import { toastThrownError } from "@/lib/toast";
|
||||
import {
|
||||
queryOptions,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import { CircleAlert } from "lucide-react";
|
||||
import type React from "react";
|
||||
|
||||
const environmentGetSettings = queryOptions({
|
||||
queryKey: ["environmentGetSettings"],
|
||||
|
|
@ -276,11 +276,7 @@ export function BackupPathWarnings({ backupPath }: { backupPath: string }) {
|
|||
);
|
||||
}
|
||||
|
||||
export function WarningMessage({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
export function WarningMessage({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<div className={"flex items-center gap-2"}>
|
||||
<div className="grow-0 shrink-0">
|
||||
|
|
@ -291,11 +287,7 @@ export function WarningMessage({
|
|||
);
|
||||
}
|
||||
|
||||
export function BackupFormatSelect({
|
||||
backupFormat,
|
||||
}: {
|
||||
backupFormat: string;
|
||||
}) {
|
||||
export function BackupFormatSelect({ backupFormat }: { backupFormat: string }) {
|
||||
const queryClient = useQueryClient();
|
||||
const setBackupFormat = useMutation({
|
||||
mutationFn: async (format: string) =>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
"use client";
|
||||
|
||||
import type React from "react";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type React from "react";
|
||||
|
||||
export function VStack({
|
||||
className,
|
||||
children,
|
||||
}: { className?: string; children: React.ReactNode }) {
|
||||
}: {
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div className={`flex flex-col w-full gap-3 ${className}`}>{children}</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
"use client";
|
||||
|
||||
import { QueryClientProvider } from "@tanstack/react-query";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import type React from "react";
|
||||
import { Suspense, useCallback, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ToastContainer } from "react-toastify";
|
||||
import Loading from "@/app/-loading";
|
||||
import { CheckForUpdateMessage } from "@/components/CheckForUpdateMessage";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
|
|
@ -12,12 +18,6 @@ import { processResult } from "@/lib/import-templates";
|
|||
import { queryClient } from "@/lib/query-client";
|
||||
import { toastError, toastSuccess, toastThrownError } from "@/lib/toast";
|
||||
import { useTauriListen } from "@/lib/use-tauri-listen";
|
||||
import { QueryClientProvider } from "@tanstack/react-query";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import type React from "react";
|
||||
import { Suspense, useCallback, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ToastContainer } from "react-toastify";
|
||||
|
||||
export function Providers({ children }: { children: React.ReactNode }) {
|
||||
const navigate = useNavigate();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Slot } from "@radix-ui/react-slot";
|
||||
import { type VariantProps, cva } from "class-variance-authority";
|
||||
import { cva, type VariantProps } from "class-variance-authority";
|
||||
import type * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as LabelPrimitive from "@radix-ui/react-label";
|
||||
import { type VariantProps, cva } from "class-variance-authority";
|
||||
import { cva, type VariantProps } from "class-variance-authority";
|
||||
import type * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import { tc } from "@/lib/i18n";
|
||||
import type React from "react";
|
||||
import { useState } from "react";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { ReorderableList, useReorderableList } from "./ReorderableList";
|
||||
import { Button } from "./ui/button";
|
||||
import { Input } from "./ui/input";
|
||||
|
||||
const internal = Symbol("useLaunchSettingsDescriptionInternal");
|
||||
|
||||
interface LaunchSettingsDescriptionContext {
|
||||
|
|
@ -57,7 +58,9 @@ export function useUnityArgumentsSettings(
|
|||
|
||||
export function UnityArgumentsSettings({
|
||||
context,
|
||||
}: { context: LaunchSettingsDescriptionContext }) {
|
||||
}: {
|
||||
context: LaunchSettingsDescriptionContext;
|
||||
}) {
|
||||
const {
|
||||
customizeCommandline,
|
||||
setCustomizeCommandline,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { useId, useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import {
|
||||
|
|
@ -9,7 +10,6 @@ import { Label } from "@/components/ui/label";
|
|||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
import type { DialogContext } from "@/lib/dialog";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { useId, useState } from "react";
|
||||
|
||||
type UnityInstallation = [path: string, version: string, fromHub: boolean];
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ async function callAsyncCommandImpl<A extends unknown[], P, R>(
|
|||
listen<FinishedMessage<R>>(`${channel}:finished`, (e) =>
|
||||
finishHandler?.(e.payload),
|
||||
),
|
||||
listen<void>(`${channel}:cancelled`, (e) =>
|
||||
listen<void>(`${channel}:cancelled`, () =>
|
||||
finishHandler?.({ type: "Success", value: "cancelled" }),
|
||||
),
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { tc } from "@/lib/i18n";
|
||||
import type React from "react";
|
||||
import { tc } from "@/lib/i18n";
|
||||
|
||||
export function dateToString(dateIn: Date | number | string) {
|
||||
const date = typeof dateIn !== "object" ? new Date(dateIn) : dateIn;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { Dialog, DialogContent } from "@/components/ui/dialog";
|
||||
import { assertNever } from "@/lib/assert-never";
|
||||
import React, {
|
||||
useEffect,
|
||||
useRef,
|
||||
useState,
|
||||
useSyncExternalStore,
|
||||
} from "react";
|
||||
import { Dialog, DialogContent } from "@/components/ui/dialog";
|
||||
import { assertNever } from "@/lib/assert-never";
|
||||
|
||||
export interface DialogContext<in R> {
|
||||
close: (arg: R) => void;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import globalInfo from "@/lib/global-info";
|
||||
import { type DependencyList, useCallback, useEffect } from "react";
|
||||
import globalInfo from "@/lib/global-info";
|
||||
|
||||
//declare interface DocumentEventMap {}
|
||||
declare global {
|
||||
|
|
@ -13,6 +13,7 @@ export function useDocumentEvent<EventName extends keyof DocumentEventMap>(
|
|||
listener: (event: DocumentEventMap[EventName]) => void,
|
||||
deps: DependencyList,
|
||||
) {
|
||||
// biome-ignore lint/correctness/useExhaustiveDependencies: useDocumentEvent receives the DependencyList
|
||||
const listenerUse = useCallback(listener, deps);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import type {
|
||||
TauriPackage,
|
||||
TauriUpdatedRealProjectInfo,
|
||||
commands,
|
||||
} from "@/lib/bindings";
|
||||
import { queryClient } from "@/lib/query-client";
|
||||
import { queryOptions } from "@tanstack/react-query";
|
||||
import { listen as tauriListen } from "@tauri-apps/api/event";
|
||||
import { useSyncExternalStore } from "react";
|
||||
import type {
|
||||
commands,
|
||||
TauriPackage,
|
||||
TauriUpdatedRealProjectInfo,
|
||||
} from "@/lib/bindings";
|
||||
import { queryClient } from "@/lib/query-client";
|
||||
|
||||
void tauriListen<TauriUpdatedRealProjectInfo>("projects-updated", (e) => {
|
||||
const options = queryOptions<
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
import i18next, { t as i18nextt, type Resource } from "i18next";
|
||||
import React from "react";
|
||||
import { initReactI18next, Trans, useTranslation } from "react-i18next";
|
||||
import type { TransProps } from "react-i18next/TransWithoutContext";
|
||||
import { ExternalLink } from "@/components/ExternalLink";
|
||||
import globalInfo from "@/lib/global-info";
|
||||
import deJson from "@/locales/de.json5";
|
||||
|
|
@ -7,10 +11,6 @@ import jaJson from "@/locales/ja.json5";
|
|||
import koJson from "@/locales/ko.json5";
|
||||
import zh_hansJson from "@/locales/zh_hans.json5";
|
||||
import zh_hantJson from "@/locales/zh_hant.json5";
|
||||
import i18next, { t as i18nextt, type Resource } from "i18next";
|
||||
import React from "react";
|
||||
import { Trans, initReactI18next, useTranslation } from "react-i18next";
|
||||
import type { TransProps } from "react-i18next/TransWithoutContext";
|
||||
|
||||
const languageResources = {
|
||||
en: enJson,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import {
|
||||
|
|
@ -6,16 +7,15 @@ import {
|
|||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
import {
|
||||
commands,
|
||||
type TauriImportDuplicated,
|
||||
type TauriImportTemplateResult,
|
||||
commands,
|
||||
} from "@/lib/bindings";
|
||||
import { dateToString } from "@/lib/dateToString";
|
||||
import { type DialogContext, openSingleDialog } from "@/lib/dialog";
|
||||
import { tc, tt } from "@/lib/i18n";
|
||||
import { queryClient } from "@/lib/query-client";
|
||||
import { toastSuccess } from "@/lib/toast";
|
||||
import { useState } from "react";
|
||||
|
||||
export async function processResult(result: TauriImportTemplateResult) {
|
||||
await queryClient.invalidateQueries({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { RouterProvider, createRouter } from "@tanstack/react-router";
|
||||
import { createRouter, RouterProvider } from "@tanstack/react-router";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { routeTree } from "./routeTree.gen";
|
||||
import "./polyfill";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {
|
|||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
import { UnitySelectorDialog } from "@/components/unity-selector-dialog";
|
||||
import { type TauriUnityVersions, commands } from "@/lib/bindings";
|
||||
import { commands, type TauriUnityVersions } from "@/lib/bindings";
|
||||
import { type DialogContext, openSingleDialog } from "@/lib/dialog";
|
||||
import i18next, { tc } from "@/lib/i18n";
|
||||
import { toastError, toastNormal } from "@/lib/toast";
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { assertNever } from "@/lib/assert-never";
|
||||
import { type TauriProjectDirCheckResult, commands } from "@/lib/bindings";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useDebounce } from "@uidotdev/usehooks";
|
||||
import { RefreshCw } from "lucide-react";
|
||||
import { assertNever } from "@/lib/assert-never";
|
||||
import { commands, type TauriProjectDirCheckResult } from "@/lib/bindings";
|
||||
import { tc } from "@/lib/i18n";
|
||||
|
||||
export function useProjectNameCheck(
|
||||
projectLocation: string,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type React from "react";
|
||||
import type { TauriProjectTemplateInfo } from "@/lib/bindings";
|
||||
import { tc } from "@/lib/i18n";
|
||||
import type React from "react";
|
||||
|
||||
const AVATARS_TEMPLATE_ID = "com.anatawa12.vrc-get.vrchat.avatars";
|
||||
const WORLDS_TEMPLATE_ID = "com.anatawa12.vrc-get.vrchat.worlds";
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { useEffectEvent } from "@/lib/use-effect-event";
|
||||
import { listen } from "@tauri-apps/api/event";
|
||||
import type { EventCallback } from "@tauri-apps/api/event";
|
||||
import { listen } from "@tauri-apps/api/event";
|
||||
import { useEffect } from "react";
|
||||
import { useEffectEvent } from "@/lib/use-effect-event";
|
||||
|
||||
export function useTauriListen<T>(event: string, handler: EventCallback<T>) {
|
||||
const handlerFn = useEffectEvent(handler);
|
||||
useEffect(() => {
|
||||
let unlisten: (() => void) | undefined = undefined;
|
||||
let unlisten: (() => void) | undefined;
|
||||
let unlistened = false;
|
||||
|
||||
listen<T>(event, handlerFn).then((unlistenFn) => {
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
* This file is used to generate a JSON file containing the licenses of all the dependencies.
|
||||
*/
|
||||
import { exec as execCallback } from "node:child_process";
|
||||
import { readFile, readdir, stat } from "node:fs/promises";
|
||||
import { readdir, readFile, stat } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { promisify } from "node:util";
|
||||
import type { LoadResult, ResolveIdResult } from "rollup";
|
||||
import { type Plugin, normalizePath } from "vite";
|
||||
import { normalizePath, type Plugin } from "vite";
|
||||
|
||||
const exec = promisify(execCallback);
|
||||
|
||||
|
|
@ -27,7 +27,9 @@ interface PackageInfo {
|
|||
|
||||
export default function viteBuildLicenseJson({
|
||||
rootDir,
|
||||
}: { rootDir: string }): Plugin {
|
||||
}: {
|
||||
rootDir: string;
|
||||
}): Plugin {
|
||||
const licenseJsonId = "build:licenses.json";
|
||||
|
||||
return {
|
||||
|
|
@ -170,7 +172,7 @@ function allSettledAggregate<T extends readonly unknown[] | []>(
|
|||
return Promise.allSettled(promises).then(
|
||||
(settled): { -readonly [P in keyof T]: Awaited<T[P]> } => {
|
||||
const result: { -readonly [P in keyof T]: Awaited<T[P]> } & unknown[] =
|
||||
// biome-ignore lint/suspicious/noExplicitAny:
|
||||
// biome-ignore lint/suspicious/noExplicitAny: limit of tsc
|
||||
[] as any;
|
||||
const errors = [];
|
||||
for (const element of settled) {
|
||||
|
|
@ -284,7 +286,7 @@ async function getLicensesFromCargoMetadata(
|
|||
async function findLicenseFileName(
|
||||
licenseId: string,
|
||||
crateDir: string,
|
||||
singleLicense: boolean,
|
||||
_singleLicense: boolean,
|
||||
pkg: CargoPackage,
|
||||
): Promise<string | null> {
|
||||
const suffixes = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue