bookish-press 0.5.19 → 0.5.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/dist/components/chapter/Citations.svelte +0 -3
- package/dist/components/chapter/Python.svelte +2 -2
- package/dist/components/chapter/Table.svelte +7 -1
- package/dist/components/controls/DarkToggle.svelte.d.ts +1 -1
- package/dist/components/page/ChapterTitle.svelte +2 -0
- package/dist/components/page/Edition.svelte +4 -1
- package/dist/components/page/MediaPreview.svelte +1 -1
- package/dist/components/page/Reference.svelte +1 -0
- package/dist/models/book/BookMedia.js +1 -1
- package/dist/models/book/Theme.js +1 -1
- package/package.json +1 -1
|
@@ -110,8 +110,6 @@ afterUpdate(() => $chapter?.layoutMarginals());
|
|
|
110
110
|
.bookish-references .bookish-reference {
|
|
111
111
|
display: block;
|
|
112
112
|
line-height: var(--bookish-paragraph-line-height-tight);
|
|
113
|
-
margin-left: 1rem;
|
|
114
|
-
margin-bottom: 1rem;
|
|
115
113
|
text-align: left;
|
|
116
114
|
}
|
|
117
115
|
|
|
@@ -125,7 +123,6 @@ afterUpdate(() => $chapter?.layoutMarginals());
|
|
|
125
123
|
.bookish-reference .bookish-citation-symbol {
|
|
126
124
|
display: block;
|
|
127
125
|
float: left;
|
|
128
|
-
margin-top: -0.5em;
|
|
129
126
|
position: absolute;
|
|
130
127
|
left: -1.75em;
|
|
131
128
|
text-align: right;
|
|
@@ -34,7 +34,7 @@ afterUpdate(() => {
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
function skulptLoaded() {
|
|
37
|
-
return window.hasOwnProperty('Sk');
|
|
37
|
+
return typeof window !== 'undefined' && window.hasOwnProperty('Sk');
|
|
38
38
|
}
|
|
39
39
|
function reset() {
|
|
40
40
|
code = startCode;
|
|
@@ -116,7 +116,7 @@ $: lines = output.split('\n');
|
|
|
116
116
|
flex: 1;
|
|
117
117
|
border: 1px solid lightGray;
|
|
118
118
|
padding: 0.5rem;
|
|
119
|
-
height:
|
|
119
|
+
height: 2rem;
|
|
120
120
|
overflow-y: scroll;
|
|
121
121
|
display: inline-block;
|
|
122
122
|
vertical-align: top;
|
|
@@ -14,7 +14,8 @@ $: rows = node.getRows();
|
|
|
14
14
|
{#each rows as row, index}
|
|
15
15
|
<tr class={editable ? 'editable' : null}>
|
|
16
16
|
{#if row.length === 1}
|
|
17
|
-
<svelte:element
|
|
17
|
+
<svelte:element
|
|
18
|
+
this={index === 0 ? 'th' : 'td'}
|
|
18
19
|
colspan={rows.reduce(
|
|
19
20
|
(max, row) => Math.max(row.length, max),
|
|
20
21
|
0
|
|
@@ -37,4 +38,9 @@ $: rows = node.getRows();
|
|
|
37
38
|
tr.editable th {
|
|
38
39
|
border: 1px dotted var(--app-border-color);
|
|
39
40
|
}
|
|
41
|
+
|
|
42
|
+
td,
|
|
43
|
+
th {
|
|
44
|
+
vertical-align: baseline;
|
|
45
|
+
}
|
|
40
46
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import smoothscroll from 'smoothscroll-polyfill';
|
|
2
2
|
import { goto } from '$app/navigation';
|
|
3
|
-
import { onMount, setContext } from 'svelte';
|
|
3
|
+
import { onMount, setContext, tick } from 'svelte';
|
|
4
4
|
import { writable } from 'svelte/store';
|
|
5
5
|
import { BASE, DARK_MODE, } from './Contexts';
|
|
6
6
|
import { BookishTheme } from '../../models/book/Theme';
|
|
@@ -38,6 +38,9 @@ if (typeof window !== 'undefined' && window.location.hash.startsWith('#/'))
|
|
|
38
38
|
goto(location.hash.replace('#', ''));
|
|
39
39
|
/** Given a theme, sets the appropriate CSS rules in the browser to apply the theme.*/
|
|
40
40
|
function setTheme(theme) {
|
|
41
|
+
// Allow for prerendering; rely on mount callback to set the theme.
|
|
42
|
+
if (typeof document === 'undefined')
|
|
43
|
+
return;
|
|
41
44
|
// If the theme is being unset, make sure we've removed any overrding style declaration.
|
|
42
45
|
// This let's the default theme kick in.
|
|
43
46
|
let themeTagImports = document.getElementById('bookish-theme-imports');
|
|
@@ -59,7 +59,7 @@ export default class BookMedia {
|
|
|
59
59
|
// Try again in a bit.
|
|
60
60
|
.catch(() => attempt > 25
|
|
61
61
|
? error("Couldn't get the image's thumbnail URL")
|
|
62
|
-
: setTimeout(() => this.getThumbnailURL(url, thumbnailRef, error, finished, attempt + 1),
|
|
62
|
+
: setTimeout(() => this.getThumbnailURL(url, thumbnailRef, error, finished, attempt + 1), 200));
|
|
63
63
|
}
|
|
64
64
|
upload(file, _, errorHandler, finishedHandler) {
|
|
65
65
|
if (storage === undefined)
|
|
@@ -465,7 +465,7 @@ export const CriticalTheme = {
|
|
|
465
465
|
// Spacing
|
|
466
466
|
spacing: {
|
|
467
467
|
paragraphLineHeight: '2.2em',
|
|
468
|
-
paragraphLineHeightTight: '1.
|
|
468
|
+
paragraphLineHeightTight: '1.9em',
|
|
469
469
|
headerLineHeight: '1.4em',
|
|
470
470
|
paragraphSpacing: '1.8rem',
|
|
471
471
|
headerSpacing: '2rem',
|