diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 0000000..a4c1e0b --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,5 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "sortImports": {}, + "sortTailwindcss": {} +} diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index a09f113..0000000 --- a/.prettierrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "printWidth": 100, - "experimentalTernaries": true, - "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"], - "pluginSearchDirs": false -} diff --git a/package.json b/package.json index 628b243..8097a39 100644 --- a/package.json +++ b/package.json @@ -8,21 +8,9 @@ "dev": "vite", "prebuild": "node scripts/generate-metadata.js", "build": "vite build && node scripts/build-worker.js", - "serve": "vite preview" - }, - "devDependencies": { - "@iconify-json/lucide": "^1.2.106", - "@iconify/tailwind4": "^1.2.3", - "@tailwindcss/vite": "^4.3.0", - "@types/node": "^25.7.0", - "esbuild": "^0.28.0", - "prettier": "^3.8.3", - "prettier-plugin-organize-imports": "^4.3.0", - "prettier-plugin-tailwindcss": "^0.8.0", - "tailwindcss": "^4.3.0", - "typescript": "^6.0.3", - "vite": "^8.0.12", - "vite-plugin-solid": "^2.11.12" + "serve": "vite preview", + "format": "oxfmt", + "format:check": "oxfmt --check" }, "dependencies": { "@atcute/atproto": "^4.0.0", @@ -60,5 +48,17 @@ "solid-js": "^1.9.12", "valibot": "^1.4.0" }, + "devDependencies": { + "@iconify-json/lucide": "^1.2.106", + "@iconify/tailwind4": "^1.2.3", + "@tailwindcss/vite": "^4.3.0", + "@types/node": "^25.7.0", + "esbuild": "^0.28.0", + "oxfmt": "^0.51.0", + "tailwindcss": "^4.3.0", + "typescript": "^6.0.3", + "vite": "^8.0.12", + "vite-plugin-solid": "^2.11.12" + }, "packageManager": "pnpm@10.32.1+sha512.a706938f0e89ac1456b6563eab4edf1d1faf3368d1191fc5c59790e96dc918e4456ab2e67d613de1043d2e8c81f87303e6b40d4ffeca9df15ef1ad567348f2be" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e30ba11..4a1f0cf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -126,15 +126,9 @@ importers: esbuild: specifier: ^0.28.0 version: 0.28.0 - prettier: - specifier: ^3.8.3 - version: 3.8.3 - prettier-plugin-organize-imports: - specifier: ^4.3.0 - version: 4.3.0(prettier@3.8.3)(typescript@6.0.3) - prettier-plugin-tailwindcss: - specifier: ^0.8.0 - version: 0.8.0(prettier-plugin-organize-imports@4.3.0(prettier@3.8.3)(typescript@6.0.3))(prettier@3.8.3) + oxfmt: + specifier: ^0.51.0 + version: 0.51.0 tailwindcss: specifier: ^4.3.0 version: 4.3.0 @@ -786,6 +780,128 @@ packages: '@oxc-project/types@0.129.0': resolution: {integrity: sha512-3oz8m3FGdr2nDXVqmFUw7jolKliC4MoyXYIG2c7gpjBnzUWQpUGIYcXYKxTdTi+N2jusvt610ckTMkxdwHkYEg==} + '@oxfmt/binding-android-arm-eabi@0.51.0': + resolution: {integrity: sha512-Ni0sCqg5CIHaLIYFGj+ncbcumylvNC6FE4rfD0KfdmnWHbPJ+zev0qZCXKxy2hFVa0fYRK0yPzf5nzPbkZou7g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxfmt/binding-android-arm64@0.51.0': + resolution: {integrity: sha512-eu5lAZjuo0KAkp+M24EhDqfOwA8owQ8d7wyBlOUUGRbDLHpU3IRlDHp8Dif+YqGlxs6jra7yS6WQu/NkPhAxeg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxfmt/binding-darwin-arm64@0.51.0': + resolution: {integrity: sha512-6LsUNIdURhhcIfIn8+xsOb61mSTa9msAHTeSGx9Jf4rsP/gN8PGCF+SKWPAQZbND2w/WBkqQ6303jqEEIXzMdQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxfmt/binding-darwin-x64@0.51.0': + resolution: {integrity: sha512-9aUMGmVxdHjYMsEAW1tNRoieTJXlVNDFkRvIR1J7LttJXWjVYCu2ekclLij2KJtxBxSQOYSHd12ME/adVGVbZg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxfmt/binding-freebsd-x64@0.51.0': + resolution: {integrity: sha512-mkY1nhZTqYb+NHaAWxOCKISN6FwdrwMNsu17vTUA3wzUV2VJ+Paq15ZokRcsMU/2PUdHO73prxyeJpjXQ3MPpQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxfmt/binding-linux-arm-gnueabihf@0.51.0': + resolution: {integrity: sha512-wtFwNwE4+YCNuPaWoGDZeGsKvD6D1YSUNBJNn/rJBh7CrDBThFE+TBI5kY7vRW9rIOQRsbW2IpyyL3Du4Zqwiw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm-musleabihf@0.51.0': + resolution: {integrity: sha512-rnOaNx86G7iRKM6lsCIQMux0SMGNC/TEbFR+r7lpruJ12bnrIWgxd5w1PLqOvgR9r8ZJbpK/zfRKctJnh8/Jfg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm64-gnu@0.51.0': + resolution: {integrity: sha512-jOgDzSqWcICGRjsp4mc08FxKMN8vzP2Kgs4E0d2HUP99F+nJDQKklRV4Zuj+0gcBgjrzx2CbpqaIdUVPepCojA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-arm64-musl@0.51.0': + resolution: {integrity: sha512-KBUCdrH5bwVrAvI9gU/1S55oH6fzXjr++J/oVocdu7bYTks1l7DNNT+rLd/1TDdAEjObGwmfWamn7LC1m8A0DQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-ppc64-gnu@0.51.0': + resolution: {integrity: sha512-NapfjYsABFqTJ1Dn9Efq6sN5esaHconVKwVLbDGNQLrwpOx/g17mkwErHzU72PutL67nf3wNAkbq122H+zLxag==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-gnu@0.51.0': + resolution: {integrity: sha512-5dlDt1dUZCVi6elIhiK1PWg9wpTzTcIuj0IZnSurvIoMrhOWqqTcc1dSTxcSkNaBZhfsNqRZdINI1zAgbKkJNQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-musl@0.51.0': + resolution: {integrity: sha512-pgdWUJn0S5nulyiVdlFV8DzCUnGXkU99W5PSkkmbaZW+LrZBPxpezun4G0DDHbQaVYuJeCuKsXsGKGo77CkUTQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-s390x-gnu@0.51.0': + resolution: {integrity: sha512-2XTFUe97CbDGAI8vjwDfZ1HdakO0XIADyJ24idEg64SC4/K4in/OisXVnrW4NMK7I6TgC7EqRhC0Ln/nKhAemA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-gnu@0.51.0': + resolution: {integrity: sha512-kQ1OuCqqt/yyf0ZN9VFxW1/JnlgJgii3Dr7pWf9vNBvrX1hv6g39/+mc5oGRHRGJFZtl3zsGDWR9c5N2B/gwBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-musl@0.51.0': + resolution: {integrity: sha512-ARTYqxHF475o96Gbn41hvSWSSRygPlRDXZZgZ9I2scU1y0qiWpCQyZCoefaQa0mwv+wwtZ+luS4YOzsRzM/izg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-openharmony-arm64@0.51.0': + resolution: {integrity: sha512-QiC1XrCl6a6BmqMzduO8hdIRMf1m44hCkt2Q68KWkTvUB/E7fd2iomyNh6KnnRca5w6eBrRAAtLFqTh+xjsjJA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxfmt/binding-win32-arm64-msvc@0.51.0': + resolution: {integrity: sha512-NC/hJb9dtU23Zf8L7IVK95xnFjiQ7AfcLO2l5pb69TDEr958qxrtnB2CveeeNSCBFNIkgaTCfd/vHNSoG78l9g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxfmt/binding-win32-ia32-msvc@0.51.0': + resolution: {integrity: sha512-2C45za4Rj36n8YIbhRL1PQbxmXJYf81WEcAgvj5I4ptRROG+A+81hREEN5bmCHADE1UfYaN312U6tkILoZZy6w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxfmt/binding-win32-x64-msvc@0.51.0': + resolution: {integrity: sha512-73RqdAuVKQTkjZIDw08JaDHUM4lav5Qu+CaPwg4QbbA7k8o7LEW0p3UsfZ/F8dsO/pwVYh3RzFcanwLRTTahbQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + '@rolldown/binding-android-arm64@1.0.0': resolution: {integrity: sha512-TWMZnRLMe63C2Lhyicviu7ZHaU4kxa6PS3rofvc9GmcvptzNN11BcfQ4Sl7MwTOsisQoa2keB/EBdNCAnUo8vA==} engines: {node: ^20.19.0 || >=22.12.0} @@ -1382,6 +1498,16 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + oxfmt@0.51.0: + resolution: {integrity: sha512-l/AoAnaEOV7Q5/Z9kHOMDehVJnCgYN7wRoooWCTUMBMi16BJhLZqd9cmCnwcVFfVlzkt53zK2KLPFNp8vSsoDg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + svelte: ^5.0.0 + peerDependenciesMeta: + svelte: + optional: true + package-manager-detector@1.6.0: resolution: {integrity: sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==} @@ -1402,76 +1528,6 @@ packages: resolution: {integrity: sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==} engines: {node: ^10 || ^12 || >=14} - prettier-plugin-organize-imports@4.3.0: - resolution: {integrity: sha512-FxFz0qFhyBsGdIsb697f/EkvHzi5SZOhWAjxcx2dLt+Q532bAlhswcXGYB1yzjZ69kW8UoadFBw7TyNwlq96Iw==} - peerDependencies: - prettier: '>=2.0' - typescript: '>=2.9' - vue-tsc: ^2.1.0 || 3 - peerDependenciesMeta: - vue-tsc: - optional: true - - prettier-plugin-tailwindcss@0.8.0: - resolution: {integrity: sha512-V8ITGH87yuBDF6JpEZTOVlUz/saAwqb8f3HRgUj8Lh+tGCcrmorhsLpYqzygwFwK0PE2Ib6Mv3M7T/uE2tZV1g==} - engines: {node: '>=20.19'} - peerDependencies: - '@ianvs/prettier-plugin-sort-imports': '*' - '@prettier/plugin-hermes': '*' - '@prettier/plugin-oxc': '*' - '@prettier/plugin-pug': '*' - '@shopify/prettier-plugin-liquid': '*' - '@trivago/prettier-plugin-sort-imports': '*' - '@zackad/prettier-plugin-twig': '*' - prettier: ^3.0 - prettier-plugin-astro: '*' - prettier-plugin-css-order: '*' - prettier-plugin-jsdoc: '*' - prettier-plugin-marko: '*' - prettier-plugin-multiline-arrays: '*' - prettier-plugin-organize-attributes: '*' - prettier-plugin-organize-imports: '*' - prettier-plugin-sort-imports: '*' - prettier-plugin-svelte: '*' - peerDependenciesMeta: - '@ianvs/prettier-plugin-sort-imports': - optional: true - '@prettier/plugin-hermes': - optional: true - '@prettier/plugin-oxc': - optional: true - '@prettier/plugin-pug': - optional: true - '@shopify/prettier-plugin-liquid': - optional: true - '@trivago/prettier-plugin-sort-imports': - optional: true - '@zackad/prettier-plugin-twig': - optional: true - prettier-plugin-astro: - optional: true - prettier-plugin-css-order: - optional: true - prettier-plugin-jsdoc: - optional: true - prettier-plugin-marko: - optional: true - prettier-plugin-multiline-arrays: - optional: true - prettier-plugin-organize-attributes: - optional: true - prettier-plugin-organize-imports: - optional: true - prettier-plugin-sort-imports: - optional: true - prettier-plugin-svelte: - optional: true - - prettier@3.8.3: - resolution: {integrity: sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==} - engines: {node: '>=14'} - hasBin: true - react@19.2.5: resolution: {integrity: sha512-llUJLzz1zTUBrskt2pwZgLq59AemifIftw4aB7JxOqf1HY2FDaGDxgwpAPVzHU1kdWabH7FauP4i1oEeer2WCA==} engines: {node: '>=0.10.0'} @@ -1540,6 +1596,10 @@ packages: resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==} engines: {node: '>=12.0.0'} + tinypool@2.1.0: + resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==} + engines: {node: ^20.0.0 || >=22.0.0} + tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -2279,6 +2339,63 @@ snapshots: '@oxc-project/types@0.129.0': {} + '@oxfmt/binding-android-arm-eabi@0.51.0': + optional: true + + '@oxfmt/binding-android-arm64@0.51.0': + optional: true + + '@oxfmt/binding-darwin-arm64@0.51.0': + optional: true + + '@oxfmt/binding-darwin-x64@0.51.0': + optional: true + + '@oxfmt/binding-freebsd-x64@0.51.0': + optional: true + + '@oxfmt/binding-linux-arm-gnueabihf@0.51.0': + optional: true + + '@oxfmt/binding-linux-arm-musleabihf@0.51.0': + optional: true + + '@oxfmt/binding-linux-arm64-gnu@0.51.0': + optional: true + + '@oxfmt/binding-linux-arm64-musl@0.51.0': + optional: true + + '@oxfmt/binding-linux-ppc64-gnu@0.51.0': + optional: true + + '@oxfmt/binding-linux-riscv64-gnu@0.51.0': + optional: true + + '@oxfmt/binding-linux-riscv64-musl@0.51.0': + optional: true + + '@oxfmt/binding-linux-s390x-gnu@0.51.0': + optional: true + + '@oxfmt/binding-linux-x64-gnu@0.51.0': + optional: true + + '@oxfmt/binding-linux-x64-musl@0.51.0': + optional: true + + '@oxfmt/binding-openharmony-arm64@0.51.0': + optional: true + + '@oxfmt/binding-win32-arm64-msvc@0.51.0': + optional: true + + '@oxfmt/binding-win32-ia32-msvc@0.51.0': + optional: true + + '@oxfmt/binding-win32-x64-msvc@0.51.0': + optional: true + '@rolldown/binding-android-arm64@1.0.0': optional: true @@ -2788,6 +2905,30 @@ snapshots: dependencies: boolbase: 1.0.0 + oxfmt@0.51.0: + dependencies: + tinypool: 2.1.0 + optionalDependencies: + '@oxfmt/binding-android-arm-eabi': 0.51.0 + '@oxfmt/binding-android-arm64': 0.51.0 + '@oxfmt/binding-darwin-arm64': 0.51.0 + '@oxfmt/binding-darwin-x64': 0.51.0 + '@oxfmt/binding-freebsd-x64': 0.51.0 + '@oxfmt/binding-linux-arm-gnueabihf': 0.51.0 + '@oxfmt/binding-linux-arm-musleabihf': 0.51.0 + '@oxfmt/binding-linux-arm64-gnu': 0.51.0 + '@oxfmt/binding-linux-arm64-musl': 0.51.0 + '@oxfmt/binding-linux-ppc64-gnu': 0.51.0 + '@oxfmt/binding-linux-riscv64-gnu': 0.51.0 + '@oxfmt/binding-linux-riscv64-musl': 0.51.0 + '@oxfmt/binding-linux-s390x-gnu': 0.51.0 + '@oxfmt/binding-linux-x64-gnu': 0.51.0 + '@oxfmt/binding-linux-x64-musl': 0.51.0 + '@oxfmt/binding-openharmony-arm64': 0.51.0 + '@oxfmt/binding-win32-arm64-msvc': 0.51.0 + '@oxfmt/binding-win32-ia32-msvc': 0.51.0 + '@oxfmt/binding-win32-x64-msvc': 0.51.0 + package-manager-detector@1.6.0: {} parse5@7.3.0: @@ -2806,19 +2947,6 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - prettier-plugin-organize-imports@4.3.0(prettier@3.8.3)(typescript@6.0.3): - dependencies: - prettier: 3.8.3 - typescript: 6.0.3 - - prettier-plugin-tailwindcss@0.8.0(prettier-plugin-organize-imports@4.3.0(prettier@3.8.3)(typescript@6.0.3))(prettier@3.8.3): - dependencies: - prettier: 3.8.3 - optionalDependencies: - prettier-plugin-organize-imports: 4.3.0(prettier@3.8.3)(typescript@6.0.3) - - prettier@3.8.3: {} - react@19.2.5: optional: true @@ -2905,6 +3033,8 @@ snapshots: fdir: 6.5.0(picomatch@4.0.4) picomatch: 4.0.4 + tinypool@2.1.0: {} + tslib@2.8.1: optional: true diff --git a/scripts/build-worker.js b/scripts/build-worker.js index 760840e..2040694 100644 --- a/scripts/build-worker.js +++ b/scripts/build-worker.js @@ -1,8 +1,9 @@ -import { build } from "esbuild"; import { copyFileSync } from "fs"; import { dirname, resolve } from "path"; import { fileURLToPath } from "url"; +import { build } from "esbuild"; + const __dirname = dirname(fileURLToPath(import.meta.url)); const wasmSrc = resolve(__dirname, "../node_modules/@takumi-rs/wasm/pkg/takumi_wasm_bg.wasm"); diff --git a/src/auth/account.tsx b/src/auth/account.tsx index ffe5af7..e660c1a 100644 --- a/src/auth/account.tsx +++ b/src/auth/account.tsx @@ -3,6 +3,7 @@ import { deleteStoredSession, getSession, OAuthUserAgent } from "@atcute/oauth-b import { A } from "@solidjs/router"; import { createEffect, For, onMount, Show } from "solid-js"; import { produce } from "solid-js/store"; + import { ActionMenu, DropdownMenu, MenuProvider, NavMenu } from "../components/dropdown.jsx"; import { Modal } from "../components/modal.jsx"; import { Login } from "./login.jsx"; @@ -200,9 +201,11 @@ export const AccountManager = () => { onclick={() => setOpenManager(true)} class={`flex items-center rounded-md ${agent() && avatars[agent()!.sub] ? "p-1.25" : "p-1.5"} hover:bg-neutral-200 active:bg-neutral-300 dark:hover:bg-neutral-700/50 dark:active:bg-neutral-700`} > - {agent() && avatars[agent()!.sub] ? + {agent() && avatars[agent()!.sub] ? ( - : } + ) : ( + + )} ); diff --git a/src/auth/login.tsx b/src/auth/login.tsx index 1cfb52a..36a0f31 100644 --- a/src/auth/login.tsx +++ b/src/auth/login.tsx @@ -1,4 +1,5 @@ import { createSignal, Show } from "solid-js"; + import "./oauth-config"; import { useOAuthScopeFlow } from "./scope-flow"; import { ScopeSelector } from "./scope-selector"; diff --git a/src/auth/oauth-config.ts b/src/auth/oauth-config.ts index 3a3f9d4..95afb85 100644 --- a/src/auth/oauth-config.ts +++ b/src/auth/oauth-config.ts @@ -1,5 +1,6 @@ import { LocalActorResolver } from "@atcute/identity-resolver"; import { configureOAuth } from "@atcute/oauth-browser-client"; + import { didDocumentResolver, handleResolver } from "../lib/api"; const reactiveDidDocumentResolver = { diff --git a/src/auth/scope-flow.ts b/src/auth/scope-flow.ts index 0d4c929..4b06e23 100644 --- a/src/auth/scope-flow.ts +++ b/src/auth/scope-flow.ts @@ -46,9 +46,9 @@ export const useOAuthScopeFlow = (options: UseOAuthScopeFlowOptions = {}) => { const authUrl = await createAuthorizationUrl({ scope: scopeString, target: - isHandle(account) || isDid(account) ? - { type: "account", identifier: account } - : { type: "pds", serviceUrl: account }, + isHandle(account) || isDid(account) + ? { type: "account", identifier: account } + : { type: "pds", serviceUrl: account }, }); await new Promise((resolve) => setTimeout(resolve, 250)); diff --git a/src/auth/scope-selector.tsx b/src/auth/scope-selector.tsx index 3b32b79..fc2a2e4 100644 --- a/src/auth/scope-selector.tsx +++ b/src/auth/scope-selector.tsx @@ -1,4 +1,5 @@ import { createSignal, For } from "solid-js"; + import { buildScopeString, GRANULAR_SCOPES, scopeIdsToString } from "./scope-utils"; interface ScopeSelectorProps { diff --git a/src/auth/session-manager.ts b/src/auth/session-manager.ts index d263dab..6ac8570 100644 --- a/src/auth/session-manager.ts +++ b/src/auth/session-manager.ts @@ -6,6 +6,7 @@ import { OAuthUserAgent, type Session, } from "@atcute/oauth-browser-client"; + import { resolveDidDoc } from "../lib/api"; import { Sessions, setAgent, setSessions } from "./state"; diff --git a/src/components/backlinks.tsx b/src/components/backlinks.tsx index 72cde4c..ed75d6f 100644 --- a/src/components/backlinks.tsx +++ b/src/components/backlinks.tsx @@ -1,6 +1,7 @@ import * as TID from "@atcute/tid"; import { A, useLocation } from "@solidjs/router"; import { createResource, createSignal, For, onMount, Show } from "solid-js"; + import { getAllBacklinks, getRecordBacklinks, LinksWithRecords } from "../lib/api.js"; import { useRepo } from "../lib/repo-context.jsx"; import { localDateFromTimestamp } from "../utils/date.js"; @@ -78,9 +79,9 @@ const BacklinkRecords = (props: BacklinksProps & { cursor?: string }) => { const uri = `at://${did}/${collection}/${rkey}`; const rkeyIsRepo = rkey === props.repoDid; const timestamp = - !rkeyIsRepo && TID.validate(rkey) ? - localDateFromTimestamp(TID.parse(rkey).timestamp / 1000) - : null; + !rkeyIsRepo && TID.validate(rkey) + ? localDateFromTimestamp(TID.parse(rkey).timestamp / 1000) + : null; return ( { if (hasUserScope("blob")) { @@ -460,25 +459,19 @@ export const RecordEditor = (props: { - : isCid(part) && props.isLink && ctx.parentIsBlob && params.repo ? + ) : isCid(part) && props.isLink && ctx.parentIsBlob && params.repo ? ( {part} - : ( - isURL(part) && + ) : isURL(part) && ["http:", "https:", "web+at:"].includes(new URL(part).protocol) && - part.split("\n").length === 1 - ) ? + part.split("\n").length === 1 ? ( {part} - : part} + ) : ( + part + )} )} @@ -163,9 +164,9 @@ const CollapsibleItem = (props: { const location = useLocation(); const isObject = () => props.value === Object(props.value); const isEmpty = () => - Array.isArray(props.value) ? - (props.value as JSONType[]).length === 0 - : Object.keys(props.value as object).length === 0; + Array.isArray(props.value) + ? (props.value as JSONType[]).length === 0 + : Object.keys(props.value as object).length === 0; const [show, setShow] = createSignal(!(ctx.preview && isObject() && !isEmpty())); const isBlobContext = props.parentIsBlob ?? ctx.parentIsBlob; diff --git a/src/components/lexicon-schema.tsx b/src/components/lexicon-schema.tsx index 9527f4f..681ca75 100644 --- a/src/components/lexicon-schema.tsx +++ b/src/components/lexicon-schema.tsx @@ -2,6 +2,7 @@ import { Nsid } from "@atcute/lexicons"; import { AtprotoDid } from "@atcute/lexicons/syntax"; import { A, useLocation, useNavigate } from "@solidjs/router"; import { createEffect, For, Show } from "solid-js"; + import { resolveLexiconAuthority } from "../lib/api.js"; import Tooltip from "./tooltip.jsx"; @@ -136,10 +137,11 @@ interface LexiconProperty { const TypeBadge = (props: { type: string; format?: string; refType?: string }) => { const navigate = useNavigate(); - const displayType = - props.refType ? props.refType.replace(/^#/, "") - : props.format ? `${props.type}:${props.format}` - : props.type; + const displayType = props.refType + ? props.refType.replace(/^#/, "") + : props.format + ? `${props.type}:${props.format}` + : props.type; const isLocalRef = () => props.refType?.startsWith("#"); const isExternalRef = () => props.refType && !props.refType.startsWith("#"); diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index 338aa02..5f69330 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -1,6 +1,7 @@ import * as TID from "@atcute/tid"; import { A, useParams } from "@solidjs/router"; import { createEffect, createMemo, createSignal, JSX, Match, Show, Switch } from "solid-js"; + import { canHover } from "../layout"; import { didDocCache } from "../lib/api"; import { addToClipboard } from "../utils/copy"; diff --git a/src/components/nested-layout.tsx b/src/components/nested-layout.tsx index 1448d97..1c5710b 100644 --- a/src/components/nested-layout.tsx +++ b/src/components/nested-layout.tsx @@ -1,4 +1,5 @@ import { JSX, Show, Suspense } from "solid-js"; + import { Spinner } from "./spinner.jsx"; export const NestedLayout = (props: { diff --git a/src/components/permission-button.tsx b/src/components/permission-button.tsx index a89b161..8ed4afd 100644 --- a/src/components/permission-button.tsx +++ b/src/components/permission-button.tsx @@ -1,4 +1,5 @@ import { JSX } from "solid-js"; + import { hasUserScope } from "../auth/scope-utils"; import { showPermissionPrompt } from "./permission-prompt"; import Tooltip from "./tooltip"; diff --git a/src/components/permission-prompt.tsx b/src/components/permission-prompt.tsx index 90a4528..6cba05e 100644 --- a/src/components/permission-prompt.tsx +++ b/src/components/permission-prompt.tsx @@ -1,4 +1,5 @@ import { createEffect, createSignal } from "solid-js"; + import { GRANULAR_SCOPES } from "../auth/scope-utils"; import { agent, setOpenManager, setPendingPermissionEdit } from "../auth/state"; import { Button } from "./button"; diff --git a/src/components/search.tsx b/src/components/search.tsx index decd10d..cf23f4f 100644 --- a/src/components/search.tsx +++ b/src/components/search.tsx @@ -10,6 +10,7 @@ import { onMount, Show, } from "solid-js"; + import { canHover } from "../layout"; import { resolveLexiconAuthority, resolveLexiconAuthorityDirect } from "../lib/api"; import { appHandleLink, appList, AppUrl } from "../lib/app-urls"; @@ -335,9 +336,9 @@ export const Search = () => { } else if (e.key === "ArrowUp") { e.preventDefault(); setSelectedIndex((prev) => - prev === -1 ? - totalSuggestions - 1 - : (prev - 1 + totalSuggestions) % totalSuggestions, + prev === -1 + ? totalSuggestions - 1 + : (prev - 1 + totalSuggestions) % totalSuggestions, ); } else if (e.key === "Enter") { const index = selectedIndex(); @@ -426,18 +427,23 @@ export const Search = () => { {(recent, index) => { const icon = - recent.type === "handle" ? "lucide--at-sign" - : recent.type === "did" ? "lucide--user-round" - : recent.type === "at-uri" ? "lucide--link" - : recent.type === "lexicon" ? "lucide--book-open" - : recent.type === "pds" ? "lucide--hard-drive" - : "lucide--globe"; + recent.type === "handle" + ? "lucide--at-sign" + : recent.type === "did" + ? "lucide--user-round" + : recent.type === "at-uri" + ? "lucide--link" + : recent.type === "lexicon" + ? "lucide--book-open" + : recent.type === "pds" + ? "lucide--hard-drive" + : "lucide--globe"; return (
{ return ( { diff --git a/src/components/tag-input.tsx b/src/components/tag-input.tsx index 87670a1..7795899 100644 --- a/src/components/tag-input.tsx +++ b/src/components/tag-input.tsx @@ -1,4 +1,5 @@ import { createSignal, For, Show } from "solid-js"; + import { TextInput } from "./text-input"; export const TagInput = (props: { diff --git a/src/components/theme.tsx b/src/components/theme.tsx index 1d0200f..63263a8 100644 --- a/src/components/theme.tsx +++ b/src/components/theme.tsx @@ -8,9 +8,11 @@ export const themeEvent = () => { export const ThemeSelection = () => { const [theme, setTheme] = createSignal( - localStorage.getItem("theme") === null ? "auto" - : localStorage.theme === "dark" ? "dark" - : "light", + localStorage.getItem("theme") === null + ? "auto" + : localStorage.theme === "dark" + ? "dark" + : "light", ); const updateTheme = (newTheme: string) => { diff --git a/src/components/tooltip.tsx b/src/components/tooltip.tsx index a0d3b4f..9bbcf5c 100644 --- a/src/components/tooltip.tsx +++ b/src/components/tooltip.tsx @@ -1,4 +1,5 @@ import { JSX, Show } from "solid-js"; + import { canHover } from "../layout"; const Tooltip = (props: { text: string; shortcut?: string; children: JSX.Element }) => ( diff --git a/src/components/video-player.tsx b/src/components/video-player.tsx index 65efd0c..6bd2d07 100644 --- a/src/components/video-player.tsx +++ b/src/components/video-player.tsx @@ -1,4 +1,5 @@ import { onCleanup, onMount } from "solid-js"; + import { useRepo } from "../lib/repo-context.jsx"; export interface VideoPlayerProps { diff --git a/src/index.tsx b/src/index.tsx index ac2b7c3..0c3aa14 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,7 +1,9 @@ /* @refresh reload */ import { Route, Router } from "@solidjs/router"; import { render } from "solid-js/web"; + import { Layout } from "./layout.tsx"; + import "./styles/index.css"; import { CarView } from "./views/car/explore.tsx"; import { CollectionLayout } from "./views/collection.tsx"; diff --git a/src/layout.tsx b/src/layout.tsx index 4ca7075..6ccc164 100644 --- a/src/layout.tsx +++ b/src/layout.tsx @@ -1,5 +1,6 @@ import { A, RouteSectionProps, useIsRouting, useLocation, useNavigate } from "@solidjs/router"; import { createEffect, ErrorBoundary, on, onCleanup, onMount, Show, Suspense } from "solid-js"; + import { AccountManager } from "./auth/account.jsx"; import { agent } from "./auth/state.js"; import { RecordEditor } from "./components/create"; @@ -118,9 +119,9 @@ const Layout = (props: RouteSectionProps) => { class={`dark:shadow-dark-700 mb-3 flex h-13 w-full items-center justify-between rounded-xl border-[0.5px] border-neutral-300 bg-neutral-50 bg-size-[95%] bg-right bg-no-repeat p-2 pl-3 shadow-xs [--header-bg:#fafafa] [--trans-blue:#5BCEFA90] [--trans-pink:#F5A9B890] [--trans-white:#FFFFFF90] dark:border-neutral-700 dark:bg-neutral-800 dark:[--header-bg:#262626] dark:[--trans-blue:#5BCEFAa0] dark:[--trans-pink:#F5A9B8a0] dark:[--trans-white:#FFFFFFa0] ${localStorage.getItem("hrt") === "true" ? "bg-[linear-gradient(to_left,transparent_10%,var(--header-bg)_85%),linear-gradient(to_bottom,var(--trans-blue)_0%,var(--trans-blue)_20%,var(--trans-pink)_20%,var(--trans-pink)_40%,var(--trans-white)_40%,var(--trans-white)_60%,var(--trans-pink)_60%,var(--trans-pink)_80%,var(--trans-blue)_80%,var(--trans-blue)_100%)]" : ""}`} style={{ "background-image": - props.params.repo && props.params.repo in headers ? - `linear-gradient(to left, transparent 20%, var(--header-bg) 85%), url(/headers/${headers[props.params.repo]})` - : undefined, + props.params.repo && props.params.repo in headers + ? `linear-gradient(to left, transparent 20%, var(--header-bg) 85%), url(/headers/${headers[props.params.repo]})` + : undefined, }} > string): typeof fetch => { @@ -27,9 +28,7 @@ const proxyFetch = (rewrite: (url: URL) => string): typeof fetch => { } catch (err) { if (init?.signal?.aborted) throw err; const url = new URL( - typeof input === "string" ? input - : input instanceof URL ? input.href - : input.url, + typeof input === "string" ? input : input instanceof URL ? input.href : input.url, ); return fetch(rewrite(url)); } diff --git a/src/lib/schema-tab.tsx b/src/lib/schema-tab.tsx index 2a4e2ed..c42a586 100644 --- a/src/lib/schema-tab.tsx +++ b/src/lib/schema-tab.tsx @@ -3,6 +3,7 @@ import { Nsid } from "@atcute/lexicons"; import { AtprotoDid } from "@atcute/lexicons/syntax"; import { useLocation } from "@solidjs/router"; import { createEffect, createSignal, ErrorBoundary, Show } from "solid-js"; + import { LexiconSchemaView } from "../components/lexicon-schema.jsx"; import { resolveLexiconAuthority, resolveLexiconSchema } from "./api.js"; diff --git a/src/views/car/explore.tsx b/src/views/car/explore.tsx index d2cdb2e..43faa53 100644 --- a/src/views/car/explore.tsx +++ b/src/views/car/explore.tsx @@ -16,6 +16,7 @@ import { Switch, untrack, } from "solid-js"; + import { Button } from "../../components/button.jsx"; import { Favicon } from "../../components/favicon.jsx"; import HoverCard from "../../components/hover-card/base"; diff --git a/src/views/collection.tsx b/src/views/collection.tsx index 064595b..674e589 100644 --- a/src/views/collection.tsx +++ b/src/views/collection.tsx @@ -15,6 +15,7 @@ import { } from "solid-js"; import { createStore } from "solid-js/store"; import { Portal } from "solid-js/web"; + import { agent } from "../auth/state"; import { Button } from "../components/button.jsx"; import HoverCard from "../components/hover-card/base"; @@ -86,9 +87,11 @@ const formatPreviewValue = (value: JSONType | undefined) => { if (value === undefined) return; const str = - typeof value === "string" ? JSON.stringify(value) - : typeof value === "number" || typeof value === "boolean" || value === null ? String(value) - : JSON.stringify(value); + typeof value === "string" + ? JSON.stringify(value) + : typeof value === "number" || typeof value === "boolean" || value === null + ? String(value) + : JSON.stringify(value); if (str.length <= PREVIEW_VALUE_MAX_LENGTH) return str; @@ -304,8 +307,9 @@ const CollectionView = () => { const [reverse, setReverse] = createSignal(searchParams.reverse === "true"); const previewField = () => getSearchParam(searchParams.preview); const limit = () => { - const limitParam = - Array.isArray(searchParams.limit) ? searchParams.limit[0] : searchParams.limit; + const limitParam = Array.isArray(searchParams.limit) + ? searchParams.limit[0] + : searchParams.limit; const paramLimit = parseInt(limitParam || ""); return !isNaN(paramLimit) && paramLimit > 0 && paramLimit <= 100 ? paramLimit : DEFAULT_LIMIT; }; @@ -573,9 +577,9 @@ const CollectionView = () => {
{ handleSelectionClick(e, index()); diff --git a/src/views/home.tsx b/src/views/home.tsx index a723947..fc36679 100644 --- a/src/views/home.tsx +++ b/src/views/home.tsx @@ -1,5 +1,6 @@ import { A } from "@solidjs/router"; import { JSX, Show } from "solid-js"; + import { agent, avatars, sessions, setOpenManager, setShowAddAccount } from "../auth/state"; import { setShowSearch } from "../components/search"; @@ -30,9 +31,11 @@ const CardContent = (props: { }) => ( <> - {typeof props.icon === "string" ? + {typeof props.icon === "string" ? ( - : props.icon} + ) : ( + props.icon + )} {props.title} @@ -138,12 +141,14 @@ export const Home = () => { - : "lucide--user-round" + ) : ( + "lucide--user-round" + ) } title={sessions[agent()!.sub]?.handle ?? agent()!.sub} description="View your repository" diff --git a/src/views/labels.tsx b/src/views/labels.tsx index 0d7d3dd..d953e83 100644 --- a/src/views/labels.tsx +++ b/src/views/labels.tsx @@ -4,6 +4,7 @@ import { isAtprotoDid } from "@atcute/identity"; import { Handle } from "@atcute/lexicons"; import { useSearchParams } from "@solidjs/router"; import { createMemo, createSignal, For, onMount, Show } from "solid-js"; + import { Button } from "../components/button.jsx"; import DidHoverCard from "../components/hover-card/did.jsx"; import RecordHoverCard from "../components/hover-card/record.jsx"; diff --git a/src/views/pds.tsx b/src/views/pds.tsx index bd2190e..599c7f6 100644 --- a/src/views/pds.tsx +++ b/src/views/pds.tsx @@ -5,6 +5,7 @@ import * as TID from "@atcute/tid"; import { A, type RouteSectionProps, useLocation, useParams } from "@solidjs/router"; import { createWindowVirtualizer } from "@tanstack/solid-virtual"; import { createEffect, createResource, createSignal, For, on, onCleanup, Show } from "solid-js"; + import { Button } from "../components/button"; import { setPDS } from "../components/navbar"; import { NestedLayout } from "../components/nested-layout.jsx"; @@ -129,9 +130,11 @@ const RepoCard = (props: { {props.repo.status ?? "inactive"} @@ -206,8 +209,9 @@ const PdsView = () => { const hidden = () => !!params.repo; const location = useLocation(); if (params.pds !== "at:") setPDS(params.pds); - const pds = - params.pds!.startsWith("localhost") ? `http://${params.pds}` : `https://${params.pds}`; + const pds = params.pds!.startsWith("localhost") + ? `http://${params.pds}` + : `https://${params.pds}`; const rpc = new Client({ handler: simpleFetchHandler({ service: pds }) }); const cached = pdsCache?.pds === pds ? pdsCache : undefined; const [version, setVersion] = createSignal(cached?.version); @@ -307,9 +311,9 @@ const PdsView = () => { (!location.hash && props.tab !== "repos"), }} href={ - props.tab === "firehose" ? - `/firehose?instance=wss://${params.pds}` - : `/${params.pds}#${props.tab}` + props.tab === "firehose" + ? `/firehose?instance=wss://${params.pds}` + : `/${params.pds}#${props.tab}` } > {props.label} @@ -413,9 +417,8 @@ const PdsView = () => { { label: "Terms of Service", url: server().links?.termsOfService }, { label: "Contact", - url: - server().contact?.email ? - `mailto:${server().contact?.email}` + url: server().contact?.email + ? `mailto:${server().contact?.email}` : undefined, display: server().contact?.email, }, diff --git a/src/views/record.tsx b/src/views/record.tsx index 80c3ba1..18b9a3f 100644 --- a/src/views/record.tsx +++ b/src/views/record.tsx @@ -9,6 +9,7 @@ import { verifyRecord } from "@atcute/repo"; import { A, useLocation, useNavigate, useParams } from "@solidjs/router"; import { createResource, createSignal, ErrorBoundary, For, Show, Suspense } from "solid-js"; import * as v from "valibot"; + import { agent } from "../auth/state"; import { Backlinks } from "../components/backlinks.jsx"; import { Button } from "../components/button.jsx"; @@ -459,9 +460,12 @@ export const RecordView = () => { {(link) => { const bskyAlts = () => - link().link.startsWith("https://bsky.app") ? - bskyAltClients.map((alt) => ({ ...alt, link: alt.transform(link().link) })) - : []; + link().link.startsWith("https://bsky.app") + ? bskyAltClients.map((alt) => ({ + ...alt, + link: alt.transform(link().link), + })) + : []; return (
{ title={`Open on ${alt.label}`} class="flex p-1.5 hover:bg-neutral-200/50 active:bg-neutral-200 dark:hover:bg-neutral-700 dark:active:bg-neutral-600" > - {alt.icon ? + {alt.icon ? ( - : } + ) : ( + + )} )} @@ -554,9 +560,9 @@ export const RecordView = () => { loading={lexicon.loading()} error={lexicon.error()} fallbackSchema={ - params.collection === "com.atproto.lexicon.schema" ? - (record()?.value as any) - : undefined + params.collection === "com.atproto.lexicon.schema" + ? (record()?.value as any) + : undefined } /> diff --git a/src/views/repo/blob-debug.tsx b/src/views/repo/blob-debug.tsx index 1613ba2..2e48946 100644 --- a/src/views/repo/blob-debug.tsx +++ b/src/views/repo/blob-debug.tsx @@ -11,6 +11,7 @@ import { Show, Switch, } from "solid-js"; + import { Button } from "../../components/button.jsx"; import { Spinner } from "../../components/spinner.jsx"; import VideoPlayer from "../../components/video-player.jsx"; @@ -89,9 +90,9 @@ export const BlobDebugView = () => { const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", bytes)); const parsed = parsedCid(); const expected = - parsed.ok && parsed.cid.digest.codec === CID.HASH_SHA256 ? - parsed.cid.digest.contents - : new Uint8Array(); + parsed.ok && parsed.cid.digest.codec === CID.HASH_SHA256 + ? parsed.cid.digest.contents + : new Uint8Array(); const matches = expected.length === digest.length && digest.every((b, i) => b === expected[i]); @@ -128,10 +129,13 @@ export const BlobDebugView = () => { }); const previewKind = (mime: string) => - mime.startsWith("image/") ? "image" - : mime === "video/mp4" ? "video" - : mime.startsWith("audio/") ? "audio" - : "none"; + mime.startsWith("image/") + ? "image" + : mime === "video/mp4" + ? "video" + : mime.startsWith("audio/") + ? "audio" + : "none"; const unsupportedHash = () => { const p = parsedCid(); @@ -248,11 +252,11 @@ export const BlobDebugView = () => { }} /> - {unsupported !== undefined ? - "Unsupported" - : b().matches ? - "Valid" - : "Mismatch"} + {unsupported !== undefined + ? "Unsupported" + : b().matches + ? "Valid" + : "Mismatch"} diff --git a/src/views/repo/blob.tsx b/src/views/repo/blob.tsx index 98541fd..246f4ef 100644 --- a/src/views/repo/blob.tsx +++ b/src/views/repo/blob.tsx @@ -1,6 +1,7 @@ import { Client, simpleFetchHandler } from "@atcute/client"; import { A } from "@solidjs/router"; import { createResource, createSignal, For, Show } from "solid-js"; + import { Button } from "../../components/button"; const LIMIT = 1000; diff --git a/src/views/repo/identity.tsx b/src/views/repo/identity.tsx index 62f3b96..6885d57 100644 --- a/src/views/repo/identity.tsx +++ b/src/views/repo/identity.tsx @@ -2,6 +2,7 @@ import { DidDocument } from "@atcute/identity"; import { Did, Handle } from "@atcute/lexicons"; import { createSignal, For, Show } from "solid-js"; import { createStore } from "solid-js/store"; + import { canHover } from "../../layout.jsx"; import { type HandleResolveResult, resolveHandleDetailed, validateHandle } from "../../lib/api.js"; import { detectDidKeyType, detectKeyType } from "../../lib/key.js"; diff --git a/src/views/repo/index.tsx b/src/views/repo/index.tsx index 6fbc54b..5307823 100644 --- a/src/views/repo/index.tsx +++ b/src/views/repo/index.tsx @@ -10,6 +10,7 @@ import { useParams, } from "@solidjs/router"; import { createEffect, createResource, createSignal, For, onMount, Show } from "solid-js"; + import { Backlinks } from "../../components/backlinks.jsx"; import { ActionMenu, @@ -396,9 +397,11 @@ const RepoView = () => {
{error()} @@ -430,9 +433,9 @@ const RepoView = () => { { > - filter() ? - authority.includes(filter()!) || - nsids()?.[authority].nsids.some((nsid) => - `${authority}.${nsid}`.includes(filter()!), - ) - : true, + filter() + ? authority.includes(filter()!) || + nsids()?.[authority].nsids.some((nsid) => + `${authority}.${nsid}`.includes(filter()!), + ) + : true, )} > {(authority) => { diff --git a/src/views/repo/logs.tsx b/src/views/repo/logs.tsx index 135cce6..e2f0424 100644 --- a/src/views/repo/logs.tsx +++ b/src/views/repo/logs.tsx @@ -7,6 +7,7 @@ import { import { useLocation } from "@solidjs/router"; import { createEffect, createResource, createSignal, For, onCleanup, Show } from "solid-js"; import * as v from "valibot"; + import Tooltip from "../../components/tooltip.jsx"; import { createOperationHistory, DiffEntry, groupBy } from "../../lib/plc-logs.js"; import { localDateFromTimestamp } from "../../utils/date.js"; diff --git a/src/views/settings.tsx b/src/views/settings.tsx index f426552..5f16783 100644 --- a/src/views/settings.tsx +++ b/src/views/settings.tsx @@ -1,4 +1,5 @@ import { createSignal } from "solid-js"; + import { TextInput } from "../components/text-input.jsx"; import { ThemeSelection } from "../components/theme.jsx"; diff --git a/src/views/stream/index.tsx b/src/views/stream/index.tsx index 3666856..71b6366 100644 --- a/src/views/stream/index.tsx +++ b/src/views/stream/index.tsx @@ -1,6 +1,7 @@ import { Firehose } from "@skyware/firehose"; import { A, useLocation, useSearchParams } from "@solidjs/router"; import { createSignal, For, onCleanup, onMount, Show } from "solid-js"; + import { Button } from "../../components/button"; import DidHoverCard from "../../components/hover-card/did"; import { JSONValue } from "../../components/json"; @@ -59,9 +60,11 @@ const StreamRecordItem = (props: { record: any; streamType: StreamType }) => { class="dark:hover:bg-dark-200 flex min-w-0 flex-1 items-start gap-2 rounded p-1 text-left hover:bg-neutral-200/70" > - {expanded() ? + {expanded() ? ( - : } + ) : ( + + )}
diff --git a/src/views/stream/stats.tsx b/src/views/stream/stats.tsx index 1647e3a..1fbdd0d 100644 --- a/src/views/stream/stats.tsx +++ b/src/views/stream/stats.tsx @@ -1,4 +1,5 @@ import { For, Show } from "solid-js"; + import { STREAM_CONFIGS, StreamType } from "./config"; const TOP_COLLECTION_LIMIT = 5; diff --git a/src/worker.js b/src/worker.js index c607ec9..3b8c912 100644 --- a/src/worker.js +++ b/src/worker.js @@ -1,4 +1,5 @@ import { ImageResponse } from "@takumi-rs/image-response/wasm"; + import wasmModule from "./takumi_wasm_bg.wasm"; // Minimal createElement helper — avoids pulling in React @@ -8,10 +9,7 @@ function h(type, props, ...children) { type, props: { ...props, - children: - flat.length === 0 ? undefined - : flat.length === 1 ? flat[0] - : flat, + children: flat.length === 0 ? undefined : flat.length === 1 ? flat[0] : flat, }, }; } @@ -82,18 +80,16 @@ function truncateToWidth(str, maxWidth) { for (; i < chars.length; i++) { const cp = chars[i].codePointAt(0); const cw = - ( - (cp >= 0x1100 && cp <= 0x115f) || - (cp >= 0x2e80 && cp <= 0x9fff) || - (cp >= 0xac00 && cp <= 0xd7af) || - (cp >= 0xf900 && cp <= 0xfaff) || - (cp >= 0xfe10 && cp <= 0xfe6f) || - (cp >= 0xff01 && cp <= 0xff60) || - (cp >= 0xffe0 && cp <= 0xffe6) || - (cp >= 0x20000 && cp <= 0x2fa1f) - ) ? - 2 - : 1; + (cp >= 0x1100 && cp <= 0x115f) || + (cp >= 0x2e80 && cp <= 0x9fff) || + (cp >= 0xac00 && cp <= 0xd7af) || + (cp >= 0xf900 && cp <= 0xfaff) || + (cp >= 0xfe10 && cp <= 0xfe6f) || + (cp >= 0xff01 && cp <= 0xff60) || + (cp >= 0xffe0 && cp <= 0xffe6) || + (cp >= 0x20000 && cp <= 0x2fa1f) + ? 2 + : 1; if (w + cw > maxWidth) break; w += cw; } @@ -460,9 +456,8 @@ class HeadEndRewriter { const d = esc(this.ogData.description); const i = this.imageUrl ? esc(this.imageUrl) : null; - const imageTags = - i ? - `\n + const imageTags = i + ? `\n ` : `\n `; @@ -661,9 +656,8 @@ export default { return env.ASSETS.fetch(request); } - const imageUrl = - ogData.generateImage ? - `${url.origin}/og-image?` + + const imageUrl = ogData.generateImage + ? `${url.origin}/og-image?` + new URLSearchParams({ did: ogData.did, collection: ogData.collection, rkey: ogData.rkey }) : null; diff --git a/vite.config.ts b/vite.config.ts index 4c2d26e..762fc3e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,9 @@ -import tailwindcss from "@tailwindcss/vite"; import { execSync } from "child_process"; + +import tailwindcss from "@tailwindcss/vite"; import { defineConfig } from "vite"; import solidPlugin from "vite-plugin-solid"; + import metadata from "./public/oauth-client-metadata.json"; const SERVER_HOST = "127.0.0.1";