schoolbox web extension :)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "refactor: disable auto imports"

This reverts commit fdbaccaa9ca3f4aae3f27b2d7c0f57731e875630.

willow 51e8184c 65d187b8

+10 -87
-4
src/entrypoints/background.ts
··· 1 - import type { Browser } from "#imports"; 2 - import { browser, defineBackground, storage } from "#imports"; 3 - import { logger } from "@/utils/logger"; 4 - import { globalSettings, updated } from "@/utils/storage"; 5 1 import semver from "semver"; 6 2 7 3 export default defineBackground(() => {
-5
src/entrypoints/end.content.ts
··· 1 - import { browser, defineContentScript } from "#imports"; 2 - import { EXCLUDE_MATCHES } from "@/utils/constants"; 3 - import { logger } from "@/utils/logger"; 4 - import { globalSettings, schoolboxUrls } from "@/utils/storage"; 5 - 6 1 export default defineContentScript({ 7 2 matches: ["<all_urls>"], 8 3 runAt: "document_end",
-2
src/entrypoints/plugins.content.ts
··· 1 - import { defineContentScript } from "#imports"; 2 - import { EXCLUDE_MATCHES } from "@/utils/constants"; 3 1 import homepageSwitcher from "./plugins/homepageSwitcher"; 4 2 import modernIcons from "./plugins/modernIcons"; 5 3 import progressBar from "./plugins/progressBar";
-3
src/entrypoints/plugins/homepageSwitcher.ts
··· 1 - import { browser } from "#imports"; 2 - import { definePlugin } from "@/utils/plugin"; 3 - 4 1 export default function init() { 5 2 definePlugin( 6 3 "homepageSwitcher",
-2
src/entrypoints/plugins/modernIcons/index.ts
··· 1 - import { injectStyles } from "@/utils"; 2 - import { definePlugin } from "@/utils/plugin"; 3 1 import styleText from "./styles.css?inline"; 4 2 5 3 export default function init() {
-4
src/entrypoints/plugins/progressBar/index.ts
··· 1 - import { injectStyles } from "@/utils"; 2 - import type { Period } from "@/utils/periodUtils"; 3 - import { getListOfPeriods } from "@/utils/periodUtils"; 4 - import { definePlugin } from "@/utils/plugin"; 5 1 import styleText from "./styles.css?inline"; 6 2 7 3 export default function init() {
-3
src/entrypoints/plugins/scrollPeriod.ts
··· 1 - import { getCurrentPeriod } from "@/utils/periodUtils"; 2 - import { definePlugin } from "@/utils/plugin"; 3 - 4 1 export default function init() { 5 2 definePlugin( 6 3 "scrollPeriod",
-2
src/entrypoints/plugins/scrollSegments/index.ts
··· 1 - import { injectStyles } from "@/utils"; 2 - import { definePlugin } from "@/utils/plugin"; 3 1 import styleText from "./styles.css?inline"; 4 2 5 3 export default function init() {
-3
src/entrypoints/plugins/subheader.ts
··· 1 - import { getCurrentPeriod } from "@/utils/periodUtils"; 2 - import { definePlugin } from "@/utils/plugin"; 3 - 4 1 export default function init() { 5 2 definePlugin( 6 3 "subheader",
-2
src/entrypoints/plugins/tabTitle.ts
··· 1 - import { definePlugin } from "@/utils/plugin"; 2 - 3 1 export default function init() { 4 2 definePlugin( 5 3 "tabTitle",
+4 -6
src/entrypoints/popup/App.svelte
··· 1 1 <script lang="ts"> 2 - import { flavors } from "@catppuccin/palette"; 3 - import { globalSettings, needsRefresh, schoolboxUrls, updated } from "@/utils/storage"; 4 - import { RotateCw } from "@lucide/svelte"; 5 - import { logger } from "@/utils/logger"; 6 - import { browser, onMount } from "#imports"; 7 - 8 2 import Router from "svelte-spa-router"; 9 3 import active from "svelte-spa-router/active"; 10 4 import Home from "./routes/Home.svelte"; ··· 12 6 import Themes from "./routes/Themes.svelte"; 13 7 import Snippets from "./routes/Snippets.svelte"; 14 8 import Banner from "./components/Banner.svelte"; 9 + 10 + import { flavors } from "@catppuccin/palette"; 11 + import { needsRefresh } from "@/utils/storage"; 12 + import { RotateCw } from "@lucide/svelte"; 15 13 16 14 const routes = { 17 15 "/": Home,
-2
src/entrypoints/popup/components/Footer.svelte
··· 1 1 <script lang="ts"> 2 2 import { onMount } from "svelte"; 3 - import { browser } from "#imports"; 4 - import { updated } from "@/utils/storage"; 5 3 import Button from "./inputs/Button.svelte"; 6 4 import { RotateCcw, Globe, GitBranch } from "@lucide/svelte"; 7 5
-1
src/entrypoints/popup/components/Motd.svelte
··· 1 1 <script lang="ts"> 2 - import { motd } from "@/utils/storage"; 3 2 import { onMount } from "svelte"; 4 3 5 4 onMount(async () => {
-1
src/entrypoints/popup/routes/Home.svelte
··· 1 1 <script lang="ts"> 2 - import { globalSettings } from "@/utils/storage"; 3 2 import Footer from "../components/Footer.svelte"; 4 3 import Motd from "../components/Motd.svelte"; 5 4
+1 -3
src/entrypoints/popup/routes/Plugins.svelte
··· 1 1 <script lang="ts"> 2 - import type { PluginId } from "@/utils/storage"; 3 - import { globalSettings, plugins } from "@/utils/storage"; 4 - import { Settings } from "@lucide/svelte"; 5 2 import Title from "../components/Title.svelte"; 6 3 import Button from "../components/inputs/Button.svelte"; 4 + import { Settings } from "@lucide/svelte"; 7 5 import Modal from "../components/Modal.svelte"; 8 6 import Toggle from "../components/inputs/Toggle.svelte"; 9 7 import Slider from "../components/inputs/Slider.svelte";
+1 -4
src/entrypoints/popup/routes/Snippets.svelte
··· 1 1 <script lang="ts"> 2 - import type { SnippetId, UserSnippet } from "@/utils/storage"; 3 - import { globalSettings, snippets } from "@/utils/storage"; 4 - 5 2 import Title from "../components/Title.svelte"; 6 3 import Toggle from "../components/inputs/Toggle.svelte"; 7 4 import TextInput from "../components/inputs/TextInput.svelte"; ··· 74 71 </div> 75 72 76 73 <div class="user-snippets-container w-full"> 77 - {#each Object.entries(globalSettings.state.userSnippets as Record<SnippetId, UserSnippet>) as [id, snippet] (id)} 74 + {#each Object.entries(globalSettings.state.userSnippets as Record<string, UserSnippet>) as [id, snippet] (id)} 78 75 <div class="group my-4 w-full"> 79 76 <Toggle 80 77 {id}
+1 -6
src/entrypoints/popup/routes/Themes.svelte
··· 1 1 <script lang="ts"> 2 - import { browser } from "#imports"; 3 - import type { LogoId } from "@/utils/storage"; 4 - import { globalSettings } from "@/utils/storage"; 5 - import { LOGO_INFO } from "@/utils/constants"; 6 - import { Palette } from "@lucide/svelte"; 7 - 8 2 import Title from "../components/Title.svelte"; 9 3 import Modal from "../components/Modal.svelte"; 10 4 import Button from "../components/inputs/Button.svelte"; 11 5 import Toggle from "../components/inputs/Toggle.svelte"; 6 + import { Palette } from "@lucide/svelte"; 12 7 13 8 const flavours = ["latte", "frappe", "macchiato", "mocha"]; 14 9 const accents = [
-3
src/entrypoints/snippets.content.ts
··· 1 - import { defineContentScript } from "#imports"; 2 - import { EXCLUDE_MATCHES } from "@/utils/constants"; 3 - import { defineSnippet } from "@/utils/snippet"; 4 1 import censor from "./snippets/censor.css?inline"; 5 2 import hidePfp from "./snippets/hidePfp/styles.css?inline"; 6 3 import hidePwaPrompt from "./snippets/hidePwaPrompt.css?inline";
-5
src/entrypoints/start.content.ts
··· 1 - import { browser, defineContentScript } from "#imports"; 2 - import { injectCatppuccin, injectLogo, injectStylesheet, injectUserSnippets } from "@/utils"; 3 - import { EXCLUDE_MATCHES, LOGO_INFO } from "@/utils/constants"; 4 - import type { LogoId } from "@/utils/storage"; 5 - import { globalSettings, schoolboxUrls } from "@/utils/storage"; 6 1 import cssUrl from "./catppuccin.css?url"; 7 2 8 3 export default defineContentScript({
-2
src/utils/constants.ts
··· 1 - import type { LogoId, LogoInfo } from "./storage"; 2 - 3 1 export const EXCLUDE_MATCHES: string[] = ["*://*/learning/quiz/*"]; 4 2 export const LOGO_INFO: Record<LogoId, LogoInfo> = { 5 3 default: {
+1 -3
src/utils/index.ts
··· 1 - import { browser } from "#imports"; 1 + export * from "./storage"; 2 2 import { flavorEntries } from "@catppuccin/palette"; 3 - import { logger } from "./logger"; 4 - import type { LogoInfo, UserSnippet } from "./storage"; 5 3 6 4 export function injectStyles(styleText: string) { 7 5 logger.info(`[content-utils] Injecting styles`);
-2
src/utils/periodUtils.ts
··· 1 1 // these utility functions are intended to be used on the dashboard, as that is where the timetable is displayed 2 2 3 - import { logger } from "./logger"; 4 - 5 3 interface PeriodHeader { 6 4 name: string; 7 5 time: {
-5
src/utils/plugin.ts
··· 1 - import { logger } from "./logger"; 2 - import type { PluginId, PluginSetting, Slider } from "./storage"; 3 - import { globalSettings, plugins, schoolboxUrls } from "./storage"; 4 - 5 1 export async function definePlugin( 6 2 pluginId: PluginId, 7 3 callback: (settings?: { toggle: Record<string, boolean>; slider: Record<string, Slider> }) => Promise<void> | void, ··· 58 54 } 59 55 60 56 function getSettingsValues(settings?: Record<string, PluginSetting>) { 61 - logger.info("Getting settings values for settings:", settings); 62 57 if (!settings) return undefined; 63 58 64 59 const result: {
-5
src/utils/snippet.ts
··· 1 - import { injectStyles } from "."; 2 - import { logger } from "./logger"; 3 - import type { SnippetId } from "./storage"; 4 - import { globalSettings, schoolboxUrls, snippets } from "./storage"; 5 - 6 1 export async function defineSnippet(snippetId: SnippetId, styleText: string) { 7 2 const snippet = await snippets[snippetId].toggle.storage.getValue(); 8 3
+1 -2
src/utils/storage/global.ts
··· 1 - import { storage } from "#imports"; 2 1 import { StorageState } from "./state.svelte"; 3 - import type * as Types from "./types"; 2 + import * as Types from "./types"; 4 3 5 4 export const globalSettings = new StorageState<Types.Settings>( 6 5 storage.defineItem<Types.Settings>("local:globalSettings", {
+1 -2
src/utils/storage/plugins.ts
··· 1 - import { storage } from "#imports"; 2 1 import { StorageState } from "./state.svelte"; 3 - import type * as Types from "./types"; 2 + import * as Types from "./types"; 4 3 5 4 export const pluginConfig: Record<Types.PluginId, Types.PluginConfig> = { 6 5 subheader: {
-1
src/utils/storage/snippets.ts
··· 1 - import { storage } from "#imports"; 2 1 import { StorageState } from "./state.svelte"; 3 2 import type * as Types from "./types"; 4 3
-3
src/utils/storage/state.svelte.ts
··· 1 - import type { WxtStorageItem } from "#imports"; 2 - import { needsRefresh } from "./global"; 3 - 4 1 export class StorageState<T> { 5 2 public state; 6 3
-1
wxt.config.ts
··· 18 18 srcDir: "src", 19 19 outDir: "dist", 20 20 modules: ["@wxt-dev/module-svelte"], 21 - imports: false, 22 21 vite: () => ({ 23 22 plugins: [tailwindcss()], 24 23 }),