chore: update dependencies to latest

This commit is contained in:
Jones Jankovic committed 2026-11-02 12:48:38 +10:30
1 parent a63e6c168e
commit 919fb5a286
79 files changed
+12263 -3718

No files matched your search

-34
View File
@@ -1,34 +0,0 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true,
"node": true
},
"extends": ["eslint:recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "import"],
"ignorePatterns": ["**/*.d.ts"],
"globals": {
"__ENABLE_GH_RELEASE_UPDATE_CHECK__": "readonly",
"__GH_RELEASE_REPO__": "readonly",
"__UPDATE_CHANNEL__": "readonly",
"__BUILD_LABEL__": "readonly"
},
"rules": {
"no-unused-vars": "off",
"no-undef": "off",
"no-useless-escape": "off",
"no-prototype-builtins": "off",
"no-empty": "off",
"no-case-declarations": "off",
"no-irregular-whitespace": "off",
"sort-imports": "off",
"import/extensions": "off",
"no-async-promise-executor": "off"
}
}
-2
View File
@@ -7,5 +7,3 @@ runs:
- name: Lint
shell: bash
run: npm run lint
env:
ESLINT_USE_FLAT_CONFIG: "false"
+2 -2
View File
@@ -1,5 +1,5 @@
name: Setup Node and dependencies
description: Install Node.js 22.x and npm dependencies.
description: Install Node.js 22.x and npm dependencies from the lockfile.
runs:
using: composite
@@ -11,4 +11,4 @@ runs:
- name: Install dependencies
shell: bash
run: npm install --legacy-peer-deps
run: npm ci
-5
View File
@@ -1,10 +1,5 @@
# npm
node_modules/
package-lock.json
bun.lockb
pnpm-lock.yaml
yarn.lock
bun.lock
# PDF.js extension assets (copied by postinstall from pdfjs-dist)
src/public/resources/pdfjs/pdf.worker.min.mjs
-1
View File
@@ -1 +0,0 @@
legacy-peer-deps=true
-3001
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -42,7 +42,7 @@ cd BetterSEQTA-plus
### 2. Install Dependencies (3 minutes)
```bash
npm install --legacy-peer-deps
npm install
```
### 3. Start Development Server (2 minutes)
+2 -2
View File
@@ -54,7 +54,7 @@ All release and CI builds that need packaged extensions use the composite action
It:
1. Installs dependencies (`npm install --legacy-peer-deps`)
1. Installs dependencies (`npm ci`)
2. Runs `npm run build` (Chrome then Firefox via Vite)
3. Zips each unpacked folder into sideload-ready archives:
- `dist/betterseqtaplus-{version}-chrome.zip`
@@ -154,7 +154,7 @@ The nightly release body warns that builds are experimental and must not be uplo
**Steps:**
1. `npm install --legacy-peer-deps`
1. `npm ci`
2. `npm run lint` (ESLint on `src/**/*.{js,ts}`)
3. Build via the shared action with **no** update detector
+6 -6
View File
@@ -21,8 +21,8 @@ Having issues with BetterSEQTA+ development? This guide covers the most common p
**Solution**:
```bash
rm -rf node_modules package-lock.json
npm install --legacy-peer-deps
rm -rf node_modules
npm install
```
### ❌ "Cannot find module" errors
@@ -33,18 +33,18 @@ npm install --legacy-peer-deps
1. **Clear and reinstall**:
```bash
rm -rf node_modules
npm install --legacy-peer-deps
npm install
```
2. **Check Node.js version**:
```bash
node --version # Should be v16 or higher
node --version # Should be v22.12 or higher
```
3. **Try with npm cache clean**:
```bash
npm cache clean --force
npm install --legacy-peer-deps
npm install
```
### ❌ Permission errors on macOS/Linux
@@ -246,7 +246,7 @@ sudo chown -R $(whoami) /usr/local/lib/node_modules
2. **Clear cache and rebuild**:
```bash
rm -rf dist node_modules
npm install --legacy-peer-deps
npm install
npm run build
```
+1 -1
View File
@@ -52,7 +52,7 @@ cd betterseqta-plus
Using npm:
```bash
npm install --legacy-peer-deps
npm install
```
Using Bun (recommended):
+34
View File
@@ -0,0 +1,34 @@
import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
export default [
{ ignores: ["**/*.d.ts"] },
js.configs.recommended,
{
files: ["src/**/*.{js,ts}"],
languageOptions: {
parser: tseslint.parser,
ecmaVersion: "latest",
sourceType: "module",
globals: {
...globals.browser,
...globals.node,
__ENABLE_GH_RELEASE_UPDATE_CHECK__: "readonly",
__GH_RELEASE_REPO__: "readonly",
__UPDATE_CHANNEL__: "readonly",
__BUILD_LABEL__: "readonly",
},
},
rules: {
"no-unused-vars": "off",
"no-undef": "off",
"no-useless-escape": "off",
"no-prototype-builtins": "off",
"no-empty": "off",
"no-case-declarations": "off",
"no-irregular-whitespace": "off",
"no-async-promise-executor": "off",
},
},
];
+11887
View File
File diff suppressed because it is too large. Load diff
+58 -65
View File
@@ -4,6 +4,9 @@
"type": "module",
"description": "Enhance SEQTA Learn's usability and aesthetics! A fork of BetterSEQTA to continue development and add heaps more features!",
"browserslist": "> 0.5%, last 2 versions, not dead",
"engines": {
"node": ">=22.12"
},
"scripts": {
"compile:layerchart": "node scripts/compile-layerchart-vendor.mjs",
"postinstall": "node scripts/copy-runtime-assets.mjs && npm run compile:layerchart",
@@ -18,7 +21,7 @@
"build:dev": "cross-env MODE=chrome SOURCEMAP=true vite build && cross-env MODE=firefox SOURCEMAP=true vite build",
"convert:safari": "xcrun safari-web-extension-converter dist/safari --project-location . --app-name $npm_package_name-safari",
"dependency-graph": "depcruise src --include-only \"^src\" --output-type dot | dot -T svg > dependency-graph.svg",
"lint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint \"src/**/*.{js,ts}\"",
"lint": "eslint \"src/**/*.{js,ts}\"",
"test": "npm run test:unit",
"test:unit": "jest",
"test:smoke": "node scripts/smoke-test.mjs",
@@ -35,87 +38,77 @@
},
"license": "MIT",
"devDependencies": {
"@babel/runtime": "^7.26.9",
"@bedframe/cli": "^0.1.2",
"@crxjs/vite-plugin": "^2.6.1",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@tailwindcss/forms": "^0.5.10",
"@tsconfig/svelte": "^5.0.4",
"@types/chrome": "^0.1.4",
"@types/color": "^4.2.0",
"@crxjs/vite-plugin": "^3.0.0",
"@eslint/js": "^10.0.1",
"@sveltejs/vite-plugin-svelte": "^7.3.1",
"@tailwindcss/forms": "^0.5.11",
"@tailwindcss/postcss": "^4.3.3",
"@tsconfig/svelte": "^5.0.8",
"@types/chrome": "^0.3.7",
"@types/d3-scale": "^4.0.9",
"@types/d3-shape": "^3.1.8",
"@types/d3-shape": "^3.2.0",
"@types/jest": "^30.0.0",
"@types/mime-types": "^3.0.1",
"@types/node": "^24.3.0",
"@types/node": "^26.6.6",
"@types/qrcode": "^1.5.6",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/sortablejs": "^1.15.8",
"@types/webextension-polyfill": "^0.12.3",
"@typescript-eslint/eslint-plugin": "^8.60.1",
"@typescript-eslint/parser": "^8.60.1",
"autoprefixer": "^10.4.21",
"cross-env": "^10.0.0",
"dependency-cruiser": "^17.0.1",
"esbuild": "^0.25.3",
"eslint": "^9.33.0",
"eslint-plugin-import": "^2.31.0",
"glob": "^13.0.6",
"jest": "^30.4.2",
"jest-environment-jsdom": "^30.4.1",
"mime-types": "^3.0.1",
"postcss": "^8.5.3",
"prettier": "^3.5.3",
"publish-browser-extension": "^4.0.4",
"sass": "^1.85.1",
"tailwindcss": "3",
"ts-jest": "^29.4.11",
"typescript": "^5.8.2",
"vite": "^6.2.1"
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@types/sortablejs": "^1.15.9",
"@types/webextension-polyfill": "^0.12.6",
"cross-env": "^10.1.0",
"dependency-cruiser": "^18.7.1",
"esbuild": "^0.28.2",
"eslint": "^10.14.0",
"glob": "^14.0.3",
"globals": "^17.14.0",
"jest": "^30.5.2",
"jest-environment-jsdom": "^30.5.2",
"mime-types": "^3.0.2",
"prettier": "^3.9.10",
"publish-browser-extension": "^6.2.0",
"sass": "^1.107.1",
"tailwindcss": "^4.3.3",
"ts-jest": "^29.4.15",
"typescript": "~6.0.3",
"typescript-eslint": "^8.72.1",
"vite": "^8.3.5"
},
"dependencies": {
"@bedframe/core": "^0.1.0",
"@codemirror/autocomplete": "^6.18.6",
"@codemirror/commands": "^6.8.0",
"@codemirror/autocomplete": "^6.20.4",
"@codemirror/commands": "^6.11.1",
"@codemirror/lang-css": "^6.3.1",
"@codemirror/language": "^6.10.8",
"@codemirror/search": "^6.5.10",
"@codemirror/state": "^6.5.2",
"@codemirror/view": "^6.36.4",
"@codemirror/language": "^6.13.1",
"@codemirror/search": "^6.7.2",
"@codemirror/state": "^6.7.6",
"@codemirror/view": "^6.43.15",
"@huggingface/transformers": "^3.8.1",
"@uiw/codemirror-extensions-color": "^4.23.10",
"@uiw/codemirror-theme-github": "^4.23.10",
"canvas-confetti": "^1.9.3",
"color": "^5.0.0",
"@uiw/codemirror-extensions-color": "^4.25.12",
"@uiw/codemirror-theme-github": "^4.25.12",
"canvas-confetti": "^1.9.4",
"color": "^5.0.3",
"d3-scale": "^4.0.2",
"d3-shape": "^3.2.0",
"dompurify": "^3.2.4",
"dompurify": "^3.4.17",
"embeddia": "^1.3.0",
"embla-carousel-autoplay": "^8.5.2",
"embla-carousel-svelte": "^8.5.2",
"fuse.js": "^7.1.0",
"layerchart": "2.0.0-next.27",
"embla-carousel-autoplay": "^8.6.0",
"embla-carousel-svelte": "^8.6.0",
"fuse.js": "^7.5.0",
"layerchart": "^2.9.2",
"localforage": "^1.10.0",
"mathjs": "^14.4.0",
"motion": "^12.4.12",
"pdfjs-dist": "^5.4.530",
"mathjs": "^15.2.0",
"motion": "^14.9.0",
"pdfjs-dist": "^6.5.438",
"qrcode": "^1.5.4",
"react": "17",
"react-best-gradient-color-picker": "3.0.11",
"react-dom": "17",
"react": "^19.3.1",
"react-best-gradient-color-picker": "^3.0.14",
"react-dom": "^19.3.1",
"rss-parser": "^3.13.0",
"semver": "^7.7.1",
"sortablejs": "^1.15.6",
"svelte": "^5.46.4",
"sortablejs": "^1.15.7",
"svelte": "^5.57.3",
"webextension-polyfill": "^0.12.0"
},
"overrides": {
"glob": "^13.0.6"
},
"pnpm": {
"overrides": {
"glob": "^13.0.6"
}
"glob": "$glob"
}
}
+1 -1
View File
@@ -52,7 +52,7 @@ export function createCustomThemesHandlers(deps: {
}): Record<string, (request: any, sendResponse: MessageSender) => boolean> {
async function readCustomThemesResponse(r: Response): Promise<Record<string, unknown>> {
const text = await r.text();
let body: unknown = {};
let body: unknown;
try {
body = text ? JSON.parse(text) : {};
} catch {
+50
View File
@@ -0,0 +1,50 @@
/* Shared Tailwind setup for every stylesheet that uses utilities. */
@import "tailwindcss" source("../");
@plugin "@tailwindcss/forms";
@custom-variant dark (&:is(.dark *));
@theme {
--text-*: initial;
--text-xs: 0.65rem;
--text-sm: 0.775rem;
--text-base: 0.65rem;
--text-md: 0.65rem;
--text-lg: 1rem;
--text-xl: 1.25rem;
--text-2xl: 1.5rem;
--text-3xl: 1.875rem;
--text-4xl: 2.25rem;
--text-5xl: 3rem;
--text-6xl: 4rem;
--text-7xl: 5rem;
--text-8xl: 6rem;
--text-9xl: 8rem;
--text-10xl: 10rem;
--text-11xl: 12rem;
--text-12xl: 14rem;
--text-13xl: 16rem;
--text-14xl: 18rem;
--font-IconFamily: IconFamily;
--animate-spin-fast: spin 0.4s linear infinite;
--aspect-theme: 5 / 1;
}
@layer base {
/* Tailwind 4 defaults borders to `currentcolor`; keep the v3 look. */
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentcolor);
}
button {
cursor: pointer;
}
}
+1 -1
View File
@@ -26,7 +26,7 @@
type="button"
onclick={onClick}
disabled={disabled}
class="inline-flex items-center justify-center gap-1.5 px-5 py-1.5 text-[0.75rem] shadow-2xl border rounded-lg transition enabled:active:scale-[0.96] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 disabled:cursor-not-allowed disabled:opacity-50 {variants[variant]} {className}"
class="inline-flex items-center justify-center gap-1.5 px-5 py-1.5 text-[0.75rem] shadow-2xl border rounded-lg transition enabled:active:scale-[0.96] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-zinc-400 disabled:cursor-not-allowed disabled:opacity-50 {variants[variant]} {className}"
>
{#if icon}<span class="font-IconFamily text-base" aria-hidden="true">{icon}</span>{/if}
{text}
@@ -109,7 +109,7 @@
href="https://betterseqta.org/privacy"
target="_blank"
rel="noopener noreferrer"
class="font-medium text-emerald-600 underline decoration-emerald-600/50 underline-offset-2 hover:text-emerald-700 dark:text-emerald-400 dark:hover:text-emerald-300 rounded-sm"
class="font-medium text-emerald-600 underline decoration-emerald-600/50 underline-offset-2 hover:text-emerald-700 dark:text-emerald-400 dark:hover:text-emerald-300 rounded-xs"
>Privacy policy</a>
</p>
</div>
@@ -116,7 +116,7 @@
{#if showQrModal && qrDataUrl}
<div
use:portal
class="fixed cursor-auto inset-0 z-[10000] flex justify-center items-center bg-black/50 {isStandalone ? 'backdrop-blur-sm' : ''} {$settingsState.DarkMode ? 'dark' : ''}"
class="fixed cursor-auto inset-0 z-10000 flex justify-center items-center bg-black/50 {isStandalone ? 'backdrop-blur-xs' : ''} {$settingsState.DarkMode ? 'dark' : ''}"
role="button"
tabindex="-1"
onclick={(e) => {
@@ -28,7 +28,7 @@
</script>
<div
class="flex fixed inset-0 z-[10000] justify-center items-center bg-black/50 {$settingsState.DarkMode ? 'dark' : ''}"
class="flex fixed inset-0 z-10000 justify-center items-center bg-black/50 {$settingsState.DarkMode ? 'dark' : ''}"
style="position: fixed; top: 0; left: 0; right: 0; bottom: 0;"
onclick={(e) => {
if (e.target === e.currentTarget) onCancel();
+12 -12
View File
@@ -57,9 +57,9 @@
: "background-color:#fff;color:#18181b;border-color:#e4e4e7;color-scheme:light",
);
const field =
"feedback-field w-full px-3 py-2.5 text-[18px] rounded-lg border focus:outline-none focus:ring-2 focus:ring-zinc-400";
"feedback-field w-full px-3 py-2.5 text-[18px] rounded-lg border focus:outline-hidden focus:ring-2 focus:ring-zinc-400";
const btn =
"px-4 py-2 text-[18px] font-medium rounded-lg transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-none focus:ring-2 focus:ring-zinc-400 disabled:opacity-50";
"px-4 py-2 text-[18px] font-medium rounded-lg transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-zinc-400 disabled:opacity-50";
const btnMuted = $derived(
`${btn} ${isDark ? "bg-zinc-700 text-zinc-200" : "bg-zinc-200 text-zinc-700"}`,
);
@@ -175,14 +175,14 @@
<!-- Backdrop click target — separate from dialog so inner clicks never bubble to a "close" handler. -->
<div
class="feedback-overlay fixed inset-0 z-[99999] overflow-y-auto overscroll-contain {isDark
class="feedback-overlay fixed inset-0 z-99999 overflow-y-auto overscroll-contain {isDark
? 'dark'
: ''}"
transition:fade={{ duration: $settingsState.animations ? 200 : 0 }}
>
<button
type="button"
class="feedback-overlay__backdrop fixed inset-0 bg-black/50 backdrop-blur-sm border-0 p-0 cursor-default"
class="feedback-overlay__backdrop fixed inset-0 bg-black/50 backdrop-blur-xs border-0 p-0 cursor-default"
aria-label="Close feedback"
disabled={busy}
onclick={() => {
@@ -191,7 +191,7 @@
></button>
<div
class="feedback-overlay__center relative z-[1] flex min-h-full items-center justify-center p-4 sm:p-6 pointer-events-none"
class="feedback-overlay__center relative z-1 flex min-h-full items-center justify-center p-4 sm:p-6 pointer-events-none"
>
<!-- svelte-ignore a11y_no_static_element_interactions -->
<div
@@ -226,8 +226,8 @@
class="feedback-tab flex-1 px-3 py-2.5 rounded-full text-[18px] font-medium transition-all duration-200 {tab ===
'send'
? isDark
? 'bg-zinc-700 text-white font-semibold shadow-sm'
: 'bg-white text-zinc-900 font-semibold shadow-sm'
? 'bg-zinc-700 text-white font-semibold shadow-xs'
: 'bg-white text-zinc-900 font-semibold shadow-xs'
: isDark
? 'bg-transparent text-zinc-400 hover:text-zinc-200'
: 'bg-transparent text-zinc-500 hover:text-zinc-800'}"
@@ -242,8 +242,8 @@
class="feedback-tab flex-1 px-3 py-2.5 rounded-full text-[18px] font-medium transition-all duration-200 {tab ===
'status'
? isDark
? 'bg-zinc-700 text-white font-semibold shadow-sm'
: 'bg-white text-zinc-900 font-semibold shadow-sm'
? 'bg-zinc-700 text-white font-semibold shadow-xs'
: 'bg-white text-zinc-900 font-semibold shadow-xs'
: isDark
? 'bg-transparent text-zinc-400 hover:text-zinc-200'
: 'bg-transparent text-zinc-500 hover:text-zinc-800'}"
@@ -387,7 +387,7 @@
<h2 id="feedback-modal-title" class="text-xl font-bold">Feedback status</h2>
<button
type="button"
class="{btnMuted} !text-base !px-3 !py-1.5"
class="{btnMuted} text-base! px-3! py-1.5!"
onclick={() => {
selectedItem = null;
void loadStatusList();
@@ -430,7 +430,7 @@
<h2 id="feedback-modal-title" class="text-xl font-bold">My feedback</h2>
<button
type="button"
class="{btnMuted} !text-base !px-3 !py-1.5"
class="{btnMuted} text-base! px-3! py-1.5!"
onclick={() => void loadStatusList()}
disabled={statusLoading}
>
@@ -461,7 +461,7 @@
<button
type="button"
onclick={() => openStatusItem(item.id)}
class="w-full p-3 text-left rounded-lg border transition-all duration-200 hover:scale-[1.01] focus:outline-none focus:ring-2 focus:ring-zinc-400 {isDark
class="w-full p-3 text-left rounded-lg border transition-all duration-200 hover:scale-[1.01] focus:outline-hidden focus:ring-2 focus:ring-zinc-400 {isDark
? 'border-zinc-700 bg-zinc-900/40'
: 'border-zinc-200 bg-white'}"
>
@@ -8,7 +8,7 @@
<button
type="button"
{onclick}
class="flex h-10 w-10 shrink-0 items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] focus:outline-none dark:text-zinc-400 dark:hover:text-white"
class="flex h-10 w-10 shrink-0 items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] focus:outline-hidden dark:text-zinc-400 dark:hover:text-white"
aria-label={label}
>
<svg
@@ -65,7 +65,7 @@
{#if activeTheme?.mode === "optional" && snapshot.remoteTheme?.allowUserOptOut !== false}
<button
type="button"
class="rounded-lg bg-amber-600 px-3 py-1.5 text-xs font-semibold text-white transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-none focus:ring-2 focus:ring-amber-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900"
class="rounded-lg bg-amber-600 px-3 py-1.5 text-xs font-semibold text-white transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-amber-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900"
onclick={() => void turnOffOptionalTheme()}
>
Turn off school theme
@@ -74,7 +74,7 @@
{#if killActive && !isEffectiveBsplusEnabled() && allowOverride}
<button
type="button"
class="rounded-lg bg-amber-600 px-3 py-1.5 text-xs font-semibold text-white transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-none focus:ring-2 focus:ring-amber-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900"
class="rounded-lg bg-amber-600 px-3 py-1.5 text-xs font-semibold text-white transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-amber-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900"
onclick={enableLocalRun}
>
Run locally anyway
@@ -86,7 +86,7 @@
{/if}
<button
type="button"
class="rounded-lg border border-amber-300/80 px-3 py-1.5 text-xs font-medium transition-colors duration-200 hover:bg-amber-100/80 focus:outline-none focus:ring-2 focus:ring-amber-500 focus:ring-offset-2 dark:border-amber-800 dark:hover:bg-amber-900/50 dark:focus:ring-offset-zinc-900"
class="rounded-lg border border-amber-300/80 px-3 py-1.5 text-xs font-medium transition-colors duration-200 hover:bg-amber-100/80 focus:outline-hidden focus:ring-2 focus:ring-amber-500 focus:ring-offset-2 dark:border-amber-800 dark:hover:bg-amber-900/50 dark:focus:ring-offset-zinc-900"
onclick={openGeneralSettings}
>
General settings
@@ -29,7 +29,7 @@
</script>
<div
class="flex fixed inset-0 z-[99999] justify-center items-center bg-black/50"
class="flex fixed inset-0 z-99999 justify-center items-center bg-black/50"
onclick={(e) => {
if (e.target === e.currentTarget) onClose();
}}
+1 -1
View File
@@ -18,7 +18,7 @@
</script>
<div
class="flex w-14 p-1 cursor-pointer transition-all duration-150 rounded-full bg-gradient-to-tr select-none shadow-2xl ring-[1px] ring-[#DDDDDD]/30 dark:ring-[#38373D]/30 {checked ? 'to-[#30D259]/80 from-[#30D259] dark:from-[#30D259]/40 dark:to-[#30D259]' : 'dark:from-[#38373D]/50 dark:to-[#38373D] to-[#DDDDDD]/50 from-[#DDDDDD]'}"
class="flex w-14 p-1 cursor-pointer transition-all duration-150 rounded-full bg-linear-to-tr select-none shadow-2xl ring-[1px] ring-[#DDDDDD]/30 dark:ring-[#38373D]/30 {checked ? 'to-[#30D259]/80 from-[#30D259] dark:from-[#30D259]/40 dark:to-[#30D259]' : 'dark:from-[#38373D]/50 dark:to-[#38373D] to-[#DDDDDD]/50 from-[#DDDDDD]'}"
onclick={() => onChange(!checked)}
onkeydown={(e) => e.key === "Enter" && onChange(!checked)}
role="switch"
@@ -31,14 +31,14 @@
<div class="top-0 z-10 shrink-0 text-[0.875rem] pb-0.5 mx-4 px-2 tab-width-container" role="tablist">
<div class="flex relative">
<div
class="absolute top-0 left-0 z-0 h-full bg-gradient-to-tr dark:from-[#38373D]/80 dark:to-[#38373D] from-[#DDDDDD]/80 to-[#DDDDDD] rounded-full opacity-40 tab-width"
class="absolute top-0 left-0 z-0 h-full bg-linear-to-tr dark:from-[#38373D]/80 dark:to-[#38373D] from-[#DDDDDD]/80 to-[#DDDDDD] rounded-full opacity-40 tab-width"
style={`width: ${100 / Math.max(1, tabs.length)}%; transform: translateX(${activeTab * 100}%); transition: transform ${fullMotionEffectsEnabled() ? 250 : 0}ms cubic-bezier(0.22, 1, 0.36, 1)`}
></div>
{#each tabs as { title }, index}
<button
role="tab"
aria-selected={activeTab === index}
class="relative z-10 flex-1 px-4 py-2 focus-visible:outline-none"
class="relative z-10 flex-1 px-4 py-2 focus-visible:outline-hidden"
onclick={() => (activeTab = index)}
>
{title}
@@ -48,14 +48,14 @@
</div>
<div class="relative overflow-hidden px-4 flex-1 min-h-0">
<div
class="tab-scroll-fade absolute inset-x-4 top-0 h-3 bg-gradient-to-b from-white/80 dark:from-zinc-800/80 to-transparent pointer-events-none z-[1]"
class="tab-scroll-fade absolute inset-x-4 top-0 h-3 bg-linear-to-b from-white/80 dark:from-zinc-800/80 to-transparent pointer-events-none z-1"
aria-hidden="true"
></div>
{#each tabs as tab, index (index)}
{#if activeTab === index}
<div
role="tabpanel"
class="focus:outline-none w-full h-full min-h-0 pt-2 overflow-y-auto no-scrollbar pb-6 tab active relative"
class="focus:outline-hidden w-full h-full min-h-0 pt-2 overflow-y-auto no-scrollbar pb-6 tab active relative"
>
{#if tab.loader}
<LazyPanel loader={tab.loader} props={tab.props} />
@@ -20,7 +20,7 @@
{#if open}
<div
class="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm"
class="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-xs"
role="presentation"
onclick={(e) => {
if (e.target === e.currentTarget && !busy) onClose();
@@ -192,7 +192,7 @@
<li>
<button
type="button"
class="flex w-full items-center gap-4 rounded-xl border border-zinc-200 bg-white p-4 text-left transition hover:border-zinc-300 hover:shadow-sm dark:border-zinc-700 dark:bg-zinc-800 dark:hover:border-zinc-600"
class="flex w-full items-center gap-4 rounded-xl border border-zinc-200 bg-white p-4 text-left transition hover:border-zinc-300 hover:shadow-xs dark:border-zinc-700 dark:bg-zinc-800 dark:hover:border-zinc-600"
onclick={() => void communityState.openDetail(theme)}
>
{#if theme.coverImage}
@@ -10,7 +10,7 @@
</script>
<div class="mb-6 flex flex-wrap items-end gap-4">
<div class="min-w-[10rem]">
<div class="min-w-40">
<span class="mb-1 block text-sm font-medium">Status</span>
<Select
value={communityState.reviewStatusFilter}
@@ -22,7 +22,7 @@
]}
/>
</div>
<div class="min-w-[10rem]">
<div class="min-w-40">
<span class="mb-1 block text-sm font-medium">Source</span>
<Select
value={communityState.reviewSourceFilter}
@@ -73,7 +73,7 @@
onApply={(id) => void communityState.applyInstalledTheme(id)}
/>
{#if communityState.reviewPreviewError}
<p class="fixed bottom-6 left-1/2 z-[100000] -translate-x-1/2 rounded-lg bg-red-600 px-4 py-2 text-sm text-white" role="alert">
<p class="fixed bottom-6 left-1/2 z-100000 -translate-x-1/2 rounded-lg bg-red-600 px-4 py-2 text-sm text-white" role="alert">
{communityState.reviewPreviewError}
</p>
{/if}
@@ -187,7 +187,7 @@
<button
class={`px-4 py-2 text-sm font-medium transition-colors rounded-full
${activeTab === tab.toLowerCase() ? 'bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700' :
'bg-zinc-100 dark:bg-transparent dark:outline dark:outline-zinc-700 hover:bg-zinc-200 dark:hover:bg-zinc-700/20'}`}
'bg-zinc-100 dark:bg-transparent dark:outline-solid dark:outline-zinc-700 hover:bg-zinc-200 dark:hover:bg-zinc-700/20'}`}
onclick={() => activeTab = tab.toLowerCase() as typeof activeTab}
>
{tab}
@@ -266,7 +266,7 @@
</div>
{#if settingsState.devMode}
<div class="p-4 mt-8 rounded bg-zinc-100 dark:bg-zinc-800">
<div class="p-4 mt-8 rounded-sm bg-zinc-100 dark:bg-zinc-800">
<h3 class="mb-2 font-bold">Debug Info:</h3>
<p>{debugInfo}</p>
<p>Total backgrounds: {backgrounds.length}</p>
@@ -72,7 +72,7 @@
<button
type="button"
onclick={handleButtonClick}
class="flex items-center gap-2 bg-zinc-100/80 font-medium text-zinc-700 transition-colors duration-150 hover:bg-zinc-200 hover:text-zinc-950 focus:outline-none dark:bg-zinc-900/50 dark:text-zinc-200 dark:hover:bg-zinc-700 dark:hover:text-white {compact ? 'h-8 rounded-lg px-3 text-[0.75rem]' : 'h-12 rounded-full px-4 text-sm'}"
class="flex items-center gap-2 bg-zinc-100/80 font-medium text-zinc-700 transition-colors duration-150 hover:bg-zinc-200 hover:text-zinc-950 focus:outline-hidden dark:bg-zinc-900/50 dark:text-zinc-200 dark:hover:bg-zinc-700 dark:hover:text-white {compact ? 'h-8 rounded-lg px-3 text-[0.75rem]' : 'h-12 rounded-full px-4 text-sm'}"
>
{#if cloudState.isLoggedIn}
{#if cloudState.user?.pfpUrl}
@@ -88,7 +88,7 @@
{/if}
<span
class={alwaysShowUserName
? "inline max-w-[10rem] truncate"
? "inline max-w-40 truncate"
: "hidden max-w-24 truncate sm:inline"}
>
{cloudState.user?.displayName || cloudState.user?.username || cloudState.user?.email || "User"}
@@ -103,7 +103,7 @@
<!-- svelte-ignore a11y_click_events_have_key_events -->
<!-- svelte-ignore a11y_no_static_element_interactions -->
<div
class="cloud-dropdown absolute right-0 top-full mt-2 w-80 rounded-xl border border-zinc-200 dark:border-zinc-600 bg-white dark:bg-zinc-800 shadow-xl z-[100] overflow-hidden"
class="cloud-dropdown absolute right-0 top-full mt-2 w-80 rounded-xl border border-zinc-200 dark:border-zinc-600 bg-white dark:bg-zinc-800 shadow-xl z-100 overflow-hidden"
class:cloud-dropdown--motion={$settingsState.animations}
onclick={(e) => e.stopPropagation()}
>
@@ -19,8 +19,8 @@
const inputClass = $derived(
compact
? "w-full px-4 py-2 text-sm rounded-lg bg-zinc-100 dark:bg-zinc-800 dark:text-white border border-zinc-200 dark:border-zinc-600 focus:outline-none focus:ring-2 focus:ring-accent-ring focus:border-transparent transition-colors duration-200"
: "w-full px-4 py-3 text-base rounded-lg bg-zinc-100 dark:bg-zinc-800 dark:text-white border border-zinc-200 dark:border-zinc-600 focus:outline-none focus:ring-2 focus:ring-accent-ring focus:border-transparent transition-colors duration-200",
? "w-full px-4 py-2 text-sm rounded-lg bg-zinc-100 dark:bg-zinc-800 dark:text-white border border-zinc-200 dark:border-zinc-600 focus:outline-hidden focus:ring-2 focus:ring-accent-ring focus:border-transparent transition-colors duration-200"
: "w-full px-4 py-3 text-base rounded-lg bg-zinc-100 dark:bg-zinc-800 dark:text-white border border-zinc-200 dark:border-zinc-600 focus:outline-hidden focus:ring-2 focus:ring-accent-ring focus:border-transparent transition-colors duration-200",
);
const btnClass = $derived(
@@ -53,9 +53,9 @@
>
<img src={slide.imageUrl} alt="" class="absolute inset-0 z-0 h-full w-full object-cover" />
{#if slide.badgeFeatured === true}
<div class="absolute top-4 left-4 z-[2] pointer-events-none">
<div class="absolute top-4 left-4 z-2 pointer-events-none">
<span
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-100 shadow-sm"
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-100 shadow-xs"
aria-label="Featured theme"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-3.5 h-3.5">
@@ -69,7 +69,7 @@
</span>
</div>
{/if}
<div class="absolute bottom-0 left-0 z-[2] p-8">
<div class="absolute bottom-0 left-0 z-2 p-8">
<h2 class="text-4xl font-bold text-white">{slide.title}</h2>
{#if slide.subtitle}
<p class="text-lg font-medium text-white/95 mt-1 line-clamp-2">{slide.subtitle}</p>
@@ -31,7 +31,7 @@
}
</script>
<div class="p-4 bg-white rounded-lg shadow dark:bg-gray-800">
<div class="p-4 bg-white rounded-lg shadow-sm dark:bg-gray-800">
<h2 class="mb-4 text-xl font-semibold">Filters</h2>
<div class="mb-4">
@@ -49,7 +49,7 @@
</div>
<button
class="px-4 py-2 mt-4 text-white bg-red-500 rounded hover:bg-red-600"
class="px-4 py-2 mt-4 text-white bg-red-500 rounded-sm hover:bg-red-600"
onclick={clearFilters}
>
Clear Filters
+4 -4
View File
@@ -46,12 +46,12 @@
<button type="button" class="shrink-0" onclick={onLogoClick} aria-label="BetterSEQTA+">
<img
src={resolveExtensionAssetUrl(darkLogo)}
class="h-9 max-w-[10.5rem] object-contain object-left dark:hidden sm:h-10"
class="h-9 max-w-42 object-contain object-left dark:hidden sm:h-10"
alt=""
/>
<img
src={resolveExtensionAssetUrl(lightLogo)}
class="hidden h-9 max-w-[10.5rem] object-contain object-left dark:block sm:h-10"
class="hidden h-9 max-w-42 object-contain object-left dark:block sm:h-10"
alt=""
/>
</button>
@@ -63,7 +63,7 @@
>
<div class="relative flex">
<MotionDiv
class="absolute inset-y-0 left-0 z-0 w-1/3 rounded-full bg-white shadow-sm dark:bg-zinc-700"
class="absolute inset-y-0 left-0 z-0 w-1/3 rounded-full bg-white shadow-xs dark:bg-zinc-700"
animate={{ x: `${activeIndex * 100}%` }}
transition={{ type: "spring", stiffness: 250, damping: 25 }}
/>
@@ -119,7 +119,7 @@
{#if onToggleSize}
<button type="button" onclick={onToggleSize}
class="flex h-10 w-10 shrink-0 items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] focus:outline-none dark:text-zinc-400 dark:hover:text-white"
class="flex h-10 w-10 shrink-0 items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] focus:outline-hidden dark:text-zinc-400 dark:hover:text-white"
aria-label="Collapse settings" title="Collapse settings" aria-expanded="true">
<span class="font-IconFamily text-2xl" aria-hidden="true">{"\uec06"}</span>
</button>
@@ -77,12 +77,12 @@
onclick={handleCardClick}
>
<div
class="theme-card isolate bg-gray-50 w-full transition-[transform,box-shadow,border-color] duration-300 ease-out relative group flex flex-col rounded-xl overflow-clip border hover:scale-[1.02] hover:shadow-xl dark:hover:shadow-black/60 dark:bg-zinc-800 dark:border-white/[0.1] h-auto"
class="theme-card isolate bg-gray-50 w-full transition-[transform,box-shadow,border-color] duration-300 ease-out relative group flex flex-col rounded-xl overflow-clip border hover:scale-[1.02] hover:shadow-xl dark:hover:shadow-black/60 dark:bg-zinc-800 dark:border-white/10 h-auto"
>
{#if isCommunity}
<div class="absolute top-2 left-2 z-20 pointer-events-none">
<span
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-sky-100 text-sky-900 dark:bg-sky-950 dark:text-sky-100 shadow-sm"
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-sky-100 text-sky-900 dark:bg-sky-950 dark:text-sky-100 shadow-xs"
aria-label="Community theme"
>
Community
@@ -90,9 +90,9 @@
</div>
{/if}
{#if theme.featured === true}
<div class="absolute top-2 z-20 pointer-events-none {isCommunity ? 'left-[5.75rem]' : 'left-2'}">
<div class="absolute top-2 z-20 pointer-events-none {isCommunity ? 'left-23' : 'left-2'}">
<span
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-100 shadow-sm"
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-100 shadow-xs"
aria-label="Featured theme"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-3.5 h-3.5">
@@ -103,9 +103,9 @@
</div>
{/if}
{#if isInstalled}
<div class="absolute top-2 z-20 pointer-events-none {theme.featured === true ? (isCommunity ? 'left-[11rem]' : 'left-[5.5rem]') : isCommunity ? 'left-[5.75rem]' : 'left-2'}">
<div class="absolute top-2 z-20 pointer-events-none {theme.featured === true ? (isCommunity ? 'left-44' : 'left-22') : isCommunity ? 'left-23' : 'left-2'}">
<span
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-emerald-100 text-emerald-900 dark:bg-emerald-950 dark:text-emerald-100 shadow-sm"
class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-emerald-100 text-emerald-900 dark:bg-emerald-950 dark:text-emerald-100 shadow-xs"
aria-label="Installed"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-3.5 h-3.5">
@@ -119,7 +119,7 @@
<button
type="button"
data-theme-favorite
class="pointer-events-none absolute right-2 top-2 z-20 flex h-10 w-10 scAle-[0.25] items-center justify-center rounded-full bg-black/50 text-white opacity-0 blur-[4px] transition-[opacity,transform,filter,background-color] duration-200 ease-[cubic-bezier(0.2,0,0,1)] hover:bg-black/70 active:scale-[0.96] group-hover:pointer-events-auto group-hover:scale-100 group-hover:opacity-100 group-hover:blur-0 focus-visible:pointer-events-auto focus-visible:scale-100 focus-visible:opacity-100 focus-visible:blur-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white"
class="pointer-events-none absolute right-2 top-2 z-20 flex h-10 w-10 scAle-[0.25] items-center justify-center rounded-full bg-black/50 text-white opacity-0 blur-xs transition-[opacity,transform,filter,background-color] duration-200 ease-[cubic-bezier(0.2,0,0,1)] hover:bg-black/70 active:scale-[0.96] group-hover:pointer-events-auto group-hover:scale-100 group-hover:opacity-100 group-hover:blur-0 focus-visible:pointer-events-auto focus-visible:scale-100 focus-visible:opacity-100 focus-visible:blur-0 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-white"
onclick={handleFavoriteClick}
aria-label={isLoggedIn
? theme.is_favorited
@@ -150,7 +150,7 @@
{#if theme.author}
<span class="text-xs text-white/85 drop-shadow-md line-clamp-1">By {theme.author}</span>
{/if}
<div class="flex gap-3 text-xs font-medium text-white/90 drop-shadow-sm">
<div class="flex gap-3 text-xs font-medium text-white/90 drop-shadow-xs">
<span class="flex items-center gap-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3.5 h-3.5">
<path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" />
@@ -195,7 +195,7 @@ else await runRemove(theme.id)
}
</script>
<div
class="flex fixed inset-0 z-50 items-center justify-center bg-black/70 backdrop-blur-sm p-4 sm:p-6"
class="flex fixed inset-0 z-50 items-center justify-center bg-black/70 backdrop-blur-xs p-4 sm:p-6"
onclick={(e) => {
if (e.target === e.currentTarget) hideModal()
}}
@@ -220,7 +220,7 @@ tabindex="-1"
<div class="absolute top-0 right-0 flex gap-1 items-center">
<button
type="button"
class="p-2 text-xl font-bold text-gray-600 font-IconFamily dark:text-gray-200 transition-colors duration-200 rounded-lg hover:bg-black/5 dark:hover:bg-white/10 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800"
class="p-2 text-xl font-bold text-gray-600 font-IconFamily dark:text-gray-200 transition-colors duration-200 rounded-lg hover:bg-black/5 dark:hover:bg-white/10 focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800"
onclick={() => hideModal()}
aria-label="Close"
>
@@ -301,7 +301,7 @@ onemblaInit={heroInit}
<button
type="button"
onclick={heroPrev}
class="p-2 rounded-full bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2"
class="p-2 rounded-full bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2"
aria-label="Previous hero slide"
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width={1.5} stroke="currentColor" class="w-5 h-5">
@@ -311,7 +311,7 @@ aria-label="Previous hero slide"
<button
type="button"
onclick={heroNext}
class="p-2 rounded-full bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2"
class="p-2 rounded-full bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2"
aria-label="Next hero slide"
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width={1.5} stroke="currentColor" class="w-5 h-5">
@@ -329,7 +329,7 @@ aria-label="Next hero slide"
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4 mb-6 w-full">
{#if currentThemes.includes(theme.id)}
<div
class="relative w-full overflow-hidden rounded-2xl min-h-[9.5rem] sm:min-h-[11rem] text-left shadow-md border border-zinc-400/70 dark:border-zinc-500 group ring-1 ring-black/10 dark:ring-white/10"
class="relative w-full overflow-hidden rounded-2xl min-h-38 sm:min-h-44 text-left shadow-md border border-zinc-400/70 dark:border-zinc-500 group ring-1 ring-black/10 dark:ring-white/10"
>
{#if masterThumb}
<img src={masterThumb} alt="" class="absolute inset-0 w-full h-full object-cover transition-transform duration-200 group-hover:scale-[1.03]" draggable="false" />
@@ -337,7 +337,7 @@ class="relative w-full overflow-hidden rounded-2xl min-h-[9.5rem] sm:min-h-[11re
<div class="absolute inset-0 bg-zinc-700" role="presentation"></div>
{/if}
<div class="absolute inset-0 bg-neutral-950/50" role="presentation"></div>
<div class="relative z-10 flex flex-col justify-end min-h-[9.5rem] sm:min-h-[11rem] p-5">
<div class="relative z-10 flex flex-col justify-end min-h-38 sm:min-h-44 p-5">
{#if installingId === theme.id}
<span class="flex justify-center mb-3">
<span class="inline-block w-10 h-10 animate-spin rounded-full border-2 border-white border-t-transparent align-middle"></span>
@@ -375,7 +375,7 @@ Remove
type="button"
onclick={() => onMasterVariantClick('install')}
disabled={installingId !== null}
class="relative w-full overflow-hidden rounded-2xl min-h-[9.5rem] sm:min-h-[11rem] text-left shadow-md transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800 disabled:opacity-70 group ring-1 ring-black/10 dark:ring-white/10"
class="relative w-full overflow-hidden rounded-2xl min-h-38 sm:min-h-44 text-left shadow-md transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800 disabled:opacity-70 group ring-1 ring-black/10 dark:ring-white/10"
title="Install {theme.name} (master)"
>
{#if masterThumb}
@@ -384,7 +384,7 @@ title="Install {theme.name} (master)"
<div class="absolute inset-0 bg-zinc-600" role="presentation"></div>
{/if}
<div class="absolute inset-0 bg-neutral-950/50" role="presentation"></div>
<div class="relative z-10 flex flex-col justify-end min-h-[9.5rem] sm:min-h-[11rem] p-5">
<div class="relative z-10 flex flex-col justify-end min-h-38 sm:min-h-44 p-5">
{#if installingId === theme.id}
<span class="flex justify-center mb-3">
<span class="inline-block w-10 h-10 animate-spin rounded-full border-2 border-white border-t-transparent align-middle"></span>
@@ -399,7 +399,7 @@ title="Install {theme.name} (master)"
{@const thumb = flavourCarouselImageUrl(f)}
{#if currentThemes.includes(f.id)}
<div
class="relative w-full overflow-hidden rounded-2xl min-h-[9.5rem] sm:min-h-[11rem] text-left shadow-md border border-zinc-400/70 dark:border-zinc-500 group ring-1 ring-black/10 dark:ring-white/10"
class="relative w-full overflow-hidden rounded-2xl min-h-38 sm:min-h-44 text-left shadow-md border border-zinc-400/70 dark:border-zinc-500 group ring-1 ring-black/10 dark:ring-white/10"
>
{#if thumb}
<img src={thumb} alt="" class="absolute inset-0 w-full h-full object-cover transition-transform duration-200 group-hover:scale-[1.03]" draggable="false" />
@@ -407,7 +407,7 @@ class="relative w-full overflow-hidden rounded-2xl min-h-[9.5rem] sm:min-h-[11re
<div class="absolute inset-0 bg-zinc-700" role="presentation"></div>
{/if}
<div class="absolute inset-0 bg-neutral-950/50" role="presentation"></div>
<div class="relative z-10 flex flex-col justify-end min-h-[9.5rem] sm:min-h-[11rem] p-5">
<div class="relative z-10 flex flex-col justify-end min-h-38 sm:min-h-44 p-5">
{#if installingId === f.id}
<span class="flex justify-center mb-3">
<span class="inline-block w-10 h-10 animate-spin rounded-full border-2 border-white border-t-transparent align-middle"></span>
@@ -445,7 +445,7 @@ Remove
type="button"
onclick={() => onFlavourClick(flavourIdx, f.id, 'install')}
disabled={installingId !== null}
class="relative w-full overflow-hidden rounded-2xl min-h-[9.5rem] sm:min-h-[11rem] text-left shadow-md transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800 disabled:opacity-70 group ring-1 ring-black/10 dark:ring-white/10"
class="relative w-full overflow-hidden rounded-2xl min-h-38 sm:min-h-44 text-left shadow-md transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800 disabled:opacity-70 group ring-1 ring-black/10 dark:ring-white/10"
title="Install {f.name}"
>
{#if thumb}
@@ -454,7 +454,7 @@ title="Install {f.name}"
<div class="absolute inset-0 bg-zinc-600" role="presentation"></div>
{/if}
<div class="absolute inset-0 bg-neutral-950/50" role="presentation"></div>
<div class="relative z-10 flex flex-col justify-end min-h-[9.5rem] sm:min-h-[11rem] p-5">
<div class="relative z-10 flex flex-col justify-end min-h-38 sm:min-h-44 p-5">
{#if installingId === f.id}
<span class="flex justify-center mb-3">
<span class="inline-block w-10 h-10 animate-spin rounded-full border-2 border-white border-t-transparent align-middle"></span>
@@ -474,7 +474,7 @@ title="Install {f.name}"
{#if showFavorites && toggleFavorite && theme}
<button
type="button"
class="flex items-center gap-2 px-4 py-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800 {theme.is_favorited ? 'text-red-500 bg-red-500/10 dark:bg-red-500/20' : 'bg-zinc-200 dark:bg-zinc-700 dark:text-white hover:bg-zinc-300 dark:hover:bg-zinc-600'}"
class="flex items-center gap-2 px-4 py-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800 {theme.is_favorited ? 'text-red-500 bg-red-500/10 dark:bg-red-500/20' : 'bg-zinc-200 dark:bg-zinc-700 dark:text-white hover:bg-zinc-300 dark:hover:bg-zinc-600'}"
onclick={handleFavoriteClick}
title={isLoggedIn ? (theme.is_favorited ? 'Remove from favorites' : 'Add to favorites') : 'Sign in to favorite themes'}
aria-label={theme.is_favorited ? 'Unfavorite' : 'Favorite'}
@@ -492,7 +492,7 @@ aria-label={theme.is_favorited ? 'Unfavorite' : 'Favorite'}
type="button"
disabled
style={variantApplyStyles(theme.id).applied}
class="relative flex justify-center items-center px-4 py-2 min-w-[8rem] rounded-lg opacity-90"
class="relative flex justify-center items-center px-4 py-2 min-w-32 rounded-lg opacity-90"
>
Applied
</button>
@@ -502,7 +502,7 @@ type="button"
onclick={() => runApply(theme.id)}
disabled={installingId !== null}
style={variantApplyStyles(theme.id).apply}
class="relative flex justify-center items-center px-4 py-2 min-w-[8rem] rounded-lg transition-all duration-200 hover:brightness-90 active:scale-95 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-70"
class="relative flex justify-center items-center px-4 py-2 min-w-32 rounded-lg transition-all duration-200 hover:brightness-90 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-offset-2 disabled:opacity-70"
>
{#if installingId === theme.id}
<svg class="absolute w-4 h-4 animate-spin" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
@@ -516,7 +516,7 @@ class="relative flex justify-center items-center px-4 py-2 min-w-[8rem] rounded-
type="button"
onclick={() => runRemove(theme.id)}
disabled={installingId !== null}
class="relative flex justify-center items-center px-4 py-2 min-w-[8rem] text-black rounded-lg dark:text-white bg-zinc-300 dark:bg-zinc-700 dark:hover:bg-zinc-600/50 hover:bg-zinc-200 transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 disabled:opacity-70"
class="relative flex justify-center items-center px-4 py-2 min-w-32 text-black rounded-lg dark:text-white bg-zinc-300 dark:bg-zinc-700 dark:hover:bg-zinc-600/50 hover:bg-zinc-200 transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 disabled:opacity-70"
>
{#if installingId === theme.id}
<svg class="absolute w-4 h-4 animate-spin" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
@@ -530,7 +530,7 @@ class="relative flex justify-center items-center px-4 py-2 min-w-[8rem] text-bla
type="button"
onclick={() => runInstall(theme.id)}
disabled={installingId !== null}
class="relative flex justify-center items-center px-4 py-2 min-w-[8rem] text-black rounded-lg dark:text-white bg-zinc-300 dark:bg-zinc-700 dark:hover:bg-zinc-600/50 hover:bg-zinc-200 transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 disabled:opacity-70"
class="relative flex justify-center items-center px-4 py-2 min-w-32 text-black rounded-lg dark:text-white bg-zinc-300 dark:bg-zinc-700 dark:hover:bg-zinc-600/50 hover:bg-zinc-200 transition-all duration-200 hover:scale-105 active:scale-95 focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 disabled:opacity-70"
>
{#if installingId === theme.id}
<svg class="absolute w-4 h-4 animate-spin" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
@@ -556,7 +556,7 @@ hideModal(relatedTheme)
}}
class="relative z-0 hover:z-20 w-full cursor-pointer rounded-xl overflow-hidden transition-all duration-200 hover:scale-[1.02]"
>
<div class="bg-gray-50 w-full transition-all duration-500 ease-out relative group group/card flex flex-col hover:shadow-xl dark:hover:shadow-white/[0.1] hover:shadow-white/[0.8] dark:bg-zinc-800 dark:border-white/[0.1] h-auto rounded-xl overflow-clip border border-zinc-200 dark:border-zinc-700">
<div class="bg-gray-50 w-full transition-all duration-500 ease-out relative group group/card flex flex-col hover:shadow-xl dark:hover:shadow-white/10 hover:shadow-white/80 dark:bg-zinc-800 dark:border-white/10 h-auto rounded-xl overflow-clip border border-zinc-200 dark:border-zinc-700">
<div class="absolute bottom-1 left-3 z-10 mb-1 text-xl font-bold text-white transition-all duration-500 group-hover:-translate-y-0.5">
{relatedTheme.name}
</div>
@@ -572,7 +572,7 @@ class="relative z-0 hover:z-20 w-full cursor-pointer rounded-xl overflow-hidden
<div class="flex justify-center items-center p-8 text-zinc-600 dark:text-zinc-300">
<button
type="button"
class="px-4 py-2 rounded-lg bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800"
class="px-4 py-2 rounded-lg bg-zinc-200 dark:bg-zinc-700 transition-all duration-200 hover:scale-105 active:scale-95 dark:text-white focus:outline-hidden focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800"
onclick={() => hideModal()}
>
Close
@@ -177,7 +177,7 @@
{#if themes}
{#each themes.themes as theme (theme.id)}
<button
class="relative group w-full aspect-theme flex justify-center items-center rounded-xl transition ring dark:ring-white ring-zinc-300 {theme.id === themes.selectedTheme ? 'dark:ring-2 ring-4' : 'ring-0'}"
class="relative group w-full aspect-theme flex justify-center items-center rounded-xl transition ring-3 dark:ring-white ring-zinc-300 {theme.id === themes.selectedTheme ? 'dark:ring-2 ring-4' : 'ring-0'}"
onclick={(e) => handleThemeClick(theme, e)}
>
{#if isEditMode}
@@ -282,7 +282,7 @@
{/if}
{#if themes && showNavigation}
<div id="divider" class="w-full h-[1px] my-2 bg-zinc-100 dark:bg-zinc-600"></div>
<div id="divider" class="w-full h-px my-2 bg-zinc-100 dark:bg-zinc-600"></div>
<button
onclick={() => void openStorePage()}
@@ -1,30 +1,31 @@
<script lang="ts">
import React from "react";
import ReactDOM from "react-dom";
import { createElement } from "react";
import { createRoot, type Root } from "react-dom/client";
import { onDestroy } from "svelte";
const e = React.createElement;
let adapterProps = $props();
let container = $state<HTMLDivElement | null>(null);
let root: Root | null = null;
$effect(() => {
if (!container) return;
const { el, children, class: className, ...rest } = adapterProps;
try {
ReactDOM.render(e(el, rest, children), container);
root ??= createRoot(container);
root.render(createElement(el, rest, children));
} catch (err) {
console.warn(`react-adapter failed to mount.`, { err });
}
});
onDestroy(() => {
if (!container) return;
try {
ReactDOM.unmountComponentAtNode(container);
root?.unmount();
} catch (err) {
console.warn(`react-adapter failed to unmount.`, { err });
}
root = null;
});
</script>
+1 -7
View File
@@ -1,10 +1,4 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
button {
@apply cursor-pointer;
}
@import "../css/tailwind.css";
::-webkit-scrollbar {
display: none;
+1 -1
View File
@@ -61,7 +61,7 @@ export async function writeData(
await txDone(tx);
} catch (e) {
const detail = e instanceof Error ? e.message : String(e);
throw new Error(`Failed to save background: ${detail}`);
throw new Error(`Failed to save background: ${detail}`, { cause: e });
}
}
+2 -8
View File
@@ -1,12 +1,6 @@
@import "./components/ColourPicker.css";
@import './components/ColourPicker.css' layer(base);
@tailwind base;
@tailwind components;
@tailwind utilities;
button {
@apply cursor-pointer;
}
@import "../css/tailwind.css";
::-webkit-scrollbar {
display: none;
+1 -1
View File
@@ -5,7 +5,7 @@ import contentShadowStyle from "./contentShadow.css?inline";
const shadowStyles = {
// Registered properties are document-wide, including inside shadow roots.
// Keep Tailwind 3 gradients separate from a host's typed Tailwind 4 properties.
// Keep our gradient variables separate from a host page's own Tailwind registrations.
settings: settingsStyle.replaceAll("--tw-gradient", "--bs-gradient"),
content: contentShadowStyle.replaceAll("--tw-gradient", "--bs-gradient"),
} as const;
+3 -3
View File
@@ -22,7 +22,7 @@
<button
type="button"
class="rounded-lg px-4 py-2 text-sm font-medium transition-colors {communityState.innerTab === 'browse'
? 'bg-white text-zinc-900 shadow dark:bg-zinc-700 dark:text-white'
? 'bg-white text-zinc-900 shadow-sm dark:bg-zinc-700 dark:text-white'
: 'text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white'}"
onclick={() => (communityState.innerTab = "browse")}
>
@@ -31,7 +31,7 @@
<button
type="button"
class="rounded-lg px-4 py-2 text-sm font-medium transition-colors {communityState.innerTab === 'mine'
? 'bg-white text-zinc-900 shadow dark:bg-zinc-700 dark:text-white'
? 'bg-white text-zinc-900 shadow-sm dark:bg-zinc-700 dark:text-white'
: 'text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white'}"
onclick={() => (communityState.innerTab = "mine")}
>
@@ -41,7 +41,7 @@
<button
type="button"
class="rounded-lg px-4 py-2 text-sm font-medium transition-colors {communityState.innerTab === 'review'
? 'bg-white text-zinc-900 shadow dark:bg-zinc-700 dark:text-white'
? 'bg-white text-zinc-900 shadow-sm dark:bg-zinc-700 dark:text-white'
: 'text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white'}"
onclick={() => (communityState.innerTab = "review")}
>
+5 -5
View File
@@ -584,7 +584,7 @@
type="search"
placeholder="Search settings"
bind:value={settingsSearch}
class="h-10 w-full rounded-lg bg-zinc-200/70 pl-9 pr-3 text-sm text-zinc-900 placeholder:text-zinc-400 transition-colors duration-200 focus:bg-white focus:outline-none focus:ring-2 focus:ring-zinc-400 focus:ring-offset-2 dark:bg-zinc-800/80 dark:text-white dark:placeholder:text-zinc-500 dark:focus:bg-zinc-800 dark:focus:ring-offset-zinc-900"
class="h-10 w-full rounded-lg bg-zinc-200/70 pl-9 pr-3 text-sm text-zinc-900 placeholder:text-zinc-400 transition-colors duration-200 focus:bg-white focus:outline-hidden focus:ring-2 focus:ring-zinc-400 focus:ring-offset-2 dark:bg-zinc-800/80 dark:text-white dark:placeholder:text-zinc-500 dark:focus:bg-zinc-800 dark:focus:ring-offset-zinc-900"
/>
</label>
{/if}
@@ -618,7 +618,7 @@
<button
type="button"
onclick={action.onclick}
class="flex h-10 w-full items-center gap-3 rounded-lg px-3 text-left text-[16px] font-medium text-zinc-600 transition-[color,background-color,transform] duration-150 hover:bg-zinc-200/70 hover:text-zinc-950 active:scale-[0.96] focus:outline-none focus:ring-2 focus:ring-zinc-400 focus:ring-offset-2 dark:text-zinc-300 dark:hover:bg-zinc-700/70 dark:hover:text-white dark:focus:ring-offset-zinc-900"
class="flex h-10 w-full items-center gap-3 rounded-lg px-3 text-left text-[16px] font-medium text-zinc-600 transition-[color,background-color,transform] duration-150 hover:bg-zinc-200/70 hover:text-zinc-950 active:scale-[0.96] focus:outline-hidden focus:ring-2 focus:ring-zinc-400 focus:ring-offset-2 dark:text-zinc-300 dark:hover:bg-zinc-700/70 dark:hover:text-white dark:focus:ring-offset-zinc-900"
>
<span class="w-5 text-center font-IconFamily text-[18px]" aria-hidden="true">{action.icon}</span>
<span>{action.label}</span>
@@ -628,7 +628,7 @@
<button
type="button"
onclick={() => openFeedback()}
class="mt-2 flex w-full items-center gap-3 rounded-lg bg-zinc-200/70 px-3 py-2.5 text-left text-[16px] font-medium text-zinc-700 transition-[color,background-color,transform] duration-150 hover:bg-zinc-300/80 active:scale-[0.96] focus:outline-none focus:ring-2 focus:ring-zinc-400 focus:ring-offset-2 dark:bg-zinc-800/80 dark:text-zinc-200 dark:hover:bg-zinc-700 dark:focus:ring-offset-zinc-900"
class="mt-2 flex w-full items-center gap-3 rounded-lg bg-zinc-200/70 px-3 py-2.5 text-left text-[16px] font-medium text-zinc-700 transition-[color,background-color,transform] duration-150 hover:bg-zinc-300/80 active:scale-[0.96] focus:outline-hidden focus:ring-2 focus:ring-zinc-400 focus:ring-offset-2 dark:bg-zinc-800/80 dark:text-zinc-200 dark:hover:bg-zinc-700 dark:focus:ring-offset-zinc-900"
>
<svg
class="w-5 h-5 shrink-0"
@@ -756,7 +756,7 @@
/>
{#if !standalone}
<button type="button" onclick={toggleExpanded}
class="mt-2 flex h-11 w-11 shrink-0 self-start items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] focus:outline-none dark:text-zinc-400 dark:hover:text-white"
class="mt-2 flex h-11 w-11 shrink-0 self-start items-center justify-center text-zinc-500 transition-[color,transform] duration-150 hover:text-zinc-950 active:scale-[0.96] focus:outline-hidden dark:text-zinc-400 dark:hover:text-white"
aria-label="Expand settings" title="Expand settings" aria-expanded="false">
<span class="font-IconFamily text-2xl" aria-hidden="true">{"\uebdb"}</span>
</button>
@@ -810,7 +810,7 @@
<button
type="button"
class="settings-backdrop absolute inset-0 {expanded ? 'bg-black/60' : 'bg-transparent'} {expanded && !$settingsState.performanceMode
? 'backdrop-blur-sm'
? 'backdrop-blur-xs'
: 'backdrop-blur-none'}"
class:settings-backdrop--motion={$settingsState.animations !== false && !$settingsState.performanceMode}
aria-label="Close settings"
@@ -6,7 +6,7 @@
<div class="border-none">
<div
class="p-1 my-1 from-white to-zinc-100 bg-gradient-to-br rounded-xl border shadow-sm border-zinc-200/50 dark:border-zinc-700/40 dark:to-zinc-900/50 dark:from-zinc-900/40 {className}"
class="p-1 my-1 from-white to-zinc-100 bg-linear-to-br rounded-xl border shadow-xs border-zinc-200/50 dark:border-zinc-700/40 dark:to-zinc-900/50 dark:from-zinc-900/40 {className}"
>
{@render children()}
</div>
@@ -65,7 +65,7 @@
"GitHub latest version override",
)}
<div
class="flex-col p-1 my-1 bg-gradient-to-br from-white rounded-xl border shadow-sm to-zinc-100 border-zinc-200/50 dark:border-zinc-700/40 dark:to-zinc-900/50 dark:from-zinc-900/40"
class="flex-col p-1 my-1 bg-linear-to-br from-white rounded-xl border shadow-xs to-zinc-100 border-zinc-200/50 dark:border-zinc-700/40 dark:to-zinc-900/50 dark:from-zinc-900/40"
>
<div class="flex justify-between items-center px-4 py-3">
<div class="pr-4">
@@ -216,7 +216,7 @@
type="text"
placeholder="https://betterseqta.org"
bind:value={devApiBaseInput}
class="flex-1 px-2 py-1 text-xs rounded border bg-white dark:bg-zinc-800 border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-zinc-100"
class="flex-1 px-2 py-1 text-xs rounded-sm border bg-white dark:bg-zinc-800 border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-zinc-100"
/>
<Button onClick={applyDevApiBase} text="Apply" />
{#if devApiBaseActive}
@@ -240,7 +240,7 @@
oninput={(e) => {
settingsState.devGhReleaseVersionOverride = e.currentTarget.value;
}}
class="px-2 py-1 text-xs rounded border bg-white dark:bg-zinc-800 border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-zinc-100"
class="px-2 py-1 text-xs rounded-sm border bg-white dark:bg-zinc-800 border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-zinc-100"
/>
</div>
</div>
@@ -163,13 +163,13 @@
>
{#if newIcon}
<div class="flex overflow-hidden items-center">
<div class="flex-shrink-0 mr-2 w-6 h-6">
<div class="shrink-0 mr-2 w-6 h-6">
<img src={`data:image/svg+xml;base64,${btoa(newIcon)}`} alt="Selected Icon" class="object-contain w-full h-full" />
</div>
<span class="truncate">Selected Icon</span>
</div>
<span
class="p-1 ml-2 rounded hover:bg-zinc-200 dark:hover:bg-zinc-600"
class="p-1 ml-2 rounded-sm hover:bg-zinc-200 dark:hover:bg-zinc-600"
aria-label="Clear icon"
role="button"
tabindex="0"
+6 -6
View File
@@ -371,7 +371,7 @@
<div class="mb-4 space-y-2 rounded-lg bg-white px-2 py-2 shadow-lg dark:bg-zinc-700">
<div class="flex h-16 items-center gap-2">
<div class="h-full">
<ThemeBlobImage source={image.blob} alt={image.variableName} class="object-contain h-full rounded" />
<ThemeBlobImage source={image.blob} alt={image.variableName} class="object-contain h-full rounded-sm" />
</div>
<input
type="text"
@@ -434,7 +434,7 @@
<div class:dark={panelDark} class="h-full min-h-0 overflow-y-scroll no-scrollbar">
{#if codeEditorFullscreen}
<div class="absolute inset-0 bg-white z-[10000] dark:bg-zinc-900 dark:text-white">
<div class="absolute inset-0 bg-white z-10000 dark:bg-zinc-900 dark:text-white">
<div class="sticky top-0 px-2 h-screen">
<div class="flex justify-between items-center my-4">
<h2 class="text-xl font-bold">Custom CSS</h2>
@@ -486,7 +486,7 @@
id='themeDescription'
placeholder="Don't worry, this one's optional!"
bind:value={theme.description}
class='p-2 w-full rounded-lg border-0 transition dark:placeholder-zinc-300 bg-zinc-200 dark:bg-zinc-700 focus:outline-none focus:ring-1 focus:ring-zinc-100 dark:focus:ring-zinc-700 focus:bg-zinc-300/50 dark:focus:bg-zinc-600'></textarea>
class='p-2 w-full rounded-lg border-0 transition dark:placeholder-zinc-300 bg-zinc-200 dark:bg-zinc-700 focus:outline-hidden focus:ring-1 focus:ring-zinc-100 dark:focus:ring-zinc-700 focus:bg-zinc-300/50 dark:focus:bg-zinc-600'></textarea>
</div>
<Divider />
@@ -535,7 +535,7 @@
{#each theme.CustomImages as image (image.id)}
<div class="space-y-2 rounded-lg bg-zinc-200/80 px-2 py-2 dark:bg-zinc-700/80">
<div class="flex h-16 items-center gap-2">
<ThemeBlobImage source={image.blob} alt="" class="h-full rounded object-contain" />
<ThemeBlobImage source={image.blob} alt="" class="h-full rounded-sm object-contain" />
<input
type="text"
value={image.variableName}
@@ -626,7 +626,7 @@
.filter(Boolean);
theme = { ...theme, adaptiveCssVariables: lines };
}}
class="p-2 mt-2 w-full min-h-[5rem] font-mono text-sm rounded-lg border-0 transition dark:placeholder-zinc-400 bg-zinc-200 dark:bg-zinc-700 focus:outline-none focus:ring-1 focus:ring-zinc-100 dark:focus:ring-zinc-700 focus:bg-zinc-300/50 dark:focus:bg-zinc-600"
class="p-2 mt-2 w-full min-h-20 font-mono text-sm rounded-lg border-0 transition dark:placeholder-zinc-400 bg-zinc-200 dark:bg-zinc-700 focus:outline-hidden focus:ring-1 focus:ring-zinc-100 dark:focus:ring-zinc-700 focus:bg-zinc-300/50 dark:focus:bg-zinc-600"
></textarea>
</div>
@@ -694,7 +694,7 @@
{/each}
<div
class="sticky bottom-0 z-[1500] -mx-2 mt-4 space-y-2 border-t border-zinc-200/80 bg-zinc-100 p-3 pb-4 dark:border-zinc-700/60 dark:bg-zinc-800"
class="sticky bottom-0 z-1500 -mx-2 mt-4 space-y-2 border-t border-zinc-200/80 bg-zinc-100 p-3 pb-4 dark:border-zinc-700/60 dark:bg-zinc-800"
>
<button
type="button"
@@ -863,7 +863,7 @@ async function handleWeightings(mark: any, api: any) {
await new Promise((resolve) => setTimeout(resolve, 2000));
text = await extractPDFTextWithRetry(pdfUrl, 2, 2000);
} else {
throw new Error(`PDF extraction failed: ${error.message}`);
throw new Error(`PDF extraction failed: ${error.message}`, { cause: error });
}
}
@@ -918,7 +918,7 @@ export async function processAssessments(api: any, assessmentItems: Element[]) {
let hasRefreshingWeighting = false;
let count = 0;
let fiberMarks: MarkLike[] = [];
let fiberMarks: MarkLike[];
try {
const state = await ReactFiber.find(
"[class*='AssessmentList__items___']",
@@ -202,7 +202,7 @@ export function determineStatus(item: any): string {
}
const completedKey = "betterseqta-completed-assessments";
let completed: unknown[] = [];
let completed: unknown[];
try {
const raw = localStorage.getItem(completedKey);
const parsed = raw ? JSON.parse(raw) : [];
@@ -72,12 +72,12 @@
</div>
</div>
<div class="flex flex-col flex-shrink-0 justify-center items-center w-12">
<div class="h-8 w-[1px] bg-zinc-900/5 dark:bg-zinc-100/5"></div>
<div class="flex flex-col shrink-0 justify-center items-center w-12">
<div class="h-8 w-px bg-zinc-900/5 dark:bg-zinc-100/5"></div>
<div class="text-2xl text-zinc-900 dark:text-zinc-100">
→
</div>
<div class="h-8 w-[1px] bg-zinc-900/5 dark:bg-zinc-100/5"></div>
<div class="h-8 w-px bg-zinc-900/5 dark:bg-zinc-100/5"></div>
</div>
{#if !isCalculating}
@@ -321,11 +321,11 @@
{#if commandPalleteOpen}
<div role="dialog" aria-modal="true" class={settingsState.DarkMode ? 'dark' : ''}>
<div
class="fixed inset-0 z-[50000] bg-zinc-900/40 dark:bg-black/60"
class="fixed inset-0 z-50000 bg-zinc-900/40 dark:bg-black/60"
transition:fade={{ duration: 150, easing: quintOut }}
></div>
<div class="fixed inset-0 z-[50000] flex justify-center place-items-start p-8 sm:p-6 md:p-8 select-none scale-120 origin-top"
<div class="fixed inset-0 z-50000 flex justify-center place-items-start p-8 sm:p-6 md:p-8 select-none scale-120 origin-top"
onclick={() => commandPalleteOpen = false}
onkeydown={(e: KeyboardEvent) => e.key === 'Escape' && (commandPalleteOpen = false)}
role="button"
@@ -352,14 +352,14 @@
bind:this={searchbar}
bind:value={searchTerm}
onkeydown={handleKeyNav}
class="pr-4 pl-12 w-full h-10 text-lg bg-transparent border-0 outline-none placeholder-zinc-400 text-zinc-700 dark:placeholder-zinc-500 dark:text-white focus:ring-0 sm:text-xl"
class="pr-4 pl-12 w-full h-10 text-lg bg-transparent border-0 outline-hidden placeholder-zinc-400 text-zinc-700 dark:placeholder-zinc-500 dark:text-white focus:ring-0 sm:text-xl"
placeholder="Search..."
/>
</div>
<ul
bind:this={resultsList}
class="overflow-y-auto max-h-[24rem] text-base scroll-py-2 p-2 gap-0.5 flex flex-col"
class="overflow-y-auto max-h-96 text-base scroll-py-2 p-2 gap-0.5 flex flex-col"
>
<Calculator
searchTerm={searchTerm}
@@ -376,10 +376,10 @@
{@const staticItem = item as StaticCommandItem}
<button
class="w-full flex items-center px-2 py-1.5 rounded-lg select-none cursor-pointer group transition-colors duration-100 ring-0 dark:ring-zinc-600/50
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow-sm' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
onclick={() => executeItemAction(staticItem)}
>
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center bg-gradient-to-br {staticItem.category === 'navigation' ? 'from-[#FA5D5D] to-[#DC2F30]' : 'from-[#4FBBFE] to-[#2090F3]'} rounded-md text-white">{staticItem.icon}</div>
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center bg-linear-to-br {staticItem.category === 'navigation' ? 'from-[#FA5D5D] to-[#DC2F30]' : 'from-[#4FBBFE] to-[#2090F3]'} rounded-md text-white">{staticItem.icon}</div>
<span class="ml-4 text-lg truncate">
<HighlightedText text={staticItem.text} term={searchTerm} matches={result.matches} />
</span>
@@ -460,7 +460,7 @@
<div class="flex gap-2 items-center">
<div class="flex gap-1 items-center">
{#each keybind as key}
<kbd class="size-6 text-[0.9rem] flex justify-center items-center rounded bg-zinc-100 dark:bg-zinc-100/10">{key}</kbd>
<kbd class="size-6 text-[0.9rem] flex justify-center items-center rounded-sm bg-zinc-100 dark:bg-zinc-100/10">{key}</kbd>
{/each}
</div>
<span>{text}</span>
@@ -14,11 +14,11 @@
<button
class="w-full flex flex-col px-2 py-1.5 rounded-lg select-none cursor-pointer group transition-colors duration-100 ring-0 dark:ring-zinc-600/50
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow-sm' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
onclick={onclick}
>
<div class="flex items-center w-full">
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center bg-gradient-to-br from-[#59F675] to-[#1BC636] rounded-md text-white">{item.metadata?.icon || '\uebee'}</div>
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center bg-linear-to-br from-[#59F675] to-[#1BC636] rounded-md text-white">{item.metadata?.icon || '\uebee'}</div>
<span class="ml-4 text-lg truncate">
<HighlightedText text={item.text} term={searchTerm} matches={matches} />
</span>
@@ -14,11 +14,11 @@
<button
class="w-full flex flex-col px-2 py-1.5 rounded-lg select-none cursor-pointer group transition-colors duration-100 ring-0 dark:ring-zinc-600/50
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow-sm' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
onclick={onclick}
>
<div class="flex items-center w-full">
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white bg-gradient-to-br from-[#59aaf6] to-[#1b62c6] rounded-md">{item.metadata?.icon || '\uebe7'}</div>
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white bg-linear-to-br from-[#59aaf6] to-[#1b62c6] rounded-md">{item.metadata?.icon || '\uebe7'}</div>
<span class="ml-4 text-lg truncate {item.metadata?.closed ? 'line-through opacity-80' : ''}">
<HighlightedText text={item.text} term={searchTerm} matches={matches} />
</span>
@@ -65,12 +65,12 @@
<button
class="w-full flex flex-col px-2 py-1.5 rounded-lg select-none cursor-pointer group transition-colors duration-100 ring-0 dark:ring-zinc-600/50
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow-sm' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
onclick={onclick}
>
<div class="flex items-center w-full">
<div
class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white rounded-md bg-gradient-to-br {gradientForCategory(item.category)}"
class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white rounded-md bg-linear-to-br {gradientForCategory(item.category)}"
>
{item.metadata?.icon || fallbackIcon(item.category)}
</div>
@@ -14,11 +14,11 @@ import type { IndexItem } from '../../indexing/types';
<button
class="w-full flex flex-col px-2 py-1.5 rounded-lg select-none cursor-pointer group transition-colors duration-100 ring-0 dark:ring-zinc-600/50
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow-sm' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
onclick={onclick}
>
<div class="flex items-center w-full">
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white {item.metadata?.type === 'assessments' ? 'bg-gradient-to-br from-[#fa915d] to-[#dc6c2f] rounded-md' : 'bg-gradient-to-br from-[#4FBBFE] to-[#2090F3] rounded-md'} {item.metadata.isActive ? 'opacity-100' : 'opacity-80'}">
<div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white {item.metadata?.type === 'assessments' ? 'bg-linear-to-br from-[#fa915d] to-[#dc6c2f] rounded-md' : 'bg-linear-to-br from-[#4FBBFE] to-[#2090F3] rounded-md'} {item.metadata.isActive ? 'opacity-100' : 'opacity-80'}">
{item.metadata?.type === 'assessments' ? '\ueac3' : '\ueb4d'}
</div>
<span class="ml-4 text-lg truncate {item.metadata.isActive ? 'opacity-100' : 'opacity-70'}">
@@ -23,7 +23,7 @@ let schemaCheckPromise: Promise<void> | null = null;
async function ensureSchemaCurrent(): Promise<void> {
if (schemaCheckPromise) return schemaCheckPromise;
schemaCheckPromise = (async () => {
let storedRaw: string | null = null;
let storedRaw: string | null;
try {
storedRaw = localStorage.getItem(SCHEMA_VERSION_KEY);
} catch {
@@ -279,10 +279,9 @@ function dispatchVectorProgress(
} else if (status === "cancelled") {
dispatchProgress(completed, totalSteps, false, "Vectorization cancelled", `Vectorization cancelled: ${message}`);
return completed;
} else {
dispatchProgress(completed, totalSteps, true, "Vectorization in progress", detail);
}
dispatchProgress(completed, totalSteps, true, "Vectorization in progress", detail);
return completed;
}
@@ -416,8 +416,6 @@ export const messagesJob: Job = {
}
}
let consecutiveExisting = 0;
let requestStartTime = 0;
let progressUpdateCounter = 0;
let itemsStreamedToVector = 0;
@@ -521,7 +519,7 @@ export const messagesJob: Job = {
}
await delay(progress.currentDelay);
requestStartTime = Date.now();
const requestStartTime = Date.now();
let list;
try {
@@ -580,8 +578,7 @@ export const messagesJob: Job = {
itemsToStream.push(...processedItems);
consecutiveExisting = newConsecutiveExisting;
if (consecutiveExisting >= 20) {
if (newConsecutiveExisting >= 20) {
progress.done = true;
}
@@ -255,7 +255,7 @@ export async function hybridSearchWithExpansion(
return hybridSearch(bm25Results, query, options);
}
let vectorResults: VectorSearchResult[] = [];
let vectorResults: VectorSearchResult[];
try {
vectorResults = await searchVectors(trimmedQuery, opts.bm25TopK * 2);
} catch (e) {
@@ -251,13 +251,8 @@
{xDomain}
yScale={yScale}
series={areaSeries}
seriesLayout="overlap"
props={{
area: {
curve: curveMonotoneX,
"fill-opacity": showSubjectTrends ? 0.12 : 0.35,
line: { class: "stroke-2" },
motion: animationsOn ? "tween" : false,
},
xAxis: {
ticks: timeRange === "7d" ? 7 : undefined,
format: (v: Date) =>
@@ -271,7 +266,7 @@
},
}}
>
{#snippet marks({ series, getAreaProps })}
{#snippet marks({ context })}
<defs>
<linearGradient id={chartUid} x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color={accentColor} stop-opacity="0.55" />
@@ -287,22 +282,23 @@
}
: undefined}
>
{#each series as s, i (s.key)}
{#each context.series.visibleSeries as s (s.key)}
{@const meta = chartSeries.find((c) => c.key === s.key)}
{@const isOverall = meta?.isOverall ?? s.key === "average"}
{@const isForecast = s.key === "forecast"}
{@const color = meta?.color ?? s.color}
{#if !isForecast}
{#if s.key !== "forecast"}
<Area
{...getAreaProps(s, i)}
seriesKey={s.key}
curve={curveMonotoneX}
motion={animationsOn ? "tween" : false}
line={{ class: "stroke-2", stroke: color }}
fill={isOverall && !showSubjectTrends
? `url(#${chartUid})`
: isOverall
? accentColor
: "transparent"}
fill-opacity={isOverall ? (showSubjectTrends ? 0.08 : 0.35) : 0}
stroke={meta?.color ?? s.color}
style={`stroke: ${meta?.color ?? s.color}`}
fillOpacity={isOverall ? (showSubjectTrends ? 0.08 : 0.35) : 0}
/>
{/if}
{/each}
@@ -1,415 +1,208 @@
<script lang="ts">
import { onMount } from "svelte";
import { scaleBand, scaleLinear } from "d3-scale";
import { BarChart } from "layerchart";
import * as Chart from "./chart/index";
import { cubicInOut } from "svelte/easing";
import { getUserInfo } from "@/seqta/ui/AddBetterSEQTAElements";
import type { Assessment } from "./types";
import { getTimeRangeLabel, type CustomTimeRange, type TimeRange } from "./timeRange";
import {
buildGradeDistribution,
DISTRIBUTION_MODE_OPTIONS,
type DistributionMode,
} from "./gradeDistribution";
import { loadDistributionMode, saveDistributionMode } from "./storage";
import { settingsState } from "@/seqta/utils/listeners/SettingsState";
interface Props {
data: Assessment[];
timeRange: TimeRange;
customTimeRange?: CustomTimeRange;
}
let { data, timeRange, customTimeRange }: Props = $props();
const timeRangeText = $derived(() => getTimeRangeLabel(timeRange, customTimeRange));
let distributionMode: DistributionMode = $state("auto");
let modeReady = $state(false);
let studentId: number | null = $state(null);
const accentColor =
"var(--bsplus-analytics-accent, var(--better-main, #007bff))";
const distribution = $derived(() =>
buildGradeDistribution(data, distributionMode),
);
const chartData = $derived(() =>
distribution().buckets.map((b) => ({
grade: b.label,
count: b.count,
minPercent: b.minPercent,
maxPercent: b.maxPercent,
})),
);
const useLetterScaleLabels = $derived(() => distribution().modeUsed === "letter");
function formatXTick(label: string): string {
if (!useLetterScaleLabels()) return label;
const row = chartData().find((d) => d.grade === label);
if (
row?.minPercent !== undefined &&
row?.maxPercent !== undefined &&
!(row.minPercent === 0 && row.maxPercent === 100)
) {
return `${label}\n${Math.round(row.minPercent)}–${Math.round(row.maxPercent)}%`;
}
return label;
}
const chartConfig = $derived(() => {
const config: Chart.ChartConfig = {
count: { label: "Assessments", color: accentColor },
};
return config;
});
const yMax = $derived(Math.max(1, ...chartData().map((d) => d.count)));
const yScale = $derived(scaleLinear().domain([0, yMax]).nice());
const totalAssessments = $derived(distribution().gradedCount);
const modeOptionLabel = $derived(
DISTRIBUTION_MODE_OPTIONS.find((o) => o.value === distributionMode)?.label ??
"Auto",
);
const subtitle = $derived(() => {
const d = distribution();
if (d.modeUsed === "letter") {
return `Assessments per letter grade · ${timeRangeText()}`;
}
return `Assessments per grade band · ${timeRangeText()}`;
});
onMount(async () => {
try {
const info = await getUserInfo();
if (info?.id) {
studentId = info.id;
const saved = await loadDistributionMode(location.origin, info.id);
if (saved) distributionMode = saved;
}
} catch {
/* use default */
} finally {
modeReady = true;
}
});
async function onModeChange(next: DistributionMode) {
distributionMode = next;
if (studentId != null) {
await saveDistributionMode(location.origin, studentId, next);
}
}
</script>
<article class="bsplus-analytics-card">
<header class="bsplus-analytics-card-header bsplus-analytics-card-header-split">
<div>
<h3 class="bsplus-analytics-card-title">Grade distribution</h3>
<p class="bsplus-analytics-card-desc">{subtitle()}</p>
</div>
<div class="bsplus-analytics-card-controls">
<label class="bsplus-analytics-card-control">
<span class="bsplus-analytics-field-label">Grouping</span>
<select
class="bsplus-analytics-select bsplus-analytics-select-compact"
value={distributionMode}
disabled={!modeReady}
aria-label="Grade distribution grouping"
onchange={(e) => onModeChange(e.currentTarget.value as DistributionMode)}
>
{#each DISTRIBUTION_MODE_OPTIONS as option}
<option value={option.value} title={option.description}>{option.label}</option>
{/each}
</select>
</label>
</div>
</header>
<div class="bsplus-analytics-card-body">
{#if totalAssessments > 0 && chartData().length > 0}
<Chart.Container config={chartConfig()} class="bsplus-chart-surface bsplus-chart-surface-bar w-full">
<BarChart
data={chartData()}
xScale={scaleBand().padding(distribution().modeUsed === "letter" ? 0.22 : 0.28)}
yScale={yScale}
x="grade"
y="count"
axis={true}
grid={true}
series={[
{
key: "count",
label: "Assessments",
color: accentColor,
},
]}
props={{
bars: {
stroke: "none",
fill: accentColor,
rounded: "all",
radius: 10,
insets: { top: 4, bottom: 0, left: 4, right: 4 },
insets: { left: 4, right: 4 },
motion: {
y: { type: "tween", duration: $settingsState.animations ? 600 : 0, easing: cubicInOut },
},
},
highlight: { area: { fill: "none" } },
xAxis: {
format: (d: string) => formatXTick(d),
tickMultiline: useLetterScaleLabels(),
tickLabelProps: useLetterScaleLabels()
? { class: "bsplus-bar-tick-label" }
: undefined,
},
yAxis: {
label: "Assessments",
format: (d: number) => (Number.isInteger(d) ? String(d) : ""),
ticks: 5,
},
}}
>
{#snippet tooltip()}
<Chart.Tooltip hideLabel />
{/snippet}
</BarChart>
</Chart.Container>
{:else}
<div class="bsplus-analytics-card-empty">
<strong>No graded assessments</strong>
<span>for {timeRangeText().toLowerCase()}</span>
</div>
{/if}
</div>
<footer class="bsplus-analytics-card-footer">
{#if distribution().modeUsed === "letter" && distribution().scaleLabel}
<p class="bsplus-analytics-scale-hint">{distribution().scaleLabel}</p>
{/if}
<p>
{#if distribution().averagePercent !== null}
Average <strong>{distribution().averagePercent}%</strong>
{:else}
Average <strong>—</strong>
{/if}
across {totalAssessments} assessment{totalAssessments === 1 ? "" : "s"}
{#if distributionMode === "auto" && distribution().modeUsed === "letter"}
<span class="bsplus-analytics-footer-muted"> · letter scale detected</span>
{:else if distributionMode !== "auto"}
<span class="bsplus-analytics-footer-muted"> · {modeOptionLabel} grouping</span>
{/if}
</p>
</footer>
</article>
@@ -1,96 +1,44 @@
<script lang="ts">
import type { HTMLAttributes } from "svelte/elements";
import type { Snippet } from "svelte";
import { getTooltipContext, Tooltip as TooltipPrimitive } from "layerchart";
import { getChartContext, Tooltip as TooltipPrimitive } from "layerchart";
import { cn } from "../utils/cn";
import {
getPayloadConfigFromPayload,
useChart,
type TooltipPayload,
} from "./chart-utils";
function defaultFormatter(value: unknown) {
return `${value}`;
}
import { useChart } from "./chart-utils";
let {
class: className,
hideLabel = false,
indicator = "dot",
hideIndicator = false,
labelKey,
label,
labelFormatter = defaultFormatter,
labelClassName,
formatter,
nameKey,
color,
labelFormatter = (value: unknown) => `${value}`,
...restProps
}: HTMLAttributes<HTMLDivElement> & {
hideLabel?: boolean;
label?: string;
indicator?: "line" | "dot" | "dashed";
nameKey?: string;
labelKey?: string;
hideIndicator?: boolean;
labelClassName?: string;
labelFormatter?: (
value: unknown,
payload: TooltipPayload[],
) => string | number | Snippet;
formatter?: Snippet<
[
{
value: unknown;
name: string;
item: TooltipPayload;
index: number;
payload: TooltipPayload[];
},
]
>;
labelFormatter?: (value: any) => string;
} = $props();
const chart = useChart();
const tooltipCtx = getTooltipContext();
const ctx = getChartContext();
const formattedLabel = $derived.by(() => {
if (hideLabel || !tooltipCtx.payload?.length) return null;
const items = $derived(ctx.tooltip.series.filter((s) => s.visible));
const [item] = tooltipCtx.payload;
const key = labelKey ?? item?.label ?? item?.name ?? "value";
const itemConfig = getPayloadConfigFromPayload(chart.config, item, key);
const value =
!labelKey && typeof label === "string"
? (chart.config[label as keyof typeof chart.config]?.label ?? label)
: (itemConfig?.label ?? item.label);
if (value === undefined) return null;
if (!labelFormatter) return value;
return labelFormatter(value, tooltipCtx.payload);
const label = $derived.by(() => {
if (hideLabel || ctx.tooltip.data == null) return null;
return labelFormatter(ctx.x(ctx.tooltip.data));
});
const nestLabel = $derived(
tooltipCtx.payload.length === 1 && indicator !== "dot",
);
const nestLabel = $derived(items.length === 1 && indicator !== "dot");
</script>
{#snippet TooltipLabel()}
{#if formattedLabel}
<div class={cn("font-medium text-zinc-900 dark:text-white", labelClassName)}>
{#if typeof formattedLabel === "function"}
{@render formattedLabel()}
{:else}
{formattedLabel}
{/if}
</div>
{#if label}
<div class="font-medium text-zinc-900 dark:text-white">{label}</div>
{/if}
{/snippet}
<TooltipPrimitive.Root variant="none">
<TooltipPrimitive.Root variant="none" portal={false}>
<div
class={cn(
"grid min-w-[9rem] items-start gap-1.5 rounded-lg border border-zinc-200 dark:border-zinc-700 bg-white dark:bg-zinc-800 px-2.5 py-1.5 text-xs shadow-xl text-zinc-900 dark:text-white",
"grid min-w-36 items-start gap-1.5 rounded-lg border border-zinc-200 dark:border-zinc-700 bg-white dark:bg-zinc-800 px-2.5 py-1.5 text-xs shadow-xl text-zinc-900 dark:text-white",
className,
)}
{...restProps}
@@ -99,57 +47,43 @@
{@render TooltipLabel()}
{/if}
<div class="grid gap-1.5">
{#each tooltipCtx.payload as item, i (item.key + i)}
{@const key = `${nameKey || item.key || item.name || "value"}`}
{@const itemConfig = getPayloadConfigFromPayload(chart.config, item, key)}
{@const indicatorColor = color || item.payload?.color || item.color}
{#each items as item (item.key)}
{@const indicatorColor = item.color}
<div
class={cn(
"flex w-full flex-wrap items-stretch gap-2",
indicator === "dot" && "items-center",
)}
>
{#if formatter && item.value !== undefined && item.name}
{@render formatter({
value: item.value,
name: item.name,
item,
index: i,
payload: tooltipCtx.payload,
<div
style="background: {indicatorColor}; border-color: {indicatorColor};"
class={cn("shrink-0 rounded-[2px] border", {
"size-2.5": indicator === "dot",
"h-full w-1": indicator === "line",
"w-0 border-[1.5px] border-dashed bg-transparent":
indicator === "dashed",
})}
{:else}
{#if !hideIndicator}
<div
style="background: {indicatorColor}; border-color: {indicatorColor};"
class={cn("shrink-0 rounded-[2px] border", {
"size-2.5": indicator === "dot",
"h-full w-1": indicator === "line",
"w-0 border-[1.5px] border-dashed bg-transparent":
indicator === "dashed",
})}
></div>
{/if}
<div
class={cn(
"flex flex-1 shrink-0 justify-between leading-none",
nestLabel ? "items-end" : "items-center",
)}
>
<div class="grid gap-1.5">
{#if nestLabel}
{@render TooltipLabel()}
{/if}
<span class="text-zinc-500 dark:text-zinc-400">
{itemConfig?.label || item.name}
</span>
</div>
{#if item.value != null && !Number.isNaN(Number(item.value))}
<span class="font-mono font-medium tabular-nums">
{item.value.toLocaleString()}
</span>
></div>
<div
class={cn(
"flex flex-1 shrink-0 justify-between leading-none",
nestLabel ? "items-end" : "items-center",
)}
>
<div class="grid gap-1.5">
{#if nestLabel}
{@render TooltipLabel()}
{/if}
<span class="text-zinc-500 dark:text-zinc-400">
{chart.config[item.key]?.label ?? item.label}
</span>
</div>
{/if}
{#if item.value != null && !Number.isNaN(Number(item.value))}
<span class="font-mono font-medium tabular-nums">
{item.value.toLocaleString()}
</span>
{/if}
</div>
</div>
{/each}
</div>
@@ -1,11 +1,4 @@
import type { Tooltip } from "layerchart";
import {
getContext,
setContext,
type Component,
type ComponentProps,
type Snippet,
} from "svelte";
import { getContext, setContext, type Component } from "svelte";
export const THEMES = { light: "", dark: ".dark" } as const;
@@ -19,52 +12,6 @@ export type ChartConfig = {
);
};
export type ExtractSnippetParams<T> = T extends Snippet<[infer P]> ? P : never;
export type TooltipPayload = ExtractSnippetParams<
ComponentProps<typeof Tooltip.Root>["children"]
>["payload"][number];
export function getPayloadConfigFromPayload(
config: ChartConfig,
payload: TooltipPayload,
key: string,
) {
if (typeof payload !== "object" || payload === null) return undefined;
const payloadPayload =
"payload" in payload &&
typeof payload.payload === "object" &&
payload.payload !== null
? payload.payload
: undefined;
let configLabelKey: string = key;
if (payload.key === key) {
configLabelKey = payload.key;
} else if (payload.name === key) {
configLabelKey = payload.name;
} else if (
key in payload &&
typeof payload[key as keyof typeof payload] === "string"
) {
configLabelKey = payload[key as keyof typeof payload] as string;
} else if (
payloadPayload !== undefined &&
key in payloadPayload &&
typeof payloadPayload[key as keyof typeof payloadPayload] === "string"
) {
configLabelKey = payloadPayload[
key as keyof typeof payloadPayload
] as string;
}
return configLabelKey in config
? config[configLabelKey]
: config[key as keyof typeof config];
}
type ChartContextValue = {
config: ChartConfig;
};
@@ -1,7 +1,7 @@
import ChartContainer from "./chart-container.svelte";
import ChartTooltip from "./chart-tooltip.svelte";
export { getPayloadConfigFromPayload, type ChartConfig } from "./chart-utils";
export { type ChartConfig } from "./chart-utils";
export {
ChartContainer,
ChartTooltip,
@@ -1,3 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
+1 -1
View File
@@ -1,4 +1,4 @@
import tailwindStyles from "./tailwind.css?inline";
import tailwindStyles from "@/css/tailwind.css?inline";
import pluginStyles from "./styles.css?inline";
import { settingsState } from "@/seqta/utils/listeners/SettingsState";
import { isSimpleAnalyticsUi } from "@/seqta/utils/performanceMode";
@@ -173,7 +173,7 @@
</div>
{#if cloudState.isLoggedIn}
<div class="flex flex-wrap gap-2 justify-end items-center max-w-[14rem]">
<div class="flex flex-wrap gap-2 justify-end items-center max-w-56">
<button
type="button"
class="text-xs text-zinc-600 dark:text-zinc-300 hover:underline disabled:opacity-50"
@@ -206,6 +206,6 @@
{/if}
{#if cloudError}
<p class="max-w-[12rem] text-xs text-right text-red-500">{cloudError}</p>
<p class="max-w-48 text-xs text-right text-red-500">{cloudError}</p>
{/if}
</div>
@@ -74,7 +74,7 @@
}
</script>
<div class="flex flex-col items-end gap-2 shrink-0 max-w-[14rem]" title={scopeLabel}>
<div class="flex flex-col items-end gap-2 shrink-0 max-w-56" title={scopeLabel}>
{#if syncOptIn}
<p class="text-xs font-medium text-green-600 dark:text-green-400">Opted in on this site</p>
{:else}
-6
View File
@@ -1,6 +0,0 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
+21
View File
@@ -0,0 +1,21 @@
import tailwindcss from "@tailwindcss/postcss";
/**
* Tailwind 4 gives its `--tw-*` variables initial values through `@property`, which
* browsers ignore inside shadow roots — and most of our UI lives in one. Tailwind
* already emits a `*`-scoped fallback for browsers without `@property`, gated behind an
* `@supports` check; unwrapping it makes those defaults apply everywhere.
*/
const shadowDomPropertyFallbacks = {
postcssPlugin: "shadow-dom-property-fallbacks",
AtRule: {
layer(atRule) {
if (atRule.params !== "properties") return;
atRule.walkAtRules("supports", (supports) => supports.replaceWith(supports.nodes));
},
},
};
export default {
plugins: [tailwindcss(), shadowDomPropertyFallbacks],
};
+1 -2
View File
@@ -140,8 +140,7 @@ function applyColorsWith(selectedColor: string) {
};
// Mode-based properties, applied if storedSetting is provided
let modeProps = {};
modeProps = settingsState.DarkMode
const modeProps = settingsState.DarkMode
? {
"--betterseqta-logo": `url(${resolveExtensionAssetUrl(darkLogo)})`,
}
+1 -1
View File
@@ -87,7 +87,7 @@ export async function applyNativeSidebar(): Promise<boolean> {
return true;
}
let menu: HTMLElement | null = null;
let menu: HTMLElement | null;
try {
menu = (await waitForElm("#menu", true, 50, 200)) as HTMLElement;
} catch {
@@ -27,7 +27,7 @@ export function CreateCustomShortcutDiv(element: any) {
shortcutdiv.classList.add("shortcut");
shortcutdiv.classList.add("customshortcut");
let image: ChildNode | null = null;
let image: ChildNode | null;
if (typeof element.icon === "string" && element.icon.trim().startsWith("<")) {
image = stringToHTML(element.icon).firstChild;
@@ -228,7 +228,7 @@ async function initEngageNoticesUi(todayFormatted: string): Promise<void> {
const noticeContainer = document.getElementById(ENGAGE_NOTICE_CONTAINER_ID);
if (!noticeContainer) return;
let prefsPayload: unknown = [];
let prefsPayload: unknown;
try {
const prefsRes = await fetch(`${location.origin}/seqta/parent/load/prefs?`, {
method: "POST",
+1 -1
View File
@@ -35,7 +35,7 @@ async function sendRuntimeMessage<T>(message: object): Promise<T> {
} catch (err) {
const msg = err instanceof Error ? err.message : String(err);
if (/disconnected port|context invalidated|receiving end does not exist|message port closed/i.test(msg)) {
throw new Error(EXTENSION_RELOAD_HINT);
throw new Error(EXTENSION_RELOAD_HINT, { cause: err });
}
throw err;
}
@@ -200,7 +200,7 @@ export async function fetchTimetableLessons(
const { from, until } = range;
const coloursPromise = fetchSubjectColours();
let lessons: SeqtaTimetableLesson[] = [];
let lessons: SeqtaTimetableLesson[];
if (isEngageParentContext()) {
const studentId = await resolveStudentId();
+1 -1
View File
@@ -97,7 +97,7 @@ class EventManager {
): Promise<void> {
const root = options.parentElement || document.documentElement;
const selector = this.buildSelector(options);
let elements: Element[] = [];
let elements: Element[];
if (selector) {
elements = Array.from(root.querySelectorAll(selector));
-40
View File
@@ -1,40 +0,0 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ["./src/**/*.{js,ts,jsx,tsx,html,svelte}"],
darkMode: "class",
theme: {
fontSize: {
xs: ".65rem",
sm: ".775rem",
base: "0.65rem",
md: "0.65rem",
lg: "1rem",
xl: "1.25rem",
"2xl": "1.5rem",
"3xl": "1.875rem",
"4xl": "2.25rem",
"5xl": "3rem",
"6xl": "4rem",
"7xl": "5rem",
"8xl": "6rem",
"9xl": "8rem",
"10xl": "10rem",
"11xl": "12rem",
"12xl": "14rem",
"13xl": "16rem",
"14xl": "18rem",
},
extend: {
fontFamily: {
IconFamily: "IconFamily",
},
animation: {
"spin-fast": "spin 0.4s linear infinite",
},
aspectRatio: {
theme: "5 / 1",
},
},
},
plugins: [require("@tailwindcss/forms")],
};
-2
View File
@@ -130,8 +130,6 @@ export default defineConfig(({ command, mode: viteMode }) => {
},
optimizeDeps: {
include: [
"@babel/runtime/helpers/extends",
"@babel/runtime/helpers/interopRequireDefault",
"layerchart",
"d3-scale",
"d3-shape",