2024-04-22 19:36:31 +02:00
|
|
|
<script lang="ts">
|
2024-04-25 13:56:07 +02:00
|
|
|
import { currentTool, reverseSelectedFiles, Tool } from '$lib/stores';
|
2024-04-25 14:48:09 +02:00
|
|
|
import Routing from '$lib/components/routing/Routing.svelte';
|
2024-04-22 19:36:31 +02:00
|
|
|
import ToolbarItem from './ToolbarItem.svelte';
|
|
|
|
import {
|
|
|
|
ArrowRightLeft,
|
|
|
|
Group,
|
|
|
|
CalendarClock,
|
|
|
|
Pencil,
|
|
|
|
SquareDashedMousePointer,
|
|
|
|
Ungroup,
|
|
|
|
MapPin,
|
|
|
|
Shrink,
|
|
|
|
Palette,
|
|
|
|
FolderTree
|
|
|
|
} from 'lucide-svelte';
|
|
|
|
|
2024-04-24 17:39:56 +02:00
|
|
|
import { _ } from 'svelte-i18n';
|
|
|
|
|
2024-04-25 13:56:07 +02:00
|
|
|
function getToggleTool(tool: Tool) {
|
2024-04-23 14:11:05 +02:00
|
|
|
return () => toggleTool(tool);
|
|
|
|
}
|
|
|
|
|
2024-04-25 13:56:07 +02:00
|
|
|
function toggleTool(tool: Tool) {
|
|
|
|
currentTool.update((current) => (current === tool ? null : tool));
|
2024-04-23 14:11:05 +02:00
|
|
|
}
|
2024-04-22 19:36:31 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="absolute top-0 bottom-0 left-0 z-10 flex flex-col justify-center pointer-events-none">
|
|
|
|
<div class="flex flex-row w-screen items-center">
|
|
|
|
<div
|
|
|
|
class="h-fit flex flex-col p-1 gap-1 bg-background rounded-md pointer-events-auto shadow-md border"
|
|
|
|
>
|
2024-04-25 13:56:07 +02:00
|
|
|
<ToolbarItem on:click={getToggleTool(Tool.ROUTING)}>
|
2024-04-22 19:36:31 +02:00
|
|
|
<Pencil slot="icon" size="18" />
|
2024-04-24 18:13:01 +02:00
|
|
|
<span slot="tooltip">{$_('toolbar.routing.tooltip')}</span>
|
2024-04-22 19:36:31 +02:00
|
|
|
</ToolbarItem>
|
|
|
|
<ToolbarItem>
|
|
|
|
<CalendarClock slot="icon" size="18" />
|
2024-04-24 17:39:56 +02:00
|
|
|
<span slot="tooltip">{$_('toolbar.time_tooltip')}</span>
|
2024-04-22 19:36:31 +02:00
|
|
|
</ToolbarItem>
|
|
|
|
<ToolbarItem on:click={reverseSelectedFiles}>
|
|
|
|
<ArrowRightLeft slot="icon" size="18" />
|
2024-04-24 17:39:56 +02:00
|
|
|
<span slot="tooltip">{$_('toolbar.reverse_tooltip')}</span>
|
2024-04-22 19:36:31 +02:00
|
|
|
</ToolbarItem>
|
|
|
|
<ToolbarItem>
|
|
|
|
<Group slot="icon" size="18" />
|
2024-04-24 17:39:56 +02:00
|
|
|
<span slot="tooltip">{$_('toolbar.merge_tooltip')}</span>
|
2024-04-22 19:36:31 +02:00
|
|
|
</ToolbarItem>
|
|
|
|
<ToolbarItem>
|
|
|
|
<Ungroup slot="icon" size="18" />
|
2024-04-24 17:39:56 +02:00
|
|
|
<span slot="tooltip">{$_('toolbar.extract_tooltip')}</span>
|
2024-04-22 19:36:31 +02:00
|
|
|
</ToolbarItem>
|
|
|
|
<ToolbarItem>
|
|
|
|
<MapPin slot="icon" size="18" />
|
2024-04-24 17:39:56 +02:00
|
|
|
<span slot="tooltip">{$_('toolbar.waypoint_tooltip')}</span>
|
2024-04-22 19:36:31 +02:00
|
|
|
</ToolbarItem>
|
|
|
|
<ToolbarItem>
|
|
|
|
<Shrink slot="icon" size="18" />
|
2024-04-24 17:39:56 +02:00
|
|
|
<span slot="tooltip">{$_('toolbar.reduce_tooltip')}</span>
|
2024-04-22 19:36:31 +02:00
|
|
|
</ToolbarItem>
|
|
|
|
<ToolbarItem>
|
|
|
|
<SquareDashedMousePointer slot="icon" size="18" />
|
2024-04-24 17:39:56 +02:00
|
|
|
<span slot="tooltip">{$_('toolbar.clean_tooltip')}</span>
|
2024-04-22 19:36:31 +02:00
|
|
|
</ToolbarItem>
|
|
|
|
<ToolbarItem>
|
|
|
|
<Palette slot="icon" size="18" />
|
2024-04-24 17:39:56 +02:00
|
|
|
<span slot="tooltip">{$_('toolbar.style_tooltip')}</span>
|
2024-04-22 19:36:31 +02:00
|
|
|
</ToolbarItem>
|
|
|
|
<ToolbarItem>
|
|
|
|
<FolderTree slot="icon" size="18" />
|
2024-04-24 17:39:56 +02:00
|
|
|
<span slot="tooltip">{$_('toolbar.structure_tooltip')}</span>
|
2024-04-22 19:36:31 +02:00
|
|
|
</ToolbarItem>
|
|
|
|
</div>
|
2024-04-25 13:56:07 +02:00
|
|
|
{#if $currentTool === Tool.ROUTING}
|
2024-04-22 19:36:31 +02:00
|
|
|
<Routing />
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
</div>
|