@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "8.34.1",
3
+ "version": "8.34.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -4,9 +4,4 @@ export const SplitTest = {
4
4
  numberOfVariants: 2,
5
5
  variantNames: ['Separated', 'Inline'] as string[],
6
6
  },
7
- Reels: {
8
- key: 'reels',
9
- numberOfVariants: 2,
10
- variantNames: ['Default', 'Reel'] as string[],
11
- },
12
7
  } as const
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' | 'titles-reel'
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' : 'title' // Sids with with `pr` for participants, `ti` for titles
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 === 'title') {
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
  )
@@ -184,7 +184,7 @@
184
184
  color: white;
185
185
 
186
186
  &:hover {
187
- outline: 1px solid white;
187
+ outline: 2px solid white;
188
188
  transform: scale(1.1);
189
189
  }
190
190
 
@@ -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
- test: {
19
- environment: 'happy-dom',
20
- environmentOptions: {
21
- happyDOM: {
22
- settings: {
23
- disableJavaScriptFileLoading: true,
24
- },
25
- },
26
- },
27
- include: ['src/**/*.{test,spec}.{js,ts}'],
28
- setupFiles: ['src/tests/setup.js'],
29
- },
30
-
31
- resolve: {
32
- conditions: process.env.VITEST ? ['browser'] : [],
33
- alias: {
34
- '$lib': path.resolve(__dirname, './src/lib'),
35
- },
36
- },
37
-
38
- define: {
39
- __SCRIPT_VERSION__: JSON.stringify(packageJson.version),
40
- __IS_EDITORIAL_SCRIPT__: true,
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
+ }))