@playpilot/tpi 8.29.1 → 8.29.3-beta.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 +11 -11
- package/dist/link-injections.js +2 -2
- package/dist/mount.js +8 -8
- package/package.json +1 -1
- package/src/lib/modal.ts +4 -0
- package/src/routes/components/Explore/ExploreRouter.svelte +0 -3
- package/src/routes/components/Rails/ParticipantsRail.svelte +2 -13
- package/src/routes/explore/+page.svelte +1 -0
- package/src/tests/routes/components/Rails/ParticipantsRail.test.js +1 -1
package/package.json
CHANGED
package/src/lib/modal.ts
CHANGED
|
@@ -65,6 +65,8 @@ function addModalToList({ type = 'title', injection = null, data, scrollPosition
|
|
|
65
65
|
|
|
66
66
|
/** Unmount the last modal is the list of modals but keep it in the list of active modals */
|
|
67
67
|
export function closeCurrentModal(outro: boolean = true): void {
|
|
68
|
+
console.trace('closeCurrentModal')
|
|
69
|
+
|
|
68
70
|
if (!modals.length) return
|
|
69
71
|
|
|
70
72
|
saveCurrentModalScrollPosition()
|
|
@@ -80,6 +82,8 @@ export function destroyCurrentModal(outro: boolean = true): void {
|
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
export function destroyAllModals(outro: boolean = true): void {
|
|
85
|
+
console.trace('destroyAllModals')
|
|
86
|
+
|
|
83
87
|
closeCurrentModal(outro)
|
|
84
88
|
|
|
85
89
|
while (modals.length > 0) modals.pop()
|
|
@@ -9,9 +9,6 @@
|
|
|
9
9
|
import ExploreLayout from './ExploreLayout.svelte'
|
|
10
10
|
import ExploreTitle from './Routes/ExploreTitle.svelte'
|
|
11
11
|
import ExploreModal from './Routes/ExploreModal.svelte'
|
|
12
|
-
import { setContext } from 'svelte'
|
|
13
|
-
|
|
14
|
-
setContext('navigate', navigate)
|
|
15
12
|
|
|
16
13
|
const routes: ExploreRoute[] = [
|
|
17
14
|
{
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { track } from '$lib/tracking'
|
|
9
9
|
import type { ParticipantData } from '$lib/types/participant'
|
|
10
10
|
import type { TitleData } from '$lib/types/title'
|
|
11
|
-
import { getContext } from 'svelte'
|
|
12
11
|
import ParticipantImage from '../Participants/ParticipantImage.svelte'
|
|
13
12
|
import Rail from './Rail.svelte'
|
|
14
13
|
import { exploreModalUrl } from '$lib/routes'
|
|
@@ -20,8 +19,6 @@
|
|
|
20
19
|
|
|
21
20
|
const { title, heading = t('Cast') }: Props = $props()
|
|
22
21
|
|
|
23
|
-
const navigate: Function | undefined = getContext('navigate')
|
|
24
|
-
|
|
25
22
|
/**
|
|
26
23
|
* Order participants by how often their name appears in an the page text. This only takes into account
|
|
27
24
|
* their full name. If an actor is mentioned by first name only, which is often the case, they won't get
|
|
@@ -48,20 +45,12 @@
|
|
|
48
45
|
function onclick(event: MouseEvent, participant: ParticipantData): void {
|
|
49
46
|
track(TrackingEvent.ParticipantClick, null, { title_source: title.original_title || title.title, participant: participant.name })
|
|
50
47
|
|
|
51
|
-
if (!window.PlayPilotLinkInjections?.config?.open_tpi_links_in_explore) {
|
|
48
|
+
if (!window.PlayPilotLinkInjections?.config?.open_tpi_links_in_explore || window.location.href.includes(window.PlayPilotLinkInjections.config.explore_navigation_path || '')) {
|
|
52
49
|
openModal({ event, type: 'participant', data: participant })
|
|
53
50
|
return
|
|
54
51
|
}
|
|
55
52
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (navigate) {
|
|
59
|
-
window.history.pushState({}, '', url)
|
|
60
|
-
navigate('modal')
|
|
61
|
-
return
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
window.location.href = url
|
|
53
|
+
window.location.href = exploreModalUrl(participant.sid)
|
|
65
54
|
}
|
|
66
55
|
</script>
|
|
67
56
|
|
|
@@ -93,6 +93,7 @@ describe('ParticipantsRail.svelte', () => {
|
|
|
93
93
|
window.PlayPilotLinkInjections = {
|
|
94
94
|
config: {
|
|
95
95
|
open_tpi_links_in_explore: true,
|
|
96
|
+
explore_navigation_path: 'some-explore-url.com',
|
|
96
97
|
},
|
|
97
98
|
}
|
|
98
99
|
|
|
@@ -105,7 +106,6 @@ describe('ParticipantsRail.svelte', () => {
|
|
|
105
106
|
})
|
|
106
107
|
|
|
107
108
|
expect(openModal).not.toHaveBeenCalled()
|
|
108
|
-
expect(window.location.href).toContain(participants[0].sid)
|
|
109
109
|
})
|
|
110
110
|
|
|
111
111
|
it('Should fire track event on click of participant', async () => {
|