@playpilot/tpi 8.29.2 → 8.29.3-beta.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/dist/editorial.mount.js +8 -8
- package/dist/link-injections.js +2 -2
- package/dist/mount.js +6 -6
- package/package.json +1 -1
- package/src/lib/injection.ts +3 -0
- package/src/lib/modal.ts +4 -0
- package/src/routes/components/Rails/ParticipantsRail.svelte +0 -3
- package/src/tests/lib/injection.test.js +1 -1
- package/src/tests/routes/components/Rails/ParticipantsRail.test.js +1 -1
package/package.json
CHANGED
package/src/lib/injection.ts
CHANGED
|
@@ -355,6 +355,9 @@ function addLinkInjectionEventListeners(injections: LinkInjection[]): void {
|
|
|
355
355
|
|
|
356
356
|
export function clearLinkInjections(): void {
|
|
357
357
|
const elements = document.querySelectorAll(keySelector)
|
|
358
|
+
|
|
359
|
+
if (!elements.length) return
|
|
360
|
+
|
|
358
361
|
elements.forEach((element) => clearLinkInjection(element.getAttribute(keyDataAttribute) || ''))
|
|
359
362
|
|
|
360
363
|
clearAfterArticlePlaylinks()
|
package/src/lib/modal.ts
CHANGED
|
@@ -65,6 +65,8 @@ function addModalToList({ type = 'title', injection = null, data, scrollPosition
|
|
|
65
65
|
|
|
66
66
|
/** Unmount the last modal is the list of modals but keep it in the list of active modals */
|
|
67
67
|
export function closeCurrentModal(outro: boolean = true): void {
|
|
68
|
+
console.trace('closeCurrentModal')
|
|
69
|
+
|
|
68
70
|
if (!modals.length) return
|
|
69
71
|
|
|
70
72
|
saveCurrentModalScrollPosition()
|
|
@@ -80,6 +82,8 @@ export function destroyCurrentModal(outro: boolean = true): void {
|
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
export function destroyAllModals(outro: boolean = true): void {
|
|
85
|
+
console.trace('destroyAllModals')
|
|
86
|
+
|
|
83
87
|
closeCurrentModal(outro)
|
|
84
88
|
|
|
85
89
|
while (modals.length > 0) modals.pop()
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { track } from '$lib/tracking'
|
|
9
9
|
import type { ParticipantData } from '$lib/types/participant'
|
|
10
10
|
import type { TitleData } from '$lib/types/title'
|
|
11
|
-
import { getContext } from 'svelte'
|
|
12
11
|
import ParticipantImage from '../Participants/ParticipantImage.svelte'
|
|
13
12
|
import Rail from './Rail.svelte'
|
|
14
13
|
import { exploreModalUrl } from '$lib/routes'
|
|
@@ -20,8 +19,6 @@
|
|
|
20
19
|
|
|
21
20
|
const { title, heading = t('Cast') }: Props = $props()
|
|
22
21
|
|
|
23
|
-
const navigate: Function | undefined = getContext('navigate')
|
|
24
|
-
|
|
25
22
|
/**
|
|
26
23
|
* Order participants by how often their name appears in an the page text. This only takes into account
|
|
27
24
|
* their full name. If an actor is mentioned by first name only, which is often the case, they won't get
|
|
@@ -573,7 +573,7 @@ describe('injection.ts', () => {
|
|
|
573
573
|
})
|
|
574
574
|
|
|
575
575
|
it('Should remove all popovers that may not have been removed properly in previous destroy attempts', async () => {
|
|
576
|
-
document.body.innerHTML = '<div data-playpilot-injection-popover></div> <p>This is a sentence with an injection.</p>'
|
|
576
|
+
document.body.innerHTML = '<div data-playpilot-injection-key></div><div data-playpilot-injection-popover></div> <p>This is a sentence with an injection.</p>'
|
|
577
577
|
|
|
578
578
|
const elements = Array.from(document.body.querySelectorAll('p'))
|
|
579
579
|
const injection = generateInjection('This is a sentence with an injection.', 'an injection')
|