@playpilot/tpi 8.40.0 → 8.40.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/.playpilot/repo.yaml +14 -0
- package/dist/editorial.mount.js +10 -10
- package/dist/link-injections.js +1 -1
- package/dist/mount.css +1 -1
- package/dist/mount.js +8 -8
- package/package.json +3 -3
- package/src/lib/api/ads.ts +3 -1
- package/src/lib/explore.ts +0 -4
- package/src/lib/injection.ts +535 -535
- package/src/lib/types/config.d.ts +0 -1
- package/src/routes/components/Debugger.svelte +1 -9
- package/src/routes/components/Explore/ExploreLayout.svelte +10 -18
- package/src/routes/components/Explore/ExploreRouter.svelte +9 -15
- package/src/routes/components/Explore/Routes/ExploreHome.svelte +1 -1
- package/src/routes/components/Rails/TitlesRail.svelte +1 -6
- package/src/routes/explore/+page.svelte +2 -8
- package/src/tests/lib/api/ads.test.js +8 -0
- package/svelte.config.js +32 -23
- package/vite.config.js +43 -43
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { fetchLinkInjections } from '$lib/api/externalPages'
|
|
4
4
|
import { Language } from '$lib/enums/Language'
|
|
5
5
|
import { SplitTest } from '$lib/enums/SplitTest'
|
|
6
|
-
import { destroyExplore, insertExplore
|
|
6
|
+
import { destroyExplore, insertExplore } from '$lib/explore'
|
|
7
7
|
import { getPageTextAndElements } from '$lib/injectionElements'
|
|
8
8
|
import { getLanguage } from '$lib/language'
|
|
9
9
|
import { getFullUrlPath } from '$lib/url'
|
|
@@ -217,14 +217,6 @@
|
|
|
217
217
|
<button onclick={replaceWithBetaScript}>Use beta script</button>
|
|
218
218
|
{/if}
|
|
219
219
|
|
|
220
|
-
{#if !useExploreRouter()}
|
|
221
|
-
<button onclick={(() => {
|
|
222
|
-
destroyExplore()
|
|
223
|
-
window.PlayPilotLinkInjections.config!.explore_use_router = !useExploreRouter()
|
|
224
|
-
insertExplore()
|
|
225
|
-
})}>Toggle new explore</button>
|
|
226
|
-
{/if}
|
|
227
|
-
|
|
228
220
|
<hr />
|
|
229
221
|
|
|
230
222
|
<div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ExploreFilter } from '$lib/types/filter'
|
|
3
3
|
import { heading } from '$lib/actions/heading'
|
|
4
|
-
import { exploreParentSelector
|
|
4
|
+
import { exploreParentSelector } from '$lib/explore'
|
|
5
5
|
import { t } from '$lib/localization'
|
|
6
6
|
import { track } from '$lib/tracking'
|
|
7
7
|
import { TrackingEvent } from '$lib/enums/TrackingEvent'
|
|
@@ -57,28 +57,20 @@
|
|
|
57
57
|
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
58
58
|
{@html t('Streaming Guide Disclaimer')}
|
|
59
59
|
</p>
|
|
60
|
-
|
|
61
|
-
{#if !useExploreRouter()}
|
|
62
|
-
<p class="description">
|
|
63
|
-
{t('Streaming Guide Description')}
|
|
64
|
-
</p>
|
|
65
|
-
{/if}
|
|
66
60
|
</div>
|
|
67
61
|
</div>
|
|
68
62
|
|
|
69
63
|
<Search oninput={(query) => searchQuery = query} />
|
|
70
64
|
|
|
71
|
-
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</div>
|
|
81
|
-
{/if}
|
|
65
|
+
<div class="filter">
|
|
66
|
+
<Filter
|
|
67
|
+
{filter}
|
|
68
|
+
{searchQuery}
|
|
69
|
+
limit={clientWidth < 500}
|
|
70
|
+
showSorting={!searchQuery}
|
|
71
|
+
onchange={() => navigate('results')}
|
|
72
|
+
onempty={() => navigate('home')} />
|
|
73
|
+
</div>
|
|
82
74
|
|
|
83
75
|
{#await isUserRegionSupported() then isSupported}
|
|
84
76
|
{#if !isSupported}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ExploreRoute } from '$lib/types/explore'
|
|
3
3
|
import type { ExploreFilter } from '$lib/types/filter'
|
|
4
|
-
import { useExploreRouter } from '$lib/explore'
|
|
5
4
|
import { track } from '$lib/tracking'
|
|
6
5
|
import { TrackingEvent } from '$lib/enums/TrackingEvent'
|
|
7
6
|
import ExploreHome from './Routes/ExploreHome.svelte'
|
|
@@ -11,29 +10,24 @@
|
|
|
11
10
|
import ExploreModal from './Routes/ExploreModal.svelte'
|
|
12
11
|
|
|
13
12
|
const routes: ExploreRoute[] = [
|
|
13
|
+
{
|
|
14
|
+
key: 'home',
|
|
15
|
+
component: ExploreHome,
|
|
16
|
+
},
|
|
14
17
|
{
|
|
15
18
|
key: 'results',
|
|
16
19
|
component: ExploreResults,
|
|
17
20
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (useExploreRouter()) {
|
|
21
|
-
routes.unshift({
|
|
22
|
-
key: 'home',
|
|
23
|
-
component: ExploreHome,
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
routes.push({
|
|
21
|
+
{
|
|
27
22
|
key: 'title',
|
|
28
23
|
component: ExploreTitle,
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
routes.push({
|
|
24
|
+
},
|
|
25
|
+
{
|
|
32
26
|
key: 'modal',
|
|
33
27
|
component: ExploreHome,
|
|
34
28
|
appendComponent: ExploreModal,
|
|
35
|
-
}
|
|
36
|
-
|
|
29
|
+
}
|
|
30
|
+
]
|
|
37
31
|
|
|
38
32
|
const initialRouteKey = getCurrentRouteParam() || routes[0].key
|
|
39
33
|
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { exploreModalUrl } from '$lib/routes'
|
|
9
9
|
import { generateRandomHash } from '$lib/hash'
|
|
10
10
|
import { getFirstTitleWithAvailableTrailer } from '$lib/trailer'
|
|
11
|
-
import { useExploreRouter } from '$lib/explore'
|
|
12
11
|
import { getContext, onMount } from 'svelte'
|
|
13
12
|
import type TinySlider from 'svelte-tiny-slider'
|
|
14
13
|
|
|
@@ -92,11 +91,7 @@
|
|
|
92
91
|
return
|
|
93
92
|
}
|
|
94
93
|
|
|
95
|
-
|
|
96
|
-
openModal({ event, type: 'titles-rail', data: titles as TitleData[], returnToTitle, props: { initialIndex: index } })
|
|
97
|
-
} else {
|
|
98
|
-
openModal({ event, data: title, returnToTitle })
|
|
99
|
-
}
|
|
94
|
+
openModal({ event, type: 'titles-rail', data: titles as TitleData[], returnToTitle, props: { initialIndex: index } })
|
|
100
95
|
}
|
|
101
96
|
|
|
102
97
|
async function expandFirstAvailableTrailer(): Promise<void> {
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { browser } from '$app/environment'
|
|
9
|
-
import {
|
|
9
|
+
import { insertExplore, insertExploreIntoNavigation } from '$lib/explore'
|
|
10
10
|
import Debugger from '../components/Debugger.svelte'
|
|
11
|
-
|
|
12
11
|
if (browser) {
|
|
13
12
|
// @ts-ignore
|
|
14
13
|
window.PlayPilotLinkInjections = {
|
|
@@ -18,7 +17,6 @@
|
|
|
18
17
|
explore_navigation_label: 'Streaming guide (inserted)',
|
|
19
18
|
explore_navigation_path: '/explore',
|
|
20
19
|
explore_custom_style: 'main { border: 2px solid white }',
|
|
21
|
-
explore_use_router: true,
|
|
22
20
|
open_tpi_links_in_explore: true,
|
|
23
21
|
},
|
|
24
22
|
require_consent: false,
|
|
@@ -34,11 +32,7 @@
|
|
|
34
32
|
<title>PlayPilot Link Injections - Explore</title>
|
|
35
33
|
</svelte:head>
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
destroyExplore()
|
|
39
|
-
window.PlayPilotLinkInjections.config!.explore_use_router = !useExploreRouter()
|
|
40
|
-
insertExplore()
|
|
41
|
-
})}>Toggle new explore</button>
|
|
35
|
+
|
|
42
36
|
|
|
43
37
|
<main>
|
|
44
38
|
<!--
|
|
@@ -72,6 +72,14 @@ describe('$lib/api/ads', () => {
|
|
|
72
72
|
await expect(async () => await fetchAds()).rejects.toThrowError()
|
|
73
73
|
expect(track).toHaveBeenCalledWith(TrackingEvent.AdsFetchFailed, null, { status: 505 })
|
|
74
74
|
})
|
|
75
|
+
|
|
76
|
+
it('Should include set region', async () => {
|
|
77
|
+
window.PlayPilotLinkInjections.region = 'uk'
|
|
78
|
+
|
|
79
|
+
await fetchAds()
|
|
80
|
+
|
|
81
|
+
expect(api).toHaveBeenCalledWith(expect.stringContaining('®ion=uk'))
|
|
82
|
+
})
|
|
75
83
|
})
|
|
76
84
|
|
|
77
85
|
describe('getFirstAdOfType', () => {
|
package/svelte.config.js
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
import adapter from '@sveltejs/adapter-auto'
|
|
2
|
-
import { sveltePreprocess
|
|
3
|
-
|
|
4
|
-
/** @type {import('@sveltejs/kit').Config} */
|
|
5
|
-
const config = {
|
|
6
|
-
preprocess: sveltePreprocess({
|
|
7
|
-
scss: {
|
|
8
|
-
includePaths: ['src'],
|
|
9
|
-
prependData: `
|
|
10
|
-
@use "src/lib/scss/_functions.scss" as *;
|
|
11
|
-
@use "src/lib/scss/_mixins.scss" as *;
|
|
12
|
-
`,
|
|
13
|
-
},
|
|
14
|
-
}),
|
|
15
|
-
kit: {
|
|
16
|
-
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
|
17
|
-
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
|
18
|
-
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
|
19
|
-
adapter: adapter(),
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import adapter from '@sveltejs/adapter-auto'
|
|
2
|
+
import { sveltePreprocess } from 'svelte-preprocess'
|
|
3
|
+
|
|
4
|
+
/** @type {import('@sveltejs/kit').Config} */
|
|
5
|
+
const config = {
|
|
6
|
+
preprocess: sveltePreprocess({
|
|
7
|
+
scss: {
|
|
8
|
+
includePaths: ['src'],
|
|
9
|
+
prependData: `
|
|
10
|
+
@use "src/lib/scss/_functions.scss" as *;
|
|
11
|
+
@use "src/lib/scss/_mixins.scss" as *;
|
|
12
|
+
`,
|
|
13
|
+
},
|
|
14
|
+
}),
|
|
15
|
+
kit: {
|
|
16
|
+
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
|
17
|
+
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
|
18
|
+
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
|
19
|
+
adapter: adapter(),
|
|
20
|
+
},
|
|
21
|
+
compilerOptions: {
|
|
22
|
+
warningFilter: (warning) => {
|
|
23
|
+
const ignore = [
|
|
24
|
+
'state_referenced_locally',
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
return !ignore.includes(warning.code)
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default config
|
package/vite.config.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
|
-
import * as dotenv from 'dotenv'
|
|
3
|
-
import { defineConfig } from 'vitest/config'
|
|
4
|
-
import { sveltekit } from '@sveltejs/kit/vite'
|
|
5
|
-
import packageJson from './package.json'
|
|
6
|
-
|
|
7
|
-
dotenv.config({ path: '.env' })
|
|
8
|
-
|
|
9
|
-
export default defineConfig(() => ({
|
|
10
|
-
plugins: [
|
|
11
|
-
sveltekit(),
|
|
12
|
-
],
|
|
13
|
-
|
|
14
|
-
server: {
|
|
15
|
-
port: 3000,
|
|
16
|
-
allowedHosts: ['engage-moderate-happy-davis.trycloudflare.com'],
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
test: {
|
|
20
|
-
environment: 'happy-dom',
|
|
21
|
-
environmentOptions: {
|
|
22
|
-
happyDOM: {
|
|
23
|
-
settings: {
|
|
24
|
-
disableJavaScriptFileLoading: true,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
include: ['src/**/*.{test,spec}.{js,ts}'],
|
|
29
|
-
setupFiles: ['src/tests/setup.js'],
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
resolve: {
|
|
33
|
-
conditions: process.env.VITEST ? ['browser'] : [],
|
|
34
|
-
alias: {
|
|
35
|
-
'$lib': path.resolve(__dirname, './src/lib'),
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
define: {
|
|
40
|
-
__SCRIPT_VERSION__: JSON.stringify(packageJson.version),
|
|
41
|
-
__IS_EDITORIAL_SCRIPT__: true,
|
|
42
|
-
},
|
|
43
|
-
}))
|
|
1
|
+
import path from 'path'
|
|
2
|
+
import * as dotenv from 'dotenv'
|
|
3
|
+
import { defineConfig } from 'vitest/config'
|
|
4
|
+
import { sveltekit } from '@sveltejs/kit/vite'
|
|
5
|
+
import packageJson from './package.json'
|
|
6
|
+
|
|
7
|
+
dotenv.config({ path: '.env' })
|
|
8
|
+
|
|
9
|
+
export default defineConfig(() => ({
|
|
10
|
+
plugins: [
|
|
11
|
+
sveltekit(),
|
|
12
|
+
],
|
|
13
|
+
|
|
14
|
+
server: {
|
|
15
|
+
port: 3000,
|
|
16
|
+
allowedHosts: ['engage-moderate-happy-davis.trycloudflare.com'],
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
test: {
|
|
20
|
+
environment: 'happy-dom',
|
|
21
|
+
environmentOptions: {
|
|
22
|
+
happyDOM: {
|
|
23
|
+
settings: {
|
|
24
|
+
disableJavaScriptFileLoading: true,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
include: ['src/**/*.{test,spec}.{js,ts}'],
|
|
29
|
+
setupFiles: ['src/tests/setup.js'],
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
resolve: {
|
|
33
|
+
conditions: process.env.VITEST ? ['browser'] : [],
|
|
34
|
+
alias: {
|
|
35
|
+
'$lib': path.resolve(__dirname, './src/lib'),
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
define: {
|
|
40
|
+
__SCRIPT_VERSION__: JSON.stringify(packageJson.version),
|
|
41
|
+
__IS_EDITORIAL_SCRIPT__: true,
|
|
42
|
+
},
|
|
43
|
+
}))
|