Commit 1d945699 authored by Christos's avatar Christos

Merge branch 'author-style' into 'master'

author package

See merge request wax/wax!242
parents 1addfe6b 108ce865
......@@ -10,6 +10,7 @@ import MainConverter from './setup/MainConverter'
import defaultToolPanels from './setup/defaultToolPanels'
import ucpToolPanels from './setup/ucpToolPanels'
// My Elements
import AuthorPackage from './elements/author/AuthorPackage'
import BibliographyEntryPackage from './elements/bibliographyEntry/BibliographyEntryPackage'
import PersistencePackage from './elements/persistence/PersistencePackage'
import ChapterSubtitlePackage from './elements/chapterSubtitle/ChapterSubtitlePackage'
......@@ -70,7 +71,20 @@ const config = {
config.import(defaultToolPanels)
config.import(ucpToolPanels)
// Packages
// Block Level Packages
config.import(ChapterTitlePackage)
config.import(ChapterSubtitlePackage)
config.import(AuthorPackage)
config.import(ParagraphPackage)
config.import(ParagraphContdPackage)
config.import(ExtractProsePackage)
config.import(ExtractPoetryPackage)
config.import(EpigraphProsePackage)
config.import(EpigraphPoetryPackage)
config.import(BibliographyEntryPackage)
config.import(SourceNotePackage)
config.import(HeadingPackage)
config.import(TablePackage)
config.import(StrongPackage)
config.import(EmphasisPackage)
......@@ -89,27 +103,16 @@ const config = {
config.import(NotePanePackage)
config.import(SpellCheckPackage)
config.import(TrackChangePackage)
config.import(ParagraphPackage)
config.import(ParagraphContdPackage)
config.import(ChapterTitlePackage)
config.import(ChapterSubtitlePackage)
config.import(ExtractProsePackage)
config.import(ExtractPoetryPackage)
config.import(EpigraphProsePackage)
config.import(EpigraphPoetryPackage)
config.import(DiacriticsPackage)
config.import(FindAndReplacePackage)
config.import(BibliographyEntryPackage)
config.import(SourceNotePackage)
config.import(HeadingPackage)
config.import(SwitchSurfacePackage)
config.import(FullScreenPackage)
config.import(HighLighterPackage)
config.import(FullScreenPackage)
config.import(ShortCutsModalPackage)
config.import(SpellCheckTogglePackage)
config.import(QuoteMarksPackage)
config.import(ChangeCasePackage)
// config.import(InlineNotePackage)
},
}
......
import { TextBlock } from 'substance'
class Author extends TextBlock {}
Author.type = 'author'
export default Author
import { TextBlockComponent } from 'substance'
class AuthorComponent extends TextBlockComponent {
render($$) {
let el = super.render($$)
return el.addClass('sc-author')
}
}
export default AuthorComponent
export default {
type: 'author',
tagName: 'author',
import: (el, node, converter) => {
node.content = converter.annotatedText(el, [node.id, 'content'])
},
export: (node, el, converter) => {
el.append(converter.annotatedText([node.id, 'content']))
},
}
import Author from './Author'
import AuthorComponent from './AuthorComponent'
import AuthorHTMLConverter from './AuthorHTMLConverter'
import WaxSwitchTextTypeCommand from '../../commands/WaxSwitchTextTypeCommand'
export default {
name: 'author',
configure: config => {
config.addNode(Author)
config.addComponent(Author.type, AuthorComponent)
config.addConverter('html', AuthorHTMLConverter)
config.addCommand('author', WaxSwitchTextTypeCommand, {
spec: { type: 'author' },
commandGroup: 'text-display',
})
config.addIcon('author', { fontawesome: 'fa-author' })
config.addLabel('author', {
en: 'Author',
})
config.addKeyboardShortcut('CommandOrControl+Alt+0', {
command: 'author',
})
},
Author: Author,
AuthorComponent: AuthorComponent,
AuthorHTMLConverter: AuthorHTMLConverter,
}
......@@ -15,6 +15,8 @@ $note-blue: #4990e2;
$content: #4a4a4a;
$color-grey: #828282;
.wax-e-editoria {
font-family: 'Vollkorn';
font-size: 16px;
......@@ -53,6 +55,33 @@ $content: #4a4a4a;
text-indent: 0;
}
//Author
.wax-e-editoria .sc-author {
font-variant: all-small-caps;
font-weight: 400;
letter-spacing: 0.06em;
border-bottom: 1px solid $color-grey;
min-width: 40ch;
display: inline-block;
&::before {
font-weight: 400;
content: 'by ';
white-space: pre-wrap;
font-style: italic;
color: $color-grey;
font-variant: none;
letter-spacing: normal;
font-family: 'Vollkorn';
font-size: 0.8em;
}
&:focus::before {
content: ' ';
margin-right: 20px;
}
}
// bibliography
.wax-e-editoria .sc-bibliography-entry {
padding-left: 25px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment