@playpilot/tpi 8.3.1 → 8.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "8.3.1",
3
+ "version": "8.4.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
Binary file
@@ -1,9 +1,12 @@
1
1
  <script lang="ts">
2
2
  import IconArrow from '../Icons/IconArrow.svelte'
3
- import { openModal } from '$lib/modal'
3
+
4
+ const src = 'https://cdn.jsdelivr.net/npm/@playpilot/tpi@latest/src/lib/images/titles-list.webp'
4
5
  </script>
5
6
 
6
- <button class="call-to-action" onclick={() => openModal({ type: 'explore' })}>
7
+ <a class="call-to-action" href={window.PlayPilotLinkInjections?.config?.explore_navigation_path}>
8
+ <img {src} alt="" width="70" height="57" />
9
+
7
10
  <div>
8
11
  <strong>Looking for something else?</strong>
9
12
  <div>Use our streamingguide</div>
@@ -12,7 +15,7 @@
12
15
  <div class="arrow">
13
16
  <IconArrow />
14
17
  </div>
15
- </button>
18
+ </a>
16
19
 
17
20
  <style lang="scss">
18
21
  strong {
@@ -32,8 +35,10 @@
32
35
  border-radius: theme(border-radius-large) theme(border-radius-large) 0 0;
33
36
  background: theme(light);
34
37
  font-family: theme(font-family);
35
- color: theme(text-color-alt);
38
+ color: theme(text-color-alt) !important;
36
39
  font-size: theme(font-size-small);
40
+ font-style: normal !important;
41
+ text-decoration: none;
37
42
  line-height: 1.5;
38
43
  text-align: left;
39
44
  cursor: pointer;
@@ -3,6 +3,7 @@
3
3
  import { track } from '$lib/tracking'
4
4
  import type { TitleData } from '$lib/types/title'
5
5
  import { getFirstAdOfType } from '$lib/api/ads'
6
+ import { exploreParentSelector } from '$lib/explore'
6
7
  import { onMount } from 'svelte'
7
8
  import Modal from './Modal.svelte'
8
9
  import Title from '../Title.svelte'
@@ -20,6 +21,7 @@
20
21
  const topScrollAd = getFirstAdOfType('top_scroll')
21
22
  const displayAd = getFirstAdOfType('card')
22
23
  const insertExploreCta = window.PlayPilotLinkInjections?.config?.explore_insert_cta_in_tpi
24
+ const useBubble = !!topScrollAd || (insertExploreCta && !document.querySelector(exploreParentSelector))
23
25
 
24
26
  let hasTrackedScrolling = false
25
27
 
@@ -53,6 +55,6 @@
53
55
  {/if}
54
56
  {/snippet}
55
57
 
56
- <Modal {onscroll} {initialScrollPosition} bubble={!!topScrollAd || insertExploreCta ? bubble : null} prepend={displayAd ? prepend : null} tall>
58
+ <Modal {onscroll} {initialScrollPosition} bubble={useBubble ? bubble : null} prepend={displayAd ? prepend : null} tall>
57
59
  <Title {title} {...restProps} />
58
60
  </Modal>
@@ -95,7 +95,7 @@ describe('TitleModal.svelte', () => {
95
95
  expect(container.querySelector('.display')).not.toBeTruthy()
96
96
  })
97
97
 
98
- it('Should render explore cta when config is set', () => {
98
+ it('Should render explore cta when config is set and explore parent element is not present', () => {
99
99
  // @ts-ignore
100
100
  window.PlayPilotLinkInjections = { config: { explore_insert_cta_in_tpi: true } }
101
101
 
@@ -113,6 +113,17 @@ describe('TitleModal.svelte', () => {
113
113
  expect(container.querySelector('.call-to-action')).not.toBeTruthy()
114
114
  })
115
115
 
116
+ it('Should not render explore cta when config is set but explore parent element is present', () => {
117
+ document.body.innerHTML = '<div data-playpilot-explore></div>'
118
+
119
+ // @ts-ignore
120
+ window.PlayPilotLinkInjections = { config: { explore_insert_cta_in_tpi: true } }
121
+
122
+ const { container } = render(TitleModal, { title })
123
+
124
+ expect(container.querySelector('.call-to-action')).not.toBeTruthy()
125
+ })
126
+
116
127
  it('Should not render explore cta when config is set but top scroll ad is given', () => {
117
128
  // @ts-ignore
118
129
  window.PlayPilotLinkInjections = { config: { explore_insert_cta_in_tpi: true }, ads: [{ campaign_format: 'top_scroll', content: {}, cta: {} }] }