@playpilot/tpi 8.38.0 → 8.38.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.38.0",
3
+ "version": "8.38.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -57,7 +57,7 @@
57
57
  onexpand={(title) => track(TrackingEvent.ExploreTitleRailExpandClick, title, { rail: headings })}
58
58
  fetchFunction={(page) => getListTitles({ ...params, page })}
59
59
  size={properties.size || 'flexible'}
60
- minimumLength={7} />
60
+ minimumLength={properties.minimum ?? 7} />
61
61
  </div>
62
62
  {/each}
63
63
  {:catch}
@@ -61,11 +61,13 @@
61
61
  {description}
62
62
  </p>
63
63
 
64
- <div class="read-more">
65
- <Button variant="link" onclick={() => descriptionExpanded = !descriptionExpanded}>
66
- {descriptionExpanded ? t('Read Less') : t('Read More')}
67
- </Button>
68
- </div>
64
+ {#if !small}
65
+ <div class="read-more">
66
+ <Button variant="link" onclick={() => descriptionExpanded = !descriptionExpanded}>
67
+ {descriptionExpanded ? t('Read Less') : t('Read More')}
68
+ </Button>
69
+ </div>
70
+ {/if}
69
71
  {/if}
70
72
  </div>
71
73
  </div>
@@ -172,6 +174,11 @@
172
174
  &.expanded {
173
175
  display: block;
174
176
  }
177
+
178
+ .small & {
179
+ font-size: theme(font-size-small);
180
+ line-height: 1.5;
181
+ }
175
182
  }
176
183
 
177
184
  .read-more {
@@ -168,6 +168,8 @@
168
168
  {/each}
169
169
  </Rail>
170
170
  {:then titles}
171
+ {@const titlesWithoutDuplicates = titles.filter((a, i, titles) => titles.findIndex(b => (b.sid === a.sid)) === i)}
172
+
171
173
  {#if titles?.length >= minimumLength}
172
174
  <Rail
173
175
  bind:slider
@@ -175,7 +177,7 @@
175
177
  {heading}
176
178
  onchange={(index) => onchange(titles, index)}
177
179
  onresize={() => slider?.reposition()}>
178
- {#each titles as title, index}
180
+ {#each titlesWithoutDuplicates as title, index}
179
181
  {@const expanded = isExpanded(title)}
180
182
  {@const onclick = (event: MouseEvent): void => openTitle(event, titles, index)}
181
183
 
@@ -221,4 +221,10 @@ describe('TitlesRail.svelte', () => {
221
221
  expect(window.location.href).toContain(`?route=modal&sid=${title.sid}`)
222
222
  expect(openModal).not.toHaveBeenCalledWith()
223
223
  })
224
+
225
+ it('Should remove duplicate titles', () => {
226
+ const { container } = render(TitlesRail, { titles: [title, title] })
227
+
228
+ expect(container.querySelectorAll('.title')).toHaveLength(1)
229
+ })
224
230
  })