frontend/layouts/app.vue

29 lines
767 B
Vue
Raw Normal View History

<template>
<Sidebar>
<SquarePattern />
<slot />
</Sidebar>
2024-11-30 19:15:23 +01:00
<ComposerDialog />
</template>
<script setup lang="ts">
2024-11-30 19:15:23 +01:00
import ComposerDialog from "~/components/composer/dialog.vue";
import SquarePattern from "~/components/graphics/square-pattern.vue";
import Sidebar from "~/components/sidebars/sidebar.vue";
const { n } = useMagicKeys();
const activeElement = useActiveElement();
const notUsingInput = computed(
() =>
activeElement.value?.tagName !== "INPUT" &&
activeElement.value?.tagName !== "TEXTAREA",
);
watchEffect(async () => {
if (n?.value && notUsingInput.value) {
// Wait 50ms
await new Promise((resolve) => setTimeout(resolve, 50));
useEvent("composer:open");
}
});
</script>