diff --git a/src/lib/components/shad-editor/editor-toolbar.svelte b/src/lib/components/shad-editor/editor-toolbar.svelte index 9d53e4e4..92581cd9 100644 --- a/src/lib/components/shad-editor/editor-toolbar.svelte +++ b/src/lib/components/shad-editor/editor-toolbar.svelte @@ -1,28 +1,31 @@ -
- {#if show_button_kv.undo} - - {/if} - {#if show_button_kv.redo} - - {/if} +
+ + {#if show_button_kv.undo} + + {/if} + {#if show_button_kv.redo} + + {/if} + - {#if show_button_kv.text} - - {/if} - {#if show_button_kv.bold} - - {/if} - {#if show_button_kv.italic} - - {/if} - {#if show_button_kv.underline} - - {/if} - {#if show_button_kv.strikethrough} - - {/if} - {#if show_button_kv.align} - - {/if} - {#if show_button_kv.link} - - {/if} - {#if show_button_kv.code} - - {/if} - {#if show_button_kv.blockquote} -
- {/if} - {#if show_button_kv.subscript} - - {/if} - {#if show_button_kv.superscript} - - {/if} - {#if show_button_kv.bullet_list} - - {/if} - {#if show_button_kv.ordered_list} - - {/if} - {#if show_button_kv.task_list} - - {/if} - - {#if show_button_kv.table} - - {/if} - {#if show_button_kv.text_color} - - {/if} - {#if show_button_kv.highlighter} - - {/if} - {#if show_button_kv.quick_color} - - {/if} - {#if show_button_kv.search_replace} - - {/if} + + {#if show_button_kv.text} + + {/if} + + + {#if show_button_kv.bold} + + {/if} + {#if show_button_kv.italic} + + {/if} + {#if show_button_kv.underline} + + {/if} + {#if show_button_kv.strikethrough} + + {/if} + + + {#if show_button_kv.align} + + {/if} + {#if show_button_kv.link} + + {/if} + {#if show_button_kv.code} + + {/if} + {#if show_button_kv.blockquote} +
+ {/if} + {#if show_button_kv.subscript} + + {/if} + {#if show_button_kv.superscript} + + {/if} + {#if show_button_kv.bullet_list} + + {/if} + {#if show_button_kv.ordered_list} + + {/if} + {#if show_button_kv.task_list} + + {/if} + + {#if show_button_kv.table} +
+ {/if} + + + cxx + {#if show_button_kv.text_color} + + {/if} + {#if show_button_kv.highlighter} + + {/if} + {#if show_button_kv.quick_color} + + {/if} + + + {#if show_button_kv.search_replace} + + {/if} + diff --git a/src/lib/components/shad-editor/shad-editor.svelte b/src/lib/components/shad-editor/shad-editor.svelte index d1734c66..ff2c681d 100644 --- a/src/lib/components/shad-editor/shad-editor.svelte +++ b/src/lib/components/shad-editor/shad-editor.svelte @@ -1,172 +1,176 @@ -
- {#if editor && showToolbar} - +
+ {#if editor && show_toolbar} + {/if}
+ class="tiptap overflow-auto relative"> - -{#if 1==3}
{ if (default_minimal) { - editor.chain().focus().setParagraph().run(); - show_menu = true; + show_toolbar = true; } }} on:mouseleave={() => { @@ -147,77 +110,30 @@ let mouse_leave_wait: number = 2000; mouse_entered_timer = setTimeout(() => { if (default_minimal) { - show_menu = false; + show_toolbar = false; } }, mouse_leave_wait); - - // if (default_minimal) { - // show_menu = false; - // } }} on:mouseenter={() => { clearTimeout(mouse_entered_timer); mouse_entered_timer = setTimeout(() => { if (default_minimal) { - show_menu = true; + show_toolbar = true; } }, mouse_enter_wait); - - // if (default_minimal) { - // show_menu = true; - // } }} - class="xxxeditor textarea p-1 transition-all duration-1000" - class:hidden={true} + class="" > - - - - - - - {#if editor && show_menu} -
- -
- {/if} - - -
- -
- +
-{/if} - -
- -