fix: Small polishes + remove isolation and CSP

This commit is contained in:
LynithDev 2024-09-16 19:35:04 +02:00
parent 885da4f798
commit 0c4673990a
11 changed files with 26 additions and 81 deletions

5
Cargo.lock generated
View file

@ -1249,7 +1249,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
"generic-array",
"rand_core 0.6.4",
"typenum",
]
@ -7287,7 +7286,6 @@ dependencies = [
"semver",
"serde",
"serde_json",
"tauri-codegen",
"tauri-utils",
"tauri-winres",
"toml 0.8.2",
@ -7585,12 +7583,10 @@ version = "2.0.0-rc.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d53d9fe87e985b273696ae22ce2b9f099a8f1b44bc8fb127467bda5fcb3e4371"
dependencies = [
"aes-gcm",
"brotli",
"cargo_metadata",
"ctor",
"dunce",
"getrandom 0.2.15",
"glob",
"html5ever",
"infer",
@ -7608,7 +7604,6 @@ dependencies = [
"serde-untagged",
"serde_json",
"serde_with",
"serialize-to-javascript",
"swift-rs",
"thiserror",
"toml 0.8.2",

View file

@ -16,7 +16,7 @@ name = "onelauncher_gui"
crate-type = [ "staticlib", "cdylib", "lib" ]
[build-dependencies]
tauri-build = { workspace = true, features = [ "isolation" ] }
tauri-build = { workspace = true }
[dependencies]
onelauncher = { workspace = true, features = [ "tauri", "specta" ] }
@ -48,7 +48,6 @@ tracing-error = { workspace = true }
[dependencies.tauri]
workspace = true
features = [
"isolation",
"macos-private-api",
"image-ico",
"image-png",

View file

@ -6,58 +6,7 @@
"withGlobalTauri": true,
"macOSPrivateApi": true,
"security": {
"csp": {
"default-src": [
"'self'",
"customprotocol:",
"asset:"
],
"connect-src": [
"https://modrinth.com",
"https://api.modrinth.com",
"https://polyfrost.org",
"https://*.polyfrost.org",
"https://*.cloudflare.com",
"https://api.mclo.gs",
"ipc:",
"http://ipc.localhost"
],
"img-src": [
"'self'",
"tauri:",
"https:",
"data:",
"blob:",
"'unsafe-inline'",
"asset:",
"https://asset.localhost"
],
"script-src": [
"'self'",
"https://*.cloudflare.com",
"https://*.polyfrost.org"
],
"frame-src": [
"https://*.cloudflare.com",
"https://www.youtube.com",
"https://www.youtube-nocookie.com",
"https://discord.com",
"https://*.githubusercontent.com",
"'self'",
"'unsafe-inline'"
],
"style-src": [
"'unsafe-inline'",
"unsafe-inline",
"'self'"
]
},
"pattern": {
"use": "isolation",
"options": {
"dir": "../frontend/isolation/"
}
},
"csp": null,
"assetProtocol": {
"enable": true,
"scope": {

View file

@ -1,12 +1 @@
import '@unocss/reset/tailwind.css';
import '@fontsource/poppins/400.css';
import '@fontsource/poppins/500.css';
import '@fontsource/poppins/600.css';
import 'overlayscrollbars/overlayscrollbars.css';
import 'virtual:uno.css';
import '~styles/globals.css';
import '~styles/highlightjs.css';
import '~utils/patches';
export * as bridge from '@onelauncher/client/bindings';

View file

@ -1,10 +1,22 @@
/* @refresh reload */
import { Route, Router } from '@solidjs/router';
/* eslint-disable perfectionist/sort-imports -- Import order does matter Here */
import '~utils/patches';
import '@fontsource/poppins/400.css';
import '@fontsource/poppins/500.css';
import '@fontsource/poppins/600.css';
import 'virtual:uno.css';
import '@unocss/reset/tailwind.css';
import 'overlayscrollbars/overlayscrollbars.css';
import '~styles/globals.css';
import '~styles/highlightjs.css';
import App from '~ui/pages/App';
import BrowserRoot from '~ui/pages/browser/BrowserRoot';
import ClusterRoot from '~ui/pages/cluster/ClusterRoot';
import Onboarding from '~ui/pages/onboarding/Onboarding';
import SettingsRoot from '~ui/pages/settings/SettingsRoot';
import { render } from 'solid-js/web';

View file

@ -1,5 +1,5 @@
.button {
@apply py-1.5 px-3 rounded-lg flex flex-row justify-center items-center gap-x-2.5 h-9.5;
@apply py-1.5 px-3 rounded-lg flex flex-row justify-center items-center gap-x-2.5;
&__primary, &__iconPrimary {
@apply text-onbrand hover:text-onbrand-hover active:text-onbrand-pressed disabled:text-onbrand-disabled;

View file

@ -1,8 +1,8 @@
import type { Ref } from '@solid-primitives/refs';
import type { OnUpdatedEventListenerArgs, OverlayScrollbars } from 'overlayscrollbars';
import { AlignBottom01Icon } from '@untitled-theme/icons-solid';
import { OverlayScrollbarsComponent, type OverlayScrollbarsComponentRef } from 'overlayscrollbars-solid';
import { createEffect, createMemo, createSignal, Index, Show, untrack } from 'solid-js';
import type { Ref } from '@solid-primitives/refs';
import type { OnUpdatedEventListenerArgs, OverlayScrollbars } from 'overlayscrollbars';
import Button from '../base/Button';
import styles from './FormattedLog.module.scss';
@ -41,7 +41,7 @@ function FormattedLog(props: FormattedLogProps) {
}
return (
<div class="relative h-full flex flex-1 flex-col rounded-md bg-component-bg">
<div class="relative h-full flex flex-1 flex-col overflow-hidden rounded-md bg-component-bg">
<Show when={props.enableAutoScroll === true}>
<div class="absolute right-0 top-0 z-1 h-6 w-full flex flex-row justify-end border border-gray-05 rounded-t-md bg-page p-px">
<Button.Toggle

View file

@ -1,7 +1,7 @@
import type { ParentProps } from 'solid-js';
import { useNavigate } from '@solidjs/router';
import useSettings from '~ui/hooks/useSettings';
import { OverlayScrollbarsComponent } from 'overlayscrollbars-solid';
import type { ParentProps } from 'solid-js';
import AnimatedRoutes from '../components/AnimatedRoutes';
import Navbar from '../components/Navbar';
@ -19,8 +19,8 @@ function App(props: ParentProps) {
</div>
<div class="h-full w-full overflow-hidden">
<div class="relative h-full w-full flex flex-col overflow-x-hidden">
<OverlayScrollbarsComponent class="os-hide-horizontal-scrollbar absolute left-0 top-0 h-full w-full flex flex-col overflow-x-hidden overflow-y-auto px-8 pb-8">
<div class="relative h-full w-full flex flex-col overflow-x-hidden pb-8">
<OverlayScrollbarsComponent class="os-hide-horizontal-scrollbar absolute left-0 top-0 h-full w-full flex flex-col overflow-x-hidden overflow-y-auto px-8">
<div class="h-full flex-1">
<AnimatedRoutes>
{props.children}

View file

@ -1,10 +1,10 @@
import type { ManagedPackage } from '@onelauncher/client/bindings';
import { ChevronRightIcon } from '@untitled-theme/icons-solid';
import OneConfigLogo from '~assets/logos/oneconfig.svg?component-solid';
import Button from '~ui/components/base/Button';
import SearchResultsContainer from '~ui/components/content/SearchResults';
import useBrowser from '~ui/hooks/useBrowser';
import { onMount, Show } from 'solid-js';
import type { ManagedPackage } from '@onelauncher/client/bindings';
import { BrowserContent } from './BrowserRoot';
function BrowserMain() {

View file

@ -120,6 +120,7 @@ function BrowserSidebar() {
<Button
buttonStyle="secondary"
children={controller.cluster()?.meta.name || 'None'}
class="h-9.5"
onClick={controller.displayClusterSelector}
/>
</div>

View file

@ -1,12 +1,12 @@
import type { UserConfig } from 'vite';
import process from 'node:process';
import { sentryVitePlugin as sentry } from '@sentry/vite-plugin';
import unocss from 'unocss/vite';
import { defineConfig, loadEnv } from 'vite';
import solid from 'vite-plugin-solid';
import solidSvg from 'vite-plugin-solid-svg';
import paths from 'vite-tsconfig-paths';
import type { UserConfig } from 'vite';
export default defineConfig(async ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd(), '') };