basic text editor

This commit is contained in:
2025-09-06 01:21:13 +02:00
parent 73d3b2a27f
commit a4c2c039d2
13 changed files with 315 additions and 24 deletions

View File

@@ -0,0 +1,28 @@
<script setup lang="ts">
import { useImageViewer } from '~/stores/viewers';
const imageViewer = useImageViewer();
function onOpenUpdate(state: boolean) {
if (!state) {
imageViewer.close();
}
}
</script>
<template>
<Dialog :open="imageViewer.src != null" @update:open="onOpenUpdate">
<DialogTrigger>
<slot />
</DialogTrigger>
<DialogContent
class="w-full overflow-hidden p-0 sm:!max-h-[90vh] sm:!max-w-[90vw]"
>
<img
v-if="imageViewer.src"
class="h-full w-full overflow-hidden !object-contain"
:src="imageViewer.src"
/>
</DialogContent>
</Dialog>
</template>