Merge branch 'main' into typobranch

This commit is contained in:
mauro 🤙
2024-08-24 16:58:47 +02:00
committed by GitHub
12 changed files with 123 additions and 37 deletions

View File

@@ -1,11 +1,22 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "raw.githubusercontent.com",
},
],
},
experimental: { experimental: {
serverActions: { serverActions: {
// edit: updated to new key. Was previously `allowedForwardedHosts` // edit: updated to new key. Was previously `allowedForwardedHosts`
allowedOrigins: ['localhost:3000', 'get-zen.vercel.app'], allowedOrigins: ["localhost:3000", "get-zen.vercel.app"],
}, },
}, },
compiler: {
styledComponents: true,
},
}; };
export default nextConfig; export default nextConfig;

View File

@@ -1,7 +1,8 @@
import type { Metadata } from "next"; import type { Metadata } from "next";
import { Inter } from "next/font/google"; import { Inter } from "next/font/google";
import "./globals.css"; import "./globals.css";
import { ThemeProvider } from "@/components/theme-provider" import { ThemeProvider } from "@/components/theme-provider";
import StyledComponentsRegistry from "@/lib/styled-components-registry";
const inter = Inter({ subsets: ["latin"] }); const inter = Inter({ subsets: ["latin"] });
@@ -25,7 +26,7 @@ export default function RootLayout({
enableSystem enableSystem
disableTransitionOnChange disableTransitionOnChange
> >
{children} <StyledComponentsRegistry>{children}</StyledComponentsRegistry>
</ThemeProvider> </ThemeProvider>
</body> </body>
</html> </html>

View File

@@ -52,7 +52,7 @@ Zen Browser offers a "Sync" feature, this is implemented using Mozilla Firefox's
# 4. Data Security # 4. Data Security
Although Zen Browser does not collect your data, we are committed to protecting the information that is stored locally on your device and, if you use the Sync feature, the encrypted data stored on Mozilla's servers. We recommend that you use secure passwords, enable device encryption, and regularly update your software to ensure your data remains safe. Although Zen Browser does not collect your data, we are committed to protecting the information that is stored locally on your device and, if you use the Sync feature, the encrypted data stored on Mozilla's servers. We recommend that you use secure passwords, enable device encryption, and regularly update your software to ensure your data remains safe.
* Note that most of the security measures are taken care by mozilla firefox. * Note that most of the security measures are taken care by Mozilla Firefox.
# 5. Your Control # 5. Your Control
## 5.1. Data Deletion ## 5.1. Data Deletion

View File

@@ -1,3 +1,4 @@
import { LOGO_COLORS } from "@/lib/logos"; import { LOGO_COLORS } from "@/lib/logos";
export function BrandingAssets() { export function BrandingAssets() {
@@ -19,6 +20,7 @@ export function BrandingAssets() {
<div className="flex items-center my-2"> <div className="flex items-center my-2">
<a <a
href={`/logos/zen-${color}.svg`} href={`/logos/zen-${color}.svg`}
download={`zen-${color}.svg`}
className="text-blue-500 text-md ml-2" className="text-blue-500 text-md ml-2"
> >
{color} {color}
@@ -40,7 +42,7 @@ export function BrandingAssets() {
<div className="flex items-center my-2"> <div className="flex items-center my-2">
<a <a
href={`/logos/zen-alpha-${color}.svg`} href={`/logos/zen-alpha-${color}.svg`}
download={`zen-alpha-${color}.png`} download={`zen-alpha-${color}.svg`}
className="text-blue-500 text-md ml-2" className="text-blue-500 text-md ml-2"
> >
{color} {color}

View File

@@ -180,9 +180,19 @@ export default function CreateThemePage() {
<input type="text" className="border text-gray-500 rounded-lg p-2 w-2/3" value={colorsBorder} onChange={(e) => setColorsBorder(e.target.value)} /> <input type="text" className="border text-gray-500 rounded-lg p-2 w-2/3" value={colorsBorder} onChange={(e) => setColorsBorder(e.target.value)} />
<div className="w-11 h-11 ml-4 rounded-lg border bg-[var(--zen-colors-border)]"></div> <div className="w-11 h-11 ml-4 rounded-lg border bg-[var(--zen-colors-border)]"></div>
</div> </div>
<h2 className="text-lg mt-8 font-bold opacity-70">
Dialog background color
</h2>
<div className="flex items-center mt-2">
<input type="text" className="border text-gray-500 rounded-lg p-2 w-2/3" value={dialogBg} onChange={(e) => setDialogBg(e.target.value)} />
<div className="w-11 h-11 ml-4 rounded-lg border bg-[var(--zen-dialog-background)]"></div>
</div>
<div className="text-md font-bold text-muted-foreground mt-8">
Right now, we aren't taking more color themes 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> <Sheet>
<SheetTrigger asChild> <SheetTrigger asChild>
<Button className="mt-8">Create theme</Button> <Button disabled className="mt-8">Create theme</Button>
</SheetTrigger> </SheetTrigger>
<SheetContent className="!w-[600px] !max-w-lg"> <SheetContent className="!w-[600px] !max-w-lg">
<SheetHeader> <SheetHeader>

View File

@@ -245,7 +245,7 @@ export default function DownloadPage() {
className="mt-5" className="mt-5"
onClick={() => onClick={() =>
(window.location.href = (window.location.href =
"https://github.com/zen-browser/desktop/issues/53") "https://docs.zen-browser.app/guides/install-macos")
} }
> >
Download Zen for MacOS Download Zen for MacOS

View File

@@ -28,6 +28,7 @@ import {
UpdateIcon, UpdateIcon,
} from "@radix-ui/react-icons"; } from "@radix-ui/react-icons";
import Image from "next/image"; import Image from "next/image";
import Link from "next/link";
import { Button } from './ui/button'; import { Button } from './ui/button';
import { COLORS } from './create-theme'; import { COLORS } from './create-theme';
import { Slider } from './ui/slider'; import { Slider } from './ui/slider';
@@ -73,7 +74,7 @@ export default function Features() {
Goodbye bad performance Goodbye bad performance
</h2> </h2>
<p className="text-center text-sm mt-2 text-muted-foreground"> <p className="text-center text-sm mt-2 text-muted-foreground">
We are constantly tweaking Firefox's engine and settings to make it We constantly tweak Firefox's engine and settings to make it
faster than ever. <a className="text-blue-500" href="https://github.com/zen-browser/desktop/blob/main/docs/performance.md" target='_blank'>Learn more</a> faster than ever. <a className="text-blue-500" href="https://github.com/zen-browser/desktop/blob/main/docs/performance.md" target='_blank'>Learn more</a>
</p> </p>
</div> </div>
@@ -117,8 +118,6 @@ export default function Features() {
</Sticky> </Sticky>
</div> </div>
<div className="relative md:grid border-t-2 md:border-l-2 md:col-span-2 md:grid-cols-2 row-span-2"> <div className="relative md:grid border-t-2 md:border-l-2 md:col-span-2 md:grid-cols-2 row-span-2">
<div className="w-1/2 absolute md:relative z-[-1] opacity-50 md:opacity-1 md:w-full h-full border-r-2 md:border-r"></div>
<div className="w-1/2 absolute md:relative z-[-1] hidden md:block md:w-full h-full border-l"></div>
<div className="p-16 md:px-32 h-full md:absolute top-0 left-0 flex flex-col"> <div className="p-16 md:px-32 h-full md:absolute top-0 left-0 flex flex-col">
<div className=""> <div className="">
<div> <div>
@@ -129,17 +128,17 @@ export default function Features() {
We are always looking for ways to make your experience better. With stackable themes that can be mixed and matched, you can create a browser that is truly yours. <a className="text-blue-500" href="https://docs.zen-browser.app/themes-store/themes-marketplace">Learn more</a> We are always looking for ways to make your experience better. With stackable themes that can be mixed and matched, you can create a browser that is truly yours. <a className="text-blue-500" href="https://docs.zen-browser.app/themes-store/themes-marketplace">Learn more</a>
</p> </p>
</div> </div>
<Button className="mt-4 rounded-full p-5 ml-auto">Download zen now!</Button> <Link href="/download"><Button className="mt-4 rounded-full p-5 ml-auto">Download Zen now!</Button></Link>
</div> </div>
<div className="border rounded-lg shadow-md mt-16 mx-auto p-4 bg-white dark:bg-black flex w-fit transform -translate-x-1/3"> <div className="border rounded-lg shadow-md mt-16 mx-auto p-4 bg-white dark:bg-black flex w-fit transform -translate-x-1/3">
{COLORS.map((color) => ( {COLORS.map((color) => (
<div key={color} className="w-5 h-5 rounded-full mx-3 " style={{ backgroundColor: color }} /> <div key={color} className="w-5 h-5 rounded-full mx-3 " style={{ backgroundColor: color }} />
))} ))}
</div> </div>
<div className="border w-1/2 rounded-lg shadow-md mt-16 mx-auto p-4 bg-white dark:bg-black flex w-fit transform translate-x-[calc(50%-1.5rem)]"> <div className="border w-1/2 rounded-lg shadow-md mt-16 mx-auto p-4 bg-white dark:bg-black flex transform translate-x-[calc(50%-1.5rem)]">
<Slider defaultValue={[80]} max={100} /> <Slider defaultValue={[80]} max={100} />
</div> </div>
<a href='/themes' className="border-2 md:w-1/2 flex items-center justify-center rounded-xl shadow-md mt-16 mx-auto p-4 bg-white dark:bg-black border-blue-500 flex w-fit text-muted-foreground"> <a href='/themes' className="border-2 w-fit md:w-1/2 lg:w-fit flex items-center justify-center rounded-xl shadow-md mt-16 mx-auto p-4 bg-white dark:bg-black border-blue-500 flex text-muted-foreground">
<span> <span>
Checkout our themes store Checkout our themes store
</span> </span>
@@ -148,8 +147,6 @@ export default function Features() {
</div> </div>
</div> </div>
<div className="relative md:grid md:border-l-2 border-t-2 md:col-span-2 grid-cols-2 row-span-2"> <div className="relative md:grid md:border-l-2 border-t-2 md:col-span-2 grid-cols-2 row-span-2">
<div className="w-1/2 absolute md:relative z-[-1] opacity-50 md:opacity-1 md:w-full h-full border-r-2 md:border-r"></div>
<div className="w-1/2 absolute md:relative z-[-1] hidden md:block md:w-full h-full border-l"></div>
<div className="p-16 md:px-32 h-full md:absolute top-0 left-0 flex flex-col"> <div className="p-16 md:px-32 h-full md:absolute top-0 left-0 flex flex-col">
<div className="flex flex-col md:flex-row"> <div className="flex flex-col md:flex-row">
<div className='relative'> <div className='relative'>
@@ -163,7 +160,7 @@ export default function Features() {
Killer feature Killer feature
</div> </div>
</div> </div>
<Button className="mt-4 rounded-full p-5 ml-4">Download zen now!</Button> <Link href="/download"><Button className="mt-4 rounded-full p-5 ml-4">Download Zen now!</Button></Link>
</div> </div>
<img src="/compact-mode.png" className="scale-105 hover:scale-110 transform rotate-[-2deg] transition-all duration-100 rounded-md w-full shadow-md dark:shadow-none dark:border-2 mt-16 border-blue-600" /> <img src="/compact-mode.png" className="scale-105 hover:scale-110 transform rotate-[-2deg] transition-all duration-100 rounded-md w-full shadow-md dark:shadow-none dark:border-2 mt-16 border-blue-600" />
</div> </div>

View File

@@ -97,7 +97,7 @@ export default function ReleaseNoteElement({ data }: { data: ReleaseNote }) {
</div> </div>
<div className="flex flex-wrap items-center justify-center"> <div className="flex flex-wrap items-center justify-center">
<Link href="/download"> <Link href="/download">
<Button className="mt-12 w-fit mx-auto">Download zen now!</Button> <Button className="mt-12 w-fit mx-auto">Download Zen now!</Button>
</Link> </Link>
</div> </div>
</div> </div>

View File

@@ -1,7 +1,7 @@
import Image from "next/image";
import { getThemeAuthorLink, ZenTheme } from "@/lib/themes"; import { getThemeAuthorLink, ZenTheme } from "@/lib/themes";
import styled from "styled-components"; import styled from "styled-components";
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./ui/dialog"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./ui/dialog";import { Button } from "./ui/button";
import { Button } from "./ui/button";
const ThemeCardWrapepr = styled.div` const ThemeCardWrapepr = styled.div`
`; `;
@@ -15,8 +15,9 @@ export default function ThemeCard({
<ThemeCardWrapepr onClick={(event) => { <ThemeCardWrapepr onClick={(event) => {
if (event.target instanceof HTMLAnchorElement) return; if (event.target instanceof HTMLAnchorElement) return;
window.open(`/themes/${theme.id}`, "_self"); window.open(`/themes/${theme.id}`, "_self");
}} className="flex flex-col justify-start p-5 rounded-lg shadow-sm bg-muted dark:bg-muted/50 border border-grey-900 dark:border-muted w-full hover:shadow-lg transition duration-300 ease-in-out hover:bg-muted/100 hover:border-blue-500 cursor-pointer select-none hover:border-blue-500 hover:shadow-lg"> }} className="flex flex-col justify-start p-5 rounded-lg shadow-sm bg-muted dark:bg-muted/50 border border-grey-900 dark:border-muted w-full hover:shadow-lg transition duration-300 ease-in-out hover:bg-muted/100 hover:border-blue-500 cursor-pointer select-none ">
<img src={theme.image} alt={theme.name} className="w-full h-32 object-cover rounded-lg border shadow" /> <Image src={theme.image} alt={theme.name} width={500} height={500} quality={100}
className="w-full h-32 object-cover rounded-lg border shadow" />
<h2 className="text-xl font-bold mt-4 overflow-ellipsis text-start">{theme.name}</h2> <h2 className="text-xl font-bold mt-4 overflow-ellipsis text-start">{theme.name}</h2>
<div className="flex mt-2"> <div className="flex mt-2">
{theme.homepage && ( {theme.homepage && (

View File

@@ -1,20 +1,25 @@
import Image from "next/image";
import { getThemeAuthorLink, getThemeMarkdown, ZenTheme } from "@/lib/themes"; import { getThemeAuthorLink, getThemeMarkdown, ZenTheme } from "@/lib/themes";
import { Button } from "./ui/button"; import { Button } from "./ui/button";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Markdown from "react-markdown"; import Markdown from "react-markdown";
import '../app/privacy-policy/markdown.css'; import '../app/privacy-policy/markdown.css';
import { ChevronLeft, LoaderCircleIcon, LoaderIcon, LoaderPinwheelIcon, MoveLeftIcon } from "lucide-react"; import { ChevronLeft, LoaderCircleIcon } from "lucide-react";
export default function ThemePage({ theme }: { theme: ZenTheme }) { export default function ThemePage({ theme }: { theme: ZenTheme }) {
const [readme, setReadme] = useState<string | null>(null); const [readme, setReadme] = useState<string | null>(null);
useEffect(() => { useEffect(() => {
getThemeMarkdown(theme).then(setReadme); getThemeMarkdown(theme).then(setReadme);
}, []); }, [theme]);
return ( return (
<div className="mt-24 lg:mt-56 flex-col lg:flex-row relative flex mx-auto items-start relative"> <div className="mt-24 lg:mt-56 flex-col lg:flex-row flex mx-auto items-start relative">
<div className="flex flex-col relative lg:fixed w-md h-full p-5 lg:p-0 lg:pr-5 mr-5 w-full md:max-w-sm"> <div className="flex flex-col relative lg:sticky lg:top-0 w-md h-full p-5 lg:p-0 lg:pr-5 mr-5 w-full md:max-w-sm">
<img src={theme.image} alt={theme.name} className="w-full object-cover rounded-lg border-2 shadow" /> <div className="flex mt-2 mb-9 items-center cursor-pointer opacity-70" onClick={() => window.history.back()}>
<ChevronLeft className="w-4 h-4 mr-1" />
<h3 className="text-md">Go back</h3>
</div>
<Image src={theme.image} alt={theme.name} width={500} height={500} className="w-full object-cover rounded-lg border-2 shadow" />
<h1 className="text-2xl mt-5 font-bold">{theme.name}</h1> <h1 className="text-2xl mt-5 font-bold">{theme.name}</h1>
<p className="text-sm text-muted-foreground mt-2">{theme.description}</p> <p className="text-sm text-muted-foreground mt-2">{theme.description}</p>
{theme.homepage && ( {theme.homepage && (
@@ -41,11 +46,7 @@ export default function ThemePage({ theme }: { theme: ZenTheme }) {
<p id="install-theme-error" className="text-muted-foreground text-sm mt-2">You need to have Zen Browser installed to install this theme. <a href="/download" className="text-blue-500">Download now!</a></p> <p id="install-theme-error" className="text-muted-foreground text-sm mt-2">You need to have Zen Browser installed to install this theme. <a href="/download" className="text-blue-500">Download now!</a></p>
</div> </div>
<hr className="block my-4 lg:hidden" /> <hr className="block my-4 lg:hidden" />
<div className="flex flex-col lg:border-l lg:min-h-96 pl-10 lg:ml-[25rem] max-w-xl lg:min-w-96 w-full"> <div className="flex flex-col lg:border-l lg:min-h-96 px-5 lg:pl-10 max-w-xl lg:min-w-96 w-full">
<div className="flex my-2 items-center cursor-pointer opacity-70" onClick={() => window.history.back()}>
<ChevronLeft className="w-4 h-4 mr-1" />
<h3 className="text-md">Go back</h3>
</div>
<div id="policy" className="w-full"> <div id="policy" className="w-full">
{readme === null ? ( {readme === null ? (
<LoaderCircleIcon className="animate-spin w-12 h-12 mx-auto" /> <LoaderCircleIcon className="animate-spin w-12 h-12 mx-auto" />

View File

@@ -566,7 +566,41 @@ export const releaseNotes: ReleaseNote[] = [
issue: 355 issue: 355
} }
] ]
},
{
version: "1.0.0-a.28",
date: "22/08/2024",
extra: "This release is the twenty-eighth alpha release of the 1.0.0-alpha series.",
features: [
"Enabled JPEG XL",
"Changed Zen Core Components license to CC BY-SA",
"Added support for color themes in theme creation",
"Fixed sidebar shortcuts",
"Started work on browser translations"
],
fixes: [
{
description: "No way to restore native theming to toolbar",
issue: 426
},
{
description: "Address bar icons are hidden",
issue: 430
},
{
description: "Tabs don't appear in vertical tab bar",
issue: 429
},
{
description: "Location bar is not focused when opening new window",
issue: 414
},
{
description: "The treshhold for the expanded tab sidebar in compact mode is too high",
issue: 389
} }
]
},
].reverse(); ].reverse();
export function releaseNoteIsAlpha(note: ReleaseNote) { export function releaseNoteIsAlpha(note: ReleaseNote) {

View File

@@ -0,0 +1,29 @@
"use client";
import React, { useState } from "react";
import { useServerInsertedHTML } from "next/navigation";
import { ServerStyleSheet, StyleSheetManager } from "styled-components";
export default function StyledComponentsRegistry({
children,
}: {
children: React.ReactNode;
}) {
// Only create stylesheet once with lazy initial state
// x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state
const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet());
useServerInsertedHTML(() => {
const styles = styledComponentsStyleSheet.getStyleElement();
styledComponentsStyleSheet.instance.clearTag();
return <>{styles}</>;
});
if (typeof window !== "undefined") return <>{children}</>;
return (
<StyleSheetManager sheet={styledComponentsStyleSheet.instance}>
{children}
</StyleSheetManager>
);
}