diff --git a/src/lib/element_tiptap_editor.svelte b/src/lib/element_tiptap_editor.svelte index 7b562482..93a51b97 100644 --- a/src/lib/element_tiptap_editor.svelte +++ b/src/lib/element_tiptap_editor.svelte @@ -60,6 +60,8 @@ if (default_minimal) { let element: HTMLDivElement; let editor: any; +// More default options should be defined later. +// minimal, basic, full let show_button_kv_defaults: any = { bold: true, italic: true, @@ -134,6 +136,7 @@ function getContent() { +
"
>
-
-
@@ -253,7 +238,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().setParagraph().run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md"
- class:variant-ghost-secondary={editor.isActive("paragraph") ? "is-active" : ""}
+ class:variant-ghost-success={editor.isActive("paragraph") ? "is-active" : ""}
class:hidden={!show_button_kv.paragraph}
title="Paragraph"
>
@@ -265,7 +250,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().toggleHeading({ level: 1 }).run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md text-xs"
- class:variant-ghost-secondary={editor.isActive("heading", { level: 1 }) ? "is-active" : ""}
+ class:variant-ghost-success={editor.isActive("heading", { level: 1 }) ? "is-active" : ""}
class:hidden={!show_button_kv.heading__h1}
title="Heading 1 "
>
@@ -276,7 +261,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().toggleHeading({ level: 2 }).run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md text-xs"
- class:variant-ghost-secondary={editor.isActive("heading", { level: 2 }) ? "is-active" : ""}
+ class:variant-ghost-success={editor.isActive("heading", { level: 2 }) ? "is-active" : ""}
class:hidden={!show_button_kv.heading__h2}
title="Heading 2 "
>
@@ -289,7 +274,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().toggleHeading({ level: 3 }).run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md text-xs"
- class:variant-ghost-secondary={editor.isActive("heading", { level: 3 }) ? "is-active" : ""}
+ class:variant-ghost-success={editor.isActive("heading", { level: 3 }) ? "is-active" : ""}
class:hidden={!show_button_kv.heading__h3}
title="Heading 3 "
>
@@ -300,7 +285,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().toggleHeading({ level: 4 }).run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md"
- class:variant-ghost-secondary={editor.isActive("heading", { level: 4 }) ? "is-active" : ""}
+ class:variant-ghost-success={editor.isActive("heading", { level: 4 }) ? "is-active" : ""}
class:hidden={!show_button_kv.heading__h4}
title="Heading 4 "
>
@@ -310,7 +295,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().toggleHeading({ level: 5 }).run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md"
- class:variant-ghost-secondary={editor.isActive("heading", { level: 5 }) ? "is-active" : ""}
+ class:variant-ghost-success={editor.isActive("heading", { level: 5 }) ? "is-active" : ""}
class:hidden={!show_button_kv.heading__h5}
title="Heading 5 "
>
@@ -320,7 +305,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().toggleHeading({ level: 6 }).run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md"
- class:variant-ghost-secondary={editor.isActive("heading", { level: 6 }) ? "is-active" : ""}
+ class:variant-ghost-success={editor.isActive("heading", { level: 6 }) ? "is-active" : ""}
class:hidden={!show_button_kv.heading__h6}
title="Heading 6 "
>
@@ -334,7 +319,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().toggleBulletList().run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md"
- class:variant-ghost-secondary={editor.isActive("bulletList") ? "is-active" : ""}
+ class:variant-ghost-success={editor.isActive("bulletList") ? "is-active" : ""}
class:hidden={!show_button_kv.bulletList}
title="Bullet list"
>
@@ -345,7 +330,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().toggleOrderedList().run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md"
- class:variant-ghost-secondary={editor.isActive("orderedList") ? "is-active" : ""}
+ class:variant-ghost-success={editor.isActive("orderedList") ? "is-active" : ""}
class:hidden={!show_button_kv.orderedList}
title="Ordered list"
>
@@ -356,7 +341,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().toggleCodeBlock().run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md"
- class:variant-ghost-secondary={editor.isActive("codeBlock") ? "is-active" : ""}
+ class:variant-ghost-success={editor.isActive("codeBlock") ? "is-active" : ""}
class:hidden={!show_button_kv.codeBlock}
title="Code block"
>
@@ -366,7 +351,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().toggleBlockquote().run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md"
- class:variant-ghost-secondary={editor.isActive("blockquote") ? "is-active" : ""}
+ class:variant-ghost-success={editor.isActive("blockquote") ? "is-active" : ""}
class:hidden={!show_button_kv.blockquote}
title="Blockquote"
>
@@ -397,28 +382,53 @@ function getContent() {
+
+
+
+
+
-
+ -->
@@ -427,7 +437,7 @@ function getContent() {
type="button"
on:click={() => editor.chain().focus().setColor('#958DF1').run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md"
- class:variant-ghost-secondary={editor.isActive('textStyle', { color: '#958DF1' }) ? 'is-active' : ''}
+ class:variant-ghost-success={editor.isActive('textStyle', { color: '#958DF1' }) ? 'is-active' : ''}
class:hidden={!show_button_kv.color__purple}
>
Purple
@@ -439,9 +449,11 @@ function getContent() {