fix embedding + playground

This commit is contained in:
vcoppe
2025-11-09 18:03:27 +01:00
parent ec3eb387e5
commit 59710d2e1a
14 changed files with 307 additions and 422 deletions

View File

@@ -6,7 +6,7 @@
import Nav from '$lib/components/Nav.svelte';
import Footer from '$lib/components/Footer.svelte';
import { onMount, type Snippet } from 'svelte';
import { convertOldEmbeddingOptions } from '$lib/components/embedding/Embedding';
import { convertOldEmbeddingOptions } from '$lib/components/embedding/embedding';
import { base } from '$app/paths';
import { languages } from '$lib/languages';
import { browser } from '$app/environment';

View File

@@ -2,7 +2,7 @@
import { Button } from '$lib/components/ui/button';
import Logo from '$lib/components/Logo.svelte';
import { getURLForLanguage } from '$lib/utils';
import { Home, Map, BookOpenText } from '@lucide/svelte';
import { House, Map, BookOpenText } from '@lucide/svelte';
import { i18n } from '$lib/i18n.svelte';
</script>
@@ -15,7 +15,7 @@
href={getURLForLanguage(i18n.lang, '/')}
class="text-base w-1/4 min-w-fit rounded-full"
>
<Home size="18" />
<House size="18" />
{i18n._('homepage.home')}
</Button>
<Button

View File

@@ -16,10 +16,12 @@
import { i18n } from '$lib/i18n.svelte';
import { settings } from '$lib/logic/settings';
import { loadFiles } from '$lib/logic/file-actions';
import { onMount } from 'svelte';
import { onDestroy, onMount } from 'svelte';
import { page } from '$app/state';
import { gpxStatistics, slicedGPXStatistics } from '$lib/logic/statistics';
import { getURLForGoogleDriveFile } from '$lib/components/embedding/Embedding';
import { getURLForGoogleDriveFile } from '$lib/components/embedding/embedding';
import { db } from '$lib/db';
import { fileStateCollection } from '$lib/logic/file-state';
const {
treeFileView,
@@ -49,6 +51,14 @@
loadFiles(files.filter((file) => file !== null));
});
}
fileStateCollection.connectToDatabase(db);
settings.connectToDatabase(db);
});
onDestroy(() => {
fileStateCollection.disconnectFromDatabase();
settings.disconnectFromDatabase();
});
</script>

View File

@@ -1,11 +1,11 @@
<script lang="ts">
import { page } from '$app/state';
import { onMount } from 'svelte';
// import Embedding from '$lib/components/embedding/Embedding.svelte';
import Embedding from '$lib/components/embedding/Embedding.svelte';
import {
getMergedEmbeddingOptions,
type EmbeddingOptions,
} from '$lib/components/embedding/Embedding';
} from '$lib/components/embedding/embedding';
let embeddingOptions: EmbeddingOptions | undefined = undefined;
@@ -23,5 +23,5 @@
</script>
{#if embeddingOptions}
<!-- <Embedding options={embeddingOptions} hash={$page.url.hash} /> -->
<Embedding options={embeddingOptions} hash={page.url.hash} />
{/if}