Add order in file schema and main projecct edition

This commit is contained in:
2024-11-13 00:25:18 +01:00
parent b54402fc19
commit adb37b255a
32 changed files with 549 additions and 34 deletions

View File

@@ -2,7 +2,7 @@
import { useDrag, usePinch, useWheel } from '@vueuse/gesture';
import type { CanvasContent, CanvasNode } from '~/types/canvas';
import { Icon } from '@iconify/vue/dist/iconify.js';
import { clamp } from '#imports';
import { clamp } from '#shared/general.utils';
interface Props
{
@@ -151,16 +151,12 @@ dark:border-dark-purple
*/
const pinchHandler = usePinch(({ event, offset: [z] }: { event: Event, offset: number[] }) => {
event.stopPropagation();
event.preventDefault();
zoom.value = clamp(z / 2048, minZoom.value, 3);
}, {
domTarget: canvas,
eventOptions: { passive: false, }
})
const dragHandler = useDrag(({ event, delta: [x, y] }: { event: Event, delta: number[] }) => {
event.stopPropagation();
event.preventDefault();
dispX.value += x / zoom.value;
dispY.value += y / zoom.value;
}, {
@@ -168,8 +164,6 @@ const dragHandler = useDrag(({ event, delta: [x, y] }: { event: Event, delta: nu
eventOptions: { passive: false, }
})
const wheelHandler = useWheel(({ event, delta: [x, y] }: { event: Event, delta: number[] }) => {
event.stopPropagation();
event.preventDefault();
zoom.value = clamp(zoom.value + y * -0.001, minZoom.value, 3);
}, {
domTarget: canvas,

View File

@@ -5,5 +5,6 @@
</template>
<script setup lang="ts">
import { parseId } from '#shared/general.utils';
const props = defineProps<{ id?: string }>()
</script>

View File

@@ -5,6 +5,7 @@
</template>
<script setup lang="ts">
import { parseId } from '#shared/general.utils';
const props = defineProps<{ id?: string }>()
const generate = computed(() => props.id)

View File

@@ -5,6 +5,7 @@
</template>
<script setup lang="ts">
import { parseId } from '#shared/general.utils';
const props = defineProps<{ id?: string }>()
const generate = computed(() => props.id)

View File

@@ -5,5 +5,6 @@
</template>
<script setup lang="ts">
import { parseId } from '#shared/general.utils';
const props = defineProps<{ id?: string }>()
</script>

View File

@@ -5,6 +5,7 @@
</template>
<script setup lang="ts">
import { parseId } from '#shared/general.utils';
const props = defineProps<{ id?: string }>()
const generate = computed(() => props.id)

View File

@@ -5,6 +5,7 @@
</template>
<script setup lang="ts">
import { parseId } from '#shared/general.utils';
const props = defineProps<{ id?: string }>()
const generate = computed(() => props.id)