diff --git a/docs/CLOUD_SETTINGS_SYNC_OPTIONS.md b/docs/CLOUD_SETTINGS_SYNC_OPTIONS.md index 4042a337..d82758b8 100644 --- a/docs/CLOUD_SETTINGS_SYNC_OPTIONS.md +++ b/docs/CLOUD_SETTINGS_SYNC_OPTIONS.md @@ -9,7 +9,7 @@ Exhaustive reference for every value that **is** or **would be** included in a B - Auto-sync (debounce, poll, triggers): `src/background/cloudSettingsAutoSync.ts` - Core defaults: `src/seqta/utils/defaultSettings.ts` - Full-schema initializer: `src/seqta/utils/ensureSyncableStorageDefaults.ts` -- In-memory settings + persistence: `src/seqta/utils/listeners/SettingsState.ts` +- In-memory settings + persistence: `src/seqta/utils/listeners/settingsState.ts` - Type definitions: `src/types/storage.ts` --- @@ -488,13 +488,13 @@ Keys (from `SettingsState`): #### `shortcuts` -| | | -| -------------- | ------------------------------------------------------------------------------------- | -| **Type** | `array` | -| **Default** | Outlook, Office, Google — each `enabled: true` | -| **UI** | Settings → Shortcuts | -| **Item shape** | `{ "name": string, "enabled": boolean }` | -| **Notes** | `name` matches keys in `src/seqta/content/links.json` (e.g. `"Outlook"`, `"YouTube"`) | +| | | +| -------------- | ------------------------------------------------------------------------------------ | +| **Type** | `array` | +| **Default** | Outlook, Office, Google — each `enabled: true` | +| **UI** | Settings → Shortcuts | +| **Item shape** | `{ "name": string, "enabled": boolean }` | +| **Notes** | `name` matches keys in `src/seqta/content/links.json` (e.g. `"Outlook"`, `"Google"`) | **Example:** @@ -1195,7 +1195,7 @@ Implementation: `ensureSyncableStorageDefaults()` + `getSyncableStorageDefaults( ### Settings persistence and live UI -`SettingsState` (`src/seqta/utils/listeners/SettingsState.ts`): +`SettingsState` (`src/seqta/utils/listeners/settingsState.ts`): - Assignments (`settingsState.foo = …`) and `setKey()` persist to `chrome.storage.local` and **notify registered listeners** in the same context (required for embedded SEQTA settings). - `saveToStorage()` omits `undefined` values so optional keys are not accidentally stripped. diff --git a/lib/inlineWorker.ts b/lib/inlineWorker.ts index e38b3b83..c6122b7a 100644 --- a/lib/inlineWorker.ts +++ b/lib/inlineWorker.ts @@ -3,7 +3,7 @@ import { build } from "esbuild"; import { resolve } from "node:path"; /** Bundle worker entry points imported with `?inlineWorker` as Blob-backed Workers in dev. */ -export default function InlineWorkerDevPlugin(): Plugin { +export default function inlineWorkerDevPlugin(): Plugin { return { name: "vite:inline-worker-dev", async load(id) { diff --git a/package-lock.json b/package-lock.json index eac056e7..a2808757 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3101,9 +3101,9 @@ } }, "node_modules/@oxlint/binding-android-arm-eabi": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.90.0.tgz", - "integrity": "sha512-sgfalb1HuxYjiAa4wESZ626z1FGusqNcXYHyB5oIOEprS2sbPg0UYEfo83uF1GNG70DIfZxHkXuE6KFrlSdn8Q==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.91.0.tgz", + "integrity": "sha512-eOqJUUS1MCqIoUUxMIkuwaqIdKaHr1SXYA0CQI95UUrF8jwQylQH33bBmnqhZfvWXKlRB2Ylx/+Sbk/ctEqzZQ==", "cpu": [ "arm" ], @@ -3118,9 +3118,9 @@ } }, "node_modules/@oxlint/binding-android-arm64": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.90.0.tgz", - "integrity": "sha512-RcKhz1ETMq+fazE9TKS2+5NIRGwigm/nW8egqF0LI+A8Yw2iW5r0E/C3XAPRiwIm/vcPiutIRIa6IQCIKhZsTQ==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.91.0.tgz", + "integrity": "sha512-vIJU4lRxK0EhbBt+iR3rkq3pio4I+V5Gshwjei3plNjN+CIq0WxWHzYVI06J9KN8Ar3hyNSFtzJAjVRLZOYpjg==", "cpu": [ "arm64" ], @@ -3135,9 +3135,9 @@ } }, "node_modules/@oxlint/binding-darwin-arm64": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.90.0.tgz", - "integrity": "sha512-PSrxMvP6mx+p1karZcUxLdy9lpaP+JWQPti4al9FgTaPhxE+pT/BjhGExloVVSWgZgIfOlLOjVyyq8BXlodhLQ==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.91.0.tgz", + "integrity": "sha512-tLy76MurwAOpQt5QVMkJUgexBSWhB7qdvAYb14bc0xntZS6f55aKicbZoxZ/QlmAbnrdlXeD5+IjwY8EZ9RWTg==", "cpu": [ "arm64" ], @@ -3152,9 +3152,9 @@ } }, "node_modules/@oxlint/binding-darwin-x64": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.90.0.tgz", - "integrity": "sha512-OLbU9qsrV2Q8QxT2OEzOPdO8zCCpyI8qB+hDI8yr6RsYELtkf0FAZhJdfjM/RnLHKzt44HWwAPnk92vBtKofvw==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.91.0.tgz", + "integrity": "sha512-zPeMmjAqm5vXxbTp/JqYuc9gGSbUuEaeCAkFHB4TCRLTlfJGD//Fkx03YvZHCHZJ7ideLiiLcae+3f2I27qnaA==", "cpu": [ "x64" ], @@ -3169,9 +3169,9 @@ } }, "node_modules/@oxlint/binding-freebsd-x64": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.90.0.tgz", - "integrity": "sha512-fBA4pWyVDARmNucQqpyFuPC49xYf1r+sX7dxPL5fNPQrSMLum39Sn56tZ9JPleWC7FzLPwSQ7plYYfirYBHF8A==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.91.0.tgz", + "integrity": "sha512-psOR9+xGMXn0hj4KY5M2kjSQ1n0TCMdYbPOraoV0iQyl7mw2oBBYGUM2+ma40m1YLVrktTBOta4FjrmcOHDhrg==", "cpu": [ "x64" ], @@ -3186,9 +3186,9 @@ } }, "node_modules/@oxlint/binding-linux-arm-gnueabihf": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.90.0.tgz", - "integrity": "sha512-zhxH78eP2nR6/pGdhBc7MIfjhhcgATeu8fkmkFJbuzfk6Cj0FzBxyEhL85yDqrCybjx+G2YDzZGsxIO9kvO4Iw==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.91.0.tgz", + "integrity": "sha512-1PNA1j4ETxawvxfz6ueDxWgQgWkXPbv44DWZmC7LR07GqojGFDOwWbosOT6/AYiJr7zMXEhn2dPWMkyFFOFpUQ==", "cpu": [ "arm" ], @@ -3203,9 +3203,9 @@ } }, "node_modules/@oxlint/binding-linux-arm-musleabihf": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.90.0.tgz", - "integrity": "sha512-MvYmpHyJqUJjEvkZbJHdwfdL45cGn8EVBkYmoXFiaYFW9suoD3dbJl5mBdpy0DVgdjlyddmldbRtk3cCgETadQ==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.91.0.tgz", + "integrity": "sha512-jcNePVpca37lTbHmiPMnVbPAAW0rH9kAoDjsDv6vESEX9pzazIR1q5SyYuc1rQzdjHtc2VVCDN9jDh6tHcOHyA==", "cpu": [ "arm" ], @@ -3220,9 +3220,9 @@ } }, "node_modules/@oxlint/binding-linux-arm64-gnu": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.90.0.tgz", - "integrity": "sha512-L13Sy+Kg0nZhwTsToniqjUFPA2TuM6962qCZ5Wp5KeB517Tw7ApdLTTtlb+bF86fcZZa2EtvCVvAJxk4Dya/MQ==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.91.0.tgz", + "integrity": "sha512-TJi78UX6R+9qZ23ZKtzN6adfW83bjY0NXsCRMBRH6H7IizaMXmZbdRAtjedMkx77bT46YQH0csawsY9lwha8MA==", "cpu": [ "arm64" ], @@ -3240,9 +3240,9 @@ } }, "node_modules/@oxlint/binding-linux-arm64-musl": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.90.0.tgz", - "integrity": "sha512-wFDdZWGpzIPFdJFjSLWnKB0TGzFriTKUIrl04iMqMyM9BBIJTuerfCHYa0WpDSjr5x3lcW/CHLyacSt886WpGg==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.91.0.tgz", + "integrity": "sha512-OowlLroUTzKq5OBvbu6iegch8SJ2DivXFCukzPWURwvcJhMj7/P0CUGH5qrDlxT1Kh48dcxqYqrvE8qK6xTLKQ==", "cpu": [ "arm64" ], @@ -3260,9 +3260,9 @@ } }, "node_modules/@oxlint/binding-linux-ppc64-gnu": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.90.0.tgz", - "integrity": "sha512-FRywfn+MoKn8xpBSzgNwNVliSKRI2QXkxi/iF7o6FEQs8Bh8z2RpVTaFAcO3pchXjvB2eGNFIoLLQABIQ+u7VA==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.91.0.tgz", + "integrity": "sha512-QF/5Ge8yGpWg5s4awMNHfVKh1WOmk591Qg082i6CHenXYBa+W1E5RwWZXaKUOw4Ko7CCjqg3TfBc0AzhnqblYg==", "cpu": [ "ppc64" ], @@ -3280,9 +3280,9 @@ } }, "node_modules/@oxlint/binding-linux-riscv64-gnu": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.90.0.tgz", - "integrity": "sha512-IS2PaUgpc/qeLADTyhUNmdx3x4ijs9pjJdPKBYHaT+mAE7k3FsjnHPTjhpsak1b++h6CIPhv6WX9Z+y7Pw0voQ==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.91.0.tgz", + "integrity": "sha512-dXlsKlNhzJQX1nageGKnvWe1D7uTng249hQM80CG/YPZ8F/VZHbxVLhImgurdWBOmu86XOemValLjrW6QIOM/Q==", "cpu": [ "riscv64" ], @@ -3300,9 +3300,9 @@ } }, "node_modules/@oxlint/binding-linux-riscv64-musl": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.90.0.tgz", - "integrity": "sha512-s7JFKRkGS8O7i2ZVODfuO++NC7sH6HDqpMn8lYxw91w0SXJOxnAVjQ8utvmDwLMMT0jaSkuOKuUYJDGDtu4sHQ==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.91.0.tgz", + "integrity": "sha512-tznkj5VrWNRUfymkaLcJetgMLbP9suL5ob/m7j0Fdbnm5u3Li/Ezo/YcBixiuwdL1sg0oGpyTe86It0J6T+Lxg==", "cpu": [ "riscv64" ], @@ -3320,9 +3320,9 @@ } }, "node_modules/@oxlint/binding-linux-s390x-gnu": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.90.0.tgz", - "integrity": "sha512-b0GxrOQr5VONCkd7KLSqmP6b6nqZuTpuS8QPQHzltmqdXP5bY0Jl0CZ0QmlCTrS3ExaLYbioFYOARzNbYvcApQ==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.91.0.tgz", + "integrity": "sha512-sNvfLiUYQkVsLNUgIW24AEYTHSd2zZ1vAxXssPdjuQHTtCpRvQihYri6d5z5FY7w/QrcnB5+g9E+/sqmZq8tfA==", "cpu": [ "s390x" ], @@ -3340,9 +3340,9 @@ } }, "node_modules/@oxlint/binding-linux-x64-gnu": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.90.0.tgz", - "integrity": "sha512-iaJeShJtgUp8rZbt9YUdTAGOpmX5KogCLba17Jp1tWdJ3F4M3D2g2TKUyI1FMTHxKH9NNHuQcuC2kZRg6IV7yQ==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.91.0.tgz", + "integrity": "sha512-eA25ETvimhUZ89y5BcunNY7yv7qwG2I7V7dFQAU+mIEqZ57gBCXdIERl0yXOEt43zjsw0yK2gRKTc+twF706wQ==", "cpu": [ "x64" ], @@ -3360,9 +3360,9 @@ } }, "node_modules/@oxlint/binding-linux-x64-musl": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.90.0.tgz", - "integrity": "sha512-/aZoXnL5WBLCXuzfHqvEFXcm4iwYmr/cYByHDTXzLFzJdE5DC7bm6phpWqHv6BeqpVgY9IpBAxGDv2WEkl5JCg==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.91.0.tgz", + "integrity": "sha512-4hZ4Z9K+OkcTpAHDoUTMg/8MModbM0aocrl9KnGzp9h5iKqjrXraEUZorYoVCT7xoK93CAHXgTndxRBrOjH/fA==", "cpu": [ "x64" ], @@ -3380,9 +3380,9 @@ } }, "node_modules/@oxlint/binding-openharmony-arm64": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.90.0.tgz", - "integrity": "sha512-SMhk7ozwoxYDKfYqGZCQEfULOKDneF9uhaoIf2neoDLWvNtjY9yVeL7YHmE5L9WdKvMpWNwwZxhenxBu6AgfOg==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.91.0.tgz", + "integrity": "sha512-gtqn4b0kLpGe46Qh7NHiR86wZpd+TLaesO106s7V3RG33r63VB94LW5qPKEDJX64osh3xfjnPFn1M0484bC7wQ==", "cpu": [ "arm64" ], @@ -3397,9 +3397,9 @@ } }, "node_modules/@oxlint/binding-win32-arm64-msvc": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.90.0.tgz", - "integrity": "sha512-KBvR3A9fO7fCi2vCP8ifWvlia7tGEQV9NaYh+IGwa/7Groy48Mt/UaYqMK9/zOtAWl20BUCf6RPqzJ32fRw33Q==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.91.0.tgz", + "integrity": "sha512-KQItBdsyHN28U3z/bEek6h9pvG3Uqv564QYO8K1bE/V7YRZgpHlRnfNKVPHkk4sfYKyPzEjCgW80QkImOLvJog==", "cpu": [ "arm64" ], @@ -3414,9 +3414,9 @@ } }, "node_modules/@oxlint/binding-win32-ia32-msvc": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.90.0.tgz", - "integrity": "sha512-+x42rDHQGbTCuT3EzpWAzhP3NoVPE/cJsG4gnrakOSg0olV+GCdMpPU23Nvrl3zZMnXxFZdTtDv4D3SuaA5ZeQ==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.91.0.tgz", + "integrity": "sha512-XFKqbbsQVmTgw+CyBKuzSZtAa45viom1naFfulKmkTFdDyDaBQaBqEz5J61TI8iwBynU+F8q7qPD+9mplZRhEg==", "cpu": [ "ia32" ], @@ -3431,9 +3431,9 @@ } }, "node_modules/@oxlint/binding-win32-x64-msvc": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.90.0.tgz", - "integrity": "sha512-30JiaFEBUB9peEOcvVM8ggo88SoN/IdSr9DW505JdBji/R6dM66gKEiG65hw6qcaF2f4mO0cEJ+RwRZprmun9g==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.91.0.tgz", + "integrity": "sha512-DmpK0PthG66Bcz5Y4JqNbzXltzyLQtg3ofYpd25+ejm7kQYUM78VL1uIP/ZFct2781mwUyBX37LatFPCTVp35A==", "cpu": [ "x64" ], @@ -5939,9 +5939,9 @@ } }, "node_modules/d3-array": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", - "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.5.tgz", + "integrity": "sha512-Th8qGXoBalmWsstpkuhmBuTsBQIFqYOJtjlBvNVvBfJ8E3uYusBUwUR8HU20U0qKKQkgCvKyR1YjiozWadk5QA==", "license": "ISC", "dependencies": { "internmap": "1 - 2" @@ -5951,9 +5951,9 @@ } }, "node_modules/d3-chord": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", - "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.2.tgz", + "integrity": "sha512-cGmADo5M2PTi3ewJZ2lcE32eURd4JmHtQ5JwRIUcas5L1SXqufG9yPyjWp8fW0gRi7aZi9bgbZPFZO1eyZ+1CQ==", "license": "ISC", "dependencies": { "d3-path": "1 - 3" @@ -5963,30 +5963,30 @@ } }, "node_modules/d3-color": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", - "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.1.tgz", + "integrity": "sha512-lfab8x0Bj0UO7SNsY8dZSbNIA6ipbkE3X0NG9nqjCu6CfCHZseuDnOSJY7hidKrjpP++i1M2qT+FlAdPKYRilA==", "license": "ISC", "engines": { "node": ">=12" } }, "node_modules/d3-contour": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz", - "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.3.tgz", + "integrity": "sha512-5DYURc8KwXPOhSUBblU0P9rVcArsSPxPOxsfO0Eud0s28oU0sB2e80aRHRL9AZW3usT8ikFKyIHpHHLNWLdRVA==", "license": "ISC", "dependencies": { - "d3-array": "^3.2.0" + "d3-array": "^3.2.4" }, "engines": { "node": ">=12" } }, "node_modules/d3-delaunay": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz", - "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==", + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.6.tgz", + "integrity": "sha512-DMQIEvSJhZCB6pwedcXaAlQ+MeKU5LlM2XakKtc73b/VM+RBiI1SRXycOEOKg2jsKj4zZ9F0KGYG6nCGwwWu/g==", "license": "ISC", "dependencies": { "delaunator": "5" @@ -5996,18 +5996,18 @@ } }, "node_modules/d3-dispatch": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", - "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.2.tgz", + "integrity": "sha512-sAzH4Y4nsLo8eSqw5jKiZt+LU2wZmL/qS+OkxQGjhwazB/D7TY34R/QK1eshfGr7cZEKymKZ/Haem7m+lu98Sg==", "license": "ISC", "engines": { "node": ">=12" } }, "node_modules/d3-dsv": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", - "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.2.tgz", + "integrity": "sha512-FUnXhX7I4/AXyRCZzwfZTDGSq8PGZ4oR0tiCBqNGOZMsDrQ+6sIWNQnBzcCGhzJKZ6uCvCezTwflUqI209RRiQ==", "license": "ISC", "dependencies": { "commander": "7", @@ -6030,9 +6030,9 @@ } }, "node_modules/d3-force": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", - "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.1.tgz", + "integrity": "sha512-kAaaHLFebBYwgi5cYBXAI8vKrQFMCD2MEswj2QuPKKbdU1wYLc8WXtS7O8F/b6POCIe3gJjY6hkDstHi1yMETQ==", "license": "ISC", "dependencies": { "d3-dispatch": "1 - 3", @@ -6044,18 +6044,18 @@ } }, "node_modules/d3-format": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", - "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.3.tgz", + "integrity": "sha512-+F+/49swqmGuQJmSKnVMIDH/QkEFV5li9QRj0xm/KhyAUBv099O5PrvpQFxBp24PYph17Mnvt9mjKQV0ii0nMA==", "license": "ISC", "engines": { "node": ">=12" } }, "node_modules/d3-geo": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz", - "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.2.tgz", + "integrity": "sha512-5R8ZgDQorIxmauv7R6gpE/ndz+Z0qAZssigq0aXFdvPHdY41RqtW02jrRUQAL724NdPABYXo1+gQEGBBr7uKNg==", "license": "ISC", "dependencies": { "d3-array": "2.5.0 - 3" @@ -6115,18 +6115,18 @@ } }, "node_modules/d3-hierarchy": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", - "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.3.tgz", + "integrity": "sha512-GRajN5ZcnEwYFWqqdzhG1qJ3+fDg6WWzk47TJg7ePY7yvYAgRfD2r1mUx+wviBOWuCwamCUzjwMSdato43jbGA==", "license": "ISC", "engines": { "node": ">=12" } }, "node_modules/d3-interpolate": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", - "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.2.tgz", + "integrity": "sha512-IRzGU62DtxhvsnSTWMQIdnoZ6gA+BCWwBon1EJI6SjoN595799b6z/QRBzXfFhE8iupUPp3042yBNo0STPqnzQ==", "license": "ISC", "dependencies": { "d3-color": "1 - 3" @@ -6142,36 +6142,36 @@ "license": "BSD-3-Clause" }, "node_modules/d3-path": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", - "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-jsbgV8zIT38ReB9O7X7gcLndTQRONSqNNd+oGIaTBdUug4r5jFmp0N6RY9R5GWbdUDucn0qoTGyfjapT4tDhcg==", "license": "ISC", "engines": { "node": ">=12" } }, "node_modules/d3-polygon": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", - "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.2.tgz", + "integrity": "sha512-WAUvPudGU1Dn4mDPfb6+JnnbeVEV53hG/BoT+bxts6AkZsOpTEiV1jHYX+2vtwCICNFG9Wxv8QS+eW1zE/Dwfg==", "license": "ISC", "engines": { "node": ">=12" } }, "node_modules/d3-quadtree": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", - "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.2.tgz", + "integrity": "sha512-9Lu9mqJKRbIk0d6mKDjpvPURaPdwHVK5CYbcdd0/4vBgz4ldz/7TIOse3kNERsByGNfld58KEco507AztJWyTQ==", "license": "ISC", "engines": { "node": ">=12" } }, "node_modules/d3-random": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", - "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.2.tgz", + "integrity": "sha512-PxJi9LNV+7mulaYO77nd+oGurXGL1fhedXjHnB3pWLUcqDnQtF4VASoqnQGHgoXLByVdv5QJ/2kfwkGn5HTS8g==", "license": "ISC", "engines": { "node": ">=12" @@ -6218,9 +6218,9 @@ "license": "ISC" }, "node_modules/d3-scale": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", - "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.3.tgz", + "integrity": "sha512-66cWobCNzcMvlfoaDHCxuIv9TBUWG1BLOWdv9kHHFuCr1JdqAWPvTmsaEYDD5NRMyWZ5+7u0GqiCDfMXMqh3hg==", "license": "ISC", "dependencies": { "d3-array": "2.10.0 - 3", @@ -6234,25 +6234,26 @@ } }, "node_modules/d3-scale-chromatic": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", - "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.1.tgz", + "integrity": "sha512-lA5gfN2yMvmChubmptnDiBfeGpHD7Yb1EbvCz0TZE0WHXhyR6W2allPuhKtzV5ILQRqeOdefF0qYtERReLUBDg==", "license": "ISC", "dependencies": { "d3-color": "1 - 3", - "d3-interpolate": "1 - 3" + "d3-interpolate": "1 - 3", + "d3-scale": "1 - 4" }, "engines": { "node": ">=12" } }, "node_modules/d3-shape": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", - "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.1.tgz", + "integrity": "sha512-dm2o+lbKdzg9tY7GEag/dB9hcbodLfwkE/DkvqbELJXaMz0yKzWWhZqhbI7CKubukA7HnRyz0avdtvi7EPxPvw==", "license": "ISC", "dependencies": { - "d3-path": "^3.1.0" + "d3-path": "^3.1.1" }, "engines": { "node": ">=12" @@ -6265,9 +6266,9 @@ "license": "BSD-3-Clause" }, "node_modules/d3-time": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", - "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.1.tgz", + "integrity": "sha512-Ze7rjrhMzdeulh0/hjcfFj7XLAHOfowtEMfsoG6DU866HPynQNW7Wfen6hzXcqKTv8XzxvF6Hzr5XD6bMHr2ug==", "license": "ISC", "dependencies": { "d3-array": "2 - 3" @@ -6277,9 +6278,9 @@ } }, "node_modules/d3-time-format": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", - "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.1.tgz", + "integrity": "sha512-22XaqjyCjpqgda20erhsOjGmC3vvYwTNYniKAd45W5UWLDF43moeOuV9qYpRqobIlsnK0UhnKZjUUJm3VgORUA==", "license": "ISC", "dependencies": { "d3-time": "1 - 3" @@ -6289,9 +6290,9 @@ } }, "node_modules/d3-timer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", - "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-1Il1aliroVSErrv5aulRBxAY+7+DnaoLIWGd1C6SsBTWDeobWiP/V69vwb8vT6abR1kKwaNe1196pmaQ1fK90A==", "license": "ISC", "engines": { "node": ">=12" @@ -6540,9 +6541,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.473", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.473.tgz", - "integrity": "sha512-9njcRQK+6FOXNAWw5g+h2RPiyazqo5RFMVJ39ZMHjDHUNnnFlhnOGV7O0WmJetODDx19ES5p+FLi+KCVFQGugw==", + "version": "1.5.475", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.475.tgz", + "integrity": "sha512-S9tceHJbIsHH8VRwh9x+8lJO50SYwTdwVGdEjdz2FERyP59j1N6rdXOSklIusrhxt9GG/WN4V/kRgmDHl9MM5w==", "dev": true, "license": "ISC" }, @@ -6615,9 +6616,9 @@ "license": "MIT" }, "node_modules/enhanced-resolve": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.26.0.tgz", - "integrity": "sha512-9vhedylFonb2YGogzUKX6+Ja72gOJbN1QHAqdrvqLwhdl/QWbKopzoUC9EbQNVsAns/bx/4uyqalrQAoy1IByw==", + "version": "5.26.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.26.1.tgz", + "integrity": "sha512-PPnnSJq3azKOIewXR/uppBV/6h98dprBJ/WaQ9Qgj10xX1lJLNfg+XShpbsrSqcDSy2yYYyhfXM1wWhftqgyzw==", "dev": true, "license": "MIT", "dependencies": { @@ -8838,9 +8839,9 @@ } }, "node_modules/napi-postinstall": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.7.tgz", - "integrity": "sha512-jyU4cU4kVAmy/3qjP+DcoQTNXfINHc+dFw54gGqWC8nu0mpV0kOnk7kff+J+Q18SbX0k3Np8Rm7yFjd3phatNQ==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.8.tgz", + "integrity": "sha512-dHbDC5V1g/EI8OLEtL4Iuwbu0fgzmyykxenn2KnlsX9XdhTXL3gWnfbbP+ab+oUcgV6CFpb8QGyQt/ZXA0UXig==", "dev": true, "license": "MIT", "bin": { @@ -9085,9 +9086,9 @@ } }, "node_modules/oxlint": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.90.0.tgz", - "integrity": "sha512-RkTN9EmgIUpLuhNoLhO3OliMGJlvb3Dk7XVjBZnfoMCHrVpuz5ESd97klfiyYeV7XfA2lNLnDCPMkUI+Qw5How==", + "version": "1.91.0", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.91.0.tgz", + "integrity": "sha512-vjy/cBZcEFcYh3dbxUoQK+bjc+QaY3ZWo86aJkZ5YAwp/HyiqP7dTdNgbvcIVJafhAH5sZbTqBp4sZcicEZngA==", "dev": true, "license": "MIT", "bin": { @@ -9100,25 +9101,25 @@ "url": "https://github.com/sponsors/oxc-project" }, "optionalDependencies": { - "@oxlint/binding-android-arm-eabi": "1.90.0", - "@oxlint/binding-android-arm64": "1.90.0", - "@oxlint/binding-darwin-arm64": "1.90.0", - "@oxlint/binding-darwin-x64": "1.90.0", - "@oxlint/binding-freebsd-x64": "1.90.0", - "@oxlint/binding-linux-arm-gnueabihf": "1.90.0", - "@oxlint/binding-linux-arm-musleabihf": "1.90.0", - "@oxlint/binding-linux-arm64-gnu": "1.90.0", - "@oxlint/binding-linux-arm64-musl": "1.90.0", - "@oxlint/binding-linux-ppc64-gnu": "1.90.0", - "@oxlint/binding-linux-riscv64-gnu": "1.90.0", - "@oxlint/binding-linux-riscv64-musl": "1.90.0", - "@oxlint/binding-linux-s390x-gnu": "1.90.0", - "@oxlint/binding-linux-x64-gnu": "1.90.0", - "@oxlint/binding-linux-x64-musl": "1.90.0", - "@oxlint/binding-openharmony-arm64": "1.90.0", - "@oxlint/binding-win32-arm64-msvc": "1.90.0", - "@oxlint/binding-win32-ia32-msvc": "1.90.0", - "@oxlint/binding-win32-x64-msvc": "1.90.0" + "@oxlint/binding-android-arm-eabi": "1.91.0", + "@oxlint/binding-android-arm64": "1.91.0", + "@oxlint/binding-darwin-arm64": "1.91.0", + "@oxlint/binding-darwin-x64": "1.91.0", + "@oxlint/binding-freebsd-x64": "1.91.0", + "@oxlint/binding-linux-arm-gnueabihf": "1.91.0", + "@oxlint/binding-linux-arm-musleabihf": "1.91.0", + "@oxlint/binding-linux-arm64-gnu": "1.91.0", + "@oxlint/binding-linux-arm64-musl": "1.91.0", + "@oxlint/binding-linux-ppc64-gnu": "1.91.0", + "@oxlint/binding-linux-riscv64-gnu": "1.91.0", + "@oxlint/binding-linux-riscv64-musl": "1.91.0", + "@oxlint/binding-linux-s390x-gnu": "1.91.0", + "@oxlint/binding-linux-x64-gnu": "1.91.0", + "@oxlint/binding-linux-x64-musl": "1.91.0", + "@oxlint/binding-openharmony-arm64": "1.91.0", + "@oxlint/binding-win32-arm64-msvc": "1.91.0", + "@oxlint/binding-win32-ia32-msvc": "1.91.0", + "@oxlint/binding-win32-x64-msvc": "1.91.0" }, "peerDependencies": { "oxlint-tsgolint": ">=7.0.2005", diff --git a/src/background.ts b/src/background.ts index bfcf8e38..d57568c9 100644 --- a/src/background.ts +++ b/src/background.ts @@ -111,7 +111,10 @@ function handleFetchThemes(_request: unknown, sendResponse: MessageSender): bool }) .then(sendResponse) .catch((err) => { - console.warn("[Background] fetchThemes API failed, trying GitHub fallback:", err?.message); + console.warn( + "[BetterSEQTA+] Background: fetchThemes API failed, trying GitHub fallback:", + err?.message, + ); fetch(githubUrl, { cache: "no-store" }) .then(async (r) => { if (!r.ok) throw new Error(`GitHub fallback HTTP ${r.status}`); @@ -121,7 +124,10 @@ function handleFetchThemes(_request: unknown, sendResponse: MessageSender): bool }) .then(sendResponse) .catch((fallbackErr) => { - console.error("[Background] fetchThemes GitHub fallback error:", fallbackErr); + console.error( + "[BetterSEQTA+] Background: fetchThemes GitHub fallback error:", + fallbackErr, + ); sendResponse({ success: false, error: fallbackErr?.message }); }); }); @@ -143,7 +149,7 @@ function handleFetchThemeDetails(request: BackgroundRequest, sendResponse: Messa .then((r) => r.json()) .then(sendResponse) .catch((err) => { - console.error("[Background] fetchThemeDetails error:", err); + console.error("[BetterSEQTA+] Background: fetchThemeDetails error:", err); sendResponse({ success: false, error: err?.message }); }); })(); @@ -216,7 +222,7 @@ function handleFetchFromUrl( sendResponse({ error: "Invalid JSON response" }); } } catch (err) { - console.error("[Background] fetchFromUrl error:", err); + console.error("[BetterSEQTA+] Background: fetchFromUrl error:", err); sendResponse({ error: (err as Error)?.message }); } })(); @@ -253,7 +259,7 @@ function handleCloudReserveClient( else sendResponse(data); }) .catch((err) => { - console.error("[Background] cloudReserveClient error:", err); + console.error("[BetterSEQTA+] Background: cloudReserveClient error:", err); sendResponse({ error: err?.message ?? "Network error" }); }); return true; @@ -299,7 +305,7 @@ function handleCloudLogin( if (!r.ok) sendResponse({ error: errorText ?? "Login failed" }); else sendResponse(data); } catch (err) { - console.error("[Background] cloudLogin error:", err); + console.error("[BetterSEQTA+] Background: cloudLogin error:", err); sendResponse({ error: (err as Error)?.message ?? "Network error" }); } })(); @@ -320,7 +326,7 @@ function handleCloudStartLogin(request: BackgroundRequest, sendResponse: Message sendResponse({ success: true }); }) .catch((err) => { - console.error("[Background] cloudStartLogin error:", err); + console.error("[BetterSEQTA+] Background: cloudStartLogin error:", err); sendResponse({ error: err?.message ?? "Failed to open login page" }); }); return true; @@ -356,17 +362,20 @@ function initCloudLoginCallbackListener() { } void performCloudSettingsDownloadWithRetry(token).catch((err) => { - console.warn("[Background] Cloud settings download after login:", err); + console.warn( + "[BetterSEQTA+] Background: Cloud settings download after login:", + err, + ); }); } catch (err) { - console.error("[Background] Failed to process login callback:", err); + console.error("[BetterSEQTA+] Background: Failed to process login callback:", err); } })(); void browser.tabs.remove(tabId); } } catch (err) { - console.error("[Background] Error parsing callback URL:", err); + console.error("[BetterSEQTA+] Background: Error parsing callback URL:", err); } } }); @@ -395,7 +404,7 @@ function handleCloudRefresh(request: BackgroundRequest, sendResponse: MessageSen else sendResponse(data); }) .catch((err) => { - console.error("[Background] cloudRefresh error:", err); + console.error("[BetterSEQTA+] Background: cloudRefresh error:", err); sendResponse({ error: err?.message ?? "Network error" }); }); return true; @@ -424,7 +433,7 @@ function handleCloudSettingsUpload( updated_at: res.updated_at, }); } catch (err) { - console.error("[Background] cloudSettingsUpload error:", err); + console.error("[BetterSEQTA+] Background: cloudSettingsUpload error:", err); sendResponse({ success: false, error: err instanceof Error ? err.message : "Upload failed", @@ -458,7 +467,7 @@ function handleCloudSettingsDownload( updated_at: res.updated_at, }); } catch (err) { - console.error("[Background] cloudSettingsDownload error:", err); + console.error("[BetterSEQTA+] Background: cloudSettingsDownload error:", err); sendResponse({ success: false, error: err instanceof Error ? err.message : "Download failed", @@ -488,7 +497,7 @@ function handleCloudFavorite(request: BackgroundRequest, sendResponse: MessageSe .then((r) => r.json()) .then(sendResponse) .catch((err) => { - console.error("[Background] cloudFavorite error:", err); + console.error("[BetterSEQTA+] Background: cloudFavorite error:", err); sendResponse({ success: false, error: err?.message }); }); })(); @@ -607,7 +616,7 @@ const MESSAGE_HANDLERS: Record = { typeof reply?.appLink === "string" && reply.appLink.length > 0 ? reply.appLink : null; sendResponse({ appLink }); } catch (err) { - console.error("[Background] getSeqtaSession error:", err); + console.error("[BetterSEQTA+] Background: getSeqtaSession error:", err); sendResponse({ appLink: null }); } })(); diff --git a/src/background/cloudSettingsAutoSync.ts b/src/background/cloudSettingsAutoSync.ts index 14086a53..64e59440 100644 --- a/src/background/cloudSettingsAutoSync.ts +++ b/src/background/cloudSettingsAutoSync.ts @@ -158,7 +158,7 @@ async function fetchCloudSummaryWithAuthRetry(token: string): Promise { const res = await performCloudSettingsUploadWithRetry(token); if (!res.success) { - console.warn("[BS+ cloud sync] Baseline upload failed:", res.error); + console.warn("[BetterSEQTA+] Cloud sync: Baseline upload failed:", res.error); } } async function downloadIfNeeded(token: string): Promise { const res = await performCloudSettingsDownloadWithRetry(token); if (!res.success && !res.notFound) { - console.warn("[BS+ cloud sync] Auto-download failed:", res.error); + console.warn("[BetterSEQTA+] Cloud sync: Auto-download failed:", res.error); } } @@ -368,7 +368,9 @@ async function runCloudSettingsPollInner(): Promise { typeof bsplus.schemaVersion === "number" && bsplus.schemaVersion > CLOUD_SETTINGS_SYNC_SCHEMA_VERSION ) { - console.warn("[BS+ cloud sync] Server schemaVersion newer than client; skip auto-download"); + console.warn( + "[BetterSEQTA+] Cloud sync: Server schemaVersion newer than client; skip auto-download", + ); return; } @@ -399,7 +401,7 @@ export function runCloudSettingsPoll(): Promise { await runCloudSettingsPollInner(); await browser.storage.local.set({ [POLL_THROTTLE_KEY]: Date.now() }); } catch (e) { - console.error("[BS+ cloud sync] Poll error:", e); + console.error("[BetterSEQTA+] Cloud sync: Poll error:", e); } finally { pollInFlight = null; } @@ -443,7 +445,7 @@ async function runDebouncedUploadJob(): Promise { if (!token) return; const res = await performCloudSettingsUploadWithRetry(token); if (!res.success) { - console.warn("[BS+ cloud sync] Auto-upload failed:", res.error); + console.warn("[BetterSEQTA+] Cloud sync: Auto-upload failed:", res.error); } } diff --git a/src/background/customThemesHandlers.ts b/src/background/customThemesHandlers.ts index c51ef346..8d44a5cf 100644 --- a/src/background/customThemesHandlers.ts +++ b/src/background/customThemesHandlers.ts @@ -45,7 +45,7 @@ export function createCustomThemesHandlers(deps: { } const normalized = normalizeCustomThemeApiResponse(body, r.status, text); if (!r.ok || normalized.success === false) { - console.error("[BetterSEQTA+ CustomThemes]", r.status, r.url, normalized); + console.error("[BetterSEQTA+] CustomThemes:", r.status, r.url, normalized); } return normalized; } @@ -112,7 +112,7 @@ export function createCustomThemesHandlers(deps: { : `/api/custom-themes?${params}`; sendResponse(await customThemesJsonFetch(path)); } catch (err) { - console.error("[Background] fetchCustomThemes error:", err); + console.error("[BetterSEQTA+] Background: fetchCustomThemes error:", err); sendResponse({ success: false, error: err instanceof Error ? err.message : "Fetch failed", @@ -135,7 +135,7 @@ export function createCustomThemesHandlers(deps: { if (request.status) params.set("status", String(request.status)); sendResponse(await customThemesJsonFetch(`/api/custom-themes/mine?${params}`, {}, true)); } catch (err) { - console.error("[Background] fetchMyCustomThemes error:", err); + console.error("[BetterSEQTA+] Background: fetchMyCustomThemes error:", err); sendResponse({ success: false, error: err instanceof Error ? err.message : "Fetch failed", @@ -164,7 +164,7 @@ export function createCustomThemesHandlers(deps: { ), ); } catch (err) { - console.error("[Background] fetchMyCustomThemeDetail error:", err); + console.error("[BetterSEQTA+] Background: fetchMyCustomThemeDetail error:", err); sendResponse({ success: false, error: err instanceof Error ? err.message : "Fetch failed", @@ -187,7 +187,7 @@ export function createCustomThemesHandlers(deps: { try { sendResponse(await customThemesMultipartPost("/api/custom-themes/mine", payload!)); } catch (err) { - console.error("[Background] submitCustomTheme error:", err); + console.error("[BetterSEQTA+] Background: submitCustomTheme error:", err); sendResponse({ success: false, error: { message: err instanceof Error ? err.message : "Upload failed" }, @@ -222,7 +222,7 @@ export function createCustomThemesHandlers(deps: { ), ); } catch (err) { - console.error("[Background] replaceCustomThemeFiles error:", err); + console.error("[BetterSEQTA+] Background: replaceCustomThemeFiles error:", err); sendResponse({ success: false, error: err instanceof Error ? err.message : "Upload failed", @@ -255,7 +255,7 @@ export function createCustomThemesHandlers(deps: { ), ); } catch (err) { - console.error("[Background] updateCustomThemeMetadata error:", err); + console.error("[BetterSEQTA+] Background: updateCustomThemeMetadata error:", err); sendResponse({ success: false, error: err instanceof Error ? err.message : "Update failed", @@ -284,7 +284,7 @@ export function createCustomThemesHandlers(deps: { ), ); } catch (err) { - console.error("[Background] deleteCustomTheme error:", err); + console.error("[BetterSEQTA+] Background: deleteCustomTheme error:", err); sendResponse({ success: false, error: err instanceof Error ? err.message : "Delete failed", diff --git a/src/background/storageMigrations.ts b/src/background/storageMigrations.ts index 4691255b..02684339 100644 --- a/src/background/storageMigrations.ts +++ b/src/background/storageMigrations.ts @@ -7,27 +7,8 @@ function crossedUpgrade(previousVersion: string, boundary: string): boolean { return prev != null && curr != null && !semver.lt(curr, boundary) && semver.lt(prev, boundary); } -/** One-time storage patches when crossing 3.6.5 / 3.6.6 / 3.7.0 / 3.7.7 (see git history on main). */ +/** One-time storage patches when crossing 3.6.6 / 3.7.0 / 3.7.7 (see git history on main). */ export async function runStorageMigrations(previousVersion: string): Promise { - if (crossedUpgrade(previousVersion, "3.6.5")) { - try { - const key = "plugin.global-search.settings"; - const got = await browser.storage.local.get(key); - const existing = (got[key] ?? {}) as Record; - await browser.storage.local.set({ - [key]: { - ...existing, - enabled: true, - transparencyEffects: true, - runIndexingOnLoad: true, - passiveIndexing: true, - }, - }); - } catch (e) { - console.warn("[BetterSEQTA+] Global Search 3.6.5 settings migration failed:", e); - } - } - if (crossedUpgrade(previousVersion, "3.6.6")) { try { await browser.storage.local.set({ themeOfTheMonthDisabled: false }); diff --git a/src/css/documentload.scss b/src/css/documentload.scss index 3c83367f..19974d1e 100644 --- a/src/css/documentload.scss +++ b/src/css/documentload.scss @@ -38,16 +38,13 @@ @layer override { .legacy-root, - .legacy-root *:not(.iconFamily) { + .legacy-root * { font-family: var(--betterseqta-font-family, Rubik), sans-serif !important; } +} - .iconFamily, - .iconFamily *, - [class~="iconFamily"], - [class~="iconFamily"] * { - font-family: "IconFamily" !important; - } +:root { + --bsplus-focus-ring: 2px solid var(--text-primary, currentColor); } html { @@ -56,126 +53,78 @@ html { font-family: Roboto, system-ui, -apple-system, sans-serif !important; } -.tooltip svg { - fill: var(--theme-primary); -} -.tooltip { - display: inline-block; - z-index: 5 !important; - width: 28px; - background: none; - box-shadow: none; - padding: 2px; - position: absolute; -} -.tooltip .tooltiptext { - width: 120px; - transform: scale(0); - transition: transform 0.2s; - transform-origin: top; - background: var(--background-primary); - color: var(--text-primary); +.bsplus-tooltip-bubble { + position: fixed; + inset: auto; + margin: 0; + min-width: 50px; + max-width: 220px; + padding: 4px; + border: 0; + border-radius: 8px; + overflow: visible; + background: var(--text-primary); + color: var(--background-primary); text-align: center; - border-radius: 6px; - padding: 2px; - position: absolute; - z-index: 1; - top: 105%; - left: 50%; - margin-left: -62px; -} -.tooltip .tooltiptext::after { - content: ""; - position: absolute; - bottom: 100%; - left: 50%; - margin-left: -5px; - border-width: 5px; - border-style: solid; - border-color: transparent transparent var(--text-primary) transparent; -} -.tooltiptext p:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.3) !important; - transition: 200ms; -} -.tooltiptext p { - border-radius: 8px !important; - padding-top: 2px; - padding-bottom: 2px; - margin: 2px; -} -.tooltip:hover .tooltiptext { - transform: scale(1); - transform-origin: top; - transition: transform 0.2s; -} -body:has(.outside-container:not(.hide)) #AddedSettings.tooltip:hover > .tooltiptext { transform: scale(0); + transform-origin: top center; + transition: + transform 0.15s, + overlay 0.15s allow-discrete, + display 0.15s allow-discrete; + + &:popover-open { + transform: scale(1); + } + + &::before { + content: ""; + position: absolute; + bottom: 100%; + left: 0; + width: 100%; + height: 8px; + } + + &::after { + content: ""; + position: absolute; + bottom: calc(100% - 1px); + left: 50%; + margin-left: -5px; + border: 5px solid transparent; + border-bottom-color: var(--text-primary); + } + + a, + button { + display: block; + width: 100%; + border-radius: 6px; + padding: 2px 8px; + color: inherit; + text-decoration: none; + transition: background 200ms; + + &:hover { + background: color-mix(in srgb, var(--background-primary) 20%, transparent); + } + } } -.assessmenttooltip svg { - fill: var(--text-primary); +.bsplus-tooltip:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; + border-radius: 50%; +} +@starting-style { + .bsplus-tooltip-bubble:popover-open { + transform: scale(0); + } } .assessmenttooltip { - bottom: 0px; + position: absolute; + bottom: 0; left: 5px; -} -.topmenutooltip { - top: 115% !important; - background: var(--text-primary) !important; - color: var(--theme-primary) !important; -} -.fixed-tooltip { - display: inline-block; - z-index: 5 !important; width: 28px; - background: none; - box-shadow: none; padding: 2px; - position: absolute; -} -.fixed-tooltip svg { - fill: var(--theme-primary); -} -.tooltiptext-fixed { - width: 120px; - transform: scale(0); - transition: transform 0.2s; - transform-origin: top; - background: var(--background-primary); - color: var(--text-primary); - text-align: center; - border-radius: 6px; - padding: 2px; - position: fixed; - z-index: 1000; - top: 0; - left: 0; - margin-left: -62px; -} -.tooltiptext-fixed::after { - content: ""; - position: absolute; - bottom: 100%; - left: 50%; - margin-left: -5px; - border-width: 5px; - border-style: solid; - border-color: transparent transparent var(--text-primary) transparent; -} -.tooltiptext-fixed.show { - transform: scale(1); - transform-origin: top; - transition: transform 0.2s; -} -.tooltiptext-fixed p:hover { - cursor: pointer; - background: rgba(0, 0, 0, 0.3) !important; - transition: 200ms; -} -.tooltiptext-fixed p { - border-radius: 8px !important; - padding-top: 2px; - padding-bottom: 2px; - margin: 2px; } diff --git a/src/css/iframe.scss b/src/css/iframe.scss index f070b817..3ef6d52f 100644 --- a/src/css/iframe.scss +++ b/src/css/iframe.scss @@ -44,12 +44,9 @@ body { } > .date > .value, - blockquote.forward > .preamble > .sender > .value { - color: rgba(255, 255, 255, 0.7) !important; - } - > .date > .label, - blockquote.forward > .preamble > .sender > .label { + > .sender > .value, + > .sender > .label { color: rgba(255, 255, 255, 0.7) !important; } } @@ -90,19 +87,6 @@ body { border-top-right-radius: 1rem; } - blockquote.forward > .preamble { - color: rgba(255, 255, 255, 0.7) !important; - } - - blockquote.forward > .preamble > .date > .value, - blockquote.forward > .preamble > .sender > .value { - color: rgba(255, 255, 255, 0.7) !important; - } - blockquote.forward > .preamble > .date > .label, - blockquote.forward > .preamble > .sender > .label { - color: rgba(255, 255, 255, 0.7) !important; - } - #backgroundTable > * { background-color: #161616; border: none; diff --git a/src/css/injected.scss b/src/css/injected.scss index 429c584d..7c3312bf 100644 --- a/src/css/injected.scss +++ b/src/css/injected.scss @@ -31,20 +31,20 @@ pointer-events: none; } -.hidden { - display: none; -} - button.timetable-zoom.iconFamily, button.bsplus-timetable-control.iconFamily, .iconFamily { font-family: "IconFamily" !important; } +.hidden { + display: none; +} + body, .legacy-root input, .legacy-root textarea, -.legacy-root button:not(.iconFamily), +.legacy-root button, .legacy-root select, .legacy-root option, .legacy-root .input, @@ -61,6 +61,8 @@ html { body { font-family: Rubik, sans-serif !important; + background: var(--theme-primary); + overflow: hidden; } select { @@ -87,14 +89,16 @@ select:hover { } select:focus { - outline: none !important; background: var(--theme-secondary, var(--background-secondary)) !important; border-color: color-mix( in srgb, var(--text-primary) 18%, var(--theme-offset-bg, var(--theme-secondary, var(--background-secondary))) 82% ) !important; - box-shadow: 0 0 0 1px color-mix(in srgb, var(--text-primary) 12%, transparent) !important; +} +select:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } select:not([multiple]):not([size]), @@ -133,7 +137,7 @@ select option { background: var(--auto-background) !important; } .legacy-root, -.legacy-root *:not(.iconFamily) { +.legacy-root * { font-family: var(--betterseqta-font-family, Rubik), sans-serif !important; } @@ -210,9 +214,6 @@ html:not(.dark) .legacy-root { pointer-events: none !important; } -.connectedNotificationsWrapper > div > button > svg > g { - fill: var(--theme-primary) !important; -} #main { color: var(--text-primary); position: relative; @@ -258,7 +259,20 @@ html:not(.dark) .legacy-root { height: 35px; width: 35px !important; padding: 0; - box-shadow: none; +} +.addedButton, +.connectedNotificationsWrapper > div > button { + border: none !important; + box-shadow: none !important; + + &::after { + content: none !important; + } + + &:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; + } } /* Engage toolbar: keep settings/theme buttons above React chrome */ @@ -350,6 +364,10 @@ html:not(.dark) .legacy-root { cursor: pointer; padding: 4px 8px; } +.legacy-root .bsplus-timetable-control > svg { + width: 16px; + height: 16px; +} #main > .dashboard { grid-template-columns: repeat(autofit, minmax(200px, 400px)) !important; @@ -434,7 +452,6 @@ ul.magicDelete > li.deleting { display: block; margin: 0; flex-shrink: 0; - fill: var(--theme-primary); color: var(--theme-primary); } #menu, @@ -466,10 +483,12 @@ ul.magicDelete > li.deleting { display: flex; white-space: nowrap; place-items: center; + cursor: pointer; } #menu .sub { top: 71px; margin-top: -2px; + pointer-events: none; } /* Drill-in stack: only the current list + folder header stay clickable. @@ -504,10 +523,6 @@ ul.magicDelete > li.deleting { } /* Only the frontmost open .sub panel receives pointer events */ -#menu .sub { - pointer-events: none; -} - #menu li.hasChildren:is(.active, .bsplus-active) > .sub { pointer-events: auto; } @@ -639,6 +654,7 @@ ul.magicDelete > li.deleting { color: var(--text-color); border-right: none; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); + --menuHidden: none; } /* Custom title bar: keep native `#title` children for sync, hide them visually. @@ -959,37 +975,35 @@ body > .sortable-fallback.bsplus-sortable-drag, list-style: none !important; } -#menu { - li:is(.active, .hasChildren.bsplus-active) > .sub > ul > .item:not(.hasChildren) { - position: relative; +#menu li:is(.active, .hasChildren.bsplus-active) > .sub > ul > .item:not(.hasChildren) { + position: relative; - &::before { - content: ""; - position: absolute; - top: 0; - left: 0; - bottom: 0; - width: 3px; - background: var(--item-colour, transparent); - transition: - width 100ms, - transform 0.3s ease; - border-radius: 8px 0 0 8px; - pointer-events: none; - } - - &:hover::before, - &:is(.active, .bsplus-active)::before { - width: 6px; - background: var(--item-colour, transparent); - } + &::before { + content: ""; + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 3px; + background: var(--item-colour, transparent); + transition: + width 100ms, + transform 0.3s ease; + border-radius: 8px 0 0 8px; + pointer-events: none; } - li.active > .sub > ul > .active { - background: rgba(0, 0, 0, 0.3) !important; + &:hover::before, + &:is(.active, .bsplus-active)::before { + width: 6px; + background: var(--item-colour, transparent); } } +#menu li.active > .sub > ul > .active { + background: rgba(0, 0, 0, 0.3) !important; +} + #userActions { display: none; } @@ -1364,8 +1378,8 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l #menu li:focus-visible, #menu section:focus-visible { - outline: 1px solid rgb(from currentColor r g b / 0.55); - outline-offset: -1px; + outline: var(--bsplus-focus-ring) !important; + outline-offset: -2px; background: rgba(0, 0, 0, 0.2) !important; } @@ -1863,12 +1877,16 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l border-radius: 50px; } .shortcut { + box-sizing: border-box; height: 4em; width: 15em; max-width: 15em; + padding: 0 20px 0 12px; + gap: 10px; background: var(--background-primary); color: var(--text-primary); display: flex; + align-items: center; border-radius: 80px; position: relative; transition: 200ms; @@ -1877,9 +1895,10 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l background: var(--auto-background); } .shortcut p { - margin: auto 0px auto 5px; + flex: 1; + min-width: 0; + margin: 0; font-size: 20px; - width: 150px; word-wrap: break-word; line-height: 20px; } @@ -2022,14 +2041,9 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l } [class*="notifications__notifications___"] > button > [class*="notifications__bubble___"] { background: var(--better-alert-highlight); - width: 25px; - height: 25px; -} -.dark .legacy-root button.iconFamily::after { - background: white; -} -.legacy-root button.iconFamily::after { - background: currentColor; + width: 22px; + height: 22px; + font-size: 12px; } .legacy-root button:not([disabled]):focus { border-color: var(--better-sub); @@ -2044,8 +2058,6 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l margin-bottom: 4px !important; > [class*="notifications__dismiss___"] { - background: rgba(0, 0, 0, 0.1) !important; - color: var(--text-primary); margin: auto 0; } @@ -2086,11 +2098,37 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l margin-top: 5px; } [class*="notifications__actions___"] { + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 8px 4px 4px !important; background: var(--auto-background); button { - background: none !important; - border: 1px solid white; + margin: 0 !important; + } +} +[class*="notifications__actions___"] button, +[class*="notifications__dismiss___"] { + border: none !important; + border-radius: 8px !important; + box-shadow: none !important; + background: color-mix(in srgb, var(--text-primary) 10%, transparent) !important; + color: var(--text-primary) !important; + transition: background 200ms; + + &::after { + content: none !important; + } + + &:hover { + background: color-mix(in srgb, var(--text-primary) 18%, transparent) !important; + } + + &:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } } [class*="notifications__details___"] { @@ -2127,7 +2165,6 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l content: ""; font-size: 12px; margin-right: 4px; - font-family: "IconFamily"; pointer-events: none; } @@ -2163,7 +2200,6 @@ html.transparencyEffects [class*="BasicPanel__BasicPanel___q92_U"] > ol > li + l font-size: 16px; margin-left: 8px; margin-top: auto; - font-family: "IconFamily"; pointer-events: none; } [class*="Input__Input___"] { @@ -2918,14 +2954,12 @@ div.bar.flat { border-radius: 12px; } -.dark { - .cke_toolbox > .cke_toolbar .cke_combo_on > .cke_combo_button, - .cke_toolbox > .cke_toolbar .cke_button_on { - background-color: #3d3d3e !important; +.dark .cke_toolbox > .cke_toolbar .cke_combo_on > .cke_combo_button, +.dark .cke_toolbox > .cke_toolbar .cke_button_on { + background-color: #3d3d3e !important; - &::after { - background: rgb(207, 207, 207) !important; - } + &::after { + background: rgb(207, 207, 207) !important; } } @@ -2967,18 +3001,14 @@ ul.uiSplitButtonList, background: transparent; color: var(--text-primary); } -body { - background: var(--theme-primary); - overflow: hidden; -} .shortcuticondiv { - height: 39px; - width: 39px; + flex-shrink: 0; + height: 39px !important; + width: 39px !important; border-radius: 50%; padding: 0; - margin: auto 0px auto 10px; - background-repeat: no-repeat; - background-size: contain; + margin: 0; + object-fit: contain; } .forumView > .messages > .thread, .forumView > .messages > .deletedPlaceholder, @@ -3219,9 +3249,6 @@ body:not(.clr-open) .clr-picker, z-index: 10; opacity: 0.4; } -#menu { - --menuHidden: none; -} .editmenuoption { background: var(--background-primary); color: var(--text-primary); @@ -3239,18 +3266,48 @@ body:not(.clr-open) .clr-picker, justify-content: space-between; align-items: center; } -.logout { - background: none !important; - padding: 5px 10px; +.bsplus-tooltip-bubble:has(> .bsplus-logout) { + min-width: 0; } +.bsplus-tooltip-bubble .bsplus-logout { + display: flex !important; + align-items: center; + justify-content: center; + width: 40px !important; + height: 32px !important; + margin: 0 !important; + padding: 0 !important; + border: none !important; + border-radius: 6px; + box-shadow: none !important; + background: none !important; + color: #fff !important; + opacity: 1 !important; + cursor: pointer; + transition: background 150ms; -#logouttooltip { - width: 50px !important; - margin-left: -28px !important; - top: 105% !important; + html.dark & { + color: #000 !important; + } - .uiButton svg g { - color: var(--background-primary) !important; + &::after { + content: none !important; + } + + svg { + width: 20px; + height: 20px; + fill: none !important; + stroke: currentColor !important; + } + + &:hover { + background: color-mix(in srgb, currentColor 12%, transparent) !important; + } + + &:focus-visible { + outline: 2px solid currentColor !important; + outline-offset: -2px; } } .svg { @@ -3352,6 +3409,7 @@ body:not(.clr-open) .clr-picker, width: 25px; position: absolute; bottom: 20px; + color: inherit; } #userActions > .details > .code { text-transform: initial; @@ -3493,50 +3551,9 @@ div.day-empty { cursor: pointer; text-decoration: underline; } -.upcoming-blank { - display: flex; - border-bottom: 2px solid #bebebe; - margin: 5px 50px; - height: 2em; - padding: 0px; -} -.upcoming-tick { - align-self: center; -} .upcoming-title h2 { width: 100%; } -.upcoming-filters { - display: flex; - height: 26px; - width: 65%; - align-self: center; - align-items: center; - color: var(--text-color); - padding: 5px; - overflow-x: scroll; - overflow-y: hidden; -} -.upcoming-checkbox-container { - position: relative; - padding: none !important; - padding-left: 25px !important; - padding-right: 10px !important; - cursor: pointer; - font-size: 12px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - height: 20px; - align-items: center; - display: flex; -} - -.upcoming-hiddenassessment { - color: #797979; -} - .calendarEventEditor > .tabset > .item { border-radius: 0 !important; } @@ -3659,64 +3676,10 @@ div.day-empty { .upcoming-special-day { font-size: 20px; } -.upcoming-blank { - display: flex; - border-bottom: 2px solid #bebebe; - margin: 5px 50px; - height: 2em; - padding: 0px; -} -.upcoming-blank p { - padding: 0; - margin: 0; -} .upcoming-title { display: flex; align-content: space-between; } -.upcoming-checkbox-container input { - position: absolute; - opacity: 0; - cursor: pointer; - height: 0; - width: 0; - padding: 0; -} -.upcoming-checkmark { - position: absolute; - top: 0; - left: 0; - height: 15px; - width: 15px; - border: 3px solid var(--item-colour); - border-radius: 5px; - color: var(--text-color); -} -.upcoming-checkbox-container:hover input ~ .upcoming-checkmark { - filter: brightness(0.8); -} -.upcoming-checkbox-container input:checked ~ .upcoming-checkmark { - background: var(--item-colour); -} -.upcoming-checkmark:after { - content: ""; - position: absolute; - display: none; -} -.upcoming-checkbox-container input:checked ~ .upcoming-checkmark:after { - display: block; -} -.upcoming-checkbox-container .upcoming-checkmark:after { - left: 3.5px; - top: 0px; - width: 5px; - height: 10px; - border: solid white; - border-width: 0 3px 3px 0; - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); - transform: rotate(45deg); -} .titlebar { align-items: center; transition: 200ms; @@ -3772,11 +3735,9 @@ div.day-empty { color 0.2s ease-in-out; } -.engage-child-select:focus { - outline: none; - box-shadow: - 0 0 0 2px var(--background-primary), - 0 0 0 4px rgba(59, 130, 246, 0.45); +.engage-child-select:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } #engage-day-container:has(> .day-empty) { @@ -3793,27 +3754,6 @@ div.day-empty { text-align: center; } -#engage-logouttooltip { - width: 50px !important; - margin-left: -28px !important; - top: 105% !important; - - .engage-logout { - background: none !important; - border: none; - cursor: pointer; - color: var(--background-primary) !important; - width: 100%; - display: flex; - align-items: center; - justify-content: center; - padding: 5px; - - svg { - fill: var(--background-primary) !important; - } - } -} .pagename { align-items: center; display: flex; @@ -3911,7 +3851,7 @@ div.day-empty { visibility 0s linear 0.45s; } .titlebar .bsplus-titlebar-badge:focus-visible { - outline: 2px solid var(--theme-primary); + outline: var(--bsplus-focus-ring) !important; outline-offset: 2px; } .bsplus-founder-badge-slot--static .bsplus-titlebar-badge { @@ -3960,17 +3900,9 @@ div.day-empty { .bsplus-founder-badge:hover { transform: scale(1.02); } -.bsplus-founder-badge:focus { - outline: none; -} -.bsplus-founder-badge:focus-visible .bsplus-founder-badge__glass { - box-shadow: - inset 0 0 0 1px rgba(255, 255, 255, 0.78), - inset 0 1px 0 rgba(255, 255, 255, 0.52), - inset 0 2px 8px rgba(255, 255, 255, 0.14), - inset 0 -1px 0 rgba(0, 0, 0, 0.08), - 0 0 0 2px var(--theme-primary, #f97316), - 0 0 0 4px rgba(249, 115, 22, 0.35); +.bsplus-founder-badge:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .bsplus-founder-badge__glass { position: relative; @@ -4125,10 +4057,8 @@ div.day-empty { transition: all 0.2s ease; } .bsplus-founder-badge-actions .bsplus-cal-btn:focus-visible { - outline: none; - box-shadow: - 0 0 0 2px var(--background-primary, #fff), - 0 0 0 4px var(--better-main, #3b82f6); + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .bsplus-founder-badge-actions .bsplus-cal-btn--ghost { background: color-mix(in srgb, var(--text-primary, #111) 8%, transparent); @@ -4156,6 +4086,9 @@ div.day-empty { z-index: 3; position: absolute; } +.userInfosvg path { + transition: fill 200ms; +} .userInfosvgdiv { width: 50px !important; height: 50px !important; @@ -4177,9 +4110,7 @@ div.day-empty { left: 15%; transition: background 200ms; } -.userInfosvg path { - transition: fill 200ms; -} + .userInfohouse { padding: 2px 8px; font-size: 14px; @@ -4454,14 +4385,9 @@ div.day-empty { transition: all 0.2s ease-in-out; } - .bsplus-tos-btn:focus { - outline: none; - } - .bsplus-tos-btn:focus-visible { - box-shadow: - 0 0 0 2px var(--background-primary), - 0 0 0 4px color-mix(in srgb, var(--text-primary) 45%, transparent); + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .bsplus-tos-btn--primary { @@ -4569,6 +4495,13 @@ div.day-empty { .whatsnewFooter a { border: none; } +.whatsnewFooter .socials { + display: flex; + align-items: center; + margin: 0 5px; + padding: 0; + background: none !important; +} .whatsnewFooter div { margin: 0 15px; display: flex; @@ -4842,6 +4775,7 @@ div.day-empty { overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; + line-clamp: 3; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); } .themeOfTheMonthCardExpanded .themeOfTheMonthCardHeroEmbossVariants { @@ -4939,6 +4873,7 @@ div.day-empty { overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: unset; + line-clamp: unset; } .themeOfTheMonthCard::before { content: ""; @@ -5074,10 +5009,12 @@ div.day-empty { overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; + line-clamp: 3; } .themeOfTheMonthCardDescriptionExpanded { display: block; -webkit-line-clamp: unset; + line-clamp: unset; } .themeOfTheMonthCardExpanding:not(.themeOfTheMonthCardExpandedShell) .themeOfTheMonthCardDescriptionExpanded { @@ -5213,12 +5150,19 @@ div.day-empty { .popup-media-fullscreenable:hover { opacity: 0.95; } -.popup-media-fullscreenable:focus { - outline: none; +[class*="Input__Input___"]:has(> input:focus-visible) { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; +} +.betterseqta-weight-input:focus-visible, +#betterseqta-weight-override:focus-visible, +#theme-of-the-month-card button:focus-visible { + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .popup-media-fullscreenable:focus-visible { - outline: 2px solid color-mix(in srgb, var(--text-primary) 70%, transparent); - outline-offset: 4px; + outline: var(--bsplus-focus-ring) !important; + outline-offset: 2px; } .bsplus-popup-media-overlay-backdrop { @@ -5486,18 +5430,6 @@ div.day-empty { opacity: 0.7; } -.notice-preview { - font-size: 14px; - color: var(--text-secondary); - line-height: 1.4; - display: -webkit-box; - -webkit-line-clamp: 2; - line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; -} - .notice-modal-overlay { position: fixed; top: 0; @@ -5699,122 +5631,8 @@ button.notice-close-btn { } } -.notice-modal-badge-row { - display: flex; - align-items: center; - gap: 12px; - flex: 1; -} - -.notice-modal-badge { - padding: 6px 12px; - border-radius: 20px; - font-size: 13px; - font-weight: 700; - white-space: nowrap; -} - -.notice-modal-staff { - font-size: 14px; - color: var(--text-secondary); - opacity: 0.8; -} - -.notice-modal-close { - background: var(--background-secondary); - border: none; - width: 32px; - height: 32px; - border-radius: 50%; - display: flex; - align-items: center; - justify-content: center; - cursor: pointer; - font-size: 18px; - color: var(--text-primary); - transition: all 0.2s ease; - flex-shrink: 0; - - &:hover { - background: var(--background-tertiary); - transform: scale(1.1); - } -} - -.notice-modal-title { - font-size: 24px; - font-weight: 600; - color: var(--text-primary); - margin: 16px 20px 20px; - line-height: 1.3; - flex-shrink: 0; -} - -.notice-modal-body { - padding: 0 20px 20px; - font-size: 15px; - line-height: 1.6; - color: var(--text-secondary); - flex: 1; - overflow-y: auto; - - &::-webkit-scrollbar { - width: 6px; - } - - &::-webkit-scrollbar-track { - background: transparent; - } - - &::-webkit-scrollbar-thumb { - background: rgba(255, 255, 255, 0.2); - border-radius: 3px; - } - - &::-webkit-scrollbar-thumb:hover { - background: rgba(255, 255, 255, 0.3); - } - - p { - margin-bottom: 12px; - - &:last-child { - margin-bottom: 0; - } - } - - a { - color: var(--theme-primary); - text-decoration: none; - - &:hover { - text-decoration: underline; - } - } - - ul, - ol { - margin: 12px 0; - padding-left: 20px; - } - - li { - margin-bottom: 4px; - } -} - -.dark { - .notice-card { - border-color: rgba(255, 255, 255, 0.05); - - &:hover { - border-color: rgba(255, 255, 255, 0.1); - } - } - - .notice-modal-content { - border-color: rgba(255, 255, 255, 0.05); - } +.dark .notice-modal-content { + border-color: rgba(255, 255, 255, 0.05); } @media (max-width: 768px) { @@ -5825,23 +5643,6 @@ button.notice-close-btn { .notice-modal-content { max-height: 90vh; } - - .notice-modal-title { - font-size: 20px; - margin: 12px 16px 16px; - } - - .notice-modal-body { - padding: 0 16px 16px; - } - - .notice-card { - padding: 12px; - } - - .notice-preview { - font-size: 13px; - } } h2.home-subtitle { diff --git a/src/css/tailwind.css b/src/css/tailwind.css index 835483b5..7dff8e2d 100644 --- a/src/css/tailwind.css +++ b/src/css/tailwind.css @@ -26,11 +26,11 @@ --text-13xl: 16rem; --text-14xl: 18rem; - --font-IconFamily: IconFamily; - --animate-spin-fast: spin 0.4s linear infinite; --aspect-theme: 5 / 1; + + --font-IconFamily: IconFamily; } @layer base { @@ -45,4 +45,28 @@ button { cursor: pointer; } + + :root, + :host { + --bsplus-focus-ring: 2px solid var(--color-zinc-900); + } + + .dark { + --bsplus-focus-ring: 2px solid var(--color-white); + } + + input:focus, + textarea:focus, + select:focus { + box-shadow: none !important; + } + + :focus-visible, + input:focus-visible, + [type]:focus-visible, + textarea:focus-visible, + select:focus-visible { + outline: var(--bsplus-focus-ring); + outline-offset: 2px; + } } diff --git a/src/declarations.d.ts b/src/declarations.d.ts index c1e8d554..5bf1d525 100644 --- a/src/declarations.d.ts +++ b/src/declarations.d.ts @@ -1,6 +1,5 @@ declare module "*.mp4"; declare module "*.webm"; -declare module "*.woff"; declare module "*.scss"; declare module "*.png"; declare module "*.webp"; diff --git a/src/interface/components/Button.svelte b/src/interface/components/Button.svelte index 7750f52f..d20dd0cc 100644 --- a/src/interface/components/Button.svelte +++ b/src/interface/components/Button.svelte @@ -17,16 +17,20 @@ const variants = { primary: "bg-zinc-100 text-zinc-900 border-transparent enabled:hover:bg-white", - secondary: "dark:bg-[#38373D]/50 bg-[#DDDDDD]/50 border-[#DDDDDD]/30 dark:border-[#38373D]/30 dark:text-white enabled:hover:brightness-125", - ghost: "bg-transparent border-transparent dark:text-white enabled:hover:bg-zinc-200/60 dark:enabled:hover:bg-zinc-700/50", + secondary: + "dark:bg-[#38373D]/50 bg-[#DDDDDD]/50 border-[#DDDDDD]/30 dark:border-[#38373D]/30 dark:text-white enabled:hover:brightness-125", + ghost: + "bg-transparent border-transparent dark:text-white enabled:hover:bg-zinc-200/60 dark:enabled:hover:bg-zinc-700/50", }; diff --git a/src/interface/components/FontPickerModal.svelte b/src/interface/components/FontPickerModal.svelte index fcc9be60..1d11b702 100644 --- a/src/interface/components/FontPickerModal.svelte +++ b/src/interface/components/FontPickerModal.svelte @@ -1,15 +1,15 @@
{#if isRecording} -
{:else if hotkeyParts.length > 0} -
{#each hotkeyParts as part} -
+
{part}
{/each}
{:else} -
\ No newline at end of file + diff --git a/src/interface/components/MotionDiv.svelte b/src/interface/components/MotionDiv.svelte index ce05bba9..64f95626 100644 --- a/src/interface/components/MotionDiv.svelte +++ b/src/interface/components/MotionDiv.svelte @@ -1,15 +1,22 @@ -
+
{#if children} {@render children()} {/if} diff --git a/src/interface/components/PickerSwatch.svelte b/src/interface/components/PickerSwatch.svelte index e4177750..1b845831 100644 --- a/src/interface/components/PickerSwatch.svelte +++ b/src/interface/components/PickerSwatch.svelte @@ -1,5 +1,5 @@ @@ -9,4 +9,4 @@ onclick={onClick} style="background: {$settingsState.selectedColor}" class="w-16 h-8 rounded-md shadow-2xl ring-[1px] ring-[#DDDDDD]/30 dark:ring-[#38373D]/30" -> \ No newline at end of file +> diff --git a/src/interface/components/SidebarAppearance.svelte b/src/interface/components/SidebarAppearance.svelte index f3280132..cbb615b1 100644 --- a/src/interface/components/SidebarAppearance.svelte +++ b/src/interface/components/SidebarAppearance.svelte @@ -4,9 +4,9 @@ import Select from "@/interface/components/Select.svelte"; import Slider from "@/interface/components/Slider.svelte"; import Switch from "@/interface/components/Switch.svelte"; - import { settingsState } from "@/seqta/utils/listeners/SettingsState"; + import { settingsState } from "@/seqta/utils/listeners/settingsState"; import { matchesSearch } from "@/interface/pages/settings/shared"; - import type { SettingsList } from "@/interface/types/SettingsProps"; + import type { SettingsList } from "@/interface/types/settingsProps"; import { DEFAULT_SIDEBAR_BLUR, DEFAULT_SIDEBAR_RADIUS, diff --git a/src/interface/components/SidebarNav.svelte b/src/interface/components/SidebarNav.svelte index 76a77c51..875946a6 100644 --- a/src/interface/components/SidebarNav.svelte +++ b/src/interface/components/SidebarNav.svelte @@ -14,7 +14,11 @@ }[]; }; - let { groups, selectedId, onselect }: { + let { + groups, + selectedId, + onselect, + }: { groups: NavGroup[]; selectedId: string; onselect: (id: string) => void; @@ -74,7 +78,9 @@ {/if} {#each group.items as item (item.id)} {#if item.divided} -
+
{/if} void } = $props(); let modalElement: HTMLElement; @@ -47,12 +47,11 @@ onclick={(e) => e.stopPropagation()} onkeydown={(e) => e.stopPropagation()} > -

- Sign in to favorite themes -

+

Sign in to favorite themes

- Sign in to the Theme Store to save favorites across devices, or create an account to get started. + Sign in to the Theme Store to save favorites across devices, or create an account to get + started.

- {/each} -
- - {#if model.kind !== "solid"} -
+ class="grid relative grid-cols-3 p-0.5 rounded-lg bg-zinc-100 dark:bg-zinc-700/70" + role="radiogroup" + aria-label="Fill type" + >
{ - if (dragging !== null) moveStop(dragging, barPosition(event)); - }} - onpointerup={() => (dragging = null)} - onpointercancel={() => (dragging = null)} - > - + {#each MODES as mode (mode.kind)} + - {/each} -
-
- {#if model.kind === "linear"} - - {/if} - + {mode.label} + + {/each}
- {/if} + + {#if model.kind !== "solid"} +
+
{ + if (dragging !== null) moveStop(dragging, barPosition(event)); + }} + onpointerup={() => (dragging = null)} + onpointercancel={() => (dragging = null)} + > +
+ {#each stops as stop, index (index)} + + {/each} +
+
+ + {#if model.kind === "linear"} + + {/if} + +
+ {/if}
@@ -370,7 +409,9 @@ min="0" max="100" class="picker-track" - style="background: linear-gradient(to right, transparent, {hex}), {CHECKERBOARD}; --swatch: {formatColour(active)};" + style="background: linear-gradient(to right, transparent, {hex}), {CHECKERBOARD}; --swatch: {formatColour( + active, + )};" aria-label="Opacity" value={Math.round(hsva.a * 100)} oninput={(event) => updateHsva({ a: Number(event.currentTarget.value) / 100 })} @@ -384,10 +425,12 @@
-
- - {#if cloudState.isLoggedIn} -
- - - {#each cloudState.user?.pfpHistory ?? [] as entry (entry.id)} - - {/each} - -
- {/if} - - {#if cloudError} -

{cloudError}

+ {#if error} +

{error}

{/if}
diff --git a/src/plugins/built-in/profilePicture/index.ts b/src/plugins/built-in/profilePicture/index.ts index 7449ce6a..5e5ca994 100644 --- a/src/plugins/built-in/profilePicture/index.ts +++ b/src/plugins/built-in/profilePicture/index.ts @@ -4,20 +4,20 @@ import ProfilePictureSetting from "./ProfilePictureSetting.svelte"; import { toMountableComponent } from "@/types/mountableComponent"; import { waitForElm } from "@/seqta/utils/waitForElm"; import browser from "@/lib/browser"; -import { cloudAuth } from "@/seqta/utils/CloudAuth"; -import { resolveCloudPfp, defaultAccountsPfpUrl } from "@/seqta/utils/cloudPfpCache"; +import { cloudAuth } from "@/seqta/utils/cloudAuth"; +import { revokePfpUrl } from "@/seqta/utils/cloudPfpCache"; +import { loadPicture, REVISION_KEY } from "./picture"; import styles from "./styles.css?inline"; -import localforage from "localforage"; const settings = defineSettings({ useCloudPfp: booleanSetting({ default: false, title: "Use BetterSEQTA Cloud profile picture", - description: "Use your cloud account avatar instead of the uploaded image below", + description: "Show your cloud account picture instead of the one uploaded here", }), picture: componentSetting({ title: "Profile Picture", - description: "Upload or remove your custom profile image", + description: "Upload or remove your profile picture", component: toMountableComponent(ProfilePictureSetting), }), }); @@ -26,14 +26,13 @@ const profilePicturePlugin: Plugin = { id: "profile-picture", name: "Custom Profile Picture", description: "Use your own image in place of the profile icon", - version: "1.3.0", + version: "2.0.0", settings: settings, disableToggle: true, defaultEnabled: false, styles, run: async (api) => { - await api.storage.loaded; let container: Element; try { container = await waitForElm(".userInfosvgdiv", true, 100, 60); @@ -41,97 +40,41 @@ const profilePicturePlugin: Plugin = { return () => {}; } - const svg = container.querySelector(".userInfosvg") as HTMLElement | null; - let img: HTMLImageElement | null = null; - let currentBlobUrl: string | undefined; + const img = document.createElement("img"); + img.className = "userInfoImg"; + img.alt = ""; + let version = 0; - const store = localforage.createInstance({ - name: "profile-picture-store", - storeName: "profilePicture", - }); - - async function applyProfileImage() { - if (img) { - img.remove(); - img = null; - } - if (currentBlobUrl) { - URL.revokeObjectURL(currentBlobUrl); - currentBlobUrl = undefined; - } - - const useCloud = api.settings.useCloudPfp; - const userId = cloudAuth.state.user?.id; - const pfpUrl = - cloudAuth.state.user?.pfpUrl ?? (userId ? defaultAccountsPfpUrl(userId) : undefined); - - if (useCloud && pfpUrl && userId) { - const resolved = await resolveCloudPfp(userId, pfpUrl); - if (resolved) { - currentBlobUrl = resolved.src; - img = document.createElement("img"); - img.className = "userInfoImg"; - img.src = resolved.src; - if (svg) svg.style.display = "none"; - container.appendChild(img); - return; - } - } - - const blob = await store.getItem("profile-picture"); - if (blob && blob instanceof Blob) { - currentBlobUrl = URL.createObjectURL(blob); - img = document.createElement("img"); - img.className = "userInfoImg"; - img.src = currentBlobUrl; - if (svg) svg.style.display = "none"; - container.appendChild(img); + const render = async () => { + const current = ++version; + const { isLoggedIn, user } = cloudAuth.state; + const cloudUser = api.settings.useCloudPfp && isLoggedIn ? user : null; + const url = await loadPicture(cloudUser); + if (current !== version) return revokePfpUrl(url); + revokePfpUrl(img.src); + if (url) { + img.src = url; + container.append(img); } else { - if (svg) svg.style.display = ""; - } - } - - if (api.settings.useCloudPfp && cloudAuth.state.isLoggedIn) { - const { pullCloudProfilePictureFromServer } = await import("@/seqta/utils/cloudPfpSync"); - await pullCloudProfilePictureFromServer(); - } - - await applyProfileImage(); - - const onLocalPictureUpdated = () => { - void applyProfileImage(); - }; - window.addEventListener("profile-picture-updated", onLocalPictureUpdated); - - const onStorageRevision = ( - changes: Record, - areaName: string, - ) => { - if (areaName === "local" && changes.profile_picture_revision) { - void applyProfileImage(); + img.removeAttribute("src"); + img.remove(); } }; - browser.storage.onChanged.addListener(onStorageRevision); - const cloudUnsub = cloudAuth.subscribe(() => { - void applyProfileImage(); - }); - - const useCloudUnreg = api.settings.onChange("useCloudPfp", (enabled: boolean) => { - void import("@/seqta/utils/cloudPfpSync").then(({ onUseCloudPfpToggled }) => - onUseCloudPfpToggled(enabled), - ); - void applyProfileImage(); - }); + const onStorage = (changes: Record, area: string) => { + if (area === "local" && changes[REVISION_KEY]) void render(); + }; + browser.storage.onChanged.addListener(onStorage); + const unsubscribe = cloudAuth.subscribe(() => void render()); + const setting = api.settings.onChange("useCloudPfp", () => void render()); return () => { - useCloudUnreg.unregister(); - cloudUnsub(); - window.removeEventListener("profile-picture-updated", onLocalPictureUpdated); - browser.storage.onChanged.removeListener(onStorageRevision); - if (img) img.remove(); - if (svg) svg.style.display = ""; - if (currentBlobUrl) URL.revokeObjectURL(currentBlobUrl); + version++; + setting.unregister(); + unsubscribe(); + browser.storage.onChanged.removeListener(onStorage); + revokePfpUrl(img.src); + img.remove(); }; }, }; diff --git a/src/plugins/built-in/profilePicture/picture.ts b/src/plugins/built-in/profilePicture/picture.ts new file mode 100644 index 00000000..816ee8ad --- /dev/null +++ b/src/plugins/built-in/profilePicture/picture.ts @@ -0,0 +1,40 @@ +import localforage from "localforage"; +import browser from "@/lib/browser"; +import type { CloudUser } from "@/seqta/utils/cloudAuth"; +import { defaultAccountsPfpUrl, resolveCloudPfp, revokePfpUrl } from "@/seqta/utils/cloudPfpCache"; + +export const REVISION_KEY = "profile_picture_revision"; + +const store = localforage.createInstance({ + name: "profile-picture-store", + storeName: "profilePicture", +}); + +export async function setLocalPicture(file: Blob | null): Promise { + if (file) await store.setItem("profile-picture", file); + else await store.removeItem("profile-picture"); + await browser.storage.local.set({ [REVISION_KEY]: Date.now() }); +} + +async function pictureUrl(cloudUser: CloudUser | null): Promise { + if (cloudUser) { + const pfpUrl = cloudUser.pfpUrl ?? defaultAccountsPfpUrl(cloudUser.id); + return resolveCloudPfp(cloudUser.id, pfpUrl); + } + const blob = await store.getItem("profile-picture"); + return blob instanceof Blob ? URL.createObjectURL(blob) : null; +} + +export async function loadPicture(cloudUser: CloudUser | null): Promise { + const url = await pictureUrl(cloudUser).catch(() => null); + if (!url) return null; + const probe = new Image(); + probe.src = url; + try { + await probe.decode(); + return url; + } catch { + revokePfpUrl(url); + return null; + } +} diff --git a/src/plugins/built-in/profilePicture/styles.css b/src/plugins/built-in/profilePicture/styles.css index 932cbf67..ff3c28d8 100644 --- a/src/plugins/built-in/profilePicture/styles.css +++ b/src/plugins/built-in/profilePicture/styles.css @@ -1,9 +1,9 @@ .userInfoImg { - width: 80%; - height: 80%; + width: calc(100% - 6px); + height: calc(100% - 6px); position: absolute; - top: 10%; - left: 10%; + top: 3px; + left: 3px; border-radius: 50%; object-fit: cover; z-index: 4; @@ -11,6 +11,10 @@ transition: box-shadow 200ms; } +.userInfosvgdiv:has(> .userInfoImg) > .userInfosvg { + display: none; +} + .dark .userInfoImg { box-shadow: 0 0 0 3px #ffffff; } diff --git a/src/plugins/built-in/themes/theme-manager.cloud.test.ts b/src/plugins/built-in/themes/theme-manager.cloud.test.ts index e061a491..5d1c8322 100644 --- a/src/plugins/built-in/themes/theme-manager.cloud.test.ts +++ b/src/plugins/built-in/themes/theme-manager.cloud.test.ts @@ -11,13 +11,13 @@ jest.mock("localforage", () => { clear: jest.fn(async () => records.clear()), }; }); -jest.mock("@/seqta/utils/listeners/SettingsState", () => ({ +jest.mock("@/seqta/utils/listeners/settingsState", () => ({ settingsState: {}, })); jest.mock("@/seqta/utils/performanceMode", () => ({ fullMotionEffectsEnabled: () => false, })); -jest.mock("@/seqta/ui/colors/Manager", () => ({ updateAllColors: jest.fn() })); +jest.mock("@/seqta/ui/colors/colorManager", () => ({ updateAllColors: jest.fn() })); jest.mock("@/seqta/ui/colors/customThemeAdaptiveBindings", () => ({})); jest.mock("@/seqta/utils/patchThemeImagesPageContext", () => ({})); jest.mock("@/utils/verboseLog", () => ({ diff --git a/src/plugins/built-in/themes/theme-manager.ts b/src/plugins/built-in/themes/theme-manager.ts index 11057b0d..0345ab29 100644 --- a/src/plugins/built-in/themes/theme-manager.ts +++ b/src/plugins/built-in/themes/theme-manager.ts @@ -5,15 +5,15 @@ import { getForcedDarkMode, type LoadedCustomTheme, shouldForceThemeAppearance, -} from "@/types/CustomThemes"; +} from "@/types/customThemes"; import { BSPLUS_PENDING_THEME_ENSURE_AFTER_CLOUD_KEY } from "@/seqta/utils/cloudSettingsSync"; -import { settingsState } from "@/seqta/utils/listeners/SettingsState"; +import { settingsState } from "@/seqta/utils/listeners/settingsState"; import { fullMotionEffectsEnabled } from "@/seqta/utils/performanceMode"; import debounce from "@/seqta/utils/debounce"; -import { themeUpdates } from "@/interface/hooks/ThemeUpdates"; +import { themeUpdates } from "@/interface/hooks/themeUpdates"; import { API_BASE } from "@/config/apiBase"; import { isAllowedFetchUrl } from "@/seqta/utils/allowedFetchUrl"; -import { updateAllColors } from "@/seqta/ui/colors/Manager"; +import { updateAllColors } from "@/seqta/ui/colors/colorManager"; import { clearCustomThemeAdaptiveCssVariables, setCustomThemeAdaptiveCssVariables, @@ -76,7 +76,7 @@ export class ThemeManager { private storeUpdateCheckRunning = false; private constructor() { - verboseDebug("[ThemeManager] Initializing..."); + verboseDebug("[BetterSEQTA+] ThemeManager: Initializing..."); } public static getInstance(): ThemeManager { @@ -97,12 +97,12 @@ export class ThemeManager { * Get a theme by ID from storage */ public async getTheme(themeId: string): Promise { - verboseDebug("[ThemeManager] Getting theme:", themeId); + verboseDebug("[BetterSEQTA+] ThemeManager: Getting theme:", themeId); try { const theme = (await localforage.getItem(themeId)) as CustomTheme; return theme; } catch (error) { - console.error("[ThemeManager] Error getting theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error getting theme:", error); return null; } } @@ -159,7 +159,7 @@ export class ThemeManager { }, ); } catch (error) { - console.error("[ThemeManager] View Transition animation error:", error); + console.error("[BetterSEQTA+] ThemeManager: View Transition animation error:", error); } } @@ -167,19 +167,19 @@ export class ThemeManager { * Disable the current theme without deleting it */ public async disableTheme(): Promise { - verboseDebug("[ThemeManager] Disabling current theme"); + verboseDebug("[BetterSEQTA+] ThemeManager: Disabling current theme"); try { if (!this.currentTheme) { - verboseDebug("[ThemeManager] No theme to disable"); + verboseDebug("[BetterSEQTA+] ThemeManager: No theme to disable"); return; } await this.removeTheme(this.currentTheme); this.currentTheme = null; settingsState.selectedTheme = ""; - verboseDebug("[ThemeManager] Theme disabled successfully"); + verboseDebug("[BetterSEQTA+] ThemeManager: Theme disabled successfully"); } catch (error) { - console.error("[ThemeManager] Error disabling theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error disabling theme:", error); } } @@ -211,7 +211,7 @@ export class ThemeManager { } await browser.storage.local.remove(BSPLUS_PENDING_THEME_ENSURE_AFTER_CLOUD_KEY); } catch (e) { - console.warn("[ThemeManager] prepareThemeAfterCloudSync:", e); + console.warn("[BetterSEQTA+] ThemeManager: prepareThemeAfterCloudSync:", e); } } @@ -219,7 +219,7 @@ export class ThemeManager { * Initialize the theme system and restore previous state */ public async initialize(): Promise { - verboseDebug("[ThemeManager] Starting initialization"); + verboseDebug("[BetterSEQTA+] ThemeManager: Starting initialization"); try { const neumorphicThemeId = "9a9786d1-b5fc-4a91-8c7a-f8bf7f7679ad"; const titlePatch = "#title {\nbackground: transparent !important;\n}"; @@ -233,23 +233,23 @@ export class ThemeManager { await import("@/plugins/built-in/themes/themeCreatorPersistence"); const creatorSession = readThemeCreatorSession(); if (creatorSession.open) { - verboseDebug("[ThemeManager] Restoring theme creator after navigation"); - const { OpenThemeCreator, isThemeCreatorOpen } = - await import("@/plugins/built-in/themes/ThemeCreator"); + verboseDebug("[BetterSEQTA+] ThemeManager: Restoring theme creator after navigation"); + const { openThemeCreator, isThemeCreatorOpen } = + await import("@/plugins/built-in/themes/themeCreator"); if (!isThemeCreatorOpen()) { - void OpenThemeCreator(creatorSession.editingThemeId); + void openThemeCreator(creatorSession.editingThemeId); } } if (settingsState.selectedTheme) { verboseDebug( - "[ThemeManager] Found selected theme, restoring:", + "[BetterSEQTA+] ThemeManager: Found selected theme, restoring:", settingsState.selectedTheme, ); await this.setTheme(settingsState.selectedTheme, false); } } catch (error) { - console.error("[ThemeManager] Error during initialization:", error); + console.error("[BetterSEQTA+] ThemeManager: Error during initialization:", error); } finally { void this.checkStoreThemeUpdates(); } @@ -259,13 +259,13 @@ export class ThemeManager { * Clean up theme system resources */ public async cleanup(): Promise { - verboseDebug("[ThemeManager] Cleaning up resources"); + verboseDebug("[BetterSEQTA+] ThemeManager: Cleaning up resources"); try { if (this.currentTheme) { await this.removeTheme(this.currentTheme, false); } } catch (error) { - console.error("[ThemeManager] Error during cleanup:", error); + console.error("[BetterSEQTA+] ThemeManager: Error during cleanup:", error); } } @@ -273,17 +273,17 @@ export class ThemeManager { * Set and apply a theme by ID */ public async setTheme(themeId: string, applyViewTransition: boolean = true): Promise { - verboseDebug("[ThemeManager] Setting theme:", themeId); + verboseDebug("[BetterSEQTA+] ThemeManager: Setting theme:", themeId); try { const theme = (await localforage.getItem(themeId)) as CustomTheme; if (!theme) { - console.error("[ThemeManager] Theme not found:", themeId); + console.error("[BetterSEQTA+] ThemeManager: Theme not found:", themeId); return; } // Store original settings before applying new theme if (!settingsState.selectedTheme) { - verboseDebug("[ThemeManager] Storing original settings"); + verboseDebug("[BetterSEQTA+] ThemeManager: Storing original settings"); settingsState.originalSelectedColor = settingsState.selectedColor; if (shouldForceThemeAppearance(theme)) { @@ -295,7 +295,7 @@ export class ThemeManager { if (applyViewTransition) { await this.applyViewTransition(async () => { if (this.currentTheme) { - verboseDebug("[ThemeManager] Removing current theme"); + verboseDebug("[BetterSEQTA+] ThemeManager: Removing current theme"); await this.removeThemeWithoutTransition(this.currentTheme); } @@ -305,7 +305,7 @@ export class ThemeManager { }); } else { if (this.currentTheme) { - verboseDebug("[ThemeManager] Removing current theme"); + verboseDebug("[BetterSEQTA+] ThemeManager: Removing current theme"); await this.removeThemeWithoutTransition(this.currentTheme); } @@ -315,7 +315,7 @@ export class ThemeManager { } void updateAllColors(); } catch (error) { - console.error("[ThemeManager] Error setting theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error setting theme:", error); } } @@ -323,7 +323,7 @@ export class ThemeManager { * Apply theme components (CSS, images, settings) */ private async applyTheme(theme: CustomTheme): Promise { - verboseDebug("[ThemeManager] Applying theme:", theme.name); + verboseDebug("[BetterSEQTA+] ThemeManager: Applying theme:", theme.name); try { // Run the theme script BEFORE injecting CustomCSS so any state the // script publishes (e.g. `data-city-state` and `--city-sky-color` for @@ -333,7 +333,7 @@ export class ThemeManager { runThemeScript(theme.themeScript); // Custom CSS + images must be applied in page context (Firefox). - verboseDebug("[ThemeManager] Applying theme styles in page context"); + verboseDebug("[BetterSEQTA+] ThemeManager: Applying theme styles in page context"); await syncThemeToPage({ customCss: theme.CustomCSS || "", images: theme.CustomImages ?? [], @@ -346,16 +346,16 @@ export class ThemeManager { if (shouldForceThemeAppearance(theme)) { const dark = getForcedDarkMode(theme); - verboseDebug("[ThemeManager] Setting dark mode:", dark); + verboseDebug("[BetterSEQTA+] ThemeManager: Setting dark mode:", dark); settingsState.DarkMode = dark; } // Use the stored selected color if available, otherwise use the default if (theme.selectedColor) { - verboseDebug("[ThemeManager] Restoring saved color:", theme.selectedColor); + verboseDebug("[BetterSEQTA+] ThemeManager: Restoring saved color:", theme.selectedColor); settingsState.selectedColor = theme.selectedColor; } else if (theme.defaultColour) { - verboseDebug("[ThemeManager] Using default color:", theme.defaultColour); + verboseDebug("[BetterSEQTA+] ThemeManager: Using default color:", theme.defaultColour); settingsState.selectedColor = theme.defaultColour; } @@ -367,7 +367,7 @@ export class ThemeManager { injectThemeDom(theme.themeDom); } catch (error) { - console.error("[ThemeManager] Error applying theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error applying theme:", error); } } @@ -375,13 +375,13 @@ export class ThemeManager { * Remove theme and restore original settings with view transition */ private async removeTheme(theme: CustomTheme, clearSelectedTheme: boolean = true): Promise { - verboseDebug("[ThemeManager] Removing theme with transition:", theme.name); + verboseDebug("[BetterSEQTA+] ThemeManager: Removing theme with transition:", theme.name); try { await this.applyViewTransition(async () => { await this.removeThemeWithoutTransition(theme, clearSelectedTheme); }); } catch (error) { - console.error("[ThemeManager] Error removing theme with transition:", error); + console.error("[BetterSEQTA+] ThemeManager: Error removing theme with transition:", error); } } @@ -392,11 +392,11 @@ export class ThemeManager { theme: CustomTheme, clearSelectedTheme: boolean = true, ): Promise { - verboseDebug("[ThemeManager] Removing theme:", theme.name); + verboseDebug("[BetterSEQTA+] ThemeManager: Removing theme:", theme.name); try { clearThemeRuntime(); - verboseDebug("[ThemeManager] Removing theme page styles"); + verboseDebug("[BetterSEQTA+] ThemeManager: Removing theme page styles"); clearThemeInPage(); this.lastSyncedImageKey = null; @@ -419,7 +419,7 @@ export class ThemeManager { if (settingsState.originalSelectedColor) { verboseDebug( - "[ThemeManager] Restoring original color:", + "[BetterSEQTA+] ThemeManager: Restoring original color:", settingsState.originalSelectedColor, ); settingsState.selectedColor = settingsState.originalSelectedColor; @@ -427,7 +427,7 @@ export class ThemeManager { if (settingsState.originalDarkMode !== undefined) { verboseDebug( - "[ThemeManager] Restoring original dark mode:", + "[BetterSEQTA+] ThemeManager: Restoring original dark mode:", settingsState.originalDarkMode, ); settingsState.DarkMode = settingsState.originalDarkMode; @@ -440,7 +440,7 @@ export class ThemeManager { } clearCustomThemeAdaptiveCssVariables(); } catch (error) { - console.error("[ThemeManager] Error removing theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error removing theme:", error); } } @@ -472,7 +472,7 @@ export class ThemeManager { * Get list of available themes */ public async getAvailableThemes(): Promise { - verboseDebug("[ThemeManager] Getting available themes"); + verboseDebug("[BetterSEQTA+] ThemeManager: Getting available themes"); try { const themeIds = (await localforage.getItem("customThemes")) as string[] | null; if (!themeIds) { @@ -487,7 +487,7 @@ export class ThemeManager { return themes.filter((theme) => theme !== null); } catch (error) { - console.error("[ThemeManager] Error getting available themes:", error); + console.error("[BetterSEQTA+] ThemeManager: Error getting available themes:", error); return []; } } @@ -496,7 +496,7 @@ export class ThemeManager { * Save or update a theme */ public async saveTheme(theme: LoadedCustomTheme): Promise { - verboseDebug("[ThemeManager] Saving theme:", theme.name); + verboseDebug("[BetterSEQTA+] ThemeManager: Saving theme:", theme.name); try { const existing = (await localforage.getItem(theme.id)) as CustomTheme | null; let toSave = theme; @@ -516,7 +516,7 @@ export class ThemeManager { await localforage.setItem("customThemes", [toSave.id]); } } catch (error) { - console.error("[ThemeManager] Error saving theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error saving theme:", error); } } @@ -524,7 +524,7 @@ export class ThemeManager { * Delete a theme */ public async deleteTheme(themeId: string): Promise { - verboseDebug("[ThemeManager] Deleting theme:", themeId); + verboseDebug("[BetterSEQTA+] ThemeManager: Deleting theme:", themeId); try { const theme = (await localforage.getItem(themeId)) as CustomTheme; if (theme) { @@ -540,7 +540,7 @@ export class ThemeManager { } } } catch (error) { - console.error("[ThemeManager] Error deleting theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error deleting theme:", error); } } @@ -576,7 +576,7 @@ export class ThemeManager { try { await this.downloadAndInstallStoreTheme(themeContent); } catch (error) { - console.error("[ThemeManager] Error downloading theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error downloading theme:", error); } } @@ -592,7 +592,7 @@ export class ThemeManager { try { return await this.downloadAndInstallCommunityTheme(themeContent); } catch (error) { - console.error("[ThemeManager] Error downloading community theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error downloading community theme:", error); throw error; } } @@ -631,7 +631,7 @@ export class ThemeManager { theme_json_url?: string; updated_at?: number; }): Promise { - verboseDebug("[ThemeManager] Downloading community theme:", themeContent.id); + verboseDebug("[BetterSEQTA+] ThemeManager: Downloading community theme:", themeContent.id); if (!themeContent.id) { throw new Error("Missing theme id"); } @@ -655,7 +655,7 @@ export class ThemeManager { const catalogId = themeContent.id; if (themeData.id && themeData.id !== catalogId) { verboseDebug( - "[ThemeManager] Community theme.json id differs from catalog id; using catalog id", + "[BetterSEQTA+] ThemeManager: Community theme.json id differs from catalog id; using catalog id", { catalogId, themeJsonId: themeData.id }, ); } @@ -681,7 +681,7 @@ export class ThemeManager { theme_json_url?: string; updated_at?: number; }): Promise { - verboseDebug("[ThemeManager] Downloading theme:", themeContent.name); + verboseDebug("[BetterSEQTA+] ThemeManager: Downloading theme:", themeContent.name); if (!themeContent.id) { throw new Error("Missing theme id"); } @@ -701,7 +701,7 @@ export class ThemeManager { } themeData = (await this.fetchFromUrl(themeJsonUrl)) as ThemeContent; } catch (apiError) { - console.warn("[ThemeManager] API failed, trying GitHub fallback:", apiError); + console.warn("[BetterSEQTA+] ThemeManager: API failed, trying GitHub fallback:", apiError); const githubUrl = `${this.GITHUB_THEMES_BASE}/${themeContent.id}/theme.json`; themeData = (await this.fetchFromUrl(githubUrl)) as ThemeContent; } @@ -716,7 +716,7 @@ export class ThemeManager { * Install a theme from theme data */ public async installTheme(themeData: ThemeContent, meta?: InstallThemeMeta): Promise { - verboseDebug("[ThemeManager] Installing theme:", themeData.name); + verboseDebug("[BetterSEQTA+] ThemeManager: Installing theme:", themeData.name); try { if (!themeData.id || !themeData.name) { throw new Error("Theme is missing required fields (id or name)"); @@ -750,7 +750,7 @@ export class ThemeManager { try { coverImageBlob = base64ToBlob(stripBase64Prefix(themeData.coverImage), "image/png"); } catch (e) { - console.warn("[ThemeManager] Failed to process cover image:", e); + console.warn("[BetterSEQTA+] ThemeManager: Failed to process cover image:", e); } } @@ -760,7 +760,7 @@ export class ThemeManager { ?.map((image) => { try { if (!image.id || !image.variableName || !image.data) { - console.warn("[ThemeManager] Skipping invalid image:", image); + console.warn("[BetterSEQTA+] ThemeManager: Skipping invalid image:", image); return null; } return { @@ -768,7 +768,7 @@ export class ThemeManager { blob: base64ToBlob(stripBase64Prefix(image.data), "image/png"), }; } catch (e) { - console.warn("[ThemeManager] Failed to process image:", e); + console.warn("[BetterSEQTA+] ThemeManager: Failed to process image:", e); return null; } }) @@ -805,7 +805,7 @@ export class ThemeManager { await this.saveTheme(theme); } catch (error) { - console.error("[ThemeManager] Error installing theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error installing theme:", error); throw error; // Re-throw to handle in UI } } @@ -880,19 +880,19 @@ export class ThemeManager { name: theme.name, updated_at: serverUpdated, }); - verboseInfo("[ThemeManager] Theme auto-updated from store:", theme.name); + verboseInfo("[BetterSEQTA+] ThemeManager: Theme auto-updated from store:", theme.name); if (wasSelected) { await this.setTheme(id, false); } themeUpdates.triggerUpdate(); } catch (err) { - console.error("[ThemeManager] Store theme auto-update failed:", id, err); + console.error("[BetterSEQTA+] ThemeManager: Store theme auto-update failed:", id, err); if (wasSelected) { try { await this.setTheme(id, false); } catch (restoreErr) { console.error( - "[ThemeManager] Failed to restore theme after update error:", + "[BetterSEQTA+] ThemeManager: Failed to restore theme after update error:", restoreErr, ); } @@ -900,7 +900,7 @@ export class ThemeManager { } } } catch (e) { - console.error("[ThemeManager] checkStoreThemeUpdates error:", e); + console.error("[BetterSEQTA+] ThemeManager: checkStoreThemeUpdates error:", e); } finally { this.storeUpdateCheckRunning = false; } @@ -910,11 +910,11 @@ export class ThemeManager { * Share a theme by exporting it */ public async shareTheme(themeId: string): Promise { - verboseDebug("[ThemeManager] Sharing theme:", themeId); + verboseDebug("[BetterSEQTA+] ThemeManager: Sharing theme:", themeId); try { const theme = (await localforage.getItem(themeId)) as LoadedCustomTheme; if (!theme) { - console.error("[ThemeManager] Theme not found"); + console.error("[BetterSEQTA+] ThemeManager: Theme not found"); return; } @@ -951,7 +951,7 @@ export class ThemeManager { this.saveThemeFile(shareableTheme, theme.name || "Unnamed_Theme"); } catch (error) { - console.error("[ThemeManager] Error sharing theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error sharing theme:", error); } } @@ -959,7 +959,7 @@ export class ThemeManager { * Preview a theme without applying it */ public async previewTheme(theme: LoadedCustomTheme): Promise { - verboseDebug("[ThemeManager] Previewing theme:", theme.name); + verboseDebug("[BetterSEQTA+] ThemeManager: Previewing theme:", theme.name); try { const { CustomCSS, CustomImages, defaultColour } = theme; @@ -992,7 +992,7 @@ export class ThemeManager { setCustomThemeAdaptiveCssVariables(theme.adaptiveCssVariables ?? []); void updateAllColors(); } catch (error) { - console.error("[ThemeManager] Error previewing theme:", error); + console.error("[BetterSEQTA+] ThemeManager: Error previewing theme:", error); } } @@ -1000,7 +1000,7 @@ export class ThemeManager { * Update the preview of a theme in real-time (for theme creator) */ public async updatePreview(theme: Partial): Promise { - verboseDebug("[ThemeManager] Updating theme preview"); + verboseDebug("[BetterSEQTA+] ThemeManager: Updating theme preview"); try { // Only store original settings if this is a new theme (not editing) // We can tell it's a new theme if it has no webURL (which is set when a theme is saved/loaded) @@ -1053,7 +1053,7 @@ export class ThemeManager { void updateAllColors(); } catch (error) { - console.error("[ThemeManager] Error updating theme preview:", error); + console.error("[BetterSEQTA+] ThemeManager: Error updating theme preview:", error); } } @@ -1075,7 +1075,7 @@ export class ThemeManager { this.originalPreviewTheme = settingsState.DarkMode; } - verboseDebug("[ThemeManager] Theme creator session started", { + verboseDebug("[BetterSEQTA+] ThemeManager: Theme creator session started", { suspendedThemeId: this.themeCreatorSuspendedThemeId, }); } @@ -1092,7 +1092,7 @@ export class ThemeManager { this.themeCreatorSuspendedThemeId = null; this.clearPreview(); if (restoreId) { - verboseDebug("[ThemeManager] Restoring theme after creator exit:", restoreId); + verboseDebug("[BetterSEQTA+] ThemeManager: Restoring theme after creator exit:", restoreId); await this.setTheme(restoreId, false); } } @@ -1101,7 +1101,7 @@ export class ThemeManager { * Clear theme preview */ public clearPreview(): void { - verboseDebug("[ThemeManager] Clearing theme preview"); + verboseDebug("[BetterSEQTA+] ThemeManager: Clearing theme preview"); try { void syncThemeToPage({ clearPreview: true }); this.lastSyncedImageKey = null; @@ -1114,23 +1114,32 @@ export class ThemeManager { settingsState.selectedColor = storedColor; localStorage.removeItem("originalPreviewColor"); } else if (this.originalPreviewColor !== null) { - verboseDebug("[ThemeManager] Restoring color from memory:", this.originalPreviewColor); + verboseDebug( + "[BetterSEQTA+] ThemeManager: Restoring color from memory:", + this.originalPreviewColor, + ); settingsState.selectedColor = this.originalPreviewColor; - verboseDebug("[ThemeManager] Color after restore:", settingsState.selectedColor); + verboseDebug( + "[BetterSEQTA+] ThemeManager: Color after restore:", + settingsState.selectedColor, + ); } else { - verboseDebug("[ThemeManager] No color to restore found"); + verboseDebug("[BetterSEQTA+] ThemeManager: No color to restore found"); } this.originalPreviewColor = null; if (this.originalPreviewTheme !== null) { - verboseDebug("[ThemeManager] Restoring dark mode:", this.originalPreviewTheme); + verboseDebug( + "[BetterSEQTA+] ThemeManager: Restoring dark mode:", + this.originalPreviewTheme, + ); settingsState.DarkMode = this.originalPreviewTheme; this.originalPreviewTheme = null; } void updateAllColors(); } catch (error) { - console.error("[ThemeManager] Error clearing preview:", error); + console.error("[BetterSEQTA+] ThemeManager: Error clearing preview:", error); } } @@ -1147,7 +1156,7 @@ export class ThemeManager { document.body.removeChild(a); URL.revokeObjectURL(url); } catch (err) { - console.error("[ThemeManager] Error saving theme file:", err); + console.error("[BetterSEQTA+] ThemeManager: Error saving theme file:", err); } } } diff --git a/src/plugins/built-in/themes/theme-runtime.ts b/src/plugins/built-in/themes/theme-runtime.ts index def0f072..2b3f1706 100644 --- a/src/plugins/built-in/themes/theme-runtime.ts +++ b/src/plugins/built-in/themes/theme-runtime.ts @@ -318,7 +318,7 @@ function callBuiltin(name: string): void { try { fn(); } catch (e) { - console.error("[ThemeRuntime] Built-in failed:", name, e); + console.error("[BetterSEQTA+] ThemeRuntime: Built-in failed:", name, e); } } @@ -674,7 +674,7 @@ function mountDevTimePicker(): void { localStorage.setItem(DEV_OVERRIDE_KEY, slider.value); } } catch (e) { - console.warn("[ThemeRuntime] Could not persist time override:", e); + console.warn("[BetterSEQTA+] ThemeRuntime: Could not persist time override:", e); } // Force a full re-publish next tick by clearing the cached bucket; // setCityTime() short-circuits the discrete state when unchanged but diff --git a/src/plugins/built-in/themes/ThemeCreator.ts b/src/plugins/built-in/themes/themeCreator.ts similarity index 94% rename from src/plugins/built-in/themes/ThemeCreator.ts rename to src/plugins/built-in/themes/themeCreator.ts index 04ebd979..e9a47c5a 100644 --- a/src/plugins/built-in/themes/ThemeCreator.ts +++ b/src/plugins/built-in/themes/themeCreator.ts @@ -1,6 +1,6 @@ import { unmount } from "svelte"; import { ThemeManager } from "@/plugins/built-in/themes/theme-manager"; -import { settingsState } from "@/seqta/utils/listeners/SettingsState"; +import { settingsState } from "@/seqta/utils/listeners/settingsState"; import { themeBuilderPanel } from "@/interface/hooks/themeBuilderPanel.svelte"; import { clearThemeCreatorSession, @@ -18,8 +18,8 @@ let currentWidthPx = 400; /** * Open the interactive theme builder docked to the right of the SEQTA page (not inside settings). */ -export async function OpenThemeCreator(themeID: string = "") { - await CloseThemeCreator(); +export async function openThemeCreator(themeID: string = "") { + await closeThemeCreator(); themeBuilderPanel.open(themeID || null); persistThemeCreatorSession(themeID || null); @@ -96,7 +96,7 @@ function positionResizeBar(widthPx: number, resizeBar: HTMLDivElement) { resizeBar.style.right = `${widthPx - 2.5}px`; } -export async function CloseThemeCreator(options?: { restoreTheme?: boolean }) { +export async function closeThemeCreator(options?: { restoreTheme?: boolean }) { const themeManager = ThemeManager.getInstance(); if (options?.restoreTheme === false) { themeManager.discardThemeCreatorRestore(); diff --git a/src/plugins/built-in/timetable/CalendarSyncControl.svelte b/src/plugins/built-in/timetable/CalendarSyncControl.svelte index 3208b32b..a83d4eda 100644 --- a/src/plugins/built-in/timetable/CalendarSyncControl.svelte +++ b/src/plugins/built-in/timetable/CalendarSyncControl.svelte @@ -27,7 +27,7 @@ } from "@/seqta/utils/googleCalendar/types"; import type { OutlookCalendarStatus } from "@/seqta/utils/calendarSync/providerStorage"; import OutlookCalendarIcon from "./OutlookCalendarIcon.svelte"; - import { settingsState } from "@/seqta/utils/listeners/SettingsState"; + import { settingsState } from "@/seqta/utils/listeners/settingsState"; import { formatLastSync, isCalendarSyncModalTarget, diff --git a/src/plugins/built-in/timetable/OutlookCalendarIcon.svelte b/src/plugins/built-in/timetable/OutlookCalendarIcon.svelte index 23bb5e1f..44de7c13 100644 --- a/src/plugins/built-in/timetable/OutlookCalendarIcon.svelte +++ b/src/plugins/built-in/timetable/OutlookCalendarIcon.svelte @@ -23,7 +23,10 @@ gradientTransform="matrix(15,0,0,15,0,0)" > - + - + - + - + - + - - + + - + - + diff --git a/src/plugins/built-in/timetable/calendarSyncUi.ts b/src/plugins/built-in/timetable/calendarSyncUi.ts index ce063ac2..7ca99ad6 100644 --- a/src/plugins/built-in/timetable/calendarSyncUi.ts +++ b/src/plugins/built-in/timetable/calendarSyncUi.ts @@ -1,7 +1,7 @@ import { mount, unmount } from "svelte"; -import { settingsState } from "@/seqta/utils/listeners/SettingsState"; -import { extractSolidColor } from "@/seqta/ui/colors/parseCssColor"; -import { ensureFontLoaded } from "@/seqta/ui/fonts/Manager"; +import { settingsState } from "@/seqta/utils/listeners/settingsState"; +import { copyPageTheme, resolvePageAccentColor } from "@/seqta/ui/colors/pageTheme"; +import { ensureFontLoaded } from "@/seqta/ui/fonts/fontManager"; import { getFontPreset } from "@/seqta/ui/fonts/presets"; import type { GoogleCalendarSyncProgress } from "@/seqta/utils/googleCalendar/types"; import hostStyles from "./calendarSyncHost.css?inline"; @@ -32,25 +32,6 @@ export function syncProgressPercent(progress: GoogleCalendarSyncProgress | null) const CONTROLS_CLASS = "timetable-calendar-controls"; const HOST_STYLE_ID = "bsplus-calendar-sync-host-styles"; -const THEME_CSS_VARS = [ - "--better-main", - "--better-pale", - "--better-light", - "--text-color", - "--background-primary", - "--background-secondary", - "--text-primary", - "--theme-offset-bg", - "--better-sub", -] as const; - -const ACCENT_CSS_VARS = [ - "--better-main", - "--accent-color-value", - "--accentColor", - "--colour-betterseqta-blue", -] as const; - let currentApp: ReturnType | null = null; export function portalToBody(node: HTMLElement) { @@ -78,28 +59,8 @@ export function syncCalendarSyncTheme(target: HTMLElement): void { ensureFontLoaded(fontPreset); target.style.setProperty("--bsplus-cal-font-family", fontPreset.stack); - for (const name of THEME_CSS_VARS) { - const value = - document.documentElement.style.getPropertyValue(name).trim() || - computed.getPropertyValue(name).trim(); - if (value) target.style.setProperty(name, value); - } - - let accent = "#3b82f6"; - for (const name of ACCENT_CSS_VARS) { - const solid = extractSolidColor(computed.getPropertyValue(name)); - if (solid) { - accent = solid; - break; - } - } - if (accent === "#3b82f6") { - const fromSettings = settingsState.selectedColor?.trim(); - if (fromSettings) { - const solid = extractSolidColor(fromSettings); - if (solid) accent = solid; - } - } + copyPageTheme(target); + const accent = resolvePageAccentColor("#3b82f6"); target.style.setProperty("--bsplus-cal-accent", accent); target.style.setProperty("--better-main", accent); target.classList.toggle("dark", dark); diff --git a/src/plugins/built-in/timetable/index.ts b/src/plugins/built-in/timetable/index.ts index 5e6f083c..60f1d90d 100644 --- a/src/plugins/built-in/timetable/index.ts +++ b/src/plugins/built-in/timetable/index.ts @@ -1,4 +1,4 @@ -import { settingsState } from "@/seqta/utils/listeners/SettingsState"; +import { settingsState } from "@/seqta/utils/listeners/settingsState"; import type { Plugin } from "../../core/types"; import { attachTimetableColorisRecovery } from "@/seqta/utils/patchSeqtaMenuUpdateColours"; import { convertTo12HourFormat } from "@/seqta/utils/convertTo12HourFormat"; diff --git a/src/plugins/built-in/timetableClassmates/ClassmatesToolbarChip.svelte b/src/plugins/built-in/timetableClassmates/ClassmatesToolbarChip.svelte index 530543de..0f6154a5 100644 --- a/src/plugins/built-in/timetableClassmates/ClassmatesToolbarChip.svelte +++ b/src/plugins/built-in/timetableClassmates/ClassmatesToolbarChip.svelte @@ -1,6 +1,6 @@