Merge branch 'fix-breezy' into shigusegubu-themes3

This commit is contained in:
Henry Jameson 2025-03-26 22:17:23 +02:00
commit 10329e9f45
11 changed files with 104 additions and 74 deletions

View file

@ -388,6 +388,10 @@ nav {
&:disabled {
cursor: not-allowed;
}
&:active {
transform: translate(1px, 1px);
}
}
.menu-item {

View file

@ -1,5 +1,7 @@
import mfaApi from '../../services/new_api/mfa.js'
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex'
import { mapStores } from 'pinia'
import { useOAuthStore } from 'src/stores/oauth.js'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faTimes
@ -18,17 +20,24 @@ export default {
...mapGetters({
authSettings: 'authFlow/settings'
}),
...mapStores(useOAuthStore),
...mapState({
instance: 'instance',
oauth: 'oauth'
})
},
methods: {
...mapMutations('authFlow', ['requireTOTP', 'abortMFA']),
...mapActions({ login: 'authFlow/login' }),
clearError () { this.error = false },
focusOnCodeInput () {
const codeInput = this.$refs.codeInput
codeInput.focus()
codeInput.setSelectionRange(0, codeInput.value.length)
},
submit () {
const { clientId, clientSecret } = this.oauth
const { clientId, clientSecret } = this.oauthStore
const data = {
clientId,
@ -42,6 +51,7 @@ export default {
if (result.error) {
this.error = result.error
this.code = null
this.focusOnCodeInput()
return
}

View file

@ -1,5 +1,5 @@
<template>
<div class="login panel panel-default">
<div class="login-panel panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading">
@ -17,6 +17,7 @@
<label for="code">{{ $t('login.recovery_code') }}</label>
<input
id="code"
ref="codeInput"
v-model="code"
class="input form-control"
>
@ -71,4 +72,5 @@
</div>
</div>
</template>
<script src="./recovery_form.js"></script>

View file

@ -1,5 +1,7 @@
import mfaApi from '../../services/new_api/mfa.js'
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex'
import { mapStores } from 'pinia'
import { useOAuthStore } from 'src/stores/oauth.js'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faTimes
@ -18,17 +20,24 @@ export default {
...mapGetters({
authSettings: 'authFlow/settings'
}),
...mapStores(useOAuthStore),
...mapState({
instance: 'instance',
oauth: 'oauth'
})
},
methods: {
...mapMutations('authFlow', ['requireRecovery', 'abortMFA']),
...mapActions({ login: 'authFlow/login' }),
clearError () { this.error = false },
focusOnCodeInput () {
const codeInput = this.$refs.codeInput
codeInput.focus()
codeInput.setSelectionRange(0, codeInput.value.length)
},
submit () {
const { clientId, clientSecret } = this.oauth
const { clientId, clientSecret } = this.oauthStore
const data = {
clientId,
@ -42,6 +51,7 @@ export default {
if (result.error) {
this.error = result.error
this.code = null
this.focusOnCodeInput()
return
}

View file

@ -1,5 +1,5 @@
<template>
<div class="login panel panel-default">
<div class="login-panel panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading">
@ -19,6 +19,7 @@
</label>
<input
id="code"
ref="codeInput"
v-model="code"
class="input form-control"
>
@ -74,4 +75,5 @@
</div>
</div>
</template>
<script src="./totp_form.js"></script>

View file

@ -112,7 +112,7 @@ export const colorFunctions = {
const color = convert(findColor(colorArg, { dynamicVars, staticVars })).rgb
const amount = Number(amountArg)
const effectiveBackground = dynamicVars.lowerLevelBackground
const effectiveBackground = dynamicVars.lowerLevelBackground ?? color
const isLightOnDark = relativeLuminance(convert(effectiveBackground).rgb) < 0.5
const mod = isLightOnDark ? 1 : -1
return brightness(amount * mod, color).rgb

View file

@ -78,23 +78,24 @@ export const findColor = (color, { dynamicVars, staticVars }) => {
targetColor = { r, g, b }
} else if (variableSlot.startsWith('parent')) {
if (variableSlot === 'parent') {
const { r, g, b } = dynamicVars.lowerLevelBackground
const { r, g, b } = dynamicVars.lowerLevelBackground ?? {}
targetColor = { r, g, b }
} else {
const virtualSlot = variableSlot.replace(/^parent/, '')
targetColor = convert(dynamicVars.lowerLevelVirtualDirectivesRaw[virtualSlot]).rgb
}
} else {
switch (variableSlot) {
case 'inheritedBackground':
targetColor = convert(dynamicVars.inheritedBackground).rgb
break
case 'background':
targetColor = convert(dynamicVars.background).rgb
break
default:
targetColor = convert(staticVars[variableSlot]).rgb
const staticVar = staticVars[variableSlot]
const dynamicVar = dynamicVars[variableSlot]
if (!staticVar && !dynamicVar) {
console.warn(dynamicVars, variableSlot, dynamicVars[variableSlot])
console.warn(`Couldn't find variable "${variableSlot}", falling back to magenta. Variables are:
Static:
${JSON.stringify(staticVars, null, 2)}
Dynamic:
${JSON.stringify(dynamicVars, null, 2)}`)
}
targetColor = convert(staticVar ?? dynamicVar ?? '#FF00FF').rgb
}
if (modifier) {
@ -109,7 +110,7 @@ export const findColor = (color, { dynamicVars, staticVars }) => {
try {
targetColor = process(color, colorFunctions, { findColor }, { dynamicVars, staticVars })
} catch (e) {
console.error('Failure executing color function', e)
console.error('Failure executing color function', e ,'\n Function: ' + color)
targetColor = '#FF00FF'
}
}
@ -120,7 +121,7 @@ export const findColor = (color, { dynamicVars, staticVars }) => {
Static:
${JSON.stringify(staticVars, null, 2)}
Dynamic:
${JSON.stringify(dynamicVars, null, 2)}`, e)
${JSON.stringify(dynamicVars, null, 2)}\nError: ${e}`)
}
}
@ -516,7 +517,7 @@ export const init = ({
.filter(c => virtualComponents.has(c) && !nonEditableComponents.has(c))
} else if (liteMode) {
validInnerComponents = (component.validInnerComponentsLite || component.validInnerComponents || [])
} else if (component.name === 'Root' || component.states != null) {
} else if (component.name === 'Root' || component.states != null || component.background?.includes('--parent')) {
validInnerComponents = component.validInnerComponents || []
} else {
validInnerComponents = component