@playpilot/tpi 8.2.2 → 8.3.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.2.2",
3
+ "version": "8.3.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -18,6 +18,7 @@
18
18
  let data = $state(dataToReadable())
19
19
  let shown = $state(false)
20
20
  let interval: ReturnType<typeof setInterval> | null = null
21
+ let railSize = $state(136)
21
22
 
22
23
  onDestroy(() => {
23
24
  if (interval) clearInterval(interval)
@@ -182,6 +183,33 @@
182
183
  insertExplore()
183
184
  })}>Toggle new explore</button>
184
185
  {/if}
186
+
187
+ <hr />
188
+
189
+ <small>Region</small>
190
+ <input type="text" value={window.PlayPilotLinkInjections.region} onchange={event => {
191
+ destroyExplore()
192
+ window.PlayPilotLinkInjections.region = (event.target as HTMLInputElement).value
193
+ insertExplore()
194
+ }} />
195
+
196
+ <hr />
197
+
198
+ <div class="form-group">
199
+ <small>Desktop rail size</small>
200
+ <input
201
+ type="range"
202
+ min={80}
203
+ max={240}
204
+ step={8}
205
+ bind:value={railSize}
206
+ oninput={() => document.body.style.setProperty('--playpilot-rail-size-huge', `${railSize}px`)} />
207
+ <small>{railSize}</small>
208
+ </div>
209
+
210
+ <hr />
211
+
212
+ <button onclick={() => shown = false}>Close</button>
185
213
  </div>
186
214
  {/if}
187
215
 
@@ -211,6 +239,14 @@
211
239
  }
212
240
  }
213
241
 
242
+ input[type="text"] {
243
+ padding: margin(0.5);
244
+ border: 1px solid theme(primary);
245
+ background: black;
246
+ font-size: margin(1);
247
+ color: theme(primary);
248
+ }
249
+
214
250
  .debugger {
215
251
  z-index: 2147483647; // As high as she goes
216
252
  position: fixed;
@@ -233,6 +269,12 @@
233
269
  scrollbar-width: thin;
234
270
  }
235
271
 
272
+ .form-group {
273
+ display: flex;
274
+ align-items: center;
275
+ gap: margin(0.5);
276
+ }
277
+
236
278
  .data {
237
279
  color: gray;
238
280
  }
@@ -4,10 +4,14 @@
4
4
  import TitlesRail from '../../Rails/TitlesRail.svelte'
5
5
  import { t } from '$lib/localization'
6
6
  import { Sorting } from '$lib/enums/Sorting'
7
+ import { mobileBreakpoint } from '$lib/constants'
7
8
 
9
+ let windowWidth = $state(0)
8
10
  let expandedTitle: TitleData | null = $state(null)
9
11
  let expandedRailKey: string | null = $state(null)
10
12
 
13
+ const size = $derived(windowWidth >= mobileBreakpoint ? 'huge' : null)
14
+
11
15
  const rails: { heading: string, params: Record<string, any>, properties: Record<string, any> }[] = [{
12
16
  heading: t('List: Trending'),
13
17
  params: { ordering: Sorting.Popular },
@@ -35,8 +39,22 @@
35
39
  }
36
40
  </script>
37
41
 
42
+ <svelte:window {onscroll} bind:innerWidth={windowWidth} />
43
+
38
44
  <div data-testid="explore-home"></div>
39
45
 
40
46
  {#each rails as { heading, params, properties }}
41
- <TitlesRail {heading} titles={getListTitles(params)} {...properties} bind:expandedTitle bind:expandedRailKey />
47
+ <div class="rail">
48
+ <TitlesRail {heading} titles={getListTitles(params)} size={size || 'small'} {...properties} bind:expandedTitle bind:expandedRailKey />
49
+ </div>
42
50
  {/each}
51
+
52
+ <style lang="scss">
53
+ .rail {
54
+ margin-top: theme(explore-rail-spacing-mobile, margin(1));
55
+
56
+ @include desktop {
57
+ margin-top: theme(explore-rail-spacing-desktop, margin(2));
58
+ }
59
+ }
60
+ </style>
@@ -15,7 +15,7 @@
15
15
  interface Props {
16
16
  titles: Promise<TitleData[]> | TitleData[]
17
17
  heading?: string,
18
- size?: 'small' | 'large'
18
+ size?: 'small' | 'large' | 'huge'
19
19
  aside?: boolean,
20
20
  expandable?: boolean,
21
21
  expandedTitle?: TitleData | null,
@@ -115,6 +115,16 @@
115
115
  <span class="skeleton">&nbsp;</span>
116
116
  <span class="skeleton">&nbsp;</span>
117
117
  </div>
118
+
119
+ {#if aside}
120
+ <div class="aside">
121
+ <div class="aside-skeleton">
122
+ {#each { length: 3 }}
123
+ <div class="skeleton">&nbsp;</div>
124
+ {/each}
125
+ </div>
126
+ </div>
127
+ {/if}
118
128
  </div>
119
129
  {/each}
120
130
  </Rail>
@@ -169,7 +179,7 @@
169
179
 
170
180
  <style lang="scss">
171
181
  .titles {
172
- --width: #{margin(6)};
182
+ --width: #{theme(rail-size-default, margin(6))};
173
183
  --image-height: #{calc(var(--width) * 3 / 2)};
174
184
  --expanded-width: #{calc(var(--image-height) / 9 * 16)};
175
185
  --border-radius: #{theme(rail-border-radius, border-radius)};
@@ -179,7 +189,11 @@
179
189
  }
180
190
 
181
191
  &.large {
182
- --width: #{margin(7.5)};
192
+ --width: #{theme(rail-size-large, margin(7.5))};
193
+ }
194
+
195
+ &.huge {
196
+ --width: #{theme(rail-size-huge, margin(8.5))};
183
197
  }
184
198
  }
185
199
 
@@ -199,6 +213,7 @@
199
213
  "media heading"
200
214
  "media aside";
201
215
  grid-template-rows: 1lh auto;
216
+ grid-template-columns: 1fr 1fr;
202
217
  align-items: flex-start;
203
218
  gap: margin(0.25) margin(0.5);
204
219
  width: calc(var(--width) * 2);
@@ -290,6 +305,7 @@
290
305
  text-overflow: ellipsis;
291
306
 
292
307
  .with-aside & {
308
+ width: 100%;
293
309
  padding-top: 0;
294
310
  font-weight: theme(rail-aside-heading-font-weight, font-bold);
295
311
  line-clamp: 1;
@@ -314,10 +330,22 @@
314
330
  width: 100%;
315
331
  background: theme(detail-background-light, lighter);
316
332
  border-radius: margin(2);
333
+ color: transparent;
317
334
 
318
335
  &:last-child {
319
336
  margin-top: margin(0.3);
320
337
  width: 50%;
321
338
  }
322
339
  }
340
+
341
+ .aside-skeleton {
342
+ display: flex;
343
+ flex-direction: column;
344
+ gap: margin(0.3);
345
+ width: 100%;
346
+
347
+ .skeleton {
348
+ margin: 0;
349
+ }
350
+ }
323
351
  </style>
@@ -7,6 +7,7 @@
7
7
 
8
8
  import { browser } from '$app/environment'
9
9
  import { destroyExplore, insertExplore, insertExploreIntoNavigation, useExploreRouter } from '$lib/explore'
10
+ import Debugger from '../components/Debugger.svelte'
10
11
 
11
12
  if (browser) {
12
13
  // @ts-ignore
@@ -56,6 +57,8 @@
56
57
  </div>
57
58
  </main>
58
59
 
60
+ <Debugger onrerender={() => null} />
61
+
59
62
  <style lang="scss">
60
63
  @import url('$lib/scss/global.scss');
61
64