Renaming general.utils to general.util

This commit is contained in:
2025-01-29 22:51:55 +01:00
parent f32c51ca38
commit f3c453b1b2
19 changed files with 26 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import type { Position } from '#shared/canvas.util';
import { type Position, InfiniteGrid } from '#shared/canvas.util';
import type CanvasNodeEditor from './canvas/CanvasNodeEditor.vue';
import type CanvasEdgeEditor from './canvas/CanvasEdgeEditor.vue';
export type Element = { type: 'node' | 'edge', id: string };
@@ -52,15 +52,11 @@ function distance(touches: TouchList): number
const [A, B] = touches;
return Math.hypot(B.clientX - A.clientX, B.clientY - A.clientY);
}
function contains(group: CanvasNode, node: CanvasNode): boolean
{
return group.x < node.x && group.y < node.y && group.x + group.width > node.x + node.width && group.y + group.height > node.y + node.height;
}
</script>
<script setup lang="ts">
import { Icon } from '@iconify/vue/dist/iconify.js';
import { clamp } from '#shared/general.utils';
import { clamp } from '#shared/general.util';
import type { CanvasContent, CanvasEdge, CanvasNode } from '~/types/canvas';
const canvas = defineModel<CanvasContent>({ required: true, });

View File

@@ -8,7 +8,7 @@
import type { Component } from 'vue';
import { heading } from 'hast-util-heading';
import { headingRank } from 'hast-util-heading-rank';
import { parseId } from '~/shared/general.utils';
import { parseId } from '~/shared/general.util';
import type { Root } from 'hast';
const { content, proses, filter } = defineProps<{

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { useDrag, useHover, usePinch, useWheel } from '@vueuse/gesture';
import { Icon } from '@iconify/vue/dist/iconify.js';
import { clamp } from '#shared/general.utils';
import { clamp } from '#shared/general.util';
const { path } = defineProps<{ path: string }>();
const { user } = useUserSession();

View File

@@ -16,7 +16,7 @@
<script setup lang="ts">
import { parseURL } from 'ufo';
import { Icon } from '@iconify/vue/dist/iconify.js';
import { iconByType } from '#shared/general.utils';
import { iconByType } from '#shared/general.util';
const { href } = defineProps<{
href: string

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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