@playpilot/tpi 8.34.1 → 8.34.2
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 +1 -1
- package/dist/mount.js +7 -7
- package/package.json +1 -1
- package/src/lib/enums/SplitTest.ts +0 -5
- package/src/lib/modal.ts +1 -3
- package/src/routes/components/Explore/Routes/ExploreModal.svelte +2 -9
- package/src/routes/components/YouTubeEmbed.svelte +1 -1
- package/src/routes/elements/+page.svelte +0 -10
- package/vite.config.js +43 -42
package/package.json
CHANGED
package/src/lib/modal.ts
CHANGED
|
@@ -11,9 +11,8 @@ import { playFallbackViewTransition } from './viewTransition'
|
|
|
11
11
|
import { destroyLinkPopover } from './popover'
|
|
12
12
|
import { prefersReducedMotion } from 'svelte/motion'
|
|
13
13
|
import TitlesRailModal from '../routes/components/Modals/TitlesRailModal.svelte'
|
|
14
|
-
import TitlesReelModal from '../routes/components/Modals/TitlesReelModal.svelte'
|
|
15
14
|
|
|
16
|
-
export type ModalType = 'title' | 'participant' | 'titles-rail'
|
|
15
|
+
export type ModalType = 'title' | 'participant' | 'titles-rail'
|
|
17
16
|
|
|
18
17
|
type Modal = {
|
|
19
18
|
injection?: LinkInjection | null
|
|
@@ -55,7 +54,6 @@ function getModalComponentByType(
|
|
|
55
54
|
{ type: Modal['type'], target: Element, data: Modal['data'], props?: Record<string, any> }): ReturnType<typeof mount> {
|
|
56
55
|
if (type === 'participant') return mount(ParticipantModal, { target, props: { participant: data as ParticipantData, ...props } })
|
|
57
56
|
if (type === 'titles-rail') return mount(TitlesRailModal, { target, props: { titles: data as TitleData[], ...props } })
|
|
58
|
-
if (type === 'titles-reel') return mount(TitlesReelModal, { target, props: { titles: data as TitleData[], ...props } })
|
|
59
57
|
return mount(TitleModal, { target, props: { title: data as TitleData, ...props } })
|
|
60
58
|
}
|
|
61
59
|
|
|
@@ -21,17 +21,10 @@
|
|
|
21
21
|
|
|
22
22
|
if (!sid) return
|
|
23
23
|
|
|
24
|
-
let type: ModalType = sid.startsWith('pr') ? 'participant' : '
|
|
24
|
+
let type: ModalType = sid.startsWith('pr') ? 'participant' : 'titles-rail' // Sids with with `pr` for participants, `ti` for titles
|
|
25
25
|
let data: any = null
|
|
26
26
|
|
|
27
|
-
if (type === '
|
|
28
|
-
const isMobile = window.innerWidth < mobileBreakpoint
|
|
29
|
-
const isInReelSplitTest = isMobile && getSplitTestVariantName(SplitTest.Reels) === 'Reel'
|
|
30
|
-
|
|
31
|
-
if (isMobile) trackSplitTestView(SplitTest.Reels)
|
|
32
|
-
|
|
33
|
-
type = isMobile && isInReelSplitTest ? 'titles-reel' : 'titles-rail'
|
|
34
|
-
|
|
27
|
+
if (type === 'titles-rail') {
|
|
35
28
|
const [title, railTitles] = (await Promise.allSettled([fetchTitleBySid(sid), fetchSimilarTitles({ sid } as unknown as TitleData)])).map((promise) =>
|
|
36
29
|
promise.status === 'fulfilled' ? promise.value : null,
|
|
37
30
|
)
|
|
@@ -97,16 +97,6 @@
|
|
|
97
97
|
<button onclick={() => openModal({ type: 'participant', data: participants[0] })}>Show participant modal</button>
|
|
98
98
|
</div>
|
|
99
99
|
</div>
|
|
100
|
-
|
|
101
|
-
<div>
|
|
102
|
-
<h3>TitlesReelModal.svelte</h3>
|
|
103
|
-
|
|
104
|
-
{#await fetchSimilarTitles(title) then titles}
|
|
105
|
-
<div class="item">
|
|
106
|
-
<button onclick={() => openModal({ type: 'titles-reel', data: titles })}>Show titles reel modal</button>
|
|
107
|
-
</div>
|
|
108
|
-
{/await}
|
|
109
|
-
</div>
|
|
110
100
|
</div>
|
|
111
101
|
|
|
112
102
|
<h2>Title elements</h2>
|
package/vite.config.js
CHANGED
|
@@ -1,42 +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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
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
|
+
}))
|