@playpilot/tpi 8.19.1 → 8.21.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.19.1",
3
+ "version": "8.21.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -16,7 +16,7 @@
16
16
  "release": "node release.js"
17
17
  },
18
18
  "devDependencies": {
19
- "@playpilot/retargeting-tracking": "^1.2.0",
19
+ "@playpilot/retargeting-tracking": "^1.3.2",
20
20
  "@sveltejs/adapter-auto": "^7.0.1",
21
21
  "@sveltejs/kit": "^2.56.1",
22
22
  "@sveltejs/vite-plugin-svelte": "^4.0.0",
@@ -1,6 +1,7 @@
1
1
  import { SupportedRegion } from '$lib/enums/Region'
2
2
  import { TrackingEvent } from '$lib/enums/TrackingEvent'
3
3
  import { track } from '$lib/tracking'
4
+ import { RETARGETING_REGION_KEY } from '@playpilot/retargeting-tracking'
4
5
 
5
6
  export async function getRegionBasedOnIp(timeout = 5000): Promise<string> {
6
7
  const savedRegion = window.PlayPilotLinkInjections?.region
@@ -41,4 +42,7 @@ function setSavedRegion(region: string): void {
41
42
  if (!window.PlayPilotLinkInjections) return
42
43
 
43
44
  window.PlayPilotLinkInjections.region = region
45
+
46
+ // @ts-ignore
47
+ window[RETARGETING_REGION_KEY] = region
44
48
  }
@@ -12,6 +12,8 @@
12
12
  import { authorize, getAuthToken, isEditorialModeEnabled, removeAuthCookie, setEditorialParamInUrl } from '$lib/api/auth'
13
13
  import { getPageTextAndElements } from '$lib/injectionElements'
14
14
  import type { LinkInjectionResponse, LinkInjection, LinkInjectionTypes } from '$lib/types/injection'
15
+ import { getRegionBasedOnIp } from '$lib/api/region'
16
+ import { isPixelAllowed } from '$lib/pixel'
15
17
  import Editor from './components/Editorial/Editor.svelte'
16
18
  import EditorTrigger from './components/Editorial/EditorTrigger.svelte'
17
19
  import Alert from './components/Editorial/Alert.svelte'
@@ -81,6 +83,8 @@
81
83
  isUrlExcluded = isUrlExcludedViaConfig(config)
82
84
  if (isUrlExcluded) return
83
85
 
86
+ if (isPixelAllowed()) await getRegionBasedOnIp()
87
+
84
88
  if (config?.html_selector) window.PlayPilotLinkInjections.selector = config?.html_selector
85
89
  } catch(error) {
86
90
  // We return if the config did not get fetched properly, as we can't determine what should and should
@@ -15,7 +15,7 @@
15
15
  const rails: { heading: string, params: Record<string, any>, properties: Record<string, any> }[] = [{
16
16
  heading: 'List: Upcoming',
17
17
  params: { from_playlist_sid: 'li42wf', region: null, no_region_filter: true },
18
- properties: {},
18
+ properties: { expandable: true },
19
19
  }, {
20
20
  heading: 'List: Trending',
21
21
  params: { ordering: Sorting.Popular },
@@ -7,6 +7,7 @@
7
7
  import RoundButton from '../RoundButton.svelte'
8
8
  import IconClose from '../Icons/IconClose.svelte'
9
9
  import IconArrow from '../Icons/IconArrow.svelte'
10
+ import Button from '../Button.svelte'
10
11
 
11
12
  interface Props {
12
13
  items: Record<string, any>[]
@@ -28,7 +29,7 @@
28
29
  if (initialIndex !== 0) slider?.setIndex(initialIndex)
29
30
 
30
31
  requestAnimationFrame(() => {
31
- slider.reposition()
32
+ slider?.reposition()
32
33
 
33
34
  initialized = true
34
35
  })
@@ -75,6 +76,15 @@
75
76
  </TinySlider>
76
77
  </div>
77
78
 
79
+ {#if window.location.href.includes('route=modal')}
80
+ <div class="back">
81
+ <Button variant="link" onclick={() => { onclose(); destroyAllModals() }}>
82
+ <IconArrow direction="left" />
83
+ Streaming guide
84
+ </Button>
85
+ </div>
86
+ {/if}
87
+
78
88
  <div class="close" transition:scale|global>
79
89
  <RoundButton size="42px" onclick={() => { onclose(); destroyAllModals() }} aria-label="Close">
80
90
  <IconClose size={24} />
@@ -159,7 +169,7 @@
159
169
 
160
170
  @include desktop {
161
171
  height: auto;
162
- max-height: 90vh;
172
+ max-height: 85vh;
163
173
  border-radius: theme(rail-modal-item-border-radius, border-radius-huge);
164
174
  }
165
175
 
@@ -176,6 +186,31 @@
176
186
  right: margin(1);
177
187
  }
178
188
 
189
+ .back {
190
+ position: absolute;
191
+ top: margin(1.5);
192
+ left: calc((100vw - $size) / 2);
193
+ font-family: theme(font-family);
194
+ transition: transform 50ms;
195
+
196
+ @include desktop {
197
+ left: margin(1);
198
+ }
199
+
200
+ &:hover {
201
+ transform: scale(1.025);
202
+
203
+ :global(button) {
204
+ text-decoration-thickness: 2px;
205
+ }
206
+ }
207
+
208
+ :global(button) {
209
+ text-decoration: underline;
210
+ color: white;
211
+ }
212
+ }
213
+
179
214
  .arrow {
180
215
  --offset: #{margin(-1.25)};
181
216
  --scale: 1;
@@ -64,6 +64,8 @@
64
64
 
65
65
  <style lang="scss">
66
66
  iframe {
67
+ z-index: -1;
68
+ position: relative;
67
69
  width: 100%;
68
70
  height: 100%;
69
71
  }