feat: release 1.6.5

This commit is contained in:
dvelo 2024-12-21 09:50:45 -06:00 committed by GitHub
commit 6307557032
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 190 additions and 101 deletions

@ -57,9 +57,11 @@
"react-fast-marquee": "^1.6.5",
"react-hot-toast": "^2.4.1",
"react-qr-code": "^2.0.15",
"react-snowfall": "^2.2.0",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.0",
"sonner": "^1.7.0",
"stripe-gradient": "^1.0.1",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"tailwindcss-patch": "^4.0.0",

@ -68,6 +68,7 @@ import {
} from "@/lib/api";
import IconDisplay from "./IconDisplay";
import ServerSingle from "@/lib/single";
import SnowfallController from "./misc/SnowfallController";
import { toast } from "sonner";
import { ServerResponse, OnlineServer } from "@/lib/types/mh-server";
import {
@ -512,12 +513,25 @@ export function ServerCommandBar() {
}
function timeConverter(UNIX_timestamp: any) {
var a = new Date(UNIX_timestamp);
var months = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
var year = a.getFullYear();
var month = months[a.getMonth()];
var date = a.getDate();
var time = month + "/" + date + "/" + year;
const a = new Date(UNIX_timestamp);
const months = [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
];
const year = a.getFullYear();
const month = months[a.getMonth()];
const date = a.getDate();
const time = month + "/" + date + "/" + year;
return time;
}
@ -842,6 +856,7 @@ export function CommandBarer() {
<ServerCommandBar />
<OfflineServerCB />
<RandomServerDialog />
<SnowfallController />
</>
);
}

@ -35,10 +35,11 @@ import { Button } from "../ui/button";
import { ModeToggle as ThemeSwitcher } from "../ThemeSwitcher";
import { Popover, PopoverTrigger, PopoverContent } from "../ui/popover";
import Image from "next/image";
import { InfoIcon } from "lucide-react";
import { CloudSnow, InfoIcon } from "lucide-react";
import LoggedInPopover from "./LoggedInPopover";
import SignInPopoverButton from "./SignInPopoverButton";
import InfoPopover from "../misc/InfoPopover";
import { snowfallEvents } from "../misc/SnowfallController";
export default function TopBar({ inter }: { inter: string }) {
const clerk = useClerk();
@ -47,8 +48,16 @@ export default function TopBar({ inter }: { inter: string }) {
return (
<>
<SignedOut>
<div className="mt-1 gap-1 grid grid-cols-5">
<div className="mt-1 gap-1 grid grid-cols-6">
<SignInPopoverButton className="col-span-2" variant="outline" />
<Button
size="icon"
variant="ghost"
className="mb-1"
onClick={() => snowfallEvents.emit("toggle")}
>
<CloudSnow className="h-[1.2rem] w-[1.2rem]" />
</Button>
<Popover>
<PopoverTrigger>
<Button size="icon" variant="ghost">
@ -59,7 +68,15 @@ export default function TopBar({ inter }: { inter: string }) {
<InfoPopover />
</PopoverContent>
</Popover>
<Button variant="ghost" size="icon">
<Button
variant="ghost"
size="icon"
onClick={() =>
window
.open("https://github.com/DeveloLongScript/MHSF", "_blank")
?.focus()
}
>
<svg
viewBox="0 0 438.549 438.549"
className="h-[1.2rem] w-[1.2rem]"
@ -74,7 +91,7 @@ export default function TopBar({ inter }: { inter: string }) {
</div>
</SignedOut>
<SignedIn>
<div className="mt-1 grid grid-cols-4 gap-1">
<div className="mt-1 grid grid-cols-5 gap-1">
<Popover>
<PopoverTrigger>
<Button size="icon" variant="ghost" className="mb-1">
@ -95,6 +112,14 @@ export default function TopBar({ inter }: { inter: string }) {
<LoggedInPopover />
</PopoverContent>
</Popover>
<Button
size="icon"
variant="ghost"
className="mb-1"
onClick={() => snowfallEvents.emit("toggle")}
>
<CloudSnow className="h-[1.2rem] w-[1.2rem]" />
</Button>
<Popover>
<PopoverTrigger>
<Button size="icon" variant="ghost" className="mb-1">

@ -0,0 +1,59 @@
/*
* MHSF, Minehut Server List
* All external content is rather licensed under the ECA Agreement
* located here: https://mhsf.app/docs/legal/external-content-agreement
*
* All code under MHSF is licensed under the MIT License
* by open source contributors
*
* Copyright (c) 2024 dvelo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
"use client";
import { CommandEvents } from "@/lib/commandEvent";
import { useEffect, useState } from "react";
import Snowfall from "react-snowfall";
export const snowfallEvents = new CommandEvents();
export default function SnowfallController() {
const [visible, setVisible] = useState(true);
useEffect(() => {
snowfallEvents.on("toggle", () => {
setVisible(!visible);
});
}, [visible]);
return (
<>
{visible && (
<Snowfall
style={{
position: "fixed",
width: "100vw",
height: "100vh",
}}
/>
)}
</>
);
}

@ -55,8 +55,26 @@ const FeatureList = ({
);
};
export const version = "1.6.0";
export const version = "1.6.50";
export const changelog: { name: string; id: string; changelog: ReactNode }[] = [
{
id: "dut6hx3f2paswzjve4yg9r",
name: "v1.6.5",
changelog: (
<FeatureList
features={[
"New MOTD engine that is over 3,000% faster, runs client-side, and doesn't need any requests to run.",
"Fixed issue where GitHub link was broken if you were signed-out",
"",
]}
title={
<strong className="flex items-center">
Version 1.6.5 (December 20th 2024)
</strong>
}
/>
),
},
{
id: "h9jr2cbxn7qwfvt5uypsdg",
name: "v1.6.0",

@ -28,7 +28,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
class CommandEvents {
export class CommandEvents {
eventTarget;
constructor() {

@ -1,36 +1,6 @@
/*
* MHSF, Minehut Server List
* All external content is rather licensed under the ECA Agreement
* located here: https://list.mlnehut.com/docs/legal/external-content-agreement
*
* All code under MHSF is licensed under the MIT License
* by open source contributors
*
* Copyright (c) 2024 dvelo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
import { OnlineServer } from "./types/mh-server";
import { toast } from "sonner";
import { getMOTDFromServer } from "./api";
import { OnlineServer } from "./types/mh-server";
import MiniMessage from "minimessage-js";
var numberOfItemsInView = 20;
@ -148,7 +118,20 @@ export default class ServersList {
async getMOTDs(
list: Array<{ server: string; motd: string }>
): Promise<Array<{ server: string; motd: string }>> {
return await getMOTDFromServer(list);
const result: Array<{ server: string; motd: string }> = [];
const mm = MiniMessage.miniMessage();
list.forEach((c) => {
try {
result.push({
server: c.server,
motd: mm.toHTML(mm.deserialize(c.motd)),
});
} catch (e) {
console.log(e);
}
});
return result;
}
}

@ -1,63 +1,33 @@
/*
* MHSF, Minehut Server List
* All external content is rather licensed under the ECA Agreement
* located here: https://list.mlnehut.com/docs/legal/external-content-agreement
*
* All code under MHSF is licensed under the MIT License
* by open source contributors
*
* Copyright (c) 2024 dvelo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
import { NextApiRequest, NextApiResponse } from "next";
import parseToHTML from "@/lib/motdEngine";
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
const initalList: Array<{ server: string; motd: string }> = req.body.motd;
const resultedList: Array<{ server: string; motd: string }> = [];
var interval = 0;
if (initalList != undefined && initalList.forEach != undefined) {
initalList.forEach((c, i) => {
parseToHTML(c.motd)
.then((m) => {
interval++;
resultedList.push({ motd: m, server: c.server });
if (interval == initalList.length) {
res.send({ result: resultedList });
}
})
.catch(() => {
resultedList.push({ motd: "Error to grab MOTD", server: c.server });
if (i == initalList.length - 1) {
res.send({ result: resultedList });
}
});
});
} else {
res.status(400).send({
message: "Wrong structure.. you might be using the legacy MOTD.",
});
}
// Deprecated - moved exclusively to the client
// const initalList: Array<{ server: string; motd: string }> = req.body.motd;
// const resultedList: Array<{ server: string; motd: string }> = [];
// var interval = 0;
// if (initalList != undefined && initalList.forEach != undefined) {
// initalList.forEach((c, i) => {
// parseToHTML(c.motd)
// .then((m) => {
// interval++;
// resultedList.push({ motd: m, server: c.server });
// if (interval == initalList.length) {
// res.send({ result: resultedList });
// }
// })
// .catch(() => {
// resultedList.push({ motd: "Error to grab MOTD", server: c.server });
// if (i == initalList.length - 1) {
// res.send({ result: resultedList });
// }
// });
// });
// } else {
// res.status(400).send({
// message: "Wrong structure.. you might be using the legacy MOTD.",
// });
// }
}

@ -6945,6 +6945,11 @@ react-fade-in@^2.0.1:
resolved "https://registry.yarnpkg.com/react-fade-in/-/react-fade-in-2.0.1.tgz#b4bcd7dac63d6857ebcd68facbff2f5f9616278f"
integrity sha512-oqS/WT4znaXEHmL+yo0IDUDY7uC9K4RP35j1SdRUEBspR09B2iIC0i8oJ28tPOr6Ez/L2aktF9p89j+DbsTVNw==
react-fast-compare@^3.2.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49"
integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==
react-fast-marquee@^1.6.5:
version "1.6.5"
resolved "https://registry.yarnpkg.com/react-fast-marquee/-/react-fast-marquee-1.6.5.tgz#98929ae93eef087a607a71e9d45ab76bba97dc16"
@ -7058,6 +7063,13 @@ react-smooth@^4.0.0:
prop-types "^15.8.1"
react-transition-group "^4.4.5"
react-snowfall@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/react-snowfall/-/react-snowfall-2.2.0.tgz#0856a72c4d29d27a6a14301c0f5deb51296fb4df"
integrity sha512-dRk7vEHq/ZUOG+JHk2k/hH3HmliOWGXr4rKRDeW4mjWuHeI1r5h0Lc1r2jnTtUS1im702d6tCmNGymlNTdhXYg==
dependencies:
react-fast-compare "^3.2.2"
react-style-singleton@^2.2.1:
version "2.2.1"
resolved "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.1.tgz"
@ -7694,6 +7706,11 @@ strip-json-comments@^3.1.1:
resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz"
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
stripe-gradient@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/stripe-gradient/-/stripe-gradient-1.0.1.tgz#27f90ac9c3a90cb3a2771bb43407951aca16bad2"
integrity sha512-ttxSoPcJDXoYBPF7yG2TPC9ZZC1bc/ITxP8g0Yx5jo07dFT/wMcGn6CbjbHOtC0NBu8zZgJwJulCpK21WyRJEg==
style-to-object@^0.4.1:
version "0.4.4"
resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.4.4.tgz#266e3dfd56391a7eefb7770423612d043c3f33ec"