bookish-press 0.4.1 → 0.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/components/Auth.svelte +19 -14
- package/components/Auth.svelte.d.ts +4 -4
- package/components/Authentication.d.ts +2 -2
- package/components/BookPreview.svelte +77 -59
- package/components/BookPreview.svelte.d.ts +5 -5
- package/components/External.svelte +1 -1
- package/components/External.svelte.d.ts +3 -3
- package/components/Link.svelte +49 -3
- package/components/Link.svelte.d.ts +3 -4
- package/components/app/BookList.svelte +19 -0
- package/components/app/BookList.svelte.d.ts +18 -0
- package/components/app/Button.svelte +49 -0
- package/components/app/Button.svelte.d.ts +22 -0
- package/components/app/Feedback.svelte +45 -0
- package/components/app/Feedback.svelte.d.ts +18 -0
- package/components/app/Head.svelte +12 -0
- package/components/app/Head.svelte.d.ts +27 -0
- package/components/app/Large.svelte +8 -0
- package/components/app/Large.svelte.d.ts +27 -0
- package/components/app/Lead.svelte +12 -0
- package/components/app/Lead.svelte.d.ts +27 -0
- package/components/app/Link.svelte +24 -0
- package/components/app/Link.svelte.d.ts +20 -0
- package/components/app/Options.svelte +24 -0
- package/components/app/Options.svelte.d.ts +19 -0
- package/components/app/Paragraph.svelte +19 -0
- package/components/app/Paragraph.svelte.d.ts +18 -0
- package/components/app/Table.svelte +32 -0
- package/components/app/Table.svelte.d.ts +27 -0
- package/components/app/TextInput.svelte +37 -0
- package/components/app/TextInput.svelte.d.ts +22 -0
- package/components/app/Writing.svelte +13 -0
- package/components/app/Writing.svelte.d.ts +27 -0
- package/components/chapter/Atom.svelte +20 -6
- package/components/chapter/Atom.svelte.d.ts +3 -3
- package/components/chapter/Block.svelte +23 -20
- package/components/chapter/Block.svelte.d.ts +4 -4
- package/components/chapter/Callout.svelte +38 -7
- package/components/chapter/Callout.svelte.d.ts +4 -4
- package/components/chapter/CaptionedCode.svelte +66 -23
- package/components/chapter/CaptionedCode.svelte.d.ts +4 -4
- package/components/chapter/ChapterBody.svelte +61 -9
- package/components/chapter/ChapterBody.svelte.d.ts +4 -4
- package/components/chapter/Citations.svelte +86 -20
- package/components/chapter/Citations.svelte.d.ts +4 -4
- package/components/chapter/Code.svelte +152 -21
- package/components/chapter/Code.svelte.d.ts +3 -3
- package/components/chapter/Comment.svelte +38 -16
- package/components/chapter/Comment.svelte.d.ts +3 -3
- package/components/chapter/Definition.svelte +52 -18
- package/components/chapter/Definition.svelte.d.ts +5 -8
- package/components/chapter/Embed.svelte +154 -66
- package/components/chapter/Embed.svelte.d.ts +5 -4
- package/components/chapter/ErrorMessage.svelte +7 -2
- package/components/chapter/ErrorMessage.svelte.d.ts +4 -4
- package/components/chapter/ExtendedPrism.d.ts +2 -0
- package/components/chapter/ExtendedPrism.js +69 -0
- package/components/chapter/Figure.svelte +90 -0
- package/components/chapter/Figure.svelte.d.ts +24 -0
- package/components/chapter/Footnote.svelte +75 -12
- package/components/chapter/Footnote.svelte.d.ts +4 -4
- package/components/chapter/Format.svelte +60 -37
- package/components/chapter/Format.svelte.d.ts +4 -4
- package/components/chapter/InlineCode.svelte +15 -5
- package/components/chapter/InlineCode.svelte.d.ts +4 -4
- package/components/chapter/Label.svelte +37 -8
- package/components/chapter/Label.svelte.d.ts +4 -4
- package/components/chapter/Link.svelte +23 -18
- package/components/chapter/Link.svelte.d.ts +4 -4
- package/components/chapter/List.svelte +75 -8
- package/components/chapter/List.svelte.d.ts +4 -4
- package/components/chapter/Marginal.svelte +169 -27
- package/components/chapter/Marginal.svelte.d.ts +6 -3
- package/components/chapter/Paragraph.svelte +74 -6
- package/components/chapter/Paragraph.svelte.d.ts +4 -4
- package/components/chapter/Positioned.svelte +33 -0
- package/components/chapter/Positioned.svelte.d.ts +19 -0
- package/components/chapter/Problem.svelte +15 -0
- package/components/chapter/Problem.svelte.d.ts +27 -0
- package/components/chapter/Python.svelte +68 -21
- package/components/chapter/Python.svelte.d.ts +4 -4
- package/components/chapter/Quote.svelte +64 -11
- package/components/chapter/Quote.svelte.d.ts +4 -4
- package/components/chapter/Rule.svelte +12 -1
- package/components/chapter/Rule.svelte.d.ts +4 -4
- package/components/chapter/Table.svelte +36 -25
- package/components/chapter/Table.svelte.d.ts +4 -4
- package/components/chapter/Text.svelte +61 -36
- package/components/chapter/Text.svelte.d.ts +5 -4
- package/components/editor/BookishEditor.svelte +343 -237
- package/components/editor/BookishEditor.svelte.d.ts +5 -5
- package/components/editor/CalloutEditor.svelte +5 -5
- package/components/editor/CalloutEditor.svelte.d.ts +4 -4
- package/components/editor/CaptionedCodeEditor.svelte +16 -12
- package/components/editor/CaptionedCodeEditor.svelte.d.ts +4 -4
- package/components/editor/CaretContext.d.ts +48 -16
- package/components/editor/CaretState.d.ts +16 -44
- package/components/editor/CaretUtilities.d.ts +2 -2
- package/components/editor/CaretView.svelte +80 -0
- package/components/editor/CaretView.svelte.d.ts +24 -0
- package/components/editor/CitationsEditor.svelte +36 -25
- package/components/editor/CitationsEditor.svelte.d.ts +4 -4
- package/components/editor/Clipboard.d.ts +2 -2
- package/components/editor/Command.d.ts +13 -12
- package/components/editor/Commands.d.ts +1 -1
- package/components/editor/Commands.js +1114 -571
- package/components/editor/ConfirmButton.svelte +18 -12
- package/components/editor/ConfirmButton.svelte.d.ts +5 -4
- package/components/editor/DefinitionEditor.svelte +29 -21
- package/components/editor/DefinitionEditor.svelte.d.ts +4 -4
- package/components/editor/EmbedEditor.svelte +93 -43
- package/components/editor/EmbedEditor.svelte.d.ts +3 -3
- package/components/editor/Icon.svelte +17 -0
- package/components/editor/Icon.svelte.d.ts +16 -0
- package/components/editor/ImageChooser.svelte +53 -34
- package/components/editor/ImageChooser.svelte.d.ts +3 -3
- package/components/editor/InlineCodeEditor.svelte +7 -4
- package/components/editor/InlineCodeEditor.svelte.d.ts +4 -4
- package/components/editor/LabelEditor.svelte +20 -11
- package/components/editor/LabelEditor.svelte.d.ts +4 -4
- package/components/editor/LanguageEditor.svelte +10 -7
- package/components/editor/LanguageEditor.svelte.d.ts +3 -3
- package/components/editor/LinkEditor.svelte +64 -39
- package/components/editor/LinkEditor.svelte.d.ts +4 -4
- package/components/editor/Note.svelte +3 -3
- package/components/editor/Note.svelte.d.ts +6 -2
- package/components/editor/PositionEditor.svelte +9 -6
- package/components/editor/PositionEditor.svelte.d.ts +4 -4
- package/components/editor/QuoteEditor.svelte +7 -2
- package/components/editor/QuoteEditor.svelte.d.ts +4 -4
- package/components/editor/Switch.svelte +55 -28
- package/components/editor/Switch.svelte.d.ts +4 -4
- package/components/editor/TableEditor.svelte +10 -0
- package/components/editor/TableEditor.svelte.d.ts +17 -0
- package/components/editor/TextEditor.svelte +83 -45
- package/components/editor/TextEditor.svelte.d.ts +5 -4
- package/components/editor/Toggle.svelte +11 -8
- package/components/editor/Toggle.svelte.d.ts +4 -4
- package/components/editor/Toolbar.svelte +192 -144
- package/components/editor/Toolbar.svelte.d.ts +5 -8
- package/components/editor/ToolbarGroup.svelte +18 -23
- package/components/editor/ToolbarGroup.svelte.d.ts +3 -4
- package/components/editor/ToolbarSpacer.svelte +8 -1
- package/components/editor/ToolbarSpacer.svelte.d.ts +6 -2
- package/components/editor/URLEditor.svelte +6 -8
- package/components/editor/URLEditor.svelte.d.ts +3 -3
- package/components/editor/UndoState.d.ts +3 -3
- package/components/editor/icons/annotate.svg +1 -0
- package/components/editor/icons/block.svg +1 -0
- package/components/editor/icons/bold.svg +1 -0
- package/components/editor/icons/bullets.svg +1 -0
- package/components/editor/icons/callout.svg +1 -0
- package/components/editor/icons/citation.svg +8 -0
- package/components/editor/icons/clear.svg +1 -0
- package/components/editor/icons/clipboard.svg +1 -0
- package/components/editor/icons/code.svg +1 -0
- package/components/editor/icons/columnafter.svg +1 -0
- package/components/editor/icons/columnbefore.svg +1 -0
- package/components/editor/icons/comment.svg +1 -0
- package/components/editor/icons/copy.svg +1 -0
- package/components/editor/icons/cut.svg +1 -0
- package/components/editor/icons/define.svg +7 -0
- package/components/editor/icons/deletecolumn.svg +1 -0
- package/components/editor/icons/deleterow.svg +1 -0
- package/components/editor/icons/footnote.svg +8 -0
- package/components/editor/icons/header1.svg +7 -0
- package/components/editor/icons/header2.svg +7 -0
- package/components/editor/icons/header3.svg +7 -0
- package/components/editor/icons/home.svg +1 -0
- package/components/editor/icons/indent.svg +1 -0
- package/components/editor/icons/italic.svg +1 -0
- package/components/editor/icons/label.svg +1 -0
- package/components/editor/icons/left.svg +1 -0
- package/components/editor/icons/level.svg +1 -0
- package/components/editor/icons/link.svg +1 -0
- package/components/editor/icons/list.svg +1 -0
- package/components/editor/icons/media.svg +1 -0
- package/components/editor/icons/middle.svg +1 -0
- package/components/editor/icons/numbers.svg +10 -0
- package/components/editor/icons/paragraph.svg +1 -0
- package/components/editor/icons/paste.svg +10 -0
- package/components/editor/icons/quote.svg +1 -0
- package/components/editor/icons/redo.svg +1 -0
- package/components/editor/icons/right.svg +1 -0
- package/components/editor/icons/rowabove.svg +1 -0
- package/components/editor/icons/rowbelow.svg +1 -0
- package/components/editor/icons/rule.svg +1 -0
- package/components/editor/icons/sub.svg +1 -0
- package/components/editor/icons/super.svg +1 -0
- package/components/editor/icons/table.svg +1 -0
- package/components/editor/icons/text.svg +1 -0
- package/components/editor/icons/time.svg +1 -0
- package/components/editor/icons/undo.svg +1 -0
- package/components/editor/icons/unindent.svg +1 -0
- package/components/editor/icons/unlink.svg +1 -0
- package/components/page/Acknowledgements.svelte +31 -22
- package/components/page/Acknowledgements.svelte.d.ts +4 -4
- package/components/page/Authors.svelte +34 -14
- package/components/page/Authors.svelte.d.ts +6 -6
- package/components/page/BulkReferenceEditor.svelte +53 -22
- package/components/page/BulkReferenceEditor.svelte.d.ts +4 -4
- package/components/page/Chapter.svelte +196 -141
- package/components/page/Chapter.svelte.d.ts +3 -3
- package/components/page/ChapterContext.d.ts +4 -4
- package/components/page/ChapterNumber.svelte +9 -0
- package/components/page/ChapterNumber.svelte.d.ts +27 -0
- package/components/page/ChapterTitle.svelte +16 -0
- package/components/page/ChapterTitle.svelte.d.ts +18 -0
- package/components/page/Contexts.d.ts +31 -20
- package/components/page/Contexts.js +47 -17
- package/components/page/DefinitionView.svelte +115 -86
- package/components/page/DefinitionView.svelte.d.ts +3 -3
- package/components/page/Description.svelte +27 -18
- package/components/page/Description.svelte.d.ts +4 -4
- package/components/page/Edition.svelte +127 -75
- package/components/page/Edition.svelte.d.ts +4 -4
- package/components/page/Editions.svelte +158 -0
- package/components/page/Editions.svelte.d.ts +14 -0
- package/components/page/Glossary.svelte +57 -48
- package/components/page/Glossary.svelte.d.ts +4 -4
- package/components/page/Header.svelte +129 -44
- package/components/page/Header.svelte.d.ts +6 -6
- package/components/page/Index.svelte +114 -80
- package/components/page/Index.svelte.d.ts +4 -4
- package/components/page/Instructions.svelte +18 -16
- package/components/page/Instructions.svelte.d.ts +4 -4
- package/components/page/License.svelte +29 -21
- package/components/page/License.svelte.d.ts +4 -4
- package/components/page/Loading.svelte +102 -12
- package/components/page/Loading.svelte.d.ts +6 -2
- package/components/page/Media.svelte +77 -51
- package/components/page/Media.svelte.d.ts +4 -4
- package/components/page/MediaPreview.svelte +26 -8
- package/components/page/MediaPreview.svelte.d.ts +3 -3
- package/components/page/Muted.svelte +10 -0
- package/components/page/Muted.svelte.d.ts +27 -0
- package/components/page/Outline.svelte +279 -59
- package/components/page/Outline.svelte.d.ts +3 -3
- package/components/page/Page.svelte +40 -9
- package/components/page/Page.svelte.d.ts +3 -3
- package/components/page/PageHeader.svelte +14 -0
- package/components/page/PageHeader.svelte.d.ts +18 -0
- package/components/page/PageParagraph.svelte +18 -0
- package/components/page/PageParagraph.svelte.d.ts +27 -0
- package/components/page/PossibleChapter.svelte +7 -7
- package/components/page/PossibleChapter.svelte.d.ts +4 -4
- package/components/page/PossibleReference.svelte +6 -11
- package/components/page/PossibleReference.svelte.d.ts +6 -7
- package/components/page/Print.svelte +27 -3
- package/components/page/Print.svelte.d.ts +4 -4
- package/components/page/Reference.svelte +256 -113
- package/components/page/Reference.svelte.d.ts +5 -5
- package/components/page/References.svelte +39 -47
- package/components/page/References.svelte.d.ts +4 -4
- package/components/page/Rows.svelte +54 -0
- package/components/page/Rows.svelte.d.ts +27 -0
- package/components/page/Search.svelte +86 -63
- package/components/page/Search.svelte.d.ts +4 -4
- package/components/page/Status.svelte +43 -35
- package/components/page/Status.svelte.d.ts +4 -9
- package/components/page/SubdomainEditor.svelte +40 -27
- package/components/page/SubdomainEditor.svelte.d.ts +4 -4
- package/components/page/TableOfContents.svelte +225 -190
- package/components/page/TableOfContents.svelte.d.ts +4 -4
- package/components/page/TableOfContentsImage.svelte +8 -8
- package/components/page/TableOfContentsImage.svelte.d.ts +3 -3
- package/components/page/TableOfContentsRow.svelte +96 -33
- package/components/page/TableOfContentsRow.svelte.d.ts +4 -4
- package/components/page/ThemeEditor.svelte +174 -39
- package/components/page/ThemeEditor.svelte.d.ts +4 -4
- package/components/page/ThemeEditorPreview.svelte +35 -23
- package/components/page/ThemeEditorPreview.svelte.d.ts +5 -5
- package/components/page/ThemeSetEditor.svelte +15 -13
- package/components/page/ThemeSetEditor.svelte.d.ts +4 -4
- package/components/page/ThemeVariableEditor.svelte +24 -15
- package/components/page/ThemeVariableEditor.svelte.d.ts +3 -3
- package/components/page/Title.svelte +12 -0
- package/components/page/Title.svelte.d.ts +27 -0
- package/components/page/Unknown.svelte +25 -21
- package/components/page/Unknown.svelte.d.ts +4 -4
- package/components/page/margins.js +50 -33
- package/index.d.ts +14 -0
- package/index.js +14 -0
- package/models/CRUD.d.ts +17 -0
- package/models/CRUD.js +207 -0
- package/models/Firebase.d.ts +1 -0
- package/models/Firebase.js +21 -15
- package/models/book/Book.d.ts +26 -30
- package/models/book/Book.js +120 -113
- package/models/book/BookMedia.d.ts +3 -3
- package/models/book/BookMedia.js +22 -16
- package/models/book/BookSaveStatus.d.ts +7 -0
- package/models/book/BookSaveStatus.js +8 -0
- package/models/book/Chapter.d.ts +46 -39
- package/models/book/Chapter.js +180 -198
- package/models/book/ChapterID.js +7 -7
- package/models/book/Definition.d.ts +1 -1
- package/models/book/Edition.d.ts +62 -60
- package/models/book/Edition.js +385 -303
- package/models/book/Reference.d.ts +24 -0
- package/models/book/Reference.js +78 -0
- package/models/book/Schema.d.ts +169 -0
- package/models/book/Schema.js +114 -0
- package/models/book/Theme.d.ts +44 -37
- package/models/book/Theme.js +452 -52
- package/models/book/ThemeColors.d.ts +1 -1
- package/models/book/Words.d.ts +2 -0
- package/models/book/Words.js +110 -0
- package/models/chapter/AtomNode.d.ts +4 -4
- package/models/chapter/AtomNode.js +20 -13
- package/models/chapter/BlockNode.d.ts +9 -10
- package/models/chapter/BlockNode.js +32 -13
- package/models/chapter/BlocksNode.d.ts +10 -10
- package/models/chapter/BlocksNode.js +315 -120
- package/models/chapter/BlocksNode.test.js +494 -228
- package/models/chapter/Bookkeeping.d.ts +1 -1
- package/models/chapter/CalloutNode.d.ts +3 -3
- package/models/chapter/CalloutNode.js +34 -12
- package/models/chapter/Caret.d.ts +9 -7
- package/models/chapter/Caret.js +11 -6
- package/models/chapter/ChapterNode.d.ts +11 -11
- package/models/chapter/ChapterNode.js +70 -33
- package/models/chapter/CitationsNode.d.ts +3 -3
- package/models/chapter/CitationsNode.js +31 -12
- package/models/chapter/CodeNode.d.ts +11 -6
- package/models/chapter/CodeNode.js +143 -34
- package/models/chapter/CommentNode.d.ts +5 -5
- package/models/chapter/CommentNode.js +29 -13
- package/models/chapter/DefinitionNode.d.ts +2 -2
- package/models/chapter/DefinitionNode.js +15 -7
- package/models/chapter/Edit.d.ts +3 -3
- package/models/chapter/EmbedNode.d.ts +9 -5
- package/models/chapter/EmbedNode.js +108 -35
- package/models/chapter/ErrorNode.d.ts +2 -2
- package/models/chapter/ErrorNode.js +34 -12
- package/models/chapter/FootnoteNode.d.ts +5 -5
- package/models/chapter/FootnoteNode.js +34 -16
- package/models/chapter/FormatNode.d.ts +10 -10
- package/models/chapter/FormatNode.js +237 -106
- package/models/chapter/FormatNode.test.js +87 -45
- package/models/chapter/InlineCodeNode.d.ts +2 -2
- package/models/chapter/InlineCodeNode.js +22 -9
- package/models/chapter/LabelNode.d.ts +4 -4
- package/models/chapter/LabelNode.js +31 -13
- package/models/chapter/LinkNode.d.ts +2 -2
- package/models/chapter/LinkNode.js +21 -9
- package/models/chapter/ListNode.d.ts +8 -8
- package/models/chapter/ListNode.js +99 -38
- package/models/chapter/ListNode.test.js +29 -24
- package/models/chapter/MetadataNode.d.ts +3 -3
- package/models/chapter/MetadataNode.js +13 -5
- package/models/chapter/Node.d.ts +5 -3
- package/models/chapter/Node.js +76 -29
- package/models/chapter/Node.test.js +20 -18
- package/models/chapter/ParagraphNode.d.ts +6 -6
- package/models/chapter/ParagraphNode.js +84 -29
- package/models/chapter/ParagraphNode.test.js +22 -13
- package/models/chapter/Parser.d.ts +25 -25
- package/models/chapter/Parser.js +201 -189
- package/models/chapter/Parser.test.js +16 -16
- package/models/chapter/Position.d.ts +1 -1
- package/models/chapter/QuoteNode.d.ts +6 -6
- package/models/chapter/QuoteNode.js +61 -23
- package/models/chapter/RootNode.d.ts +4 -4
- package/models/chapter/RuleNode.d.ts +2 -2
- package/models/chapter/RuleNode.js +31 -11
- package/models/chapter/TableNode.d.ts +8 -6
- package/models/chapter/TableNode.js +89 -34
- package/models/chapter/TableNode.test.js +22 -24
- package/models/chapter/TextNode.d.ts +6 -6
- package/models/chapter/TextNode.js +72 -32
- package/models/chapter/TextNode.test.js +4 -4
- package/models/loadEdition.d.ts +1 -1
- package/models/loadEdition.js +10 -6
- package/package.json +104 -25
- package/util/getSubdomain.js +8 -6
- package/util/isMobile.js +1 -1
- package/util/mineReference.d.ts +3 -2
- package/util/mineReference.js +67 -29
- package/util/scrollToEyeLevel.js +6 -1
- package/components/chapter/renderPosition.d.ts +0 -3
- package/components/chapter/renderPosition.js +0 -4
- package/components/editor/ToolbarIcon.svelte +0 -22
- package/components/editor/ToolbarIcon.svelte.d.ts +0 -16
- package/components/page/Alert.svelte +0 -11
- package/components/page/Alert.svelte.d.ts +0 -23
- package/components/page/Revisions.svelte +0 -124
- package/components/page/Revisions.svelte.d.ts +0 -14
- package/models/BookLoader.d.ts +0 -2
- package/models/BookLoader.js +0 -67
- package/models/Firestore.d.ts +0 -22
- package/models/Firestore.js +0 -194
- package/models/chapter/ReferenceNode.d.ts +0 -29
- package/models/chapter/ReferenceNode.js +0 -48
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} LeadProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} LeadEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} LeadSlots */
|
|
4
|
+
export default class Lead extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type LeadProps = typeof __propDef.props;
|
|
13
|
+
export type LeadEvents = typeof __propDef.events;
|
|
14
|
+
export type LeadSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponentTyped } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
[x: string]: never;
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script>export let to;
|
|
2
|
+
export let before = undefined;
|
|
3
|
+
export let title = undefined;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<a
|
|
7
|
+
href={to}
|
|
8
|
+
{title}
|
|
9
|
+
on:click={() => (before ? before() : undefined)}
|
|
10
|
+
target={to.startsWith('http') ? '_blank' : null}><slot /></a
|
|
11
|
+
>
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
a {
|
|
15
|
+
color: var(--app-interactive-color);
|
|
16
|
+
font-family: var(--app-font);
|
|
17
|
+
font-weight: 400;
|
|
18
|
+
text-decoration: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
a:hover {
|
|
22
|
+
text-decoration: underline;
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
to: string;
|
|
5
|
+
before?: Function | undefined;
|
|
6
|
+
title?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type LinkProps = typeof __propDef.props;
|
|
16
|
+
export type LinkEvents = typeof __propDef.events;
|
|
17
|
+
export type LinkSlots = typeof __propDef.slots;
|
|
18
|
+
export default class Link extends SvelteComponentTyped<LinkProps, LinkEvents, LinkSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script>export let options;
|
|
2
|
+
export let changed;
|
|
3
|
+
export let value;
|
|
4
|
+
export let label;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<select bind:value on:change={() => changed(value)} aria-label={label}>
|
|
8
|
+
<option value="" selected={value === ''} />
|
|
9
|
+
{#each options as option}
|
|
10
|
+
<option value={option[1]} selected={value === option[1]}
|
|
11
|
+
>{option[0]}</option
|
|
12
|
+
>
|
|
13
|
+
{/each}
|
|
14
|
+
</select>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
select {
|
|
18
|
+
border: none;
|
|
19
|
+
background-color: var(--app-chrome-background);
|
|
20
|
+
padding: var(--app-chrome-padding);
|
|
21
|
+
font-family: var(--app-font);
|
|
22
|
+
font-size: var(--app-chrome-font-size);
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
options: [string, string][];
|
|
5
|
+
changed: (value: string) => void;
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export type OptionsProps = typeof __propDef.props;
|
|
15
|
+
export type OptionsEvents = typeof __propDef.events;
|
|
16
|
+
export type OptionsSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Options extends SvelteComponentTyped<OptionsProps, OptionsEvents, OptionsSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>export let aside = false;
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<p class={aside ? 'aside' : ''}><slot /></p>
|
|
5
|
+
|
|
6
|
+
<style>
|
|
7
|
+
p {
|
|
8
|
+
font-family: var(--app-font);
|
|
9
|
+
font-size: var(--app-font-size);
|
|
10
|
+
font-weight: 300;
|
|
11
|
+
line-height: var(--app-line-height);
|
|
12
|
+
margin-top: 0;
|
|
13
|
+
margin-bottom: var(--app-text-spacing);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.aside {
|
|
17
|
+
font-style: italic;
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
aside?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {
|
|
10
|
+
default: {};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type ParagraphProps = typeof __propDef.props;
|
|
14
|
+
export type ParagraphEvents = typeof __propDef.events;
|
|
15
|
+
export type ParagraphSlots = typeof __propDef.slots;
|
|
16
|
+
export default class Paragraph extends SvelteComponentTyped<ParagraphProps, ParagraphEvents, ParagraphSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<section>
|
|
2
|
+
<table>
|
|
3
|
+
<slot />
|
|
4
|
+
</table>
|
|
5
|
+
</section>
|
|
6
|
+
|
|
7
|
+
<style>
|
|
8
|
+
section {
|
|
9
|
+
width: 100%;
|
|
10
|
+
overflow-x: auto;
|
|
11
|
+
margin-top: var(--app-text-spacing);
|
|
12
|
+
margin-bottom: var(--app-text-spacing);
|
|
13
|
+
border-top: var(--app-chrome-border-size) solid var(--app-border-color);
|
|
14
|
+
border-bottom: var(--app-chrome-border-size) solid
|
|
15
|
+
var(--app-border-color);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
table {
|
|
19
|
+
width: 100%;
|
|
20
|
+
border-collapse: collapse;
|
|
21
|
+
clear: both;
|
|
22
|
+
border-collapse: separate;
|
|
23
|
+
border-spacing: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
table :global(td:not(:first-of-type)) {
|
|
27
|
+
padding: var(--app-chrome-padding);
|
|
28
|
+
vertical-align: top;
|
|
29
|
+
font-family: var(--app-font);
|
|
30
|
+
font-weight: 300;
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TableProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TableEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TableSlots */
|
|
4
|
+
export default class Table extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type TableProps = typeof __propDef.props;
|
|
13
|
+
export type TableEvents = typeof __propDef.events;
|
|
14
|
+
export type TableSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponentTyped } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
[x: string]: never;
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script>export let text = '';
|
|
2
|
+
export let autocomplete = null;
|
|
3
|
+
export let type;
|
|
4
|
+
export let placeholder;
|
|
5
|
+
export let disabled;
|
|
6
|
+
let input;
|
|
7
|
+
export function value() {
|
|
8
|
+
return text;
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<input
|
|
13
|
+
{autocomplete}
|
|
14
|
+
{type}
|
|
15
|
+
{placeholder}
|
|
16
|
+
{disabled}
|
|
17
|
+
bind:this={input}
|
|
18
|
+
on:input={() => (text = input.value)}
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
input {
|
|
23
|
+
font-family: var(--app-font);
|
|
24
|
+
font-size: var(--app-chrome-font-size);
|
|
25
|
+
color: var(--app-font-color);
|
|
26
|
+
padding: var(--app-chrome-padding);
|
|
27
|
+
font-size: var(--app-chrome-font-size);
|
|
28
|
+
border: none;
|
|
29
|
+
border-bottom: var(--app-chrome-border-size) solid
|
|
30
|
+
var(--app-border-color);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
input:focus {
|
|
34
|
+
border-bottom-color: var(--app-interactive-color);
|
|
35
|
+
outline: none;
|
|
36
|
+
}
|
|
37
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
text?: string | undefined;
|
|
5
|
+
autocomplete?: string | null | undefined;
|
|
6
|
+
type: string;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
value?: (() => string) | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type TextInputProps = typeof __propDef.props;
|
|
17
|
+
export type TextInputEvents = typeof __propDef.events;
|
|
18
|
+
export type TextInputSlots = typeof __propDef.slots;
|
|
19
|
+
export default class TextInput extends SvelteComponentTyped<TextInputProps, TextInputEvents, TextInputSlots> {
|
|
20
|
+
get value(): () => string;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} WritingProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} WritingEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} WritingSlots */
|
|
4
|
+
export default class Writing extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type WritingProps = typeof __propDef.props;
|
|
13
|
+
export type WritingEvents = typeof __propDef.events;
|
|
14
|
+
export type WritingSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponentTyped } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
[x: string]: never;
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
1
3
|
<script>import { getCaret } from '../page/Contexts';
|
|
2
4
|
export let node;
|
|
3
5
|
let caret = getCaret();
|
|
@@ -5,12 +7,20 @@ let caret = getCaret();
|
|
|
5
7
|
$: selected = $caret && $caret.range && $caret.range.start.node === node;
|
|
6
8
|
function handleMouseDown() {
|
|
7
9
|
// Select this so that the view stays focused.
|
|
8
|
-
$caret?.setCaret({
|
|
10
|
+
$caret?.setCaret({
|
|
11
|
+
start: { node: node, index: 0 },
|
|
12
|
+
end: { node: node, index: 0 },
|
|
13
|
+
});
|
|
9
14
|
}
|
|
10
15
|
</script>
|
|
11
16
|
|
|
12
17
|
<!-- Prevent the editor from receiving the click. -->
|
|
13
|
-
<span
|
|
18
|
+
<span
|
|
19
|
+
class={`bookish-editor-atom ${
|
|
20
|
+
selected ? 'bookish-editor-atom-selected' : ''
|
|
21
|
+
} ${$caret?.focused ? 'bookish-editor-atom-selected-focused' : ''}`}
|
|
22
|
+
on:mousedown|stopPropagation|preventDefault={handleMouseDown}><slot /></span
|
|
23
|
+
>
|
|
14
24
|
|
|
15
25
|
<style>
|
|
16
26
|
.bookish-editor-atom {
|
|
@@ -29,8 +39,12 @@ function handleMouseDown() {
|
|
|
29
39
|
}
|
|
30
40
|
|
|
31
41
|
@keyframes atom-selected {
|
|
32
|
-
from,
|
|
33
|
-
|
|
42
|
+
from,
|
|
43
|
+
to {
|
|
44
|
+
outline-width: 2px;
|
|
45
|
+
}
|
|
46
|
+
50% {
|
|
47
|
+
outline-width: 4px;
|
|
48
|
+
}
|
|
34
49
|
}
|
|
35
|
-
|
|
36
|
-
</style>
|
|
50
|
+
</style>
|
|
@@ -11,9 +11,9 @@ declare const __propDef: {
|
|
|
11
11
|
default: {};
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export type AtomProps = typeof __propDef.props;
|
|
15
|
+
export type AtomEvents = typeof __propDef.events;
|
|
16
|
+
export type AtomSlots = typeof __propDef.slots;
|
|
17
17
|
export default class Atom extends SvelteComponentTyped<AtomProps, AtomEvents, AtomSlots> {
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
3
|
+
<script>import CalloutNode from '../../models/chapter/CalloutNode';
|
|
4
|
+
import CodeNode from '../../models/chapter/CodeNode';
|
|
5
|
+
import EmbedNode from '../../models/chapter/EmbedNode';
|
|
6
|
+
import ErrorNode from '../../models/chapter/ErrorNode';
|
|
7
|
+
import ListNode from '../../models/chapter/ListNode';
|
|
8
|
+
import ParagraphNode from '../../models/chapter/ParagraphNode';
|
|
9
|
+
import QuoteNode from '../../models/chapter/QuoteNode';
|
|
10
|
+
import RuleNode from '../../models/chapter/RuleNode';
|
|
11
|
+
import TableNode from '../../models/chapter/TableNode';
|
|
12
|
+
import Callout from './Callout.svelte';
|
|
13
|
+
import CaptionedCode from './CaptionedCode.svelte';
|
|
14
|
+
import Embed from './Embed.svelte';
|
|
15
|
+
import ErrorMessage from './ErrorMessage.svelte';
|
|
16
|
+
import List from './List.svelte';
|
|
17
|
+
import Paragraph from './Paragraph.svelte';
|
|
18
|
+
import Quote from './Quote.svelte';
|
|
19
|
+
import Rule from './Rule.svelte';
|
|
20
|
+
import Table from './Table.svelte';
|
|
21
|
+
import Problem from './Problem.svelte';
|
|
19
22
|
export let node;
|
|
20
23
|
</script>
|
|
21
24
|
|
|
@@ -28,5 +31,5 @@ export let node;
|
|
|
28
31
|
{:else if node instanceof ErrorNode}<ErrorMessage {node} />
|
|
29
32
|
{:else if node instanceof RuleNode}<Rule {node} />
|
|
30
33
|
{:else if node instanceof TableNode}<Table {node} />
|
|
31
|
-
{:else}<p
|
|
32
|
-
{/if}
|
|
34
|
+
{:else}<p><Problem>Unknown node type</Problem></p>
|
|
35
|
+
{/if}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type BlockNode from
|
|
2
|
+
import type BlockNode from '../../models/chapter/BlockNode';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
node: BlockNode;
|
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
12
|
+
export type BlockProps = typeof __propDef.props;
|
|
13
|
+
export type BlockEvents = typeof __propDef.events;
|
|
14
|
+
export type BlockSlots = typeof __propDef.slots;
|
|
15
15
|
export default class Block extends SvelteComponentTyped<BlockProps, BlockEvents, BlockSlots> {
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1,10 +1,41 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
3
|
+
<script>import Block from './Block.svelte';
|
|
4
|
+
import Positioned from './Positioned.svelte';
|
|
3
5
|
export let node;
|
|
4
6
|
</script>
|
|
5
7
|
|
|
6
|
-
<
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
<Positioned position={node.getPosition()}>
|
|
9
|
+
<section class={'bookish-callout'} data-nodeid={node.nodeID}>
|
|
10
|
+
{#each node.getBlocks() as element (element.nodeID)}
|
|
11
|
+
<Block node={element} />
|
|
12
|
+
{/each}
|
|
13
|
+
</section>
|
|
14
|
+
</Positioned>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
.bookish-callout {
|
|
18
|
+
border: none;
|
|
19
|
+
border-top: 2px solid var(--bookish-border-color-bold);
|
|
20
|
+
border-bottom: 2px solid var(--bookish-border-color-bold);
|
|
21
|
+
margin: var(--bookish-paragraph-spacing);
|
|
22
|
+
padding-left: 0;
|
|
23
|
+
padding-right: 0;
|
|
24
|
+
padding-top: var(--bookish-paragraph-spacing);
|
|
25
|
+
padding-bottom: var(--bookish-paragraph-spacing);
|
|
26
|
+
line-height: var(--bookish-paragraph-line-height-tight);
|
|
27
|
+
clear: both;
|
|
28
|
+
position: relative;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.bookish-callout :global(h2),
|
|
32
|
+
.bookish-callout :global(h3),
|
|
33
|
+
.bookish-callout :global(h4) {
|
|
34
|
+
margin-top: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.bookish-callout :global(ol),
|
|
38
|
+
.bookish-callout :global(ul) {
|
|
39
|
+
padding-left: 1rem;
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type CalloutNode from
|
|
2
|
+
import type CalloutNode from '../../models/chapter/CalloutNode';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
node: CalloutNode;
|
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
12
|
+
export type CalloutProps = typeof __propDef.props;
|
|
13
|
+
export type CalloutEvents = typeof __propDef.events;
|
|
14
|
+
export type CalloutSlots = typeof __propDef.slots;
|
|
15
15
|
export default class Callout extends SvelteComponentTyped<CalloutProps, CalloutEvents, CalloutSlots> {
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1,34 +1,77 @@
|
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
1
3
|
<script>import Code from './Code.svelte';
|
|
2
4
|
import Python from './Python.svelte';
|
|
3
|
-
import Format from './Format.svelte';
|
|
4
5
|
import Text from './Text.svelte';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
6
|
+
import { isEditable } from '../page/Contexts';
|
|
7
|
+
import Figure from './Figure.svelte';
|
|
8
|
+
import { getCaret } from '../page/Contexts';
|
|
7
9
|
export let node;
|
|
8
|
-
$: caption = node.getCaption();
|
|
9
10
|
$: language = node.getLanguage();
|
|
10
11
|
let editable = isEditable();
|
|
11
12
|
// const languages = [ "C", "C++", "CSS", "Go", "HTML", "Java", "JavaScript", "Markdown", "Plaintext", "Python", "TypeScript" ];
|
|
13
|
+
let caret = getCaret();
|
|
14
|
+
$: inside =
|
|
15
|
+
$caret?.range?.start.node === node.getCodeNode() ||
|
|
16
|
+
$caret?.range?.end.node === node.getCodeNode();
|
|
12
17
|
</script>
|
|
13
18
|
|
|
14
|
-
<
|
|
15
|
-
{#if editable
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
<Figure {node} caption={node.getCaption()}>
|
|
20
|
+
{#if editable}
|
|
21
|
+
<div class="container">
|
|
22
|
+
<code
|
|
23
|
+
class={`bookish-code bookish-code-block language-${language} ${
|
|
24
|
+
!inside ? 'hidden' : ''
|
|
25
|
+
}`}
|
|
26
|
+
>
|
|
27
|
+
<Text node={node.getCodeNode()} />
|
|
28
|
+
</code>
|
|
29
|
+
<div class="code" class:inside>
|
|
30
|
+
<Code
|
|
31
|
+
editable={false}
|
|
32
|
+
inline={false}
|
|
33
|
+
language={node.getLanguage()}
|
|
34
|
+
nodeID={node.getCodeNode().nodeID}>{node.getCode()}</Code
|
|
35
|
+
>
|
|
28
36
|
</div>
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
</div>
|
|
38
|
+
{:else if node.getLanguage() === 'python' && node.isExecutable()}
|
|
39
|
+
<Python {node} startCode={node.getCode()} />
|
|
40
|
+
{:else}
|
|
41
|
+
<Code
|
|
42
|
+
editable={false}
|
|
43
|
+
inline={false}
|
|
44
|
+
language={node.getLanguage()}
|
|
45
|
+
nodeID={node.getCodeNode().nodeID}>{node.getCode()}</Code
|
|
46
|
+
>
|
|
33
47
|
{/if}
|
|
34
|
-
|
|
48
|
+
{#if node.getLanguage() !== 'plaintext'}<aside class="language"
|
|
49
|
+
>{node.getLanguage()}</aside
|
|
50
|
+
>{/if}
|
|
51
|
+
</Figure>
|
|
52
|
+
|
|
53
|
+
<style>
|
|
54
|
+
.language {
|
|
55
|
+
float: right;
|
|
56
|
+
margin-top: 0;
|
|
57
|
+
font-size: small;
|
|
58
|
+
color: gray;
|
|
59
|
+
margin-right: 0.5em;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.bookish-code.hidden {
|
|
63
|
+
opacity: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.container {
|
|
67
|
+
position: relative;
|
|
68
|
+
}
|
|
69
|
+
.code {
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: 0;
|
|
72
|
+
width: 100%;
|
|
73
|
+
}
|
|
74
|
+
.code.inside {
|
|
75
|
+
display: none;
|
|
76
|
+
}
|
|
77
|
+
</style>
|
|
@@ -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 {};
|