bookish-press 0.4.46 → 0.4.47
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/.env.example +8 -0
- package/.firebaserc +8 -0
- package/.prettierignore +8 -0
- package/.prettierrc.json +5 -0
- package/_update-notifier-last-checked +0 -0
- package/firebase.json +46 -0
- package/firestore.indexes.json +4 -0
- package/firestore.rules +59 -0
- package/functions/.eslintrc.js +28 -0
- package/functions/package-lock.json +12595 -0
- package/functions/package.json +43 -0
- package/functions/src/index.ts +345 -0
- package/functions/tsconfig.dev.json +3 -0
- package/functions/tsconfig.json +15 -0
- package/package.json +53 -270
- package/scripts/claims.cjs +99 -0
- package/src/app.d.ts +9 -0
- package/src/app.html +24 -0
- package/src/lib/components/Auth.svelte +65 -0
- package/{components/Authentication.d.ts → src/lib/components/Authentication.ts} +2 -0
- package/{components → src/lib/components}/BookPreview.svelte +27 -22
- package/{components → src/lib/components}/External.svelte +2 -1
- package/src/lib/components/Link.svelte +58 -0
- package/{components → src/lib/components}/app/BookList.svelte +6 -3
- package/{components → src/lib/components}/app/Button.svelte +5 -4
- package/{components → src/lib/components}/app/Feedback.svelte +11 -7
- package/{components → src/lib/components}/app/Head.svelte +2 -1
- package/{components → src/lib/components}/app/Large.svelte +0 -0
- package/{components → src/lib/components}/app/Lead.svelte +0 -0
- package/{components → src/lib/components}/app/Link.svelte +4 -3
- package/{components → src/lib/components}/app/Options.svelte +5 -4
- package/{components → src/lib/components}/app/Paragraph.svelte +2 -1
- package/{components → src/lib/components}/app/Section.svelte +0 -0
- package/{components → src/lib/components}/app/Table.svelte +0 -0
- package/{components → src/lib/components}/app/TextInput.svelte +12 -9
- package/{components → src/lib/components}/chapter/Atom.svelte +18 -12
- package/src/lib/components/chapter/Block.svelte +42 -0
- package/{components → src/lib/components}/chapter/Callout.svelte +6 -3
- package/{components → src/lib/components}/chapter/CaptionedCode.svelte +21 -13
- package/{components → src/lib/components}/chapter/ChapterBody.svelte +13 -9
- package/{components → src/lib/components}/chapter/Citations.svelte +34 -33
- package/{components → src/lib/components}/chapter/Code.svelte +63 -59
- package/{components → src/lib/components}/chapter/Comment.svelte +30 -18
- package/{components → src/lib/components}/chapter/Definition.svelte +23 -17
- package/{components → src/lib/components}/chapter/Embed.svelte +97 -77
- package/src/lib/components/chapter/ErrorMessage.svelte +12 -0
- package/{components → src/lib/components}/chapter/ExtendedPrism.js +0 -0
- package/{components → src/lib/components}/chapter/Figure.svelte +34 -26
- package/{components → src/lib/components}/chapter/Footnote.svelte +32 -20
- package/{components → src/lib/components}/chapter/Format.svelte +39 -34
- package/{components → src/lib/components}/chapter/InlineCode.svelte +9 -5
- package/{components → src/lib/components}/chapter/Label.svelte +23 -14
- package/{components → src/lib/components}/chapter/Link.svelte +27 -21
- package/{components → src/lib/components}/chapter/List.svelte +5 -3
- package/{components → src/lib/components}/chapter/Marginal.svelte +54 -41
- package/{components → src/lib/components}/chapter/Paragraph.svelte +25 -20
- package/{components → src/lib/components}/chapter/Positioned.svelte +4 -1
- package/{components → src/lib/components}/chapter/Problem.svelte +0 -0
- package/src/lib/components/chapter/Python.svelte +144 -0
- package/{components → src/lib/components}/chapter/Quote.svelte +9 -5
- package/{components → src/lib/components}/chapter/Rule.svelte +4 -1
- package/{components → src/lib/components}/chapter/Table.svelte +11 -7
- package/src/lib/components/chapter/Text.svelte +109 -0
- package/src/lib/components/editor/BookishEditor.svelte +1101 -0
- package/src/lib/components/editor/CalloutEditor.svelte +14 -0
- package/{components → src/lib/components}/editor/CaptionedCodeEditor.svelte +10 -6
- package/src/lib/components/editor/CaretContext.ts +55 -0
- package/{components/editor/CaretState.d.ts → src/lib/components/editor/CaretState.ts} +6 -7
- package/{components/editor/CaretUtilities.d.ts → src/lib/components/editor/CaretUtilities.ts} +1 -0
- package/{components → src/lib/components}/editor/CaretView.svelte +25 -20
- package/src/lib/components/editor/CitationsEditor.svelte +64 -0
- package/{components/editor/Clipboard.d.ts → src/lib/components/editor/Clipboard.ts} +2 -1
- package/{components/editor/Command.d.ts → src/lib/components/editor/Command.ts} +8 -2
- package/{components/editor/Commands.js → src/lib/components/editor/Commands.ts} +730 -315
- package/src/lib/components/editor/ConfirmButton.svelte +51 -0
- package/src/lib/components/editor/DefinitionEditor.svelte +44 -0
- package/src/lib/components/editor/EmbedEditor.svelte +152 -0
- package/{components → src/lib/components}/editor/Icon.svelte +2 -1
- package/{components → src/lib/components}/editor/ImageChooser.svelte +24 -19
- package/src/lib/components/editor/InlineCodeEditor.svelte +16 -0
- package/{components → src/lib/components}/editor/LabelEditor.svelte +14 -9
- package/{components → src/lib/components}/editor/LanguageEditor.svelte +8 -5
- package/src/lib/components/editor/LinkEditor.svelte +110 -0
- package/{components → src/lib/components}/editor/Note.svelte +0 -0
- package/{components → src/lib/components}/editor/Permissions.svelte +43 -36
- package/src/lib/components/editor/PositionEditor.svelte +21 -0
- package/src/lib/components/editor/QuoteEditor.svelte +14 -0
- package/{components → src/lib/components}/editor/Switch.svelte +14 -11
- package/src/lib/components/editor/TableEditor.svelte +14 -0
- package/{components → src/lib/components}/editor/TextEditor.svelte +101 -89
- package/src/lib/components/editor/Toggle.svelte +47 -0
- package/src/lib/components/editor/Toolbar.svelte +297 -0
- package/{components → src/lib/components}/editor/ToolbarGroup.svelte +5 -3
- package/{components → src/lib/components}/editor/ToolbarSpacer.svelte +0 -0
- package/src/lib/components/editor/URLEditor.svelte +15 -0
- package/{components/editor/UndoState.d.ts → src/lib/components/editor/UndoState.ts} +3 -2
- package/{components → src/lib/components}/editor/icons/annotate.svg +0 -0
- package/{components → src/lib/components}/editor/icons/block.svg +0 -0
- package/{components → src/lib/components}/editor/icons/bold.svg +0 -0
- package/{components → src/lib/components}/editor/icons/bullets.svg +0 -0
- package/{components → src/lib/components}/editor/icons/callout.svg +0 -0
- package/{components → src/lib/components}/editor/icons/citation.svg +0 -0
- package/{components → src/lib/components}/editor/icons/clear.svg +0 -0
- package/{components → src/lib/components}/editor/icons/clipboard.svg +0 -0
- package/{components → src/lib/components}/editor/icons/code.svg +0 -0
- package/{components → src/lib/components}/editor/icons/columnafter.svg +0 -0
- package/{components → src/lib/components}/editor/icons/columnbefore.svg +0 -0
- package/{components → src/lib/components}/editor/icons/comment.svg +0 -0
- package/{components → src/lib/components}/editor/icons/copy.svg +0 -0
- package/{components → src/lib/components}/editor/icons/cut.svg +0 -0
- package/{components → src/lib/components}/editor/icons/define.svg +0 -0
- package/{components → src/lib/components}/editor/icons/deletecolumn.svg +0 -0
- package/{components → src/lib/components}/editor/icons/deleterow.svg +0 -0
- package/{components → src/lib/components}/editor/icons/footnote.svg +0 -0
- package/{components → src/lib/components}/editor/icons/header1.svg +0 -0
- package/{components → src/lib/components}/editor/icons/header2.svg +0 -0
- package/{components → src/lib/components}/editor/icons/header3.svg +0 -0
- package/{components → src/lib/components}/editor/icons/home.svg +0 -0
- package/{components → src/lib/components}/editor/icons/indent.svg +0 -0
- package/{components → src/lib/components}/editor/icons/italic.svg +0 -0
- package/{components → src/lib/components}/editor/icons/label.svg +0 -0
- package/{components → src/lib/components}/editor/icons/left.svg +0 -0
- package/{components → src/lib/components}/editor/icons/level.svg +0 -0
- package/{components → src/lib/components}/editor/icons/link.svg +0 -0
- package/{components → src/lib/components}/editor/icons/list.svg +0 -0
- package/{components → src/lib/components}/editor/icons/media.svg +0 -0
- package/{components → src/lib/components}/editor/icons/middle.svg +0 -0
- package/{components → src/lib/components}/editor/icons/numbers.svg +0 -0
- package/{components → src/lib/components}/editor/icons/paragraph.svg +0 -0
- package/{components → src/lib/components}/editor/icons/paste.svg +0 -0
- package/{components → src/lib/components}/editor/icons/quote.svg +0 -0
- package/{components → src/lib/components}/editor/icons/redo.svg +0 -0
- package/{components → src/lib/components}/editor/icons/right.svg +0 -0
- package/{components → src/lib/components}/editor/icons/rowabove.svg +0 -0
- package/{components → src/lib/components}/editor/icons/rowbelow.svg +0 -0
- package/{components → src/lib/components}/editor/icons/rule.svg +0 -0
- package/{components → src/lib/components}/editor/icons/sub.svg +0 -0
- package/{components → src/lib/components}/editor/icons/super.svg +0 -0
- package/{components → src/lib/components}/editor/icons/table.svg +0 -0
- package/{components → src/lib/components}/editor/icons/text.svg +0 -0
- package/{components → src/lib/components}/editor/icons/time.svg +0 -0
- package/{components → src/lib/components}/editor/icons/undo.svg +0 -0
- package/{components → src/lib/components}/editor/icons/unindent.svg +0 -0
- package/{components → src/lib/components}/editor/icons/unlink.svg +0 -0
- package/{components → src/lib/components}/page/Acknowledgements.svelte +19 -10
- package/src/lib/components/page/Authors.svelte +92 -0
- package/src/lib/components/page/BookLoader.svelte +77 -0
- package/src/lib/components/page/BulkReferenceEditor.svelte +86 -0
- package/src/lib/components/page/Chapter.svelte +449 -0
- package/src/lib/components/page/ChapterContext.ts +13 -0
- package/{components → src/lib/components}/page/ChapterNumber.svelte +0 -0
- package/{components → src/lib/components}/page/ChapterTitle.svelte +4 -2
- package/src/lib/components/page/Contexts.ts +176 -0
- package/{components → src/lib/components}/page/DefinitionView.svelte +52 -37
- package/{components → src/lib/components}/page/Description.svelte +15 -7
- package/src/lib/components/page/Edition.svelte +189 -0
- package/src/lib/components/page/EditionLoader.svelte +123 -0
- package/{components → src/lib/components}/page/Editions.svelte +22 -18
- package/{components → src/lib/components}/page/Glossary.svelte +33 -28
- package/{components → src/lib/components}/page/Header.svelte +59 -52
- package/{components → src/lib/components}/page/Index.svelte +48 -41
- package/{components → src/lib/components}/page/Instructions.svelte +2 -1
- package/{components → src/lib/components}/page/License.svelte +17 -9
- package/{components → src/lib/components}/page/Loading.svelte +0 -0
- package/{components → src/lib/components}/page/Media.svelte +44 -27
- package/{components → src/lib/components}/page/MediaPreview.svelte +3 -2
- package/{components → src/lib/components}/page/Muted.svelte +0 -0
- package/{components → src/lib/components}/page/Outline.svelte +140 -110
- package/src/lib/components/page/Page.svelte +94 -0
- package/{components → src/lib/components}/page/PageHeader.svelte +2 -1
- package/{components → src/lib/components}/page/PageParagraph.svelte +0 -0
- package/src/lib/components/page/PossibleChapter.svelte +16 -0
- package/src/lib/components/page/PossibleReference.svelte +14 -0
- package/{components → src/lib/components}/page/Print.svelte +5 -3
- package/{components → src/lib/components}/page/Publish.svelte +59 -52
- package/{components → src/lib/components}/page/Reference.svelte +39 -30
- package/{components → src/lib/components}/page/References.svelte +18 -14
- package/{components → src/lib/components}/page/Rows.svelte +0 -0
- package/src/lib/components/page/Search.svelte +153 -0
- package/{components → src/lib/components}/page/Status.svelte +5 -3
- package/{components → src/lib/components}/page/SubdomainEditor.svelte +16 -13
- package/{components → src/lib/components}/page/TableOfContents.svelte +79 -68
- package/src/lib/components/page/TableOfContentsImage.svelte +22 -0
- package/{components → src/lib/components}/page/TableOfContentsRow.svelte +34 -24
- package/{components → src/lib/components}/page/ThemeEditor.svelte +44 -33
- package/{components → src/lib/components}/page/ThemeEditorPreview.svelte +21 -12
- package/src/lib/components/page/ThemeSetEditor.svelte +21 -0
- package/{components → src/lib/components}/page/ThemeVariableEditor.svelte +18 -14
- package/{components → src/lib/components}/page/Title.svelte +0 -0
- package/{components → src/lib/components}/page/Unknown.svelte +10 -8
- package/{components/page/margins.js → src/lib/components/page/margins.ts} +79 -46
- package/{index.js → src/lib/index.js} +0 -0
- package/src/lib/models/CRUD.ts +469 -0
- package/{models/Firebase.js → src/lib/models/Firebase.ts} +26 -16
- package/src/lib/models/book/Book.ts +283 -0
- package/src/lib/models/book/BookMedia.ts +182 -0
- package/src/lib/models/book/BookSaveStatus.ts +8 -0
- package/src/lib/models/book/Chapter.ts +462 -0
- package/{models/book/ChapterID.js → src/lib/models/book/ChapterID.ts} +1 -0
- package/src/lib/models/book/Definition.ts +2 -0
- package/src/lib/models/book/Edition.ts +1216 -0
- package/src/lib/models/book/Reference.ts +171 -0
- package/{models/book/Schema.js → src/lib/models/book/Schema.ts} +1 -0
- package/{models/book/Theme.js → src/lib/models/book/Theme.ts} +110 -6
- package/{models/book/ThemeColors.d.ts → src/lib/models/book/ThemeColors.ts} +6 -0
- package/{models/book/Words.js → src/lib/models/book/Words.ts} +1 -0
- package/{models/chapter/AtomNode.js → src/lib/models/chapter/AtomNode.ts} +30 -10
- package/{models/chapter/BlockNode.js → src/lib/models/chapter/BlockNode.ts} +80 -47
- package/src/lib/models/chapter/BlocksNode.test.ts +867 -0
- package/{models/chapter/BlocksNode.js → src/lib/models/chapter/BlocksNode.ts} +571 -359
- package/{models/chapter/Bookkeeping.d.ts → src/lib/models/chapter/Bookkeeping.ts} +0 -0
- package/src/lib/models/chapter/CalloutNode.ts +79 -0
- package/{models/chapter/Caret.js → src/lib/models/chapter/Caret.ts} +50 -26
- package/src/lib/models/chapter/ChapterNode.ts +169 -0
- package/{models/chapter/CitationsNode.js → src/lib/models/chapter/CitationsNode.ts} +17 -10
- package/{models/chapter/CodeNode.js → src/lib/models/chapter/CodeNode.ts} +125 -62
- package/src/lib/models/chapter/CommentNode.ts +61 -0
- package/{models/chapter/DefinitionNode.js → src/lib/models/chapter/DefinitionNode.ts} +14 -8
- package/src/lib/models/chapter/Edit.ts +6 -0
- package/src/lib/models/chapter/EmbedNode.ts +257 -0
- package/{models/chapter/ErrorNode.js → src/lib/models/chapter/ErrorNode.ts} +15 -8
- package/src/lib/models/chapter/FootnoteNode.ts +59 -0
- package/src/lib/models/chapter/FormatNode.test.ts +137 -0
- package/{models/chapter/FormatNode.js → src/lib/models/chapter/FormatNode.ts} +443 -262
- package/{models/chapter/InlineCodeNode.js → src/lib/models/chapter/InlineCodeNode.ts} +17 -9
- package/{models/chapter/LabelNode.js → src/lib/models/chapter/LabelNode.ts} +26 -10
- package/{models/chapter/LinkNode.js → src/lib/models/chapter/LinkNode.ts} +12 -7
- package/{models/chapter/ListNode.test.js → src/lib/models/chapter/ListNode.test.ts} +57 -20
- package/{models/chapter/ListNode.js → src/lib/models/chapter/ListNode.ts} +277 -200
- package/src/lib/models/chapter/MetadataNode.ts +44 -0
- package/{models → src/lib/models}/chapter/Node.test.js +0 -0
- package/{models/chapter/Node.js → src/lib/models/chapter/Node.ts} +155 -71
- package/src/lib/models/chapter/ParagraphNode.test.ts +54 -0
- package/{models/chapter/ParagraphNode.js → src/lib/models/chapter/ParagraphNode.ts} +95 -58
- package/{models/chapter/Parser.test.js → src/lib/models/chapter/Parser.test.ts} +7 -0
- package/{models/chapter/Parser.js → src/lib/models/chapter/Parser.ts} +369 -184
- package/{models/chapter/Position.d.ts → src/lib/models/chapter/Position.ts} +0 -0
- package/src/lib/models/chapter/QuoteNode.ts +135 -0
- package/{models/chapter/RootNode.d.ts → src/lib/models/chapter/RootNode.ts} +2 -0
- package/{models/chapter/RuleNode.js → src/lib/models/chapter/RuleNode.ts} +9 -6
- package/{models/chapter/TableNode.test.js → src/lib/models/chapter/TableNode.test.ts} +27 -10
- package/{models/chapter/TableNode.js → src/lib/models/chapter/TableNode.ts} +141 -82
- package/{models/chapter/TextNode.test.js → src/lib/models/chapter/TextNode.test.ts} +2 -0
- package/{models/chapter/TextNode.js → src/lib/models/chapter/TextNode.ts} +117 -65
- package/{util/getSubdomain.js → src/lib/util/getSubdomain.ts} +14 -8
- package/{util/isMobile.js → src/lib/util/isMobile.ts} +1 -0
- package/{util/mineReference.js → src/lib/util/mineReference.ts} +45 -25
- package/{util/scrollToEyeLevel.js → src/lib/util/scrollToEyeLevel.ts} +4 -2
- package/src/params/edition.ts +3 -0
- package/src/routes/+error.svelte +12 -0
- package/src/routes/+layout.svelte +241 -0
- package/src/routes/+page.svelte +43 -0
- package/src/routes/Footer.svelte +0 -0
- package/src/routes/Header.svelte +112 -0
- package/src/routes/[bookid]/+layout.svelte +5 -0
- package/src/routes/[bookid]/[[editionid=edition]]/+error.svelte +14 -0
- package/src/routes/[bookid]/[[editionid=edition]]/+layout.svelte +7 -0
- package/src/routes/[bookid]/[[editionid=edition]]/+page.svelte +5 -0
- package/src/routes/[bookid]/[[editionid=edition]]/[chapterid]/+page.svelte +5 -0
- package/src/routes/[bookid]/[[editionid=edition]]/glossary/+page.svelte +5 -0
- package/src/routes/[bookid]/[[editionid=edition]]/index/[[letter]]/+page.svelte +5 -0
- package/src/routes/[bookid]/[[editionid=edition]]/media/+page.svelte +5 -0
- package/src/routes/[bookid]/[[editionid=edition]]/print/+page.svelte +5 -0
- package/src/routes/[bookid]/[[editionid=edition]]/references/+page.svelte +5 -0
- package/src/routes/[bookid]/[[editionid=edition]]/search/+page.svelte +5 -0
- package/src/routes/[bookid]/editions/+page.svelte +20 -0
- package/src/routes/about/+page.svelte +102 -0
- package/src/routes/confirm/+page.svelte +62 -0
- package/src/routes/email/+page.svelte +99 -0
- package/src/routes/login/+page.svelte +66 -0
- package/src/routes/read/+page.svelte +38 -0
- package/src/routes/write/+error.svelte +10 -0
- package/src/routes/write/+layout.svelte +11 -0
- package/src/routes/write/+page.svelte +114 -0
- package/src/routes/write/[bookid]/+layout.svelte +5 -0
- package/src/routes/write/[bookid]/[[editionid=edition]]/+layout.svelte +7 -0
- package/src/routes/write/[bookid]/[[editionid=edition]]/+page.svelte +5 -0
- package/src/routes/write/[bookid]/[[editionid=edition]]/[chapterid]/+page.svelte +5 -0
- package/src/routes/write/[bookid]/[[editionid=edition]]/glossary/+page.svelte +5 -0
- package/src/routes/write/[bookid]/[[editionid=edition]]/index/[[letter]]/+page.svelte +5 -0
- package/src/routes/write/[bookid]/[[editionid=edition]]/media/+page.svelte +5 -0
- package/src/routes/write/[bookid]/[[editionid=edition]]/print/+page.svelte +5 -0
- package/src/routes/write/[bookid]/[[editionid=edition]]/references/+page.svelte +5 -0
- package/src/routes/write/[bookid]/[[editionid=edition]]/search/+page.svelte +5 -0
- package/src/routes/write/[bookid]/[[editionid=edition]]/theme/+page.svelte +5 -0
- package/src/routes/write/[bookid]/[[editionid=edition]]/unknown/+page.svelte +5 -0
- package/src/routes/write/[bookid]/editions/+page.svelte +20 -0
- package/src/vite-env.d.ts +1 -0
- package/static/icons/favicon.png +0 -0
- package/static/icons/icon.png +0 -0
- package/static/icons/ios-icon.png +0 -0
- package/storage.rules +9 -0
- package/svelte.config.js +19 -0
- package/tsconfig.json +18 -0
- package/tsconfig.node.json +9 -0
- package/vite.config.ts +8 -0
- package/vite.reader.config.ts +32 -0
- package/components/Auth.svelte +0 -55
- package/components/Auth.svelte.d.ts +0 -16
- package/components/Authentication.js +0 -1
- package/components/BookPreview.svelte.d.ts +0 -18
- package/components/External.svelte.d.ts +0 -18
- package/components/Link.svelte +0 -51
- package/components/Link.svelte.d.ts +0 -18
- package/components/app/BookList.svelte.d.ts +0 -18
- package/components/app/Button.svelte.d.ts +0 -22
- package/components/app/Feedback.svelte.d.ts +0 -18
- package/components/app/Head.svelte.d.ts +0 -18
- package/components/app/Large.svelte.d.ts +0 -27
- package/components/app/Lead.svelte.d.ts +0 -27
- package/components/app/Link.svelte.d.ts +0 -20
- package/components/app/Options.svelte.d.ts +0 -19
- package/components/app/Paragraph.svelte.d.ts +0 -18
- package/components/app/Section.svelte.d.ts +0 -27
- package/components/app/Table.svelte.d.ts +0 -27
- package/components/app/TextInput.svelte.d.ts +0 -22
- package/components/chapter/Atom.svelte.d.ts +0 -19
- package/components/chapter/Block.svelte +0 -37
- package/components/chapter/Block.svelte.d.ts +0 -17
- package/components/chapter/Callout.svelte.d.ts +0 -17
- package/components/chapter/CaptionedCode.svelte.d.ts +0 -17
- package/components/chapter/ChapterBody.svelte.d.ts +0 -19
- package/components/chapter/Citations.svelte.d.ts +0 -17
- package/components/chapter/Code.svelte.d.ts +0 -22
- package/components/chapter/Comment.svelte.d.ts +0 -17
- package/components/chapter/Definition.svelte.d.ts +0 -17
- package/components/chapter/Embed.svelte.d.ts +0 -20
- package/components/chapter/ErrorMessage.svelte +0 -9
- package/components/chapter/ErrorMessage.svelte.d.ts +0 -17
- package/components/chapter/ExtendedPrism.d.ts +0 -2
- package/components/chapter/Figure.svelte.d.ts +0 -24
- package/components/chapter/Footnote.svelte.d.ts +0 -19
- package/components/chapter/Format.svelte.d.ts +0 -19
- package/components/chapter/InlineCode.svelte.d.ts +0 -17
- package/components/chapter/Label.svelte.d.ts +0 -17
- package/components/chapter/Link.svelte.d.ts +0 -17
- package/components/chapter/List.svelte.d.ts +0 -17
- package/components/chapter/Marginal.svelte.d.ts +0 -22
- package/components/chapter/Paragraph.svelte.d.ts +0 -18
- package/components/chapter/Positioned.svelte.d.ts +0 -19
- package/components/chapter/Problem.svelte.d.ts +0 -27
- package/components/chapter/Python.svelte +0 -128
- package/components/chapter/Python.svelte.d.ts +0 -18
- package/components/chapter/Quote.svelte.d.ts +0 -17
- package/components/chapter/Rule.svelte.d.ts +0 -17
- package/components/chapter/Table.svelte.d.ts +0 -17
- package/components/chapter/Text.svelte +0 -87
- package/components/chapter/Text.svelte.d.ts +0 -18
- package/components/editor/BookishEditor.svelte +0 -884
- package/components/editor/BookishEditor.svelte.d.ts +0 -25
- package/components/editor/CalloutEditor.svelte +0 -10
- package/components/editor/CalloutEditor.svelte.d.ts +0 -17
- package/components/editor/CaptionedCodeEditor.svelte.d.ts +0 -17
- package/components/editor/CaretContext.d.ts +0 -50
- package/components/editor/CaretContext.js +0 -1
- package/components/editor/CaretState.js +0 -1
- package/components/editor/CaretUtilities.js +0 -1
- package/components/editor/CaretView.svelte.d.ts +0 -25
- package/components/editor/CitationsEditor.svelte +0 -53
- package/components/editor/CitationsEditor.svelte.d.ts +0 -17
- package/components/editor/Clipboard.js +0 -1
- package/components/editor/Command.js +0 -1
- package/components/editor/Commands.d.ts +0 -3
- package/components/editor/ConfirmButton.svelte +0 -49
- package/components/editor/ConfirmButton.svelte.d.ts +0 -19
- package/components/editor/DefinitionEditor.svelte +0 -36
- package/components/editor/DefinitionEditor.svelte.d.ts +0 -17
- package/components/editor/EmbedEditor.svelte +0 -137
- package/components/editor/EmbedEditor.svelte.d.ts +0 -17
- package/components/editor/Icon.svelte.d.ts +0 -16
- package/components/editor/ImageChooser.svelte.d.ts +0 -18
- package/components/editor/InlineCodeEditor.svelte +0 -12
- package/components/editor/InlineCodeEditor.svelte.d.ts +0 -17
- package/components/editor/LabelEditor.svelte.d.ts +0 -17
- package/components/editor/LanguageEditor.svelte.d.ts +0 -17
- package/components/editor/LinkEditor.svelte +0 -100
- package/components/editor/LinkEditor.svelte.d.ts +0 -17
- package/components/editor/Note.svelte.d.ts +0 -27
- package/components/editor/Permissions.svelte.d.ts +0 -20
- package/components/editor/PositionEditor.svelte +0 -17
- package/components/editor/PositionEditor.svelte.d.ts +0 -18
- package/components/editor/QuoteEditor.svelte +0 -10
- package/components/editor/QuoteEditor.svelte.d.ts +0 -17
- package/components/editor/Switch.svelte.d.ts +0 -20
- package/components/editor/TableEditor.svelte +0 -10
- package/components/editor/TableEditor.svelte.d.ts +0 -17
- package/components/editor/TextEditor.svelte.d.ts +0 -24
- package/components/editor/Toggle.svelte +0 -41
- package/components/editor/Toggle.svelte.d.ts +0 -19
- package/components/editor/Toolbar.svelte +0 -249
- package/components/editor/Toolbar.svelte.d.ts +0 -17
- package/components/editor/ToolbarGroup.svelte.d.ts +0 -18
- package/components/editor/ToolbarSpacer.svelte.d.ts +0 -23
- package/components/editor/URLEditor.svelte +0 -13
- package/components/editor/URLEditor.svelte.d.ts +0 -18
- package/components/editor/UndoState.js +0 -1
- package/components/page/Acknowledgements.svelte.d.ts +0 -14
- package/components/page/Authors.svelte +0 -85
- package/components/page/Authors.svelte.d.ts +0 -21
- package/components/page/BookLoader.svelte +0 -59
- package/components/page/BookLoader.svelte.d.ts +0 -16
- package/components/page/BulkReferenceEditor.svelte +0 -63
- package/components/page/BulkReferenceEditor.svelte.d.ts +0 -14
- package/components/page/Chapter.svelte +0 -392
- package/components/page/Chapter.svelte.d.ts +0 -18
- package/components/page/ChapterContext.d.ts +0 -10
- package/components/page/ChapterContext.js +0 -1
- package/components/page/ChapterNumber.svelte.d.ts +0 -27
- package/components/page/ChapterTitle.svelte.d.ts +0 -18
- package/components/page/Contexts.d.ts +0 -47
- package/components/page/Contexts.js +0 -133
- package/components/page/DefinitionView.svelte.d.ts +0 -18
- package/components/page/Description.svelte.d.ts +0 -14
- package/components/page/Edition.svelte +0 -161
- package/components/page/Edition.svelte.d.ts +0 -20
- package/components/page/EditionLoader.svelte +0 -99
- package/components/page/EditionLoader.svelte.d.ts +0 -18
- package/components/page/Editions.svelte.d.ts +0 -14
- package/components/page/Glossary.svelte.d.ts +0 -14
- package/components/page/Header.svelte.d.ts +0 -29
- package/components/page/Index.svelte.d.ts +0 -14
- package/components/page/Instructions.svelte.d.ts +0 -18
- package/components/page/License.svelte.d.ts +0 -14
- package/components/page/Loading.svelte.d.ts +0 -23
- package/components/page/Media.svelte.d.ts +0 -14
- package/components/page/MediaPreview.svelte.d.ts +0 -19
- package/components/page/Muted.svelte.d.ts +0 -27
- package/components/page/Outline.svelte.d.ts +0 -19
- package/components/page/Page.svelte +0 -84
- package/components/page/Page.svelte.d.ts +0 -19
- package/components/page/PageHeader.svelte.d.ts +0 -18
- package/components/page/PageParagraph.svelte.d.ts +0 -27
- package/components/page/PossibleChapter.svelte +0 -14
- package/components/page/PossibleChapter.svelte.d.ts +0 -14
- package/components/page/PossibleReference.svelte +0 -11
- package/components/page/PossibleReference.svelte.d.ts +0 -18
- package/components/page/Print.svelte.d.ts +0 -14
- package/components/page/Publish.svelte.d.ts +0 -14
- package/components/page/Reference.svelte.d.ts +0 -17
- package/components/page/References.svelte.d.ts +0 -14
- package/components/page/Rows.svelte.d.ts +0 -27
- package/components/page/Search.svelte +0 -133
- package/components/page/Search.svelte.d.ts +0 -14
- package/components/page/Status.svelte.d.ts +0 -14
- package/components/page/SubdomainEditor.svelte.d.ts +0 -14
- package/components/page/TableOfContents.svelte.d.ts +0 -14
- package/components/page/TableOfContentsImage.svelte +0 -18
- package/components/page/TableOfContentsImage.svelte.d.ts +0 -16
- package/components/page/TableOfContentsRow.svelte.d.ts +0 -24
- package/components/page/ThemeEditor.svelte.d.ts +0 -14
- package/components/page/ThemeEditorPreview.svelte.d.ts +0 -17
- package/components/page/ThemeSetEditor.svelte +0 -19
- package/components/page/ThemeSetEditor.svelte.d.ts +0 -18
- package/components/page/ThemeVariableEditor.svelte.d.ts +0 -18
- package/components/page/Title.svelte.d.ts +0 -27
- package/components/page/Unknown.svelte.d.ts +0 -16
- package/components/page/margins.d.ts +0 -2
- package/index.d.ts +0 -15
- package/models/CRUD.d.ts +0 -27
- package/models/CRUD.js +0 -262
- package/models/Firebase.d.ts +0 -5
- package/models/book/Book.d.ts +0 -61
- package/models/book/Book.js +0 -135
- package/models/book/BookMedia.d.ts +0 -23
- package/models/book/BookMedia.js +0 -108
- package/models/book/BookSaveStatus.d.ts +0 -7
- package/models/book/BookSaveStatus.js +0 -8
- package/models/book/Chapter.d.ts +0 -81
- package/models/book/Chapter.js +0 -212
- package/models/book/ChapterID.d.ts +0 -10
- package/models/book/Definition.d.ts +0 -6
- package/models/book/Definition.js +0 -1
- package/models/book/Edition.d.ts +0 -139
- package/models/book/Edition.js +0 -620
- package/models/book/Reference.d.ts +0 -24
- package/models/book/Reference.js +0 -78
- package/models/book/Schema.d.ts +0 -174
- package/models/book/Theme.d.ts +0 -113
- package/models/book/ThemeColors.js +0 -1
- package/models/book/Words.d.ts +0 -2
- package/models/chapter/AtomNode.d.ts +0 -18
- package/models/chapter/BlockNode.d.ts +0 -20
- package/models/chapter/BlocksNode.d.ts +0 -50
- package/models/chapter/BlocksNode.test.d.ts +0 -1
- package/models/chapter/BlocksNode.test.js +0 -568
- package/models/chapter/Bookkeeping.js +0 -1
- package/models/chapter/CalloutNode.d.ts +0 -17
- package/models/chapter/CalloutNode.js +0 -58
- package/models/chapter/Caret.d.ts +0 -23
- package/models/chapter/ChapterNode.d.ts +0 -34
- package/models/chapter/ChapterNode.js +0 -117
- package/models/chapter/CitationsNode.d.ts +0 -16
- package/models/chapter/CodeNode.d.ts +0 -35
- package/models/chapter/CommentNode.d.ts +0 -18
- package/models/chapter/CommentNode.js +0 -48
- package/models/chapter/DefinitionNode.d.ts +0 -12
- package/models/chapter/Edit.d.ts +0 -7
- package/models/chapter/Edit.js +0 -1
- package/models/chapter/EmbedNode.d.ts +0 -45
- package/models/chapter/EmbedNode.js +0 -168
- package/models/chapter/ErrorNode.d.ts +0 -17
- package/models/chapter/FootnoteNode.d.ts +0 -18
- package/models/chapter/FootnoteNode.js +0 -47
- package/models/chapter/FormatNode.d.ts +0 -60
- package/models/chapter/FormatNode.test.d.ts +0 -1
- package/models/chapter/FormatNode.test.js +0 -96
- package/models/chapter/InlineCodeNode.d.ts +0 -12
- package/models/chapter/LabelNode.d.ts +0 -17
- package/models/chapter/LinkNode.d.ts +0 -12
- package/models/chapter/ListNode.d.ts +0 -51
- package/models/chapter/ListNode.test.d.ts +0 -1
- package/models/chapter/MetadataNode.d.ts +0 -17
- package/models/chapter/MetadataNode.js +0 -32
- package/models/chapter/Node.d.ts +0 -38
- package/models/chapter/Node.test.d.ts +0 -1
- package/models/chapter/ParagraphNode.d.ts +0 -33
- package/models/chapter/ParagraphNode.test.d.ts +0 -1
- package/models/chapter/ParagraphNode.test.js +0 -30
- package/models/chapter/Parser.d.ts +0 -75
- package/models/chapter/Parser.test.d.ts +0 -1
- package/models/chapter/Position.js +0 -1
- package/models/chapter/QuoteNode.d.ts +0 -25
- package/models/chapter/QuoteNode.js +0 -99
- package/models/chapter/RootNode.js +0 -1
- package/models/chapter/RuleNode.d.ts +0 -15
- package/models/chapter/TableNode.d.ts +0 -37
- package/models/chapter/TableNode.test.d.ts +0 -1
- package/models/chapter/TextNode.d.ts +0 -36
- package/models/chapter/TextNode.test.d.ts +0 -1
- package/util/getSubdomain.d.ts +0 -3
- package/util/isMobile.d.ts +0 -2
- package/util/mineReference.d.ts +0 -4
- package/util/scrollToEyeLevel.d.ts +0 -2
|
@@ -0,0 +1,171 @@
|
|
|
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
|
+
|
|
11
|
+
constructor(
|
|
12
|
+
citationID: string,
|
|
13
|
+
authors: string = '',
|
|
14
|
+
year: string = '',
|
|
15
|
+
title: string = '',
|
|
16
|
+
source: string = '',
|
|
17
|
+
url: string = '',
|
|
18
|
+
summary: string = '',
|
|
19
|
+
short: boolean = false
|
|
20
|
+
) {
|
|
21
|
+
this.citationID = citationID;
|
|
22
|
+
this.authors = authors;
|
|
23
|
+
this.year = year;
|
|
24
|
+
this.title = title;
|
|
25
|
+
this.source = source;
|
|
26
|
+
this.url = url;
|
|
27
|
+
this.summary = summary;
|
|
28
|
+
this.short = short;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
toText() {
|
|
32
|
+
return (
|
|
33
|
+
this.authors +
|
|
34
|
+
' ' +
|
|
35
|
+
this.year +
|
|
36
|
+
' ' +
|
|
37
|
+
this.title +
|
|
38
|
+
' ' +
|
|
39
|
+
this.source +
|
|
40
|
+
(this.summary ? this.summary : '')
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
toList() {
|
|
45
|
+
return [
|
|
46
|
+
this.authors,
|
|
47
|
+
this.year,
|
|
48
|
+
this.title,
|
|
49
|
+
this.source,
|
|
50
|
+
this.url,
|
|
51
|
+
this.summary,
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
copy() {
|
|
56
|
+
return new Reference(
|
|
57
|
+
this.citationID,
|
|
58
|
+
this.authors,
|
|
59
|
+
this.year,
|
|
60
|
+
this.title,
|
|
61
|
+
this.source,
|
|
62
|
+
this.url,
|
|
63
|
+
this.summary,
|
|
64
|
+
this.short
|
|
65
|
+
) as this;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
withChildReplaced() {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
withContentInRange(): this | undefined {
|
|
73
|
+
return this.copy();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
withCitationID(id: string) {
|
|
77
|
+
return new Reference(
|
|
78
|
+
id,
|
|
79
|
+
this.authors,
|
|
80
|
+
this.year,
|
|
81
|
+
this.title,
|
|
82
|
+
this.source,
|
|
83
|
+
this.url,
|
|
84
|
+
this.summary,
|
|
85
|
+
this.short
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
withAuthors(authors: string) {
|
|
89
|
+
return new Reference(
|
|
90
|
+
this.citationID,
|
|
91
|
+
authors,
|
|
92
|
+
this.year,
|
|
93
|
+
this.title,
|
|
94
|
+
this.source,
|
|
95
|
+
this.url,
|
|
96
|
+
this.summary,
|
|
97
|
+
this.short
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
withYear(year: string) {
|
|
101
|
+
return new Reference(
|
|
102
|
+
this.citationID,
|
|
103
|
+
this.authors,
|
|
104
|
+
year,
|
|
105
|
+
this.title,
|
|
106
|
+
this.source,
|
|
107
|
+
this.url,
|
|
108
|
+
this.summary,
|
|
109
|
+
this.short
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
withTitle(title: string) {
|
|
113
|
+
return new Reference(
|
|
114
|
+
this.citationID,
|
|
115
|
+
this.authors,
|
|
116
|
+
this.year,
|
|
117
|
+
title,
|
|
118
|
+
this.source,
|
|
119
|
+
this.url,
|
|
120
|
+
this.summary,
|
|
121
|
+
this.short
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
withSource(source: string) {
|
|
125
|
+
return new Reference(
|
|
126
|
+
this.citationID,
|
|
127
|
+
this.authors,
|
|
128
|
+
this.year,
|
|
129
|
+
this.title,
|
|
130
|
+
source,
|
|
131
|
+
this.url,
|
|
132
|
+
this.summary,
|
|
133
|
+
this.short
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
withURL(url: string) {
|
|
137
|
+
return new Reference(
|
|
138
|
+
this.citationID,
|
|
139
|
+
this.authors,
|
|
140
|
+
this.year,
|
|
141
|
+
this.title,
|
|
142
|
+
this.source,
|
|
143
|
+
url,
|
|
144
|
+
this.summary,
|
|
145
|
+
this.short
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
withSummary(summary: string) {
|
|
149
|
+
return new Reference(
|
|
150
|
+
this.citationID,
|
|
151
|
+
this.authors,
|
|
152
|
+
this.year,
|
|
153
|
+
this.title,
|
|
154
|
+
this.source,
|
|
155
|
+
this.url,
|
|
156
|
+
summary,
|
|
157
|
+
this.short
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
equals(ref: Reference) {
|
|
162
|
+
return (
|
|
163
|
+
this.authors === ref.authors &&
|
|
164
|
+
this.year === ref.year &&
|
|
165
|
+
this.title === ref.title &&
|
|
166
|
+
this.source === ref.source &&
|
|
167
|
+
this.summary == ref.summary &&
|
|
168
|
+
this.short === ref.short
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -1,3 +1,53 @@
|
|
|
1
|
+
import type ThemeColors from './ThemeColors';
|
|
2
|
+
|
|
3
|
+
type Theme = {
|
|
4
|
+
// A list of URLs to CSS files (for including @font-face declarations other other custom style).
|
|
5
|
+
imports?: string[];
|
|
6
|
+
// Background colors
|
|
7
|
+
light?: ThemeColors;
|
|
8
|
+
dark?: ThemeColors;
|
|
9
|
+
// Fonts
|
|
10
|
+
fonts?: {
|
|
11
|
+
paragraphFontFamily?: string;
|
|
12
|
+
headerFontFamily?: string;
|
|
13
|
+
codeFontFamily?: string;
|
|
14
|
+
bulletFontFamily?: string;
|
|
15
|
+
};
|
|
16
|
+
// Fonts
|
|
17
|
+
sizes?: {
|
|
18
|
+
paragraphFontSize?: string;
|
|
19
|
+
blockFontSize?: string;
|
|
20
|
+
smallFontSize?: string;
|
|
21
|
+
titleFontSize?: string;
|
|
22
|
+
header1FontSize?: string;
|
|
23
|
+
header2FontSize?: string;
|
|
24
|
+
header3FontSize?: string;
|
|
25
|
+
codeFontSize?: string;
|
|
26
|
+
};
|
|
27
|
+
weights?: {
|
|
28
|
+
headerFontWeight?: string;
|
|
29
|
+
paragraphFontWeight?: string;
|
|
30
|
+
boldFontWeight?: string;
|
|
31
|
+
linkFontWeight?: string;
|
|
32
|
+
codeFontWeight?: string;
|
|
33
|
+
bulletFontWeight?: string;
|
|
34
|
+
};
|
|
35
|
+
// Spacing
|
|
36
|
+
spacing?: {
|
|
37
|
+
paragraphLineHeight?: string;
|
|
38
|
+
paragraphLineHeightTight?: string;
|
|
39
|
+
headerLineHeight?: string;
|
|
40
|
+
paragraphSpacing?: string;
|
|
41
|
+
headerSpacing?: string;
|
|
42
|
+
indent?: string;
|
|
43
|
+
inlinePadding?: string;
|
|
44
|
+
blockPadding?: string;
|
|
45
|
+
roundedness?: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default Theme;
|
|
50
|
+
|
|
1
51
|
export const BookishTheme = {
|
|
2
52
|
imports: [
|
|
3
53
|
'https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400;1,700&family=Outfit:wght@300;700&display=swap',
|
|
@@ -8,9 +58,11 @@ export const BookishTheme = {
|
|
|
8
58
|
backgroundColor: '#FFFFFF',
|
|
9
59
|
blockBackgroundColor: '#FCFAFA',
|
|
10
60
|
errorBackgroundColor: '#F8D7DA',
|
|
61
|
+
|
|
11
62
|
// Border colors
|
|
12
63
|
borderColorLight: '#E0E0E0',
|
|
13
64
|
borderColorBold: '#000000',
|
|
65
|
+
|
|
14
66
|
// Foreground colors
|
|
15
67
|
paragraphColor: '#000000',
|
|
16
68
|
mutedColor: '#9AA1A7',
|
|
@@ -25,9 +77,11 @@ export const BookishTheme = {
|
|
|
25
77
|
backgroundColor: '#1C1C1C',
|
|
26
78
|
blockBackgroundColor: '#333333',
|
|
27
79
|
errorBackgroundColor: '#721C24',
|
|
80
|
+
|
|
28
81
|
// Border colors
|
|
29
82
|
borderColorLight: '#444444',
|
|
30
83
|
borderColorBold: '#DADADA',
|
|
84
|
+
|
|
31
85
|
// Foreground colors
|
|
32
86
|
paragraphColor: '#DADADA',
|
|
33
87
|
mutedColor: '#666666',
|
|
@@ -37,6 +91,7 @@ export const BookishTheme = {
|
|
|
37
91
|
linkColor: '#73a3fa',
|
|
38
92
|
bulletColor: '#721C24',
|
|
39
93
|
},
|
|
94
|
+
|
|
40
95
|
// Fonts
|
|
41
96
|
fonts: {
|
|
42
97
|
paragraphFontFamily: '"Noto Serif", serif',
|
|
@@ -44,6 +99,7 @@ export const BookishTheme = {
|
|
|
44
99
|
codeFontFamily: '"Courier New", monospace',
|
|
45
100
|
bulletFontFamily: '"Outfit", serif',
|
|
46
101
|
},
|
|
102
|
+
|
|
47
103
|
// Font sizes
|
|
48
104
|
sizes: {
|
|
49
105
|
paragraphFontSize: '14pt',
|
|
@@ -55,6 +111,7 @@ export const BookishTheme = {
|
|
|
55
111
|
header3FontSize: '14pt',
|
|
56
112
|
codeFontSize: '12pt',
|
|
57
113
|
},
|
|
114
|
+
|
|
58
115
|
// Font weights
|
|
59
116
|
weights: {
|
|
60
117
|
headerFontWeight: '700',
|
|
@@ -64,6 +121,7 @@ export const BookishTheme = {
|
|
|
64
121
|
codeFontWeight: '400',
|
|
65
122
|
bulletFontWeight: '500',
|
|
66
123
|
},
|
|
124
|
+
|
|
67
125
|
// Spacing
|
|
68
126
|
spacing: {
|
|
69
127
|
paragraphLineHeight: '1.8em',
|
|
@@ -77,7 +135,8 @@ export const BookishTheme = {
|
|
|
77
135
|
roundedness: '5px',
|
|
78
136
|
},
|
|
79
137
|
};
|
|
80
|
-
|
|
138
|
+
|
|
139
|
+
export const SeriousTheme: Theme = {
|
|
81
140
|
imports: [
|
|
82
141
|
'https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Roboto:ital,wght@0,300;0,500;1,300&display=swap',
|
|
83
142
|
],
|
|
@@ -87,9 +146,11 @@ export const SeriousTheme = {
|
|
|
87
146
|
backgroundColor: '#FFFFFF',
|
|
88
147
|
blockBackgroundColor: '#FCFAFA',
|
|
89
148
|
errorBackgroundColor: '#F8D7DA',
|
|
149
|
+
|
|
90
150
|
// Border colors
|
|
91
151
|
borderColorLight: '#E0E0E0',
|
|
92
152
|
borderColorBold: '#000000',
|
|
153
|
+
|
|
93
154
|
// Foreground colors
|
|
94
155
|
paragraphColor: '#000000',
|
|
95
156
|
mutedColor: '#9AA1A7',
|
|
@@ -104,9 +165,11 @@ export const SeriousTheme = {
|
|
|
104
165
|
backgroundColor: '#010101',
|
|
105
166
|
blockBackgroundColor: '#333333',
|
|
106
167
|
errorBackgroundColor: '#721C24',
|
|
168
|
+
|
|
107
169
|
// Border colors
|
|
108
170
|
borderColorLight: '#444444',
|
|
109
171
|
borderColorBold: '#DADADA',
|
|
172
|
+
|
|
110
173
|
// Foreground colors
|
|
111
174
|
paragraphColor: '#DADADA',
|
|
112
175
|
mutedColor: '#666666',
|
|
@@ -116,6 +179,7 @@ export const SeriousTheme = {
|
|
|
116
179
|
linkColor: '#b36363',
|
|
117
180
|
bulletColor: '#b36363',
|
|
118
181
|
},
|
|
182
|
+
|
|
119
183
|
// Fonts
|
|
120
184
|
fonts: {
|
|
121
185
|
paragraphFontFamily: '"Roboto", serif',
|
|
@@ -123,6 +187,7 @@ export const SeriousTheme = {
|
|
|
123
187
|
codeFontFamily: '"Courier New", monospace',
|
|
124
188
|
bulletFontFamily: '"Roboto"',
|
|
125
189
|
},
|
|
190
|
+
|
|
126
191
|
// Font sizes
|
|
127
192
|
sizes: {
|
|
128
193
|
paragraphFontSize: '14pt',
|
|
@@ -134,6 +199,7 @@ export const SeriousTheme = {
|
|
|
134
199
|
header3FontSize: '14pt',
|
|
135
200
|
codeFontSize: '12pt',
|
|
136
201
|
},
|
|
202
|
+
|
|
137
203
|
// Font weights
|
|
138
204
|
weights: {
|
|
139
205
|
headerFontWeight: '700',
|
|
@@ -143,6 +209,7 @@ export const SeriousTheme = {
|
|
|
143
209
|
codeFontWeight: '400',
|
|
144
210
|
bulletFontWeight: '500',
|
|
145
211
|
},
|
|
212
|
+
|
|
146
213
|
// Spacing
|
|
147
214
|
spacing: {
|
|
148
215
|
paragraphLineHeight: '2rem',
|
|
@@ -156,7 +223,8 @@ export const SeriousTheme = {
|
|
|
156
223
|
roundedness: '5px',
|
|
157
224
|
},
|
|
158
225
|
};
|
|
159
|
-
|
|
226
|
+
|
|
227
|
+
export const TechTheme: Theme = {
|
|
160
228
|
imports: [
|
|
161
229
|
'https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,500;1,300&family=Russo+One&display=swap',
|
|
162
230
|
],
|
|
@@ -166,9 +234,11 @@ export const TechTheme = {
|
|
|
166
234
|
backgroundColor: '#FFFFFF',
|
|
167
235
|
blockBackgroundColor: '#FCFAFA',
|
|
168
236
|
errorBackgroundColor: '#F8D7DA',
|
|
237
|
+
|
|
169
238
|
// Border colors
|
|
170
239
|
borderColorLight: '#E0E0E0',
|
|
171
240
|
borderColorBold: '#000000',
|
|
241
|
+
|
|
172
242
|
// Foreground colors
|
|
173
243
|
paragraphColor: '#000000',
|
|
174
244
|
mutedColor: '#9AA1A7',
|
|
@@ -183,9 +253,11 @@ export const TechTheme = {
|
|
|
183
253
|
backgroundColor: '#000000',
|
|
184
254
|
blockBackgroundColor: '#333333',
|
|
185
255
|
errorBackgroundColor: '#721C24',
|
|
256
|
+
|
|
186
257
|
// Border colors
|
|
187
258
|
borderColorLight: '#444444',
|
|
188
259
|
borderColorBold: '#DADADA',
|
|
260
|
+
|
|
189
261
|
// Foreground colors
|
|
190
262
|
paragraphColor: '#DADADA',
|
|
191
263
|
mutedColor: '#959595',
|
|
@@ -195,6 +267,7 @@ export const TechTheme = {
|
|
|
195
267
|
linkColor: '#7589e6',
|
|
196
268
|
bulletColor: '#7589e6',
|
|
197
269
|
},
|
|
270
|
+
|
|
198
271
|
// Fonts
|
|
199
272
|
fonts: {
|
|
200
273
|
paragraphFontFamily: '"Roboto", serif',
|
|
@@ -202,6 +275,7 @@ export const TechTheme = {
|
|
|
202
275
|
bulletFontFamily: '"Roboto"',
|
|
203
276
|
codeFontFamily: '"Courier New", monospace',
|
|
204
277
|
},
|
|
278
|
+
|
|
205
279
|
// Font sizes
|
|
206
280
|
sizes: {
|
|
207
281
|
paragraphFontSize: '14pt',
|
|
@@ -213,6 +287,7 @@ export const TechTheme = {
|
|
|
213
287
|
header3FontSize: '14pt',
|
|
214
288
|
codeFontSize: '12pt',
|
|
215
289
|
},
|
|
290
|
+
|
|
216
291
|
// Font weights
|
|
217
292
|
weights: {
|
|
218
293
|
headerFontWeight: '300',
|
|
@@ -222,20 +297,22 @@ export const TechTheme = {
|
|
|
222
297
|
codeFontWeight: '400',
|
|
223
298
|
bulletFontWeight: '500',
|
|
224
299
|
},
|
|
300
|
+
|
|
225
301
|
// Spacing
|
|
226
302
|
spacing: {
|
|
227
303
|
paragraphLineHeight: '2rem',
|
|
228
304
|
paragraphLineHeightTight: '1.4em',
|
|
229
305
|
headerLineHeight: '3em',
|
|
230
306
|
paragraphSpacing: '1.8rem',
|
|
231
|
-
headerSpacing: '
|
|
307
|
+
headerSpacing: '1.4rem',
|
|
232
308
|
indent: '10%',
|
|
233
309
|
inlinePadding: '0.25rem',
|
|
234
310
|
blockPadding: '1rem',
|
|
235
311
|
roundedness: '5px',
|
|
236
312
|
},
|
|
237
313
|
};
|
|
238
|
-
|
|
314
|
+
|
|
315
|
+
export const HumanTheme: Theme = {
|
|
239
316
|
imports: [
|
|
240
317
|
'https://fonts.googleapis.com/css2?family=Caveat&family=Piazzolla:ital,wght@0,300;0,700;1,300&display=swap',
|
|
241
318
|
],
|
|
@@ -245,9 +322,11 @@ export const HumanTheme = {
|
|
|
245
322
|
backgroundColor: '#FFFFFF',
|
|
246
323
|
blockBackgroundColor: '#FCFAFA',
|
|
247
324
|
errorBackgroundColor: '#F8D7DA',
|
|
325
|
+
|
|
248
326
|
// Border colors
|
|
249
327
|
borderColorLight: '#E0E0E0',
|
|
250
328
|
borderColorBold: '#000000',
|
|
329
|
+
|
|
251
330
|
// Foreground colors
|
|
252
331
|
paragraphColor: '#000000',
|
|
253
332
|
mutedColor: '#9AA1A7',
|
|
@@ -262,9 +341,11 @@ export const HumanTheme = {
|
|
|
262
341
|
backgroundColor: '#141421',
|
|
263
342
|
blockBackgroundColor: '#333333',
|
|
264
343
|
errorBackgroundColor: '#721C24',
|
|
344
|
+
|
|
265
345
|
// Border colors
|
|
266
346
|
borderColorLight: '#444444',
|
|
267
347
|
borderColorBold: '#DADADA',
|
|
348
|
+
|
|
268
349
|
// Foreground colors
|
|
269
350
|
paragraphColor: '#DADADA',
|
|
270
351
|
mutedColor: '#666666',
|
|
@@ -274,6 +355,7 @@ export const HumanTheme = {
|
|
|
274
355
|
linkColor: '#2b8ae3',
|
|
275
356
|
bulletColor: '#2b8ae3',
|
|
276
357
|
},
|
|
358
|
+
|
|
277
359
|
// Fonts
|
|
278
360
|
fonts: {
|
|
279
361
|
paragraphFontFamily: '"Piazzolla", serif',
|
|
@@ -281,6 +363,7 @@ export const HumanTheme = {
|
|
|
281
363
|
codeFontFamily: '"Courier New", monospace',
|
|
282
364
|
bulletFontFamily: '"Caveat", serif',
|
|
283
365
|
},
|
|
366
|
+
|
|
284
367
|
// Font sizes
|
|
285
368
|
sizes: {
|
|
286
369
|
paragraphFontSize: '14pt',
|
|
@@ -292,6 +375,7 @@ export const HumanTheme = {
|
|
|
292
375
|
header3FontSize: '20pt',
|
|
293
376
|
codeFontSize: '11pt',
|
|
294
377
|
},
|
|
378
|
+
|
|
295
379
|
// Font weights
|
|
296
380
|
weights: {
|
|
297
381
|
headerFontWeight: '700',
|
|
@@ -301,6 +385,7 @@ export const HumanTheme = {
|
|
|
301
385
|
codeFontWeight: '400',
|
|
302
386
|
bulletFontWeight: '300',
|
|
303
387
|
},
|
|
388
|
+
|
|
304
389
|
// Spacing
|
|
305
390
|
spacing: {
|
|
306
391
|
paragraphLineHeight: '2.2rem',
|
|
@@ -314,7 +399,8 @@ export const HumanTheme = {
|
|
|
314
399
|
roundedness: '5px',
|
|
315
400
|
},
|
|
316
401
|
};
|
|
317
|
-
|
|
402
|
+
|
|
403
|
+
export const SketchyTheme: Theme = {
|
|
318
404
|
imports: [
|
|
319
405
|
'https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,300;0,500;1,300&family=Cabin+Sketch&display=swap',
|
|
320
406
|
],
|
|
@@ -324,9 +410,11 @@ export const SketchyTheme = {
|
|
|
324
410
|
backgroundColor: '#FFFFFF',
|
|
325
411
|
blockBackgroundColor: '#FCFAFA',
|
|
326
412
|
errorBackgroundColor: '#F8D7DA',
|
|
413
|
+
|
|
327
414
|
// Border colors
|
|
328
415
|
borderColorLight: '#E0E0E0',
|
|
329
416
|
borderColorBold: '#000000',
|
|
417
|
+
|
|
330
418
|
// Foreground colors
|
|
331
419
|
paragraphColor: '#000000',
|
|
332
420
|
mutedColor: '#9AA1A7',
|
|
@@ -341,9 +429,11 @@ export const SketchyTheme = {
|
|
|
341
429
|
backgroundColor: '#1C1C1C',
|
|
342
430
|
blockBackgroundColor: '#333333',
|
|
343
431
|
errorBackgroundColor: '#721C24',
|
|
432
|
+
|
|
344
433
|
// Border colors
|
|
345
434
|
borderColorLight: '#444444',
|
|
346
435
|
borderColorBold: '#DADADA',
|
|
436
|
+
|
|
347
437
|
// Foreground colors
|
|
348
438
|
paragraphColor: '#DADADA',
|
|
349
439
|
mutedColor: '#666666',
|
|
@@ -353,6 +443,7 @@ export const SketchyTheme = {
|
|
|
353
443
|
linkColor: '#9c7e2c',
|
|
354
444
|
bulletColor: '#9c7e2c',
|
|
355
445
|
},
|
|
446
|
+
|
|
356
447
|
// Fonts
|
|
357
448
|
fonts: {
|
|
358
449
|
paragraphFontFamily: '"Bitter", serif',
|
|
@@ -360,6 +451,7 @@ export const SketchyTheme = {
|
|
|
360
451
|
codeFontFamily: '"Courier New", monospace',
|
|
361
452
|
bulletFontFamily: '"Verdana"',
|
|
362
453
|
},
|
|
454
|
+
|
|
363
455
|
// Font sizes
|
|
364
456
|
sizes: {
|
|
365
457
|
paragraphFontSize: '14pt',
|
|
@@ -371,6 +463,7 @@ export const SketchyTheme = {
|
|
|
371
463
|
header3FontSize: '16pt',
|
|
372
464
|
codeFontSize: '12pt',
|
|
373
465
|
},
|
|
466
|
+
|
|
374
467
|
// Font weights
|
|
375
468
|
weights: {
|
|
376
469
|
headerFontWeight: '500',
|
|
@@ -380,6 +473,7 @@ export const SketchyTheme = {
|
|
|
380
473
|
codeFontWeight: '400',
|
|
381
474
|
bulletFontWeight: '500',
|
|
382
475
|
},
|
|
476
|
+
|
|
383
477
|
// Spacing
|
|
384
478
|
spacing: {
|
|
385
479
|
paragraphLineHeight: '2.4em',
|
|
@@ -393,22 +487,26 @@ export const SketchyTheme = {
|
|
|
393
487
|
roundedness: '5px',
|
|
394
488
|
},
|
|
395
489
|
};
|
|
396
|
-
|
|
490
|
+
|
|
491
|
+
export const CriticalTheme: Theme = {
|
|
397
492
|
imports: [
|
|
398
493
|
'https://fonts.googleapis.com/css2?family=Arvo:ital,wght@0,400;0,700;1,400;1,700&display=block',
|
|
399
494
|
'https://fonts.googleapis.com/css2?family=DM+Mono&display=block',
|
|
400
495
|
'https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@500&display=block',
|
|
401
496
|
'https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,400;0,700;1,400;1,700&display=swap',
|
|
402
497
|
],
|
|
498
|
+
|
|
403
499
|
// Background colors
|
|
404
500
|
light: {
|
|
405
501
|
// Background colors;
|
|
406
502
|
backgroundColor: '#FFFFFF',
|
|
407
503
|
blockBackgroundColor: '#FCFAFA',
|
|
408
504
|
errorBackgroundColor: '#F8D7DA',
|
|
505
|
+
|
|
409
506
|
// Border colors
|
|
410
507
|
borderColorLight: '#E0E0E0',
|
|
411
508
|
borderColorBold: '#000000',
|
|
509
|
+
|
|
412
510
|
// Foreground colors
|
|
413
511
|
paragraphColor: '#000000',
|
|
414
512
|
mutedColor: '#9AA1A7',
|
|
@@ -423,9 +521,11 @@ export const CriticalTheme = {
|
|
|
423
521
|
backgroundColor: '#1C1C1C',
|
|
424
522
|
blockBackgroundColor: '#333333',
|
|
425
523
|
errorBackgroundColor: '#721C24',
|
|
524
|
+
|
|
426
525
|
// Border colors
|
|
427
526
|
borderColorLight: '#444444',
|
|
428
527
|
borderColorBold: '#DADADA',
|
|
528
|
+
|
|
429
529
|
// Foreground colors
|
|
430
530
|
paragraphColor: '#DADADA',
|
|
431
531
|
mutedColor: '#CCCCCC',
|
|
@@ -435,6 +535,7 @@ export const CriticalTheme = {
|
|
|
435
535
|
linkColor: '#73a3fa',
|
|
436
536
|
bulletColor: '#721C24',
|
|
437
537
|
},
|
|
538
|
+
|
|
438
539
|
// Fonts
|
|
439
540
|
fonts: {
|
|
440
541
|
paragraphFontFamily: '"Bitter", serif',
|
|
@@ -442,6 +543,7 @@ export const CriticalTheme = {
|
|
|
442
543
|
codeFontFamily: '"DM Mono", monospace',
|
|
443
544
|
bulletFontFamily: '"M Plus Rounded 1c", serif',
|
|
444
545
|
},
|
|
546
|
+
|
|
445
547
|
// Font sizes
|
|
446
548
|
sizes: {
|
|
447
549
|
paragraphFontSize: '14pt',
|
|
@@ -453,6 +555,7 @@ export const CriticalTheme = {
|
|
|
453
555
|
header3FontSize: '14pt',
|
|
454
556
|
codeFontSize: '12pt',
|
|
455
557
|
},
|
|
558
|
+
|
|
456
559
|
// Font weights
|
|
457
560
|
weights: {
|
|
458
561
|
headerFontWeight: '700',
|
|
@@ -462,6 +565,7 @@ export const CriticalTheme = {
|
|
|
462
565
|
codeFontWeight: '400',
|
|
463
566
|
bulletFontWeight: '400',
|
|
464
567
|
},
|
|
568
|
+
|
|
465
569
|
// Spacing
|
|
466
570
|
spacing: {
|
|
467
571
|
paragraphLineHeight: '2.2em',
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
type ThemeColors = {
|
|
2
|
+
// Background colors;
|
|
2
3
|
backgroundColor: string;
|
|
3
4
|
blockBackgroundColor: string;
|
|
4
5
|
errorBackgroundColor: string;
|
|
6
|
+
|
|
7
|
+
// Border colors
|
|
5
8
|
borderColorLight: string;
|
|
6
9
|
borderColorBold: string;
|
|
10
|
+
|
|
11
|
+
// Foreground colors
|
|
7
12
|
paragraphColor: string;
|
|
8
13
|
mutedColor: string;
|
|
9
14
|
highlightColor: string;
|
|
@@ -12,4 +17,5 @@ type ThemeColors = {
|
|
|
12
17
|
linkColor: string;
|
|
13
18
|
bulletColor: string;
|
|
14
19
|
};
|
|
20
|
+
|
|
15
21
|
export default ThemeColors;
|
|
@@ -1,38 +1,58 @@
|
|
|
1
|
+
import type Caret from './Caret';
|
|
1
2
|
import FormatNode from './FormatNode';
|
|
2
3
|
import Node from './Node';
|
|
3
4
|
import TextNode from './TextNode';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import type RootNode from './RootNode';
|
|
6
|
+
|
|
7
|
+
export default abstract class AtomNode<MetadataType> extends Node {
|
|
8
|
+
readonly #meta: MetadataType;
|
|
9
|
+
|
|
10
|
+
constructor(meta: MetadataType) {
|
|
7
11
|
super();
|
|
8
12
|
this.#meta = meta;
|
|
9
13
|
}
|
|
14
|
+
|
|
10
15
|
getMeta() {
|
|
11
16
|
return this.#meta;
|
|
12
17
|
}
|
|
18
|
+
|
|
19
|
+
abstract getDefaultCaret(): Caret | undefined;
|
|
20
|
+
|
|
13
21
|
// Include the meta node if it's a node, to include it in normal operations.
|
|
14
22
|
// We special case it in other places to avoid breaking other conventions (such as formatting changes, which
|
|
15
23
|
// the atom node should be isolated from).
|
|
16
24
|
getChildren() {
|
|
17
25
|
return this.#meta instanceof Node ? [this.#meta] : [];
|
|
18
26
|
}
|
|
19
|
-
|
|
27
|
+
|
|
28
|
+
nextWord(root: RootNode): Caret {
|
|
20
29
|
const next = root.getNextTextOrAtom(this);
|
|
21
30
|
return next ? { node: next, index: 0 } : { node: this, index: 0 };
|
|
22
31
|
}
|
|
23
|
-
|
|
32
|
+
|
|
33
|
+
previousWord(root: RootNode): Caret {
|
|
24
34
|
const previous = root.getPreviousTextOrAtom(this);
|
|
25
35
|
return previous
|
|
26
36
|
? {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
node: previous,
|
|
38
|
+
index:
|
|
39
|
+
previous instanceof TextNode ? previous.getLength() : 0,
|
|
40
|
+
}
|
|
30
41
|
: { node: this, index: 0 };
|
|
31
42
|
}
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
|
|
44
|
+
getFormatRoot(root: Node): FormatNode | undefined {
|
|
45
|
+
return this.getFarthestParentMatching(
|
|
46
|
+
root,
|
|
47
|
+
(p) => p instanceof FormatNode
|
|
48
|
+
) as FormatNode;
|
|
34
49
|
}
|
|
50
|
+
|
|
35
51
|
getCaretPositionCount() {
|
|
36
52
|
return 1;
|
|
37
53
|
}
|
|
54
|
+
|
|
55
|
+
abstract toBookdown(format?: FormatNode): string;
|
|
56
|
+
abstract toText(): string;
|
|
57
|
+
abstract withMeta(meta: MetadataType): AtomNode<MetadataType>;
|
|
38
58
|
}
|