+
+
),
+ beforeSettingsMenu: (
+
+ ),
settingsMenu: (
-
-
-
-
-
- {/* Loop */}
-
-
-
-
- Loop
- {isLoop ? "On" : "Off"}
-
-
-
-
- setIsLoop(true)}
+ <>
+
+
+
+
+
+ {/* Loop */}
+
+
+
+
+ Loop
+ {isLoop ? "On" : "Off"}
+
+
+
+
-
- On
-
- setIsLoop(false)}
- >
-
- Off
-
-
-
-
+ setIsLoop(true)}
+ >
+
+ On
+
+ setIsLoop(false)}
+ >
+
+ Off
+
+
+
+
- {/* Playback Speed */}
-
+ {/* Playback Speed */}
+
- {/* Audio Gain */}
-
-
-
+ {/* Audio Gain */}
+
+
+
+ >
),
}}
/>
@@ -392,3 +409,87 @@ function AudioGain() {
);
}
+function PlaylistMenu({
+ playlist,
+ file,
+ placement = "top end",
+}: {
+ playlist: z.infer
[];
+ file: z.infer;
+ placement?: Menu.ItemsProps["placement"];
+}) {
+ return (
+
+
+
+
+
+ {playlist.map((item) => {
+ const isCurrent = `${item.name}#${item.size}` === `${file.name}#${file.size}`;
+
+ const Wrapper = ({ children, className }: React.PropsWithChildren<{ className?: string }>) =>
+ isCurrent ? (
+
+ {children}
+
+ ) : (
+
+ {children}
+
+ );
+
+ return (
+
+ {/* Thumbnail */}
+
+ {item.mimeType.includes("video") ? (
+

+ ) : (
+
+
+
+ )}
+
+
+
+
{item.name}
+
{formatDate(item.modifiedTime)}
+
+
+ );
+ })}
+
+
+ );
+}
diff --git a/src/components/preview/PreviewLayout.tsx b/src/components/preview/PreviewLayout.tsx
index 9edae28..be3de26 100644
--- a/src/components/preview/PreviewLayout.tsx
+++ b/src/components/preview/PreviewLayout.tsx
@@ -14,7 +14,7 @@ import {
PreviewUnknown,
} from "~/components/preview";
import { Button } from "~/components/ui/button";
-import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "~/components/ui/card";
+import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
import { type getFileType } from "~/lib/previewHelper";
import { cn } from "~/lib/utils";
@@ -23,8 +23,6 @@ import { type Schema_File } from "~/types/schema";
import config from "config";
-import MediaPlaylistLayout from "./MediaPlaylistLayout";
-
type Props = {
data: z.infer;
fileType: "unknown" | ReturnType;
@@ -32,7 +30,7 @@ type Props = {
playlist: z.infer[];
paths: string[];
};
-export default function PreviewLayout({ data, paths, fileType, token, playlist }: Props) {
+export default function PreviewLayout({ data, fileType, token, playlist }: Props) {
const [view, setView] = useState<"markdown" | "raw">("markdown");
const PreviewComponent = useMemo(() => {
switch (fileType) {
@@ -44,6 +42,7 @@ export default function PreviewLayout({ data, paths, fileType, token, playlist }
);
case "code":
@@ -82,7 +81,7 @@ export default function PreviewLayout({ data, paths, fileType, token, playlist }
default:
return ;
}
- }, [fileType, data, view, token]);
+ }, [fileType, data, view, token, playlist]);
return (
-
+ {/*
-
+ */}
= {
* If possible, please don't change this value
* Even if you're creating a PR, just let me change it myself
*/
- version: "2.0.4",
+ version: "2.4.2",
/**
* Base path of the app, used for generating links
*
diff --git a/src/lib/configurationHelper.ts b/src/lib/configurationHelper.ts
index 42bac5a..5d5c0e8 100644
--- a/src/lib/configurationHelper.ts
+++ b/src/lib/configurationHelper.ts
@@ -13,7 +13,7 @@ import config from "~/config/gIndex.config";
export const versionExpectMap: Record<"v1" | "v2" | "latest", string[]> = {
v1: ["1.0.0", "1.0.1", "1.0.2", "1.0.3"],
v2: ["2.0.0", "2.0.1", "2.0.2", "2.0.3"],
- latest: ["2.0.4"],
+ latest: ["2.0.4", "2.4.0", "2.4.1", "2.4.2"],
};
export type PickFileResponse =
| {
@@ -166,7 +166,7 @@ export const initialConfiguration: z.input = {
};
export const configurationTemplate = `import { type z } from "zod";
-import { BASE_URL } from "~/constant";
+import { BASE_URL, IS_DEV } from "~/constant";
import { type Schema_Config } from "~/types/schema";
@@ -184,7 +184,7 @@ const config: z.input = {
* @default process.env.NEXT_PUBLIC_DOMAIN
* @fallback process.env.NEXT_PUBLIC_VERCEL_URL
*/
- basePath: \`https://\${BASE_URL}\`,
+ basePath: IS_DEV ? "http://localhost:3000" : \`https://\${BASE_URL}\`,
/**
* Show deploy guide dropdown on navbar
diff --git a/src/lib/previewHelper.tsx b/src/lib/previewHelper.tsx
index 64185bb..69ded80 100644
--- a/src/lib/previewHelper.tsx
+++ b/src/lib/previewHelper.tsx
@@ -346,7 +346,7 @@ export const MediaPlayerIcons = {
Chapters: () => (
),
diff --git a/src/types/schema.ts b/src/types/schema.ts
index b0f6c12..2939a02 100644
--- a/src/types/schema.ts
+++ b/src/types/schema.ts
@@ -112,7 +112,7 @@ const Schema_Config_API = z
allowDownloadProtectedFile: z.coerce.boolean(),
temporaryTokenDuration: z.coerce.number().positive(),
- maxFileSize: z.coerce.number().positive(),
+ maxFileSize: z.coerce.number(),
})
.refine(
(data) => {