diff --git a/entry-app-webview.html b/entry-app-webview.html index 7e4280cc..d8789222 100644 --- a/entry-app-webview.html +++ b/entry-app-webview.html @@ -7,7 +7,7 @@ name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> - + Userscripts App diff --git a/entry-ext-action-popup.html b/entry-ext-action-popup.html index c329fa52..8d65c1ca 100644 --- a/entry-ext-action-popup.html +++ b/entry-ext-action-popup.html @@ -3,7 +3,7 @@ - + Userscripts popup diff --git a/entry-ext-extension-page.html b/entry-ext-extension-page.html index f275bcb8..24b226cb 100644 --- a/entry-ext-extension-page.html +++ b/entry-ext-extension-page.html @@ -3,7 +3,7 @@ - + Userscripts page diff --git a/eslint.config.js b/eslint.config.js index 7471ce7d..50f7e759 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -40,7 +40,7 @@ export default [ /** @see {@link https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options} */ { - files: ["scripts/**/*.js"], + files: ["*.js", "scripts/**/*.js"], languageOptions: { globals: { ...globals.node, @@ -48,7 +48,7 @@ export default [ }, }, { - files: ["src/{app,dev}/**/*.{js,svelte}"], + files: ["src/{app,dev,shared}/**/*.{js,svelte}"], languageOptions: { globals: { ...globals.browser, diff --git a/etc/uilayout.sketch b/etc/uilayout.sketch index 3c513380..f86be3ba 100644 Binary files a/etc/uilayout.sketch and b/etc/uilayout.sketch differ diff --git a/public/ext/safari-15/images/icon-128.png b/public/ext/safari-15/images/icon-128.png index a775ed07..f0030ddd 100644 Binary files a/public/ext/safari-15/images/icon-128.png and b/public/ext/safari-15/images/icon-128.png differ diff --git a/public/ext/safari-15/images/icon-256.png b/public/ext/safari-15/images/icon-256.png index b3a52bf7..dea9320e 100644 Binary files a/public/ext/safari-15/images/icon-256.png and b/public/ext/safari-15/images/icon-256.png differ diff --git a/public/ext/safari-15/images/icon-48.png b/public/ext/safari-15/images/icon-48.png index a6fd3c6a..3955fd6b 100644 Binary files a/public/ext/safari-15/images/icon-48.png and b/public/ext/safari-15/images/icon-48.png differ diff --git a/public/ext/safari-15/images/icon-512.png b/public/ext/safari-15/images/icon-512.png index 7458bb07..3d0c5854 100644 Binary files a/public/ext/safari-15/images/icon-512.png and b/public/ext/safari-15/images/icon-512.png differ diff --git a/public/ext/safari-15/images/icon-64.png b/public/ext/safari-15/images/icon-64.png new file mode 100644 index 00000000..d1ffa334 Binary files /dev/null and b/public/ext/safari-15/images/icon-64.png differ diff --git a/public/ext/safari-15/images/icon-96.png b/public/ext/safari-15/images/icon-96.png index 7bfd59c1..411a520a 100644 Binary files a/public/ext/safari-15/images/icon-96.png and b/public/ext/safari-15/images/icon-96.png differ diff --git a/public/ext/safari-15/images/toolbar-icon-16.png b/public/ext/safari-15/images/toolbar-icon-16.png index 5173e1e2..cee9abb0 100644 Binary files a/public/ext/safari-15/images/toolbar-icon-16.png and b/public/ext/safari-15/images/toolbar-icon-16.png differ diff --git a/public/ext/safari-15/images/toolbar-icon-32.png b/public/ext/safari-15/images/toolbar-icon-32.png index ae1ef8f9..1de18ba5 100644 Binary files a/public/ext/safari-15/images/toolbar-icon-32.png and b/public/ext/safari-15/images/toolbar-icon-32.png differ diff --git a/public/ext/safari-15/images/toolbar-icon-48.png b/public/ext/safari-15/images/toolbar-icon-48.png new file mode 100644 index 00000000..e1367b2b Binary files /dev/null and b/public/ext/safari-15/images/toolbar-icon-48.png differ diff --git a/public/ext/safari-15/manifest.json b/public/ext/safari-15/manifest.json index 16e415e2..1f64988a 100644 --- a/public/ext/safari-15/manifest.json +++ b/public/ext/safari-15/manifest.json @@ -6,6 +6,7 @@ "version": "_VERSION_", "icons": { "48": "images/icon-48.png", + "64": "images/icon-64.png", "96": "images/icon-96.png", "128": "images/icon-128.png", "256": "images/icon-256.png", @@ -19,7 +20,8 @@ "default_popup": "dist/entry-ext-action-popup.html", "default_icon": { "16": "images/toolbar-icon-16.png", - "32": "images/toolbar-icon-32.png" + "32": "images/toolbar-icon-32.png", + "48": "images/toolbar-icon-48.png" } }, "options_ui": { diff --git a/scripts/utils.js b/scripts/utils.js index 4b7d04c1..e0069126 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -191,4 +191,11 @@ export const baseConfig = { "import.meta.env.GIT_TAG": JSON.stringify(gitTag), "import.meta.env.GIT_COMMIT": JSON.stringify(gitCommit), }, + resolve: { + alias: { + // NOTE: Don't forget to modify the `paths` in `jsconfig.json` also + "@shared": fileURLToPath(new URL("../src/shared", import.meta.url)), + "@ext": fileURLToPath(new URL("../src/ext/shared", import.meta.url)), + }, + }, }; diff --git a/src/app/App.svelte b/src/app/App.svelte index 26c0df01..e029cd50 100644 --- a/src/app/App.svelte +++ b/src/app/App.svelte @@ -1,10 +1,10 @@ + + + + + + + + + diff --git a/src/ext/shared/Components/Tag.svelte b/src/shared/Components/Tag.svelte similarity index 100% rename from src/ext/shared/Components/Tag.svelte rename to src/shared/Components/Tag.svelte diff --git a/src/ext/shared/Components/Toggle.svelte b/src/shared/Components/Toggle.svelte similarity index 96% rename from src/ext/shared/Components/Toggle.svelte rename to src/shared/Components/Toggle.svelte index c803ee8a..9b1d338f 100644 --- a/src/ext/shared/Components/Toggle.svelte +++ b/src/shared/Components/Toggle.svelte @@ -37,7 +37,7 @@ } span { - background-color: var(--color-black); + background-color: var(--color-grey); border-radius: 0.625em; display: block; height: 100%; diff --git a/src/ext/shared/img/icon-arrow-down.svg b/src/shared/img/icon-arrow-down.svg similarity index 100% rename from src/ext/shared/img/icon-arrow-down.svg rename to src/shared/img/icon-arrow-down.svg diff --git a/src/ext/shared/img/icon-arrow-left.svg b/src/shared/img/icon-arrow-left.svg similarity index 100% rename from src/ext/shared/img/icon-arrow-left.svg rename to src/shared/img/icon-arrow-left.svg diff --git a/src/ext/shared/img/icon-arrow-up.svg b/src/shared/img/icon-arrow-up.svg similarity index 100% rename from src/ext/shared/img/icon-arrow-up.svg rename to src/shared/img/icon-arrow-up.svg diff --git a/src/ext/shared/img/icon-bug.svg b/src/shared/img/icon-bug.svg similarity index 100% rename from src/ext/shared/img/icon-bug.svg rename to src/shared/img/icon-bug.svg diff --git a/src/ext/shared/img/icon-check.svg b/src/shared/img/icon-check.svg similarity index 100% rename from src/ext/shared/img/icon-check.svg rename to src/shared/img/icon-check.svg diff --git a/src/ext/shared/img/icon-clear.svg b/src/shared/img/icon-clear.svg similarity index 100% rename from src/ext/shared/img/icon-clear.svg rename to src/shared/img/icon-clear.svg diff --git a/src/ext/shared/img/icon-close.svg b/src/shared/img/icon-close.svg similarity index 100% rename from src/ext/shared/img/icon-close.svg rename to src/shared/img/icon-close.svg diff --git a/src/ext/shared/img/icon-download.svg b/src/shared/img/icon-download.svg similarity index 100% rename from src/ext/shared/img/icon-download.svg rename to src/shared/img/icon-download.svg diff --git a/src/ext/shared/img/icon-edit.svg b/src/shared/img/icon-edit.svg similarity index 100% rename from src/ext/shared/img/icon-edit.svg rename to src/shared/img/icon-edit.svg diff --git a/src/ext/shared/img/icon-error.svg b/src/shared/img/icon-error.svg similarity index 100% rename from src/ext/shared/img/icon-error.svg rename to src/shared/img/icon-error.svg diff --git a/src/ext/shared/img/icon-info.svg b/src/shared/img/icon-info.svg similarity index 100% rename from src/ext/shared/img/icon-info.svg rename to src/shared/img/icon-info.svg diff --git a/src/ext/shared/img/icon-loader.svg b/src/shared/img/icon-loader.svg similarity index 92% rename from src/ext/shared/img/icon-loader.svg rename to src/shared/img/icon-loader.svg index b75290bb..64cc3f45 100644 --- a/src/ext/shared/img/icon-loader.svg +++ b/src/shared/img/icon-loader.svg @@ -1,4 +1,4 @@ - + diff --git a/src/ext/shared/img/icon-loupe.svg b/src/shared/img/icon-loupe.svg similarity index 100% rename from src/ext/shared/img/icon-loupe.svg rename to src/shared/img/icon-loupe.svg diff --git a/src/ext/shared/img/icon-open.svg b/src/shared/img/icon-open.svg similarity index 100% rename from src/ext/shared/img/icon-open.svg rename to src/shared/img/icon-open.svg diff --git a/src/ext/shared/img/icon-plus.svg b/src/shared/img/icon-plus.svg similarity index 100% rename from src/ext/shared/img/icon-plus.svg rename to src/shared/img/icon-plus.svg diff --git a/src/ext/shared/img/icon-power.svg b/src/shared/img/icon-power.svg similarity index 100% rename from src/ext/shared/img/icon-power.svg rename to src/shared/img/icon-power.svg diff --git a/src/ext/shared/img/icon-refresh.svg b/src/shared/img/icon-refresh.svg similarity index 100% rename from src/ext/shared/img/icon-refresh.svg rename to src/shared/img/icon-refresh.svg diff --git a/src/ext/shared/img/icon-settings.svg b/src/shared/img/icon-settings.svg similarity index 100% rename from src/ext/shared/img/icon-settings.svg rename to src/shared/img/icon-settings.svg diff --git a/src/ext/shared/img/icon-sort.svg b/src/shared/img/icon-sort.svg similarity index 100% rename from src/ext/shared/img/icon-sort.svg rename to src/shared/img/icon-sort.svg diff --git a/src/ext/shared/img/icon-sync.svg b/src/shared/img/icon-sync.svg similarity index 100% rename from src/ext/shared/img/icon-sync.svg rename to src/shared/img/icon-sync.svg diff --git a/src/ext/shared/img/icon-trash.svg b/src/shared/img/icon-trash.svg similarity index 100% rename from src/ext/shared/img/icon-trash.svg rename to src/shared/img/icon-trash.svg diff --git a/src/ext/shared/img/icon-update.svg b/src/shared/img/icon-update.svg similarity index 100% rename from src/ext/shared/img/icon-update.svg rename to src/shared/img/icon-update.svg diff --git a/src/ext/shared/img/icon-warn.svg b/src/shared/img/icon-warn.svg similarity index 100% rename from src/ext/shared/img/icon-warn.svg rename to src/shared/img/icon-warn.svg diff --git a/src/app/img/icon.png b/src/shared/img/logo-icon.png similarity index 100% rename from src/app/img/icon.png rename to src/shared/img/logo-icon.png diff --git a/src/shared/jsconfig.json b/src/shared/jsconfig.json new file mode 100644 index 00000000..eb649856 --- /dev/null +++ b/src/shared/jsconfig.json @@ -0,0 +1,30 @@ +// https://code.visualstudio.com/docs/languages/jsconfig +// https://www.typescriptlang.org/docs/handbook/tsconfig-json.html +// https://www.typescriptlang.org/tsconfig + +// https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html +// https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html + +{ + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "bundler", + + "verbatimModuleSyntax": true, + "isolatedModules": true, + "resolveJsonModule": true, + + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "skipLibCheck": true, + "sourceMap": true, + + "paths": { + "@shared/*": ["./*"] + } + }, + "include": ["**/*.d.ts", "**/*.js", "**/*.svelte"] +} diff --git a/src/ext/shared/reset.css b/src/shared/reset.css similarity index 100% rename from src/ext/shared/reset.css rename to src/shared/reset.css diff --git a/src/shared/variables.css b/src/shared/variables.css index 04ab9458..7b1b14e2 100644 --- a/src/shared/variables.css +++ b/src/shared/variables.css @@ -1,38 +1,50 @@ +/* Base styles */ :root { + /* Layout variables */ --border-radius: 0.188rem; - --box-shadow: 0 0.5rem 1rem 0 rgb(0 0 0 / 0.25); - --color-bg-primary: #323639; - --color-bg-secondary: #2f3337; - --color-script-highlighted: #364049; /* rgba(116, 178, 235, 0.1); */ - --color-black: #1d2023; - --color-blue: #74b1eb; - --color-green: #60f36c; - --color-grey: rgb(255 255 255 / 0.15); - --color-red: #ff453a; - --color-yellow: #e4f360; - --letter-spacing-large: -0.031rem; + --font-family: -apple-system, "Helvetica Neue", "Helvetica", sans-serif; --letter-spacing-default: -0.029rem; + --letter-spacing-large: -0.031rem; --letter-spacing-medium: -0.018rem; --letter-spacing-small: -0.008rem; --opacity-disabled: 0.3; - --text-color-primary: rgb(255 255 255); - --text-color-secondary: rgb(255 255 255 / 0.65); - --text-color-disabled: rgb(255 255 255 / 0.4); - --font-family: -apple-system, "Helvetica Neue", "Helvetica", sans-serif; --text-default: 1rem/1.5rem var(--font-family); --text-large: 1.25rem/1.5rem var(--font-family); --text-medium: 0.875rem/1.313rem var(--font-family); --text-small: 0.719rem/1rem var(--font-family); - /* editor variables */ + /* Editor layout variables */ --editor-font: monaco, monospace; --editor-font-size: 14px; --editor-line-height: 24px; - --editor-invisible: rgb(255 255 255 / 0.15); --editor-active-line: var(--color-bg-secondary); + --editor-error: var(--color-red); + --editor-non-matching-bracket: var(--editor-error); --editor-selected-bg: rgb(116 178 235 / 0.35); --editor-matched-highlight: rgb(116 178 235 / 0.2); --editor-search-highlight: rgb(255 166 0 / 0.3); + + /* Dark theme (default) */ + --color-bg-primary: #323639; + --color-bg-secondary: #2f3337; + --color-bg-theme: var(--color-black); + --color-script-highlighted: #364049; + --color-black: #1d2023; + --color-white: #fff; + --color-blue: #74b1eb; + --color-green: #60f36c; + --color-grey: rgb(255 255 255 / 0.15); + --color-red: #ff453a; + --color-yellow: #e4f360; + --text-color-primary: rgb(255 255 255); + --text-color-secondary: rgb(255 255 255 / 0.65); + --text-color-disabled: rgb(255 255 255 / 0.4); + --box-shadow: 0 0.5rem 1rem 0 rgb(0 0 0 / 0.25); + --button-color: var(--color-black); + --border-color: var(--color-black); + + /* Editor dark theme colors */ + --editor-invisible: rgb(255 255 255 / 0.15); --editor-number: #77e26a; --editor-comment: rgb(255 255 255 / 0.35); --editor-def: #efc371; @@ -43,9 +55,49 @@ --editor-property: #e86c8a; --editor-string: #f5eea2; --editor-string-2: #cdabff; - --editor-error: var(--color-red); --editor-cursor: #e3e7eb; --editor-matching-bracket-color: #fff; --editor-matching-bracket-border: var(--editor-number); - --editor-non-matching-bracket: var(--editor-error); + --editor-blurred-background: rgba(50 54 57 / 0.65); +} + +/* Light theme */ +@media (prefers-color-scheme: light) { + :root { + color-scheme: light dark; + --color-bg-primary: #fafafa; + --color-bg-secondary: #f1f1f1; + --color-bg-theme: var(--color-white); + --color-script-highlighted: #e2ebf3; + --color-black: #333; + --color-white: #fff; + --color-blue: #317eff; + --color-green: #2bb239; + --color-grey: rgb(51 51 51 / 0.15); + --color-red: #ff453a; + --color-yellow: #b8722c; + --text-color-primary: rgb(51 51 51); + --text-color-secondary: rgb(51 51 51 / 0.65); + --text-color-disabled: rgb(51 51 51 / 0.35); + --box-shadow: 0 0.25rem 1rem 0 rgb(0 0 0 / 0.15); + --button-color: var(--color-white); + --border-color: var(--color-grey); + + /* Editor light theme colors */ + --editor-invisible: rgb(51 51 51 / 0.15); + --editor-number: var(--color-green); + --editor-comment: var(--text-color-disabled); + --editor-def: #b86d17; + --editor-default: #777; + --editor-keyword: #3a68ff; + --editor-atom: #00adad; + --editor-operator: #8c99a7; + --editor-property: #ff453a; + --editor-string: var(--editor-atom); + --editor-string-2: #a34fe6; + --editor-cursor: #7e7e7f; + --editor-matching-bracket-color: var(--text-color-primary); + --editor-matching-bracket-border: #ff00ea; + --editor-blurred-background: rgba(255 255 255 / 0.65); /* eeeeeea6 */ + } } diff --git a/src/shared/vite-env.d.ts b/src/shared/vite-env.d.ts new file mode 100644 index 00000000..4078e747 --- /dev/null +++ b/src/shared/vite-env.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/vite.config.js b/vite.config.js index f7cf2b45..56037d79 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,5 +1,6 @@ import { defineConfig } from "vite"; import { svelte } from "@sveltejs/vite-plugin-svelte"; +import { baseConfig } from "./scripts/utils.js"; /** * About `inline-svg` @@ -22,4 +23,6 @@ export default defineConfig({ publicDir: "public/ext/vendor/", plugins: [svelte()], base: "./", + define: baseConfig.define, + resolve: baseConfig.resolve, }); diff --git a/xcode/App-Shared/Shared.xcassets/USBackgroundColor.colorset/Contents.json b/xcode/App-Shared/Shared.xcassets/USBackgroundColor.colorset/Contents.json index fad1a4bb..59ca3d0d 100644 --- a/xcode/App-Shared/Shared.xcassets/USBackgroundColor.colorset/Contents.json +++ b/xcode/App-Shared/Shared.xcassets/USBackgroundColor.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x39", - "green" : "0x36", - "red" : "0x32" + "blue" : "0xFA", + "green" : "0xFA", + "red" : "0xFA" } }, "idiom" : "universal" diff --git a/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/Contents.json b/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/Contents.json index 8e400851..ae847694 100644 --- a/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/Contents.json +++ b/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/Contents.json @@ -1,7 +1,17 @@ { "images" : [ { - "filename" : "LaunchScreen.pdf", + "filename" : "LaunchScreenLightCentered.pdf", + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "LaunchScreenDarkCentered.pdf", "idiom" : "universal" } ], diff --git a/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/LaunchScreen.pdf b/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/LaunchScreen.pdf deleted file mode 100644 index 51a0b7dc..00000000 Binary files a/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/LaunchScreen.pdf and /dev/null differ diff --git a/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/LaunchScreenDarkCentered.pdf b/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/LaunchScreenDarkCentered.pdf new file mode 100644 index 00000000..244ab0ef Binary files /dev/null and b/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/LaunchScreenDarkCentered.pdf differ diff --git a/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/LaunchScreenLightCentered.pdf b/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/LaunchScreenLightCentered.pdf new file mode 100644 index 00000000..936d8c04 Binary files /dev/null and b/xcode/App-iOS/Assets.xcassets/LaunchScreen.imageset/LaunchScreenLightCentered.pdf differ diff --git a/xcode/App-iOS/Base.lproj/LaunchScreen.storyboard b/xcode/App-iOS/Base.lproj/LaunchScreen.storyboard index f3b08bf5..178ccbc4 100644 --- a/xcode/App-iOS/Base.lproj/LaunchScreen.storyboard +++ b/xcode/App-iOS/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,10 @@ - + - + + + @@ -21,7 +23,7 @@ - + @@ -31,5 +33,8 @@ + + + diff --git a/xcode/App-iOS/Info.plist b/xcode/App-iOS/Info.plist index b6d4f637..51a0de5f 100644 --- a/xcode/App-iOS/Info.plist +++ b/xcode/App-iOS/Info.plist @@ -35,7 +35,7 @@ UIStatusBarStyle - UIStatusBarStyleLightContent + UIStatusBarStyleDefault UIViewControllerBasedStatusBarAppearance UIFileSharingEnabled