Fix formatting in status.json and themes-search.tsx

This commit is contained in:
mauro-balades
2024-09-30 16:58:46 +02:00
parent f0e7db050d
commit 4f6bef1850
10 changed files with 335 additions and 111 deletions

View File

@@ -1 +1 @@
{ "ZenBot":200 }
{ "ZenBot": 200 }

View File

@@ -1 +1,172 @@
!function(){"use strict";(t=>{const{screen:{width:e,height:a},navigator:{language:r},location:n,localStorage:i,document:c,history:o}=t,{hostname:s,href:u}=n,{currentScript:l,referrer:d}=c;if(!l)return;const f="data-",m=l.getAttribute.bind(l),h=m(f+"website-id"),p=m(f+"host-url"),g=m(f+"tag"),y="false"!==m(f+"auto-track"),b="true"===m(f+"exclude-search"),v=m(f+"domains")||"",S=v.split(",").map((t=>t.trim())),w=`${(p||""||l.src.split("/").slice(0,-1).join("/")).replace(/\/$/,"")}/api/send`,N=`${e}x${a}`,T=/data-umami-event-([\w-_]+)/,A=f+"umami-event",x=300,O=t=>{if(t){try{const e=decodeURI(t);if(e!==t)return e}catch(e){return t}return encodeURI(t)}},U=t=>{try{const{pathname:e,search:a}=new URL(t);t=e+a}catch(t){}return b?t.split("?")[0]:t},j=()=>({website:h,hostname:s,screen:N,language:r,title:O(q),url:O(D),referrer:O(_),tag:g||void 0}),k=(t,e,a)=>{a&&(_=D,D=U(a.toString()),D!==_&&setTimeout(I,x))},E=()=>!h||i&&i.getItem("umami.disabled")||v&&!S.includes(s),L=async(t,e="event")=>{if(E())return;const a={"Content-Type":"application/json"};void 0!==R&&(a["x-umami-cache"]=R);try{const r=await fetch(w,{method:"POST",body:JSON.stringify({type:e,payload:t}),headers:a}),n=await r.text();return R=n}catch(t){}},$=()=>{B||(I(),(()=>{const t=(t,e,a)=>{const r=t[e];return(...e)=>(a.apply(null,e),r.apply(t,e))};o.pushState=t(o,"pushState",k),o.replaceState=t(o,"replaceState",k)})(),(()=>{const t=new MutationObserver((([t])=>{q=t&&t.target?t.target.text:void 0})),e=c.querySelector("head > title");e&&t.observe(e,{subtree:!0,characterData:!0,childList:!0})})(),c.addEventListener("click",(async t=>{const e=t=>["BUTTON","A"].includes(t),a=async t=>{const e=t.getAttribute.bind(t),a=e(A);if(a){const r={};return t.getAttributeNames().forEach((t=>{const a=t.match(T);a&&(r[a[1]]=e(t))})),I(a,r)}},r=t.target,i=e(r.tagName)?r:((t,a)=>{let r=t;for(let t=0;t<a;t++){if(e(r.tagName))return r;if(r=r.parentElement,!r)return null}})(r,10);if(!i)return a(r);{const{href:e,target:r}=i,c=i.getAttribute(A);if(c)if("A"===i.tagName){const o="_blank"===r||t.ctrlKey||t.shiftKey||t.metaKey||t.button&&1===t.button;if(c&&e)return o||t.preventDefault(),a(i).then((()=>{o||(n.href=e)}))}else if("BUTTON"===i.tagName)return a(i)}}),!0),B=!0)},I=(t,e)=>L("string"==typeof t?{...j(),name:t,data:"object"==typeof e?e:void 0}:"object"==typeof t?t:"function"==typeof t?t(j()):j()),K=t=>L({...j(),data:t},"identify");t.umami||(t.umami={track:I,identify:K});let R,B,D=U(u),_=d!==s?d:"",q=c.title;y&&!E()&&("complete"===c.readyState?$():c.addEventListener("readystatechange",$,!0))})(window)}();
!(function () {
"use strict";
((t) => {
const {
screen: { width: e, height: a },
navigator: { language: r },
location: n,
localStorage: i,
document: c,
history: o,
} = t,
{ hostname: s, href: u } = n,
{ currentScript: l, referrer: d } = c;
if (!l) return;
const f = "data-",
m = l.getAttribute.bind(l),
h = m(f + "website-id"),
p = m(f + "host-url"),
g = m(f + "tag"),
y = "false" !== m(f + "auto-track"),
b = "true" === m(f + "exclude-search"),
v = m(f + "domains") || "",
S = v.split(",").map((t) => t.trim()),
w = `${(p || "" || l.src.split("/").slice(0, -1).join("/")).replace(/\/$/, "")}/api/send`,
N = `${e}x${a}`,
T = /data-umami-event-([\w-_]+)/,
A = f + "umami-event",
x = 300,
O = (t) => {
if (t) {
try {
const e = decodeURI(t);
if (e !== t) return e;
} catch (e) {
return t;
}
return encodeURI(t);
}
},
U = (t) => {
try {
const { pathname: e, search: a } = new URL(t);
t = e + a;
} catch (t) {}
return b ? t.split("?")[0] : t;
},
j = () => ({
website: h,
hostname: s,
screen: N,
language: r,
title: O(q),
url: O(D),
referrer: O(_),
tag: g || void 0,
}),
k = (t, e, a) => {
a && ((_ = D), (D = U(a.toString())), D !== _ && setTimeout(I, x));
},
E = () =>
!h || (i && i.getItem("umami.disabled")) || (v && !S.includes(s)),
L = async (t, e = "event") => {
if (E()) return;
const a = { "Content-Type": "application/json" };
void 0 !== R && (a["x-umami-cache"] = R);
try {
const r = await fetch(w, {
method: "POST",
body: JSON.stringify({ type: e, payload: t }),
headers: a,
}),
n = await r.text();
return (R = n);
} catch (t) {}
},
$ = () => {
B ||
(I(),
(() => {
const t = (t, e, a) => {
const r = t[e];
return (...e) => (a.apply(null, e), r.apply(t, e));
};
(o.pushState = t(o, "pushState", k)),
(o.replaceState = t(o, "replaceState", k));
})(),
(() => {
const t = new MutationObserver(([t]) => {
q = t && t.target ? t.target.text : void 0;
}),
e = c.querySelector("head > title");
e &&
t.observe(e, { subtree: !0, characterData: !0, childList: !0 });
})(),
c.addEventListener(
"click",
async (t) => {
const e = (t) => ["BUTTON", "A"].includes(t),
a = async (t) => {
const e = t.getAttribute.bind(t),
a = e(A);
if (a) {
const r = {};
return (
t.getAttributeNames().forEach((t) => {
const a = t.match(T);
a && (r[a[1]] = e(t));
}),
I(a, r)
);
}
},
r = t.target,
i = e(r.tagName)
? r
: ((t, a) => {
let r = t;
for (let t = 0; t < a; t++) {
if (e(r.tagName)) return r;
if (((r = r.parentElement), !r)) return null;
}
})(r, 10);
if (!i) return a(r);
{
const { href: e, target: r } = i,
c = i.getAttribute(A);
if (c)
if ("A" === i.tagName) {
const o =
"_blank" === r ||
t.ctrlKey ||
t.shiftKey ||
t.metaKey ||
(t.button && 1 === t.button);
if (c && e)
return (
o || t.preventDefault(),
a(i).then(() => {
o || (n.href = e);
})
);
} else if ("BUTTON" === i.tagName) return a(i);
}
},
!0,
),
(B = !0));
},
I = (t, e) =>
L(
"string" == typeof t
? { ...j(), name: t, data: "object" == typeof e ? e : void 0 }
: "object" == typeof t
? t
: "function" == typeof t
? t(j())
: j(),
),
K = (t) => L({ ...j(), data: t }, "identify");
t.umami || (t.umami = { track: I, identify: K });
let R,
B,
D = U(u),
_ = d !== s ? d : "",
q = c.title;
y &&
!E() &&
("complete" === c.readyState
? $()
: c.addEventListener("readystatechange", $, !0));
})(window);
})();

View File

@@ -25,9 +25,20 @@ export default async function RootLayout({
<head>
<link rel="me" href="https://fosstodon.org/@zenbrowser"></link>
{/* Analitics */}
<script defer src="https://cdn.jsdelivr.net/gh/zen-browser/www/public/uma.js" data-host-url="https://uma.zen-browser.app" data-website-id="7148ef7c-5299-4ca1-9a18-9d6964e93b53" data-domains="zen-browser.app"></script>
<script
defer
src="https://cdn.jsdelivr.net/gh/zen-browser/www/public/uma.js"
data-host-url="https://uma.zen-browser.app"
data-website-id="7148ef7c-5299-4ca1-9a18-9d6964e93b53"
data-domains="zen-browser.app"
></script>
{/* End */}
<link rel="alternate" type="application/rss+xml" title="Zen Browser Release Notes" href="https://www.zen-browser.app/feed.xml" />
<link
rel="alternate"
type="application/rss+xml"
title="Zen Browser Release Notes"
href="https://www.zen-browser.app/feed.xml"
/>
</head>
<body className={inter.className}>
<ThemeProvider attribute="class" defaultTheme="dark">

View File

@@ -291,9 +291,9 @@ export default function CreateThemePage() {
<div className="ml-4 h-11 w-11 rounded-lg border bg-[var(--zen-dialog-background)]"></div>
</div>
<div className="text-md mt-8 font-bold text-muted-foreground">
Right now, we aren't taking more color Mods for the browser,
until we find a way to make it more accessible for everyone.
However, you can still create your own theme and share it with the
Right now, we aren't taking more color Mods for the browser, until
we find a way to make it more accessible for everyone. However,
you can still create your own theme and share it with the
community.
</div>
<Sheet>

View File

@@ -190,7 +190,7 @@ export default function DownloadPage() {
};
const linuxAppimageBashScript =
'bash <(curl https://updates.zen-browser.app/appimage.sh)';
"bash <(curl https://updates.zen-browser.app/appimage.sh)";
return (
<>
@@ -533,7 +533,7 @@ export default function DownloadPage() {
"mb-2 ml-5 flex h-full w-full cursor-pointer select-none flex-col items-center rounded-lg border bg-background p-5",
selectedLinuxDownloadType === "flatpak"
? "border-blue-400"
: ""
: "",
)}
>
<h1 className="my-2 text-5xl opacity-40 dark:opacity-20">

View File

@@ -13,9 +13,16 @@ export default function Footer() {
<Logo />
<div className="mt-auto">
<h1 className="text-2xl font-bold opacity-80">Zen Browser</h1>
<a data-umami-event="footer-status" href="https://uptime.zen-browser.app/" className="py-2 px-3 w-fit mt-2 cursor-pointer rounded-md shadow bg-surface flex items-center">
<div className="rounded-full size-3 bg-green-500 relative shadow">
<div className="rounded-full size-3 bg-green-500 animate-ping absolute top-[-0.2%] z-0" style={{ animationDuration: "1.7s" }}></div>
<a
data-umami-event="footer-status"
href="https://uptime.zen-browser.app/"
className="mt-2 flex w-fit cursor-pointer items-center rounded-md bg-surface px-3 py-2 shadow"
>
<div className="relative size-3 rounded-full bg-green-500 shadow">
<div
className="absolute top-[-0.2%] z-0 size-3 animate-ping rounded-full bg-green-500"
style={{ animationDuration: "1.7s" }}
></div>
</div>
<p className="ml-3 !text-sm font-bold opacity-40">
System Status
@@ -54,7 +61,10 @@ export default function Footer() {
<h2 className="text-md font-bold opacity-80">Get Help</h2>
<ul className="mt-4 font-normal opacity-70">
<li>
<a data-umami-event="footer-discord" href="https://discord.com/servers/mauro-s-little-sweatshop-1088172780480114748">
<a
data-umami-event="footer-discord"
href="https://discord.com/servers/mauro-s-little-sweatshop-1088172780480114748"
>
Discord
</a>
</li>
@@ -70,7 +80,12 @@ export default function Footer() {
<a href="/about">About Us</a>
</li>
<li className="mt-2">
<a data-umami-event="footer-privacy-policy" href="/privacy-policy">Privacy Policy</a>
<a
data-umami-event="footer-privacy-policy"
href="/privacy-policy"
>
Privacy Policy
</a>
</li>
</ul>
</div>
@@ -93,10 +108,20 @@ export default function Footer() {
<h2 className="text-md mt-8 font-bold opacity-80">Support Us</h2>
<ul className="mt-4 font-normal opacity-70">
<li>
<a data-umami-event="patreon-fotter" href="https://patreon.com/zen_browser">Patreon</a>
<a
data-umami-event="patreon-fotter"
href="https://patreon.com/zen_browser"
>
Patreon
</a>
</li>
<li className="mt-2">
<a data-umami-event="ko-fi-fotter" href="https://ko-fi.com/zen_browser">Ko-fi</a>
<a
data-umami-event="ko-fi-fotter"
href="https://ko-fi.com/zen_browser"
>
Ko-fi
</a>
</li>
</ul>
</div>

View File

@@ -11,25 +11,25 @@ export default function MarketplacePage({ themes }: { themes: ZenTheme[] }) {
const [tags, setTags] = React.useState<string[]>(["all"]);
return (
<div className="mx-auto flex flex-col lg:flex-row h-full w-full relative">
<div className="relative shadow bg-surface w-full lg:w-fit lg:rounded-br-lg lg:rounded-tr-lg lg:mt-24 py-48 lg:py-32 px-10 dark:bg-[#121212] w-full lg:w-1/2 xl:w-1/3 2xl:w-1/4">
<div className="relative mx-auto flex h-full w-full flex-col lg:flex-row">
<div className="relative w-full bg-surface px-10 py-48 shadow dark:bg-[#121212] lg:mt-24 lg:w-1/2 lg:w-fit lg:rounded-br-lg lg:rounded-tr-lg lg:py-32 xl:w-1/3 2xl:w-1/4">
<StickyBox
className="h-fit min-w-52 text-xs text-muted-foreground lg:mb-0"
offsetTop={120}
>
<h1 className="text-4xl font-bold lg:text-7xl">Mods Store</h1>
<p className="mt-4 text-lg text-muted-foreground">
Discover and install Mods for Zen Browser.
</p>
<ThemesSearch
input={searchInput}
setInput={setSearchInput}
tags={tags}
setTags={setTags}
/>
<h1 className="text-4xl font-bold lg:text-7xl">Mods Store</h1>
<p className="mt-4 text-lg text-muted-foreground">
Discover and install Mods for Zen Browser.
</p>
<ThemesSearch
input={searchInput}
setInput={setSearchInput}
tags={tags}
setTags={setTags}
/>
</StickyBox>
</div>
<div className="mt-10 grid w-full grid-cols-1 pt-12 gap-8 lg:gap-y-16 px-5 xl:grid-cols-2 lg:w-1/2 lg:px-10 xl:w-2/3 2xl:w-3/4 2xl:grid-cols-3">
<div className="mt-10 grid w-full grid-cols-1 gap-8 px-5 pt-12 lg:w-1/2 lg:gap-y-16 lg:px-10 xl:w-2/3 xl:grid-cols-2 2xl:w-3/4 2xl:grid-cols-3">
{getThemesFromSearch(themes, searchInput, tags).map((theme) => (
<ThemeCard key={theme.name} theme={theme} />
))}

View File

@@ -38,7 +38,7 @@ export default function ThemeCard({
<img
src={theme.image}
alt={theme.name}
className="h-48 rounded-xl border-2 object-cover shadow overflow-hidden border-[rgba(0,0,0,.5)] dark:border-[#333]"
className="h-48 overflow-hidden rounded-xl border-2 border-[rgba(0,0,0,.5)] object-cover shadow dark:border-[#333]"
/>
<h2 className="mt-4 overflow-ellipsis text-start text-xl font-bold">
{theme.name.substring(0, maxNameLen).trim() +

View File

@@ -52,7 +52,7 @@ export default function ThemesSearch({
key={tag}
onClick={() => setTags([tag])}
className={ny(
`!rounded-full px-5 !min-w-24 !py-2 !h-fit ${tags.includes(tag) ? "bg-black text-white dark:bg-white dark:text-black" : ""}`,
`!h-fit !min-w-24 !rounded-full !py-2 px-5 ${tags.includes(tag) ? "bg-black text-white dark:bg-white dark:text-black" : ""}`,
)}
>
{tag.replace(/-/g, " ")}

View File

@@ -985,12 +985,11 @@ export const releaseNotes: ReleaseNote[] = [
{
version: "1.0.1-a.4",
date: "23/09/2024",
image: true,
image: true,
workflowId: 11000317603,
extra: "This update addresses some significant issues with the previous release.\n\nWe appreciate your patience and support!",
features: [
"Added a new system for handling keyboard shortcuts",
],
extra:
"This update addresses some significant issues with the previous release.\n\nWe appreciate your patience and support!",
features: ["Added a new system for handling keyboard shortcuts"],
fixes: [
{
description: "The New Tab button is not visible",
@@ -1005,88 +1004,106 @@ export const releaseNotes: ReleaseNote[] = [
issue: 1636,
},
{
description: "Expand-on-hover doesn't work properly when compact mode is enabled",
description:
"Expand-on-hover doesn't work properly when compact mode is enabled",
},
{
description: "Fixed an issue with reordering tabs",
},
{
description: "Fixed an issue with reordering tabs",
}
],
},
{
version: "1.0.1-a.5",
date: "24/09/2024",
image: false,
{
version: "1.0.1-a.5",
date: "24/09/2024",
image: false,
workflowId: 11020784612,
extra: "This update is a small patch to fix some issues that weren't addressed in the previous release!",
extra:
"This update is a small patch to fix some issues that weren't addressed in the previous release!",
features: [
"Moved application menu button to the right",
"Added new shortcuts",
"Collapsed tab sidebar is now smaller"
],
fixes: [
{
description: "Fixed issue with hovering over window control buttons (macOS)",
},
{
description: "(Hopefully) resolved all issues with keyboard shortcuts",
issue: 1629
},
],
},
{
version: "1.0.1-a.6",
date: "29/09/2024",
image: true,
"Moved application menu button to the right",
"Added new shortcuts",
"Collapsed tab sidebar is now smaller",
],
fixes: [
{
description:
"Fixed issue with hovering over window control buttons (macOS)",
},
{
description: "(Hopefully) resolved all issues with keyboard shortcuts",
issue: 1629,
},
],
},
{
version: "1.0.1-a.6",
date: "29/09/2024",
image: true,
workflowId: 11095257662,
extra: "This release fixes a few critical bugs and introduces Tab Unloading! Unused tabs will free up memory with this new feature",
extra:
"This release fixes a few critical bugs and introduces Tab Unloading! Unused tabs will free up memory with this new feature",
features: [
"Added Paste and Go button",
"Added Tab Unloading",
"Sidebar Web Panel can now be moved freely",
"Added warning when shortcut setting changes are unsaved",
"Enabled container tabs by default",
"Improved Expand Tabs on Hover layout"
],
themeChanges: [
"Toggle inputs will not use the themed tertiary color",
],
breakingChanges: [
"The keyboard shortcuts will be overriden by the defaults ones in this update.",
],
fixes: [
{
description: "Fixed Firefox add-ons not updating",
issue: 1173
},
{
description: "Fixed expand-on-hover shifting web page",
issue: 1718
},
{
description: "Fixed cycling between workspaces with shortcuts",
},
{
description: "Removed duplicate shortcut options in the settings",
issue: 1784
},
{
description: "Restored missing keyboard shortcuts",
issue: 1706
},
{
description: "Fixed keyboard shortcuts not saving",
issue: 1715
},
{
description: "Fixed workspace names that start with an emoji",
issue: 1732
},
{
description: "Fixed shortcut keys incorrectly displayed on macOS"
}
]
}
"Added Paste and Go button",
"Added Tab Unloading",
"Sidebar Web Panel can now be moved freely",
"Added warning when shortcut setting changes are unsaved",
"Enabled container tabs by default",
"Improved Expand Tabs on Hover layout",
],
themeChanges: ["Toggle inputs will not use the themed tertiary color"],
breakingChanges: [
"The keyboard shortcuts will be overriden by the defaults ones in this update.",
],
fixes: [
{
description: "Fixed Firefox add-ons not updating",
issue: 1173,
},
{
description: "Fixed expand-on-hover shifting web page",
issue: 1718,
},
{
description: "Fixed cycling between workspaces with shortcuts",
},
{
description: "Removed duplicate shortcut options in the settings",
issue: 1784,
},
{
description: "Restored missing keyboard shortcuts",
issue: 1706,
},
{
description: "Fixed keyboard shortcuts not saving",
issue: 1715,
},
{
description: "Fixed workspace names that start with an emoji",
issue: 1732,
},
{
description: "Fixed shortcut keys incorrectly displayed on macOS",
},
],
},
{
version: "1.0.1-a.7",
date: "01/10/2024",
image: false,
workflowId: 11108707060,
extra:
"This release is a really small release to fix a very important bug that was introduced in the previous release.",
fixes: [
{
description:
"Fixed a critical issue with the sidebar being 1 pixel small",
},
{
description: "Fixed tabs separation always showing",
},
],
},
].reverse();
export function releaseNoteIsAlpha(note: ReleaseNote) {