From bbef4e40dffd012dafed71e6efff5c05e7308c3e Mon Sep 17 00:00:00 2001 From: Alexander Tumin Date: Mon, 7 Oct 2024 13:39:36 +0300 Subject: [PATCH 01/20] Fix whitespaces for multiple status mute reasons, display bot status reason --- changelog.d/multiple-status-mute-reasons.fix | 1 + src/components/notification/notification.scss | 1 + src/components/status/status.scss | 1 + src/components/status/status.vue | 21 ++++++++++++------- src/i18n/en.json | 1 + 5 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 changelog.d/multiple-status-mute-reasons.fix diff --git a/changelog.d/multiple-status-mute-reasons.fix b/changelog.d/multiple-status-mute-reasons.fix new file mode 100644 index 000000000..952ccea82 --- /dev/null +++ b/changelog.d/multiple-status-mute-reasons.fix @@ -0,0 +1 @@ +Fix whitespaces for multiple status mute reasons, display bot status reason diff --git a/src/components/notification/notification.scss b/src/components/notification/notification.scss index 2dbced099..0ca6aea77 100644 --- a/src/components/notification/notification.scss +++ b/src/components/notification/notification.scss @@ -26,6 +26,7 @@ overflow: hidden; display: flex; flex-wrap: nowrap; + gap: 1ex; & .status-username, & .mute-thread, diff --git a/src/components/status/status.scss b/src/components/status/status.scss index 63809ff26..344e4b8ef 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -281,6 +281,7 @@ overflow: hidden; display: flex; flex-wrap: nowrap; + gap: 1ex; & .status-username, & .mute-thread, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 61a58cda0..7fef69df0 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -36,17 +36,24 @@ > {{ $t('status.sensitive_muted') }} + + {{ $t('status.bot_muted') }} + - {{ $t('status.thread_muted') }} - - - {{ $t('status.thread_muted_and_words') }} + + {{ $t('status.thread_muted') }} + + + {{ $t('status.thread_muted_and_words') }} + Date: Tue, 19 Nov 2024 03:18:52 +0200 Subject: [PATCH 02/20] bundling theme now works and so are bundled style's palettes --- src/components/button.style.js | 7 + .../settings_modal/tabs/appearance_tab.js | 64 ++++++-- .../settings_modal/tabs/appearance_tab.vue | 28 +++- src/modules/config.js | 2 + src/modules/interface.js | 153 ++++++++++-------- src/services/style_setter/style_setter.js | 7 +- .../{Redmond DX.json => Redmond DX.piss} | 14 +- static/styles/index.json | 2 +- 8 files changed, 171 insertions(+), 106 deletions(-) rename static/styles/{Redmond DX.json => Redmond DX.piss} (93%) diff --git a/src/components/button.style.js b/src/components/button.style.js index 248da8bbd..747cfd5eb 100644 --- a/src/components/button.style.js +++ b/src/components/button.style.js @@ -89,6 +89,13 @@ export default { shadow: ['--buttonDefaultHoverGlow', '--buttonPressedBevel'] } }, + { + state: ['toggled', 'disabled'], + directives: { + background: '$blend(--inheritedBackground 0.25 --parent)', + shadow: ['--buttonPressedBevel'] + } + }, { state: ['disabled'], directives: { diff --git a/src/components/settings_modal/tabs/appearance_tab.js b/src/components/settings_modal/tabs/appearance_tab.js index 076bb995f..711b1961b 100644 --- a/src/components/settings_modal/tabs/appearance_tab.js +++ b/src/components/settings_modal/tabs/appearance_tab.js @@ -36,6 +36,7 @@ const AppearanceTab = { return { availableStyles: [], bundledPalettes: [], + compilationCache: {}, fileImporter: newImporter({ accept: '.json, .piss', validator: this.importValidator, @@ -84,6 +85,8 @@ const AppearanceTab = { PaletteEditor }, mounted () { + this.$store.dispatch('getThemeData') + const updateIndex = (resource) => { const capitalizedResource = resource[0].toUpperCase() + resource.slice(1) const currentIndex = this.$store.state.instance[`${resource}sIndex`] @@ -102,6 +105,13 @@ const AppearanceTab = { }) } + updateIndex('style').then(styles => { + styles.forEach(([key, stylePromise]) => stylePromise.then(data => { + const meta = data.find(x => x.component === '@meta') + this.availableStyles.push({ key, data, name: meta.directives.name, version: 'v3' }) + })) + }) + updateIndex('theme').then(themes => { themes.forEach(([key, themePromise]) => themePromise.then(data => { this.availableStyles.push({ key, data, name: data.name, version: 'v2' }) @@ -166,11 +176,15 @@ const AppearanceTab = { ] }, stylePalettes () { - if (!this.mergedConfig.styleCustomData) return - const meta = this.mergedConfig.styleCustomData - .find(x => x.component === '@meta') - const result = this.mergedConfig.styleCustomData - .filter(x => x.component.startsWith('@palette')) + const ruleset = this.$store.state.interface.styleDataUsed || [] + console.log( + 'ASR', + this.$store.state.interface.paletteDataUsed, + this.$store.state.interface.styleDataUsed + ) + if (!ruleset && ruleset.length === 0) return + const meta = ruleset.find(x => x.component === '@meta') + const result = ruleset.filter(x => x.component.startsWith('@palette')) .map(x => { const { variant, directives } = x const { @@ -307,7 +321,7 @@ const AppearanceTab = { return key === palette }, setStyle (name) { - this.$store.dispatch('setTheme', name) + this.$store.dispatch('setStyle', name) }, setTheme (name) { this.$store.dispatch('setTheme', name) @@ -323,18 +337,30 @@ const AppearanceTab = { resetTheming (name) { this.$store.dispatch('setStyle', 'stock') }, - previewTheme (key, input) { + previewTheme (key, version, input) { let theme3 - if (input) { - const style = normalizeThemeData(input) - const theme2 = convertTheme2To3(style) - theme3 = init({ - inputRuleset: theme2, - ultimateBackgroundColor: '#000000', - liteMode: true, - debug: true, - onlyNormalState: true - }) + if (this.compilationCache[key]) { + theme3 = this.compilationCache[key] + } else if (input) { + if (version === 'v2') { + const style = normalizeThemeData(input) + const theme2 = convertTheme2To3(style) + theme3 = init({ + inputRuleset: theme2, + ultimateBackgroundColor: '#000000', + liteMode: true, + debug: true, + onlyNormalState: true + }) + } else if (version === 'v3') { + theme3 = init({ + inputRuleset: input, + ultimateBackgroundColor: '#000000', + liteMode: true, + debug: true, + onlyNormalState: true + }) + } } else { theme3 = init({ inputRuleset: [], @@ -345,6 +371,10 @@ const AppearanceTab = { }) } + if (!this.compilationCache[key]) { + this.compilationCache[key] = theme3 + } + return getScopedVersion( getCssRules(theme3.eager), '#theme-preview-' + key diff --git a/src/components/settings_modal/tabs/appearance_tab.vue b/src/components/settings_modal/tabs/appearance_tab.vue index 32e0a37fa..5c1c46fe3 100644 --- a/src/components/settings_modal/tabs/appearance_tab.vue +++ b/src/components/settings_modal/tabs/appearance_tab.vue @@ -18,7 +18,7 @@ @@ -30,7 +30,7 @@ +