bookish-press 0.4.40 → 0.4.42
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/components/chapter/Embed.svelte +1 -1
- package/components/chapter/Figure.svelte +6 -6
- package/components/page/Authors.svelte +13 -7
- package/components/page/Media.svelte +22 -20
- package/components/page/MediaPreview.svelte +1 -2
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/models/chapter/EmbedNode.d.ts +1 -0
- package/models/chapter/EmbedNode.js +6 -0
- package/package.json +1 -1
|
@@ -117,7 +117,7 @@ function handleClick() {
|
|
|
117
117
|
{:else}
|
|
118
118
|
<p class="bookish-figure-unspecified">No image or video</p>
|
|
119
119
|
{/if}
|
|
120
|
-
{:else if
|
|
120
|
+
{:else if node.isVideo()}
|
|
121
121
|
<article class="bookish-figure-embed">
|
|
122
122
|
<iframe
|
|
123
123
|
class="bookish-figure-frame"
|
|
@@ -41,12 +41,12 @@ function focusFigure() {
|
|
|
41
41
|
<slot />
|
|
42
42
|
</div>
|
|
43
43
|
{#if caption !== undefined}
|
|
44
|
-
<figcaption class="
|
|
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="
|
|
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
|
-
.
|
|
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
|
-
.
|
|
81
|
+
.credit {
|
|
82
82
|
display: block;
|
|
83
83
|
position: absolute;
|
|
84
|
-
top: -
|
|
85
|
-
right:
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
|
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}, {/if}
|
|
66
69
|
{/each}
|
|
67
70
|
{/if}
|
|
71
|
+
{#if editable}
|
|
72
|
+
<Note>(edition authors) </Note>
|
|
73
|
+
{/if}
|
|
68
74
|
{#if editable}
|
|
69
75
|
<Button tooltip="add author" command={addAuthor}>+ author</Button>
|
|
70
76
|
{/if}
|
|
@@ -57,29 +57,31 @@ $: unused = images?.filter((image) => embeds.find((embed) => embed.getURL() ===
|
|
|
57
57
|
{#if embeds.length === 0}
|
|
58
58
|
<p>No images or videos appear in the book.</p>
|
|
59
59
|
{:else}
|
|
60
|
-
<p>These are the images
|
|
60
|
+
<p>These are the images in the book:</p>
|
|
61
61
|
{/if}
|
|
62
62
|
{#each embeds as embed}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<span
|
|
72
|
-
>{#if editable}{images &&
|
|
73
|
-
images.find((i) => i.url === embed.getURL()) ===
|
|
74
|
-
undefined
|
|
75
|
-
? 'linked'
|
|
76
|
-
: 'uploaded'}{embed.getCredit().isEmptyText()
|
|
77
|
-
? ''
|
|
78
|
-
: ' • '}{/if}<Format
|
|
79
|
-
node={embed.getCredit()}
|
|
80
|
-
/></span
|
|
63
|
+
{#if !embed.isVideo()}
|
|
64
|
+
<MediaPreview
|
|
65
|
+
url={embed.isLocal()
|
|
66
|
+
? `${$base}/${embed.getSmallURL()}`
|
|
67
|
+
: embed.getSmallURL()}
|
|
68
|
+
alt={embed.getDescription() === ''
|
|
69
|
+
? 'no description, image not used'
|
|
70
|
+
: embed.getDescription()}
|
|
81
71
|
>
|
|
82
|
-
|
|
72
|
+
<span
|
|
73
|
+
>{#if editable}{images &&
|
|
74
|
+
images.find((i) => i.url === embed.getURL()) ===
|
|
75
|
+
undefined
|
|
76
|
+
? 'linked'
|
|
77
|
+
: 'uploaded'}{embed.getCredit().isEmptyText()
|
|
78
|
+
? ''
|
|
79
|
+
: ' • '}{/if}<Format
|
|
80
|
+
node={embed.getCredit()}
|
|
81
|
+
/></span
|
|
82
|
+
>
|
|
83
|
+
</MediaPreview>
|
|
84
|
+
{/if}
|
|
83
85
|
{/each}
|
|
84
86
|
{#if editable && unused !== undefined && unused.length > 0}
|
|
85
87
|
<PageHeader id="unused">Unused</PageHeader>
|
package/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { default as References } from "./components/page/References.svelte";
|
|
|
5
5
|
export { default as PossibleChapter } from "./components/page/PossibleChapter.svelte";
|
|
6
6
|
export { default as Media } from "./components/page/Media.svelte";
|
|
7
7
|
export { default as Print } from "./components/page/Print.svelte";
|
|
8
|
+
export { default as Unknown } from "./components/page/Unknown.svelte";
|
|
8
9
|
export { default as Glossary } from "./components/page/Glossary.svelte";
|
|
9
10
|
export { default as Edition } from "./components/page/Edition.svelte";
|
|
10
11
|
export { default as Feedback } from "./components/app/Feedback.svelte";
|
package/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { default as References } from './components/page/References.svelte';
|
|
|
5
5
|
export { default as PossibleChapter } from './components/page/PossibleChapter.svelte';
|
|
6
6
|
export { default as Media } from './components/page/Media.svelte';
|
|
7
7
|
export { default as Print } from './components/page/Print.svelte';
|
|
8
|
+
export { default as Unknown } from './components/page/Unknown.svelte';
|
|
8
9
|
export { default as Glossary } from './components/page/Glossary.svelte';
|
|
9
10
|
export { default as Edition } from './components/page/Edition.svelte';
|
|
10
11
|
export { default as Feedback } from './components/app/Feedback.svelte';
|
|
@@ -9,6 +9,7 @@ export default class EmbedNode extends BlockNode {
|
|
|
9
9
|
#private;
|
|
10
10
|
constructor(url: string, description: string, caption?: FormatNode, credit?: FormatNode, position?: Position);
|
|
11
11
|
getType(): string;
|
|
12
|
+
isVideo(): boolean;
|
|
12
13
|
getURL(): string;
|
|
13
14
|
getSmallURL(): string;
|
|
14
15
|
hasSmallURL(): boolean;
|
|
@@ -30,6 +30,12 @@ export default class EmbedNode extends BlockNode {
|
|
|
30
30
|
getType() {
|
|
31
31
|
return 'embed';
|
|
32
32
|
}
|
|
33
|
+
isVideo() {
|
|
34
|
+
return (this.#urls.includes('https://www.youtube.com') ||
|
|
35
|
+
this.#urls.includes('https://youtu.be') ||
|
|
36
|
+
this.#urls.includes('https://www.tiktok.com') ||
|
|
37
|
+
this.#urls.includes('vimeo.com'));
|
|
38
|
+
}
|
|
33
39
|
getURL() {
|
|
34
40
|
return this.#urls.split(URL_SEPARATOR)[0];
|
|
35
41
|
}
|