bookish-press 0.5.18 → 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.
@@ -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: 3rem;
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 this={index === 0 ? 'th' : 'td'}>
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,7 +1,7 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
- dark: Boolean;
4
+ dark: boolean;
5
5
  toggle: () => void;
6
6
  };
7
7
  events: {
@@ -11,6 +11,8 @@ export let link = undefined;
11
11
  <style>
12
12
  h3 {
13
13
  font-family: var(--bookish-header-font-family);
14
+ /* Disable heavy weight in this context. */
15
+ font-weight: normal;
14
16
  margin: 0;
15
17
  }
16
18
  </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');
@@ -3,7 +3,7 @@ export let alt;
3
3
  let loaded;
4
4
  let urlChecked;
5
5
  $: {
6
- if (urlChecked !== url) {
6
+ if (urlChecked !== url && typeof Image !== 'undefined') {
7
7
  urlChecked = url;
8
8
  let image = new Image();
9
9
  image.src = url;
@@ -266,6 +266,7 @@ function move(field, direction) {
266
266
  .reference {
267
267
  line-height: var(--bookish-paragraph-line-height-tight);
268
268
  margin-top: 0;
269
+ margin-bottom: var(--bookish-block-padding);
269
270
  }
270
271
 
271
272
  p {
@@ -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), 100));
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.5em',
468
+ paragraphLineHeightTight: '1.9em',
469
469
  headerLineHeight: '1.4em',
470
470
  paragraphSpacing: '1.8rem',
471
471
  headerSpacing: '2rem',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bookish-press",
3
3
  "private": false,
4
- "version": "0.5.18",
4
+ "version": "0.5.21",
5
5
  "type": "module",
6
6
  "description": "A platform for reading and writing readable, accessible, beautiful online books.",
7
7
  "license": "MIT",