Skip to content

Commit

Permalink
feat(pdf): cover base image
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Oct 1, 2021
1 parent 740d24b commit 295a2eb
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 5 deletions.
31 changes: 31 additions & 0 deletions src/components/editor/pdf/PDFConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,32 @@
/>
</svg>
</HeroIcon>
<PDFConfigurationSlot>
<template #title>
<h2 class="text-2xl font-bold font-poppins">
{{ t('editor.pdf.custom.title.cover') }}
</h2>
</template>
<div
class="
flex flex-row flex-wrap
justify-start
items-center
my-3
overflow-x-hidden
"
>
<div class="wb-input-container">
<label class="mx-2 text-xs">{{
t('editor.pdf.base.pageSize')
}}</label>
<InputFile
:title="t('generics.input.image')"
@load="onCoverImageLoad"
/>
</div>
</div>
</PDFConfigurationSlot>
<PDFConfigurationSlot>
<template #title>
<h2 class="text-2xl font-bold font-poppins">
Expand Down Expand Up @@ -630,6 +656,7 @@
store.commit('pdf/setStyles', {
base: {
...base,
background: _base.value.background,
pageMargins: basePageMargins,
},
paragraph,
Expand All @@ -641,4 +668,8 @@
store.commit('absolute/switchPdfConfiguration', false)
}
const onCoverImageLoad = (e: any) => {
store.commit('pdf/setBackground', e)
}
</script>
1 change: 1 addition & 0 deletions src/lang/br/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default {
},
custom: {
title: {
cover: 'Capa',
paragraph: 'Parágrafo',
headingOne: 'Título Principal',
headingTwo: 'Título Secundário',
Expand Down
5 changes: 5 additions & 0 deletions src/lang/br/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ import editor from './editor'

export default {
editor,
generics: {
input: {
image: 'Inserir Imagem',
},
},
}
9 changes: 5 additions & 4 deletions src/lang/en/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ export default {
pageOrientation: 'Orientations',
pageMargins: {
title: 'Margins',
left: 'Esquerda',
top: 'Cima',
right: 'Direita',
bottom: 'Baixo',
left: 'Left',
top: 'Top',
right: 'Right',
bottom: 'Bottom',
},
},
custom: {
title: {
cover: 'Cover',
paragraph: 'Paragraph',
headingOne: 'Heading One',
headingTwo: 'Heading Two',
Expand Down
5 changes: 5 additions & 0 deletions src/lang/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ import editor from './editor'

export default {
editor,
generics: {
input: {
image: 'Insert Image',
},
},
}
1 change: 0 additions & 1 deletion src/use/pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export const usePDF: Callback<any> = () => {
const pages: Array<ContextState> = store.state.project.pages
const arr: Array<any> = []

// TODO: Resolve this
const cover = frontCover(store)
arr.push(cover)

Expand Down

0 comments on commit 295a2eb

Please sign in to comment.