@playpilot/tpi 8.23.0-beta.3 → 8.23.0-beta.4
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/dist/editorial.mount.js +8 -8
- package/dist/link-injections.js +1 -1
- package/dist/mount.js +7 -7
- package/package.json +1 -1
- package/src/lib/data/translations.ts +10 -0
- package/src/routes/components/Description.svelte +12 -4
- package/src/routes/components/Modals/RailModal.svelte +3 -2
- package/src/routes/components/Modals/TitlesReelModal.svelte +2 -1
- package/src/tests/routes/components/Description.test.js +9 -4
package/package.json
CHANGED
|
@@ -146,6 +146,11 @@ export const translations = {
|
|
|
146
146
|
[Language.Swedish]: 'Visa mer',
|
|
147
147
|
[Language.Danish]: 'Vis mere',
|
|
148
148
|
},
|
|
149
|
+
'Show Less': {
|
|
150
|
+
[Language.English]: 'Show less',
|
|
151
|
+
[Language.Swedish]: 'Visa mindre',
|
|
152
|
+
[Language.Danish]: 'Vis mindre',
|
|
153
|
+
},
|
|
149
154
|
'Cast': {
|
|
150
155
|
[Language.English]: 'Cast',
|
|
151
156
|
[Language.Swedish]: 'Rollista',
|
|
@@ -333,6 +338,11 @@ export const translations = {
|
|
|
333
338
|
[Language.Swedish]: 'Snart på Bio',
|
|
334
339
|
[Language.Danish]: 'Kommende film',
|
|
335
340
|
},
|
|
341
|
+
'Explore All Movies And Shows': {
|
|
342
|
+
[Language.English]: 'Explore all movies and TV-shows',
|
|
343
|
+
[Language.Swedish]: 'Utforska alla filmer och TV-serier',
|
|
344
|
+
[Language.Danish]: 'Udforsk alle film og tv-serier',
|
|
345
|
+
},
|
|
336
346
|
|
|
337
347
|
// Genres
|
|
338
348
|
'All': {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { t } from '$lib/localization'
|
|
3
|
+
|
|
2
4
|
interface Props {
|
|
3
5
|
text: string
|
|
4
6
|
blurb?: string
|
|
@@ -12,8 +14,8 @@
|
|
|
12
14
|
|
|
13
15
|
const limitedText = $derived(text.slice(0, limit))
|
|
14
16
|
|
|
15
|
-
function
|
|
16
|
-
expanded =
|
|
17
|
+
function toggle(): void {
|
|
18
|
+
expanded = !expanded
|
|
17
19
|
onclick()
|
|
18
20
|
}
|
|
19
21
|
</script>
|
|
@@ -23,7 +25,7 @@
|
|
|
23
25
|
{expanded ? text : limitedText}{#if !expanded && text.length > limit}...{/if}
|
|
24
26
|
|
|
25
27
|
{#if !expanded && (text.length > limit || blurb)}
|
|
26
|
-
<button class="
|
|
28
|
+
<button class="toggle" onclick={toggle}>{t('Show More')}</button>
|
|
27
29
|
{/if}
|
|
28
30
|
</span>
|
|
29
31
|
|
|
@@ -32,10 +34,16 @@
|
|
|
32
34
|
{/if}
|
|
33
35
|
</div>
|
|
34
36
|
|
|
37
|
+
{#if expanded}
|
|
38
|
+
<button class="toggle" onclick={toggle}>{t('Show Less')}</button>
|
|
39
|
+
{/if}
|
|
40
|
+
|
|
35
41
|
<style lang="scss">
|
|
36
42
|
.description:first-child {
|
|
37
43
|
margin: margin(-1) 0 margin(1);
|
|
38
44
|
max-width: theme(description-max-width, 100%);
|
|
45
|
+
max-height: theme(description-max-height, 100vh);
|
|
46
|
+
overflow: auto;
|
|
39
47
|
}
|
|
40
48
|
|
|
41
49
|
.paragraph {
|
|
@@ -44,7 +52,7 @@
|
|
|
44
52
|
font-family: theme(description-font-family, font-family);
|
|
45
53
|
}
|
|
46
54
|
|
|
47
|
-
.
|
|
55
|
+
.toggle {
|
|
48
56
|
display: inline;
|
|
49
57
|
appearance: none;
|
|
50
58
|
padding: 0;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { onMount, type Snippet } from 'svelte'
|
|
3
3
|
import TinySlider from 'svelte-tiny-slider'
|
|
4
4
|
import { fade } from 'svelte/transition'
|
|
5
|
+
import { t } from '$lib/localization'
|
|
5
6
|
import Modal from './Modal.svelte'
|
|
6
7
|
import IconArrow from '../Icons/IconArrow.svelte'
|
|
7
8
|
import ModalCloseOverlay from './ModalCloseOverlay.svelte'
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
</div>
|
|
75
76
|
|
|
76
77
|
<div class="close">
|
|
77
|
-
<ModalCloseOverlay {onclose} label={window.location.href.includes('route=modal') ? '
|
|
78
|
+
<ModalCloseOverlay {onclose} label={window.location.href.includes('route=modal') ? t('Explore All Movies And Shows') : ''} />
|
|
78
79
|
</div>
|
|
79
80
|
{/snippet}
|
|
80
81
|
</Modal>
|
|
@@ -209,6 +210,6 @@
|
|
|
209
210
|
}
|
|
210
211
|
|
|
211
212
|
.close {
|
|
212
|
-
--modal-close-overlay-left: calc((100vw - $size) / 2)
|
|
213
|
+
--modal-close-overlay-left: calc((100vw - #{$size}) / 2);
|
|
213
214
|
}
|
|
214
215
|
</style>
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
</TinySlider>
|
|
84
84
|
</div>
|
|
85
85
|
|
|
86
|
-
<ModalCloseOverlay label=
|
|
86
|
+
<ModalCloseOverlay label={t('Explore All Movies And Shows')} />
|
|
87
87
|
{/snippet}
|
|
88
88
|
</Modal>
|
|
89
89
|
</div>
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
--playpilot-detail-background-border-radius: 0;
|
|
98
98
|
--playpilot-detail-background-width: 400%;
|
|
99
99
|
--playpilot-detail-backdrop: rgba(0, 0, 0, 0.85);
|
|
100
|
+
--playpilot-description-max-height: 40dvh;
|
|
100
101
|
|
|
101
102
|
:global(*) {
|
|
102
103
|
box-sizing: border-box;
|
|
@@ -23,15 +23,20 @@ describe('Description.svelte', () => {
|
|
|
23
23
|
expect(queryByRole('button')).not.toBeTruthy()
|
|
24
24
|
})
|
|
25
25
|
|
|
26
|
-
it('Should expand description and
|
|
27
|
-
const { getByText,
|
|
26
|
+
it('Should expand description and collapse again after clicking Show more and Show less', async () => {
|
|
27
|
+
const { getByText, queryByText } = render(Description, { text: 'Some test description', limit: 5 })
|
|
28
28
|
|
|
29
29
|
expect(getByText('Some ...')).toBeTruthy()
|
|
30
30
|
|
|
31
|
-
await fireEvent.click(/** @type {Node} **/(
|
|
31
|
+
await fireEvent.click(/** @type {Node} **/(getByText('Show more')))
|
|
32
32
|
|
|
33
33
|
expect(getByText('Some test description')).toBeTruthy()
|
|
34
|
-
expect(
|
|
34
|
+
expect(queryByText('Show more')).not.toBeTruthy()
|
|
35
|
+
|
|
36
|
+
await fireEvent.click(/** @type {Node} **/(getByText('Show less')))
|
|
37
|
+
|
|
38
|
+
expect(queryByText('Some test description')).not.toBeTruthy()
|
|
39
|
+
expect(queryByText('Show less')).not.toBeTruthy()
|
|
35
40
|
})
|
|
36
41
|
|
|
37
42
|
it('Should include blurb after expanding if given', async () => {
|