bookish-press 0.4.0 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/components/Auth.svelte +19 -14
- package/components/Auth.svelte.d.ts +4 -4
- package/components/Authentication.d.ts +2 -2
- package/components/BookPreview.svelte +77 -59
- package/components/BookPreview.svelte.d.ts +5 -5
- package/components/External.svelte +1 -1
- package/components/External.svelte.d.ts +3 -3
- package/components/Link.svelte +49 -3
- package/components/Link.svelte.d.ts +3 -4
- package/components/app/BookList.svelte +19 -0
- package/components/app/BookList.svelte.d.ts +18 -0
- package/components/app/Button.svelte +49 -0
- package/components/app/Button.svelte.d.ts +22 -0
- package/components/app/Feedback.svelte +45 -0
- package/components/app/Feedback.svelte.d.ts +18 -0
- package/components/app/Head.svelte +12 -0
- package/components/app/Head.svelte.d.ts +27 -0
- package/components/app/Large.svelte +8 -0
- package/components/app/Large.svelte.d.ts +27 -0
- package/components/app/Lead.svelte +12 -0
- package/components/app/Lead.svelte.d.ts +27 -0
- package/components/app/Link.svelte +24 -0
- package/components/app/Link.svelte.d.ts +20 -0
- package/components/app/Options.svelte +24 -0
- package/components/app/Options.svelte.d.ts +19 -0
- package/components/app/Paragraph.svelte +19 -0
- package/components/app/Paragraph.svelte.d.ts +18 -0
- package/components/app/Table.svelte +32 -0
- package/components/app/Table.svelte.d.ts +27 -0
- package/components/app/TextInput.svelte +37 -0
- package/components/app/TextInput.svelte.d.ts +22 -0
- package/components/app/Writing.svelte +13 -0
- package/components/app/Writing.svelte.d.ts +27 -0
- package/components/chapter/Atom.svelte +20 -6
- package/components/chapter/Atom.svelte.d.ts +3 -3
- package/components/chapter/Block.svelte +23 -20
- package/components/chapter/Block.svelte.d.ts +4 -4
- package/components/chapter/Callout.svelte +38 -7
- package/components/chapter/Callout.svelte.d.ts +4 -4
- package/components/chapter/CaptionedCode.svelte +66 -23
- package/components/chapter/CaptionedCode.svelte.d.ts +4 -4
- package/components/chapter/ChapterBody.svelte +61 -9
- package/components/chapter/ChapterBody.svelte.d.ts +4 -4
- package/components/chapter/Citations.svelte +86 -20
- package/components/chapter/Citations.svelte.d.ts +4 -4
- package/components/chapter/Code.svelte +152 -21
- package/components/chapter/Code.svelte.d.ts +3 -3
- package/components/chapter/Comment.svelte +38 -16
- package/components/chapter/Comment.svelte.d.ts +3 -3
- package/components/chapter/Definition.svelte +52 -18
- package/components/chapter/Definition.svelte.d.ts +5 -8
- package/components/chapter/Embed.svelte +154 -66
- package/components/chapter/Embed.svelte.d.ts +5 -4
- package/components/chapter/ErrorMessage.svelte +7 -2
- package/components/chapter/ErrorMessage.svelte.d.ts +4 -4
- package/components/chapter/ExtendedPrism.d.ts +2 -0
- package/components/chapter/ExtendedPrism.js +69 -0
- package/components/chapter/Figure.svelte +90 -0
- package/components/chapter/Figure.svelte.d.ts +24 -0
- package/components/chapter/Footnote.svelte +75 -12
- package/components/chapter/Footnote.svelte.d.ts +4 -4
- package/components/chapter/Format.svelte +60 -37
- package/components/chapter/Format.svelte.d.ts +4 -4
- package/components/chapter/InlineCode.svelte +15 -5
- package/components/chapter/InlineCode.svelte.d.ts +4 -4
- package/components/chapter/Label.svelte +37 -8
- package/components/chapter/Label.svelte.d.ts +4 -4
- package/components/chapter/Link.svelte +23 -18
- package/components/chapter/Link.svelte.d.ts +4 -4
- package/components/chapter/List.svelte +75 -8
- package/components/chapter/List.svelte.d.ts +4 -4
- package/components/chapter/Marginal.svelte +169 -27
- package/components/chapter/Marginal.svelte.d.ts +6 -3
- package/components/chapter/Paragraph.svelte +74 -6
- package/components/chapter/Paragraph.svelte.d.ts +4 -4
- package/components/chapter/Positioned.svelte +33 -0
- package/components/chapter/Positioned.svelte.d.ts +19 -0
- package/components/chapter/Problem.svelte +15 -0
- package/components/chapter/Problem.svelte.d.ts +27 -0
- package/components/chapter/Python.svelte +68 -21
- package/components/chapter/Python.svelte.d.ts +4 -4
- package/components/chapter/Quote.svelte +64 -11
- package/components/chapter/Quote.svelte.d.ts +4 -4
- package/components/chapter/Rule.svelte +12 -1
- package/components/chapter/Rule.svelte.d.ts +4 -4
- package/components/chapter/Table.svelte +36 -25
- package/components/chapter/Table.svelte.d.ts +4 -4
- package/components/chapter/Text.svelte +61 -36
- package/components/chapter/Text.svelte.d.ts +5 -4
- package/components/editor/BookishEditor.svelte +343 -237
- package/components/editor/BookishEditor.svelte.d.ts +5 -5
- package/components/editor/CalloutEditor.svelte +5 -5
- package/components/editor/CalloutEditor.svelte.d.ts +4 -4
- package/components/editor/CaptionedCodeEditor.svelte +16 -12
- package/components/editor/CaptionedCodeEditor.svelte.d.ts +4 -4
- package/components/editor/CaretContext.d.ts +48 -16
- package/components/editor/CaretState.d.ts +16 -44
- package/components/editor/CaretUtilities.d.ts +2 -2
- package/components/editor/CaretView.svelte +80 -0
- package/components/editor/CaretView.svelte.d.ts +24 -0
- package/components/editor/CitationsEditor.svelte +36 -25
- package/components/editor/CitationsEditor.svelte.d.ts +4 -4
- package/components/editor/Clipboard.d.ts +2 -2
- package/components/editor/Command.d.ts +13 -12
- package/components/editor/Commands.d.ts +1 -1
- package/components/editor/Commands.js +1114 -571
- package/components/editor/ConfirmButton.svelte +18 -12
- package/components/editor/ConfirmButton.svelte.d.ts +5 -4
- package/components/editor/DefinitionEditor.svelte +29 -21
- package/components/editor/DefinitionEditor.svelte.d.ts +4 -4
- package/components/editor/EmbedEditor.svelte +93 -43
- package/components/editor/EmbedEditor.svelte.d.ts +3 -3
- package/components/editor/Icon.svelte +17 -0
- package/components/editor/Icon.svelte.d.ts +16 -0
- package/components/editor/ImageChooser.svelte +53 -34
- package/components/editor/ImageChooser.svelte.d.ts +3 -3
- package/components/editor/InlineCodeEditor.svelte +7 -4
- package/components/editor/InlineCodeEditor.svelte.d.ts +4 -4
- package/components/editor/LabelEditor.svelte +20 -11
- package/components/editor/LabelEditor.svelte.d.ts +4 -4
- package/components/editor/LanguageEditor.svelte +10 -7
- package/components/editor/LanguageEditor.svelte.d.ts +3 -3
- package/components/editor/LinkEditor.svelte +64 -39
- package/components/editor/LinkEditor.svelte.d.ts +4 -4
- package/components/editor/Note.svelte +3 -3
- package/components/editor/Note.svelte.d.ts +6 -2
- package/components/editor/PositionEditor.svelte +9 -6
- package/components/editor/PositionEditor.svelte.d.ts +4 -4
- package/components/editor/QuoteEditor.svelte +7 -2
- package/components/editor/QuoteEditor.svelte.d.ts +4 -4
- package/components/editor/Switch.svelte +55 -28
- package/components/editor/Switch.svelte.d.ts +4 -4
- package/components/editor/TableEditor.svelte +10 -0
- package/components/editor/TableEditor.svelte.d.ts +17 -0
- package/components/editor/TextEditor.svelte +83 -45
- package/components/editor/TextEditor.svelte.d.ts +5 -4
- package/components/editor/Toggle.svelte +11 -8
- package/components/editor/Toggle.svelte.d.ts +4 -4
- package/components/editor/Toolbar.svelte +192 -144
- package/components/editor/Toolbar.svelte.d.ts +5 -8
- package/components/editor/ToolbarGroup.svelte +18 -23
- package/components/editor/ToolbarGroup.svelte.d.ts +3 -4
- package/components/editor/ToolbarSpacer.svelte +8 -1
- package/components/editor/ToolbarSpacer.svelte.d.ts +6 -2
- package/components/editor/URLEditor.svelte +6 -8
- package/components/editor/URLEditor.svelte.d.ts +3 -3
- package/components/editor/UndoState.d.ts +3 -3
- package/components/editor/icons/annotate.svg +1 -0
- package/components/editor/icons/block.svg +1 -0
- package/components/editor/icons/bold.svg +1 -0
- package/components/editor/icons/bullets.svg +1 -0
- package/components/editor/icons/callout.svg +1 -0
- package/components/editor/icons/citation.svg +8 -0
- package/components/editor/icons/clear.svg +1 -0
- package/components/editor/icons/clipboard.svg +1 -0
- package/components/editor/icons/code.svg +1 -0
- package/components/editor/icons/columnafter.svg +1 -0
- package/components/editor/icons/columnbefore.svg +1 -0
- package/components/editor/icons/comment.svg +1 -0
- package/components/editor/icons/copy.svg +1 -0
- package/components/editor/icons/cut.svg +1 -0
- package/components/editor/icons/define.svg +7 -0
- package/components/editor/icons/deletecolumn.svg +1 -0
- package/components/editor/icons/deleterow.svg +1 -0
- package/components/editor/icons/footnote.svg +8 -0
- package/components/editor/icons/header1.svg +7 -0
- package/components/editor/icons/header2.svg +7 -0
- package/components/editor/icons/header3.svg +7 -0
- package/components/editor/icons/home.svg +1 -0
- package/components/editor/icons/indent.svg +1 -0
- package/components/editor/icons/italic.svg +1 -0
- package/components/editor/icons/label.svg +1 -0
- package/components/editor/icons/left.svg +1 -0
- package/components/editor/icons/level.svg +1 -0
- package/components/editor/icons/link.svg +1 -0
- package/components/editor/icons/list.svg +1 -0
- package/components/editor/icons/media.svg +1 -0
- package/components/editor/icons/middle.svg +1 -0
- package/components/editor/icons/numbers.svg +10 -0
- package/components/editor/icons/paragraph.svg +1 -0
- package/components/editor/icons/paste.svg +10 -0
- package/components/editor/icons/quote.svg +1 -0
- package/components/editor/icons/redo.svg +1 -0
- package/components/editor/icons/right.svg +1 -0
- package/components/editor/icons/rowabove.svg +1 -0
- package/components/editor/icons/rowbelow.svg +1 -0
- package/components/editor/icons/rule.svg +1 -0
- package/components/editor/icons/sub.svg +1 -0
- package/components/editor/icons/super.svg +1 -0
- package/components/editor/icons/table.svg +1 -0
- package/components/editor/icons/text.svg +1 -0
- package/components/editor/icons/time.svg +1 -0
- package/components/editor/icons/undo.svg +1 -0
- package/components/editor/icons/unindent.svg +1 -0
- package/components/editor/icons/unlink.svg +1 -0
- package/components/page/Acknowledgements.svelte +31 -22
- package/components/page/Acknowledgements.svelte.d.ts +4 -4
- package/components/page/Authors.svelte +34 -14
- package/components/page/Authors.svelte.d.ts +6 -6
- package/components/page/BulkReferenceEditor.svelte +53 -22
- package/components/page/BulkReferenceEditor.svelte.d.ts +4 -4
- package/components/page/Chapter.svelte +196 -141
- package/components/page/Chapter.svelte.d.ts +3 -3
- package/components/page/ChapterContext.d.ts +4 -4
- package/components/page/ChapterNumber.svelte +9 -0
- package/components/page/ChapterNumber.svelte.d.ts +27 -0
- package/components/page/ChapterTitle.svelte +16 -0
- package/components/page/ChapterTitle.svelte.d.ts +18 -0
- package/components/page/Contexts.d.ts +31 -20
- package/components/page/Contexts.js +47 -17
- package/components/page/DefinitionView.svelte +115 -86
- package/components/page/DefinitionView.svelte.d.ts +3 -3
- package/components/page/Description.svelte +27 -18
- package/components/page/Description.svelte.d.ts +4 -4
- package/components/page/Edition.svelte +127 -74
- package/components/page/Edition.svelte.d.ts +4 -4
- package/components/page/Editions.svelte +144 -0
- package/components/page/Editions.svelte.d.ts +14 -0
- package/components/page/Glossary.svelte +57 -48
- package/components/page/Glossary.svelte.d.ts +4 -4
- package/components/page/Header.svelte +129 -44
- package/components/page/Header.svelte.d.ts +6 -6
- package/components/page/Index.svelte +114 -80
- package/components/page/Index.svelte.d.ts +4 -4
- package/components/page/Instructions.svelte +18 -16
- package/components/page/Instructions.svelte.d.ts +4 -4
- package/components/page/License.svelte +29 -21
- package/components/page/License.svelte.d.ts +4 -4
- package/components/page/Loading.svelte +102 -12
- package/components/page/Loading.svelte.d.ts +6 -2
- package/components/page/Media.svelte +77 -51
- package/components/page/Media.svelte.d.ts +4 -4
- package/components/page/MediaPreview.svelte +26 -8
- package/components/page/MediaPreview.svelte.d.ts +3 -3
- package/components/page/Muted.svelte +10 -0
- package/components/page/Muted.svelte.d.ts +27 -0
- package/components/page/Outline.svelte +279 -59
- package/components/page/Outline.svelte.d.ts +3 -3
- package/components/page/Page.svelte +40 -9
- package/components/page/Page.svelte.d.ts +3 -3
- package/components/page/PageHeader.svelte +14 -0
- package/components/page/PageHeader.svelte.d.ts +18 -0
- package/components/page/PageParagraph.svelte +18 -0
- package/components/page/PageParagraph.svelte.d.ts +27 -0
- package/components/page/PossibleChapter.svelte +7 -7
- package/components/page/PossibleChapter.svelte.d.ts +4 -4
- package/components/page/PossibleReference.svelte +6 -11
- package/components/page/PossibleReference.svelte.d.ts +6 -7
- package/components/page/Print.svelte +27 -3
- package/components/page/Print.svelte.d.ts +4 -4
- package/components/page/Reference.svelte +256 -113
- package/components/page/Reference.svelte.d.ts +5 -5
- package/components/page/References.svelte +39 -47
- package/components/page/References.svelte.d.ts +4 -4
- package/components/page/Rows.svelte +54 -0
- package/components/page/Rows.svelte.d.ts +27 -0
- package/components/page/Search.svelte +86 -63
- package/components/page/Search.svelte.d.ts +4 -4
- package/components/page/Status.svelte +43 -35
- package/components/page/Status.svelte.d.ts +4 -9
- package/components/page/SubdomainEditor.svelte +40 -27
- package/components/page/SubdomainEditor.svelte.d.ts +4 -4
- package/components/page/TableOfContents.svelte +225 -190
- package/components/page/TableOfContents.svelte.d.ts +4 -4
- package/components/page/TableOfContentsImage.svelte +8 -8
- package/components/page/TableOfContentsImage.svelte.d.ts +3 -3
- package/components/page/TableOfContentsRow.svelte +96 -33
- package/components/page/TableOfContentsRow.svelte.d.ts +4 -4
- package/components/page/ThemeEditor.svelte +174 -39
- package/components/page/ThemeEditor.svelte.d.ts +4 -4
- package/components/page/ThemeEditorPreview.svelte +35 -23
- package/components/page/ThemeEditorPreview.svelte.d.ts +5 -5
- package/components/page/ThemeSetEditor.svelte +15 -13
- package/components/page/ThemeSetEditor.svelte.d.ts +4 -4
- package/components/page/ThemeVariableEditor.svelte +24 -15
- package/components/page/ThemeVariableEditor.svelte.d.ts +3 -3
- package/components/page/Title.svelte +12 -0
- package/components/page/Title.svelte.d.ts +27 -0
- package/components/page/Unknown.svelte +25 -21
- package/components/page/Unknown.svelte.d.ts +4 -4
- package/components/page/margins.js +50 -33
- package/index.d.ts +14 -0
- package/index.js +14 -0
- package/models/CRUD.d.ts +17 -0
- package/models/CRUD.js +194 -0
- package/models/Firebase.js +17 -15
- package/models/book/Book.d.ts +24 -28
- package/models/book/Book.js +120 -113
- package/models/book/BookMedia.d.ts +3 -3
- package/models/book/BookMedia.js +22 -16
- package/models/book/BookSaveStatus.d.ts +7 -0
- package/models/book/BookSaveStatus.js +8 -0
- package/models/book/Chapter.d.ts +46 -39
- package/models/book/Chapter.js +180 -198
- package/models/book/ChapterID.js +7 -7
- package/models/book/Definition.d.ts +1 -1
- package/models/book/Edition.d.ts +62 -60
- package/models/book/Edition.js +385 -303
- package/models/book/Reference.d.ts +24 -0
- package/models/book/Reference.js +78 -0
- package/models/book/Schema.d.ts +169 -0
- package/models/book/Schema.js +114 -0
- package/models/book/Theme.d.ts +44 -37
- package/models/book/Theme.js +452 -52
- package/models/book/ThemeColors.d.ts +1 -1
- package/models/book/Words.d.ts +2 -0
- package/models/book/Words.js +110 -0
- package/models/chapter/AtomNode.d.ts +4 -4
- package/models/chapter/AtomNode.js +20 -13
- package/models/chapter/BlockNode.d.ts +9 -10
- package/models/chapter/BlockNode.js +32 -13
- package/models/chapter/BlocksNode.d.ts +10 -10
- package/models/chapter/BlocksNode.js +315 -120
- package/models/chapter/BlocksNode.test.js +494 -228
- package/models/chapter/Bookkeeping.d.ts +1 -1
- package/models/chapter/CalloutNode.d.ts +3 -3
- package/models/chapter/CalloutNode.js +34 -12
- package/models/chapter/Caret.d.ts +9 -7
- package/models/chapter/Caret.js +11 -6
- package/models/chapter/ChapterNode.d.ts +11 -11
- package/models/chapter/ChapterNode.js +70 -33
- package/models/chapter/CitationsNode.d.ts +3 -3
- package/models/chapter/CitationsNode.js +31 -12
- package/models/chapter/CodeNode.d.ts +11 -6
- package/models/chapter/CodeNode.js +143 -34
- package/models/chapter/CommentNode.d.ts +5 -5
- package/models/chapter/CommentNode.js +29 -13
- package/models/chapter/DefinitionNode.d.ts +2 -2
- package/models/chapter/DefinitionNode.js +15 -7
- package/models/chapter/Edit.d.ts +3 -3
- package/models/chapter/EmbedNode.d.ts +9 -5
- package/models/chapter/EmbedNode.js +108 -35
- package/models/chapter/ErrorNode.d.ts +2 -2
- package/models/chapter/ErrorNode.js +34 -12
- package/models/chapter/FootnoteNode.d.ts +5 -5
- package/models/chapter/FootnoteNode.js +34 -16
- package/models/chapter/FormatNode.d.ts +10 -10
- package/models/chapter/FormatNode.js +237 -106
- package/models/chapter/FormatNode.test.js +87 -45
- package/models/chapter/InlineCodeNode.d.ts +2 -2
- package/models/chapter/InlineCodeNode.js +22 -9
- package/models/chapter/LabelNode.d.ts +4 -4
- package/models/chapter/LabelNode.js +31 -13
- package/models/chapter/LinkNode.d.ts +2 -2
- package/models/chapter/LinkNode.js +21 -9
- package/models/chapter/ListNode.d.ts +8 -8
- package/models/chapter/ListNode.js +99 -38
- package/models/chapter/ListNode.test.js +29 -24
- package/models/chapter/MetadataNode.d.ts +3 -3
- package/models/chapter/MetadataNode.js +13 -5
- package/models/chapter/Node.d.ts +5 -3
- package/models/chapter/Node.js +76 -29
- package/models/chapter/Node.test.js +20 -18
- package/models/chapter/ParagraphNode.d.ts +6 -6
- package/models/chapter/ParagraphNode.js +84 -29
- package/models/chapter/ParagraphNode.test.js +22 -13
- package/models/chapter/Parser.d.ts +25 -25
- package/models/chapter/Parser.js +201 -189
- package/models/chapter/Parser.test.js +16 -16
- package/models/chapter/Position.d.ts +1 -1
- package/models/chapter/QuoteNode.d.ts +6 -6
- package/models/chapter/QuoteNode.js +61 -23
- package/models/chapter/RootNode.d.ts +4 -4
- package/models/chapter/RuleNode.d.ts +2 -2
- package/models/chapter/RuleNode.js +31 -11
- package/models/chapter/TableNode.d.ts +8 -6
- package/models/chapter/TableNode.js +89 -34
- package/models/chapter/TableNode.test.js +22 -24
- package/models/chapter/TextNode.d.ts +6 -6
- package/models/chapter/TextNode.js +72 -32
- package/models/chapter/TextNode.test.js +4 -4
- package/models/loadEdition.d.ts +1 -1
- package/models/loadEdition.js +10 -6
- package/package.json +104 -25
- package/util/getSubdomain.js +8 -6
- package/util/isMobile.js +1 -1
- package/util/mineReference.d.ts +3 -2
- package/util/mineReference.js +67 -29
- package/util/scrollToEyeLevel.js +6 -1
- package/components/chapter/renderPosition.d.ts +0 -3
- package/components/chapter/renderPosition.js +0 -4
- package/components/editor/ToolbarIcon.svelte +0 -22
- package/components/editor/ToolbarIcon.svelte.d.ts +0 -16
- package/components/page/Alert.svelte +0 -11
- package/components/page/Alert.svelte.d.ts +0 -23
- package/components/page/Revisions.svelte +0 -124
- package/components/page/Revisions.svelte.d.ts +0 -14
- package/models/BookLoader.d.ts +0 -2
- package/models/BookLoader.js +0 -67
- package/models/Firestore.d.ts +0 -22
- package/models/Firestore.js +0 -194
- package/models/chapter/ReferenceNode.d.ts +0 -29
- package/models/chapter/ReferenceNode.js +0 -48
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default class Reference {
|
|
2
|
+
readonly citationID: string;
|
|
3
|
+
readonly authors: string;
|
|
4
|
+
readonly year: string;
|
|
5
|
+
readonly title: string;
|
|
6
|
+
readonly source: string;
|
|
7
|
+
readonly url: string;
|
|
8
|
+
readonly summary: string;
|
|
9
|
+
readonly short: boolean;
|
|
10
|
+
constructor(citationID: string, authors?: string, year?: string, title?: string, source?: string, url?: string, summary?: string, short?: boolean);
|
|
11
|
+
toText(): string;
|
|
12
|
+
toList(): string[];
|
|
13
|
+
copy(): this;
|
|
14
|
+
withChildReplaced(): undefined;
|
|
15
|
+
withContentInRange(): this | undefined;
|
|
16
|
+
withCitationID(id: string): Reference;
|
|
17
|
+
withAuthors(authors: string): Reference;
|
|
18
|
+
withYear(year: string): Reference;
|
|
19
|
+
withTitle(title: string): Reference;
|
|
20
|
+
withSource(source: string): Reference;
|
|
21
|
+
withURL(url: string): Reference;
|
|
22
|
+
withSummary(summary: string): Reference;
|
|
23
|
+
equals(ref: Reference): boolean;
|
|
24
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export default class Reference {
|
|
2
|
+
citationID;
|
|
3
|
+
authors;
|
|
4
|
+
year;
|
|
5
|
+
title;
|
|
6
|
+
source;
|
|
7
|
+
url;
|
|
8
|
+
summary;
|
|
9
|
+
short;
|
|
10
|
+
constructor(citationID, authors = '', year = '', title = '', source = '', url = '', summary = '', short = false) {
|
|
11
|
+
this.citationID = citationID;
|
|
12
|
+
this.authors = authors;
|
|
13
|
+
this.year = year;
|
|
14
|
+
this.title = title;
|
|
15
|
+
this.source = source;
|
|
16
|
+
this.url = url;
|
|
17
|
+
this.summary = summary;
|
|
18
|
+
this.short = short;
|
|
19
|
+
}
|
|
20
|
+
toText() {
|
|
21
|
+
return (this.authors +
|
|
22
|
+
' ' +
|
|
23
|
+
this.year +
|
|
24
|
+
' ' +
|
|
25
|
+
this.title +
|
|
26
|
+
' ' +
|
|
27
|
+
this.source +
|
|
28
|
+
(this.summary ? this.summary : ''));
|
|
29
|
+
}
|
|
30
|
+
toList() {
|
|
31
|
+
return [
|
|
32
|
+
this.authors,
|
|
33
|
+
this.year,
|
|
34
|
+
this.title,
|
|
35
|
+
this.source,
|
|
36
|
+
this.url,
|
|
37
|
+
this.summary,
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
copy() {
|
|
41
|
+
return new Reference(this.citationID, this.authors, this.year, this.title, this.source, this.url, this.summary, this.short);
|
|
42
|
+
}
|
|
43
|
+
withChildReplaced() {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
withContentInRange() {
|
|
47
|
+
return this.copy();
|
|
48
|
+
}
|
|
49
|
+
withCitationID(id) {
|
|
50
|
+
return new Reference(id, this.authors, this.year, this.title, this.source, this.url, this.summary, this.short);
|
|
51
|
+
}
|
|
52
|
+
withAuthors(authors) {
|
|
53
|
+
return new Reference(this.citationID, authors, this.year, this.title, this.source, this.url, this.summary, this.short);
|
|
54
|
+
}
|
|
55
|
+
withYear(year) {
|
|
56
|
+
return new Reference(this.citationID, this.authors, year, this.title, this.source, this.url, this.summary, this.short);
|
|
57
|
+
}
|
|
58
|
+
withTitle(title) {
|
|
59
|
+
return new Reference(this.citationID, this.authors, this.year, title, this.source, this.url, this.summary, this.short);
|
|
60
|
+
}
|
|
61
|
+
withSource(source) {
|
|
62
|
+
return new Reference(this.citationID, this.authors, this.year, this.title, source, this.url, this.summary, this.short);
|
|
63
|
+
}
|
|
64
|
+
withURL(url) {
|
|
65
|
+
return new Reference(this.citationID, this.authors, this.year, this.title, this.source, url, this.summary, this.short);
|
|
66
|
+
}
|
|
67
|
+
withSummary(summary) {
|
|
68
|
+
return new Reference(this.citationID, this.authors, this.year, this.title, this.source, this.url, summary, this.short);
|
|
69
|
+
}
|
|
70
|
+
equals(ref) {
|
|
71
|
+
return (this.authors === ref.authors &&
|
|
72
|
+
this.year === ref.year &&
|
|
73
|
+
this.title === ref.title &&
|
|
74
|
+
this.source === ref.source &&
|
|
75
|
+
this.summary == ref.summary &&
|
|
76
|
+
this.short === ref.short);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
export declare const Schema: {
|
|
2
|
+
$schema: string;
|
|
3
|
+
title: string;
|
|
4
|
+
type: string;
|
|
5
|
+
definitions: {
|
|
6
|
+
embed: {
|
|
7
|
+
type: string[];
|
|
8
|
+
pattern: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
required: string[];
|
|
12
|
+
additionalProperties: boolean;
|
|
13
|
+
properties: {
|
|
14
|
+
title: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
authors: {
|
|
18
|
+
type: string;
|
|
19
|
+
items: {
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
images: {
|
|
24
|
+
type: string;
|
|
25
|
+
properties: {
|
|
26
|
+
cover: {
|
|
27
|
+
$ref: string;
|
|
28
|
+
};
|
|
29
|
+
unknown: {
|
|
30
|
+
$ref: string;
|
|
31
|
+
};
|
|
32
|
+
index: {
|
|
33
|
+
$ref: string;
|
|
34
|
+
};
|
|
35
|
+
references: {
|
|
36
|
+
$ref: string;
|
|
37
|
+
};
|
|
38
|
+
glossary: {
|
|
39
|
+
$ref: string;
|
|
40
|
+
};
|
|
41
|
+
search: {
|
|
42
|
+
$ref: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
description: {
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
49
|
+
acknowledgements: {
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
chapters: {
|
|
53
|
+
type: string;
|
|
54
|
+
items: {
|
|
55
|
+
type: string;
|
|
56
|
+
required: string[];
|
|
57
|
+
properties: {
|
|
58
|
+
id: {
|
|
59
|
+
type: string;
|
|
60
|
+
pattern: string;
|
|
61
|
+
};
|
|
62
|
+
title: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
image: {
|
|
66
|
+
$ref: string;
|
|
67
|
+
};
|
|
68
|
+
numbered: {
|
|
69
|
+
type: string;
|
|
70
|
+
default: string;
|
|
71
|
+
};
|
|
72
|
+
section: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
authors: {
|
|
76
|
+
type: string;
|
|
77
|
+
items: {
|
|
78
|
+
type: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
forthcoming: {
|
|
82
|
+
type: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
revisions: {
|
|
88
|
+
type: string;
|
|
89
|
+
items: {
|
|
90
|
+
type: string;
|
|
91
|
+
minItems: number;
|
|
92
|
+
maxItems: number;
|
|
93
|
+
items: {
|
|
94
|
+
type: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
tags: {
|
|
99
|
+
type: string;
|
|
100
|
+
items: {
|
|
101
|
+
type: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
license: {
|
|
105
|
+
type: string;
|
|
106
|
+
};
|
|
107
|
+
sources: {
|
|
108
|
+
type: string;
|
|
109
|
+
additionalProperties: {
|
|
110
|
+
type: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
references: {
|
|
114
|
+
type: string;
|
|
115
|
+
additionalProperties: {
|
|
116
|
+
oneOf: ({
|
|
117
|
+
type: string;
|
|
118
|
+
maxItems?: undefined;
|
|
119
|
+
items?: undefined;
|
|
120
|
+
additionalItems?: undefined;
|
|
121
|
+
} | {
|
|
122
|
+
type: string;
|
|
123
|
+
maxItems: number;
|
|
124
|
+
items: ({
|
|
125
|
+
type: string;
|
|
126
|
+
format?: undefined;
|
|
127
|
+
} | {
|
|
128
|
+
type: string[];
|
|
129
|
+
format: string;
|
|
130
|
+
})[];
|
|
131
|
+
additionalItems: {
|
|
132
|
+
type: string;
|
|
133
|
+
};
|
|
134
|
+
})[];
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
symbols: {
|
|
138
|
+
type: string;
|
|
139
|
+
additionalProperties: {
|
|
140
|
+
type: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
glossary: {
|
|
144
|
+
type: string;
|
|
145
|
+
additionalProperties: {
|
|
146
|
+
type: string;
|
|
147
|
+
properties: {
|
|
148
|
+
phrase: {
|
|
149
|
+
type: string;
|
|
150
|
+
};
|
|
151
|
+
definition: {
|
|
152
|
+
type: string;
|
|
153
|
+
};
|
|
154
|
+
synonyms: {
|
|
155
|
+
type: string;
|
|
156
|
+
items: {
|
|
157
|
+
type: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
additionalProperties: boolean;
|
|
162
|
+
required: string[];
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
theme: {
|
|
166
|
+
type: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export const Schema = {
|
|
2
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
3
|
+
title: 'Bookish book schema',
|
|
4
|
+
type: 'object',
|
|
5
|
+
definitions: {
|
|
6
|
+
embed: {
|
|
7
|
+
type: ['string', 'null'],
|
|
8
|
+
pattern: '^\\|.+\\|.+\\|.+\\|.+\\|$',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
required: [
|
|
12
|
+
'title',
|
|
13
|
+
'authors',
|
|
14
|
+
'description',
|
|
15
|
+
'chapters',
|
|
16
|
+
'revisions',
|
|
17
|
+
'license',
|
|
18
|
+
'sources',
|
|
19
|
+
'references',
|
|
20
|
+
'images',
|
|
21
|
+
],
|
|
22
|
+
additionalProperties: false,
|
|
23
|
+
properties: {
|
|
24
|
+
title: { type: 'string' },
|
|
25
|
+
authors: {
|
|
26
|
+
type: 'array',
|
|
27
|
+
items: { type: 'string' },
|
|
28
|
+
},
|
|
29
|
+
images: {
|
|
30
|
+
type: 'object',
|
|
31
|
+
properties: {
|
|
32
|
+
cover: { $ref: '#/definitions/embed' },
|
|
33
|
+
unknown: { $ref: '#/definitions/embed' },
|
|
34
|
+
index: { $ref: '#/definitions/embed' },
|
|
35
|
+
references: { $ref: '#/definitions/embed' },
|
|
36
|
+
glossary: { $ref: '#/definitions/embed' },
|
|
37
|
+
search: { $ref: '#/definitions/embed' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
description: { type: 'string' },
|
|
41
|
+
acknowledgements: { type: 'string' },
|
|
42
|
+
chapters: {
|
|
43
|
+
type: 'array',
|
|
44
|
+
items: {
|
|
45
|
+
type: 'object',
|
|
46
|
+
required: ['id', 'title', 'image'],
|
|
47
|
+
properties: {
|
|
48
|
+
id: { type: 'string', pattern: '^[a-zA-Z0-9]+$' },
|
|
49
|
+
title: { type: 'string' },
|
|
50
|
+
image: { $ref: '#/definitions/embed' },
|
|
51
|
+
numbered: { type: 'boolean', default: 'True by default' },
|
|
52
|
+
section: { type: 'string' },
|
|
53
|
+
authors: { type: 'array', items: { type: 'string' } },
|
|
54
|
+
forthcoming: { type: 'boolean' },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
revisions: {
|
|
59
|
+
type: 'array',
|
|
60
|
+
items: {
|
|
61
|
+
type: 'array',
|
|
62
|
+
minItems: 2,
|
|
63
|
+
maxItems: 2,
|
|
64
|
+
items: { type: 'string' },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
tags: {
|
|
68
|
+
type: 'array',
|
|
69
|
+
items: { type: 'string' },
|
|
70
|
+
},
|
|
71
|
+
license: { type: 'string' },
|
|
72
|
+
sources: { type: 'object', additionalProperties: { type: 'string' } },
|
|
73
|
+
references: {
|
|
74
|
+
type: 'object',
|
|
75
|
+
additionalProperties: {
|
|
76
|
+
oneOf: [
|
|
77
|
+
{ type: 'string' },
|
|
78
|
+
{
|
|
79
|
+
type: 'array',
|
|
80
|
+
maxItems: 6,
|
|
81
|
+
items: [
|
|
82
|
+
{ type: 'string' },
|
|
83
|
+
{ type: 'integer' },
|
|
84
|
+
{ type: 'string' },
|
|
85
|
+
{ type: 'string' },
|
|
86
|
+
{ type: ['string', 'null'], format: 'uri' },
|
|
87
|
+
],
|
|
88
|
+
additionalItems: { type: 'string' },
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
symbols: {
|
|
94
|
+
type: 'object',
|
|
95
|
+
additionalProperties: { type: 'string' },
|
|
96
|
+
},
|
|
97
|
+
glossary: {
|
|
98
|
+
type: 'object',
|
|
99
|
+
additionalProperties: {
|
|
100
|
+
type: 'object',
|
|
101
|
+
properties: {
|
|
102
|
+
phrase: { type: 'string' },
|
|
103
|
+
definition: { type: 'string' },
|
|
104
|
+
synonyms: { type: 'array', items: { type: 'string' } },
|
|
105
|
+
},
|
|
106
|
+
additionalProperties: false,
|
|
107
|
+
required: ['phrase', 'definition'],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
theme: {
|
|
111
|
+
type: 'object',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|
package/models/book/Theme.d.ts
CHANGED
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
import type ThemeColors from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import type ThemeColors from './ThemeColors';
|
|
2
|
+
type Theme = {
|
|
3
|
+
imports?: string[];
|
|
4
|
+
light?: ThemeColors;
|
|
5
|
+
dark?: ThemeColors;
|
|
6
|
+
fonts?: {
|
|
7
|
+
paragraphFontFamily?: string;
|
|
8
|
+
headerFontFamily?: string;
|
|
9
|
+
codeFontFamily?: string;
|
|
10
|
+
bulletFontFamily?: string;
|
|
10
11
|
};
|
|
11
|
-
sizes
|
|
12
|
-
paragraphFontSize
|
|
13
|
-
blockFontSize
|
|
14
|
-
smallFontSize
|
|
15
|
-
titleFontSize
|
|
16
|
-
header1FontSize
|
|
17
|
-
header2FontSize
|
|
18
|
-
header3FontSize
|
|
19
|
-
codeFontSize
|
|
12
|
+
sizes?: {
|
|
13
|
+
paragraphFontSize?: string;
|
|
14
|
+
blockFontSize?: string;
|
|
15
|
+
smallFontSize?: string;
|
|
16
|
+
titleFontSize?: string;
|
|
17
|
+
header1FontSize?: string;
|
|
18
|
+
header2FontSize?: string;
|
|
19
|
+
header3FontSize?: string;
|
|
20
|
+
codeFontSize?: string;
|
|
20
21
|
};
|
|
21
|
-
weights
|
|
22
|
-
headerFontWeight
|
|
23
|
-
paragraphFontWeight
|
|
24
|
-
boldFontWeight
|
|
25
|
-
linkFontWeight
|
|
26
|
-
codeFontWeight
|
|
27
|
-
bulletFontWeight
|
|
22
|
+
weights?: {
|
|
23
|
+
headerFontWeight?: string;
|
|
24
|
+
paragraphFontWeight?: string;
|
|
25
|
+
boldFontWeight?: string;
|
|
26
|
+
linkFontWeight?: string;
|
|
27
|
+
codeFontWeight?: string;
|
|
28
|
+
bulletFontWeight?: string;
|
|
28
29
|
};
|
|
29
|
-
spacing
|
|
30
|
-
paragraphLineHeight
|
|
31
|
-
paragraphLineHeightTight
|
|
32
|
-
headerLineHeight
|
|
33
|
-
paragraphSpacing
|
|
34
|
-
headerSpacing
|
|
35
|
-
indent
|
|
36
|
-
inlinePadding
|
|
37
|
-
blockPadding
|
|
38
|
-
roundedness
|
|
30
|
+
spacing?: {
|
|
31
|
+
paragraphLineHeight?: string;
|
|
32
|
+
paragraphLineHeightTight?: string;
|
|
33
|
+
headerLineHeight?: string;
|
|
34
|
+
paragraphSpacing?: string;
|
|
35
|
+
headerSpacing?: string;
|
|
36
|
+
indent?: string;
|
|
37
|
+
inlinePadding?: string;
|
|
38
|
+
blockPadding?: string;
|
|
39
|
+
roundedness?: string;
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
|
-
export
|
|
42
|
+
export default Theme;
|
|
43
|
+
export declare const BookishTheme: {
|
|
44
|
+
imports: string[];
|
|
42
45
|
light: {
|
|
43
46
|
backgroundColor: string;
|
|
44
47
|
blockBackgroundColor: string;
|
|
@@ -103,4 +106,8 @@ export declare const defaultTheme: {
|
|
|
103
106
|
roundedness: string;
|
|
104
107
|
};
|
|
105
108
|
};
|
|
106
|
-
export
|
|
109
|
+
export declare const SeriousTheme: Theme;
|
|
110
|
+
export declare const TechTheme: Theme;
|
|
111
|
+
export declare const HumanTheme: Theme;
|
|
112
|
+
export declare const SketchyTheme: Theme;
|
|
113
|
+
export declare const CriticalTheme: Theme;
|