From ca75d540bf9b5a681e1ba59ec8d36800b700444b Mon Sep 17 00:00:00 2001 From: wouter-adriaens Date: Mon, 7 Oct 2024 13:29:30 +0200 Subject: [PATCH] #326 Extend options + fix toolbar layout --- src/components/dumb/OeEditor.vue | 44 +++++++++++++++++-- src/models/editor.ts | 9 ++++ src/stories/dumb-components/editor.stories.ts | 9 ++++ 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/src/components/dumb/OeEditor.vue b/src/components/dumb/OeEditor.vue index cbff554..f9ca288 100644 --- a/src/components/dumb/OeEditor.vue +++ b/src/components/dumb/OeEditor.vue @@ -23,16 +23,44 @@ -
+
+ + +
+ +
+ + +
+ +
+ +
-
+
+ + +
+ +
+ +
+ +
+ + + +
@@ -78,12 +106,21 @@ const props = withDefaults(defineProps(), { undo: true, redo: true, header: true, + blockquote: false, + codeblock: false, bold: true, italic: true, + strike: false, + underline: false, + color: false, + background: false, + sub: false, + super: false, bullist: true, numlist: true, indent: true, outdent: true, + align: false, removeformat: true, biblio: false, private: false, @@ -185,6 +222,7 @@ watch( .ql-toolbar { display: flex; justify-content: space-between; + padding: 8px 2px; :deep(.ql-formats) { margin-right: 0; @@ -205,7 +243,7 @@ watch( .toolbar-group { position: relative; - padding: 0 8px; + padding: 0 2px; &::after { content: ''; diff --git a/src/models/editor.ts b/src/models/editor.ts index 0a768f1..8dcb3f9 100644 --- a/src/models/editor.ts +++ b/src/models/editor.ts @@ -23,12 +23,21 @@ export interface OeEditorToolbarConfig { undo?: boolean; redo?: boolean; header?: boolean; + blockquote: boolean; + codeblock: boolean; bold?: boolean; italic?: boolean; + underline?: boolean; + strike?: boolean; + color?: boolean; + background?: boolean; + sub?: boolean; + super?: boolean; bullist?: boolean; numlist?: boolean; outdent?: boolean; indent?: boolean; + align?: boolean; removeformat?: boolean; private?: boolean; biblio?: boolean; diff --git a/src/stories/dumb-components/editor.stories.ts b/src/stories/dumb-components/editor.stories.ts index 459b259..e1c85aa 100644 --- a/src/stories/dumb-components/editor.stories.ts +++ b/src/stories/dumb-components/editor.stories.ts @@ -78,11 +78,20 @@ export const FulloptionToolbar: Story = { redo: true, bold: true, italic: true, + strike: true, + underline: true, + color: true, + background: true, + sub: true, + super: true, + blockquote: true, + codeblock: true, bullist: true, numlist: true, fullscreen: true, indent: true, outdent: true, + align: true, code: true, private: true, header: true,