Skip to content

Commit

Permalink
feat(editor): aside commands example
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Sep 21, 2021
1 parent f828ef1 commit e3b5f96
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 0 deletions.
1 change: 1 addition & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
declare module 'vue' {
export interface GlobalComponents {
AsideBar: typeof import('E:/dev/projects/write-better/src/components/editor/aside/AsideBar.vue')['default']
AsideBarCommands: typeof import('E:/dev/projects/write-better/src/components/editor/aside/AsideBarCommands.vue')['default']
AsideBarItem: typeof import('E:/dev/projects/write-better/src/components/editor/aside/AsideBarItem.vue')['default']
AsideGraph: typeof import('E:/dev/projects/write-better/src/components/editor/aside/AsideGraph.vue')['default']
Disclosure: typeof import('@headlessui/vue')['Disclosure']
Expand Down
58 changes: 58 additions & 0 deletions src/components/editor/aside/AsideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,64 @@
</svg>
</HeroIcon>
</template>
<AsideBarCommands
:title="t('editor.aside.commands.contents[0].title')"
:description="t('editor.aside.commands.contents[0].description')"
>
<template #exib>
<p class="text-xl">{{ t('editor.aside.commands.contents[0].tag') }}</p>
</template>
</AsideBarCommands>
<AsideBarCommands
:title="t('editor.aside.commands.contents[1].title')"
:description="t('editor.aside.commands.contents[1].description')"
>
<template #exib>
<p class="font-bold text-xl">
{{ t('editor.aside.commands.contents[1].tag') }}
</p>
</template>
</AsideBarCommands>
<AsideBarCommands
:title="t('editor.aside.commands.contents[2].title')"
:description="t('editor.aside.commands.contents[2].description')"
>
<template #exib>
<p class="font-italic text-xl">
{{ t('editor.aside.commands.contents[2].tag') }}
</p>
</template>
</AsideBarCommands>
<AsideBarCommands
:title="t('editor.aside.commands.contents[3].title')"
:description="t('editor.aside.commands.contents[3].description')"
>
<template #exib>
<p class="font-bold text-xl">
{{ t('editor.aside.commands.contents[3].tag') }}
</p>
</template>
</AsideBarCommands>
<AsideBarCommands
:title="t('editor.aside.commands.contents[4].title')"
:description="t('editor.aside.commands.contents[4].description')"
>
<template #exib>
<p class="font-bold text-xl">
{{ t('editor.aside.commands.contents[4].tag') }}
</p>
</template>
</AsideBarCommands>
<AsideBarCommands
:title="t('editor.aside.commands.contents[5].title')"
:description="t('editor.aside.commands.contents[5].description')"
>
<template #exib>
<p class="font-bold text-xl">
{{ t('editor.aside.commands.contents[5].tag') }}
</p>
</template>
</AsideBarCommands>
</AsideBarItem>
<AsideBarItem :title="t('editor.aside.project.title')">
<template #icon>
Expand Down
30 changes: 30 additions & 0 deletions src/components/editor/aside/AsideBarCommands.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<div
class="
flex
mt-2
justify-between
items-center
w-full
p-1
border-2 border-black
dark:border-gray-600
text-black
dark:text-gray-300
rounded
"
>
<slot name="exib" />
<div class="flex flex-col items-start justify-start">
<p>{{ props.title }}</p>
<p class="text-xs">{{ props.description }}</p>
</div>
</div>
</template>

<script setup lang="ts">
const props = defineProps({
title: String,
description: String,
})
</script>
32 changes: 32 additions & 0 deletions src/lang/br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,38 @@ export default {
},
commands: {
title: 'Comandos',
contents: [
{
tag: 'P',
title: 'Parágrafo',
description: '/p texto aqui',
},
{
tag: 'B',
title: 'Negrito',
description: '&texto aqui&',
},
{
tag: 'I',
title: 'Itálico',
description: '*texto aqui*',
},
{
tag: 'H1',
title: 'Heading 1',
description: '/h1 texto aqui',
},
{
tag: 'H2',
title: 'Heading 2',
description: '/h2 texto aqui',
},
{
tag: 'H3',
title: 'Heading 3',
description: '/h3 texto aqui',
},
],
},
},
},
Expand Down
32 changes: 32 additions & 0 deletions src/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,38 @@ export default {
},
commands: {
title: 'Commands',
contents: [
{
tag: 'P',
title: 'Paragraph',
description: '/p text here',
},
{
tag: 'B',
title: 'Bold',
description: '&text here&',
},
{
tag: 'I',
title: 'Italic',
description: '*text here*',
},
{
tag: 'H1',
title: 'Heading 1',
description: '/h1 text here',
},
{
tag: 'H2',
title: 'Heading 2',
description: '/h2 text here',
},
{
tag: 'H3',
title: 'Heading 3',
description: '/h3 text here',
},
],
},
},
},
Expand Down

0 comments on commit e3b5f96

Please sign in to comment.