bookish-press 0.4.47 → 0.4.49
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/components/Auth.svelte +55 -0
- package/components/Auth.svelte.d.ts +16 -0
- package/{src/lib/components/Authentication.ts → components/Authentication.d.ts} +0 -2
- package/components/Authentication.js +1 -0
- package/{src/lib/components → components}/BookPreview.svelte +22 -27
- package/components/BookPreview.svelte.d.ts +18 -0
- package/{src/lib/components → components}/External.svelte +1 -2
- package/components/External.svelte.d.ts +18 -0
- package/components/Link.svelte +51 -0
- package/components/Link.svelte.d.ts +18 -0
- package/{src/lib/components → components}/app/BookList.svelte +3 -6
- package/components/app/BookList.svelte.d.ts +18 -0
- package/{src/lib/components → components}/app/Button.svelte +4 -5
- package/components/app/Button.svelte.d.ts +22 -0
- package/{src/lib/components → components}/app/Feedback.svelte +7 -11
- package/components/app/Feedback.svelte.d.ts +18 -0
- package/{src/lib/components → components}/app/Head.svelte +1 -2
- package/components/app/Head.svelte.d.ts +18 -0
- package/{src/lib/components → components}/app/Large.svelte +0 -0
- package/components/app/Large.svelte.d.ts +27 -0
- package/{src/lib/components → components}/app/Lead.svelte +0 -0
- package/components/app/Lead.svelte.d.ts +27 -0
- package/{src/lib/components → components}/app/Link.svelte +3 -4
- package/components/app/Link.svelte.d.ts +20 -0
- package/{src/lib/components → components}/app/Options.svelte +4 -5
- package/components/app/Options.svelte.d.ts +19 -0
- package/{src/lib/components → components}/app/Paragraph.svelte +1 -2
- package/components/app/Paragraph.svelte.d.ts +18 -0
- package/{src/lib/components → components}/app/Section.svelte +0 -0
- package/components/app/Section.svelte.d.ts +27 -0
- package/{src/lib/components → components}/app/Table.svelte +0 -0
- package/components/app/Table.svelte.d.ts +27 -0
- package/{src/lib/components → components}/app/TextInput.svelte +9 -12
- package/components/app/TextInput.svelte.d.ts +22 -0
- package/{src/lib/components → components}/chapter/Atom.svelte +12 -18
- package/components/chapter/Atom.svelte.d.ts +19 -0
- package/components/chapter/Block.svelte +37 -0
- package/components/chapter/Block.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/Callout.svelte +3 -6
- package/components/chapter/Callout.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/CaptionedCode.svelte +13 -21
- package/components/chapter/CaptionedCode.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/ChapterBody.svelte +9 -13
- package/components/chapter/ChapterBody.svelte.d.ts +19 -0
- package/{src/lib/components → components}/chapter/Citations.svelte +33 -34
- package/components/chapter/Citations.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/Code.svelte +60 -64
- package/components/chapter/Code.svelte.d.ts +22 -0
- package/{src/lib/components → components}/chapter/Comment.svelte +18 -30
- package/components/chapter/Comment.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/Definition.svelte +17 -23
- package/components/chapter/Definition.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/Embed.svelte +77 -97
- package/components/chapter/Embed.svelte.d.ts +20 -0
- package/components/chapter/ErrorMessage.svelte +9 -0
- package/components/chapter/ErrorMessage.svelte.d.ts +17 -0
- package/components/chapter/ExtendedPrism.d.ts +2 -0
- package/{src/lib/components → components}/chapter/ExtendedPrism.js +0 -0
- package/{src/lib/components → components}/chapter/Figure.svelte +26 -34
- package/components/chapter/Figure.svelte.d.ts +24 -0
- package/{src/lib/components → components}/chapter/Footnote.svelte +20 -32
- package/components/chapter/Footnote.svelte.d.ts +19 -0
- package/{src/lib/components → components}/chapter/Format.svelte +34 -39
- package/components/chapter/Format.svelte.d.ts +19 -0
- package/{src/lib/components → components}/chapter/InlineCode.svelte +5 -9
- package/components/chapter/InlineCode.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/Label.svelte +14 -23
- package/components/chapter/Label.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/Link.svelte +21 -27
- package/components/chapter/Link.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/List.svelte +3 -5
- package/components/chapter/List.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/Marginal.svelte +41 -54
- package/components/chapter/Marginal.svelte.d.ts +22 -0
- package/{src/lib/components → components}/chapter/Paragraph.svelte +20 -25
- package/components/chapter/Paragraph.svelte.d.ts +18 -0
- package/{src/lib/components → components}/chapter/Positioned.svelte +1 -4
- package/components/chapter/Positioned.svelte.d.ts +19 -0
- package/{src/lib/components → components}/chapter/Problem.svelte +0 -0
- package/components/chapter/Problem.svelte.d.ts +27 -0
- package/components/chapter/Python.svelte +128 -0
- package/components/chapter/Python.svelte.d.ts +18 -0
- package/{src/lib/components → components}/chapter/Quote.svelte +19 -13
- package/components/chapter/Quote.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/Rule.svelte +1 -4
- package/components/chapter/Rule.svelte.d.ts +17 -0
- package/{src/lib/components → components}/chapter/Table.svelte +7 -11
- package/components/chapter/Table.svelte.d.ts +17 -0
- package/components/chapter/Text.svelte +87 -0
- package/components/chapter/Text.svelte.d.ts +18 -0
- package/components/editor/BookishEditor.svelte +884 -0
- package/components/editor/BookishEditor.svelte.d.ts +25 -0
- package/components/editor/CalloutEditor.svelte +10 -0
- package/components/editor/CalloutEditor.svelte.d.ts +17 -0
- package/{src/lib/components → components}/editor/CaptionedCodeEditor.svelte +6 -10
- package/components/editor/CaptionedCodeEditor.svelte.d.ts +17 -0
- package/components/editor/CaretContext.d.ts +50 -0
- package/components/editor/CaretContext.js +1 -0
- package/{src/lib/components/editor/CaretState.ts → components/editor/CaretState.d.ts} +7 -6
- package/components/editor/CaretState.js +1 -0
- package/{src/lib/components/editor/CaretUtilities.ts → components/editor/CaretUtilities.d.ts} +0 -1
- package/components/editor/CaretUtilities.js +1 -0
- package/{src/lib/components → components}/editor/CaretView.svelte +20 -25
- package/components/editor/CaretView.svelte.d.ts +25 -0
- package/components/editor/CitationsEditor.svelte +53 -0
- package/components/editor/CitationsEditor.svelte.d.ts +17 -0
- package/{src/lib/components/editor/Clipboard.ts → components/editor/Clipboard.d.ts} +1 -2
- package/components/editor/Clipboard.js +1 -0
- package/{src/lib/components/editor/Command.ts → components/editor/Command.d.ts} +2 -8
- package/components/editor/Command.js +1 -0
- package/components/editor/Commands.d.ts +3 -0
- package/{src/lib/components/editor/Commands.ts → components/editor/Commands.js} +315 -730
- package/components/editor/ConfirmButton.svelte +49 -0
- package/components/editor/ConfirmButton.svelte.d.ts +19 -0
- package/components/editor/DefinitionEditor.svelte +36 -0
- package/components/editor/DefinitionEditor.svelte.d.ts +17 -0
- package/components/editor/EmbedEditor.svelte +137 -0
- package/components/editor/EmbedEditor.svelte.d.ts +17 -0
- package/{src/lib/components → components}/editor/Icon.svelte +1 -2
- package/components/editor/Icon.svelte.d.ts +16 -0
- package/{src/lib/components → components}/editor/ImageChooser.svelte +19 -24
- package/components/editor/ImageChooser.svelte.d.ts +18 -0
- package/components/editor/InlineCodeEditor.svelte +12 -0
- package/components/editor/InlineCodeEditor.svelte.d.ts +17 -0
- package/{src/lib/components → components}/editor/LabelEditor.svelte +9 -14
- package/components/editor/LabelEditor.svelte.d.ts +17 -0
- package/{src/lib/components → components}/editor/LanguageEditor.svelte +5 -8
- package/components/editor/LanguageEditor.svelte.d.ts +17 -0
- package/components/editor/LinkEditor.svelte +100 -0
- package/components/editor/LinkEditor.svelte.d.ts +17 -0
- package/{src/lib/components → components}/editor/Note.svelte +0 -0
- package/components/editor/Note.svelte.d.ts +27 -0
- package/{src/lib/components → components}/editor/Permissions.svelte +36 -43
- package/components/editor/Permissions.svelte.d.ts +20 -0
- package/components/editor/PositionEditor.svelte +17 -0
- package/components/editor/PositionEditor.svelte.d.ts +18 -0
- package/components/editor/QuoteEditor.svelte +10 -0
- package/components/editor/QuoteEditor.svelte.d.ts +17 -0
- package/{src/lib/components → components}/editor/Switch.svelte +11 -14
- package/components/editor/Switch.svelte.d.ts +20 -0
- package/components/editor/TableEditor.svelte +10 -0
- package/components/editor/TableEditor.svelte.d.ts +17 -0
- package/{src/lib/components → components}/editor/TextEditor.svelte +89 -101
- package/components/editor/TextEditor.svelte.d.ts +24 -0
- package/components/editor/Toggle.svelte +41 -0
- package/components/editor/Toggle.svelte.d.ts +19 -0
- package/components/editor/Toolbar.svelte +249 -0
- package/components/editor/Toolbar.svelte.d.ts +17 -0
- package/{src/lib/components → components}/editor/ToolbarGroup.svelte +3 -5
- package/components/editor/ToolbarGroup.svelte.d.ts +18 -0
- package/{src/lib/components → components}/editor/ToolbarSpacer.svelte +0 -0
- package/components/editor/ToolbarSpacer.svelte.d.ts +23 -0
- package/components/editor/URLEditor.svelte +13 -0
- package/components/editor/URLEditor.svelte.d.ts +18 -0
- package/{src/lib/components/editor/UndoState.ts → components/editor/UndoState.d.ts} +2 -3
- package/components/editor/UndoState.js +1 -0
- package/{src/lib/components → components}/editor/icons/annotate.svg +0 -0
- package/{src/lib/components → components}/editor/icons/block.svg +0 -0
- package/{src/lib/components → components}/editor/icons/bold.svg +0 -0
- package/{src/lib/components → components}/editor/icons/bullets.svg +0 -0
- package/{src/lib/components → components}/editor/icons/callout.svg +0 -0
- package/{src/lib/components → components}/editor/icons/citation.svg +0 -0
- package/{src/lib/components → components}/editor/icons/clear.svg +0 -0
- package/{src/lib/components → components}/editor/icons/clipboard.svg +0 -0
- package/{src/lib/components → components}/editor/icons/code.svg +0 -0
- package/{src/lib/components → components}/editor/icons/columnafter.svg +0 -0
- package/{src/lib/components → components}/editor/icons/columnbefore.svg +0 -0
- package/{src/lib/components → components}/editor/icons/comment.svg +0 -0
- package/{src/lib/components → components}/editor/icons/copy.svg +0 -0
- package/{src/lib/components → components}/editor/icons/cut.svg +0 -0
- package/{src/lib/components → components}/editor/icons/define.svg +0 -0
- package/{src/lib/components → components}/editor/icons/deletecolumn.svg +0 -0
- package/{src/lib/components → components}/editor/icons/deleterow.svg +0 -0
- package/{src/lib/components → components}/editor/icons/footnote.svg +0 -0
- package/{src/lib/components → components}/editor/icons/header1.svg +0 -0
- package/{src/lib/components → components}/editor/icons/header2.svg +0 -0
- package/{src/lib/components → components}/editor/icons/header3.svg +0 -0
- package/{src/lib/components → components}/editor/icons/home.svg +0 -0
- package/{src/lib/components → components}/editor/icons/indent.svg +0 -0
- package/{src/lib/components → components}/editor/icons/italic.svg +0 -0
- package/{src/lib/components → components}/editor/icons/label.svg +0 -0
- package/{src/lib/components → components}/editor/icons/left.svg +0 -0
- package/{src/lib/components → components}/editor/icons/level.svg +0 -0
- package/{src/lib/components → components}/editor/icons/link.svg +0 -0
- package/{src/lib/components → components}/editor/icons/list.svg +0 -0
- package/{src/lib/components → components}/editor/icons/media.svg +0 -0
- package/{src/lib/components → components}/editor/icons/middle.svg +0 -0
- package/{src/lib/components → components}/editor/icons/numbers.svg +0 -0
- package/{src/lib/components → components}/editor/icons/paragraph.svg +0 -0
- package/{src/lib/components → components}/editor/icons/paste.svg +0 -0
- package/{src/lib/components → components}/editor/icons/quote.svg +0 -0
- package/{src/lib/components → components}/editor/icons/redo.svg +0 -0
- package/{src/lib/components → components}/editor/icons/right.svg +0 -0
- package/{src/lib/components → components}/editor/icons/rowabove.svg +0 -0
- package/{src/lib/components → components}/editor/icons/rowbelow.svg +0 -0
- package/{src/lib/components → components}/editor/icons/rule.svg +0 -0
- package/{src/lib/components → components}/editor/icons/sub.svg +0 -0
- package/{src/lib/components → components}/editor/icons/super.svg +0 -0
- package/{src/lib/components → components}/editor/icons/table.svg +0 -0
- package/{src/lib/components → components}/editor/icons/text.svg +0 -0
- package/{src/lib/components → components}/editor/icons/time.svg +0 -0
- package/{src/lib/components → components}/editor/icons/undo.svg +0 -0
- package/{src/lib/components → components}/editor/icons/unindent.svg +0 -0
- package/{src/lib/components → components}/editor/icons/unlink.svg +0 -0
- package/{src/lib/components → components}/page/Acknowledgements.svelte +10 -19
- package/components/page/Acknowledgements.svelte.d.ts +14 -0
- package/components/page/Authors.svelte +85 -0
- package/components/page/Authors.svelte.d.ts +21 -0
- package/components/page/BookLoader.svelte +59 -0
- package/components/page/BookLoader.svelte.d.ts +16 -0
- package/components/page/BulkReferenceEditor.svelte +63 -0
- package/components/page/BulkReferenceEditor.svelte.d.ts +14 -0
- package/components/page/Chapter.svelte +393 -0
- package/components/page/Chapter.svelte.d.ts +18 -0
- package/components/page/ChapterContext.d.ts +10 -0
- package/components/page/ChapterContext.js +1 -0
- package/{src/lib/components → components}/page/ChapterNumber.svelte +0 -0
- package/components/page/ChapterNumber.svelte.d.ts +27 -0
- package/{src/lib/components → components}/page/ChapterTitle.svelte +2 -4
- package/components/page/ChapterTitle.svelte.d.ts +18 -0
- package/components/page/Contexts.d.ts +47 -0
- package/components/page/Contexts.js +133 -0
- package/{src/lib/components → components}/page/DefinitionView.svelte +38 -53
- package/components/page/DefinitionView.svelte.d.ts +18 -0
- package/{src/lib/components → components}/page/Description.svelte +7 -15
- package/components/page/Description.svelte.d.ts +14 -0
- package/components/page/Edition.svelte +161 -0
- package/components/page/Edition.svelte.d.ts +20 -0
- package/components/page/EditionLoader.svelte +99 -0
- package/components/page/EditionLoader.svelte.d.ts +18 -0
- package/{src/lib/components → components}/page/Editions.svelte +18 -22
- package/components/page/Editions.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/Glossary.svelte +28 -33
- package/components/page/Glossary.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/Header.svelte +52 -59
- package/components/page/Header.svelte.d.ts +29 -0
- package/{src/lib/components → components}/page/Index.svelte +47 -50
- package/components/page/Index.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/Instructions.svelte +1 -2
- package/components/page/Instructions.svelte.d.ts +18 -0
- package/{src/lib/components → components}/page/License.svelte +9 -17
- package/components/page/License.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/Loading.svelte +0 -0
- package/components/page/Loading.svelte.d.ts +23 -0
- package/{src/lib/components → components}/page/Media.svelte +27 -44
- package/components/page/Media.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/MediaPreview.svelte +2 -3
- package/components/page/MediaPreview.svelte.d.ts +19 -0
- package/{src/lib/components → components}/page/Muted.svelte +0 -0
- package/components/page/Muted.svelte.d.ts +27 -0
- package/{src/lib/components → components}/page/Outline.svelte +110 -140
- package/components/page/Outline.svelte.d.ts +19 -0
- package/components/page/Page.svelte +84 -0
- package/components/page/Page.svelte.d.ts +19 -0
- package/{src/lib/components → components}/page/PageHeader.svelte +1 -2
- package/components/page/PageHeader.svelte.d.ts +18 -0
- package/{src/lib/components → components}/page/PageParagraph.svelte +0 -0
- package/components/page/PageParagraph.svelte.d.ts +27 -0
- package/components/page/PossibleChapter.svelte +14 -0
- package/components/page/PossibleChapter.svelte.d.ts +14 -0
- package/components/page/PossibleReference.svelte +11 -0
- package/components/page/PossibleReference.svelte.d.ts +18 -0
- package/{src/lib/components → components}/page/Print.svelte +3 -5
- package/components/page/Print.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/Publish.svelte +52 -59
- package/components/page/Publish.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/Reference.svelte +30 -39
- package/components/page/Reference.svelte.d.ts +17 -0
- package/{src/lib/components → components}/page/References.svelte +14 -18
- package/components/page/References.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/Rows.svelte +0 -0
- package/components/page/Rows.svelte.d.ts +27 -0
- package/components/page/Search.svelte +133 -0
- package/components/page/Search.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/Status.svelte +3 -5
- package/components/page/Status.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/SubdomainEditor.svelte +13 -16
- package/components/page/SubdomainEditor.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/TableOfContents.svelte +68 -79
- package/components/page/TableOfContents.svelte.d.ts +14 -0
- package/components/page/TableOfContentsImage.svelte +18 -0
- package/components/page/TableOfContentsImage.svelte.d.ts +16 -0
- package/{src/lib/components → components}/page/TableOfContentsRow.svelte +24 -34
- package/components/page/TableOfContentsRow.svelte.d.ts +24 -0
- package/{src/lib/components → components}/page/ThemeEditor.svelte +33 -44
- package/components/page/ThemeEditor.svelte.d.ts +14 -0
- package/{src/lib/components → components}/page/ThemeEditorPreview.svelte +12 -21
- package/components/page/ThemeEditorPreview.svelte.d.ts +17 -0
- package/components/page/ThemeSetEditor.svelte +19 -0
- package/components/page/ThemeSetEditor.svelte.d.ts +18 -0
- package/{src/lib/components → components}/page/ThemeVariableEditor.svelte +14 -18
- package/components/page/ThemeVariableEditor.svelte.d.ts +18 -0
- package/{src/lib/components → components}/page/Title.svelte +0 -0
- package/components/page/Title.svelte.d.ts +27 -0
- package/{src/lib/components → components}/page/Unknown.svelte +8 -10
- package/components/page/Unknown.svelte.d.ts +16 -0
- package/components/page/margins.d.ts +2 -0
- package/{src/lib/components/page/margins.ts → components/page/margins.js} +46 -79
- package/index.d.ts +15 -0
- package/{src/lib/index.js → index.js} +0 -0
- package/models/CRUD.d.ts +27 -0
- package/models/CRUD.js +262 -0
- package/models/Firebase.d.ts +5 -0
- package/{src/lib/models/Firebase.ts → models/Firebase.js} +16 -26
- package/models/book/Book.d.ts +61 -0
- package/models/book/Book.js +135 -0
- package/models/book/BookMedia.d.ts +23 -0
- package/models/book/BookMedia.js +108 -0
- package/models/book/BookSaveStatus.d.ts +7 -0
- package/models/book/BookSaveStatus.js +8 -0
- package/models/book/Chapter.d.ts +81 -0
- package/models/book/Chapter.js +212 -0
- package/models/book/ChapterID.d.ts +10 -0
- package/{src/lib/models/book/ChapterID.ts → models/book/ChapterID.js} +0 -1
- package/models/book/Definition.d.ts +6 -0
- package/models/book/Definition.js +1 -0
- package/models/book/Edition.d.ts +139 -0
- package/models/book/Edition.js +620 -0
- package/models/book/Reference.d.ts +24 -0
- package/models/book/Reference.js +78 -0
- package/models/book/Schema.d.ts +174 -0
- package/{src/lib/models/book/Schema.ts → models/book/Schema.js} +0 -1
- package/models/book/Theme.d.ts +113 -0
- package/{src/lib/models/book/Theme.ts → models/book/Theme.js} +6 -110
- package/{src/lib/models/book/ThemeColors.ts → models/book/ThemeColors.d.ts} +0 -6
- package/models/book/ThemeColors.js +1 -0
- package/models/book/Words.d.ts +2 -0
- package/{src/lib/models/book/Words.ts → models/book/Words.js} +0 -1
- package/models/chapter/AtomNode.d.ts +18 -0
- package/{src/lib/models/chapter/AtomNode.ts → models/chapter/AtomNode.js} +10 -30
- package/models/chapter/BlockNode.d.ts +20 -0
- package/{src/lib/models/chapter/BlockNode.ts → models/chapter/BlockNode.js} +47 -80
- package/models/chapter/BlocksNode.d.ts +50 -0
- package/{src/lib/models/chapter/BlocksNode.ts → models/chapter/BlocksNode.js} +359 -571
- package/models/chapter/BlocksNode.test.d.ts +1 -0
- package/models/chapter/BlocksNode.test.js +568 -0
- package/{src/lib/models/chapter/Bookkeeping.ts → models/chapter/Bookkeeping.d.ts} +0 -0
- package/models/chapter/Bookkeeping.js +1 -0
- package/models/chapter/CalloutNode.d.ts +17 -0
- package/models/chapter/CalloutNode.js +58 -0
- package/models/chapter/Caret.d.ts +23 -0
- package/{src/lib/models/chapter/Caret.ts → models/chapter/Caret.js} +26 -50
- package/models/chapter/ChapterNode.d.ts +34 -0
- package/models/chapter/ChapterNode.js +117 -0
- package/models/chapter/CitationsNode.d.ts +16 -0
- package/{src/lib/models/chapter/CitationsNode.ts → models/chapter/CitationsNode.js} +10 -17
- package/models/chapter/CodeNode.d.ts +35 -0
- package/{src/lib/models/chapter/CodeNode.ts → models/chapter/CodeNode.js} +62 -125
- package/models/chapter/CommentNode.d.ts +18 -0
- package/models/chapter/CommentNode.js +48 -0
- package/models/chapter/DefinitionNode.d.ts +12 -0
- package/{src/lib/models/chapter/DefinitionNode.ts → models/chapter/DefinitionNode.js} +8 -14
- package/models/chapter/Edit.d.ts +7 -0
- package/models/chapter/Edit.js +1 -0
- package/models/chapter/EmbedNode.d.ts +45 -0
- package/models/chapter/EmbedNode.js +168 -0
- package/models/chapter/ErrorNode.d.ts +17 -0
- package/{src/lib/models/chapter/ErrorNode.ts → models/chapter/ErrorNode.js} +8 -15
- package/models/chapter/FootnoteNode.d.ts +18 -0
- package/models/chapter/FootnoteNode.js +47 -0
- package/models/chapter/FormatNode.d.ts +60 -0
- package/{src/lib/models/chapter/FormatNode.ts → models/chapter/FormatNode.js} +262 -443
- package/models/chapter/FormatNode.test.d.ts +1 -0
- package/models/chapter/FormatNode.test.js +96 -0
- package/models/chapter/InlineCodeNode.d.ts +12 -0
- package/{src/lib/models/chapter/InlineCodeNode.ts → models/chapter/InlineCodeNode.js} +9 -17
- package/models/chapter/LabelNode.d.ts +17 -0
- package/{src/lib/models/chapter/LabelNode.ts → models/chapter/LabelNode.js} +10 -26
- package/models/chapter/LinkNode.d.ts +12 -0
- package/{src/lib/models/chapter/LinkNode.ts → models/chapter/LinkNode.js} +7 -12
- package/models/chapter/ListNode.d.ts +51 -0
- package/{src/lib/models/chapter/ListNode.ts → models/chapter/ListNode.js} +200 -277
- package/models/chapter/ListNode.test.d.ts +1 -0
- package/{src/lib/models/chapter/ListNode.test.ts → models/chapter/ListNode.test.js} +20 -57
- package/models/chapter/MetadataNode.d.ts +17 -0
- package/models/chapter/MetadataNode.js +32 -0
- package/models/chapter/Node.d.ts +38 -0
- package/{src/lib/models/chapter/Node.ts → models/chapter/Node.js} +71 -155
- package/models/chapter/Node.test.d.ts +1 -0
- package/{src/lib/models → models}/chapter/Node.test.js +0 -0
- package/models/chapter/ParagraphNode.d.ts +33 -0
- package/{src/lib/models/chapter/ParagraphNode.ts → models/chapter/ParagraphNode.js} +58 -95
- package/models/chapter/ParagraphNode.test.d.ts +1 -0
- package/models/chapter/ParagraphNode.test.js +30 -0
- package/models/chapter/Parser.d.ts +75 -0
- package/{src/lib/models/chapter/Parser.ts → models/chapter/Parser.js} +184 -369
- package/models/chapter/Parser.test.d.ts +1 -0
- package/{src/lib/models/chapter/Parser.test.ts → models/chapter/Parser.test.js} +0 -7
- package/{src/lib/models/chapter/Position.ts → models/chapter/Position.d.ts} +0 -0
- package/models/chapter/Position.js +1 -0
- package/models/chapter/QuoteNode.d.ts +25 -0
- package/models/chapter/QuoteNode.js +99 -0
- package/{src/lib/models/chapter/RootNode.ts → models/chapter/RootNode.d.ts} +0 -2
- package/models/chapter/RootNode.js +1 -0
- package/models/chapter/RuleNode.d.ts +15 -0
- package/{src/lib/models/chapter/RuleNode.ts → models/chapter/RuleNode.js} +6 -9
- package/models/chapter/TableNode.d.ts +37 -0
- package/{src/lib/models/chapter/TableNode.ts → models/chapter/TableNode.js} +82 -141
- package/models/chapter/TableNode.test.d.ts +1 -0
- package/{src/lib/models/chapter/TableNode.test.ts → models/chapter/TableNode.test.js} +10 -27
- package/models/chapter/TextNode.d.ts +36 -0
- package/{src/lib/models/chapter/TextNode.ts → models/chapter/TextNode.js} +65 -117
- package/models/chapter/TextNode.test.d.ts +1 -0
- package/{src/lib/models/chapter/TextNode.test.ts → models/chapter/TextNode.test.js} +0 -2
- package/package.json +270 -53
- package/util/getSubdomain.d.ts +3 -0
- package/{src/lib/util/getSubdomain.ts → util/getSubdomain.js} +8 -14
- package/util/isMobile.d.ts +2 -0
- package/{src/lib/util/isMobile.ts → util/isMobile.js} +0 -1
- package/util/mineReference.d.ts +4 -0
- package/{src/lib/util/mineReference.ts → util/mineReference.js} +25 -45
- package/util/scrollToEyeLevel.d.ts +2 -0
- package/{src/lib/util/scrollToEyeLevel.ts → util/scrollToEyeLevel.js} +2 -4
- package/.env.example +0 -8
- package/.firebaserc +0 -8
- package/.prettierignore +0 -8
- package/.prettierrc.json +0 -5
- package/_update-notifier-last-checked +0 -0
- package/firebase.json +0 -46
- package/firestore.indexes.json +0 -4
- package/firestore.rules +0 -59
- package/functions/.eslintrc.js +0 -28
- package/functions/package-lock.json +0 -12595
- package/functions/package.json +0 -43
- package/functions/src/index.ts +0 -345
- package/functions/tsconfig.dev.json +0 -3
- package/functions/tsconfig.json +0 -15
- package/scripts/claims.cjs +0 -99
- package/src/app.d.ts +0 -9
- package/src/app.html +0 -24
- package/src/lib/components/Auth.svelte +0 -65
- package/src/lib/components/Link.svelte +0 -58
- package/src/lib/components/chapter/Block.svelte +0 -42
- package/src/lib/components/chapter/ErrorMessage.svelte +0 -12
- package/src/lib/components/chapter/Python.svelte +0 -144
- package/src/lib/components/chapter/Text.svelte +0 -109
- package/src/lib/components/editor/BookishEditor.svelte +0 -1101
- package/src/lib/components/editor/CalloutEditor.svelte +0 -14
- package/src/lib/components/editor/CaretContext.ts +0 -55
- package/src/lib/components/editor/CitationsEditor.svelte +0 -64
- package/src/lib/components/editor/ConfirmButton.svelte +0 -51
- package/src/lib/components/editor/DefinitionEditor.svelte +0 -44
- package/src/lib/components/editor/EmbedEditor.svelte +0 -152
- package/src/lib/components/editor/InlineCodeEditor.svelte +0 -16
- package/src/lib/components/editor/LinkEditor.svelte +0 -110
- package/src/lib/components/editor/PositionEditor.svelte +0 -21
- package/src/lib/components/editor/QuoteEditor.svelte +0 -14
- package/src/lib/components/editor/TableEditor.svelte +0 -14
- package/src/lib/components/editor/Toggle.svelte +0 -47
- package/src/lib/components/editor/Toolbar.svelte +0 -297
- package/src/lib/components/editor/URLEditor.svelte +0 -15
- package/src/lib/components/page/Authors.svelte +0 -92
- package/src/lib/components/page/BookLoader.svelte +0 -77
- package/src/lib/components/page/BulkReferenceEditor.svelte +0 -86
- package/src/lib/components/page/Chapter.svelte +0 -449
- package/src/lib/components/page/ChapterContext.ts +0 -13
- package/src/lib/components/page/Contexts.ts +0 -176
- package/src/lib/components/page/Edition.svelte +0 -189
- package/src/lib/components/page/EditionLoader.svelte +0 -123
- package/src/lib/components/page/Page.svelte +0 -94
- package/src/lib/components/page/PossibleChapter.svelte +0 -16
- package/src/lib/components/page/PossibleReference.svelte +0 -14
- package/src/lib/components/page/Search.svelte +0 -153
- package/src/lib/components/page/TableOfContentsImage.svelte +0 -22
- package/src/lib/components/page/ThemeSetEditor.svelte +0 -21
- package/src/lib/models/CRUD.ts +0 -469
- package/src/lib/models/book/Book.ts +0 -283
- package/src/lib/models/book/BookMedia.ts +0 -182
- package/src/lib/models/book/BookSaveStatus.ts +0 -8
- package/src/lib/models/book/Chapter.ts +0 -462
- package/src/lib/models/book/Definition.ts +0 -2
- package/src/lib/models/book/Edition.ts +0 -1216
- package/src/lib/models/book/Reference.ts +0 -171
- package/src/lib/models/chapter/BlocksNode.test.ts +0 -867
- package/src/lib/models/chapter/CalloutNode.ts +0 -79
- package/src/lib/models/chapter/ChapterNode.ts +0 -169
- package/src/lib/models/chapter/CommentNode.ts +0 -61
- package/src/lib/models/chapter/Edit.ts +0 -6
- package/src/lib/models/chapter/EmbedNode.ts +0 -257
- package/src/lib/models/chapter/FootnoteNode.ts +0 -59
- package/src/lib/models/chapter/FormatNode.test.ts +0 -137
- package/src/lib/models/chapter/MetadataNode.ts +0 -44
- package/src/lib/models/chapter/ParagraphNode.test.ts +0 -54
- package/src/lib/models/chapter/QuoteNode.ts +0 -135
- package/src/params/edition.ts +0 -3
- package/src/routes/+error.svelte +0 -12
- package/src/routes/+layout.svelte +0 -241
- package/src/routes/+page.svelte +0 -43
- package/src/routes/Footer.svelte +0 -0
- package/src/routes/Header.svelte +0 -112
- package/src/routes/[bookid]/+layout.svelte +0 -5
- package/src/routes/[bookid]/[[editionid=edition]]/+error.svelte +0 -14
- package/src/routes/[bookid]/[[editionid=edition]]/+layout.svelte +0 -7
- package/src/routes/[bookid]/[[editionid=edition]]/+page.svelte +0 -5
- package/src/routes/[bookid]/[[editionid=edition]]/[chapterid]/+page.svelte +0 -5
- package/src/routes/[bookid]/[[editionid=edition]]/glossary/+page.svelte +0 -5
- package/src/routes/[bookid]/[[editionid=edition]]/index/[[letter]]/+page.svelte +0 -5
- package/src/routes/[bookid]/[[editionid=edition]]/media/+page.svelte +0 -5
- package/src/routes/[bookid]/[[editionid=edition]]/print/+page.svelte +0 -5
- package/src/routes/[bookid]/[[editionid=edition]]/references/+page.svelte +0 -5
- package/src/routes/[bookid]/[[editionid=edition]]/search/+page.svelte +0 -5
- package/src/routes/[bookid]/editions/+page.svelte +0 -20
- package/src/routes/about/+page.svelte +0 -102
- package/src/routes/confirm/+page.svelte +0 -62
- package/src/routes/email/+page.svelte +0 -99
- package/src/routes/login/+page.svelte +0 -66
- package/src/routes/read/+page.svelte +0 -38
- package/src/routes/write/+error.svelte +0 -10
- package/src/routes/write/+layout.svelte +0 -11
- package/src/routes/write/+page.svelte +0 -114
- package/src/routes/write/[bookid]/+layout.svelte +0 -5
- package/src/routes/write/[bookid]/[[editionid=edition]]/+layout.svelte +0 -7
- package/src/routes/write/[bookid]/[[editionid=edition]]/+page.svelte +0 -5
- package/src/routes/write/[bookid]/[[editionid=edition]]/[chapterid]/+page.svelte +0 -5
- package/src/routes/write/[bookid]/[[editionid=edition]]/glossary/+page.svelte +0 -5
- package/src/routes/write/[bookid]/[[editionid=edition]]/index/[[letter]]/+page.svelte +0 -5
- package/src/routes/write/[bookid]/[[editionid=edition]]/media/+page.svelte +0 -5
- package/src/routes/write/[bookid]/[[editionid=edition]]/print/+page.svelte +0 -5
- package/src/routes/write/[bookid]/[[editionid=edition]]/references/+page.svelte +0 -5
- package/src/routes/write/[bookid]/[[editionid=edition]]/search/+page.svelte +0 -5
- package/src/routes/write/[bookid]/[[editionid=edition]]/theme/+page.svelte +0 -5
- package/src/routes/write/[bookid]/[[editionid=edition]]/unknown/+page.svelte +0 -5
- package/src/routes/write/[bookid]/editions/+page.svelte +0 -20
- package/src/vite-env.d.ts +0 -1
- 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 +0 -9
- package/svelte.config.js +0 -19
- package/tsconfig.json +0 -18
- package/tsconfig.node.json +0 -9
- package/vite.config.ts +0 -8
- package/vite.reader.config.ts +0 -32
|
@@ -2,56 +2,46 @@
|
|
|
2
2
|
// This operates on the DOM directly, as scroll position isn't easily managed in React.
|
|
3
3
|
export function hideOutlineIfObscured() {
|
|
4
4
|
// Get the outline's bounds.
|
|
5
|
-
let outline = document.getElementsByClassName('outline')[0]
|
|
6
|
-
|
|
5
|
+
let outline = document.getElementsByClassName('outline')[0];
|
|
7
6
|
// If there's no outline, don't bother.
|
|
8
|
-
if (!outline)
|
|
9
|
-
|
|
7
|
+
if (!outline)
|
|
8
|
+
return;
|
|
10
9
|
// Set a threshold for hiding
|
|
11
10
|
let threshold = 100;
|
|
12
|
-
|
|
13
11
|
// If the outline isn't affixed to the footer
|
|
14
12
|
if (window.getComputedStyle(outline).getPropertyValue('left') !== '0px') {
|
|
15
13
|
let outlineRect = outline.getBoundingClientRect();
|
|
16
|
-
let overlapRect
|
|
17
|
-
|
|
14
|
+
let overlapRect = undefined;
|
|
18
15
|
// Find the bottom-most left inset marginal within threshold of the outline.
|
|
19
|
-
Array.from(document.getElementsByClassName('inset-left')).forEach(
|
|
20
|
-
(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
outlineRect.top > insetRect.bottom + threshold
|
|
26
|
-
)
|
|
27
|
-
)
|
|
28
|
-
overlapRect = insetRect;
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
|
|
16
|
+
Array.from(document.getElementsByClassName('inset-left')).forEach((el) => {
|
|
17
|
+
let insetRect = el.getBoundingClientRect();
|
|
18
|
+
if (!(outlineRect.bottom < insetRect.top - threshold ||
|
|
19
|
+
outlineRect.top > insetRect.bottom + threshold))
|
|
20
|
+
overlapRect = insetRect;
|
|
21
|
+
});
|
|
32
22
|
// If it overlaps, reduce opacity by the proportion of the vertical distance between two rectangles and the height of the marginal.
|
|
33
23
|
if (overlapRect) {
|
|
34
|
-
let overlap
|
|
35
|
-
let distance =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
: outlineRect.bottom < overlap.top + threshold
|
|
24
|
+
let overlap = overlapRect;
|
|
25
|
+
let distance = outlineRect.bottom < overlap.top
|
|
26
|
+
? threshold
|
|
27
|
+
: outlineRect.bottom < overlap.top + threshold
|
|
39
28
|
? threshold - (outlineRect.bottom - overlap.top)
|
|
40
29
|
: outlineRect.top > overlap.bottom - threshold
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
? threshold - (overlap.bottom - outlineRect.top)
|
|
31
|
+
: outlineRect.top > overlap.bottom
|
|
32
|
+
? threshold
|
|
33
|
+
: 0;
|
|
45
34
|
let proportion = distance / threshold;
|
|
46
35
|
outline.style.opacity = '' + proportion * proportion;
|
|
47
36
|
}
|
|
48
37
|
// Otherwise, remove the dimming.
|
|
49
|
-
else
|
|
38
|
+
else
|
|
39
|
+
outline.style.removeProperty('opacity');
|
|
50
40
|
}
|
|
51
41
|
// If it is, it's always visible.
|
|
52
|
-
else
|
|
42
|
+
else
|
|
43
|
+
outline.style.removeProperty('opacity');
|
|
53
44
|
}
|
|
54
|
-
|
|
55
45
|
// After each render of the chapter, we need to adjust the layout of marginals, which by default are floating from
|
|
56
46
|
// their little spans within the body of the text.
|
|
57
47
|
//
|
|
@@ -64,60 +54,45 @@ export function hideOutlineIfObscured() {
|
|
|
64
54
|
// fixed in a fixed position.
|
|
65
55
|
export function layoutMarginals() {
|
|
66
56
|
// Get the chapter DOM node, so we can calculate margins.
|
|
67
|
-
let chapter = document.getElementsByClassName(
|
|
68
|
-
'bookish-chapter-body'
|
|
69
|
-
)[0] as HTMLElement;
|
|
70
|
-
|
|
57
|
+
let chapter = document.getElementsByClassName('bookish-chapter-body')[0];
|
|
71
58
|
// If there's no chapter rendered yet, stop.
|
|
72
|
-
if (chapter === undefined)
|
|
73
|
-
|
|
74
|
-
let book = document.getElementsByClassName('bookish')[0]
|
|
75
|
-
|
|
59
|
+
if (chapter === undefined)
|
|
60
|
+
return;
|
|
61
|
+
let book = document.getElementsByClassName('bookish')[0];
|
|
76
62
|
// This is the grid line we'll aline all marginals too horizontally.
|
|
77
63
|
let margin = chapter.getBoundingClientRect().width;
|
|
78
|
-
|
|
79
64
|
// This will track the current leading bottom edge for laying out marginals.
|
|
80
|
-
let currentBottom
|
|
81
|
-
|
|
65
|
+
let currentBottom = null;
|
|
82
66
|
// Are there any marginal right inset images that might overlap?
|
|
83
67
|
let rightInsets = document.getElementsByClassName('inset-right');
|
|
84
|
-
|
|
85
68
|
const marginals = document.getElementsByClassName('bookish-marginal');
|
|
86
|
-
|
|
87
69
|
// Layout all of the marginals vertically to prevent overlaps.
|
|
88
|
-
Array.from(marginals).forEach((element
|
|
89
|
-
const el = element
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (
|
|
94
|
-
window.getComputedStyle(el).getPropertyValue('position') !== 'fixed'
|
|
95
|
-
) {
|
|
70
|
+
Array.from(marginals).forEach((element) => {
|
|
71
|
+
const el = element;
|
|
72
|
+
if (el === null)
|
|
73
|
+
return;
|
|
74
|
+
if (window.getComputedStyle(el).getPropertyValue('position') !== 'fixed') {
|
|
96
75
|
if (el.parentElement) {
|
|
97
|
-
let containingMarginal =
|
|
98
|
-
el.parentElement.closest('.bookish-marginal');
|
|
99
|
-
|
|
76
|
+
let containingMarginal = el.parentElement.closest('.bookish-marginal');
|
|
100
77
|
// Get the bounds of this marginal so we know it's size.
|
|
101
78
|
let elementBounds = el.getBoundingClientRect();
|
|
102
|
-
|
|
103
79
|
// Get the bounds of this marginal's parent so we know it's vertical position.
|
|
104
80
|
let parentBounds = el.parentElement.getBoundingClientRect();
|
|
105
|
-
let parentTop =
|
|
106
|
-
parentBounds.top +
|
|
81
|
+
let parentTop = parentBounds.top +
|
|
107
82
|
window.scrollY -
|
|
108
83
|
(book.getBoundingClientRect().top + window.scrollY);
|
|
109
|
-
|
|
110
84
|
// If it's inside a marginal, position it below the marginal.
|
|
111
85
|
if (containingMarginal !== null && currentBottom) {
|
|
112
86
|
el.style.left = '0';
|
|
113
87
|
el.style.top =
|
|
114
88
|
'' +
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
89
|
+
(currentBottom -
|
|
90
|
+
(containingMarginal.getBoundingClientRect().top +
|
|
91
|
+
window.scrollY)) +
|
|
92
|
+
'px';
|
|
119
93
|
currentBottom = currentBottom + elementBounds.height;
|
|
120
|
-
}
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
121
96
|
// If we don't have a bottom yet, or the current above is above the parent's top,
|
|
122
97
|
// then set the current bottom to the bottom of the parent.
|
|
123
98
|
if (currentBottom === null || currentBottom < parentTop) {
|
|
@@ -129,7 +104,6 @@ export function layoutMarginals() {
|
|
|
129
104
|
el.style.top = currentBottom + 'px';
|
|
130
105
|
currentBottom = currentBottom + elementBounds.height;
|
|
131
106
|
}
|
|
132
|
-
|
|
133
107
|
// If there are any right insets, do any intersect with this marginal?
|
|
134
108
|
// If so, move the marginal below them.
|
|
135
109
|
if (rightInsets.length > 0) {
|
|
@@ -138,24 +112,18 @@ export function layoutMarginals() {
|
|
|
138
112
|
let insetBounds = inset.getBoundingClientRect();
|
|
139
113
|
let insetTop = insetBounds.top + window.scrollY;
|
|
140
114
|
let insetBottom = insetTop + insetBounds.height;
|
|
141
|
-
let elementTop =
|
|
142
|
-
|
|
143
|
-
let elementBottom =
|
|
144
|
-
elementTop + elementBounds.height;
|
|
145
|
-
|
|
115
|
+
let elementTop = el.getBoundingClientRect().top + window.scrollY;
|
|
116
|
+
let elementBottom = elementTop + elementBounds.height;
|
|
146
117
|
// If they overlap...
|
|
147
118
|
if (currentBottom !== null) {
|
|
148
|
-
if (
|
|
149
|
-
|
|
150
|
-
elementBottom >= insetTop) ||
|
|
119
|
+
if ((elementTop <= insetTop &&
|
|
120
|
+
elementBottom >= insetTop) ||
|
|
151
121
|
(elementTop <= insetBottom &&
|
|
152
122
|
elementBottom >= insetBottom) ||
|
|
153
123
|
(elementTop >= insetTop &&
|
|
154
|
-
elementBottom <= insetBottom)
|
|
155
|
-
) {
|
|
124
|
+
elementBottom <= insetBottom)) {
|
|
156
125
|
// Calculate the new position based on the preferred position, minus the element's height (which was added above), plus the overlap between the inset and the marginal.
|
|
157
|
-
let newTop =
|
|
158
|
-
currentBottom -
|
|
126
|
+
let newTop = currentBottom -
|
|
159
127
|
elementBounds.height +
|
|
160
128
|
(insetBottom - elementTop);
|
|
161
129
|
// Reposition the marginal.
|
|
@@ -167,7 +135,6 @@ export function layoutMarginals() {
|
|
|
167
135
|
}
|
|
168
136
|
});
|
|
169
137
|
}
|
|
170
|
-
|
|
171
138
|
// Reposition the marginal horizontally.
|
|
172
139
|
el.style.left = 'calc(2rem + ' + margin + 'px)';
|
|
173
140
|
}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { default as TableOfContents } from "./components/page/TableOfContents.svelte";
|
|
2
|
+
export { default as Search } from "./components/page/Search.svelte";
|
|
3
|
+
export { default as Index } from "./components/page/Index.svelte";
|
|
4
|
+
export { default as References } from "./components/page/References.svelte";
|
|
5
|
+
export { default as PossibleChapter } from "./components/page/PossibleChapter.svelte";
|
|
6
|
+
export { default as Media } from "./components/page/Media.svelte";
|
|
7
|
+
export { default as Print } from "./components/page/Print.svelte";
|
|
8
|
+
export { default as Unknown } from "./components/page/Unknown.svelte";
|
|
9
|
+
export { default as Glossary } from "./components/page/Glossary.svelte";
|
|
10
|
+
export { default as Edition } from "./components/page/Edition.svelte";
|
|
11
|
+
export { default as Feedback } from "./components/app/Feedback.svelte";
|
|
12
|
+
export { default as Loading } from "./components/page/Loading.svelte";
|
|
13
|
+
export { default as EditionModel } from "./models/book/Edition";
|
|
14
|
+
export { EDITION } from "./components/page/Contexts";
|
|
15
|
+
export { default as Schema } from "./models/book/Schema";
|
|
File without changes
|
package/models/CRUD.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DocumentReference } from 'firebase/firestore';
|
|
2
|
+
import Edition from './book/Edition';
|
|
3
|
+
import Book from './book/Book';
|
|
4
|
+
import type { Unsubscribe } from 'firebase/auth';
|
|
5
|
+
export declare function listenToPublishedBooks(react: (books: Book[]) => void): Unsubscribe;
|
|
6
|
+
export declare function listenToEditableBooks(userID: string, react: (books: Book[]) => void): Unsubscribe;
|
|
7
|
+
export declare function listenToPartiallyEditableBooks(userID: string, react: (books: Book[]) => void): Unsubscribe;
|
|
8
|
+
export declare function listenToBooksByName(name: string, react: (book: Book[]) => void): Unsubscribe;
|
|
9
|
+
export declare function listenToBookWithID(id: string, react: (book: Book | null) => void): Unsubscribe;
|
|
10
|
+
export declare function listenToEdition(bookID: string, editionID: string, react: (edition: Edition | null) => void): Unsubscribe;
|
|
11
|
+
export declare function listenToChapters(bookID: string, editionID: string, react: (chapters: [DocumentReference, string][]) => void): Unsubscribe;
|
|
12
|
+
/** Hit the authentication database to get user emails. */
|
|
13
|
+
export declare function getUserEmails(uids: string[]): Promise<Map<string, string> | null>;
|
|
14
|
+
export declare function createUser(email: string): Promise<string | null>;
|
|
15
|
+
export declare function createBook(userID: string): Promise<string>;
|
|
16
|
+
export declare function createNewEdition(book: Book): Promise<Book>;
|
|
17
|
+
export declare function updateLock(edition: Edition, uid: string, content: string, lock: boolean): Promise<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* Persists the edition in the database, creating and deleting chapters as necessary.
|
|
20
|
+
* returns a map of DocumentReferences for new chapters so they can be persisted client side.
|
|
21
|
+
*/
|
|
22
|
+
export declare function updateEdition(previousEdition: Edition | undefined, newEdition: Edition): Promise<Map<string, DocumentReference>>;
|
|
23
|
+
export declare function updateBook(book: Book): Promise<void>;
|
|
24
|
+
export declare function isSubdomainAvailable(subdomain: string, book: Book): Promise<boolean>;
|
|
25
|
+
export declare function publish(edition: Edition): Promise<string | {
|
|
26
|
+
url: string;
|
|
27
|
+
}>;
|
package/models/CRUD.js
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { db, functions } from './Firebase';
|
|
2
|
+
import { collection, getDocs, getDoc, setDoc, doc, addDoc, query, where, deleteDoc, DocumentReference, onSnapshot, QueryFieldFilterConstraint, } from 'firebase/firestore';
|
|
3
|
+
import { httpsCallable } from 'firebase/functions';
|
|
4
|
+
import Edition from './book/Edition';
|
|
5
|
+
import Book, {} from './book/Book';
|
|
6
|
+
function editionPath(bookID, editionID) {
|
|
7
|
+
return `books/${bookID}/editions/${editionID}`;
|
|
8
|
+
}
|
|
9
|
+
const NO_DATABASE_CONNECTION = 'Not connected to database';
|
|
10
|
+
///////////////
|
|
11
|
+
//// READ BOOKS
|
|
12
|
+
///////////////
|
|
13
|
+
function listenToBooks(constraint, react) {
|
|
14
|
+
if (!db)
|
|
15
|
+
throw NO_DATABASE_CONNECTION;
|
|
16
|
+
try {
|
|
17
|
+
return onSnapshot(query(collection(db, 'books'), constraint), (snapshot) => react(snapshot.empty
|
|
18
|
+
? []
|
|
19
|
+
: snapshot.docs.map((doc) => Book.fromJSON(doc.ref, doc.data()))));
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
throw 'Issue querying database';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export function listenToPublishedBooks(react) {
|
|
26
|
+
return listenToBooks(where('published', '==', true), react);
|
|
27
|
+
}
|
|
28
|
+
export function listenToEditableBooks(userID, react) {
|
|
29
|
+
return listenToBooks(where('uids', 'array-contains', userID), react);
|
|
30
|
+
}
|
|
31
|
+
export function listenToPartiallyEditableBooks(userID, react) {
|
|
32
|
+
return listenToBooks(where('readuids', 'array-contains', userID), react);
|
|
33
|
+
}
|
|
34
|
+
export function listenToBooksByName(name, react) {
|
|
35
|
+
return listenToBooks(where('domain', '==', name), react);
|
|
36
|
+
}
|
|
37
|
+
export function listenToBookWithID(id, react) {
|
|
38
|
+
if (!db)
|
|
39
|
+
throw NO_DATABASE_CONNECTION;
|
|
40
|
+
const ref = doc(db, 'books', id);
|
|
41
|
+
return onSnapshot(doc(db, 'books', id), (doc) => {
|
|
42
|
+
if (!doc.metadata.hasPendingWrites)
|
|
43
|
+
react(doc.exists()
|
|
44
|
+
? Book.fromJSON(ref, doc.data())
|
|
45
|
+
: null);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export function listenToEdition(bookID, editionID, react) {
|
|
49
|
+
if (!db)
|
|
50
|
+
throw NO_DATABASE_CONNECTION;
|
|
51
|
+
return onSnapshot(doc(db, 'books', bookID, 'editions', editionID), (doc) => {
|
|
52
|
+
if (!doc.metadata.hasPendingWrites)
|
|
53
|
+
react(doc.exists()
|
|
54
|
+
? Edition.fromJSON(doc.ref, doc.data())
|
|
55
|
+
: null);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export function listenToChapters(bookID, editionID, react) {
|
|
59
|
+
if (!db)
|
|
60
|
+
throw NO_DATABASE_CONNECTION;
|
|
61
|
+
return onSnapshot(collection(db, 'books', bookID, 'editions', editionID, 'chapters'), (docs) => {
|
|
62
|
+
const chapters = [];
|
|
63
|
+
docs.forEach((doc) => {
|
|
64
|
+
chapters.push([doc.ref, doc.data().text]);
|
|
65
|
+
});
|
|
66
|
+
react(chapters);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/////////////////
|
|
70
|
+
//// MANAGE USERS
|
|
71
|
+
/////////////////
|
|
72
|
+
/** Hit the authentication database to get user emails. */
|
|
73
|
+
export async function getUserEmails(uids) {
|
|
74
|
+
if (!functions)
|
|
75
|
+
throw Error("Can't publish, no connection to Firebase functions.");
|
|
76
|
+
const getUserEmails = httpsCallable(functions, 'getUserEmails');
|
|
77
|
+
const result = await getUserEmails({
|
|
78
|
+
uids,
|
|
79
|
+
});
|
|
80
|
+
return new Map(Object.entries(result.data));
|
|
81
|
+
}
|
|
82
|
+
export async function createUser(email) {
|
|
83
|
+
if (!functions)
|
|
84
|
+
throw Error("Can't publish, no connection to Firebase functions.");
|
|
85
|
+
const createUserWithEmail = httpsCallable(functions, 'createUserWithEmail');
|
|
86
|
+
const result = await createUserWithEmail({
|
|
87
|
+
email,
|
|
88
|
+
});
|
|
89
|
+
return result.data;
|
|
90
|
+
}
|
|
91
|
+
export async function createBook(userID) {
|
|
92
|
+
if (!db)
|
|
93
|
+
throw Error("Can't create book, not connected to Firebase.");
|
|
94
|
+
// Create a new book
|
|
95
|
+
const newBookData = {
|
|
96
|
+
title: 'Untitled',
|
|
97
|
+
authors: [],
|
|
98
|
+
description: '',
|
|
99
|
+
cover: null,
|
|
100
|
+
published: false,
|
|
101
|
+
domain: null,
|
|
102
|
+
editions: [],
|
|
103
|
+
uids: [userID],
|
|
104
|
+
readuids: [],
|
|
105
|
+
};
|
|
106
|
+
// Create the book
|
|
107
|
+
const bookRef = await addDoc(collection(db, 'books'), newBookData);
|
|
108
|
+
// Create a model to store it.
|
|
109
|
+
let book = Book.fromJSON(bookRef, newBookData);
|
|
110
|
+
// Make a new default edition with a single chapter with this user id.
|
|
111
|
+
let newEdition = new Edition(bookRef, undefined, [], 'Untitled', [], 1, '', null, {}, '', [], 'All rights reserved.', '', [], {}, {}, {}, {}, null, null, {}).withNewChapter();
|
|
112
|
+
// Add the edition to the editions collection in the database so we can get an edition ref.
|
|
113
|
+
const editionRef = await addDoc(collection(db, 'books', bookRef.id, 'editions'), newEdition.toObject());
|
|
114
|
+
// Remember the ref.
|
|
115
|
+
newEdition = newEdition.withRef(editionRef);
|
|
116
|
+
// Now replicate the edition info in the book. We dodge type checking here because we know with certainty
|
|
117
|
+
// that the ref was just added the line before.
|
|
118
|
+
const info = newEdition.getInfo();
|
|
119
|
+
if (info)
|
|
120
|
+
book = book.withEditions([info]);
|
|
121
|
+
// Update the book with the edition info.
|
|
122
|
+
await updateBook(book);
|
|
123
|
+
// Update all of the changes to the edition in Firestore, persisting the refs and chapter text.
|
|
124
|
+
await updateEdition(undefined, newEdition);
|
|
125
|
+
// Return the book id
|
|
126
|
+
return bookRef.id;
|
|
127
|
+
}
|
|
128
|
+
export async function createNewEdition(book) {
|
|
129
|
+
if (!db)
|
|
130
|
+
throw Error("Can't publish draft, no Firebase connection.");
|
|
131
|
+
// Get the latest draft.
|
|
132
|
+
const latestEditionID = book.getLatestEditionID();
|
|
133
|
+
if (latestEditionID === undefined)
|
|
134
|
+
throw 'No editions on this book';
|
|
135
|
+
const latestDraftDoc = await getDoc(doc(db, 'books', book.ref.id, 'editions', latestEditionID));
|
|
136
|
+
const latestDraft = latestDraftDoc.exists()
|
|
137
|
+
? latestDraftDoc.data()
|
|
138
|
+
: undefined;
|
|
139
|
+
if (latestDraft === undefined)
|
|
140
|
+
return book;
|
|
141
|
+
// Make a copy without chapter and edition refs, because we want to create new ones,
|
|
142
|
+
// and with an incremented edition number.
|
|
143
|
+
const newEdition = latestDraft.withoutRefs();
|
|
144
|
+
// Create a copy of the existing draft as a new edition.
|
|
145
|
+
const newEditionRef = await addDoc(collection(db, 'editions'), newEdition.toObject());
|
|
146
|
+
// Create the edition, creating chapter text as necessary, using the edition sync function.
|
|
147
|
+
updateEdition(undefined, newEdition.withRef(newEditionRef));
|
|
148
|
+
// Put the new edition in the book.
|
|
149
|
+
book = book.withEditions([
|
|
150
|
+
newEdition.getInfo(),
|
|
151
|
+
...book.getEditions(),
|
|
152
|
+
]);
|
|
153
|
+
// Update the book.
|
|
154
|
+
updateBook(book);
|
|
155
|
+
return book;
|
|
156
|
+
}
|
|
157
|
+
export async function updateLock(edition, uid, content, lock) {
|
|
158
|
+
if (!db)
|
|
159
|
+
throw NO_DATABASE_CONNECTION;
|
|
160
|
+
if (edition.editionRef === undefined)
|
|
161
|
+
return false;
|
|
162
|
+
if (lock && edition.hasLease(uid, content))
|
|
163
|
+
return true;
|
|
164
|
+
if (!lock && !edition.hasLease(uid, content))
|
|
165
|
+
return true;
|
|
166
|
+
await setDoc(doc(db, editionPath(edition.bookRef.id, edition.editionRef.id)), edition.withLock(uid, content, lock).toObject());
|
|
167
|
+
return lock;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Persists the edition in the database, creating and deleting chapters as necessary.
|
|
171
|
+
* returns a map of DocumentReferences for new chapters so they can be persisted client side.
|
|
172
|
+
*/
|
|
173
|
+
export async function updateEdition(previousEdition, newEdition) {
|
|
174
|
+
if (!db)
|
|
175
|
+
throw Error("Can't update edition, not connected to Firebase.");
|
|
176
|
+
// Get the reference to the edition, fail if we don't have one.
|
|
177
|
+
const editionRef = newEdition.getEditionRef();
|
|
178
|
+
if (!editionRef)
|
|
179
|
+
throw Error('Book given has no ID');
|
|
180
|
+
const newChapterRefs = new Map();
|
|
181
|
+
// Create any new chapters that aren't in the current edition, and update text if it changed.
|
|
182
|
+
for (const newChapter of newEdition.chapters) {
|
|
183
|
+
if (newChapter.ref === undefined) {
|
|
184
|
+
// Make the new chapter's text.
|
|
185
|
+
const newChapterRef = await addDoc(collection(db, editionPath(newEdition.bookRef.id, editionRef.id), 'chapters'), { text: newChapter.text });
|
|
186
|
+
// Add the ref of the new chapter to the revised chapter.
|
|
187
|
+
newEdition = newEdition.withRevisedChapter(newChapter, newChapter.withRef(newChapterRef));
|
|
188
|
+
// Map the chapter ref to it's id.
|
|
189
|
+
newChapterRefs.set(newChapter.id, newChapterRef);
|
|
190
|
+
}
|
|
191
|
+
// If we have a previous version, did the text change? If so, update it.
|
|
192
|
+
else {
|
|
193
|
+
const previousChapter = previousEdition === undefined
|
|
194
|
+
? undefined
|
|
195
|
+
: previousEdition.getChapterByRef(newChapter.ref);
|
|
196
|
+
if (previousChapter === undefined ||
|
|
197
|
+
newChapter.text !== previousChapter.text) {
|
|
198
|
+
await setDoc(doc(db, editionPath(newEdition.bookRef.id, editionRef.id), 'chapters', newChapter.ref.id), { text: newChapter.text });
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
// Remove any chapters from Firebase that are removed.
|
|
203
|
+
if (previousEdition) {
|
|
204
|
+
for (const previousChapter of previousEdition.chapters) {
|
|
205
|
+
if (previousChapter.ref &&
|
|
206
|
+
newEdition.getChapterByRef(previousChapter.ref) === undefined) {
|
|
207
|
+
await deleteDoc(previousChapter.ref);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// If the edition's summary info changed, update it.
|
|
212
|
+
if (previousEdition !== undefined) {
|
|
213
|
+
const previousInfo = previousEdition.getInfo();
|
|
214
|
+
const newInfo = newEdition.getInfo();
|
|
215
|
+
if (previousInfo && newInfo) {
|
|
216
|
+
const previousKeys = Object.keys(previousInfo);
|
|
217
|
+
const newKeys = Object.keys(newInfo);
|
|
218
|
+
if (previousKeys.length !== newKeys.length ||
|
|
219
|
+
!previousKeys.every((key) => previousInfo[key] === newInfo[key])) {
|
|
220
|
+
const bookDoc = await getDoc(doc(db, 'books', newEdition.bookRef.id));
|
|
221
|
+
if (!bookDoc.exists())
|
|
222
|
+
throw Error('Book does not exist');
|
|
223
|
+
const book = Book.fromJSON(newEdition.bookRef, bookDoc.data());
|
|
224
|
+
updateBook(book.withRevisedEdition(previousEdition, newEdition));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
// Finally, update the edition's document.
|
|
229
|
+
await setDoc(doc(db, editionPath(newEdition.bookRef.id, editionRef.id)), newEdition.toObject());
|
|
230
|
+
return newChapterRefs;
|
|
231
|
+
}
|
|
232
|
+
export async function updateBook(book) {
|
|
233
|
+
if (!db)
|
|
234
|
+
throw Error("Can't update book, not connected to Firebase.");
|
|
235
|
+
await setDoc(doc(db, 'books', book.getRefID()), book.toJSON());
|
|
236
|
+
}
|
|
237
|
+
export async function isSubdomainAvailable(subdomain, book) {
|
|
238
|
+
if (!db)
|
|
239
|
+
throw Error('Not connected to Firebase.');
|
|
240
|
+
const matches = await getDocs(query(collection(db, 'books'), where('domain', '==', subdomain)));
|
|
241
|
+
return matches.empty || matches.docs[0].id === book.getRefID();
|
|
242
|
+
}
|
|
243
|
+
export async function publish(edition) {
|
|
244
|
+
if (!db)
|
|
245
|
+
throw Error('Cannot publish, no database connection');
|
|
246
|
+
if (!functions)
|
|
247
|
+
throw Error('Cannot publish, no cloud connection');
|
|
248
|
+
const editionRef = edition.getEditionRef();
|
|
249
|
+
const bookRef = edition.getBookRef();
|
|
250
|
+
if (editionRef === undefined)
|
|
251
|
+
return `Cannot publish, no edition ID`;
|
|
252
|
+
// Get a reference to the publishing function
|
|
253
|
+
const publishEdition = httpsCallable(functions, 'publishEdition');
|
|
254
|
+
// Call the function, passing
|
|
255
|
+
const result = await publishEdition({
|
|
256
|
+
bookID: bookRef.id,
|
|
257
|
+
editionID: editionRef.id,
|
|
258
|
+
});
|
|
259
|
+
return result.data;
|
|
260
|
+
// Update the edition's published status in the book.
|
|
261
|
+
// await updateBook(book.withEditionAsPublished(true, index));
|
|
262
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const app: import("@firebase/app").FirebaseApp | undefined;
|
|
2
|
+
export declare const auth: import("@firebase/auth").Auth | undefined;
|
|
3
|
+
export declare const db: import("@firebase/firestore").Firestore | undefined;
|
|
4
|
+
export declare const storage: import("@firebase/storage").FirebaseStorage | undefined;
|
|
5
|
+
export declare const functions: import("@firebase/functions").Functions | undefined;
|
|
@@ -3,44 +3,34 @@ import { connectAuthEmulator, getAuth } from 'firebase/auth';
|
|
|
3
3
|
import { connectFirestoreEmulator, getFirestore } from 'firebase/firestore';
|
|
4
4
|
import { connectFunctionsEmulator, getFunctions } from 'firebase/functions';
|
|
5
5
|
import { connectStorageEmulator, getStorage } from 'firebase/storage';
|
|
6
|
-
import {
|
|
7
|
-
PUBLIC_READER,
|
|
8
|
-
PUBLIC_CONTEXT,
|
|
9
|
-
PUBLIC_FIREBASE_API_KEY,
|
|
10
|
-
PUBLIC_FIREBASE_AUTH_DOMAIN,
|
|
11
|
-
PUBLIC_FIREBASE_PROJECT_ID,
|
|
12
|
-
PUBLIC_FIREBASE_STORAGE_BUCKET,
|
|
13
|
-
PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
|
|
14
|
-
PUBLIC_FIREBASE_APP_ID,
|
|
15
|
-
} from '$env/static/public';
|
|
16
|
-
|
|
6
|
+
import { PUBLIC_READER, PUBLIC_CONTEXT, PUBLIC_FIREBASE_API_KEY, PUBLIC_FIREBASE_AUTH_DOMAIN, PUBLIC_FIREBASE_PROJECT_ID, PUBLIC_FIREBASE_STORAGE_BUCKET, PUBLIC_FIREBASE_MESSAGING_SENDER_ID, PUBLIC_FIREBASE_APP_ID, } from '$env/static/public';
|
|
17
7
|
const isReader = PUBLIC_READER === 'true';
|
|
18
|
-
|
|
19
8
|
// Some feedback about context
|
|
20
9
|
if (!isReader && PUBLIC_CONTEXT !== 'prod')
|
|
21
10
|
console.log(`*** ${PUBLIC_CONTEXT.toLocaleUpperCase()} ***`);
|
|
22
|
-
|
|
23
11
|
// Initialize Firebase using the environment variables provided at build time.
|
|
24
12
|
// Only do this if we have environment variables defined. (We won't in the standalone Reader).
|
|
25
13
|
export const app = isReader
|
|
26
14
|
? undefined
|
|
27
15
|
: initializeApp({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
apiKey: PUBLIC_FIREBASE_API_KEY,
|
|
17
|
+
authDomain: PUBLIC_FIREBASE_AUTH_DOMAIN,
|
|
18
|
+
projectId: PUBLIC_FIREBASE_PROJECT_ID,
|
|
19
|
+
storageBucket: PUBLIC_FIREBASE_STORAGE_BUCKET,
|
|
20
|
+
messagingSenderId: PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
|
|
21
|
+
appId: PUBLIC_FIREBASE_APP_ID,
|
|
22
|
+
});
|
|
36
23
|
export const auth = isReader ? undefined : getAuth();
|
|
37
24
|
export const db = isReader ? undefined : getFirestore();
|
|
38
25
|
export const storage = isReader ? undefined : getStorage();
|
|
39
26
|
export const functions = isReader ? undefined : getFunctions();
|
|
40
|
-
|
|
41
27
|
if (!isReader && PUBLIC_CONTEXT === 'local') {
|
|
42
|
-
if (db)
|
|
43
|
-
|
|
44
|
-
if (
|
|
45
|
-
|
|
28
|
+
if (db)
|
|
29
|
+
connectFirestoreEmulator(db, 'localhost', 8080);
|
|
30
|
+
if (auth)
|
|
31
|
+
connectAuthEmulator(auth, 'http://localhost:9099');
|
|
32
|
+
if (storage)
|
|
33
|
+
connectStorageEmulator(storage, 'localhost', 9199);
|
|
34
|
+
if (functions)
|
|
35
|
+
connectFunctionsEmulator(functions, 'localhost', 5001);
|
|
46
36
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { DocumentReference } from 'firebase/firestore';
|
|
2
|
+
import BookMedia from './BookMedia';
|
|
3
|
+
import type Edition from './Edition';
|
|
4
|
+
/** A replication of edition info */
|
|
5
|
+
export type EditionInfo = {
|
|
6
|
+
ref: DocumentReference;
|
|
7
|
+
summary: string;
|
|
8
|
+
number: number;
|
|
9
|
+
published: number | null;
|
|
10
|
+
editionuids: string[];
|
|
11
|
+
chapteruids: string[];
|
|
12
|
+
};
|
|
13
|
+
export type BookSpecification = {
|
|
14
|
+
title: string;
|
|
15
|
+
authors: string[];
|
|
16
|
+
description: string;
|
|
17
|
+
cover: string | null;
|
|
18
|
+
published: boolean;
|
|
19
|
+
editions: EditionInfo[];
|
|
20
|
+
domain: string | null;
|
|
21
|
+
uids: string[];
|
|
22
|
+
readuids: string[];
|
|
23
|
+
};
|
|
24
|
+
export default class Book {
|
|
25
|
+
readonly ref: DocumentReference;
|
|
26
|
+
readonly title: string;
|
|
27
|
+
readonly authors: string[];
|
|
28
|
+
readonly description: string;
|
|
29
|
+
readonly cover: string | null;
|
|
30
|
+
readonly published: boolean;
|
|
31
|
+
readonly editions: EditionInfo[];
|
|
32
|
+
readonly domain: string | null;
|
|
33
|
+
readonly uids: string[];
|
|
34
|
+
media: BookMedia;
|
|
35
|
+
constructor(ref: DocumentReference, title: string, authors: string[], description: string, cover: string | null, editions: EditionInfo[], domain: string | null, uids: string[]);
|
|
36
|
+
getMedia(): BookMedia;
|
|
37
|
+
static fromJSON(ref: DocumentReference, book: BookSpecification): Book;
|
|
38
|
+
toJSON(): BookSpecification;
|
|
39
|
+
getSubdomain(): string | null;
|
|
40
|
+
withSubdomain(domain: string): Book;
|
|
41
|
+
getTitle(): string;
|
|
42
|
+
withTitle(title: string): Book;
|
|
43
|
+
getDescription(): string;
|
|
44
|
+
withDescription(description: string): Book;
|
|
45
|
+
getCover(): string | null;
|
|
46
|
+
withCover(cover: string | null): Book;
|
|
47
|
+
getAuthors(): string[];
|
|
48
|
+
withAuthors(authors: string[]): Book;
|
|
49
|
+
getRef(): DocumentReference<import("@firebase/firestore").DocumentData>;
|
|
50
|
+
getRefID(): string;
|
|
51
|
+
getEditionNumberID(number: number): string | undefined;
|
|
52
|
+
getLatestPublishedEditionID(): string;
|
|
53
|
+
getLatestEditionID(): string | undefined;
|
|
54
|
+
getEditions(): EditionInfo[];
|
|
55
|
+
getPublishedEditionCount(): number;
|
|
56
|
+
isEditor(uid: string): boolean;
|
|
57
|
+
withEditors(uids: string[]): Book;
|
|
58
|
+
withEditions(revisions: EditionInfo[]): Book;
|
|
59
|
+
withRevisedEdition(previous: Edition, revised: Edition): Book;
|
|
60
|
+
hasPublishedEdition(): boolean;
|
|
61
|
+
}
|