|
|
@ -31,62 +31,93 @@ const setAlign = (alignment) => { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="flex items-center space-x-2 flex-wrap"> |
|
|
|
<div class="flex items-center space-x-1 flex-wrap text-sm text-gray-800"> |
|
|
|
|
|
|
|
<button |
|
|
|
|
|
|
|
@click="editor.chain().focus().toggleHeading({ level: 1 }).run()" |
|
|
|
|
|
|
|
class="px-2 py-0.5 rounded-lg hover:bg-gray-200 bg-gray-300 my-0.5" |
|
|
|
|
|
|
|
:class="{ 'bg-gray-400': editor.isActive('heading', { level: 1 }) }" |
|
|
|
|
|
|
|
title="Heading 1" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
T1 |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
|
|
|
|
@click="editor.chain().focus().toggleHeading({ level: 2 }).run()" |
|
|
|
|
|
|
|
class="px-2 py-0.5 rounded-lg hover:bg-gray-200 bg-gray-300 my-0.5" |
|
|
|
|
|
|
|
:class="{ 'bg-gray-400': editor.isActive('heading', { level: 2 }) }" |
|
|
|
|
|
|
|
title="Heading 2" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
T2 |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
|
|
|
|
@click="editor.chain().focus().toggleHeading({ level: 3 }).run()" |
|
|
|
|
|
|
|
class="px-2 py-0.5 rounded-lg hover:bg-gray-200 bg-gray-300 my-0.5" |
|
|
|
|
|
|
|
:class="{ 'bg-gray-400': editor.isActive('heading', { level: 3 }) }" |
|
|
|
|
|
|
|
title="Heading 3" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
T3 |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
|
|
|
|
@click="editor.chain().focus().toggleHeading({ level: 4 }).run()" |
|
|
|
|
|
|
|
class="px-2 py-0.5 rounded-lg hover:bg-gray-200 bg-gray-300 my-0.5" |
|
|
|
|
|
|
|
:class="{ 'bg-gray-400': editor.isActive('heading', { level: 4 }) }" |
|
|
|
|
|
|
|
title="Heading 3" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
T4 |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
<button |
|
|
|
|
|
|
|
@click="editor.chain().focus().setParagraph().run()" |
|
|
|
|
|
|
|
class="px-2 py-0.5 rounded-lg hover:bg-gray-200 bg-gray-300 my-0.5" |
|
|
|
|
|
|
|
:class="{ 'bg-gray-400': editor.isActive('paragraph') }" |
|
|
|
|
|
|
|
title="Paragraph" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
paragraphe |
|
|
|
|
|
|
|
</button> |
|
|
|
<button |
|
|
|
<button |
|
|
|
@click="editor.chain().focus().toggleBold().run()" |
|
|
|
@click="editor.chain().focus().toggleBold().run()" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
class="px-2 py-0.5 rounded-lg hover:bg-gray-200 bg-gray-300 my-0.5" |
|
|
|
:class="{ 'bg-gray-200': editor.isActive('bold') }" |
|
|
|
:class="{ 'bg-gray-400': editor.isActive('bold') }" |
|
|
|
title="Bold" |
|
|
|
title="Bold" |
|
|
|
> |
|
|
|
> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
|
gras |
|
|
|
<path d="M6 12h8a4 4 0 0 0 0-8H6v8z"></path> |
|
|
|
|
|
|
|
<path d="M6 12h9a4 4 0 0 1 0 8H6v-8z"></path> |
|
|
|
|
|
|
|
</svg> |
|
|
|
|
|
|
|
</button> |
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
<button |
|
|
|
@click="editor.chain().focus().toggleItalic().run()" |
|
|
|
@click="editor.chain().focus().toggleItalic().run()" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
class="px-2 py-0.5 rounded-lg hover:bg-gray-200 bg-gray-300 my-0.5" |
|
|
|
:class="{ 'bg-gray-200': editor.isActive('italic') }" |
|
|
|
:class="{ 'bg-gray-400': editor.isActive('italic') }" |
|
|
|
title="Italic" |
|
|
|
title="Italic" |
|
|
|
> |
|
|
|
> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
|
italic |
|
|
|
<path d="M19 4h-9v2h3.5l-3.5 8h-3v2h9v-2h-3.5l3.5-8h3z"></path> |
|
|
|
|
|
|
|
</svg> |
|
|
|
|
|
|
|
</button> |
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
<button |
|
|
|
@click="editor.chain().focus().toggleUnderline().run()" |
|
|
|
@click="editor.chain().focus().toggleUnderline().run()" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
class="px-2 py-0.5 rounded-lg hover:bg-gray-200 bg-gray-300 my-0.5" |
|
|
|
:class="{ 'bg-gray-200': editor.isActive('underline') }" |
|
|
|
:class="{ 'bg-gray-400': editor.isActive('underline') }" |
|
|
|
title="Underline" |
|
|
|
title="Underline" |
|
|
|
> |
|
|
|
> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
|
sous-ligner |
|
|
|
<path d="M6 4v6a6 6 0 0 0 6 6 6 6 0 0 0 6-6V4"></path> |
|
|
|
|
|
|
|
<line x1="4" y1="20" x2="20" y2="20"></line> |
|
|
|
|
|
|
|
</svg> |
|
|
|
|
|
|
|
</button> |
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
<button |
|
|
|
@click="editor.chain().focus().toggleStrike().run()" |
|
|
|
@click="editor.chain().focus().toggleStrike().run()" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
class="px-2 py-0.5 rounded-lg hover:bg-gray-200 bg-gray-300 my-0.5" |
|
|
|
:class="{ 'bg-gray-200': editor.isActive('strike') }" |
|
|
|
:class="{ 'bg-gray-400': editor.isActive('strike') }" |
|
|
|
title="Strikethrough" |
|
|
|
title="Strikethrough" |
|
|
|
> |
|
|
|
> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
|
barrer |
|
|
|
<path d="M17 9V5H7v4"></path> |
|
|
|
|
|
|
|
<path d="M16 15v4H8v-4"></path> |
|
|
|
|
|
|
|
<line x1="5" y1="12" x2="19" y2="12"></line> |
|
|
|
|
|
|
|
</svg> |
|
|
|
|
|
|
|
</button> |
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex items-center justify-center"> |
|
|
|
<div class="flex items-center justify-center"> |
|
|
|
<button |
|
|
|
<button |
|
|
|
@click="!editor.state.selection.empty ? editor.chain().focus().toggleHighlight({color: highlight}).run() : highColor.click()" |
|
|
|
@click="!editor.state.selection.empty ? editor.chain().focus().toggleHighlight({color: highlight}).run() : highColor.click()" |
|
|
|
class="px-1 rounded" |
|
|
|
class="px-2 py-0.5 rounded-lg" |
|
|
|
:style="'background-color:'+highlight" |
|
|
|
:style="'background-color:'+highlight" |
|
|
|
title="Highlight" |
|
|
|
title="Highlight" |
|
|
|
>A</button> |
|
|
|
>sur-ligner</button> |
|
|
|
<input |
|
|
|
<input |
|
|
|
type="color" |
|
|
|
type="color" |
|
|
|
@input="(e) => highlight = e.target.value" |
|
|
|
@input="(e) => highlight = e.target.value" |
|
|
@ -98,7 +129,7 @@ const setAlign = (alignment) => { |
|
|
|
<div class="flex items-center space-x-1"> |
|
|
|
<div class="flex items-center space-x-1"> |
|
|
|
<label |
|
|
|
<label |
|
|
|
@click="!editor.state.selection.empty || editor.state.isFocused ? setColor(color) : textColor.click()" |
|
|
|
@click="!editor.state.selection.empty || editor.state.isFocused ? setColor(color) : textColor.click()" |
|
|
|
class="text-lg text-medium" :style="'color: ' + color">A</label> |
|
|
|
class="px-2 py-0.5 rounded-lg hover:bg-gray-200 bg-gray-300 my-0.5" :style="'color: ' + color">couleur</label> |
|
|
|
<input |
|
|
|
<input |
|
|
|
type="color" |
|
|
|
type="color" |
|
|
|
@input="(e) => color = e.target.value" |
|
|
|
@input="(e) => color = e.target.value" |
|
|
@ -110,20 +141,18 @@ const setAlign = (alignment) => { |
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
<button |
|
|
|
@click="editor.chain().focus().clearNodes().run()" |
|
|
|
@click="editor.chain().focus().clearNodes().run()" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
class="px-2 py-0.5 rounded-lg hover:bg-red-600 bg-red-500 my-0.5 text-white" |
|
|
|
title="Clear Formatting" |
|
|
|
title="Clear Formatting" |
|
|
|
> |
|
|
|
> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
|
retirer tout format |
|
|
|
<path d="M12 20h9"></path> |
|
|
|
|
|
|
|
<path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path> |
|
|
|
|
|
|
|
<line x1="2" y1="2" x2="22" y2="22"></line> |
|
|
|
|
|
|
|
</svg> |
|
|
|
|
|
|
|
</button> |
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="border-l border-gray-300 h-full mx-4"></div> |
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
<button |
|
|
|
@click="setAlign('left')" |
|
|
|
@click="setAlign('left')" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
:class="{ 'bg-gray-200': editor.isActive({ textAlign: 'left' }) }" |
|
|
|
:class="{ 'bg-gray-400': editor.isActive({ textAlign: 'left' }) }" |
|
|
|
title="Align Left" |
|
|
|
title="Align Left" |
|
|
|
> |
|
|
|
> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
@ -137,7 +166,7 @@ const setAlign = (alignment) => { |
|
|
|
<button |
|
|
|
<button |
|
|
|
@click="setAlign('center')" |
|
|
|
@click="setAlign('center')" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
:class="{ 'bg-gray-200': editor.isActive({ textAlign: 'center' }) }" |
|
|
|
:class="{ 'bg-gray-400': editor.isActive({ textAlign: 'center' }) }" |
|
|
|
title="Align Center" |
|
|
|
title="Align Center" |
|
|
|
> |
|
|
|
> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
@ -151,7 +180,7 @@ const setAlign = (alignment) => { |
|
|
|
<button |
|
|
|
<button |
|
|
|
@click="setAlign('right')" |
|
|
|
@click="setAlign('right')" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
:class="{ 'bg-gray-200': editor.isActive({ textAlign: 'right' }) }" |
|
|
|
:class="{ 'bg-gray-400': editor.isActive({ textAlign: 'right' }) }" |
|
|
|
title="Align Right" |
|
|
|
title="Align Right" |
|
|
|
> |
|
|
|
> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
@ -165,7 +194,7 @@ const setAlign = (alignment) => { |
|
|
|
<button |
|
|
|
<button |
|
|
|
@click="setAlign('justify')" |
|
|
|
@click="setAlign('justify')" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
class="p-1 rounded hover:bg-gray-100" |
|
|
|
:class="{ 'bg-gray-200': editor.isActive({ textAlign: 'justify' }) }" |
|
|
|
:class="{ 'bg-gray-400': editor.isActive({ textAlign: 'justify' }) }" |
|
|
|
title="Justify" |
|
|
|
title="Justify" |
|
|
|
> |
|
|
|
> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor"> |
|
|
@ -175,11 +204,5 @@ const setAlign = (alignment) => { |
|
|
|
<line x1="21" y1="18" x2="3" y2="18"></line> |
|
|
|
<line x1="21" y1="18" x2="3" y2="18"></line> |
|
|
|
</svg> |
|
|
|
</svg> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
|
|
<div class="border-l border-gray-300 h-8 mx-2"></div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="text-sm text-gray-600"> |
|
|
|
|
|
|
|
Tip: Select text blocks or images before applying alignment. |
|
|
|
|
|
|
|
</p> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |