bookish-press 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/components/Auth.svelte +27 -24
- package/components/Auth.svelte.d.ts +4 -4
- package/components/Authentication.d.ts +2 -2
- package/components/BookPreview.svelte +75 -59
- package/components/BookPreview.svelte.d.ts +5 -5
- package/components/External.svelte +1 -1
- package/components/External.svelte.d.ts +3 -3
- package/components/Link.svelte +49 -3
- package/components/Link.svelte.d.ts +3 -4
- package/components/app/BookList.svelte +19 -0
- package/components/app/BookList.svelte.d.ts +18 -0
- package/components/app/Button.svelte +49 -0
- package/components/app/Button.svelte.d.ts +22 -0
- package/components/app/Feedback.svelte +47 -0
- package/components/app/Feedback.svelte.d.ts +18 -0
- package/components/app/Head.svelte +15 -0
- package/components/app/Head.svelte.d.ts +18 -0
- package/components/app/Large.svelte +8 -0
- package/components/app/Large.svelte.d.ts +27 -0
- package/components/app/Lead.svelte +12 -0
- package/components/app/Lead.svelte.d.ts +27 -0
- package/components/app/Link.svelte +24 -0
- package/components/app/Link.svelte.d.ts +20 -0
- package/components/app/Options.svelte +24 -0
- package/components/app/Options.svelte.d.ts +19 -0
- package/components/app/Paragraph.svelte +20 -0
- package/components/app/Paragraph.svelte.d.ts +18 -0
- package/components/app/Section.svelte +12 -0
- package/components/app/Section.svelte.d.ts +27 -0
- package/components/app/Table.svelte +32 -0
- package/components/app/Table.svelte.d.ts +27 -0
- package/components/app/TextInput.svelte +38 -0
- package/components/app/TextInput.svelte.d.ts +22 -0
- package/components/chapter/Atom.svelte +20 -6
- package/components/chapter/Atom.svelte.d.ts +3 -3
- package/components/chapter/Block.svelte +26 -21
- package/components/chapter/Block.svelte.d.ts +4 -4
- package/components/chapter/Callout.svelte +38 -7
- package/components/chapter/Callout.svelte.d.ts +4 -4
- package/components/chapter/CaptionedCode.svelte +67 -24
- package/components/chapter/CaptionedCode.svelte.d.ts +4 -4
- package/components/chapter/ChapterBody.svelte +62 -9
- package/components/chapter/ChapterBody.svelte.d.ts +5 -4
- package/components/chapter/Citations.svelte +86 -20
- package/components/chapter/Citations.svelte.d.ts +4 -4
- package/components/chapter/Code.svelte +152 -21
- package/components/chapter/Code.svelte.d.ts +3 -3
- package/components/chapter/Comment.svelte +39 -17
- package/components/chapter/Comment.svelte.d.ts +3 -3
- package/components/chapter/Definition.svelte +52 -18
- package/components/chapter/Definition.svelte.d.ts +5 -8
- package/components/chapter/Embed.svelte +155 -67
- package/components/chapter/Embed.svelte.d.ts +6 -4
- package/components/chapter/ErrorMessage.svelte +7 -2
- package/components/chapter/ErrorMessage.svelte.d.ts +4 -4
- package/components/chapter/ExtendedPrism.d.ts +2 -0
- package/components/chapter/ExtendedPrism.js +69 -0
- package/components/chapter/Figure.svelte +90 -0
- package/components/chapter/Figure.svelte.d.ts +24 -0
- package/components/chapter/Footnote.svelte +75 -12
- package/components/chapter/Footnote.svelte.d.ts +4 -4
- package/components/chapter/Format.svelte +63 -38
- package/components/chapter/Format.svelte.d.ts +5 -4
- package/components/chapter/InlineCode.svelte +16 -6
- package/components/chapter/InlineCode.svelte.d.ts +4 -4
- package/components/chapter/Label.svelte +38 -9
- package/components/chapter/Label.svelte.d.ts +4 -4
- package/components/chapter/Link.svelte +24 -19
- package/components/chapter/Link.svelte.d.ts +4 -4
- package/components/chapter/List.svelte +75 -8
- package/components/chapter/List.svelte.d.ts +4 -4
- package/components/chapter/Marginal.svelte +169 -27
- package/components/chapter/Marginal.svelte.d.ts +6 -3
- package/components/chapter/Paragraph.svelte +79 -6
- package/components/chapter/Paragraph.svelte.d.ts +4 -4
- package/components/chapter/Positioned.svelte +33 -0
- package/components/chapter/Positioned.svelte.d.ts +19 -0
- package/components/chapter/Problem.svelte +15 -0
- package/components/chapter/Problem.svelte.d.ts +27 -0
- package/components/chapter/Python.svelte +68 -21
- package/components/chapter/Python.svelte.d.ts +4 -4
- package/components/chapter/Quote.svelte +64 -11
- package/components/chapter/Quote.svelte.d.ts +4 -4
- package/components/chapter/Rule.svelte +12 -1
- package/components/chapter/Rule.svelte.d.ts +4 -4
- package/components/chapter/Table.svelte +36 -25
- package/components/chapter/Table.svelte.d.ts +4 -4
- package/components/chapter/Text.svelte +61 -36
- package/components/chapter/Text.svelte.d.ts +5 -4
- package/components/editor/BookishEditor.svelte +373 -244
- package/components/editor/BookishEditor.svelte.d.ts +9 -6
- package/components/editor/CalloutEditor.svelte +5 -5
- package/components/editor/CalloutEditor.svelte.d.ts +4 -4
- package/components/editor/CaptionedCodeEditor.svelte +16 -12
- package/components/editor/CaptionedCodeEditor.svelte.d.ts +4 -4
- package/components/editor/CaretContext.d.ts +48 -16
- package/components/editor/CaretState.d.ts +16 -44
- package/components/editor/CaretUtilities.d.ts +2 -2
- package/components/editor/CaretView.svelte +82 -0
- package/components/editor/CaretView.svelte.d.ts +25 -0
- package/components/editor/CitationsEditor.svelte +36 -25
- package/components/editor/CitationsEditor.svelte.d.ts +4 -4
- package/components/editor/Clipboard.d.ts +2 -2
- package/components/editor/Command.d.ts +13 -12
- package/components/editor/Commands.d.ts +1 -1
- package/components/editor/Commands.js +1114 -571
- package/components/editor/ConfirmButton.svelte +18 -12
- package/components/editor/ConfirmButton.svelte.d.ts +5 -4
- package/components/editor/DefinitionEditor.svelte +29 -21
- package/components/editor/DefinitionEditor.svelte.d.ts +4 -4
- package/components/editor/EmbedEditor.svelte +93 -43
- package/components/editor/EmbedEditor.svelte.d.ts +3 -3
- package/components/editor/Icon.svelte +17 -0
- package/components/editor/Icon.svelte.d.ts +16 -0
- package/components/editor/ImageChooser.svelte +53 -34
- package/components/editor/ImageChooser.svelte.d.ts +3 -3
- package/components/editor/InlineCodeEditor.svelte +7 -4
- package/components/editor/InlineCodeEditor.svelte.d.ts +4 -4
- package/components/editor/LabelEditor.svelte +20 -11
- package/components/editor/LabelEditor.svelte.d.ts +4 -4
- package/components/editor/LanguageEditor.svelte +10 -7
- package/components/editor/LanguageEditor.svelte.d.ts +3 -3
- package/components/editor/LinkEditor.svelte +64 -39
- package/components/editor/LinkEditor.svelte.d.ts +4 -4
- package/components/editor/Note.svelte +4 -3
- package/components/editor/Note.svelte.d.ts +6 -2
- package/components/editor/Permissions.svelte +95 -0
- package/components/editor/Permissions.svelte.d.ts +20 -0
- package/components/editor/PositionEditor.svelte +9 -6
- package/components/editor/PositionEditor.svelte.d.ts +4 -4
- package/components/editor/QuoteEditor.svelte +7 -2
- package/components/editor/QuoteEditor.svelte.d.ts +4 -4
- package/components/editor/Switch.svelte +55 -28
- package/components/editor/Switch.svelte.d.ts +4 -4
- package/components/editor/TableEditor.svelte +10 -0
- package/components/editor/TableEditor.svelte.d.ts +17 -0
- package/components/editor/TextEditor.svelte +83 -45
- package/components/editor/TextEditor.svelte.d.ts +5 -4
- package/components/editor/Toggle.svelte +11 -8
- package/components/editor/Toggle.svelte.d.ts +4 -4
- package/components/editor/Toolbar.svelte +191 -144
- package/components/editor/Toolbar.svelte.d.ts +5 -8
- package/components/editor/ToolbarGroup.svelte +17 -23
- package/components/editor/ToolbarGroup.svelte.d.ts +3 -4
- package/components/editor/ToolbarSpacer.svelte +8 -1
- package/components/editor/ToolbarSpacer.svelte.d.ts +6 -2
- package/components/editor/URLEditor.svelte +6 -8
- package/components/editor/URLEditor.svelte.d.ts +3 -3
- package/components/editor/UndoState.d.ts +3 -3
- package/components/editor/icons/annotate.svg +1 -0
- package/components/editor/icons/block.svg +1 -0
- package/components/editor/icons/bold.svg +1 -0
- package/components/editor/icons/bullets.svg +1 -0
- package/components/editor/icons/callout.svg +1 -0
- package/components/editor/icons/citation.svg +8 -0
- package/components/editor/icons/clear.svg +1 -0
- package/components/editor/icons/clipboard.svg +1 -0
- package/components/editor/icons/code.svg +1 -0
- package/components/editor/icons/columnafter.svg +1 -0
- package/components/editor/icons/columnbefore.svg +1 -0
- package/components/editor/icons/comment.svg +1 -0
- package/components/editor/icons/copy.svg +1 -0
- package/components/editor/icons/cut.svg +1 -0
- package/components/editor/icons/define.svg +7 -0
- package/components/editor/icons/deletecolumn.svg +1 -0
- package/components/editor/icons/deleterow.svg +1 -0
- package/components/editor/icons/footnote.svg +8 -0
- package/components/editor/icons/header1.svg +7 -0
- package/components/editor/icons/header2.svg +7 -0
- package/components/editor/icons/header3.svg +7 -0
- package/components/editor/icons/home.svg +1 -0
- package/components/editor/icons/indent.svg +1 -0
- package/components/editor/icons/italic.svg +1 -0
- package/components/editor/icons/label.svg +1 -0
- package/components/editor/icons/left.svg +1 -0
- package/components/editor/icons/level.svg +1 -0
- package/components/editor/icons/link.svg +1 -0
- package/components/editor/icons/list.svg +1 -0
- package/components/editor/icons/media.svg +1 -0
- package/components/editor/icons/middle.svg +1 -0
- package/components/editor/icons/numbers.svg +10 -0
- package/components/editor/icons/paragraph.svg +1 -0
- package/components/editor/icons/paste.svg +10 -0
- package/components/editor/icons/quote.svg +1 -0
- package/components/editor/icons/redo.svg +1 -0
- package/components/editor/icons/right.svg +1 -0
- package/components/editor/icons/rowabove.svg +1 -0
- package/components/editor/icons/rowbelow.svg +1 -0
- package/components/editor/icons/rule.svg +1 -0
- package/components/editor/icons/sub.svg +1 -0
- package/components/editor/icons/super.svg +1 -0
- package/components/editor/icons/table.svg +1 -0
- package/components/editor/icons/text.svg +1 -0
- package/components/editor/icons/time.svg +1 -0
- package/components/editor/icons/undo.svg +1 -0
- package/components/editor/icons/unindent.svg +1 -0
- package/components/editor/icons/unlink.svg +1 -0
- package/components/page/Acknowledgements.svelte +35 -24
- package/components/page/Acknowledgements.svelte.d.ts +4 -4
- package/components/page/Authors.svelte +34 -17
- package/components/page/Authors.svelte.d.ts +7 -6
- package/components/page/BookLoader.svelte +59 -0
- package/components/page/BookLoader.svelte.d.ts +16 -0
- package/components/page/BulkReferenceEditor.svelte +54 -23
- package/components/page/BulkReferenceEditor.svelte.d.ts +4 -4
- package/components/page/Chapter.svelte +234 -143
- package/components/page/Chapter.svelte.d.ts +3 -3
- package/components/page/ChapterContext.d.ts +4 -4
- package/components/page/ChapterNumber.svelte +9 -0
- package/components/page/ChapterNumber.svelte.d.ts +27 -0
- package/components/page/ChapterTitle.svelte +16 -0
- package/components/page/ChapterTitle.svelte.d.ts +18 -0
- package/components/page/Contexts.d.ts +42 -22
- package/components/page/Contexts.js +129 -17
- package/components/page/DefinitionView.svelte +129 -90
- package/components/page/DefinitionView.svelte.d.ts +3 -3
- package/components/page/Description.svelte +31 -19
- package/components/page/Description.svelte.d.ts +4 -4
- package/components/page/Edition.svelte +135 -81
- package/components/page/Edition.svelte.d.ts +5 -6
- package/components/page/EditionLoader.svelte +99 -0
- package/components/page/EditionLoader.svelte.d.ts +18 -0
- package/components/page/Editions.svelte +106 -0
- package/components/page/Editions.svelte.d.ts +14 -0
- package/components/page/Glossary.svelte +65 -49
- package/components/page/Glossary.svelte.d.ts +4 -4
- package/components/page/Header.svelte +143 -56
- package/components/page/Header.svelte.d.ts +8 -6
- package/components/page/Index.svelte +116 -80
- package/components/page/Index.svelte.d.ts +4 -4
- package/components/page/Instructions.svelte +18 -17
- package/components/page/Instructions.svelte.d.ts +6 -4
- package/components/page/License.svelte +39 -23
- package/components/page/License.svelte.d.ts +4 -4
- package/components/page/Loading.svelte +102 -12
- package/components/page/Loading.svelte.d.ts +6 -2
- package/components/page/Media.svelte +81 -53
- package/components/page/Media.svelte.d.ts +4 -4
- package/components/page/MediaPreview.svelte +26 -8
- package/components/page/MediaPreview.svelte.d.ts +3 -3
- package/components/page/Muted.svelte +10 -0
- package/components/page/Muted.svelte.d.ts +27 -0
- package/components/page/Outline.svelte +279 -59
- package/components/page/Outline.svelte.d.ts +3 -3
- package/components/page/Page.svelte +40 -9
- package/components/page/Page.svelte.d.ts +3 -3
- package/components/page/PageHeader.svelte +14 -0
- package/components/page/PageHeader.svelte.d.ts +18 -0
- package/components/page/PageParagraph.svelte +18 -0
- package/components/page/PageParagraph.svelte.d.ts +27 -0
- package/components/page/PossibleChapter.svelte +7 -7
- package/components/page/PossibleChapter.svelte.d.ts +4 -4
- package/components/page/PossibleReference.svelte +6 -11
- package/components/page/PossibleReference.svelte.d.ts +6 -7
- package/components/page/Print.svelte +27 -3
- package/components/page/Print.svelte.d.ts +4 -4
- package/components/page/Publish.svelte +134 -0
- package/components/page/Publish.svelte.d.ts +14 -0
- package/components/page/Reference.svelte +259 -117
- package/components/page/Reference.svelte.d.ts +5 -5
- package/components/page/References.svelte +45 -48
- package/components/page/References.svelte.d.ts +4 -4
- package/components/page/Rows.svelte +54 -0
- package/components/page/Rows.svelte.d.ts +27 -0
- package/components/page/Search.svelte +88 -63
- package/components/page/Search.svelte.d.ts +4 -4
- package/components/page/Status.svelte +46 -39
- package/components/page/Status.svelte.d.ts +4 -9
- package/components/page/SubdomainEditor.svelte +41 -27
- package/components/page/SubdomainEditor.svelte.d.ts +4 -4
- package/components/page/TableOfContents.svelte +264 -191
- package/components/page/TableOfContents.svelte.d.ts +4 -4
- package/components/page/TableOfContentsImage.svelte +8 -8
- package/components/page/TableOfContentsImage.svelte.d.ts +3 -3
- package/components/page/TableOfContentsRow.svelte +97 -34
- package/components/page/TableOfContentsRow.svelte.d.ts +4 -4
- package/components/page/ThemeEditor.svelte +177 -39
- package/components/page/ThemeEditor.svelte.d.ts +4 -4
- package/components/page/ThemeEditorPreview.svelte +35 -23
- package/components/page/ThemeEditorPreview.svelte.d.ts +5 -5
- package/components/page/ThemeSetEditor.svelte +15 -13
- package/components/page/ThemeSetEditor.svelte.d.ts +4 -4
- package/components/page/ThemeVariableEditor.svelte +24 -15
- package/components/page/ThemeVariableEditor.svelte.d.ts +3 -3
- package/components/page/Title.svelte +12 -0
- package/components/page/Title.svelte.d.ts +27 -0
- package/components/page/Unknown.svelte +28 -21
- package/components/page/Unknown.svelte.d.ts +4 -4
- package/components/page/margins.js +50 -33
- package/index.d.ts +13 -0
- package/index.js +14 -0
- package/models/CRUD.d.ts +27 -0
- package/models/CRUD.js +262 -0
- package/models/Firebase.d.ts +1 -0
- package/models/Firebase.js +26 -16
- package/models/book/Book.d.ts +40 -39
- package/models/book/Book.js +121 -121
- package/models/book/BookMedia.d.ts +3 -3
- package/models/book/BookMedia.js +22 -16
- package/models/book/BookSaveStatus.d.ts +7 -0
- package/models/book/BookSaveStatus.js +8 -0
- package/models/book/Chapter.d.ts +50 -39
- package/models/book/Chapter.js +189 -198
- package/models/book/ChapterID.js +7 -7
- package/models/book/Definition.d.ts +1 -1
- package/models/book/Edition.d.ts +87 -61
- package/models/book/Edition.js +460 -309
- package/models/book/Reference.d.ts +24 -0
- package/models/book/Reference.js +78 -0
- package/models/book/Schema.d.ts +168 -0
- package/models/book/Schema.js +115 -0
- package/models/book/Theme.d.ts +44 -37
- package/models/book/Theme.js +452 -52
- package/models/book/ThemeColors.d.ts +1 -1
- package/models/book/Words.d.ts +2 -0
- package/models/book/Words.js +110 -0
- package/models/chapter/AtomNode.d.ts +4 -4
- package/models/chapter/AtomNode.js +20 -13
- package/models/chapter/BlockNode.d.ts +9 -10
- package/models/chapter/BlockNode.js +32 -13
- package/models/chapter/BlocksNode.d.ts +10 -10
- package/models/chapter/BlocksNode.js +315 -120
- package/models/chapter/BlocksNode.test.js +494 -228
- package/models/chapter/Bookkeeping.d.ts +1 -1
- package/models/chapter/CalloutNode.d.ts +3 -3
- package/models/chapter/CalloutNode.js +34 -12
- package/models/chapter/Caret.d.ts +9 -7
- package/models/chapter/Caret.js +11 -6
- package/models/chapter/ChapterNode.d.ts +11 -11
- package/models/chapter/ChapterNode.js +70 -33
- package/models/chapter/CitationsNode.d.ts +3 -3
- package/models/chapter/CitationsNode.js +31 -12
- package/models/chapter/CodeNode.d.ts +11 -6
- package/models/chapter/CodeNode.js +143 -34
- package/models/chapter/CommentNode.d.ts +5 -5
- package/models/chapter/CommentNode.js +29 -13
- package/models/chapter/DefinitionNode.d.ts +2 -2
- package/models/chapter/DefinitionNode.js +15 -7
- package/models/chapter/Edit.d.ts +3 -3
- package/models/chapter/EmbedNode.d.ts +9 -5
- package/models/chapter/EmbedNode.js +108 -35
- package/models/chapter/ErrorNode.d.ts +2 -2
- package/models/chapter/ErrorNode.js +34 -12
- package/models/chapter/FootnoteNode.d.ts +5 -5
- package/models/chapter/FootnoteNode.js +34 -16
- package/models/chapter/FormatNode.d.ts +10 -10
- package/models/chapter/FormatNode.js +237 -106
- package/models/chapter/FormatNode.test.js +87 -45
- package/models/chapter/InlineCodeNode.d.ts +2 -2
- package/models/chapter/InlineCodeNode.js +22 -9
- package/models/chapter/LabelNode.d.ts +4 -4
- package/models/chapter/LabelNode.js +31 -13
- package/models/chapter/LinkNode.d.ts +2 -2
- package/models/chapter/LinkNode.js +21 -9
- package/models/chapter/ListNode.d.ts +8 -8
- package/models/chapter/ListNode.js +99 -38
- package/models/chapter/ListNode.test.js +29 -24
- package/models/chapter/MetadataNode.d.ts +3 -3
- package/models/chapter/MetadataNode.js +13 -5
- package/models/chapter/Node.d.ts +5 -3
- package/models/chapter/Node.js +76 -29
- package/models/chapter/Node.test.js +20 -18
- package/models/chapter/ParagraphNode.d.ts +6 -6
- package/models/chapter/ParagraphNode.js +84 -29
- package/models/chapter/ParagraphNode.test.js +22 -13
- package/models/chapter/Parser.d.ts +27 -27
- package/models/chapter/Parser.js +220 -206
- package/models/chapter/Parser.test.js +16 -16
- package/models/chapter/Position.d.ts +1 -1
- package/models/chapter/QuoteNode.d.ts +6 -6
- package/models/chapter/QuoteNode.js +61 -23
- package/models/chapter/RootNode.d.ts +4 -4
- package/models/chapter/RuleNode.d.ts +2 -2
- package/models/chapter/RuleNode.js +31 -11
- package/models/chapter/TableNode.d.ts +8 -6
- package/models/chapter/TableNode.js +89 -34
- package/models/chapter/TableNode.test.js +22 -24
- package/models/chapter/TextNode.d.ts +6 -6
- package/models/chapter/TextNode.js +72 -32
- package/models/chapter/TextNode.test.js +4 -4
- package/package.json +108 -26
- package/util/getSubdomain.js +8 -6
- package/util/isMobile.js +1 -1
- package/util/mineReference.d.ts +3 -2
- package/util/mineReference.js +67 -29
- package/util/scrollToEyeLevel.js +6 -1
- package/components/chapter/renderPosition.d.ts +0 -3
- package/components/chapter/renderPosition.js +0 -4
- package/components/editor/ToolbarIcon.svelte +0 -22
- package/components/editor/ToolbarIcon.svelte.d.ts +0 -16
- package/components/page/Alert.svelte +0 -11
- package/components/page/Alert.svelte.d.ts +0 -23
- package/components/page/Revisions.svelte +0 -124
- package/components/page/Revisions.svelte.d.ts +0 -14
- package/models/BookLoader.d.ts +0 -2
- package/models/BookLoader.js +0 -67
- package/models/Firestore.d.ts +0 -22
- package/models/Firestore.js +0 -194
- package/models/chapter/ReferenceNode.d.ts +0 -29
- package/models/chapter/ReferenceNode.js +0 -48
- package/models/loadEdition.d.ts +0 -5
- package/models/loadEdition.js +0 -16
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type CodeNode from
|
|
2
|
+
import type CodeNode from '../../models/chapter/CodeNode';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
node: CodeNode;
|
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
12
|
+
export type CaptionedCodeProps = typeof __propDef.props;
|
|
13
|
+
export type CaptionedCodeEvents = typeof __propDef.events;
|
|
14
|
+
export type CaptionedCodeSlots = typeof __propDef.slots;
|
|
15
15
|
export default class CaptionedCode extends SvelteComponentTyped<CaptionedCodeProps, CaptionedCodeEvents, CaptionedCodeSlots> {
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1,23 +1,76 @@
|
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
1
3
|
<script>import ParagraphNode from '../../models/chapter/ParagraphNode';
|
|
2
|
-
import Block from
|
|
4
|
+
import Block from './Block.svelte';
|
|
3
5
|
import Paragraph from './Paragraph.svelte';
|
|
6
|
+
import Problem from './Problem.svelte';
|
|
4
7
|
export let node;
|
|
5
|
-
export let placeholder =
|
|
8
|
+
export let placeholder = '';
|
|
9
|
+
export let editable = false;
|
|
6
10
|
$: errors = node.getErrors();
|
|
7
11
|
$: blocks = node.getBlocks();
|
|
8
12
|
</script>
|
|
9
13
|
|
|
10
|
-
<
|
|
11
|
-
{#if errors.length > 0
|
|
14
|
+
<section class="bookish-chapter-body" data-nodeid={node.nodeID}>
|
|
15
|
+
{#if editable && errors.length > 0}
|
|
12
16
|
<p>
|
|
13
|
-
<
|
|
17
|
+
<Problem
|
|
18
|
+
>{errors.length +
|
|
19
|
+
' ' +
|
|
20
|
+
(errors.length > 1 ? 'errors' : 'error')} below</Problem
|
|
21
|
+
>
|
|
14
22
|
</p>
|
|
15
23
|
{/if}
|
|
16
|
-
{#if blocks.length === 1 && blocks[0] instanceof ParagraphNode && blocks[0]
|
|
17
|
-
|
|
24
|
+
{#if blocks.length === 1 && blocks[0] instanceof ParagraphNode && blocks[0]
|
|
25
|
+
.getFormat()
|
|
26
|
+
.isEmptyText()}
|
|
27
|
+
<Paragraph node={blocks[0]} {placeholder} />
|
|
18
28
|
{:else}
|
|
19
|
-
{#each node.getBlocks() as block }
|
|
29
|
+
{#each node.getBlocks() as block (block.nodeID)}
|
|
20
30
|
<Block node={block} />
|
|
21
31
|
{/each}
|
|
22
32
|
{/if}
|
|
23
|
-
</
|
|
33
|
+
</section>
|
|
34
|
+
|
|
35
|
+
<style>
|
|
36
|
+
/* This accounts for completely empty chapters. */
|
|
37
|
+
.bookish-chapter-body {
|
|
38
|
+
min-height: 2em;
|
|
39
|
+
min-width: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* This implements a drop cap in the first letter of the first text in the first format of the first paragraph of a chapter (but only chapters). */
|
|
43
|
+
:global(
|
|
44
|
+
.chapter-content
|
|
45
|
+
.bookish-chapter-body
|
|
46
|
+
p:first-of-type:not(.placeholder)::first-letter
|
|
47
|
+
) {
|
|
48
|
+
padding: 0 0.25rem;
|
|
49
|
+
margin: 0 0.25rem 0 0;
|
|
50
|
+
font-size: 4rem;
|
|
51
|
+
font-weight: 700;
|
|
52
|
+
float: left;
|
|
53
|
+
line-height: 1;
|
|
54
|
+
color: var(--bookish-paragraph-color);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:global(.bookish-content-highlight) {
|
|
58
|
+
position: relative;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* A rectangular highlight like a highlighter marker over highlighted text */
|
|
62
|
+
:global(.bookish-content-highlight:before) {
|
|
63
|
+
content: '';
|
|
64
|
+
z-index: -1;
|
|
65
|
+
left: -0.25em;
|
|
66
|
+
top: -0.5em;
|
|
67
|
+
position: absolute;
|
|
68
|
+
width: 100%;
|
|
69
|
+
height: 2em;
|
|
70
|
+
opacity: 0.7;
|
|
71
|
+
padding: 0.1em 0.25em;
|
|
72
|
+
transform: skew(-10deg);
|
|
73
|
+
background-color: var(--bookish-highlight-color);
|
|
74
|
+
filter: url(#marker);
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type ChapterNode from
|
|
2
|
+
import type ChapterNode from '../../models/chapter/ChapterNode';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
node: ChapterNode;
|
|
6
6
|
placeholder?: string | undefined;
|
|
7
|
+
editable?: boolean | undefined;
|
|
7
8
|
};
|
|
8
9
|
events: {
|
|
9
10
|
[evt: string]: CustomEvent<any>;
|
|
10
11
|
};
|
|
11
12
|
slots: {};
|
|
12
13
|
};
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type ChapterBodyProps = typeof __propDef.props;
|
|
15
|
+
export type ChapterBodyEvents = typeof __propDef.events;
|
|
16
|
+
export type ChapterBodySlots = typeof __propDef.slots;
|
|
16
17
|
export default class ChapterBody extends SvelteComponentTyped<ChapterBodyProps, ChapterBodyEvents, ChapterBodySlots> {
|
|
17
18
|
}
|
|
18
19
|
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
1
3
|
<script>import Marginal from './Marginal.svelte';
|
|
2
4
|
import Parser from '../../models/chapter/Parser';
|
|
5
|
+
import Problem from './Problem.svelte';
|
|
3
6
|
import Atom from './Atom.svelte';
|
|
4
7
|
import { getChapter, getEdition } from '../page/Contexts';
|
|
5
8
|
import PossibleReference from '../page/PossibleReference.svelte';
|
|
@@ -7,13 +10,14 @@ import { afterUpdate } from 'svelte';
|
|
|
7
10
|
export let node;
|
|
8
11
|
let chapter = getChapter();
|
|
9
12
|
let edition = getEdition();
|
|
10
|
-
$:
|
|
13
|
+
$: ast =
|
|
14
|
+
$edition && $chapter ? $chapter.chapter.getAST($edition) : undefined;
|
|
11
15
|
// Sort citations numerically, however they're numbered.
|
|
12
16
|
$: citations = node.getMeta().sort((a, b) => {
|
|
13
|
-
if (
|
|
17
|
+
if (ast === undefined)
|
|
14
18
|
return 0;
|
|
15
|
-
let aNumber =
|
|
16
|
-
let bNumber =
|
|
19
|
+
let aNumber = ast.getCitationNumber(a);
|
|
20
|
+
let bNumber = ast.getCitationNumber(b);
|
|
17
21
|
if (aNumber === null) {
|
|
18
22
|
if (bNumber === null)
|
|
19
23
|
return 0;
|
|
@@ -32,30 +36,45 @@ afterUpdate(() => $chapter?.layoutMarginals());
|
|
|
32
36
|
</script>
|
|
33
37
|
|
|
34
38
|
<Atom {node}>
|
|
35
|
-
{#if
|
|
36
|
-
<span class="bookish-citation"
|
|
37
|
-
<Marginal
|
|
39
|
+
{#if ast}
|
|
40
|
+
<span class="bookish-citation" data-nodeid={node.nodeID}>
|
|
41
|
+
<Marginal
|
|
42
|
+
{node}
|
|
43
|
+
id={'citation-' + citations.join('-')}
|
|
44
|
+
label="citations"
|
|
45
|
+
>
|
|
38
46
|
<svelte:fragment slot="interactor">
|
|
39
47
|
{#each citations as citationID, index}
|
|
40
|
-
{@const citationNumber =
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
{@const citationNumber =
|
|
49
|
+
ast?.getCitationNumber(citationID)}
|
|
50
|
+
{#if citationNumber && citationID in ($edition?.getReferences() ?? {})}
|
|
51
|
+
<sup class="bookish-citation-symbol"
|
|
52
|
+
>{citationNumber}</sup
|
|
53
|
+
>
|
|
43
54
|
{:else}
|
|
44
|
-
<
|
|
55
|
+
<Problem
|
|
56
|
+
>Unknown reference: <code>{citationID}</code
|
|
57
|
+
></Problem
|
|
58
|
+
>
|
|
45
59
|
{/if}
|
|
46
|
-
{#if citations.length > 1 && index < citations.length - 1
|
|
60
|
+
{#if citations.length > 1 && index < citations.length - 1}<sup
|
|
61
|
+
>,</sup
|
|
62
|
+
>{/if}
|
|
47
63
|
{:else}
|
|
48
|
-
<sup class="bookish-citation-symbol">{
|
|
64
|
+
<sup class="bookish-citation-symbol">{'\u2014'}</sup>
|
|
49
65
|
{/each}
|
|
50
66
|
</svelte:fragment>
|
|
51
67
|
<span slot="content" class="bookish-references">
|
|
52
|
-
{#each citations as citationID
|
|
53
|
-
{@const citationNumber =
|
|
54
|
-
|
|
55
|
-
{
|
|
68
|
+
{#each citations as citationID}
|
|
69
|
+
{@const citationNumber =
|
|
70
|
+
ast?.getCitationNumber(citationID)}
|
|
71
|
+
{@const ref = $edition?.getReference(citationID)}
|
|
72
|
+
{#if citationNumber && ref && $edition}
|
|
56
73
|
<span class="bookish-reference">
|
|
57
|
-
<sup class="bookish-citation-symbol"
|
|
58
|
-
|
|
74
|
+
<sup class="bookish-citation-symbol"
|
|
75
|
+
>{citationNumber}</sup
|
|
76
|
+
>
|
|
77
|
+
<PossibleReference node={ref} />
|
|
59
78
|
</span>
|
|
60
79
|
{/if}
|
|
61
80
|
{/each}
|
|
@@ -63,4 +82,51 @@ afterUpdate(() => $chapter?.layoutMarginals());
|
|
|
63
82
|
</Marginal>
|
|
64
83
|
</span>
|
|
65
84
|
{/if}
|
|
66
|
-
</Atom>
|
|
85
|
+
</Atom>
|
|
86
|
+
|
|
87
|
+
<style>
|
|
88
|
+
.bookish-reference {
|
|
89
|
+
font-family: var(--bookish-paragraph-font-family);
|
|
90
|
+
list-style-position: outside;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:global(ol li.bookish-reference::before) {
|
|
94
|
+
color: var(--bookish-paragraph-color);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:global(.bookish-marginal) .bookish-reference {
|
|
98
|
+
font-size: var(--bookish-small-font-size);
|
|
99
|
+
font-style: normal;
|
|
100
|
+
color: var(--bookish-paragraph-color);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* This enables us to layout the numbers and letters in a neat right-aligned floating grid. */
|
|
104
|
+
.bookish-reference {
|
|
105
|
+
position: relative;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.bookish-references .bookish-reference {
|
|
109
|
+
display: block;
|
|
110
|
+
line-height: var(--bookish-paragraph-line-height-tight);
|
|
111
|
+
margin-left: 1rem;
|
|
112
|
+
margin-bottom: 1rem;
|
|
113
|
+
text-align: left;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.bookish-citation-symbol {
|
|
117
|
+
font-family: var(--bookish-paragraph-font-family);
|
|
118
|
+
font-weight: normal;
|
|
119
|
+
color: var(--bookish-link-color);
|
|
120
|
+
position: relative;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.bookish-reference .bookish-citation-symbol {
|
|
124
|
+
display: block;
|
|
125
|
+
float: left;
|
|
126
|
+
margin-top: -0.5em;
|
|
127
|
+
position: absolute;
|
|
128
|
+
left: -1.75em;
|
|
129
|
+
text-align: right;
|
|
130
|
+
width: 1.5em; /* Just enough space for 2 digits, a bit of a hack */
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type CitationsNode from
|
|
2
|
+
import type CitationsNode from '../../models/chapter/CitationsNode';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
node: CitationsNode;
|
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
12
|
+
export type CitationsProps = typeof __propDef.props;
|
|
13
|
+
export type CitationsEvents = typeof __propDef.events;
|
|
14
|
+
export type CitationsSlots = typeof __propDef.slots;
|
|
15
15
|
export default class Citations extends SvelteComponentTyped<CitationsProps, CitationsEvents, CitationsSlots> {
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1,35 +1,166 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
3
|
+
<script>import { afterUpdate } from 'svelte';
|
|
4
|
+
import Prism from './ExtendedPrism';
|
|
5
5
|
export let editable;
|
|
6
6
|
export let inline;
|
|
7
7
|
export let nodeID;
|
|
8
8
|
export let edited = undefined;
|
|
9
9
|
export let language = undefined;
|
|
10
|
-
let
|
|
11
|
-
// Find any code tags inside and highlight them.
|
|
12
|
-
function highlightCode() {
|
|
13
|
-
if (el)
|
|
14
|
-
hljs.highlightElement(el);
|
|
15
|
-
}
|
|
10
|
+
let element = null;
|
|
16
11
|
// When the component mounts or updates, highlight the code inside.
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
afterUpdate(() => {
|
|
13
|
+
if (element) {
|
|
14
|
+
Prism.highlightElement(element);
|
|
15
|
+
}
|
|
19
16
|
});
|
|
20
17
|
function handleChange() {
|
|
21
|
-
if (
|
|
22
|
-
edited(
|
|
18
|
+
if (element && edited)
|
|
19
|
+
edited(element.innerText);
|
|
23
20
|
}
|
|
24
|
-
// There's no way to mute highlightjs warnings on missing languages, so we check here.
|
|
25
|
-
$: lang = language ? (hljs.getLanguage(language) === undefined ? "text" : language) : "plaintext";
|
|
26
21
|
</script>
|
|
27
22
|
|
|
28
|
-
<code
|
|
23
|
+
<code
|
|
29
24
|
data-nodeid={nodeID}
|
|
25
|
+
bind:this={element}
|
|
30
26
|
contenteditable={editable}
|
|
31
|
-
class={`bookish-code ${
|
|
27
|
+
class={`bookish-code ${
|
|
28
|
+
inline ? 'bookish-code-inline' : 'bookish-code-block'
|
|
29
|
+
} ${language ? `language-${language}` : ''}`}
|
|
32
30
|
on:blur={handleChange}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</code>
|
|
31
|
+
>
|
|
32
|
+
<slot />
|
|
33
|
+
</code>
|
|
34
|
+
|
|
35
|
+
<style global>
|
|
36
|
+
:global(.bookish-code) {
|
|
37
|
+
font-family: var(--bookish-code-font-family);
|
|
38
|
+
font-weight: var(--bookish-code-font-weight);
|
|
39
|
+
font-size: var(--bookish-code-font-size);
|
|
40
|
+
border: 1px solid var(--bookish-border-color-light);
|
|
41
|
+
color: var(--bookish-muted-color);
|
|
42
|
+
background-color: var(--bookish-block-background-color);
|
|
43
|
+
clear: both;
|
|
44
|
+
overflow-x: scroll;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:global(code) {
|
|
48
|
+
font-family: var(--bookish-code-font-family);
|
|
49
|
+
font-weight: var(--bookish-code-font-weight);
|
|
50
|
+
font-size: var(--bookish-code-font-size);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:global(.bookish-code-block) {
|
|
54
|
+
display: block;
|
|
55
|
+
padding: var(--bookish-block-padding);
|
|
56
|
+
line-height: var(--bookish-paragraph-line-height-tight);
|
|
57
|
+
border-radius: var(--bookish-roundedness);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:global(.bookish-code-inline) {
|
|
61
|
+
display: inline;
|
|
62
|
+
padding: calc(1.5 * var(--bookish-inline-padding))
|
|
63
|
+
var(--bookish-inline-padding);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:global(.bookish-code-inline) :global(code) {
|
|
67
|
+
display: inline;
|
|
68
|
+
padding: 0em;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* PrismJS 1.29.0
|
|
72
|
+
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+python */
|
|
73
|
+
/**
|
|
74
|
+
* prism.js default theme for JavaScript, CSS and HTML
|
|
75
|
+
* Based on dabblet (http://dabblet.com)
|
|
76
|
+
* @author Lea Verou
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
:global(code[class*='language-']) {
|
|
80
|
+
color: black;
|
|
81
|
+
background: none;
|
|
82
|
+
font-family: var(--bookish-code-font-family);
|
|
83
|
+
font-size: 1em;
|
|
84
|
+
text-align: left;
|
|
85
|
+
white-space: pre;
|
|
86
|
+
word-spacing: normal;
|
|
87
|
+
word-break: normal;
|
|
88
|
+
word-wrap: normal;
|
|
89
|
+
line-height: 1.5;
|
|
90
|
+
|
|
91
|
+
-moz-tab-size: 4;
|
|
92
|
+
-o-tab-size: 4;
|
|
93
|
+
tab-size: 4;
|
|
94
|
+
|
|
95
|
+
-webkit-hyphens: none;
|
|
96
|
+
-moz-hyphens: none;
|
|
97
|
+
-ms-hyphens: none;
|
|
98
|
+
hyphens: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:global(.token.comment),
|
|
102
|
+
:global(.token.prolog),
|
|
103
|
+
:global(.token.doctype),
|
|
104
|
+
:global(.token.cdata) {
|
|
105
|
+
color: var(--bookish-comment-color);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:global(.token.punctuation) {
|
|
109
|
+
color: var(--bookish-muted-color);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:global(.token.namespace) {
|
|
113
|
+
opacity: 0.7;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:global(.token.property),
|
|
117
|
+
:global(.token.tag),
|
|
118
|
+
:global(.token.boolean),
|
|
119
|
+
:global(.token.number),
|
|
120
|
+
:global(.token.constant),
|
|
121
|
+
:global(.token.symbol),
|
|
122
|
+
:global(.token.deleted) {
|
|
123
|
+
color: var(--bookish-error-color);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:global(.token.selector),
|
|
127
|
+
:global(.token.attr-name),
|
|
128
|
+
:global(.token.string),
|
|
129
|
+
:global(.token.char),
|
|
130
|
+
:global(.token.builtin),
|
|
131
|
+
:global(.token.inserted) {
|
|
132
|
+
color: var(--bookish-pragraph-color);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
:global(.token.operator),
|
|
136
|
+
:global(.token.entity),
|
|
137
|
+
:global(.token.url) {
|
|
138
|
+
color: var(--bookish-bullet-color);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:global(.token.atrule),
|
|
142
|
+
:global(.token.attr-value),
|
|
143
|
+
:global(.token.keyword) {
|
|
144
|
+
color: var(--bookish-link-color);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
:global(.token.regex),
|
|
148
|
+
:global(.token.important),
|
|
149
|
+
:global(.token.variable),
|
|
150
|
+
:global(.token.function),
|
|
151
|
+
:global(.token.class-name) {
|
|
152
|
+
color: var(--bookish-highlight-color);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:global(.token.important),
|
|
156
|
+
:global(.token.bold) {
|
|
157
|
+
font-weight: bold;
|
|
158
|
+
}
|
|
159
|
+
:global(.token.italic) {
|
|
160
|
+
font-style: italic;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
:global(.token.entity) {
|
|
164
|
+
cursor: help;
|
|
165
|
+
}
|
|
166
|
+
</style>
|
|
@@ -14,9 +14,9 @@ declare const __propDef: {
|
|
|
14
14
|
default: {};
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
17
|
+
export type CodeProps = typeof __propDef.props;
|
|
18
|
+
export type CodeEvents = typeof __propDef.events;
|
|
19
|
+
export type CodeSlots = typeof __propDef.slots;
|
|
20
20
|
export default class Code extends SvelteComponentTyped<CodeProps, CodeEvents, CodeSlots> {
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -1,28 +1,45 @@
|
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
1
3
|
<script>import Atom from './Atom.svelte';
|
|
2
4
|
import Marginal from './Marginal.svelte';
|
|
3
5
|
import Format from './Format.svelte';
|
|
4
|
-
import { getChapter,
|
|
5
|
-
import { getCaret } from '../page/Contexts';
|
|
6
|
+
import { getChapter, isChapterEditable, getCaret, getEdition, } from '../page/Contexts';
|
|
6
7
|
import { afterUpdate } from 'svelte';
|
|
7
|
-
import
|
|
8
|
+
import Icon from '../editor/Icon.svelte';
|
|
9
|
+
import CommentIcon from '../editor/icons/comment.svg?raw';
|
|
8
10
|
export let node;
|
|
9
11
|
let chapter = getChapter();
|
|
10
|
-
let
|
|
12
|
+
let edition = getEdition();
|
|
13
|
+
let editable = isChapterEditable();
|
|
11
14
|
let caret = getCaret();
|
|
12
|
-
$: chapterNode =
|
|
13
|
-
|
|
15
|
+
$: chapterNode =
|
|
16
|
+
$edition && $chapter ? $chapter.chapter.getAST($edition) : undefined;
|
|
17
|
+
$: focused =
|
|
18
|
+
$caret && $caret.range && node.contains($caret.range.start.node);
|
|
14
19
|
// Position the marginals on every render.
|
|
15
20
|
afterUpdate(() => $chapter?.layoutMarginals());
|
|
16
21
|
</script>
|
|
17
22
|
|
|
18
23
|
<Atom {node}>
|
|
19
24
|
{#if editable}
|
|
20
|
-
<Marginal
|
|
25
|
+
<Marginal
|
|
26
|
+
{node}
|
|
27
|
+
id={'comment-' +
|
|
28
|
+
(chapterNode === undefined
|
|
29
|
+
? '?'
|
|
30
|
+
: chapterNode.getComments().indexOf(node))}
|
|
31
|
+
label="comment, escape to edit"
|
|
32
|
+
>
|
|
21
33
|
<span slot="interactor" class="bookish-comment-symbol">
|
|
22
|
-
<
|
|
34
|
+
<Icon icon={CommentIcon} />
|
|
23
35
|
</span>
|
|
24
|
-
<span
|
|
25
|
-
|
|
36
|
+
<span
|
|
37
|
+
slot="content"
|
|
38
|
+
class={`bookish-app-comment ${
|
|
39
|
+
focused ? 'bookish-app-comment-focused' : ''
|
|
40
|
+
}`}
|
|
41
|
+
>
|
|
42
|
+
<Format node={node.getMeta()} placeholder="comment" />
|
|
26
43
|
</span>
|
|
27
44
|
</Marginal>
|
|
28
45
|
{/if}
|
|
@@ -30,17 +47,22 @@ afterUpdate(() => $chapter?.layoutMarginals());
|
|
|
30
47
|
|
|
31
48
|
<style>
|
|
32
49
|
.bookish-app-comment {
|
|
33
|
-
background: var(--
|
|
34
|
-
border: var(--
|
|
35
|
-
border-radius: 0 var(--
|
|
36
|
-
|
|
37
|
-
|
|
50
|
+
background: var(--app-chrome-background);
|
|
51
|
+
border: var(--app-chrome-border-size) solid var(--app-border-color);
|
|
52
|
+
border-radius: 0 var(--app-chrome-padding) var(--app-chrome-padding)
|
|
53
|
+
var(--app-chrome-padding);
|
|
54
|
+
padding: var(--app-chrome-padding);
|
|
55
|
+
font-size: var(--app-chrome-font-size);
|
|
38
56
|
display: inline-block;
|
|
39
57
|
line-height: 1.5em;
|
|
40
58
|
}
|
|
41
59
|
|
|
42
|
-
.bookish-app-comment-focused,
|
|
60
|
+
.bookish-app-comment-focused,
|
|
61
|
+
.bookish-footnote-focused {
|
|
43
62
|
outline: 2px solid var(--bookish-highlight-color);
|
|
44
63
|
}
|
|
45
64
|
|
|
46
|
-
|
|
65
|
+
.bookish-comment-symbol {
|
|
66
|
+
position: relative;
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
12
|
+
export type CommentProps = typeof __propDef.props;
|
|
13
|
+
export type CommentEvents = typeof __propDef.events;
|
|
14
|
+
export type CommentSlots = typeof __propDef.slots;
|
|
15
15
|
export default class Comment extends SvelteComponentTyped<CommentProps, CommentEvents, CommentSlots> {
|
|
16
16
|
}
|
|
17
17
|
export {};
|