bookish-press 0.6.54 → 0.7.1
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/dist/components/Auth.svelte.d.ts +2 -0
- package/dist/components/BookPreview.svelte.d.ts +3 -1
- package/dist/components/Link.svelte.d.ts +3 -1
- package/dist/components/app/BookList.svelte.d.ts +2 -0
- package/dist/components/app/Button.svelte.d.ts +2 -0
- package/dist/components/app/Feedback.svelte.d.ts +3 -1
- package/dist/components/app/Head.svelte.d.ts +3 -1
- package/dist/components/app/Large.svelte.d.ts +2 -0
- package/dist/components/app/Lead.svelte.d.ts +2 -0
- package/dist/components/app/Link.svelte.d.ts +3 -1
- package/dist/components/app/Options.svelte.d.ts +2 -0
- package/dist/components/app/Paragraph.svelte.d.ts +3 -1
- package/dist/components/app/Section.svelte.d.ts +2 -0
- package/dist/components/app/Table.svelte.d.ts +2 -0
- package/dist/components/app/TextInput.svelte.d.ts +5 -3
- package/dist/components/chapter/Atom.svelte.d.ts +2 -0
- package/dist/components/chapter/Block.svelte.d.ts +2 -0
- package/dist/components/chapter/Callout.svelte.d.ts +2 -0
- package/dist/components/chapter/CaptionedCode.svelte.d.ts +2 -0
- package/dist/components/chapter/ChapterBody.svelte.d.ts +4 -2
- package/dist/components/chapter/Citations.svelte +4 -1
- package/dist/components/chapter/Citations.svelte.d.ts +2 -0
- package/dist/components/chapter/Code.svelte.d.ts +2 -0
- package/dist/components/chapter/Comment.svelte.d.ts +2 -0
- package/dist/components/chapter/Definition.svelte.d.ts +2 -0
- package/dist/components/chapter/Embed.svelte.d.ts +5 -3
- package/dist/components/chapter/ErrorMessage.svelte.d.ts +2 -0
- package/dist/components/chapter/Figure.svelte.d.ts +3 -1
- package/dist/components/chapter/Footnote.svelte.d.ts +2 -0
- package/dist/components/chapter/Format.svelte.d.ts +2 -0
- package/dist/components/chapter/InlineCode.svelte.d.ts +2 -0
- package/dist/components/chapter/Label.svelte.d.ts +2 -0
- package/dist/components/chapter/LineBreak.svelte.d.ts +2 -0
- package/dist/components/chapter/Link.svelte.d.ts +2 -0
- package/dist/components/chapter/List.svelte.d.ts +2 -0
- package/dist/components/chapter/Marginal.svelte.d.ts +2 -0
- package/dist/components/chapter/Paragraph.svelte.d.ts +2 -0
- package/dist/components/chapter/Positioned.svelte.d.ts +2 -0
- package/dist/components/chapter/Problem.svelte.d.ts +2 -0
- package/dist/components/chapter/Python.svelte.d.ts +2 -0
- package/dist/components/chapter/Quote.svelte.d.ts +2 -0
- package/dist/components/chapter/Rule.svelte.d.ts +2 -0
- package/dist/components/chapter/Table.svelte.d.ts +2 -0
- package/dist/components/chapter/Text.svelte.d.ts +2 -0
- package/dist/components/controls/DarkToggle.svelte.d.ts +2 -0
- package/dist/components/editor/BookishEditor.svelte +17 -4
- package/dist/components/editor/BookishEditor.svelte.d.ts +4 -2
- package/dist/components/editor/CalloutEditor.svelte.d.ts +2 -0
- package/dist/components/editor/CaptionedCodeEditor.svelte.d.ts +2 -0
- package/dist/components/editor/CaretContext.d.ts +4 -0
- package/dist/components/editor/CaretContext.js +52 -1
- package/dist/components/editor/CaretState.d.ts +1 -1
- package/dist/components/editor/CaretView.svelte +12 -1
- package/dist/components/editor/CaretView.svelte.d.ts +4 -0
- package/dist/components/editor/CitationsEditor.svelte.d.ts +2 -0
- package/dist/components/editor/Command.d.ts +1 -1
- package/dist/components/editor/Commands.js +52 -0
- package/dist/components/editor/ConfirmButton.svelte.d.ts +2 -0
- package/dist/components/editor/DefinitionEditor.svelte.d.ts +2 -0
- package/dist/components/editor/EmbedEditor.svelte.d.ts +2 -0
- package/dist/components/editor/Icon.svelte.d.ts +2 -0
- package/dist/components/editor/ImageChooser.svelte.d.ts +2 -0
- package/dist/components/editor/ImageThumbnail.svelte.d.ts +2 -0
- package/dist/components/editor/InlineCodeEditor.svelte.d.ts +2 -0
- package/dist/components/editor/LabelEditor.svelte.d.ts +2 -0
- package/dist/components/editor/LanguageEditor.svelte.d.ts +2 -0
- package/dist/components/editor/LinkEditor.svelte.d.ts +2 -0
- package/dist/components/editor/Note.svelte.d.ts +2 -0
- package/dist/components/editor/Permissions.svelte.d.ts +2 -0
- package/dist/components/editor/PositionEditor.svelte.d.ts +2 -0
- package/dist/components/editor/QuoteEditor.svelte.d.ts +2 -0
- package/dist/components/editor/Switch.svelte.d.ts +2 -0
- package/dist/components/editor/TableEditor.svelte.d.ts +2 -0
- package/dist/components/editor/TextEditor.svelte +1 -0
- package/dist/components/editor/TextEditor.svelte.d.ts +4 -2
- package/dist/components/editor/Toggle.svelte.d.ts +2 -0
- package/dist/components/editor/Toolbar.svelte +1 -6
- package/dist/components/editor/Toolbar.svelte.d.ts +2 -0
- package/dist/components/editor/ToolbarGroup.svelte.d.ts +2 -0
- package/dist/components/editor/ToolbarSpacer.svelte.d.ts +2 -0
- package/dist/components/editor/URLEditor.svelte.d.ts +2 -0
- package/dist/components/page/Acknowledgements.svelte +12 -5
- package/dist/components/page/Acknowledgements.svelte.d.ts +2 -0
- package/dist/components/page/Analytics.svelte.d.ts +3 -1
- package/dist/components/page/Authors.svelte.d.ts +3 -1
- package/dist/components/page/BookLoader.svelte.d.ts +2 -0
- package/dist/components/page/BulkReferenceEditor.svelte.d.ts +2 -0
- package/dist/components/page/Chapter.svelte.d.ts +3 -1
- package/dist/components/page/ChapterContext.d.ts +0 -1
- package/dist/components/page/ChapterNumber.svelte.d.ts +2 -0
- package/dist/components/page/ChapterTitle.svelte.d.ts +2 -0
- package/dist/components/page/Contexts.d.ts +0 -1
- package/dist/components/page/DefinitionView.svelte +2 -2
- package/dist/components/page/DefinitionView.svelte.d.ts +2 -0
- package/dist/components/page/Description.svelte.d.ts +2 -0
- package/dist/components/page/EditableHeader.svelte +25 -0
- package/dist/components/page/EditableHeader.svelte.d.ts +20 -0
- package/dist/components/page/Edition.svelte.d.ts +3 -1
- package/dist/components/page/EditionLoader.svelte +1 -1
- package/dist/components/page/EditionLoader.svelte.d.ts +2 -0
- package/dist/components/page/Editions.svelte.d.ts +3 -1
- package/dist/components/page/Glossary.svelte +10 -4
- package/dist/components/page/Glossary.svelte.d.ts +2 -0
- package/dist/components/page/Header.svelte +1 -0
- package/dist/components/page/Header.svelte.d.ts +4 -2
- package/dist/components/page/Index.svelte +9 -5
- package/dist/components/page/Index.svelte.d.ts +2 -0
- package/dist/components/page/Instructions.svelte.d.ts +2 -0
- package/dist/components/page/License.svelte +3 -3
- package/dist/components/page/License.svelte.d.ts +2 -0
- package/dist/components/page/Loading.svelte.d.ts +2 -0
- package/dist/components/page/Media.svelte +6 -2
- package/dist/components/page/Media.svelte.d.ts +2 -0
- package/dist/components/page/MediaPreview.svelte.d.ts +2 -0
- package/dist/components/page/Muted.svelte.d.ts +2 -0
- package/dist/components/page/Outline.svelte.d.ts +3 -1
- package/dist/components/page/Page.svelte.d.ts +2 -0
- package/dist/components/page/PageHeader.svelte.d.ts +3 -1
- package/dist/components/page/PageParagraph.svelte.d.ts +2 -0
- package/dist/components/page/PossibleChapter.svelte.d.ts +2 -0
- package/dist/components/page/PossibleReference.svelte.d.ts +2 -0
- package/dist/components/page/Print.svelte.d.ts +2 -0
- package/dist/components/page/Publish.svelte.d.ts +2 -0
- package/dist/components/page/Reference.svelte.d.ts +3 -1
- package/dist/components/page/References.svelte +7 -1
- package/dist/components/page/References.svelte.d.ts +2 -0
- package/dist/components/page/Rows.svelte.d.ts +2 -0
- package/dist/components/page/Search.svelte +11 -5
- package/dist/components/page/Search.svelte.d.ts +2 -0
- package/dist/components/page/Status.svelte.d.ts +2 -0
- package/dist/components/page/SubdomainEditor.svelte.d.ts +2 -0
- package/dist/components/page/TableOfContents.svelte +9 -16
- package/dist/components/page/TableOfContents.svelte.d.ts +2 -0
- package/dist/components/page/TableOfContentsImage.svelte.d.ts +2 -0
- package/dist/components/page/TableOfContentsRow.svelte +25 -13
- package/dist/components/page/TableOfContentsRow.svelte.d.ts +6 -5
- package/dist/components/page/ThemeEditor.svelte.d.ts +2 -0
- package/dist/components/page/ThemeEditorPreview.svelte.d.ts +2 -0
- package/dist/components/page/ThemeSetEditor.svelte.d.ts +2 -0
- package/dist/components/page/ThemeVariableEditor.svelte.d.ts +2 -0
- package/dist/components/page/Title.svelte.d.ts +2 -0
- package/dist/components/page/Unknown.svelte +2 -2
- package/dist/components/page/Unknown.svelte.d.ts +2 -0
- package/dist/models/CRUD.js +12 -8
- package/dist/models/book/ChapterID.d.ts +3 -9
- package/dist/models/book/ChapterID.js +1 -1
- package/dist/models/book/Edition.d.ts +12 -4
- package/dist/models/book/Edition.js +56 -22
- package/dist/models/chapter/AtomNode.d.ts +2 -2
- package/dist/models/chapter/FormatNode.d.ts +5 -5
- package/dist/models/chapter/FormatNode.js +10 -5
- package/dist/models/chapter/MetadataNode.d.ts +3 -3
- package/package.json +22 -16
|
@@ -17,6 +17,8 @@ import type Node from '../../models/chapter/Node';
|
|
|
17
17
|
export type PasteContent = {
|
|
18
18
|
plain: string | undefined;
|
|
19
19
|
};
|
|
20
|
+
export type Accent = '`' | "'" | '^' | '~' | ':';
|
|
21
|
+
export declare const Accents: Record<string, string>;
|
|
20
22
|
type CaretContext = {
|
|
21
23
|
chapter: boolean;
|
|
22
24
|
range: CaretRange;
|
|
@@ -46,5 +48,7 @@ type CaretContext = {
|
|
|
46
48
|
clipboard: Clipboard;
|
|
47
49
|
handleCopy: (node: Node) => void;
|
|
48
50
|
handlePaste: (context: CaretContext, text: PasteContent | Node, save: boolean) => Edit;
|
|
51
|
+
setAccent: (accent: Accent | undefined) => void;
|
|
52
|
+
getAccent: () => Accent | undefined;
|
|
49
53
|
};
|
|
50
54
|
export type { CaretContext as default };
|
|
@@ -1 +1,52 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export const Accents = {
|
|
2
|
+
'`a': 'à',
|
|
3
|
+
'`A': 'À',
|
|
4
|
+
'`e': 'è',
|
|
5
|
+
'`E': 'È',
|
|
6
|
+
'`i': 'ì',
|
|
7
|
+
'`I': 'Ì',
|
|
8
|
+
'`o': 'ò',
|
|
9
|
+
'`O': 'Ò',
|
|
10
|
+
'`u': 'ù',
|
|
11
|
+
'`U': 'Ù',
|
|
12
|
+
"'a": 'á',
|
|
13
|
+
"'A": 'Á',
|
|
14
|
+
"'e": 'é',
|
|
15
|
+
"'E": 'É',
|
|
16
|
+
"'i": 'í',
|
|
17
|
+
"'I": 'Í',
|
|
18
|
+
"'o": 'ó',
|
|
19
|
+
"'O": 'Ó',
|
|
20
|
+
"'u": 'ú',
|
|
21
|
+
"'U": 'Ú',
|
|
22
|
+
'^a': 'â',
|
|
23
|
+
'^A': 'Â',
|
|
24
|
+
'^e': 'ê',
|
|
25
|
+
'^E': 'Ê',
|
|
26
|
+
'^i': 'î',
|
|
27
|
+
'^I': 'Î',
|
|
28
|
+
'^o': 'ô',
|
|
29
|
+
'^O': 'Ô',
|
|
30
|
+
'^u': 'û',
|
|
31
|
+
'^U': 'Û',
|
|
32
|
+
'~a': 'ã',
|
|
33
|
+
'~A': 'Ã',
|
|
34
|
+
'~e': 'ẽ',
|
|
35
|
+
'~E': 'Ẽ',
|
|
36
|
+
'~i': 'ĩ',
|
|
37
|
+
'~I': 'Ĩ',
|
|
38
|
+
'~o': 'õ',
|
|
39
|
+
'~O': 'Õ',
|
|
40
|
+
'~u': 'ũ',
|
|
41
|
+
'~U': 'Ũ',
|
|
42
|
+
':a': 'ä',
|
|
43
|
+
':A': 'Ä',
|
|
44
|
+
':e': 'ë',
|
|
45
|
+
':E': 'Ë',
|
|
46
|
+
':i': 'ï',
|
|
47
|
+
':I': 'Ï',
|
|
48
|
+
':o': 'ö',
|
|
49
|
+
':O': 'Ö',
|
|
50
|
+
':u': 'ü',
|
|
51
|
+
':U': 'Ü',
|
|
52
|
+
};
|
|
@@ -13,7 +13,7 @@ type CaretState = {
|
|
|
13
13
|
context: CaretContext | undefined;
|
|
14
14
|
edit: (previous: Node, edited: Node) => void;
|
|
15
15
|
setCaret: (range: CaretRange) => void;
|
|
16
|
-
executor: (command: Command, key: string) => void;
|
|
16
|
+
executor: (command: Command, key: string, code: string) => void;
|
|
17
17
|
focused: boolean;
|
|
18
18
|
};
|
|
19
19
|
export type { CaretState as default };
|
|
@@ -9,6 +9,7 @@ export let disabled;
|
|
|
9
9
|
export let ignored;
|
|
10
10
|
export let blink;
|
|
11
11
|
export let locked;
|
|
12
|
+
export let accent;
|
|
12
13
|
let element;
|
|
13
14
|
let headerHeight = 0;
|
|
14
15
|
// When the caret updates position, scroll the element into view after the render is complete.
|
|
@@ -38,7 +39,9 @@ afterUpdate(() => {
|
|
|
38
39
|
style:height="{height}px"
|
|
39
40
|
style:scroll-margin-top="{headerHeight}px"
|
|
40
41
|
bind:this={element}
|
|
41
|
-
>{#if locked}🔒{/if}
|
|
42
|
+
>{#if locked}🔒{/if}{#if accent}
|
|
43
|
+
<span class="accent">{accent}</span>
|
|
44
|
+
{/if}</div
|
|
42
45
|
>
|
|
43
46
|
|
|
44
47
|
<style>
|
|
@@ -84,4 +87,12 @@ afterUpdate(() => {
|
|
|
84
87
|
outline-width: 1px;
|
|
85
88
|
outline-color: var(--bookish-link-color);
|
|
86
89
|
}
|
|
90
|
+
|
|
91
|
+
.accent {
|
|
92
|
+
display: inline-block;
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: -0.5em;
|
|
95
|
+
color: var(--app-muted-color);
|
|
96
|
+
font-size: 200%;
|
|
97
|
+
}
|
|
87
98
|
</style>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Accent } from './CaretContext';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
left: number;
|
|
@@ -11,11 +12,14 @@ declare const __propDef: {
|
|
|
11
12
|
ignored: boolean;
|
|
12
13
|
blink: boolean;
|
|
13
14
|
locked: boolean;
|
|
15
|
+
accent: Accent | undefined;
|
|
14
16
|
};
|
|
15
17
|
events: {
|
|
16
18
|
[evt: string]: CustomEvent<any>;
|
|
17
19
|
};
|
|
18
20
|
slots: {};
|
|
21
|
+
exports?: {} | undefined;
|
|
22
|
+
bindings?: string | undefined;
|
|
19
23
|
};
|
|
20
24
|
export type CaretViewProps = typeof __propDef.props;
|
|
21
25
|
export type CaretViewEvents = typeof __propDef.events;
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
11
13
|
};
|
|
12
14
|
export type CitationsEditorProps = typeof __propDef.props;
|
|
13
15
|
export type CitationsEditorEvents = typeof __propDef.events;
|
|
@@ -15,6 +15,6 @@ type Command = {
|
|
|
15
15
|
mutates: boolean;
|
|
16
16
|
visible: boolean | ((context: CaretContext) => boolean);
|
|
17
17
|
active: boolean | ((context: CaretContext, key?: string) => boolean);
|
|
18
|
-
handler: (context: CaretContext, utilities: CaretUtilities, key: string) => Edit;
|
|
18
|
+
handler: (context: CaretContext, utilities: CaretUtilities, key: string, code: string) => Edit | true;
|
|
19
19
|
};
|
|
20
20
|
export type { Command as default };
|
|
@@ -54,6 +54,7 @@ import SuperscriptIcon from './icons/super.svg?raw';
|
|
|
54
54
|
import TableIcon from './icons/table.svg?raw';
|
|
55
55
|
import UndoIcon from './icons/undo.svg?raw';
|
|
56
56
|
import UnindentIcon from './icons/unindent.svg?raw';
|
|
57
|
+
import { Accents } from './CaretContext';
|
|
57
58
|
import LineBreakNode from '../../models/chapter/LineBreakNode';
|
|
58
59
|
/**
|
|
59
60
|
* Icons:
|
|
@@ -109,6 +110,25 @@ function rootWithNode(context, original, replacement, caret) {
|
|
|
109
110
|
: context.range,
|
|
110
111
|
};
|
|
111
112
|
}
|
|
113
|
+
function createAccentCommand(accent, code, control, alt, shift, description) {
|
|
114
|
+
return {
|
|
115
|
+
icon: accent,
|
|
116
|
+
description: description,
|
|
117
|
+
category: 'text',
|
|
118
|
+
mutates: false,
|
|
119
|
+
control,
|
|
120
|
+
alt,
|
|
121
|
+
shift,
|
|
122
|
+
key: undefined,
|
|
123
|
+
code,
|
|
124
|
+
visible: false,
|
|
125
|
+
active: true,
|
|
126
|
+
handler: (context) => {
|
|
127
|
+
context.setAccent(accent);
|
|
128
|
+
return true;
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
112
132
|
// An ordered list of command specifications for keyboard and mouse input.
|
|
113
133
|
const commands = [
|
|
114
134
|
{
|
|
@@ -695,6 +715,8 @@ const commands = [
|
|
|
695
715
|
handler: (context) => {
|
|
696
716
|
if (context.root === undefined)
|
|
697
717
|
return;
|
|
718
|
+
// Reset the accent.
|
|
719
|
+
context.setAccent(undefined);
|
|
698
720
|
if (context.isSelection) {
|
|
699
721
|
const edit = context.root.withRangeFormatted(context.range, undefined);
|
|
700
722
|
if (edit === undefined)
|
|
@@ -1505,6 +1527,26 @@ const commands = [
|
|
|
1505
1527
|
return { root: context.root, range: context.range };
|
|
1506
1528
|
},
|
|
1507
1529
|
},
|
|
1530
|
+
// Windows grave
|
|
1531
|
+
createAccentCommand('`', 'Backquote', true, false, false, 'insert a grave accent'),
|
|
1532
|
+
// Mac grave
|
|
1533
|
+
createAccentCommand('`', 'Backquote', false, true, false, 'insert a grave accent'),
|
|
1534
|
+
// Windows apostrophe
|
|
1535
|
+
createAccentCommand("'", 'Quote', true, false, false, 'insert an apostrophe accent'),
|
|
1536
|
+
// Mac apostrophe
|
|
1537
|
+
createAccentCommand('`', 'KeyE', false, true, false, 'insert an apostrophe accent'),
|
|
1538
|
+
// Windows caret
|
|
1539
|
+
createAccentCommand('^', 'Digit6', true, false, true, 'insert a caret accent'),
|
|
1540
|
+
// Mac caret
|
|
1541
|
+
createAccentCommand('^', 'KeyI', false, true, false, 'insert a caret accent'),
|
|
1542
|
+
// Windows tilde
|
|
1543
|
+
createAccentCommand('~', 'Backquote', true, false, true, 'insert a tilde accent'),
|
|
1544
|
+
// Mac tilde
|
|
1545
|
+
createAccentCommand('~', 'KeyN', false, true, false, 'insert a tilde accent'),
|
|
1546
|
+
// Windows umlaut
|
|
1547
|
+
createAccentCommand(':', 'Semicolon', true, false, true, 'insert a tilde accent'),
|
|
1548
|
+
// Mac umlaut
|
|
1549
|
+
createAccentCommand(':', 'KeyU', false, true, false, 'insert a grave accent'),
|
|
1508
1550
|
{
|
|
1509
1551
|
icon: 'insert symbol',
|
|
1510
1552
|
description: 'insert character',
|
|
@@ -1521,6 +1563,16 @@ const commands = [
|
|
|
1521
1563
|
utilities;
|
|
1522
1564
|
const range = context.range;
|
|
1523
1565
|
if (key.length === 1) {
|
|
1566
|
+
// See if there's an accent.
|
|
1567
|
+
const accent = context.getAccent();
|
|
1568
|
+
if (accent !== undefined) {
|
|
1569
|
+
// Reset the accent.
|
|
1570
|
+
context.setAccent(undefined);
|
|
1571
|
+
const match = Accents[accent + key];
|
|
1572
|
+
if (match) {
|
|
1573
|
+
key = match;
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1524
1576
|
// Insert at the start.
|
|
1525
1577
|
let sortedRange = range.start.node.sortRange(range);
|
|
1526
1578
|
let insertionPoint = sortedRange.start;
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
11
13
|
};
|
|
12
14
|
export type DefinitionEditorProps = typeof __propDef.props;
|
|
13
15
|
export type DefinitionEditorEvents = typeof __propDef.events;
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
11
13
|
};
|
|
12
14
|
export type EmbedEditorProps = typeof __propDef.props;
|
|
13
15
|
export type EmbedEditorEvents = typeof __propDef.events;
|
|
@@ -9,6 +9,8 @@ declare const __propDef: {
|
|
|
9
9
|
[evt: string]: CustomEvent<any>;
|
|
10
10
|
};
|
|
11
11
|
slots: {};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
12
14
|
};
|
|
13
15
|
export type ImageChooserProps = typeof __propDef.props;
|
|
14
16
|
export type ImageChooserEvents = typeof __propDef.events;
|
|
@@ -10,6 +10,8 @@ declare const __propDef: {
|
|
|
10
10
|
[evt: string]: CustomEvent<any>;
|
|
11
11
|
};
|
|
12
12
|
slots: {};
|
|
13
|
+
exports?: {} | undefined;
|
|
14
|
+
bindings?: string | undefined;
|
|
13
15
|
};
|
|
14
16
|
export type ImageThumbnailProps = typeof __propDef.props;
|
|
15
17
|
export type ImageThumbnailEvents = typeof __propDef.events;
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
11
13
|
};
|
|
12
14
|
export type InlineCodeEditorProps = typeof __propDef.props;
|
|
13
15
|
export type InlineCodeEditorEvents = typeof __propDef.events;
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
11
13
|
};
|
|
12
14
|
export type LabelEditorProps = typeof __propDef.props;
|
|
13
15
|
export type LabelEditorEvents = typeof __propDef.events;
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
11
13
|
};
|
|
12
14
|
export type LanguageEditorProps = typeof __propDef.props;
|
|
13
15
|
export type LanguageEditorEvents = typeof __propDef.events;
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
11
13
|
};
|
|
12
14
|
export type LinkEditorProps = typeof __propDef.props;
|
|
13
15
|
export type LinkEditorEvents = typeof __propDef.events;
|
|
@@ -11,6 +11,8 @@ declare const __propDef: {
|
|
|
11
11
|
[evt: string]: CustomEvent<any>;
|
|
12
12
|
};
|
|
13
13
|
slots: {};
|
|
14
|
+
exports?: {} | undefined;
|
|
15
|
+
bindings?: string | undefined;
|
|
14
16
|
};
|
|
15
17
|
export type PermissionsProps = typeof __propDef.props;
|
|
16
18
|
export type PermissionsEvents = typeof __propDef.events;
|
|
@@ -9,6 +9,8 @@ declare const __propDef: {
|
|
|
9
9
|
[evt: string]: CustomEvent<any>;
|
|
10
10
|
};
|
|
11
11
|
slots: {};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
12
14
|
};
|
|
13
15
|
export type PositionEditorProps = typeof __propDef.props;
|
|
14
16
|
export type PositionEditorEvents = typeof __propDef.events;
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
11
13
|
};
|
|
12
14
|
export type QuoteEditorProps = typeof __propDef.props;
|
|
13
15
|
export type QuoteEditorEvents = typeof __propDef.events;
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
10
|
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
11
13
|
};
|
|
12
14
|
export type TableEditorProps = typeof __propDef.props;
|
|
13
15
|
export type TableEditorEvents = typeof __propDef.events;
|
|
@@ -6,15 +6,17 @@ declare const __propDef: {
|
|
|
6
6
|
placeholder: string;
|
|
7
7
|
valid: (text: string) => string | undefined;
|
|
8
8
|
save: (text: string) => Promise<void> | undefined | void | string;
|
|
9
|
-
saveOnExit?: boolean
|
|
9
|
+
saveOnExit?: boolean;
|
|
10
10
|
width?: number | undefined;
|
|
11
|
-
clip?: boolean
|
|
11
|
+
clip?: boolean;
|
|
12
12
|
move?: ((el: HTMLElement, direction: -1 | 1) => void) | undefined;
|
|
13
13
|
};
|
|
14
14
|
events: {
|
|
15
15
|
[evt: string]: CustomEvent<any>;
|
|
16
16
|
};
|
|
17
17
|
slots: {};
|
|
18
|
+
exports?: {} | undefined;
|
|
19
|
+
bindings?: string | undefined;
|
|
18
20
|
};
|
|
19
21
|
export type TextEditorProps = typeof __propDef.props;
|
|
20
22
|
export type TextEditorEvents = typeof __propDef.events;
|
|
@@ -186,12 +186,7 @@ function handleKeyPress(event) {
|
|
|
186
186
|
' ' +
|
|
187
187
|
getShortcutDescription(command)}
|
|
188
188
|
tabIndex="0"
|
|
189
|
-
command={() =>
|
|
190
|
-
caret?.executor.call(
|
|
191
|
-
undefined,
|
|
192
|
-
command,
|
|
193
|
-
'',
|
|
194
|
-
)}
|
|
189
|
+
command={() => caret?.executor(command, '', '')}
|
|
195
190
|
>
|
|
196
191
|
<Icon icon={command.icon} />
|
|
197
192
|
</Button>
|
|
@@ -9,6 +9,8 @@ declare const __propDef: {
|
|
|
9
9
|
[evt: string]: CustomEvent<any>;
|
|
10
10
|
};
|
|
11
11
|
slots: {};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
12
14
|
};
|
|
13
15
|
export type UrlEditorProps = typeof __propDef.props;
|
|
14
16
|
export type UrlEditorEvents = typeof __propDef.events;
|
|
@@ -4,6 +4,7 @@ import BookishEditor from '../editor/BookishEditor.svelte';
|
|
|
4
4
|
import Instructions from './Instructions.svelte';
|
|
5
5
|
import { getUser, getEdition, getLeasee, isEditionEditable, lease, } from './Contexts';
|
|
6
6
|
import PageHeader from './PageHeader.svelte';
|
|
7
|
+
import EditableHeader from './EditableHeader.svelte';
|
|
7
8
|
let auth = getUser();
|
|
8
9
|
let edition = getEdition();
|
|
9
10
|
let editable = isEditionEditable();
|
|
@@ -16,10 +17,14 @@ $: acknowledgements = $edition?.getAcknowledgements();
|
|
|
16
17
|
</Instructions>
|
|
17
18
|
|
|
18
19
|
<!-- If editable, show acknowledgements even if they're empty, otherwise hide -->
|
|
19
|
-
{#if $edition
|
|
20
|
+
{#if $edition}
|
|
20
21
|
{#if editable}
|
|
22
|
+
<EditableHeader
|
|
23
|
+
id="acknowledgements"
|
|
24
|
+
label="Edit acknowledgements header"
|
|
25
|
+
/>
|
|
21
26
|
<BookishEditor
|
|
22
|
-
text={acknowledgements}
|
|
27
|
+
text={acknowledgements ?? ''}
|
|
23
28
|
parser={(text) => Parser.parseChapter($edition, text)}
|
|
24
29
|
chapter={false}
|
|
25
30
|
component={ChapterBody}
|
|
@@ -27,14 +32,16 @@ $: acknowledgements = $edition?.getAcknowledgements();
|
|
|
27
32
|
save={(node) =>
|
|
28
33
|
$edition
|
|
29
34
|
? edition.set(
|
|
30
|
-
$edition.withAcknowledgements(node.toBookdown())
|
|
35
|
+
$edition.withAcknowledgements(node.toBookdown()),
|
|
31
36
|
)
|
|
32
37
|
: undefined}
|
|
33
38
|
leasee={getLeasee(auth, edition, `acks`)}
|
|
34
39
|
lease={(lock) => lease(auth, edition, `acks`, lock)}
|
|
35
40
|
/>
|
|
36
|
-
{:else if acknowledgements.length > 0}
|
|
37
|
-
<PageHeader id="acknowledgements"
|
|
41
|
+
{:else if acknowledgements && acknowledgements.length > 0}
|
|
42
|
+
<PageHeader id="acknowledgements"
|
|
43
|
+
>{$edition.getHeader('acknowledgements')}</PageHeader
|
|
44
|
+
>
|
|
38
45
|
<ChapterBody node={Parser.parseChapter($edition, acknowledgements)} />
|
|
39
46
|
{/if}
|
|
40
47
|
{/if}
|
|
@@ -5,6 +5,8 @@ declare const __propDef: {
|
|
|
5
5
|
[evt: string]: CustomEvent<any>;
|
|
6
6
|
};
|
|
7
7
|
slots: {};
|
|
8
|
+
exports?: {} | undefined;
|
|
9
|
+
bindings?: string | undefined;
|
|
8
10
|
};
|
|
9
11
|
export type AcknowledgementsProps = typeof __propDef.props;
|
|
10
12
|
export type AcknowledgementsEvents = typeof __propDef.events;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
/** By default, we use the Bookish.press Google Analytics tag */ gtagid?: string | null
|
|
4
|
+
/** By default, we use the Bookish.press Google Analytics tag */ gtagid?: string | null;
|
|
5
5
|
};
|
|
6
6
|
events: {
|
|
7
7
|
[evt: string]: CustomEvent<any>;
|
|
8
8
|
};
|
|
9
9
|
slots: {};
|
|
10
|
+
exports?: {} | undefined;
|
|
11
|
+
bindings?: string | undefined;
|
|
10
12
|
};
|
|
11
13
|
export type AnalyticsProps = typeof __propDef.props;
|
|
12
14
|
export type AnalyticsEvents = typeof __propDef.events;
|
|
@@ -7,12 +7,14 @@ declare const __propDef: {
|
|
|
7
7
|
add: () => Promise<void> | void;
|
|
8
8
|
edit: (index: number, text: string) => Promise<void> | void;
|
|
9
9
|
remove: (index: number) => Promise<void> | void;
|
|
10
|
-
editors?: boolean
|
|
10
|
+
editors?: boolean;
|
|
11
11
|
};
|
|
12
12
|
events: {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
14
14
|
};
|
|
15
15
|
slots: {};
|
|
16
|
+
exports?: {} | undefined;
|
|
17
|
+
bindings?: string | undefined;
|
|
16
18
|
};
|
|
17
19
|
export type AuthorsProps = typeof __propDef.props;
|
|
18
20
|
export type AuthorsEvents = typeof __propDef.events;
|
|
@@ -5,6 +5,8 @@ declare const __propDef: {
|
|
|
5
5
|
[evt: string]: CustomEvent<any>;
|
|
6
6
|
};
|
|
7
7
|
slots: {};
|
|
8
|
+
exports?: {} | undefined;
|
|
9
|
+
bindings?: string | undefined;
|
|
8
10
|
};
|
|
9
11
|
export type BulkReferenceEditorProps = typeof __propDef.props;
|
|
10
12
|
export type BulkReferenceEditorEvents = typeof __propDef.events;
|
|
@@ -3,12 +3,14 @@ import type ChapterModel from '../../models/book/Chapter';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
chapter: ChapterModel;
|
|
6
|
-
print?: boolean
|
|
6
|
+
print?: boolean;
|
|
7
7
|
};
|
|
8
8
|
events: {
|
|
9
9
|
[evt: string]: CustomEvent<any>;
|
|
10
10
|
};
|
|
11
11
|
slots: {};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
12
14
|
};
|
|
13
15
|
export type ChapterProps = typeof __propDef.props;
|
|
14
16
|
export type ChapterEvents = typeof __propDef.events;
|