@playpilot/tpi 8.21.4 → 8.21.7

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.21.4",
3
+ "version": "8.21.7",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -13,10 +13,11 @@
13
13
  "lint": "prettier --check . && eslint .",
14
14
  "test:unit": "vitest",
15
15
  "test": "npm run test:unit -- --run",
16
- "release": "node release.js"
16
+ "release": "node release.js",
17
+ "postinstall": "patch-package"
17
18
  },
18
19
  "devDependencies": {
19
- "@playpilot/retargeting-tracking": "^1.4.0",
20
+ "@playpilot/retargeting-tracking": "^1.4.1",
20
21
  "@sveltejs/adapter-auto": "^7.0.1",
21
22
  "@sveltejs/kit": "^2.56.1",
22
23
  "@sveltejs/vite-plugin-svelte": "^4.0.0",
@@ -29,16 +30,17 @@
29
30
  "eslint-config-prettier": "^9.1.0",
30
31
  "eslint-plugin-svelte": "^3.15.0",
31
32
  "globals": "^15.0.0",
32
- "happy-dom": "^16.8.1",
33
+ "happy-dom": "^20.10.6",
34
+ "patch-package": "^8.0.1",
33
35
  "prettier": "^3.8.3",
34
36
  "prettier-plugin-svelte": "^3.2.6",
35
37
  "sass": "^1.99.0",
36
- "svelte": "5.44.1",
37
- "svelte-check": "^4.0.0",
38
- "svelte-preprocess": "^6.0.3",
38
+ "svelte": "5.55.7",
39
+ "svelte-check": "^4.6.0",
40
+ "svelte-preprocess": "^6.0.5",
39
41
  "svelte-tiny-slider": "^2.7.2",
40
- "typescript": "^5.9.3",
41
- "typescript-eslint": "^8.59.2",
42
+ "typescript": "^6.0.3",
43
+ "typescript-eslint": "^8.62.0",
42
44
  "vite": "^5.4.21",
43
45
  "vite-plugin-css-injected-by-js": "^4.0.1",
44
46
  "vitest": "^2.1.9"
@@ -0,0 +1,13 @@
1
+ diff --git a/node_modules/svelte/src/compiler/warnings.js b/node_modules/svelte/src/compiler/warnings.js
2
+ index 089cb1e..5003a7f 100644
3
+ --- a/node_modules/svelte/src/compiler/warnings.js
4
+ +++ b/node_modules/svelte/src/compiler/warnings.js
5
+ @@ -667,7 +667,7 @@ export function reactive_declaration_module_script_dependency(node) {
6
+ * @param {string} type
7
+ */
8
+ export function state_referenced_locally(node, name, type) {
9
+ - w(node, 'state_referenced_locally', `This reference only captures the initial value of \`${name}\`. Did you mean to reference it inside a ${type} instead?\nhttps://svelte.dev/e/state_referenced_locally`);
10
+ + // w(node, 'state_referenced_locally', `This reference only captures the initial value of \`${name}\`. Did you mean to reference it inside a ${type} instead?\nhttps://svelte.dev/e/state_referenced_locally`);
11
+ }
12
+
13
+ /**
@@ -17,7 +17,6 @@ export function getLinkInjectionElements(parentElement: HTMLElement, excludeElem
17
17
  if (validElements.includes(element)) continue
18
18
  if (excludeElementsSelector && element.matches(excludeElementsSelector)) continue
19
19
 
20
- // Ignore links, buttons, and headers
21
20
  if (/^(A|BUTTON|SCRIPT|NOSCRIPT|STYLE|IFRAME|FIGCAPTION|TIME|LABEL|BLOCKQUOTE|H1)$/.test(element.tagName)) continue
22
21
 
23
22
  // Ignore elements that are visibly hidden as they are likely only for screen readers.
package/src/mount.ts CHANGED
@@ -26,4 +26,4 @@ window.PlayPilotMount = {
26
26
  },
27
27
  }
28
28
 
29
- export default window.PlayPilotLinkInjections
29
+ export default window.PlayPilotMount
@@ -79,7 +79,7 @@
79
79
  }
80
80
 
81
81
  function getMatchingElements(): Element[] {
82
- const injectedElements = Array.from(document.querySelectorAll(`[data-playpilot-injection-key="${key}"]`))
82
+ const injectedElements = Array.from(document.querySelectorAll(`[data-playpilot-injection-key="${key.toString()}"]`))
83
83
  if (injectedElements.length) return injectedElements
84
84
 
85
85
  // No matching injection was found, so we try and get the element the sentence might be in.
@@ -77,6 +77,7 @@
77
77
 
78
78
  <svelte:window ontouchmove={move} ontouchend={end} />
79
79
 
80
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
80
81
  <div class="handle" class:dragging={isDragging} class:dragged={hasBeenDragged} bind:this={handleElement} ontouchstart={start}></div>
81
82
 
82
83
  <style lang="scss">
@@ -64,7 +64,7 @@ describe('$lib/api/auth', () => {
64
64
  it('Should throw error if api response was negative and throwError is true', async () => {
65
65
  vi.mocked(api).mockRejectedValueOnce({ response: '', ok: false, status: 403 })
66
66
 
67
- expect(async () => await authorize({ href: 'https://example.com/some-path?articleReplacementEditToken=some-token', throwError: true })).rejects.toThrowError()
67
+ await expect(async () => await authorize({ href: 'https://example.com/some-path?articleReplacementEditToken=some-token', throwError: true })).rejects.toThrowError()
68
68
  })
69
69
  })
70
70
 
@@ -30,14 +30,14 @@ describe('$lib/api/search', () => {
30
30
  it('Should throw when response is invalid', async () => {
31
31
  vi.mocked(api).mockRejectedValueOnce({ ok: false })
32
32
 
33
- expect(async () => await searchTitles('')).rejects.toThrowError()
33
+ await expect(async () => await searchTitles('')).rejects.toThrowError()
34
34
  })
35
35
 
36
36
  it('Should throw when no api token is given', async () => {
37
37
  // @ts-ignore
38
38
  window.PlayPilotLinkInjections = null
39
39
 
40
- expect(async () => await searchTitles('')).rejects.toThrowError('No token was provided')
40
+ await expect(async () => await searchTitles('')).rejects.toThrowError('No token was provided')
41
41
  })
42
42
  })
43
43
  })
@@ -30,7 +30,7 @@ describe('injectionElements.ts', () => {
30
30
  })
31
31
 
32
32
  it('Should ignore child elements that were already included in parent text', () => {
33
- document.body.innerHTML = '<section><p>Some paragraph <div>Some div</div></p></section>'
33
+ document.body.innerHTML = '<section><p>Some paragraph <span>Some div</span></p></section>'
34
34
  const parent = /** @type {HTMLElement} */ (document.querySelector('section'))
35
35
 
36
36
  expect(getLinkInjectionElements(parent)).toHaveLength(1)
@@ -109,7 +109,7 @@ describe('EditorItem.svelte', () => {
109
109
  const onhighlight = vi.fn()
110
110
  const { container } = render(EditorItem, { linkInjection, onhighlight })
111
111
 
112
- await fireEvent.mouseOver(/** @type {HTMLElement} */ (document.querySelector(`[data-playpilot-injection-key=${ linkInjection.key }]`)))
112
+ await fireEvent.mouseOver(/** @type {HTMLElement} */ (document.querySelector(`[data-playpilot-injection-key="${ linkInjection.key }"]`)))
113
113
  expect(container.querySelector('.highlighted')).toBeTruthy()
114
114
  expect(onhighlight).toHaveBeenCalled()
115
115
  })
@@ -2,8 +2,14 @@ import { render } from '@testing-library/svelte'
2
2
  import { describe, expect, it } from 'vitest'
3
3
 
4
4
  import YouTubeEmbed from '../../../routes/components/YouTubeEmbed.svelte'
5
+ import { beforeEach } from 'node:test'
6
+ import { fakeFetch } from '../../helpers'
5
7
 
6
8
  describe('YouTubeEmbed.svelte', () => {
9
+ beforeEach(() => {
10
+ fakeFetch()
11
+ })
12
+
7
13
  it('Should render embed iframe with given video url and default options', () => {
8
14
  const { container } = render(YouTubeEmbed, { embeddable_url: 'youtube.com/watch?v=abc' })
9
15
 
package/vite.config.js CHANGED
@@ -20,7 +20,6 @@ export default defineConfig(() => ({
20
20
  environmentOptions: {
21
21
  happyDOM: {
22
22
  settings: {
23
- enableJavaScriptEvaluation: true,
24
23
  disableJavaScriptFileLoading: true,
25
24
  },
26
25
  },