bookish-press 0.4.26 → 0.4.28

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.
@@ -175,8 +175,7 @@ $: chapterNumber = $edition?.getChapterNumber(chapterID);
175
175
  $: chapterSection = $edition?.getChapterSection(chapterID);
176
176
  $: chapterAST = $edition ? chapter.getAST($edition) : undefined;
177
177
  $: citations = chapterAST ? chapterAST.getCitations() : undefined;
178
- $: editionNumber =
179
- $book && $edition ? $edition.getEditionNumber() : undefined;
178
+ $: editionNumber = $edition ? $edition.getEditionNumber() : undefined;
180
179
  let chapterStore = writable();
181
180
  setContext(CHAPTER, chapterStore);
182
181
  $: chapterStore.set({
@@ -6,6 +6,8 @@ import { BASE, DARK_MODE, } from './Contexts';
6
6
  import { BookishTheme } from '../../models/book/Theme';
7
7
  // Poly fill smooth scrolling for Safari.
8
8
  onMount(() => smoothscroll.polyfill());
9
+ // The book edition to render.
10
+ export let edition;
9
11
  // The base path allows links to adjust to different routing contexts in which a book is placed.
10
12
  // For example, when the book is hosted alone, all routes might start with the bare root "/",
11
13
  // but when the book is being viewed or edited in the Bookish app, it needs a prefix for the
@@ -15,8 +17,6 @@ export let base = '/';
15
17
  let baseStore = writable(base);
16
18
  $: setContext(BASE, baseStore);
17
19
  $: baseStore.set(base);
18
- // The book edition to render.
19
- export let edition;
20
20
  // Default dark mode to whatever's stored in local storage, if anything.
21
21
  // respect user choice on the website despite the system theme
22
22
  let darkMode = writable(typeof localStorage !== 'undefined' &&
@@ -2,8 +2,8 @@ import { SvelteComponentTyped } from "svelte";
2
2
  import type EditionModel from '../../models/book/Edition';
3
3
  declare const __propDef: {
4
4
  props: {
5
- base?: string | undefined;
6
5
  edition: EditionModel;
6
+ base?: string | undefined;
7
7
  };
8
8
  events: {
9
9
  [evt: string]: CustomEvent<any>;
@@ -9,7 +9,6 @@ import Parser from '../../models/chapter/Parser';
9
9
  import Permissions from '../editor/Permissions.svelte';
10
10
  let book = getBook();
11
11
  let editable = isBookEditable();
12
- let auth = getUser();
13
12
  $: editions = $book?.getEditions();
14
13
  $: latestPublishedID = $book?.getLatestPublishedEditionID();
15
14
  async function handleDraftEdition() {
@@ -63,7 +63,7 @@ function addChapter() {
63
63
  }
64
64
  </script>
65
65
 
66
- {#if $edition && $book}
66
+ {#if $edition}
67
67
  <Page title={$edition.getTitle()}>
68
68
  <Header
69
69
  editable={isEditionEditable()}
@@ -107,9 +107,7 @@ function addChapter() {
107
107
  ? edition.set($edition.withoutAuthor(index))
108
108
  : undefined}
109
109
  />
110
- {#if $book.getPublishedEditionCount() > 1}
111
- <Note>{$edition.getEditionLabel()} edition</Note>
112
- {/if}
110
+ <Note>{$edition.getEditionLabel()} edition</Note>
113
111
  </div>
114
112
  </Header>
115
113
 
@@ -285,7 +283,7 @@ function addChapter() {
285
283
  <Publish />
286
284
  {/if}
287
285
 
288
- {#if editable || isEditionPartiallyEditable()}
286
+ {#if $book && (editable || isEditionPartiallyEditable())}
289
287
  <PageHeader>Editors</PageHeader>
290
288
  <Instructions {editable}>
291
289
  These authors can edit this edition and its chapters. To give
@@ -6,7 +6,7 @@ import { connectStorageEmulator, getStorage } from 'firebase/storage';
6
6
  import { PUBLIC_READER, PUBLIC_CONTEXT, PUBLIC_FIREBASE_API_KEY, PUBLIC_FIREBASE_AUTH_DOMAIN, PUBLIC_FIREBASE_PROJECT_ID, PUBLIC_FIREBASE_STORAGE_BUCKET, PUBLIC_FIREBASE_MESSAGING_SENDER_ID, PUBLIC_FIREBASE_APP_ID, } from '$env/static/public';
7
7
  const isReader = PUBLIC_READER === 'true';
8
8
  // Some feedback about context
9
- if (PUBLIC_CONTEXT !== 'prod')
9
+ if (!isReader && PUBLIC_CONTEXT !== 'prod')
10
10
  console.log(`*** ${PUBLIC_CONTEXT.toLocaleUpperCase()} ***`);
11
11
  // Initialize Firebase using the environment variables provided at build time.
12
12
  // Only do this if we have environment variables defined. (We won't in the standalone Reader).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bookish-press",
3
3
  "private": false,
4
- "version": "0.4.26",
4
+ "version": "0.4.28",
5
5
  "type": "module",
6
6
  "description": "A platform for reading and writing readable, accessible, beautiful online books.",
7
7
  "license": "MIT",