chore(front): fmt
This commit is contained in:
parent
ff4c2e4b3d
commit
03d4fc75b3
|
@ -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>
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -79,71 +79,85 @@ const channelUpload = ref()
|
||||||
:cancel="t('components.channels.UploadModal.button.cancel')"
|
:cancel="t('components.channels.UploadModal.button.cancel')"
|
||||||
:title="modalTitle"
|
:title="modalTitle"
|
||||||
>
|
>
|
||||||
|
<!-- Page content -->
|
||||||
|
<!-- Page 1 -->
|
||||||
|
|
||||||
<!-- Page content -->
|
<Layout
|
||||||
<!-- Page 1 -->
|
v-if="state.page === 'selectDestination'"
|
||||||
|
flex
|
||||||
<Layout flex style="place-content:center" v-if="state.page === 'selectDestination'">
|
style="place-content:center"
|
||||||
<Card
|
|
||||||
small
|
|
||||||
solid
|
|
||||||
title="Music"
|
|
||||||
icon="bi-upload"
|
|
||||||
@click="destinationSelected({ type: 'library' })"
|
|
||||||
>
|
>
|
||||||
<template #image>
|
<Card
|
||||||
<i class="bi bi-headphones solid secondary raised" :class="$style.icon"></i>
|
small
|
||||||
</template>
|
solid
|
||||||
{{ "Host music you listen to" /* TODO: Translate */ }}
|
title="Music"
|
||||||
</Card>
|
icon="bi-upload"
|
||||||
<Card
|
@click="destinationSelected({ type: 'library' })"
|
||||||
small
|
>
|
||||||
title="Music"
|
<template #image>
|
||||||
solid
|
<i
|
||||||
icon="bi-upload primary solid"
|
class="bi bi-headphones solid secondary raised"
|
||||||
@click="destinationSelected({ type: 'channel', filter: 'music' })"
|
:class="$style.icon"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
{{ "Host music you listen to" /* TODO: Translate */ }}
|
||||||
|
</Card>
|
||||||
|
<Card
|
||||||
|
small
|
||||||
|
title="Music"
|
||||||
|
solid
|
||||||
|
icon="bi-upload primary solid"
|
||||||
|
@click="destinationSelected({ type: 'channel', filter: 'music' })"
|
||||||
|
>
|
||||||
|
<template #image>
|
||||||
|
<i
|
||||||
|
class="bi bi-music-note-beamed solid primary"
|
||||||
|
:class="$style.icon"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
{{ "Publish music you make" /* TODO: Translate */ }}
|
||||||
|
</Card>
|
||||||
|
<Card
|
||||||
|
small
|
||||||
|
solid
|
||||||
|
title="Podcast"
|
||||||
|
icon="bi-upload primary solid"
|
||||||
|
@click="destinationSelected({ type: 'channel', filter: 'podcast' })"
|
||||||
|
>
|
||||||
|
<template #image>
|
||||||
|
<i
|
||||||
|
class="bi bi-mic-fill solid primary"
|
||||||
|
:class="$style.icon"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
{{ "Publish podcasts you make" /* TODO: Translate */ }}
|
||||||
|
</Card>
|
||||||
|
</Layout>
|
||||||
|
|
||||||
|
<!-- Page 2 -->
|
||||||
|
|
||||||
|
<Layout
|
||||||
|
v-if="state.page === 'uploadFiles'"
|
||||||
|
stack
|
||||||
>
|
>
|
||||||
<template #image>
|
<!-- -->
|
||||||
<i class="bi bi-music-note-beamed solid primary" :class="$style.icon"></i>
|
|
||||||
</template>
|
|
||||||
{{ "Publish music you make" /* TODO: Translate */ }}
|
|
||||||
</Card>
|
|
||||||
<Card
|
|
||||||
small
|
|
||||||
solid
|
|
||||||
title="Podcast"
|
|
||||||
icon="bi-upload primary solid"
|
|
||||||
@click="destinationSelected({ type: 'channel', filter: 'podcast' })"
|
|
||||||
>
|
|
||||||
<template #image>
|
|
||||||
<i class="bi bi-mic-fill solid primary" :class="$style.icon"></i>
|
|
||||||
</template>
|
|
||||||
{{ "Publish podcasts you make" /* TODO: Translate */ }}
|
|
||||||
</Card>
|
|
||||||
</Layout>
|
|
||||||
|
|
||||||
<!-- Page 2 -->
|
<ChannelUpload
|
||||||
|
v-if="state.uploadDestination?.type === 'channel'"
|
||||||
<Layout stack v-if="state.page === 'uploadFiles'">
|
ref="channelUpload"
|
||||||
|
:filter="state.uploadDestination.filter"
|
||||||
<!-- -->
|
:channel="null"
|
||||||
|
|
||||||
<ChannelUpload
|
|
||||||
ref="channelUpload"
|
|
||||||
v-if="state.uploadDestination?.type === 'channel'"
|
|
||||||
:filter="state.uploadDestination.filter"
|
|
||||||
:channel="null"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<!-- 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>
|
||||||
|
|
||||||
<template #actions>
|
<template #actions>
|
||||||
<Button
|
<Button
|
||||||
|
@ -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'"
|
||||||
|
|
Loading…
Reference in New Issue