chore(front): fmt

This commit is contained in:
jon r 2025-02-24 02:55:09 +01:00
parent ff4c2e4b3d
commit 03d4fc75b3
3 changed files with 92 additions and 77 deletions

View File

@ -2,22 +2,21 @@
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { type ColorProps, type PastelProps, type VariantProps, type RaisedProps, color } from '~/composables/color' import { type ColorProps, type PastelProps, type VariantProps, type RaisedProps, color } from '~/composables/color'
const input = ref<HTMLInputElement>()
const input = ref<HTMLInputElement>();
const emit = defineEmits<{ const emit = defineEmits<{
click: [event: MouseEvent] click: [event: MouseEvent]
}>() }>()
const handleClick = (event: MouseEvent) => { const handleClick = (event: MouseEvent) => {
emit('click', event) emit('click', event)
if (model.value !== undefined) { if (model.value !== undefined) {
input.value?.focus(); input.value?.focus()
} }
} }
const props = defineProps<{ noUnderline?:true, autofocus? : boolean } &(PastelProps | ColorProps) & VariantProps & RaisedProps>() const props = defineProps<{ noUnderline?:true, autofocus? : boolean } &(PastelProps | ColorProps) & VariantProps & RaisedProps>()
const model = defineModel<string>() const model = defineModel<string>()
onMounted(() => { onMounted(() => {
if (props.autofocus) input.value?.focus(); if (props.autofocus) input.value?.focus()
}) })
const sanitize = () => const sanitize = () =>
@ -26,7 +25,6 @@ const sanitize = () =>
const sanitizeAndBlur = () => const sanitizeAndBlur = () =>
sanitize() && input.value?.blur() sanitize() && input.value?.blur()
</script> </script>
<template> <template>

View File

@ -218,29 +218,29 @@ onMounted(() => {
/> />
<textarea <textarea
ref="textarea" ref="textarea"
@click="updateLineNumber"
@mousedown.stop
@mouseup.stop
@keydown.left="updateLineNumber"
@keydown.right="updateLineNumber"
@keydown.up="updateLineNumber"
:maxlength="charLimit" :maxlength="charLimit"
@keydown.down="updateLineNumber"
@keydown.enter="newline"
v-bind="$attrs" v-bind="$attrs"
:autofocus="autofocus || undefined" :autofocus="autofocus || undefined"
@keydown.ctrl.shift.z.exact.prevent="redo"
:required="required" :required="required"
@keydown.ctrl.z.exact.prevent="undo"
:placeholder="placeholder" :placeholder="placeholder"
@keydown.ctrl.b.exact.prevent="bold" @click="updateLineNumber"
v-model="model" v-model="model"
@keydown.ctrl.i.exact.prevent="italics" @mousedown.stop
id="textarea_id" id="textarea_id"
@keydown.ctrl.shift.x.exact.prevent="strikethrough" @mouseup.stop
:rows="initialLines" :rows="initialLines"
@keydown.ctrl.k.exact.prevent="link" @keydown.left="updateLineNumber"
:style="`min-height:${((typeof(initialLines) === 'string' ? parseInt(initialLines) : (initialLines ?? 3)) + 1.2) * 1.5}rem`" :style="`min-height:${((typeof(initialLines) === 'string' ? parseInt(initialLines) : (initialLines ?? 3)) + 1.2) * 1.5}rem`"
@keydown.right="updateLineNumber"
@keydown.up="updateLineNumber"
@keydown.down="updateLineNumber"
@keydown.enter="newline"
@keydown.ctrl.shift.z.exact.prevent="redo"
@keydown.ctrl.z.exact.prevent="undo"
@keydown.ctrl.b.exact.prevent="bold"
@keydown.ctrl.i.exact.prevent="italics"
@keydown.ctrl.shift.x.exact.prevent="strikethrough"
@keydown.ctrl.k.exact.prevent="link"
/> />
<label <label
class="textarea-buttons" class="textarea-buttons"

View File

@ -79,11 +79,14 @@ const channelUpload = ref()
:cancel="t('components.channels.UploadModal.button.cancel')" :cancel="t('components.channels.UploadModal.button.cancel')"
:title="modalTitle" :title="modalTitle"
> >
<!-- Page content --> <!-- Page content -->
<!-- Page 1 --> <!-- Page 1 -->
<Layout flex style="place-content:center" v-if="state.page === 'selectDestination'"> <Layout
v-if="state.page === 'selectDestination'"
flex
style="place-content:center"
>
<Card <Card
small small
solid solid
@ -92,7 +95,10 @@ const channelUpload = ref()
@click="destinationSelected({ type: 'library' })" @click="destinationSelected({ type: 'library' })"
> >
<template #image> <template #image>
<i class="bi bi-headphones solid secondary raised" :class="$style.icon"></i> <i
class="bi bi-headphones solid secondary raised"
:class="$style.icon"
/>
</template> </template>
{{ "Host music you listen to" /* TODO: Translate */ }} {{ "Host music you listen to" /* TODO: Translate */ }}
</Card> </Card>
@ -104,7 +110,10 @@ const channelUpload = ref()
@click="destinationSelected({ type: 'channel', filter: 'music' })" @click="destinationSelected({ type: 'channel', filter: 'music' })"
> >
<template #image> <template #image>
<i class="bi bi-music-note-beamed solid primary" :class="$style.icon"></i> <i
class="bi bi-music-note-beamed solid primary"
:class="$style.icon"
/>
</template> </template>
{{ "Publish music you make" /* TODO: Translate */ }} {{ "Publish music you make" /* TODO: Translate */ }}
</Card> </Card>
@ -116,7 +125,10 @@ const channelUpload = ref()
@click="destinationSelected({ type: 'channel', filter: 'podcast' })" @click="destinationSelected({ type: 'channel', filter: 'podcast' })"
> >
<template #image> <template #image>
<i class="bi bi-mic-fill solid primary" :class="$style.icon"></i> <i
class="bi bi-mic-fill solid primary"
:class="$style.icon"
/>
</template> </template>
{{ "Publish podcasts you make" /* TODO: Translate */ }} {{ "Publish podcasts you make" /* TODO: Translate */ }}
</Card> </Card>
@ -124,13 +136,15 @@ const channelUpload = ref()
<!-- Page 2 --> <!-- Page 2 -->
<Layout stack v-if="state.page === 'uploadFiles'"> <Layout
v-if="state.page === 'uploadFiles'"
stack
>
<!-- --> <!-- -->
<ChannelUpload <ChannelUpload
ref="channelUpload"
v-if="state.uploadDestination?.type === 'channel'" v-if="state.uploadDestination?.type === 'channel'"
ref="channelUpload"
:filter="state.uploadDestination.filter" :filter="state.uploadDestination.filter"
:channel="null" :channel="null"
/> />
@ -140,8 +154,8 @@ const channelUpload = ref()
<!-- Privacy Slider --> <!-- Privacy Slider -->
<LibraryUpload <LibraryUpload
v-if="state.uploadDestination?.type === 'library'" v-if="state.uploadDestination?.type === 'library'"
v-model="privacyLevel"> v-model="privacyLevel"
</LibraryUpload> />
{{ state.files }} {{ state.files }}
</Layout> </Layout>
@ -153,7 +167,10 @@ const channelUpload = ref()
> >
{{ t('components.channels.UploadModal.button.previous') }} {{ t('components.channels.UploadModal.button.previous') }}
</Button> </Button>
<Spacer h grow /> <Spacer
h
grow
/>
<Spacer size-16 /> <Spacer size-16 />
<Button <Button
v-if="state.page === 'uploadFiles'" v-if="state.page === 'uploadFiles'"