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
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
import Chapter from './Chapter';
|
|
2
|
+
import Parser from '../chapter/Parser';
|
|
3
|
+
import EmbedNode from '../chapter/EmbedNode';
|
|
4
|
+
import Reference from './Reference';
|
|
5
|
+
import ChapterIDs from './ChapterID.js';
|
|
6
|
+
export default class Edition {
|
|
7
|
+
bookRef;
|
|
8
|
+
editionRef;
|
|
9
|
+
uids;
|
|
10
|
+
title;
|
|
11
|
+
authors;
|
|
12
|
+
number;
|
|
13
|
+
summary;
|
|
14
|
+
published;
|
|
15
|
+
images;
|
|
16
|
+
description;
|
|
17
|
+
chapters;
|
|
18
|
+
license;
|
|
19
|
+
acknowledgements;
|
|
20
|
+
tags;
|
|
21
|
+
sources;
|
|
22
|
+
references;
|
|
23
|
+
symbols;
|
|
24
|
+
glossary;
|
|
25
|
+
theme;
|
|
26
|
+
base;
|
|
27
|
+
active;
|
|
28
|
+
// Given an object with a valid specification and an object mapping chapter IDs to chapter text,
|
|
29
|
+
// construct an object representing a book.
|
|
30
|
+
constructor(bookRef, editionRef, uids, title, authors, number, summary, published, images, description, chapters, license, acknowledgements, tags, sources, references, symbols, glossary, theme, base, active) {
|
|
31
|
+
this.bookRef = bookRef;
|
|
32
|
+
this.editionRef = editionRef;
|
|
33
|
+
this.uids = uids;
|
|
34
|
+
this.title = title;
|
|
35
|
+
this.authors = authors;
|
|
36
|
+
this.number = number;
|
|
37
|
+
this.summary = summary;
|
|
38
|
+
this.published = published;
|
|
39
|
+
this.images = images;
|
|
40
|
+
this.description = description;
|
|
41
|
+
this.chapters = chapters.slice();
|
|
42
|
+
this.license = license;
|
|
43
|
+
this.acknowledgements = acknowledgements;
|
|
44
|
+
this.tags = tags.slice();
|
|
45
|
+
this.sources = Object.assign({}, sources);
|
|
46
|
+
this.references = {};
|
|
47
|
+
for (const [citationID, ref] of Object.entries(references)) {
|
|
48
|
+
this.references[citationID] =
|
|
49
|
+
ref instanceof Reference
|
|
50
|
+
? ref
|
|
51
|
+
: Edition.parseReference(citationID, ref, this);
|
|
52
|
+
}
|
|
53
|
+
this.symbols = Object.assign({}, symbols);
|
|
54
|
+
this.glossary = Object.assign({}, glossary);
|
|
55
|
+
this.theme = theme;
|
|
56
|
+
this.base = base;
|
|
57
|
+
this.active = active;
|
|
58
|
+
}
|
|
59
|
+
static fromJSON(editionRef, spec) {
|
|
60
|
+
// Copy all of the specification metadata to fields.
|
|
61
|
+
// Choose suitable defaults if the spec is lacking a field.
|
|
62
|
+
return new Edition(spec.bookRef, editionRef, spec.uids, spec.title, spec.authors, spec.number, spec.summary, spec.published, spec.images, spec.description, spec.chapters.map((chap) => Chapter.fromJSON(chap, '')), spec.license, spec.acknowledgements, spec.tags ?? [], spec.sources ?? {}, spec.references ?? {}, spec.symbols ?? {}, spec.glossary ?? {}, spec.theme, spec.base ?? '', spec.active);
|
|
63
|
+
}
|
|
64
|
+
static parseReference(citationID, ref, edition, short = false) {
|
|
65
|
+
if (typeof ref === 'string')
|
|
66
|
+
return Parser.parseFormat(edition, ref);
|
|
67
|
+
else {
|
|
68
|
+
// APA Format. Could eventually support multiple formats.
|
|
69
|
+
let [authors, year, title, source, url, summary] = ref;
|
|
70
|
+
if (source.charAt(0) === '#') {
|
|
71
|
+
let src = edition.getSource(source);
|
|
72
|
+
if (src !== null)
|
|
73
|
+
source = src;
|
|
74
|
+
}
|
|
75
|
+
return new Reference(citationID, authors ?? '', year ?? '', title ?? '', source ?? '', url ?? '', summary ?? '', short);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// Convert the book to an object for storage.
|
|
79
|
+
toObject() {
|
|
80
|
+
const references = {};
|
|
81
|
+
for (const [citationID, ref] of Object.entries(this.references))
|
|
82
|
+
references[citationID] =
|
|
83
|
+
ref instanceof Reference ? ref.toList() : ref.toBookdown();
|
|
84
|
+
const editionJSON = {
|
|
85
|
+
bookRef: this.bookRef,
|
|
86
|
+
title: this.title,
|
|
87
|
+
authors: this.authors,
|
|
88
|
+
number: this.number,
|
|
89
|
+
summary: this.summary,
|
|
90
|
+
published: this.published,
|
|
91
|
+
images: Object.assign({}, this.images),
|
|
92
|
+
description: this.description,
|
|
93
|
+
chapters: this.chapters.map((chap) => chap.toJSON()),
|
|
94
|
+
license: this.license,
|
|
95
|
+
acknowledgements: this.acknowledgements,
|
|
96
|
+
tags: this.tags.slice(),
|
|
97
|
+
sources: Object.assign({}, this.sources),
|
|
98
|
+
references: references,
|
|
99
|
+
symbols: Object.assign({}, this.symbols),
|
|
100
|
+
glossary: Object.assign({}, this.glossary),
|
|
101
|
+
theme: this.theme,
|
|
102
|
+
base: this.base,
|
|
103
|
+
uids: this.uids.slice(),
|
|
104
|
+
chapteruids: this.getChapterUIDS(),
|
|
105
|
+
active: this.active,
|
|
106
|
+
};
|
|
107
|
+
return editionJSON;
|
|
108
|
+
}
|
|
109
|
+
getBookRef() {
|
|
110
|
+
return this.bookRef;
|
|
111
|
+
}
|
|
112
|
+
getEditionRef() {
|
|
113
|
+
return this.editionRef;
|
|
114
|
+
}
|
|
115
|
+
getChapterUIDS() {
|
|
116
|
+
return Array.from(new Set(this.chapters.map((chapter) => chapter.uids).flat()));
|
|
117
|
+
}
|
|
118
|
+
withRef(editionRef) {
|
|
119
|
+
return new Edition(this.bookRef, editionRef, this.uids, this.title, this.authors, this.number, this.summary, this.published, this.images, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
120
|
+
}
|
|
121
|
+
getTitle() {
|
|
122
|
+
return this.title;
|
|
123
|
+
}
|
|
124
|
+
withTitle(title) {
|
|
125
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, title, this.authors, this.number, this.summary, this.published, this.images, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
126
|
+
}
|
|
127
|
+
getDescription() {
|
|
128
|
+
return this.description;
|
|
129
|
+
}
|
|
130
|
+
setDescription(description) {
|
|
131
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, this.summary, this.published, this.images, description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
132
|
+
}
|
|
133
|
+
getAcknowledgements() {
|
|
134
|
+
return this.acknowledgements;
|
|
135
|
+
}
|
|
136
|
+
withAcknowledgements(acks) {
|
|
137
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, this.summary, this.published, this.images, this.description, this.chapters, this.license, acks, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
138
|
+
}
|
|
139
|
+
withSummary(summary) {
|
|
140
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, summary, this.published, this.images, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
141
|
+
}
|
|
142
|
+
asPublished(published) {
|
|
143
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, this.summary, published ? Date.now() : null, this.images, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
144
|
+
}
|
|
145
|
+
getLicense() {
|
|
146
|
+
return this.license;
|
|
147
|
+
}
|
|
148
|
+
setLicense(license) {
|
|
149
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, this.summary, this.published, this.images, this.description, this.chapters, license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
150
|
+
}
|
|
151
|
+
getChapters() {
|
|
152
|
+
return this.chapters.slice();
|
|
153
|
+
}
|
|
154
|
+
hasChapter(chapterID) {
|
|
155
|
+
return (this.getChapter(chapterID) !== undefined ||
|
|
156
|
+
['references', 'glossary', 'index', 'search', 'media'].includes(chapterID));
|
|
157
|
+
}
|
|
158
|
+
getChapter(chapterID) {
|
|
159
|
+
return this.chapters.find((chapter) => chapter.getID() === chapterID);
|
|
160
|
+
}
|
|
161
|
+
getChapterByRef(ref) {
|
|
162
|
+
return this.chapters.find((chap) => chap.ref !== undefined && chap.ref.id === ref.id);
|
|
163
|
+
}
|
|
164
|
+
getChapterPosition(chapterID) {
|
|
165
|
+
var position = 0;
|
|
166
|
+
for (; position < this.chapters.length; position++)
|
|
167
|
+
if (this.chapters[position].getID() === chapterID)
|
|
168
|
+
return position;
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
getChapterCount() {
|
|
172
|
+
return this.chapters.length;
|
|
173
|
+
}
|
|
174
|
+
withChapters(chapters) {
|
|
175
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, this.summary, this.published, this.images, this.description, chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
176
|
+
}
|
|
177
|
+
withChapterText(text) {
|
|
178
|
+
return this.withChapters(this.chapters.map((chapter) => {
|
|
179
|
+
if (chapter.ref === undefined)
|
|
180
|
+
return chapter;
|
|
181
|
+
const match = text.find(([ref, text]) => chapter.ref !== undefined &&
|
|
182
|
+
chapter.ref.id === ref.id &&
|
|
183
|
+
chapter.text !== text &&
|
|
184
|
+
text !== undefined);
|
|
185
|
+
return match ? chapter.withText(match[1]) : chapter;
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
withRevisedChapter(previous, edited) {
|
|
189
|
+
const index = this.chapters.indexOf(previous);
|
|
190
|
+
if (index < 0)
|
|
191
|
+
return this;
|
|
192
|
+
return this.withChapters([
|
|
193
|
+
...this.chapters.slice(0, index),
|
|
194
|
+
edited,
|
|
195
|
+
...this.chapters.slice(index + 1),
|
|
196
|
+
]);
|
|
197
|
+
}
|
|
198
|
+
withoutRefs() {
|
|
199
|
+
return this.withRef(undefined).withChapters(this.chapters.map((chap) => chap.withoutRef()));
|
|
200
|
+
}
|
|
201
|
+
withIncrementedEditionNumber() {
|
|
202
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number + 1, this.summary, this.published, this.images, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
203
|
+
}
|
|
204
|
+
withNewChapter() {
|
|
205
|
+
// Synthesize a chapter ID placeholder that doesn't overlap with existing chapter names
|
|
206
|
+
let number = 1;
|
|
207
|
+
while (this.hasChapter('chapter' + number))
|
|
208
|
+
number++;
|
|
209
|
+
// Create a default chapter on this model. Remember the document reference so we can modify it later.
|
|
210
|
+
const newChapter = new Chapter(undefined, `chapter${number}`, 'Untitled Chapter', [], null, true, false, undefined, '', []);
|
|
211
|
+
return this.withChapters([...this.chapters, newChapter]);
|
|
212
|
+
}
|
|
213
|
+
withoutChapter(chapterID) {
|
|
214
|
+
let index = this.chapters.findIndex((chapter) => chapter.getID() === chapterID);
|
|
215
|
+
if (index < 0)
|
|
216
|
+
return this;
|
|
217
|
+
return this.withChapters([
|
|
218
|
+
...this.chapters.slice(0, index),
|
|
219
|
+
...this.chapters.slice(index + 1),
|
|
220
|
+
]);
|
|
221
|
+
}
|
|
222
|
+
withMovedChapter(chapterID, increment) {
|
|
223
|
+
// Get the index of the chapter.
|
|
224
|
+
let index = this.chapters.findIndex((chapter) => chapter.getID() === chapterID);
|
|
225
|
+
if (index + increment < 0 || index + increment >= this.chapters.length)
|
|
226
|
+
return this;
|
|
227
|
+
const newChapters = this.chapters.slice();
|
|
228
|
+
const temp = newChapters[index + increment];
|
|
229
|
+
newChapters[index + increment] = newChapters[index];
|
|
230
|
+
newChapters[index] = temp;
|
|
231
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, this.summary, this.published, this.images, this.description, newChapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
232
|
+
}
|
|
233
|
+
getSymbols() {
|
|
234
|
+
return this.symbols;
|
|
235
|
+
}
|
|
236
|
+
hasReferences() {
|
|
237
|
+
return Object.keys(this.references).length > 0;
|
|
238
|
+
}
|
|
239
|
+
getReferences() {
|
|
240
|
+
return Object.assign({}, this.references);
|
|
241
|
+
}
|
|
242
|
+
getReference(citationID) {
|
|
243
|
+
return citationID in this.references
|
|
244
|
+
? this.references[citationID]
|
|
245
|
+
: undefined;
|
|
246
|
+
}
|
|
247
|
+
withReferences(newReferences) {
|
|
248
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, this.summary, this.published, this.images, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, newReferences, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
249
|
+
}
|
|
250
|
+
withNewReferences(references) {
|
|
251
|
+
const newReferences = Object.assign({}, this.references);
|
|
252
|
+
// Generate a unique ID for the reference.
|
|
253
|
+
for (const newRef of references)
|
|
254
|
+
newReferences[newRef.citationID] = newRef;
|
|
255
|
+
return this.withReferences(newReferences);
|
|
256
|
+
}
|
|
257
|
+
withEditedReference(ref) {
|
|
258
|
+
if (!(ref.citationID in this.references))
|
|
259
|
+
return this;
|
|
260
|
+
const newReferences = Object.assign({}, this.references);
|
|
261
|
+
newReferences[ref.citationID] = ref;
|
|
262
|
+
return this.withReferences(newReferences);
|
|
263
|
+
}
|
|
264
|
+
withEditedReferenceID(newCitationID, ref) {
|
|
265
|
+
if (!(ref.citationID in this.references))
|
|
266
|
+
return;
|
|
267
|
+
const newReferences = Object.assign({}, this.references);
|
|
268
|
+
delete newReferences[ref.citationID];
|
|
269
|
+
newReferences[newCitationID] = ref.withCitationID(newCitationID);
|
|
270
|
+
return this.withReferences(newReferences);
|
|
271
|
+
}
|
|
272
|
+
withoutReference(citationID) {
|
|
273
|
+
if (!(citationID in this.references))
|
|
274
|
+
return this;
|
|
275
|
+
const newReferences = Object.assign({}, this.references);
|
|
276
|
+
delete newReferences[citationID];
|
|
277
|
+
return this.withReferences(newReferences);
|
|
278
|
+
}
|
|
279
|
+
hasGlossary() {
|
|
280
|
+
return Object.keys(this.glossary).length > 0;
|
|
281
|
+
}
|
|
282
|
+
getGlossary() {
|
|
283
|
+
return Object.assign({}, this.glossary);
|
|
284
|
+
}
|
|
285
|
+
hasDefinition(id) {
|
|
286
|
+
return id in this.glossary;
|
|
287
|
+
}
|
|
288
|
+
withGlossary(glossary) {
|
|
289
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, this.summary, this.published, this.images, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, glossary, this.theme, this.base, this.active);
|
|
290
|
+
}
|
|
291
|
+
withDefinition(id, phrase, definition, synonyms) {
|
|
292
|
+
const newGlossary = Object.assign({}, this.glossary);
|
|
293
|
+
newGlossary[id] = {
|
|
294
|
+
phrase: phrase,
|
|
295
|
+
definition: definition,
|
|
296
|
+
synonyms: synonyms,
|
|
297
|
+
};
|
|
298
|
+
return this.withGlossary(newGlossary);
|
|
299
|
+
}
|
|
300
|
+
withoutDefinition(id) {
|
|
301
|
+
const newGlossary = Object.assign({}, this.glossary);
|
|
302
|
+
delete newGlossary[id];
|
|
303
|
+
return this.withGlossary(newGlossary);
|
|
304
|
+
}
|
|
305
|
+
withEditedDefinition(id, definition) {
|
|
306
|
+
const newGlossary = Object.assign({}, this.glossary);
|
|
307
|
+
newGlossary[id] = definition;
|
|
308
|
+
return this.withGlossary(newGlossary);
|
|
309
|
+
}
|
|
310
|
+
withEditedDefinitionID(id, newID) {
|
|
311
|
+
if (!(id in this.glossary))
|
|
312
|
+
return;
|
|
313
|
+
const newGlossary = Object.assign({}, this.glossary);
|
|
314
|
+
const definition = newGlossary[id];
|
|
315
|
+
delete newGlossary[id];
|
|
316
|
+
newGlossary[newID] = definition;
|
|
317
|
+
return this.withGlossary(newGlossary);
|
|
318
|
+
}
|
|
319
|
+
getTags() {
|
|
320
|
+
return this.tags;
|
|
321
|
+
}
|
|
322
|
+
getTheme() {
|
|
323
|
+
return this.theme;
|
|
324
|
+
}
|
|
325
|
+
withTheme(theme) {
|
|
326
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, this.summary, this.published, this.images, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, theme, this.base, this.active);
|
|
327
|
+
}
|
|
328
|
+
withThemeValue(group, name, value) {
|
|
329
|
+
if (this.theme === null)
|
|
330
|
+
return this;
|
|
331
|
+
if (group === 'imports')
|
|
332
|
+
return this;
|
|
333
|
+
const newTheme = Object.assign({}, this.theme);
|
|
334
|
+
const newGroup = Object.assign({}, this.theme[group]);
|
|
335
|
+
newGroup[name] = value;
|
|
336
|
+
newTheme[group] = newGroup;
|
|
337
|
+
return this.withTheme(newTheme);
|
|
338
|
+
}
|
|
339
|
+
// Don't let callers get their sneaky hands on this mutable array...
|
|
340
|
+
getAuthors() {
|
|
341
|
+
return [...this.authors];
|
|
342
|
+
}
|
|
343
|
+
withAuthors(authors) {
|
|
344
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, authors, this.number, this.summary, this.published, this.images, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
345
|
+
}
|
|
346
|
+
withAuthor(name) {
|
|
347
|
+
return this.withAuthors([...this.authors, name]);
|
|
348
|
+
}
|
|
349
|
+
withAuthorName(index, name) {
|
|
350
|
+
if (index < 0 || index >= this.authors.length)
|
|
351
|
+
return this;
|
|
352
|
+
return this.withAuthors([
|
|
353
|
+
...this.authors.slice(0, index),
|
|
354
|
+
name,
|
|
355
|
+
...this.authors.slice(index + 1),
|
|
356
|
+
]);
|
|
357
|
+
}
|
|
358
|
+
withoutAuthor(index) {
|
|
359
|
+
if (index < 0 || index >= this.authors.length)
|
|
360
|
+
return this;
|
|
361
|
+
return this.withAuthors([
|
|
362
|
+
...this.authors.slice(0, index),
|
|
363
|
+
...this.authors.slice(index + 1),
|
|
364
|
+
]);
|
|
365
|
+
}
|
|
366
|
+
withEditors(uids) {
|
|
367
|
+
return new Edition(this.bookRef, this.editionRef, uids, this.title, this.authors, this.number, this.summary, this.published, this.images, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
368
|
+
}
|
|
369
|
+
hasImage(id) {
|
|
370
|
+
return this.images[id] !== null;
|
|
371
|
+
}
|
|
372
|
+
getImage(id) {
|
|
373
|
+
return this.images[id] ?? null;
|
|
374
|
+
}
|
|
375
|
+
withImage(id, embed) {
|
|
376
|
+
const newImages = Object.assign({}, this.images);
|
|
377
|
+
newImages[id] = embed;
|
|
378
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, this.summary, this.published, newImages, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, this.active);
|
|
379
|
+
}
|
|
380
|
+
isEditor(uid) {
|
|
381
|
+
return this.uids.includes(uid);
|
|
382
|
+
}
|
|
383
|
+
isChapterEditor(uid) {
|
|
384
|
+
return this.getChapterUIDS().includes(uid);
|
|
385
|
+
}
|
|
386
|
+
getLeasee(content) {
|
|
387
|
+
return this.active[content];
|
|
388
|
+
}
|
|
389
|
+
hasLease(uid, content) {
|
|
390
|
+
return this.active[content] === uid;
|
|
391
|
+
}
|
|
392
|
+
isLeased(contentID) {
|
|
393
|
+
return contentID in this.active;
|
|
394
|
+
}
|
|
395
|
+
withLock(uid, content, lock) {
|
|
396
|
+
const newActive = Object.assign({}, this.active);
|
|
397
|
+
if (lock)
|
|
398
|
+
newActive[content] = uid;
|
|
399
|
+
else
|
|
400
|
+
delete newActive[content];
|
|
401
|
+
return new Edition(this.bookRef, this.editionRef, this.uids, this.title, this.authors, this.number, this.summary, this.published, this.images, this.description, this.chapters, this.license, this.acknowledgements, this.tags, this.sources, this.references, this.symbols, this.glossary, this.theme, this.base, newActive);
|
|
402
|
+
}
|
|
403
|
+
getBookReadingTime() {
|
|
404
|
+
return this.chapters
|
|
405
|
+
.map((chapter) => chapter.getReadingTime(this))
|
|
406
|
+
.reduce((total, time) => total === undefined
|
|
407
|
+
? 0
|
|
408
|
+
: time === undefined
|
|
409
|
+
? total
|
|
410
|
+
: total + time, 0);
|
|
411
|
+
}
|
|
412
|
+
getChapterNumber(chapterID) {
|
|
413
|
+
let chapterNumber = 1;
|
|
414
|
+
let match = null;
|
|
415
|
+
this.chapters.forEach((chapter) => {
|
|
416
|
+
// If we found a match...
|
|
417
|
+
if (chapter.getID() === chapterID) {
|
|
418
|
+
match = chapterNumber;
|
|
419
|
+
// And it's an unnumbered chapter, set to null.
|
|
420
|
+
if (!chapter.isNumbered())
|
|
421
|
+
match = null;
|
|
422
|
+
}
|
|
423
|
+
// Otherwise, increment if it's numbered.
|
|
424
|
+
else if (chapter.isNumbered())
|
|
425
|
+
chapterNumber++;
|
|
426
|
+
});
|
|
427
|
+
// Remember the number if we found it.
|
|
428
|
+
if (match !== null)
|
|
429
|
+
return match;
|
|
430
|
+
else
|
|
431
|
+
return undefined;
|
|
432
|
+
}
|
|
433
|
+
getSource(sourceID) {
|
|
434
|
+
return sourceID.charAt(0) === '#' &&
|
|
435
|
+
sourceID.substring(1) in this.sources
|
|
436
|
+
? this.sources[sourceID.substring(1)]
|
|
437
|
+
: null;
|
|
438
|
+
}
|
|
439
|
+
getChapterName(chapterID) {
|
|
440
|
+
const chapter = this.getChapter(chapterID);
|
|
441
|
+
return chapter?.getTitle();
|
|
442
|
+
}
|
|
443
|
+
getChapterSection(chapterID) {
|
|
444
|
+
const chapter = this.getChapter(chapterID);
|
|
445
|
+
return chapter?.getSection();
|
|
446
|
+
}
|
|
447
|
+
getFootnoteSymbol(number) {
|
|
448
|
+
let symbols = 'abcdefghijklmnopqrstuvwxyz';
|
|
449
|
+
// Let's hope there are never more than 26^2 footnotes in a single chapter...
|
|
450
|
+
return number < symbols.length
|
|
451
|
+
? symbols.charAt(number)
|
|
452
|
+
: symbols.charAt(Math.floor(number / symbols.length) - 1) +
|
|
453
|
+
symbols.charAt(number % symbols.length);
|
|
454
|
+
}
|
|
455
|
+
getBookIndex() {
|
|
456
|
+
// A map from word to a map of chapters containing the word
|
|
457
|
+
const bookIndex = {};
|
|
458
|
+
// Construct the index by building a dictionary of chapters in which each word appears.
|
|
459
|
+
this.chapters.forEach((chapter) => {
|
|
460
|
+
let index = chapter.getIndex(this);
|
|
461
|
+
if (index)
|
|
462
|
+
Object.keys(index).forEach((word) => {
|
|
463
|
+
if (word !== '' && word.length > 2) {
|
|
464
|
+
if (!(word in bookIndex))
|
|
465
|
+
bookIndex[word] = new Set();
|
|
466
|
+
bookIndex[word].add(chapter.getID());
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
return bookIndex;
|
|
471
|
+
}
|
|
472
|
+
// Given the current chapter, find the available chapter after it.
|
|
473
|
+
getNextChapterID(chapterID) {
|
|
474
|
+
// Handle back matter chapters.
|
|
475
|
+
switch (chapterID) {
|
|
476
|
+
case ChapterIDs.ReferencesID:
|
|
477
|
+
return this.hasGlossary()
|
|
478
|
+
? ChapterIDs.GlossaryID
|
|
479
|
+
: ChapterIDs.IndexID;
|
|
480
|
+
case ChapterIDs.GlossaryID:
|
|
481
|
+
return ChapterIDs.IndexID;
|
|
482
|
+
case ChapterIDs.IndexID:
|
|
483
|
+
return ChapterIDs.SearchID;
|
|
484
|
+
case ChapterIDs.SearchID:
|
|
485
|
+
return ChapterIDs.MediaID;
|
|
486
|
+
case ChapterIDs.MediaID:
|
|
487
|
+
return ChapterIDs.TableOfContentsID;
|
|
488
|
+
case ChapterIDs.TableOfContentsID:
|
|
489
|
+
return this.chapters.length > 0
|
|
490
|
+
? this.chapters[0].getID()
|
|
491
|
+
: null;
|
|
492
|
+
default:
|
|
493
|
+
let after = false;
|
|
494
|
+
for (let i = 0; i < this.chapters.length; i++) {
|
|
495
|
+
let chapter = this.chapters[i];
|
|
496
|
+
if (chapter.getID() === chapterID)
|
|
497
|
+
after = true;
|
|
498
|
+
// If we're after the given chapter and it's not forthcoming.
|
|
499
|
+
else if (after && !chapter.isForthcoming())
|
|
500
|
+
return chapter.getID();
|
|
501
|
+
}
|
|
502
|
+
// If the given ID was the last chapter, go to the next back matter chapter.
|
|
503
|
+
if (after)
|
|
504
|
+
return this.hasReferences()
|
|
505
|
+
? ChapterIDs.ReferencesID
|
|
506
|
+
: this.hasGlossary()
|
|
507
|
+
? ChapterIDs.GlossaryID
|
|
508
|
+
: ChapterIDs.IndexID;
|
|
509
|
+
// Otherwise, it wasn't a valid ID
|
|
510
|
+
else
|
|
511
|
+
return null;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
// Given a chapter id, find the available chapter before it.
|
|
515
|
+
getPreviousChapterID(chapterID) {
|
|
516
|
+
switch (chapterID) {
|
|
517
|
+
// Handle back matter chapters.
|
|
518
|
+
case ChapterIDs.ReferencesID:
|
|
519
|
+
return this.chapters.length > 0
|
|
520
|
+
? this.chapters[this.chapters.length - 1].getID()
|
|
521
|
+
: null; // Last chapter of the book
|
|
522
|
+
case ChapterIDs.GlossaryID:
|
|
523
|
+
return this.hasReferences()
|
|
524
|
+
? ChapterIDs.ReferencesID
|
|
525
|
+
: this.chapters.length > 0
|
|
526
|
+
? this.chapters[this.chapters.length - 1].getID()
|
|
527
|
+
: ChapterIDs.TableOfContentsID;
|
|
528
|
+
case ChapterIDs.IndexID:
|
|
529
|
+
return this.hasGlossary()
|
|
530
|
+
? ChapterIDs.GlossaryID
|
|
531
|
+
: this.hasReferences()
|
|
532
|
+
? ChapterIDs.ReferencesID
|
|
533
|
+
: this.chapters.length > 0
|
|
534
|
+
? this.chapters[this.chapters.length - 1].getID()
|
|
535
|
+
: ChapterIDs.TableOfContentsID;
|
|
536
|
+
case ChapterIDs.SearchID:
|
|
537
|
+
return ChapterIDs.IndexID;
|
|
538
|
+
case ChapterIDs.MediaID:
|
|
539
|
+
return ChapterIDs.SearchID;
|
|
540
|
+
default:
|
|
541
|
+
let before = false;
|
|
542
|
+
for (let i = this.chapters.length - 1; i >= 0; i--) {
|
|
543
|
+
let chapter = this.chapters[i];
|
|
544
|
+
if (chapter.getID() === chapterID)
|
|
545
|
+
before = true;
|
|
546
|
+
// If we're before the given chapter and it's not forthcoming.
|
|
547
|
+
else if (before && !chapter.isForthcoming())
|
|
548
|
+
return chapter.getID();
|
|
549
|
+
}
|
|
550
|
+
// If the given ID was the last chapter, go to the next back matter chapter.
|
|
551
|
+
if (before)
|
|
552
|
+
return ChapterIDs.TableOfContentsID;
|
|
553
|
+
// Otherwise, it wasn't a valid ID
|
|
554
|
+
else
|
|
555
|
+
return null;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
// Get all of the embeds in the book
|
|
559
|
+
getEmbeds() {
|
|
560
|
+
let embeds = [];
|
|
561
|
+
// Add the book cover
|
|
562
|
+
const cover = this.getImage('cover');
|
|
563
|
+
if (cover) {
|
|
564
|
+
let coverNode = Parser.parseEmbed(this, cover);
|
|
565
|
+
if (coverNode instanceof EmbedNode)
|
|
566
|
+
embeds.push(coverNode);
|
|
567
|
+
}
|
|
568
|
+
// Add the cover and images from each chapter.
|
|
569
|
+
this.getChapters().forEach((c) => {
|
|
570
|
+
const image = c.getImage();
|
|
571
|
+
let cover = image === null ? undefined : Parser.parseEmbed(this, image);
|
|
572
|
+
if (cover && cover instanceof EmbedNode)
|
|
573
|
+
embeds.push(cover);
|
|
574
|
+
// Get the chapter body's embeds
|
|
575
|
+
let bodyEmbeds = c?.getAST(this)?.getEmbeds();
|
|
576
|
+
if (bodyEmbeds)
|
|
577
|
+
bodyEmbeds.forEach((embed) => embeds.push(embed));
|
|
578
|
+
});
|
|
579
|
+
// Add the back matter covers
|
|
580
|
+
let backmatter = ['references', 'glossary', 'index', 'search', 'media'];
|
|
581
|
+
backmatter.forEach((id) => {
|
|
582
|
+
const img = this.getImage(id);
|
|
583
|
+
if (img) {
|
|
584
|
+
let image = Parser.parseEmbed(this, img);
|
|
585
|
+
if (image instanceof EmbedNode)
|
|
586
|
+
embeds.push(image);
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
return embeds;
|
|
590
|
+
}
|
|
591
|
+
isLatestEdition(book) {
|
|
592
|
+
const latestEditionID = book.getLatestEditionID();
|
|
593
|
+
return (latestEditionID !== undefined &&
|
|
594
|
+
latestEditionID === this.editionRef?.id);
|
|
595
|
+
}
|
|
596
|
+
isLatestPublishedEdition(book) {
|
|
597
|
+
const latestEditionID = book.getLatestPublishedEditionID();
|
|
598
|
+
return (latestEditionID !== undefined &&
|
|
599
|
+
latestEditionID === this.editionRef?.id);
|
|
600
|
+
}
|
|
601
|
+
getEditionNumber() {
|
|
602
|
+
return this.number;
|
|
603
|
+
}
|
|
604
|
+
getEditionLabel() {
|
|
605
|
+
const num = this.number;
|
|
606
|
+
return `${num}${num === 1 ? 'st' : num === 2 ? 'nd' : num === 3 ? 'rd' : ''}`;
|
|
607
|
+
}
|
|
608
|
+
getInfo() {
|
|
609
|
+
return this.editionRef === undefined
|
|
610
|
+
? undefined
|
|
611
|
+
: {
|
|
612
|
+
ref: this.editionRef,
|
|
613
|
+
summary: this.summary,
|
|
614
|
+
number: this.number,
|
|
615
|
+
published: this.published,
|
|
616
|
+
editionuids: this.uids,
|
|
617
|
+
chapteruids: Array.from(new Set(this.chapters.map((chapter) => chapter.uids).flat())),
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default class Reference {
|
|
2
|
+
readonly citationID: string;
|
|
3
|
+
readonly authors: string;
|
|
4
|
+
readonly year: string;
|
|
5
|
+
readonly title: string;
|
|
6
|
+
readonly source: string;
|
|
7
|
+
readonly url: string;
|
|
8
|
+
readonly summary: string;
|
|
9
|
+
readonly short: boolean;
|
|
10
|
+
constructor(citationID: string, authors?: string, year?: string, title?: string, source?: string, url?: string, summary?: string, short?: boolean);
|
|
11
|
+
toText(): string;
|
|
12
|
+
toList(): string[];
|
|
13
|
+
copy(): this;
|
|
14
|
+
withChildReplaced(): undefined;
|
|
15
|
+
withContentInRange(): this | undefined;
|
|
16
|
+
withCitationID(id: string): Reference;
|
|
17
|
+
withAuthors(authors: string): Reference;
|
|
18
|
+
withYear(year: string): Reference;
|
|
19
|
+
withTitle(title: string): Reference;
|
|
20
|
+
withSource(source: string): Reference;
|
|
21
|
+
withURL(url: string): Reference;
|
|
22
|
+
withSummary(summary: string): Reference;
|
|
23
|
+
equals(ref: Reference): boolean;
|
|
24
|
+
}
|