@playpilot/tpi 8.35.0-beta.2 → 8.35.1
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 +10 -11
- package/dist/link-injections.js +2 -2
- package/dist/mount.css +1 -0
- package/dist/mount.js +8 -9
- package/package.json +1 -1
- package/src/lib/data/translations.ts +0 -40
- package/src/lib/fakeData.ts +0 -6
- package/src/lib/types/filter.d.ts +2 -5
- package/src/lib/types/participant.d.ts +1 -1
- package/src/main.ts +24 -3
- package/src/routes/components/Explore/Filter/Filter.svelte +4 -10
- package/src/routes/components/Explore/Filter/FilterSorting.svelte +4 -5
- package/src/routes/components/Explore/Routes/ExploreResults.svelte +7 -12
- package/src/routes/components/GridTitle.svelte +4 -11
- package/src/routes/components/Modals/Modal.svelte +1 -1
- package/src/routes/components/Modals/ParticipantModal.svelte +5 -1
- package/src/routes/components/Participants/Participant.svelte +135 -75
- package/src/tests/main.test.js +2 -1
- package/src/tests/routes/components/Participants/Participant.test.js +14 -52
- package/vite._mount.config.js +1 -3
package/package.json
CHANGED
|
@@ -151,16 +151,6 @@ export const translations = {
|
|
|
151
151
|
[Language.Swedish]: 'Visa mindre',
|
|
152
152
|
[Language.Danish]: 'Vis mindre',
|
|
153
153
|
},
|
|
154
|
-
'Read More': {
|
|
155
|
-
[Language.English]: 'Read more',
|
|
156
|
-
[Language.Swedish]: 'Läs mer',
|
|
157
|
-
[Language.Danish]: 'Læs mere',
|
|
158
|
-
},
|
|
159
|
-
'Read Less': {
|
|
160
|
-
[Language.English]: 'Read less',
|
|
161
|
-
[Language.Swedish]: 'Läs mindre',
|
|
162
|
-
[Language.Danish]: 'Læs mindre',
|
|
163
|
-
},
|
|
164
154
|
'Cast': {
|
|
165
155
|
[Language.English]: 'Cast',
|
|
166
156
|
[Language.Swedish]: 'Rollista',
|
|
@@ -368,36 +358,6 @@ export const translations = {
|
|
|
368
358
|
[Language.Swedish]: 'Utforska alla filmer och tv-serier',
|
|
369
359
|
[Language.Danish]: 'Udforsk alle film og tv-serier',
|
|
370
360
|
},
|
|
371
|
-
'Job: all': {
|
|
372
|
-
[Language.English]: 'All',
|
|
373
|
-
[Language.Swedish]: 'Alla',
|
|
374
|
-
[Language.Danish]: 'Alle',
|
|
375
|
-
},
|
|
376
|
-
'Job: actor': {
|
|
377
|
-
[Language.English]: 'Actor',
|
|
378
|
-
[Language.Swedish]: 'Skådespelare',
|
|
379
|
-
[Language.Danish]: 'Skuespiller',
|
|
380
|
-
},
|
|
381
|
-
'Job: producer': {
|
|
382
|
-
[Language.English]: 'Producer',
|
|
383
|
-
[Language.Swedish]: 'Producent',
|
|
384
|
-
[Language.Danish]: 'Producer',
|
|
385
|
-
},
|
|
386
|
-
'Job: executive-producer': {
|
|
387
|
-
[Language.English]: 'Executive Producer',
|
|
388
|
-
[Language.Swedish]: 'Verkställande producent',
|
|
389
|
-
[Language.Danish]: 'Administrerende producer',
|
|
390
|
-
},
|
|
391
|
-
'Job: writer': {
|
|
392
|
-
[Language.English]: 'Writer',
|
|
393
|
-
[Language.Swedish]: 'Manusförfattare',
|
|
394
|
-
[Language.Danish]: 'Manuskriptforfatter',
|
|
395
|
-
},
|
|
396
|
-
'Job: director': {
|
|
397
|
-
[Language.English]: 'Director',
|
|
398
|
-
[Language.Swedish]: 'Regissör',
|
|
399
|
-
[Language.Danish]: 'Instruktør',
|
|
400
|
-
},
|
|
401
361
|
|
|
402
362
|
// Genres
|
|
403
363
|
'All': {
|
package/src/lib/fakeData.ts
CHANGED
|
@@ -54,7 +54,6 @@ export const participants: ParticipantData[] = [
|
|
|
54
54
|
image_uuid: null,
|
|
55
55
|
gender: 'Male',
|
|
56
56
|
character: 'Will Rodman (archive footage) (uncredited)',
|
|
57
|
-
description: 'Some description',
|
|
58
57
|
},
|
|
59
58
|
{
|
|
60
59
|
sid: 'pr8bZm',
|
|
@@ -66,7 +65,6 @@ export const participants: ParticipantData[] = [
|
|
|
66
65
|
image_uuid: null,
|
|
67
66
|
gender: 'Male',
|
|
68
67
|
character: 'Old Man',
|
|
69
|
-
description: 'Some description',
|
|
70
68
|
},
|
|
71
69
|
{
|
|
72
70
|
sid: 'pr45Dp',
|
|
@@ -78,7 +76,6 @@ export const participants: ParticipantData[] = [
|
|
|
78
76
|
image_uuid: null,
|
|
79
77
|
gender: 'Male',
|
|
80
78
|
character: 'Self (archive footage) (uncredited)',
|
|
81
|
-
description: 'Some description',
|
|
82
79
|
},
|
|
83
80
|
{
|
|
84
81
|
sid: 'pr6DnN',
|
|
@@ -90,7 +87,6 @@ export const participants: ParticipantData[] = [
|
|
|
90
87
|
image_uuid: null,
|
|
91
88
|
gender: 'Male',
|
|
92
89
|
character: 'Dreyfus',
|
|
93
|
-
description: 'Some description',
|
|
94
90
|
},
|
|
95
91
|
{
|
|
96
92
|
sid: 'pr7GK8',
|
|
@@ -102,7 +98,6 @@ export const participants: ParticipantData[] = [
|
|
|
102
98
|
image_uuid: null,
|
|
103
99
|
gender: 'Male',
|
|
104
100
|
character: 'Cannon-Gunner',
|
|
105
|
-
description: 'Some description',
|
|
106
101
|
},
|
|
107
102
|
{
|
|
108
103
|
sid: 'pr88KG',
|
|
@@ -114,7 +109,6 @@ export const participants: ParticipantData[] = [
|
|
|
114
109
|
image_uuid: null,
|
|
115
110
|
gender: 'Female',
|
|
116
111
|
character: 'Cornelia',
|
|
117
|
-
description: 'Some description',
|
|
118
112
|
},
|
|
119
113
|
]
|
|
120
114
|
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type { Sorting } from '$lib/enums/Sorting'
|
|
2
|
-
|
|
3
1
|
export type ExploreFilterType = 'array' | 'range' | 'string'
|
|
4
|
-
export type ExploreFilterItem = { type: ExploreFilterType
|
|
2
|
+
export type ExploreFilterItem = { type: ExploreFilterType, value: unknown }
|
|
5
3
|
export type ExploreFilter = Record<string, ExploreFilterItem>
|
|
6
|
-
export type ExploreFilterItemArrayValue = { label: string
|
|
7
|
-
export type ExploreTitleSorting = { label: string; value: (typeof Sorting)[keyof typeof Sorting] }
|
|
4
|
+
export type ExploreFilterItemArrayValue = { label: string, value: string }
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export type ParticipantData = {
|
|
2
2
|
sid: string
|
|
3
3
|
name: string
|
|
4
|
-
description: string
|
|
5
4
|
birth_date: string
|
|
6
5
|
death_date: string | null
|
|
7
6
|
jobs: Job[]
|
|
@@ -17,6 +16,7 @@ export type ParticipantData = {
|
|
|
17
16
|
}
|
|
18
17
|
gender: string
|
|
19
18
|
character?: string | null
|
|
19
|
+
bio?: string | null
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export type Job = 'actor' | 'writer' | 'director'
|
package/src/main.ts
CHANGED
|
@@ -83,17 +83,38 @@ window.PlayPilotLinkInjections ||= {
|
|
|
83
83
|
},
|
|
84
84
|
|
|
85
85
|
mount(): void {
|
|
86
|
+
const scriptId = 'playpilot-mount'
|
|
87
|
+
const styleId = 'playpilot-mount-style'
|
|
88
|
+
|
|
89
|
+
const ondoubleload = (event: Event): void => {
|
|
90
|
+
if (!event.target) return
|
|
91
|
+
|
|
92
|
+
(event.target as HTMLElement).dataset.loaded = 'true'
|
|
93
|
+
|
|
94
|
+
if (document.getElementById(scriptId)?.dataset.loaded !== 'true' || document.getElementById(styleId)?.dataset.loaded !== 'true') return
|
|
95
|
+
|
|
96
|
+
window.PlayPilotMount?.mount()
|
|
97
|
+
}
|
|
98
|
+
|
|
86
99
|
const shouldLoadEditorial = isEditorialModeEnabled() || getAuthToken()
|
|
87
100
|
|
|
88
101
|
const script = document.createElement('script')
|
|
89
|
-
|
|
90
|
-
script.id = 'playpilot-mount'
|
|
102
|
+
script.id = scriptId
|
|
91
103
|
script.src = `${cdnBaseUrl}/dist/${shouldLoadEditorial ? 'editorial.' : ''}mount.js`
|
|
92
104
|
// script.src = './dist/mount.js' // Use me during development of this script
|
|
105
|
+
script.defer = true
|
|
106
|
+
script.onload = ondoubleload
|
|
93
107
|
|
|
94
|
-
|
|
108
|
+
const style = document.createElement('link')
|
|
109
|
+
style.id = styleId
|
|
110
|
+
style.rel = 'stylesheet'
|
|
111
|
+
style.type = 'text/css'
|
|
112
|
+
style.href = `${cdnBaseUrl}/dist/mount.css`
|
|
113
|
+
// style.href = './dist/mount.css' // Use me during development of this script
|
|
114
|
+
style.onload = ondoubleload
|
|
95
115
|
|
|
96
116
|
document.body.appendChild(script)
|
|
117
|
+
document.head.appendChild(style)
|
|
97
118
|
},
|
|
98
119
|
}
|
|
99
120
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { ExploreFilter
|
|
2
|
+
import type { ExploreFilter } from '$lib/types/filter'
|
|
3
3
|
import genres from '$lib/data/genres.json'
|
|
4
4
|
import { fetchProviders } from '$lib/api/providers'
|
|
5
5
|
import { t } from '$lib/localization'
|
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
interface Props {
|
|
17
17
|
filter: ExploreFilter
|
|
18
18
|
limit?: boolean
|
|
19
|
-
hideActive?: boolean
|
|
20
19
|
showSorting?: boolean
|
|
21
|
-
sortings?: null | ExploreTitleSorting[]
|
|
22
20
|
searchQuery?: string
|
|
23
21
|
onchange?: () => void
|
|
24
22
|
onempty?: () => void
|
|
@@ -27,9 +25,7 @@
|
|
|
27
25
|
const {
|
|
28
26
|
filter,
|
|
29
27
|
limit = true,
|
|
30
|
-
hideActive = false,
|
|
31
28
|
showSorting = true,
|
|
32
|
-
sortings = null,
|
|
33
29
|
searchQuery = '',
|
|
34
30
|
onchange = () => null,
|
|
35
31
|
onempty = () => null,
|
|
@@ -69,7 +65,7 @@
|
|
|
69
65
|
data: [{ label: t('Movies'), value: 'movie' }, { label: t('Shows'), value: 'series' }, { label: t('Kids'), value: 'kids' }, { label: t('Documentary'), value: 'documentary' }],
|
|
70
66
|
}]
|
|
71
67
|
|
|
72
|
-
let limited = $
|
|
68
|
+
let limited = $state(limit)
|
|
73
69
|
let wasPreviouslyActive = false
|
|
74
70
|
|
|
75
71
|
$effect(() => {
|
|
@@ -108,15 +104,13 @@
|
|
|
108
104
|
|
|
109
105
|
{#if showSorting}
|
|
110
106
|
<div class="sorting" transition:fly={{ x: 5, duration: 100 }}>
|
|
111
|
-
<FilterSorting {filter} {onchange}
|
|
107
|
+
<FilterSorting {filter} {onchange} />
|
|
112
108
|
</div>
|
|
113
109
|
{/if}
|
|
114
110
|
</div>
|
|
115
111
|
</div>
|
|
116
112
|
|
|
117
|
-
{
|
|
118
|
-
<ActiveFilterItems {filter} {items} />
|
|
119
|
-
{/if}
|
|
113
|
+
<ActiveFilterItems {filter} {items} />
|
|
120
114
|
|
|
121
115
|
<style lang="scss">
|
|
122
116
|
.filter {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Button from '../../Button.svelte'
|
|
3
3
|
import IconArrow from '../../Icons/IconArrow.svelte'
|
|
4
|
-
import type { ExploreFilter
|
|
4
|
+
import type { ExploreFilter } from '$lib/types/filter'
|
|
5
5
|
import { t } from '$lib/localization'
|
|
6
6
|
import Dropdown from './Dropdown.svelte'
|
|
7
7
|
import { Sorting } from '$lib/enums/Sorting'
|
|
@@ -9,18 +9,17 @@
|
|
|
9
9
|
interface Props {
|
|
10
10
|
filter: ExploreFilter
|
|
11
11
|
onchange?: () => void
|
|
12
|
-
sortings?: null | ExploreTitleSorting[]
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
const { filter, onchange = () => null
|
|
14
|
+
const { filter, onchange = () => null }: Props = $props()
|
|
16
15
|
|
|
17
16
|
const param = 'ordering'
|
|
18
17
|
|
|
19
|
-
const options =
|
|
18
|
+
const options = [
|
|
20
19
|
{ label: 'Popularity', value: Sorting.Popular },
|
|
21
20
|
{ label: 'New', value: Sorting.New },
|
|
22
21
|
{ label: 'Top Rated', value: Sorting.Best },
|
|
23
|
-
]
|
|
22
|
+
]
|
|
24
23
|
|
|
25
24
|
const label = $derived(options.find(({ value }) => value === filter[param]?.value)?.label || 'Sort By')
|
|
26
25
|
|
|
@@ -21,11 +21,9 @@
|
|
|
21
21
|
searchQuery?: string,
|
|
22
22
|
filter?: ExploreFilter
|
|
23
23
|
forceGrid?: boolean
|
|
24
|
-
hidePlaylinks?: boolean
|
|
25
|
-
onTitleClick?: null | ((event: MouseEvent, titles: TitleData[], index: number) => void)
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
const { searchQuery = '', filter = {}, forceGrid = false
|
|
26
|
+
const { searchQuery = '', filter = {}, forceGrid = false }: Props = $props()
|
|
29
27
|
|
|
30
28
|
// svelte-ignore non_reactive_update
|
|
31
29
|
let page = 1
|
|
@@ -55,7 +53,9 @@
|
|
|
55
53
|
if (filter) setFilter()
|
|
56
54
|
})
|
|
57
55
|
|
|
58
|
-
onDestroy(
|
|
56
|
+
onDestroy(() => {
|
|
57
|
+
emptyFilter()
|
|
58
|
+
})
|
|
59
59
|
|
|
60
60
|
async function getTitlesForFilter(): Promise<APIPaginatedResult<TitleData>> {
|
|
61
61
|
latestRequestId += 1
|
|
@@ -132,12 +132,7 @@
|
|
|
132
132
|
track(TrackingEvent.ExploreShowMore, null, { page })
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
function openTitle(event: MouseEvent, title: TitleData
|
|
136
|
-
if (onTitleClick) {
|
|
137
|
-
onTitleClick(event, titles, index)
|
|
138
|
-
return
|
|
139
|
-
}
|
|
140
|
-
|
|
135
|
+
function openTitle(event: MouseEvent, title: TitleData): void {
|
|
141
136
|
openModal({ event, data: title })
|
|
142
137
|
track(TrackingEvent.ExploreTitleClick, title)
|
|
143
138
|
}
|
|
@@ -152,9 +147,9 @@
|
|
|
152
147
|
</script>
|
|
153
148
|
|
|
154
149
|
<div class="titles" class:grid role="main" style:--grid-columns={gridColumns} bind:clientWidth={width} data-testid="explore-results">
|
|
155
|
-
{#each titles as title
|
|
150
|
+
{#each titles as title}
|
|
156
151
|
{#key title.sid}
|
|
157
|
-
<TitleComponent {title}
|
|
152
|
+
<TitleComponent {title} onclick={(event: MouseEvent) => openTitle(event, title)} />
|
|
158
153
|
{/key}
|
|
159
154
|
{/each}
|
|
160
155
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { TitleData } from '$lib/types/title'
|
|
3
|
-
import { getContext } from 'svelte'
|
|
4
3
|
import IconIMDb from './Icons/IconIMDb.svelte'
|
|
5
4
|
import PlaylinksCompact from './Playlinks/PlaylinksCompact.svelte'
|
|
6
5
|
import TitlePoster from './TitlePoster.svelte'
|
|
@@ -8,10 +7,9 @@
|
|
|
8
7
|
interface Props {
|
|
9
8
|
title: TitleData
|
|
10
9
|
onclick?: (event: MouseEvent) => void
|
|
11
|
-
hidePlaylinks?: boolean
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
const { title, onclick = () => null
|
|
12
|
+
const { title, onclick = () => null }: Props = $props()
|
|
15
13
|
</script>
|
|
16
14
|
|
|
17
15
|
<button class="title" {onclick} data-testid="title">
|
|
@@ -35,11 +33,9 @@
|
|
|
35
33
|
</div>
|
|
36
34
|
|
|
37
35
|
<div class="content">
|
|
38
|
-
<div class="heading"
|
|
36
|
+
<div class="heading">{title.title}</div>
|
|
39
37
|
|
|
40
|
-
{
|
|
41
|
-
<PlaylinksCompact playlinks={title.providers} size={20} />
|
|
42
|
-
{/if}
|
|
38
|
+
<PlaylinksCompact playlinks={title.providers} size={20} />
|
|
43
39
|
</div>
|
|
44
40
|
</button>
|
|
45
41
|
|
|
@@ -85,6 +81,7 @@
|
|
|
85
81
|
}
|
|
86
82
|
|
|
87
83
|
.heading {
|
|
84
|
+
margin-bottom: margin(0.5);
|
|
88
85
|
overflow: hidden;
|
|
89
86
|
text-overflow: ellipsis;
|
|
90
87
|
white-space: nowrap;
|
|
@@ -99,10 +96,6 @@
|
|
|
99
96
|
color: theme(grid-item-title-hover-text-color, text-color);
|
|
100
97
|
text-decoration: theme(grid-item-title-hover-text-decoration, none);
|
|
101
98
|
}
|
|
102
|
-
|
|
103
|
-
&.margin {
|
|
104
|
-
margin-bottom: margin(0.5);
|
|
105
|
-
}
|
|
106
99
|
}
|
|
107
100
|
|
|
108
101
|
.meta {
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
const { participant, initialScrollPosition = 0, ...restProps }: Props = $props()
|
|
16
16
|
|
|
17
|
+
let windowWidth = $state(0)
|
|
18
|
+
|
|
17
19
|
track(TrackingEvent.ParticipantModalView, null, { participant: participant.name })
|
|
18
20
|
|
|
19
21
|
onMount(() => {
|
|
@@ -23,6 +25,8 @@
|
|
|
23
25
|
})
|
|
24
26
|
</script>
|
|
25
27
|
|
|
26
|
-
<
|
|
28
|
+
<svelte:window bind:innerWidth={windowWidth} />
|
|
29
|
+
|
|
30
|
+
<Modal {initialScrollPosition} {...restProps} closeButtonStyle="flat" tall>
|
|
27
31
|
<Participant {participant} />
|
|
28
32
|
</Modal>
|