Skip to content

Commit b36c82f

Browse files
authored
chore(deps): upgrade dependencies (#695)
- pre-commit hook -> pre-push - fix tests after upgrading packages - add dependabot workflow for actions
1 parent 8a0fbef commit b36c82f

8 files changed

Lines changed: 1132 additions & 1415 deletions

File tree

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: '/'
6+
schedule:
7+
interval: monthly
8+
9+
# Group all dependabot version update PRs into one
10+
groups:
11+
github-actions:
12+
applies-to: version-updates
13+
patterns:
14+
- '*'

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
3333
3434
- name: Install dependencies
35-
run: npm install
35+
run: npm ci
3636

3737
- name: Run tests
3838
run: npm test
File renamed without changes.

README.md

Lines changed: 60 additions & 60 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 1006 additions & 1308 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,50 +50,50 @@
5050
"email": "timmywil@users.noreply.github.com"
5151
},
5252
"devDependencies": {
53-
"@commitlint/cli": "^20.1.0",
54-
"@commitlint/config-conventional": "^20.0.0",
53+
"@commitlint/cli": "^20.4.3",
54+
"@commitlint/config-conventional": "^20.4.3",
5555
"@release-it/bumper": "7.0.5",
56-
"@release-it/conventional-changelog": "10.0.2",
56+
"@release-it/conventional-changelog": "10.0.5",
5757
"@types/assert": "^1.5.11",
58-
"@types/prismjs": "^1.26.5",
58+
"@types/prismjs": "^1.26.6",
5959
"@types/qunit": "^2.19.13",
60-
"@types/react": "^19.2.7",
60+
"@types/react": "^19.2.14",
6161
"@types/react-dom": "^19.2.3",
6262
"@types/semver": "^7.7.1",
63-
"@typescript-eslint/eslint-plugin": "^8.48.0",
64-
"@typescript-eslint/parser": "^8.48.0",
65-
"commitlint": "^20.1.0",
63+
"@typescript-eslint/eslint-plugin": "^8.56.1",
64+
"@typescript-eslint/parser": "^8.56.1",
65+
"commitlint": "^20.4.3",
6666
"concurrently": "^9.2.1",
67-
"conventional-changelog-conventionalcommits": "^9.1.0",
67+
"conventional-changelog-conventionalcommits": "^9.3.0",
6868
"cross-env": "^10.1.0",
69-
"css-loader": "^7.1.2",
70-
"eslint": "^9.39.1",
69+
"css-loader": "^7.1.4",
70+
"eslint": "^9.39.3",
7171
"eslint-config-prettier": "^10.1.8",
7272
"eslint-plugin-react": "^7.37.5",
7373
"gzip-size": "^7.0.0",
74-
"html-webpack-plugin": "^5.6.5",
74+
"html-webpack-plugin": "^5.6.6",
7575
"husky": "^9.1.7",
76-
"jquery-test-runner": "^0.2.8",
77-
"marked": "^17.0.1",
78-
"prettier": "^3.7.3",
76+
"jquery-test-runner": "^0.3.0",
77+
"marked": "^17.0.4",
78+
"prettier": "^3.8.1",
7979
"prismjs": "^1.30.0",
80-
"qunit": "^2.24.3",
81-
"react": "^19.2.0",
82-
"react-dom": "^19.2.0",
83-
"release-it": "19.0.6",
84-
"rollup": "^4.53.3",
80+
"qunit": "^2.25.0",
81+
"react": "^19.2.4",
82+
"react-dom": "^19.2.4",
83+
"release-it": "19.2.4",
84+
"rollup": "^4.59.0",
8585
"rollup-plugin-typescript2": "^0.36.0",
86-
"semver": "^7.7.3",
86+
"semver": "^7.7.4",
8787
"style-loader": "^4.0.0",
8888
"ts-loader": "^9.5.4",
8989
"tslib": "^2.8.1",
90-
"typedoc": "^0.28.15",
91-
"typedoc-plugin-markdown": "^4.9.0",
90+
"typedoc": "^0.28.17",
91+
"typedoc-plugin-markdown": "^4.10.0",
9292
"typescript": "~5.9.3",
9393
"uglify-js": "^3.19.3",
94-
"webpack": "^5.103.0",
94+
"webpack": "^5.105.4",
9595
"webpack-cli": "^6.0.1",
96-
"webpack-dev-server": "^5.2.2"
96+
"webpack-dev-server": "^5.2.3"
9797
},
9898
"prettier": {
9999
"printWidth": 100,

src/css.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ export function setTransform(
110110
* Dimensions used in containment and focal point zooming
111111
*/
112112
export function getDimensions(elem: HTMLElement | SVGElement) {
113-
const parent = elem.parentNode as HTMLElement | SVGElement
113+
let parent = elem.parentNode as HTMLElement | SVGElement | null
114+
if (!parent || parent.nodeType !== 1) {
115+
parent = document.documentElement
116+
}
117+
114118
const style = window.getComputedStyle(elem)
115119
const parentStyle = window.getComputedStyle(parent)
116120
const rectElem = elem.getBoundingClientRect()

test/unit/panzoom.test.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,27 +63,27 @@ QUnit.module('Panzoom', () => {
6363
const div = document.createElement('div')
6464
document.body.appendChild(div)
6565
Panzoom(div)
66-
function checkEvent(event: CustomEvent<PanzoomEventDetail>) {
67-
console.log(`${event.type} called`)
68-
assert.ok(event.detail, 'Event detail exists')
69-
assert.ok(event.detail.hasOwnProperty('x'), 'Event detail has x value')
70-
assert.ok(event.detail.hasOwnProperty('y'), 'Event detail has y value')
71-
assert.ok(event.detail.hasOwnProperty('scale'), 'Event detail has scale value')
72-
assert.ok(event.detail.hasOwnProperty('isSVG'), 'Event detail has isSVG value')
73-
assert.ok(
74-
event.detail.hasOwnProperty('originalEvent'),
75-
'Event detail has originalEvent value'
76-
)
77-
if (event.type === 'panzoomend') {
78-
document.body.removeChild(div)
79-
done()
80-
}
66+
67+
const events = ['panzoomstart', 'panzoomchange', 'panzoompan', 'panzoomzoom', 'panzoomend']
68+
let eventsCalled = 0
69+
for (const eventName of events) {
70+
div.addEventListener(eventName, (event) => {
71+
eventsCalled++
72+
const customEvent = event as CustomEvent<PanzoomEventDetail>
73+
assert.ok(customEvent.detail, 'Event detail exists')
74+
assert.ok(customEvent.detail.hasOwnProperty('x'), 'Event detail has x value')
75+
assert.ok(customEvent.detail.hasOwnProperty('y'), 'Event detail has y value')
76+
assert.ok(customEvent.detail.hasOwnProperty('scale'), 'Event detail has scale value')
77+
assert.ok(customEvent.detail.hasOwnProperty('isSVG'), 'Event detail has isSVG value')
78+
assert.ok(
79+
customEvent.detail.hasOwnProperty('originalEvent'),
80+
'Event detail has originalEvent value'
81+
)
82+
if (eventsCalled === events.length) {
83+
done()
84+
}
85+
})
8186
}
82-
;(div as any).addEventListener('panzoomstart', checkEvent)
83-
;(div as any).addEventListener('panzoomchange', checkEvent)
84-
;(div as any).addEventListener('panzoompan', checkEvent)
85-
;(div as any).addEventListener('panzoomzoom', checkEvent)
86-
;(div as any).addEventListener('panzoomend', checkEvent)
8787

8888
div.dispatchEvent(new PointerEvent('pointerdown'))
8989
setTimeout(() => {
@@ -93,6 +93,7 @@ QUnit.module('Panzoom', () => {
9393
})
9494
})
9595
})
96+
9697
QUnit.test('removes the events when using the destroy method', (assert) => {
9798
const div = document.createElement('div')
9899
document.body.appendChild(div)

0 commit comments

Comments
 (0)