diff --git a/rspack.config.js b/rspack.config.js index 9bb41530b..4cf1ebf9a 100644 --- a/rspack.config.js +++ b/rspack.config.js @@ -89,9 +89,15 @@ module.exports = (env, options) => { ], type: 'javascript/auto', }, + { + test: /\.svg$/, + resourceQuery: /raw/, + type: 'asset/source', + }, // Asset files { test: /\.(png|svg|jpg|jpeg|ico|ttf|webp|eot|woff|webm|mp4|wav)(\?.*)?$/, + resourceQuery: { not: [/raw/] }, type: 'asset/resource', }, // Regular CSS/SCSS files diff --git a/src/cm/themes/noctisLilac.js b/src/cm/themes/noctisLilac.js index c8665b661..c32479274 100644 --- a/src/cm/themes/noctisLilac.js +++ b/src/cm/themes/noctisLilac.js @@ -11,7 +11,7 @@ export const config = { cursor: "#5c49e9", dropdownBackground: "#f2f1f8", dropdownBorder: "#e1def3", - activeLine: "#e1def3", + activeLine: "#e1def355", lineNumber: "#0c006b70", lineNumberActive: "#0c006b", matchingBracket: "#d5d1f2", diff --git a/src/dialogs/loader.js b/src/dialogs/loader.js index 0c69daf4f..7ada9e5f5 100644 --- a/src/dialogs/loader.js +++ b/src/dialogs/loader.js @@ -2,6 +2,7 @@ import DOMPurify from "dompurify"; import Ref from "html-tag-js/ref"; import actionStack from "lib/actionStack"; import restoreTheme from "lib/restoreTheme"; +import tailSpinSvg from "res/tail-spin.svg?raw"; let loaderIsImmortal = false; let onCancelCallback = null; @@ -51,7 +52,7 @@ function create(titleText, message = "", options = {}) { {titleText} - +
- + - - - + + + @@ -18,7 +18,7 @@ dur="0.9s" repeatCount="indefinite" /> - + @@ -127,6 +122,7 @@ export async function apply(id, init) { updateActiveTerminals("theme", theme.preferredTerminalTheme); } } + localStorage.__primary_color = theme.primaryColor; document.body.setAttribute("theme-type", theme.type); $style.textContent = theme.css; @@ -144,19 +140,6 @@ export async function apply(id, init) { }, 1000); firstTime = false; } - - try { - let fs = fsOperation(loaderFile); - const svg = await fs.readFile("utf8"); - - fs = fsOperation(img); - if (!(await fs.exists())) { - await fsOperation(DATA_STORAGE).createFile(svgName); - } - await fs.writeFile(svg.replace(/#fff/g, theme.primaryColor)); - } catch (error) { - window.log("error", error); - } } /** diff --git a/webpack.config.js b/webpack.config.js index a87528b11..8767eaa8f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -30,18 +30,24 @@ module.exports = (env, options) => { test: /\.(hbs|md)$/, use: ['raw-loader'], }, - { - test: /\.m.(sa|sc|c)ss$/, - use: [ - 'raw-loader', - 'postcss-loader', - 'sass-loader', - ], - }, - { - test: /\.(png|svg|jpg|jpeg|ico|ttf|webp|eot|woff|webm|mp4|webp|wav)(\?.*)?$/, - type: "asset/resource", - }, + { + test: /\.m.(sa|sc|c)ss$/, + use: [ + 'raw-loader', + 'postcss-loader', + 'sass-loader', + ], + }, + { + test: /\.svg$/, + resourceQuery: /raw/, + type: 'asset/source', + }, + { + test: /\.(png|svg|jpg|jpeg|ico|ttf|webp|eot|woff|webm|mp4|webp|wav)(\?.*)?$/, + resourceQuery: { not: [/raw/] }, + type: "asset/resource", + }, { test: /(?