Skip to content

Commit 89baa5d

Browse files
committed
wip: Add indent and unindent buttons
1 parent 60388aa commit 89baa5d

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

components/CoreEditor.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ export default defineComponent({
8080
instance.value?.format(type, {})
8181
}
8282
83+
// const indent = () => {
84+
85+
// }
86+
8387
const handleUpload = async (event: Event) => {
8488
const target = event.target as HTMLInputElement
8589

components/CoreEditorToolbar.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ withDefaults(defineProps<{
66
code?: boolean,
77
heading?: boolean,
88
image?: boolean,
9+
indent?: boolean,
910
italic?: boolean,
1011
link?: boolean,
1112
numberList?: boolean,
1213
taskList?: boolean,
14+
unindent?: boolean,
1315
upload?: boolean,
1416
}>(), {
1517
blockquote: true,
@@ -18,10 +20,12 @@ withDefaults(defineProps<{
1820
code: true,
1921
heading: true,
2022
image: true,
23+
indent: true,
2124
italic: true,
2225
link: true,
2326
numberList: true,
2427
taskList: true,
28+
unindent: true,
2529
upload: false,
2630
})
2731
@@ -32,10 +36,12 @@ defineEmits<{
3236
code: [],
3337
heading: [],
3438
image: [],
39+
indent: [],
3540
italic: [],
3641
link: [],
3742
numberList: [],
3843
taskList: [],
44+
unindent: [],
3945
upload: [event: Event],
4046
}>()
4147
@@ -48,6 +54,14 @@ const triggerUpload = () => {
4854

4955
<template>
5056
<div class="flex gap-1 lg:gap-4">
57+
<div v-if="indent || unindent" class="flex gap-1">
58+
<CoreButton v-if="indent" class="p-1 border border-layer" title="Indent" @click="$emit('indent')">
59+
<Icon name="FormatIndent" size="1.5rem" />
60+
</CoreButton>
61+
<CoreButton v-if="unindent" class="p-1 border border-layer" title="Unindent" @click="$emit('unindent')">
62+
<Icon name="FormatUnindent" size="1.5rem" />
63+
</CoreButton>
64+
</div>
5165
<div v-if="heading || bold || italic" class="flex gap-1">
5266
<CoreButton v-if="heading" class="p-1 border border-layer" title="Heading" @click="$emit('heading')">
5367
<Icon name="FormatHeading" size="1.5rem" />

components/Icon.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ const icons = {
5353
FormatCode: Tabler.IconCode,
5454
FormatHeading: Tabler.IconHeading,
5555
FormatImage: Tabler.IconPhoto,
56+
FormatIndent: Tabler.IconIndentIncrease,
5657
FormatItalic: Tabler.IconItalic,
5758
FormatLink: Tabler.IconLink,
5859
FormatListBulleted: Tabler.IconList,
5960
FormatListChecked: Tabler.IconListCheck,
6061
FormatListNumbered: Tabler.IconListNumbers,
62+
FormatUnindent: Tabler.IconIndentDecrease,
6163
FormatUpload: Tabler.IconUpload,
6264
Graph: Tabler.IconAffiliate,
6365
ImagePlus: Tabler.IconPhotoPlus,

0 commit comments

Comments
 (0)