@playpilot/tpi 8.0.0-beta.explore-home.12 → 8.0.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/dist/editorial.mount.js +7 -7
- package/dist/link-injections.js +1 -1
- package/dist/mount.js +6 -6
- package/package.json +1 -1
- package/src/routes/components/Modals/Modal.svelte +7 -1
- package/src/routes/components/Modals/RailModal.svelte +1 -1
- package/src/routes/components/Rails/TitlesRail.svelte +36 -34
- package/src/tests/routes/components/Modals/Modal.test.js +12 -0
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
prepend?: Snippet | null
|
|
19
19
|
tall?: boolean
|
|
20
20
|
wide?: boolean
|
|
21
|
-
|
|
21
|
+
blur?: boolean
|
|
22
22
|
closeButtonStyle?: 'shadow' | 'flat'
|
|
23
23
|
initialScrollPosition?: number
|
|
24
24
|
onscroll?: () => void
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
dialog,
|
|
33
33
|
tall = false,
|
|
34
34
|
wide = false,
|
|
35
|
+
blur = false,
|
|
35
36
|
closeButtonStyle = 'shadow',
|
|
36
37
|
initialScrollPosition = 0,
|
|
37
38
|
onscroll = () => null,
|
|
@@ -119,6 +120,7 @@
|
|
|
119
120
|
class="modal"
|
|
120
121
|
class:wide
|
|
121
122
|
class:tall
|
|
123
|
+
class:blur
|
|
122
124
|
class:has-bubble={!!bubble}
|
|
123
125
|
class:has-prepend={!!prepend}
|
|
124
126
|
style:--dialog-offset="{dialogOffset}px"
|
|
@@ -206,6 +208,10 @@
|
|
|
206
208
|
&.has-bubble {
|
|
207
209
|
--playpilot-detail-background-border-radius: 0;
|
|
208
210
|
}
|
|
211
|
+
|
|
212
|
+
&.blur {
|
|
213
|
+
backdrop-filter: blur(1.5rem);
|
|
214
|
+
}
|
|
209
215
|
}
|
|
210
216
|
|
|
211
217
|
.dialog,
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
})
|
|
30
30
|
</script>
|
|
31
31
|
|
|
32
|
-
<Modal>
|
|
32
|
+
<Modal blur>
|
|
33
33
|
{#snippet dialog()}
|
|
34
34
|
<div class="rail-modal" style:--transition-duration="{transitionDuration}ms">
|
|
35
35
|
<TinySlider threshold={40} moveThreshold={40} transitionDuration={initialized ? transitionDuration : 0} bind:this={slider}>
|
|
@@ -115,41 +115,43 @@
|
|
|
115
115
|
{/each}
|
|
116
116
|
</Rail>
|
|
117
117
|
{:then titles}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<div class="
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
118
|
+
{#if titles?.length}
|
|
119
|
+
<Rail
|
|
120
|
+
bind:slider
|
|
121
|
+
{heading}
|
|
122
|
+
onchange={(index) => setTimeout(() => openTitle(null, titles, index), 250)}
|
|
123
|
+
onresize={() => slider?.reposition()}>
|
|
124
|
+
{#each titles as title, index}
|
|
125
|
+
{@const expanded = isExpanded(title)}
|
|
126
|
+
{@const href = titleUrl(title)}
|
|
127
|
+
{@const onclick = (event: MouseEvent): void => openTitle(event, titles, index)}
|
|
128
|
+
|
|
129
|
+
<div class="title" class:expanded data-testid="title">
|
|
130
|
+
<div class="media">
|
|
131
|
+
{#if expanded}
|
|
132
|
+
<div class="video" out:fade={{ delay: 200, duration: 200 }}>
|
|
133
|
+
<a class="video-overlay" title="" {href} {onclick}></a>
|
|
134
|
+
|
|
135
|
+
{#if !!title.embeddable_url}
|
|
136
|
+
<YouTubeEmbed embeddable_url={title.embeddable_url!} muted loop />
|
|
137
|
+
{:else}
|
|
138
|
+
<img class="video-fallback" src={title.medium_poster} alt="" />
|
|
139
|
+
{/if}
|
|
140
|
+
</div>
|
|
141
|
+
{:else}
|
|
142
|
+
<a class="poster" {href} {onclick}>
|
|
143
|
+
<TitlePoster {title} width={96} height={144} />
|
|
144
|
+
</a>
|
|
145
|
+
{/if}
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<a class="heading" {href} {onclick} data-testid="heading">
|
|
149
|
+
{title.title}
|
|
150
|
+
</a>
|
|
145
151
|
</div>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
</a>
|
|
150
|
-
</div>
|
|
151
|
-
{/each}
|
|
152
|
-
</Rail>
|
|
152
|
+
{/each}
|
|
153
|
+
</Rail>
|
|
154
|
+
{/if}
|
|
153
155
|
{/await}
|
|
154
156
|
</div>
|
|
155
157
|
|
|
@@ -121,6 +121,18 @@ describe('Modal.svelte', () => {
|
|
|
121
121
|
expect(getByTestId('modal').classList).toContain('wide')
|
|
122
122
|
})
|
|
123
123
|
|
|
124
|
+
it('Should not have blur class by default', () => {
|
|
125
|
+
const { getByTestId } = render(Modal, { children })
|
|
126
|
+
|
|
127
|
+
expect(getByTestId('modal').classList).not.toContain('blur')
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
it('Should have blur class when prop is given', () => {
|
|
131
|
+
const { getByTestId } = render(Modal, { children, blur: true })
|
|
132
|
+
|
|
133
|
+
expect(getByTestId('modal').classList).toContain('blur')
|
|
134
|
+
})
|
|
135
|
+
|
|
124
136
|
it('Should not show back button by default', () => {
|
|
125
137
|
const { queryByLabelText } = render(Modal, { children })
|
|
126
138
|
|