feat: migration to Svelte 5

This commit is contained in:
Scott Idem
2025-11-19 12:38:03 -05:00
parent d99e9ee1b0
commit f25b9ccd8f
46 changed files with 9578 additions and 9095 deletions

View File

@@ -3,10 +3,14 @@
import { browser } from '$app/environment';
import { ensureCodeMirrorModules } from './codemirror_modules';
export let content: string = '';
export let placeholder: string = 'Start typing...';
interface Props {
content?: string;
placeholder?: string;
}
let editor_container: HTMLDivElement;
let { content = $bindable(''), placeholder = 'Start typing...' }: Props = $props();
let editor_container: HTMLDivElement = $state();
let editor_view: any;
let cm: any; // Declare cm at the top level
@@ -141,15 +145,15 @@
<div class="toolbar p-1 bg-gray-100 border-b">
<button
type="button"
on:click={() => wrapSelection('**')}
onclick={() => wrapSelection('**')}
class="px-2 py-1 rounded hover:bg-gray-200"><b>B</b></button
>
<button
type="button"
on:click={() => wrapSelection('*')}
onclick={() => wrapSelection('*')}
class="px-2 py-1 rounded hover:bg-gray-200"><i>I</i></button
>
<button type="button" on:click={insertList} class="px-2 py-1 rounded hover:bg-gray-200"
<button type="button" onclick={insertList} class="px-2 py-1 rounded hover:bg-gray-200"
>List</button
>
</div>