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,31 +1,54 @@
|
|
|
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 {
|
|
5
|
-
import { afterUpdate } from
|
|
6
|
+
import { getChapter, getEdition, getCaret, } from '../page/Contexts';
|
|
7
|
+
import { afterUpdate } from 'svelte';
|
|
6
8
|
export let node;
|
|
7
9
|
$: content = node.getMeta();
|
|
8
10
|
let caret = getCaret();
|
|
9
11
|
let chapter = getChapter();
|
|
10
12
|
let edition = getEdition();
|
|
11
13
|
// What footnote number is this?
|
|
12
|
-
$:
|
|
13
|
-
|
|
14
|
-
$:
|
|
15
|
-
$:
|
|
14
|
+
$: ast =
|
|
15
|
+
$edition && $chapter ? $chapter.chapter.getAST($edition) : undefined;
|
|
16
|
+
$: number = ast?.getFootnotes().indexOf(node);
|
|
17
|
+
$: letter =
|
|
18
|
+
number === undefined ? undefined : $edition?.getFootnoteSymbol(number);
|
|
19
|
+
$: focused =
|
|
20
|
+
ast &&
|
|
21
|
+
$caret &&
|
|
22
|
+
$caret.range &&
|
|
23
|
+
$caret.range.start.node.hasAncestor(ast, node);
|
|
16
24
|
// Position the marginals on every render.
|
|
17
25
|
afterUpdate(() => $chapter?.layoutMarginals());
|
|
18
26
|
</script>
|
|
19
27
|
|
|
20
|
-
<Atom
|
|
28
|
+
<Atom {node}>
|
|
21
29
|
<span class={`bookish-footnote-link`} data-nodeid={node.nodeID}>
|
|
22
|
-
<Marginal
|
|
23
|
-
|
|
30
|
+
<Marginal
|
|
31
|
+
{node}
|
|
32
|
+
id={'footnote-' + number}
|
|
33
|
+
label="footnote, press escape to edit"
|
|
34
|
+
>
|
|
35
|
+
<sup slot="interactor" class="bookish-footnote-symbol">{letter}</sup
|
|
36
|
+
>
|
|
24
37
|
<!-- We prevent default on the span to prevent mouse events from bubbling up to the footnote symbol. This is key for two reasons:
|
|
25
38
|
1) clicks on the footnote select the footnote atom node itself
|
|
26
39
|
2) we want to be able to click on footnote text and we can't do that if the footnote sets the caret to the atom after clicks. -->
|
|
27
|
-
<span
|
|
28
|
-
|
|
40
|
+
<span
|
|
41
|
+
slot="content"
|
|
42
|
+
class={`bookish-footnote ${
|
|
43
|
+
focused ? 'bookish-footnote-focused' : ''
|
|
44
|
+
}`}
|
|
45
|
+
on:mousedown|preventDefault
|
|
46
|
+
>
|
|
47
|
+
<sup class="bookish-footnote-symbol">{letter}</sup><Format
|
|
48
|
+
node={content}
|
|
49
|
+
placeholder="footnote"
|
|
50
|
+
/></span
|
|
51
|
+
>
|
|
29
52
|
</Marginal>
|
|
30
53
|
</span>
|
|
31
54
|
</Atom>
|
|
@@ -34,4 +57,44 @@ afterUpdate(() => $chapter?.layoutMarginals());
|
|
|
34
57
|
.bookish-footnote-focused {
|
|
35
58
|
outline: 2px solid var(--bookish-highlight-color);
|
|
36
59
|
}
|
|
37
|
-
|
|
60
|
+
|
|
61
|
+
.bookish-footnote {
|
|
62
|
+
font-family: var(--bookish-paragraph-font-family);
|
|
63
|
+
font-size: var(--bookish-small-font-size);
|
|
64
|
+
font-style: normal;
|
|
65
|
+
color: var(--bookish-paragraph-color);
|
|
66
|
+
font-weight: 300;
|
|
67
|
+
font-size: var(--bookish-small-font-size);
|
|
68
|
+
line-height: 1.5em;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.bookish-footnote-symbol {
|
|
72
|
+
font-family: var(--bookish-paragraph-font-family);
|
|
73
|
+
font-weight: normal;
|
|
74
|
+
color: var(--bookish-link-color);
|
|
75
|
+
position: relative;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* This enables us to layout the numbers and letters in a neat right-aligned floating grid. */
|
|
79
|
+
.bookish-footnote {
|
|
80
|
+
position: relative;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.bookish-footnote {
|
|
84
|
+
display: block;
|
|
85
|
+
line-height: var(--bookish-paragraph-line-height-tight);
|
|
86
|
+
margin-left: 1rem;
|
|
87
|
+
margin-bottom: 1rem;
|
|
88
|
+
text-align: left;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.bookish-footnote .bookish-footnote-symbol {
|
|
92
|
+
display: block;
|
|
93
|
+
float: left;
|
|
94
|
+
margin-top: -0.5em;
|
|
95
|
+
position: absolute;
|
|
96
|
+
left: -1.75em;
|
|
97
|
+
text-align: right;
|
|
98
|
+
width: 1.5em; /* Just enough space for 2 digits, a bit of a hack */
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type FootnoteNode from
|
|
2
|
+
import type FootnoteNode from '../../models/chapter/FootnoteNode';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
node: FootnoteNode;
|
|
@@ -11,9 +11,9 @@ declare const __propDef: {
|
|
|
11
11
|
};
|
|
12
12
|
slots: {};
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export type FootnoteProps = typeof __propDef.props;
|
|
15
|
+
export type FootnoteEvents = typeof __propDef.events;
|
|
16
|
+
export type FootnoteSlots = typeof __propDef.slots;
|
|
17
17
|
export default class Footnote extends SvelteComponentTyped<FootnoteProps, FootnoteEvents, FootnoteSlots> {
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -1,57 +1,82 @@
|
|
|
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
|
|
19
|
-
import
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
3
|
+
<script>import FormatNode from '../../models/chapter/FormatNode';
|
|
4
|
+
import CitationsNode from '../../models/chapter/CitationsNode';
|
|
5
|
+
import CommentNode from '../../models/chapter/CommentNode';
|
|
6
|
+
import DefinitionNode from '../../models/chapter/DefinitionNode';
|
|
7
|
+
import FootnoteNode from '../../models/chapter/FootnoteNode';
|
|
8
|
+
import InlineCodeNode from '../../models/chapter/InlineCodeNode';
|
|
9
|
+
import LabelNode from '../../models/chapter/LabelNode';
|
|
10
|
+
import LinkNode from '../../models/chapter/LinkNode';
|
|
11
|
+
import TextNode from '../../models/chapter/TextNode';
|
|
12
|
+
import Problem from './Problem.svelte';
|
|
13
|
+
import Citations from './Citations.svelte';
|
|
14
|
+
import Definition from './Definition.svelte';
|
|
15
|
+
import Footnote from './Footnote.svelte';
|
|
16
|
+
import InlineCode from './InlineCode.svelte';
|
|
17
|
+
import Label from './Label.svelte';
|
|
18
|
+
import Link from './Link.svelte';
|
|
19
|
+
import Comment from './Comment.svelte';
|
|
20
|
+
import Text from './Text.svelte';
|
|
21
|
+
import Format from './Format.svelte';
|
|
22
|
+
import { isChapterEditable } from '../page/Contexts';
|
|
20
23
|
export let node;
|
|
24
|
+
export let editable = false;
|
|
21
25
|
export let placeholder = undefined;
|
|
22
|
-
let editable = isEditable();
|
|
23
26
|
$: format = node.getFormat();
|
|
24
27
|
$: tag =
|
|
25
|
-
format ===
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
format === '*'
|
|
29
|
+
? 'strong'
|
|
30
|
+
: format === '_'
|
|
31
|
+
? 'em'
|
|
32
|
+
: format === '^'
|
|
33
|
+
? 'sup'
|
|
34
|
+
: format === 'v'
|
|
35
|
+
? 'sub'
|
|
36
|
+
: 'span';
|
|
37
|
+
$: showPlaceholder =
|
|
38
|
+
node.isEmptyText() &&
|
|
39
|
+
placeholder !== undefined &&
|
|
40
|
+
(editable || isChapterEditable());
|
|
31
41
|
</script>
|
|
32
42
|
|
|
33
|
-
<svelte:element
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
<svelte:element
|
|
44
|
+
this={tag}
|
|
45
|
+
data-nodeid={node.nodeID}
|
|
46
|
+
class={`format ${showPlaceholder ? 'bookish-editor-placeholder' : ''}`}
|
|
47
|
+
>
|
|
48
|
+
{#each node.getSegments() as segment (segment.nodeID)}
|
|
49
|
+
{#if segment instanceof TextNode}<Text
|
|
50
|
+
node={segment}
|
|
51
|
+
placeholder={node.getSegments().length === 1
|
|
52
|
+
? placeholder
|
|
53
|
+
: undefined}
|
|
54
|
+
/>
|
|
55
|
+
{:else if segment instanceof InlineCodeNode}<InlineCode
|
|
56
|
+
node={segment}
|
|
57
|
+
/>
|
|
37
58
|
{:else if segment instanceof LinkNode}<Link node={segment} />
|
|
38
59
|
{:else if segment instanceof CitationsNode}<Citations node={segment} />
|
|
39
|
-
{:else if segment instanceof DefinitionNode}<Definition
|
|
60
|
+
{:else if segment instanceof DefinitionNode}<Definition
|
|
61
|
+
node={segment}
|
|
62
|
+
/>
|
|
40
63
|
{:else if segment instanceof FootnoteNode}<Footnote node={segment} />
|
|
41
64
|
{:else if segment instanceof LabelNode}<Label node={segment} />
|
|
42
65
|
{:else if segment instanceof CommentNode}<Comment node={segment} />
|
|
43
66
|
{:else if segment instanceof FormatNode}<Format node={segment} />
|
|
44
|
-
{:else}<
|
|
67
|
+
{:else}<Problem>Unknown segment type node={segment}</Problem>
|
|
45
68
|
{/if}
|
|
46
69
|
{/each}
|
|
47
|
-
{#if showPlaceholder }
|
|
48
|
-
{ placeholder }
|
|
49
|
-
{/if}
|
|
50
70
|
</svelte:element>
|
|
51
71
|
|
|
52
72
|
<style>
|
|
53
73
|
.bookish-editor-placeholder {
|
|
54
|
-
color: var(--
|
|
74
|
+
color: var(--app-muted-color);
|
|
55
75
|
font-style: italic;
|
|
56
|
-
}
|
|
57
|
-
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
strong,
|
|
79
|
+
b {
|
|
80
|
+
font-weight: var(--bookish-bold-font-weight);
|
|
81
|
+
}
|
|
82
|
+
</style>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import FormatNode from
|
|
2
|
+
import FormatNode from '../../models/chapter/FormatNode';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
node: FormatNode;
|
|
6
|
+
editable?: boolean | undefined;
|
|
6
7
|
placeholder?: string | undefined;
|
|
7
8
|
};
|
|
8
9
|
events: {
|
|
@@ -10,9 +11,9 @@ declare const __propDef: {
|
|
|
10
11
|
};
|
|
11
12
|
slots: {};
|
|
12
13
|
};
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type FormatProps = typeof __propDef.props;
|
|
15
|
+
export type FormatEvents = typeof __propDef.events;
|
|
16
|
+
export type FormatSlots = typeof __propDef.slots;
|
|
16
17
|
export default class Format extends SvelteComponentTyped<FormatProps, FormatEvents, FormatSlots> {
|
|
17
18
|
}
|
|
18
19
|
export {};
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
<
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
3
|
+
<script>import { isChapterEditable } from '../page/Contexts';
|
|
2
4
|
import Code from './Code.svelte';
|
|
3
5
|
import Text from './Text.svelte';
|
|
4
6
|
export let node;
|
|
5
|
-
let editable =
|
|
7
|
+
let editable = isChapterEditable();
|
|
6
8
|
</script>
|
|
7
9
|
|
|
8
|
-
{#if editable
|
|
9
|
-
<span
|
|
10
|
+
{#if editable}
|
|
11
|
+
<span
|
|
12
|
+
class="bookish-code bookish-code-inline hljs"
|
|
13
|
+
data-nodeid={node.nodeID}><Text node={node.getText()} /></span
|
|
14
|
+
>
|
|
10
15
|
{:else}
|
|
11
|
-
<Code
|
|
12
|
-
{
|
|
16
|
+
<Code
|
|
17
|
+
editable={false}
|
|
18
|
+
inline={true}
|
|
19
|
+
language={node.getMeta()}
|
|
20
|
+
nodeID={node.getText().nodeID}>{node.getText().getText()}</Code
|
|
21
|
+
>
|
|
22
|
+
{/if}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type InlineCodeNode from
|
|
2
|
+
import type InlineCodeNode from '../../models/chapter/InlineCodeNode';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
node: InlineCodeNode;
|
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
12
|
+
export type InlineCodeProps = typeof __propDef.props;
|
|
13
|
+
export type InlineCodeEvents = typeof __propDef.events;
|
|
14
|
+
export type InlineCodeSlots = typeof __propDef.slots;
|
|
15
15
|
export default class InlineCode extends SvelteComponentTyped<InlineCodeProps, InlineCodeEvents, InlineCodeSlots> {
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1,20 +1,49 @@
|
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
1
3
|
<script>import Atom from './Atom.svelte';
|
|
2
|
-
import { getChapter,
|
|
4
|
+
import { getChapter, getEdition, isChapterEditable, } from '../page/Contexts';
|
|
5
|
+
import Problem from './Problem.svelte';
|
|
3
6
|
export let node;
|
|
4
|
-
let editable =
|
|
7
|
+
let editable = isChapterEditable();
|
|
5
8
|
let chapter = getChapter();
|
|
6
|
-
|
|
7
|
-
$:
|
|
9
|
+
let edition = getEdition();
|
|
10
|
+
$: ast =
|
|
11
|
+
$edition && $chapter ? $chapter.chapter.getAST($edition) : undefined;
|
|
12
|
+
$: duplicate =
|
|
13
|
+
ast === undefined
|
|
14
|
+
? false
|
|
15
|
+
: ast.getLabels().filter((l) => l.getMeta() === node.getMeta())
|
|
16
|
+
.length > 1;
|
|
8
17
|
</script>
|
|
9
18
|
|
|
10
|
-
<Atom
|
|
11
|
-
<span
|
|
12
|
-
class={
|
|
19
|
+
<Atom {node}>
|
|
20
|
+
<span
|
|
21
|
+
class={'bookish-label' +
|
|
22
|
+
($chapter?.highlightedID === node.getMeta()
|
|
23
|
+
? ' bookish-content-highlight'
|
|
24
|
+
: '')}
|
|
13
25
|
id={node.getMeta()}
|
|
14
26
|
data-nodeid={node.nodeID}
|
|
15
27
|
>
|
|
16
28
|
{#if editable}
|
|
17
|
-
|
|
29
|
+
{#if duplicate}
|
|
30
|
+
<Problem>Duplicate label {node.getMeta()}</Problem>
|
|
31
|
+
{:else}
|
|
32
|
+
<span>•<code>{node.getMeta()}</code></span>
|
|
33
|
+
{/if}
|
|
18
34
|
{/if}
|
|
19
35
|
</span>
|
|
20
|
-
</Atom>
|
|
36
|
+
</Atom>
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
/* A little circle at the point of the annotation */
|
|
40
|
+
.bookish-label.bookish-content-highlight {
|
|
41
|
+
display: inline-block;
|
|
42
|
+
width: 3em;
|
|
43
|
+
height: 3em;
|
|
44
|
+
border-radius: 3em;
|
|
45
|
+
position: absolute;
|
|
46
|
+
z-index: -1;
|
|
47
|
+
margin-left: -1em;
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type LabelNode from
|
|
2
|
+
import type LabelNode from '../../models/chapter/LabelNode';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
node: LabelNode;
|
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
12
|
+
export type LabelProps = typeof __propDef.props;
|
|
13
|
+
export type LabelEvents = typeof __propDef.events;
|
|
14
|
+
export type LabelSlots = typeof __propDef.slots;
|
|
15
15
|
export default class Label extends SvelteComponentTyped<LabelProps, LabelEvents, LabelSlots> {
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
<
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
3
|
+
<script>import { getBase, getEdition, isChapterEditable } from '../page/Contexts';
|
|
2
4
|
import Text from './Text.svelte';
|
|
5
|
+
import Problem from './Problem.svelte';
|
|
3
6
|
export let node;
|
|
4
7
|
let base = getBase();
|
|
5
|
-
let editable =
|
|
8
|
+
let editable = isChapterEditable();
|
|
6
9
|
let edition = getEdition();
|
|
7
10
|
$: url = node.getMeta();
|
|
8
11
|
$: content = node.getText();
|
|
9
12
|
function isInvalidChapterLink() {
|
|
10
13
|
// If it's internal, validate it.
|
|
11
|
-
if (!url.startsWith(
|
|
14
|
+
if (!url.startsWith('http')) {
|
|
12
15
|
// Pull out any labels and just get the chapter name.
|
|
13
16
|
let chapter = url;
|
|
14
|
-
if (url.indexOf(
|
|
15
|
-
let parts = chapter.split(
|
|
17
|
+
if (url.indexOf(':') >= 0) {
|
|
18
|
+
let parts = chapter.split(':');
|
|
16
19
|
chapter = parts[0];
|
|
17
20
|
}
|
|
18
|
-
if (chapter !==
|
|
21
|
+
if (chapter !== '' && !$edition?.hasChapter(chapter))
|
|
19
22
|
return true;
|
|
20
23
|
}
|
|
21
24
|
return false;
|
|
@@ -24,23 +27,25 @@ function isInvalidChapterLink() {
|
|
|
24
27
|
|
|
25
28
|
{#if editable}
|
|
26
29
|
<span class="bookish-editor-link"><Text node={content} /></span>
|
|
27
|
-
<!-- If this is an invalid chapter link, say so -->
|
|
30
|
+
<!-- If this is an invalid chapter link, say so -->
|
|
28
31
|
{:else if isInvalidChapterLink()}
|
|
29
|
-
<
|
|
30
|
-
<!-- If this is external link, make an anchor that opens a new window. -->
|
|
31
|
-
{:else if url.startsWith(
|
|
32
|
+
<Problem>Unknown chapter name reference '{url}'</Problem>
|
|
33
|
+
<!-- If this is external link, make an anchor that opens a new window. -->
|
|
34
|
+
{:else if url.startsWith('http')}
|
|
32
35
|
<a href={url} target="_blank" rel="noreferrer"><Text node={content} /></a>
|
|
33
|
-
<!-- If's a chapter link with a label -->
|
|
34
|
-
{:else if url.indexOf(
|
|
36
|
+
<!-- If's a chapter link with a label -->
|
|
37
|
+
{:else if url.indexOf(':') >= 0}
|
|
35
38
|
<!-- If the chapter isn't specified, set to the current chapter's id. -->
|
|
36
|
-
{#if url.split(
|
|
37
|
-
<a href={
|
|
39
|
+
{#if url.split(':')[0] === ''}
|
|
40
|
+
<a href={'#' + url.split(':')[1]}><Text node={content} /></a>
|
|
38
41
|
{:else}
|
|
39
|
-
<a href={
|
|
42
|
+
<a href={'/' + url.split(':')[0] + '#' + url.split(':')[1]}
|
|
43
|
+
><Text node={content} /></a
|
|
44
|
+
>
|
|
40
45
|
{/if}
|
|
41
|
-
<!-- If this is internal link, make a route link to the chapter. -->
|
|
42
|
-
{:else}
|
|
43
|
-
<a href={base +
|
|
46
|
+
<!-- If this is internal link, make a route link to the chapter. -->
|
|
47
|
+
{:else}
|
|
48
|
+
<a href={$base + '/' + url}><Text node={content} /></a>
|
|
44
49
|
{/if}
|
|
45
50
|
|
|
46
51
|
<style>
|
|
@@ -48,4 +53,4 @@ function isInvalidChapterLink() {
|
|
|
48
53
|
color: var(--bookish-link-color);
|
|
49
54
|
font-weight: var(--bookish-link-font-weight);
|
|
50
55
|
}
|
|
51
|
-
</style>
|
|
56
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type LinkNode from
|
|
2
|
+
import type LinkNode from '../../models/chapter/LinkNode';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
node: LinkNode;
|
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
12
|
+
export type LinkProps = typeof __propDef.props;
|
|
13
|
+
export type LinkEvents = typeof __propDef.events;
|
|
14
|
+
export type LinkSlots = typeof __propDef.slots;
|
|
15
15
|
export default class Link extends SvelteComponentTyped<LinkProps, LinkEvents, LinkSlots> {
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1,14 +1,81 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
1
|
+
<svelte:options immutable={true} />
|
|
2
|
+
|
|
3
|
+
<script>import ListNode from '../../models/chapter/ListNode';
|
|
4
|
+
import Format from './Format.svelte';
|
|
3
5
|
export let node;
|
|
4
6
|
</script>
|
|
5
7
|
|
|
6
|
-
<svelte:element
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
<svelte:element
|
|
9
|
+
this={node.isNumbered() ? 'ol' : 'ul'}
|
|
10
|
+
data-nodeid={node.nodeID}
|
|
11
|
+
>
|
|
12
|
+
{#each node.getItems() as item (item.nodeID)}
|
|
13
|
+
{#if item instanceof ListNode}
|
|
14
|
+
<svelte:self node={item} />
|
|
10
15
|
{:else}
|
|
11
|
-
<li><Format node={item}/></li>
|
|
16
|
+
<li><Format node={item} /></li>
|
|
12
17
|
{/if}
|
|
13
18
|
{/each}
|
|
14
|
-
</svelte:element>
|
|
19
|
+
</svelte:element>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
ol {
|
|
23
|
+
list-style: none;
|
|
24
|
+
counter-reset: item;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
ol > li {
|
|
28
|
+
counter-increment: item;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ol > li {
|
|
32
|
+
list-style-type: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
ol > :global(ol > li) {
|
|
36
|
+
list-style-type: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
ol > :global(ol > ol > li) {
|
|
40
|
+
list-style-type: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
ol > :global(li::before),
|
|
44
|
+
ul > :global(ol > li::before),
|
|
45
|
+
ul > :global(ul > ol > li::before) {
|
|
46
|
+
content: counter(item) '. ';
|
|
47
|
+
color: var(--bookish-bullet-color);
|
|
48
|
+
display: inline-block;
|
|
49
|
+
width: 1em;
|
|
50
|
+
margin-left: -1.5rem;
|
|
51
|
+
margin-right: 0.5rem;
|
|
52
|
+
text-align: right;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ol > :global(ol > li::before),
|
|
56
|
+
ul > :global(ol > ol > li::before) {
|
|
57
|
+
content: counter(item, lower-alpha) '. ';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
ol > :global(ol > ol > li:before) {
|
|
61
|
+
content: counter(item, upper-alpha) '. ';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
li {
|
|
65
|
+
margin-bottom: calc(0.5 * var(--bookish-paragraph-spacing));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
ul li {
|
|
69
|
+
list-style: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
ul li::before {
|
|
73
|
+
content: '*';
|
|
74
|
+
color: var(--bookish-bullet-color);
|
|
75
|
+
display: inline-block;
|
|
76
|
+
width: 1rem;
|
|
77
|
+
margin-left: -1rem;
|
|
78
|
+
font-family: var(--bookish-bullet-font-family);
|
|
79
|
+
font-weight: var(--bookish-bullet-font-weight);
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import ListNode from
|
|
2
|
+
import ListNode from '../../models/chapter/ListNode';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
node: ListNode;
|
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
12
|
+
export type ListProps = typeof __propDef.props;
|
|
13
|
+
export type ListEvents = typeof __propDef.events;
|
|
14
|
+
export type ListSlots = typeof __propDef.slots;
|
|
15
15
|
export default class List extends SvelteComponentTyped<ListProps, ListEvents, ListSlots> {
|
|
16
16
|
}
|
|
17
17
|
export {};
|