bookish-press 0.4.38 → 0.4.40

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.
@@ -6,12 +6,13 @@ import ChapterIDs from '../../models/book/ChapterID';
6
6
  import Format from '../chapter/Format.svelte';
7
7
  import MediaPreview from './MediaPreview.svelte';
8
8
  import { onMount } from 'svelte';
9
- import { getBook, getEdition, isBookEditable, isEditionEditable, } from './Contexts';
9
+ import { getBase, getBook, getEdition, isBookEditable, isEditionEditable, } from './Contexts';
10
10
  import Button from '../app/Button.svelte';
11
11
  import PageHeader from './PageHeader.svelte';
12
12
  let book = getBook();
13
13
  let edition = getEdition();
14
14
  let editable = isBookEditable();
15
+ let base = getBase();
15
16
  let images = [];
16
17
  $: embeds = $edition?.getEmbeds() ?? [];
17
18
  $: media = $book?.getMedia();
@@ -60,7 +61,9 @@ $: unused = images?.filter((image) => embeds.find((embed) => embed.getURL() ===
60
61
  {/if}
61
62
  {#each embeds as embed}
62
63
  <MediaPreview
63
- url={embed.getSmallURL()}
64
+ url={embed.isLocal()
65
+ ? `${$base}/${embed.getSmallURL()}`
66
+ : embed.getSmallURL()}
64
67
  alt={embed.getDescription() === ''
65
68
  ? 'no description, image not used'
66
69
  : embed.getDescription()}
@@ -1,14 +1,10 @@
1
1
  <script>import { getBase } from './Contexts';
2
2
  export let url;
3
3
  export let alt;
4
- let base = getBase();
5
4
  </script>
6
5
 
7
6
  <figure class={'media-preview'}>
8
- <img
9
- src={url.startsWith('http') ? url : `${$base}/images/small/${url}`}
10
- {alt}
11
- />
7
+ <img src={url.startsWith('http') ? url : `${url}`} {alt} />
12
8
  <figcaption class="credit"><slot /></figcaption>
13
9
  </figure>
14
10
 
@@ -140,7 +140,7 @@ let darkLabel = '\u263E';
140
140
  <div class="outline-headers">
141
141
  <!-- Book navigation links -->
142
142
  <div class="outline-header-nav">
143
- {#if previous !== null}<Link to="{$base}/{previous}">
143
+ {#if previous !== null}<Link to="{$base}/{previous}"
144
144
  >{previousLabel}</Link
145
145
  >{:else}<span class="outline-header-nav-disabled"
146
146
  >{previousLabel}</span
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bookish-press",
3
3
  "private": false,
4
- "version": "0.4.38",
4
+ "version": "0.4.40",
5
5
  "type": "module",
6
6
  "description": "A platform for reading and writing readable, accessible, beautiful online books.",
7
7
  "license": "MIT",