diff --git a/package-lock.json b/package-lock.json index 65145ac..76884d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,6 +53,7 @@ "postcss-nested": "^7.0.2", "postcss-preset-env": "^10.4.0", "postcss-strip-inline-comments": "^0.1.5", + "raw-loader": "^4.0.2", "resolve-url-loader": "^5.0.0", "tailwindcss": "^4.1.17", "ts-loader": "^9.5.4", @@ -17838,6 +17839,95 @@ "node": ">= 0.8" } }, + "node_modules/raw-loader": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz", + "integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^4.0.0 || ^5.0.0" + } + }, + "node_modules/raw-loader/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/raw-loader/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/raw-loader/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/raw-loader/node_modules/loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/raw-loader/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", diff --git a/package.json b/package.json index 274b7b1..fe7bd0b 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "postcss-nested": "^7.0.2", "postcss-preset-env": "^10.4.0", "postcss-strip-inline-comments": "^0.1.5", + "raw-loader": "^4.0.2", "resolve-url-loader": "^5.0.0", "tailwindcss": "^4.1.17", "ts-loader": "^9.5.4", diff --git a/src/csui/Popup.vue b/src/csui/Popup.vue index 60eb028..789e3d6 100644 --- a/src/csui/Popup.vue +++ b/src/csui/Popup.vue @@ -125,7 +125,6 @@ import BrowserDetect from '../ext/conf/BrowserDetect'; import CommsClient, {CommsOrigin} from '../ext/lib/comms/CommsClient'; import Settings from '../ext/lib/settings/Settings'; import EventBus from '../ext/lib/EventBus'; -import {ChromeShittinessMitigations as CSM} from '../common/js/ChromeShittinessMitigations'; import SupportLevelIndicator from '@csui/src/components/SupportLevelIndicator.vue' import { LogAggregator } from '@src/ext/lib/logging/LogAggregator'; import { ComponentLogger } from '@src/ext/lib/logging/ComponentLogger'; diff --git a/src/ext/lib/settings/Settings.ts b/src/ext/lib/settings/Settings.ts index 4d8a2e9..19497d3 100644 --- a/src/ext/lib/settings/Settings.ts +++ b/src/ext/lib/settings/Settings.ts @@ -61,7 +61,7 @@ class Settings { constructor(options: SettingsOptions) { // Options: activeSettings, updateCallback, logger - this.logger = options.logAggregator && new ComponentLogger(options.logAggregator, 'Settings', {styles: SETTINGS_LOGGER_STYLES}) || undefined;; + this.logger = options.logAggregator && new ComponentLogger(options.logAggregator, 'Settings', {styles: SETTINGS_LOGGER_STYLES}) || undefined; this.onSettingsChanged = options.onSettingsChanged; this.afterSettingsSaved = options.afterSettingsSaved; this.active = options.activeSettings ?? undefined; @@ -73,6 +73,24 @@ class Settings { chrome.storage.onChanged.addListener((changes, area) => {this.storageChangeListener(changes, area)}); } + updateOptions(options: SettingsOptions) { + if (options.logAggregator) { + this.logger = options.logAggregator && new ComponentLogger(options.logAggregator, 'Settings', {styles: SETTINGS_LOGGER_STYLES}) + } + + if (options.onSettingsChanged) { + this.onSettingsChanged = options.onSettingsChanged; + } + + if (options.afterSettingsSaved) { + this.afterSettingsSaved = options.afterSettingsSaved; + } + + if (options.activeSettings) { + this.active = options.activeSettings; + } + } + private storageChangeListener(changes, area) { if (!changes.uwSettings) { return; diff --git a/src/main.css b/src/main.css index fc1b12a..b2b33b7 100644 --- a/src/main.css +++ b/src/main.css @@ -38,4 +38,40 @@ html, body { h1, h2, h3, h4, h5, h6 { @apply font-mono; } + + h2 { + @apply text-[1.75em]; + } + + h3 { + @apply text-primary-300 text-[1.25em] mt-4 border-b-1 border-b-stone-700; + } + + a { + @apply text-primary-400; + + &:hover { + @apply text-primary-300; + } + } + + p { + @apply mt-1 mb-2; + } + + p, li { + @apply leading-tight; + } + + ul { + @apply bg-stone-900/50 px-4 py-2 mt-1 mb-2; + + li { + @apply ml-4 list-disc marker:text-primary-400 mt-1 mb-2; + } + } + + small, strike { + @apply opacity-50; + } } diff --git a/src/ui/components/Debugging/Debugging.vue b/src/ui/components/Debugging/Debugging.vue new file mode 100644 index 0000000..7622555 --- /dev/null +++ b/src/ui/components/Debugging/Debugging.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/ui/components/ExtensionInfo/About.vue b/src/ui/components/ExtensionInfo/About.vue new file mode 100644 index 0000000..f9b1ed2 --- /dev/null +++ b/src/ui/components/ExtensionInfo/About.vue @@ -0,0 +1,35 @@ + + diff --git a/src/ui/components/ExtensionInfo/WhatsNew.vue b/src/ui/components/ExtensionInfo/WhatsNew.vue new file mode 100644 index 0000000..a063451 --- /dev/null +++ b/src/ui/components/ExtensionInfo/WhatsNew.vue @@ -0,0 +1,80 @@ + + + diff --git a/src/ui/components/ExtensionInfo/segments/ChangelogContent.vue b/src/ui/components/ExtensionInfo/segments/ChangelogContent.vue new file mode 100644 index 0000000..586f994 --- /dev/null +++ b/src/ui/components/ExtensionInfo/segments/ChangelogContent.vue @@ -0,0 +1,59 @@ + + + diff --git a/src/ui/components/ExtensionInfo/segments/ExtensionInfoContent.vue b/src/ui/components/ExtensionInfo/segments/ExtensionInfoContent.vue new file mode 100644 index 0000000..65af237 --- /dev/null +++ b/src/ui/components/ExtensionInfo/segments/ExtensionInfoContent.vue @@ -0,0 +1,93 @@ + + + diff --git a/src/ui/components/KeyboardShortcuts/KeyboardShortcutSettings.vue b/src/ui/components/KeyboardShortcuts/KeyboardShortcutSettings.vue index 4ce1244..63a0d23 100644 --- a/src/ui/components/KeyboardShortcuts/KeyboardShortcutSettings.vue +++ b/src/ui/components/KeyboardShortcuts/KeyboardShortcutSettings.vue @@ -5,7 +5,7 @@
- +
diff --git a/src/ui/components/SettingsWindowContent.vue b/src/ui/components/SettingsWindowContent.vue index 20624e7..d8d5af0 100644 --- a/src/ui/components/SettingsWindowContent.vue +++ b/src/ui/components/SettingsWindowContent.vue @@ -1,8 +1,8 @@ - - - - - - - diff --git a/src/ui/components/VideoSettings/components/ShortcutButton.vue b/src/ui/components/VideoSettings/components/ShortcutButton.vue new file mode 100644 index 0000000..63a8fcf --- /dev/null +++ b/src/ui/components/VideoSettings/components/ShortcutButton.vue @@ -0,0 +1,22 @@ + + + diff --git a/src/ui/components/common/mixins/CommsMixin.vue b/src/ui/components/common/mixins/CommsMixin.vue new file mode 100644 index 0000000..1bf410c --- /dev/null +++ b/src/ui/components/common/mixins/CommsMixin.vue @@ -0,0 +1,22 @@ + diff --git a/src/ui/components/common/mixins/KeyboardShortcutParserMixin.ts b/src/ui/components/common/mixins/KeyboardShortcutParserMixin.vue similarity index 92% rename from src/ui/components/common/mixins/KeyboardShortcutParserMixin.ts rename to src/ui/components/common/mixins/KeyboardShortcutParserMixin.vue index a9856a7..42f9a38 100644 --- a/src/ui/components/common/mixins/KeyboardShortcutParserMixin.ts +++ b/src/ui/components/common/mixins/KeyboardShortcutParserMixin.vue @@ -1,3 +1,4 @@ + diff --git a/src/ui/pages/popup/index.html b/src/ui/pages/popup/index.html new file mode 100644 index 0000000..e69de29 diff --git a/src/ui/pages/popup/popup.js b/src/ui/pages/popup/popup.js new file mode 100644 index 0000000..6a1afed --- /dev/null +++ b/src/ui/pages/popup/popup.js @@ -0,0 +1,30 @@ +import EventBus from '../../../ext/lib/EventBus'; +import { ComponentLogger } from '../../../ext/lib/logging/ComponentLogger'; +import { LogAggregator } from '../../../ext/lib/logging/LogAggregator'; +import Settings from '../../../ext/lib/settings/Settings'; + +const loadedTabs = [ + 'videoSettings', + 'extensionSettings', + 'changelog', + 'about', +]; + +async function load() { + const _uw_data = { + eventBus: new EventBus(), + settings: {}, + settingsInitialized: false, + logAggregator: undefined, + logger: undefined, + site: undefined, + siteSettings: undefined, + comms: undefined, + }; + + _uw_data.logAggregator = new LogAggregator('🔵ext-popup🔵'); + _uw_data.logger = new ComponentLogger(_uw_data.logAggregator, 'Popup'); + _uw_data.settings = new Settings({logAggregator: _uw_data.logAggregator}); + + _uw_data. +} diff --git a/src/ui/pages/settings/App.vue b/src/ui/pages/settings/App.vue index 8405966..429d7a8 100644 --- a/src/ui/pages/settings/App.vue +++ b/src/ui/pages/settings/App.vue @@ -1,16 +1,20 @@