bookish-press 0.4.41 → 0.4.43

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.
@@ -41,12 +41,12 @@ function focusFigure() {
41
41
  <slot />
42
42
  </div>
43
43
  {#if caption !== undefined}
44
- <figcaption class="bookish-figure-caption">
44
+ <figcaption class="caption">
45
45
  {#if caption}
46
46
  <Format node={caption} placeholder="caption" />
47
47
  {/if}
48
48
  {#if credit}
49
- <aside class="bookish-figure-credit">
49
+ <aside class="credit">
50
50
  <Format node={credit} placeholder="credit" />
51
51
  </aside>
52
52
  {/if}
@@ -68,7 +68,7 @@ function focusFigure() {
68
68
  filter: opacity(50%);
69
69
  }
70
70
 
71
- .bookish-figure-caption {
71
+ .caption {
72
72
  text-align: center;
73
73
  position: relative;
74
74
  color: var(--bookish-muted-color);
@@ -78,11 +78,11 @@ function focusFigure() {
78
78
  margin-bottom: var(--bookish-block-padding);
79
79
  }
80
80
 
81
- .bookish-figure-credit {
81
+ .credit {
82
82
  display: block;
83
83
  position: absolute;
84
- top: -1em;
85
- right: 0;
84
+ top: calc(-1.2 * var(--bookish-block-padding));
85
+ right: var(--bookish-block-padding);
86
86
  text-align: right;
87
87
  font-style: italic;
88
88
  font-size: var(--bookish-small-font-size);
@@ -14,6 +14,12 @@ export let remove;
14
14
  let edition = getEdition();
15
15
  let authorList = null;
16
16
  let newAuthor = false;
17
+ $: authorsToShow =
18
+ authors.length > 0
19
+ ? authors
20
+ : inheritedAuthors !== undefined && inheritedAuthors.length > 0
21
+ ? inheritedAuthors
22
+ : undefined;
17
23
  function addAuthor() {
18
24
  add();
19
25
  newAuthor = true;
@@ -34,15 +40,12 @@ afterUpdate(() => {
34
40
  </script>
35
41
 
36
42
  <p class="bookish-authors" bind:this={authorList}>
37
- {#if authors.length === 0}
38
- {#if editable && inheritedAuthors !== undefined && inheritedAuthors.length > 0}
39
- <Note>&nbsp;(book authors)&nbsp;</Note>
40
- {:else}
41
- No authors
42
- {/if}
43
+ <!-- Editing and inherited authors? Say they're -->
44
+ {#if authorsToShow === undefined}
45
+ No authors
43
46
  {:else}
44
47
  <em>by </em>
45
- {#each authors as author, index}
48
+ {#each authorsToShow as author, index}
46
49
  {#if editable}
47
50
  <TextEditor
48
51
  text={author}
@@ -65,6 +68,9 @@ afterUpdate(() => {
65
68
  {#if index < authors.length - 1},&nbsp{/if}
66
69
  {/each}
67
70
  {/if}
71
+ {#if editable}
72
+ <Note>(edition authors)&nbsp;</Note>
73
+ {/if}
68
74
  {#if editable}
69
75
  &nbsp;<Button tooltip="add author" command={addAuthor}>+ author</Button>
70
76
  {/if}
@@ -45,12 +45,12 @@ function imagesAreLoaded() {
45
45
  <meta name="description" content={title} />
46
46
  </svelte:head>
47
47
 
48
+ <section class={'bookish-page' + (loaded ? ' loaded' : '')}>
49
+ <slot />
50
+ </section>
51
+ <!-- Overlay loading feedback if loading, but still render the page. -->
48
52
  {#if loaded === false}
49
53
  <Loading />
50
- {:else}
51
- <section class={'bookish-page' + (loaded ? ' loaded' : '')}>
52
- <slot />
53
- </section>
54
54
  {/if}
55
55
 
56
56
  <style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bookish-press",
3
3
  "private": false,
4
- "version": "0.4.41",
4
+ "version": "0.4.43",
5
5
  "type": "module",
6
6
  "description": "A platform for reading and writing readable, accessible, beautiful online books.",
7
7
  "license": "MIT",