limpiar App.svelte

This commit is contained in:
Cat /dev/Nulo 2023-03-16 11:30:09 -03:00
parent baca793e0a
commit 6368c6b54f

View file

@ -1,37 +1,9 @@
<script lang="ts">
import { nanoid } from "nanoid";
import Editor from "./editor/Editor.svelte";
import { getWorldPage, getWorldY } from "./lib/doc";
import { currentRoute } from "./lib/routes";
let worldDescriptor: string = "";
let fileId: string = nanoid();
$: world = worldDescriptor.includes(":")
? {
room: worldDescriptor.split(":")[0],
password: worldDescriptor.split(":")[1],
}
: null;
$: worldY = world && getWorldY(world);
$: doc = worldY && getWorldPage(worldY.ydoc, fileId);
function generateWorld() {
worldDescriptor = `${nanoid()}:${nanoid()}`;
}
</script>
<main>
<svelte:component this={$currentRoute.component} {...$currentRoute.params} />
<!-- <button on:click={generateWorld}>generar mundo</button>
<input
type="text"
bind:value={worldDescriptor}
placeholder="mundo descriptor"
/>
<input type="text" bind:value={fileId} placeholder="world" />
{#if doc}<Editor {doc} />{/if} -->
</main>
<style>