@playpilot/tpi 8.23.0 → 8.23.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/events.md CHANGED
@@ -126,6 +126,7 @@ Event | Action | Info | Payload
126
126
  `venus_title_rail_modal_view` | _Fires any time a title is clicked in a rail, opening the rail modal_ | | `rail` (heading key of the rail)
127
127
  `venus_title_rail_expand_click` | _Fires any time a title is expanded in a rail directly via a click_ | Does not fire when a title opens automatically on load or navigate | `Title`, `rail` (heading key of the rail)
128
128
  `venus_title_rail_set_index` | _Fires when navigating in the titles rail modal, either via arrows, swipe, or clicking titles_ | | `Title`, `index` (index of the new position of the slider)
129
+ `venus_title_reel_set_index` | _Fires when navigating in the titles reel modal, swipe, or clicking titles_ | | `Title`, `index` (index of the new position of the slider)
129
130
  `venus_navigate` | _Fires when navigating on the explore page_ | Does not fire on initial load | `route` (the key of the given route)
130
131
  `venus_any_click` | _Fires on any click anywhere_ | | `selector` (parent > child selector of the clicked element), `text` (direct text content of the clicked element, limited to 30 characters)
131
132
  `venus_scroll_distance` | _Fires on increments of scroll distance_ | 25%, 50%, 75%, 100% | `scroll_percentage` (percentage of the explore element the user has seen)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "8.23.0",
3
+ "version": "8.23.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -79,6 +79,7 @@ export const TrackingEvent = {
79
79
  ExploreTitleRailModalView: 'venus_title_rail_modal_view',
80
80
  ExploreTitleRailExpandClick: 'venus_title_rail_expand_click',
81
81
  ExploreTitleRailSetIndex: 'venus_title_rail_set_index',
82
+ ExploreTitleReelSetIndex: 'venus_title_reel_set_index',
82
83
  ExploreNavigate: 'venus_navigate',
83
84
  ExploreAnyClick: 'venus_any_click',
84
85
  ExploreScrollDistance: 'venus_scroll_distance',
@@ -3,6 +3,8 @@
3
3
  import { onMount } from 'svelte'
4
4
  import { heading } from '$lib/actions/heading'
5
5
  import { t } from '$lib/localization'
6
+ import { track } from '$lib/tracking'
7
+ import { TrackingEvent } from '$lib/enums/TrackingEvent'
6
8
  import TinySlider from 'svelte-tiny-slider'
7
9
  import Modal from './Modal.svelte'
8
10
  import TitleBackground from '../TitleBackground.svelte'
@@ -15,9 +17,10 @@
15
17
 
16
18
  interface Props {
17
19
  titles: TitleData[],
20
+ onclose?: () => void
18
21
  }
19
22
 
20
- const { titles }: Props = $props()
23
+ const { titles, onclose = () => null }: Props = $props()
21
24
 
22
25
  let interval: ReturnType<typeof setInterval> | null = null
23
26
 
@@ -29,6 +32,11 @@
29
32
  }
30
33
  })
31
34
 
35
+ function onchange(index: number): void {
36
+ pauseAndPlay(index)
37
+ track(TrackingEvent.ExploreTitleReelSetIndex, titles[index], { index })
38
+ }
39
+
32
40
  function pauseAndPlay(index: number): void {
33
41
  ;[titles[index - 1], titles[index + 1]].forEach(title => {
34
42
  window.dispatchEvent(new CustomEvent('pauseembed', { detail: title?.embeddable_url } ))
@@ -49,7 +57,7 @@
49
57
  <Modal>
50
58
  {#snippet dialog()}
51
59
  <div class="slider">
52
- <TinySlider vertical threshold={50} moveThreshold={10} onchange={pauseAndPlay}>
60
+ <TinySlider vertical threshold={50} moveThreshold={10} {onchange}>
53
61
  {#snippet children({ currentIndex, setIndex })}
54
62
  {#each titles as title, index}
55
63
  <!-- svelte-ignore a11y_click_events_have_key_events -->
@@ -92,7 +100,7 @@
92
100
  </TinySlider>
93
101
  </div>
94
102
 
95
- <ModalCloseOverlay label={t('Explore All Movies And Shows')} />
103
+ <ModalCloseOverlay {onclose} label={t('Explore All Movies And Shows')} />
96
104
  {/snippet}
97
105
  </Modal>
98
106
  </div>