@playpilot/tpi 6.9.1 → 6.9.3

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": "6.9.1",
3
+ "version": "6.9.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -126,6 +126,7 @@ h1, h2, h3, h4, h5 {
126
126
  transform: translateX(-50%);
127
127
  width: 40px;
128
128
  height: auto;
129
+ margin: 0 !important;
129
130
  border-radius: theme(border-radius-small);
130
131
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
131
132
  transform-origin: bottom center;
@@ -54,6 +54,11 @@ export type ConfigResponse = {
54
54
  */
55
55
  require_affiliate_consent?: boolean
56
56
 
57
+ /**
58
+ * Scroll reveal posters that show on mobile are enabled by default. Use this option to disable them.
59
+ */
60
+ disable_scroll_reveal_posters?: boolean
61
+
57
62
  /**
58
63
  * The following options are all relevant for in text disclaimers, which renders as a disclaimer text within the article,
59
64
  * rather than only inside of title cards.
@@ -17,6 +17,7 @@
17
17
  onDestroy(destroyAllPosters)
18
18
 
19
19
  function onscroll(): void {
20
+ if (window.PlayPilotLinkInjections?.config?.disable_scroll_reveal_posters) return
20
21
  if (!isMobile) return
21
22
 
22
23
  setScrollTimeout()
@@ -190,12 +190,6 @@
190
190
  margin-top: margin(1);
191
191
  }
192
192
 
193
- .right {
194
- display: flex;
195
- gap: inherit;
196
- margin-left: auto;
197
- }
198
-
199
193
  .background {
200
194
  position: absolute;
201
195
  top: 0;
@@ -14,8 +14,11 @@ function createPosterLink(top = 0, url = 'poster.jpg') {
14
14
  return link
15
15
  }
16
16
 
17
- describe('FloatingPoster', () => {
17
+ describe('PostersScrollReveal', () => {
18
18
  beforeEach(() => {
19
+ // @ts-ignore
20
+ window.PlayPilotLinkInjections = {}
21
+
19
22
  document.body.innerHTML = ''
20
23
 
21
24
  Object.defineProperty(window, 'innerHeight', {
@@ -44,6 +47,19 @@ describe('FloatingPoster', () => {
44
47
  expect(poster?.getAttribute('src')).toBe('poster.jpg')
45
48
  })
46
49
 
50
+ it('Should not create poster when config object value is given', async () => {
51
+ window.PlayPilotLinkInjections.config = { disable_scroll_reveal_posters: true }
52
+
53
+ createPosterLink(500)
54
+
55
+ render(PostersScrollReveal)
56
+
57
+ window.dispatchEvent(new Event('scroll'))
58
+
59
+ const poster = document.querySelector('[data-playpilot-poster]')
60
+ expect(poster).not.toBeTruthy()
61
+ })
62
+
47
63
  it('Should not create posters on desktop when link is in viewport', async () => {
48
64
  createPosterLink(500)
49
65