feat: migration to Svelte 5
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user