@playpilot/tpi 8.27.0 → 8.27.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.27.0",
3
+ "version": "8.27.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -31,6 +31,7 @@
31
31
 
32
32
  <style lang="scss">
33
33
  .back {
34
+ z-index: 10;
34
35
  position: absolute;
35
36
  top: margin(1.5);
36
37
  left: var(--modal-close-overlay-left, margin(1));
@@ -57,6 +58,7 @@
57
58
  .close {
58
59
  --playpilot-button-background: transparent;
59
60
  --playpilot-button-text-color: white;
61
+ z-index: 10;
60
62
  position: absolute;
61
63
  top: margin(1);
62
64
  right: margin(1);
@@ -24,7 +24,7 @@
24
24
 
25
25
  let slider: TinySlider
26
26
  let initialized = $state(false)
27
- let availableHeight: number = $state(window.innerHeight)
27
+ let availableHeight: number | null = $state(null)
28
28
  let element: HTMLElement | null = $state(null)
29
29
 
30
30
  onMount(() => {
@@ -47,6 +47,11 @@
47
47
  }
48
48
 
49
49
  function setAvailableHeight(): void {
50
+ if (!displayAd) {
51
+ availableHeight = null
52
+ return
53
+ }
54
+
50
55
  const modal = document.querySelector('.modal')!
51
56
  availableHeight = window.innerHeight - (element!.getBoundingClientRect().top + modal.scrollTop + parseInt(window.getComputedStyle(modal).paddingBottom))
52
57
  }
@@ -64,7 +69,7 @@
64
69
 
65
70
  <Modal blur {onclose} {prepend} {...restProps}>
66
71
  {#snippet dialog()}
67
- <div class="rail-modal" class:initialized style:--transition-duration="{transitionDuration}ms" style:--available-height="{availableHeight}px" bind:this={element}>
72
+ <div class="rail-modal" class:initialized style:--transition-duration="{transitionDuration}ms" style:--available-height={availableHeight && availableHeight + 'px'} bind:this={element}>
68
73
  <TinySlider threshold={40} moveThreshold={40} transitionDuration={initialized ? transitionDuration : 0} bind:this={slider}>
69
74
  {#snippet children({ currentIndex })}
70
75
  {#each items as item, index}
@@ -165,7 +170,7 @@
165
170
  border-radius: theme(rail-modal-item-border-radius, border-radius-huge) theme(rail-modal-item-border-radius, border-radius-huge) 0 0;
166
171
  background: theme(rail-modal-item-background, light);
167
172
  box-shadow: none;
168
- height: calc(var(--available-height, 90vh) - env(safe-area-inset-top));
173
+ height: calc(var(--available-height, 90vh) - margin(1) - env(safe-area-inset-top));
169
174
  overflow: auto;
170
175
  overscroll-behavior: contain;
171
176
  transition: box-shadow var(--transition-duration);