Skip to content

Commit b0ffe42

Browse files
committed
chore(core): update d3 type deps
1 parent 247a037 commit b0ffe42

File tree

10 files changed

+41
-185
lines changed

10 files changed

+41
-185
lines changed

docs/components/Repl.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ export default defineComponent({
77
props: ['example', 'examplesImports', 'dependencies'],
88
setup(props) {
99
return () => {
10+
if (typeof navigator === 'undefined') {
11+
return null
12+
}
13+
1014
return h(Suspense, h(DocsRepl, props))
1115
}
1216
},

docs/src/components.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ declare module 'vue' {
3838
Showcase: typeof import('./../components/home/Showcase.vue')['default']
3939
Sidebar: typeof import('./../components/examples/dnd/Sidebar.vue')['default']
4040
SnappableConnectionLine: typeof import('./../components/examples/connection-radius/SnappableConnectionLine.vue')['default']
41-
Team: typeof import('./../components/home/Team.vue')['default']
4241
TeleportableNode: typeof import('./../components/examples/teleport/TeleportableNode.vue')['default']
4342
ToolbarNode: typeof import('./../components/examples/node-toolbar/ToolbarNode.vue')['default']
4443
TransitionEdge: typeof import('./../components/examples/transition/TransitionEdge.vue')['default']

packages/core/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@
7575
},
7676
"devDependencies": {
7777
"@rollup/plugin-replace": "^5.0.2",
78-
"@types/d3": "^7.4.0",
78+
"@types/d3-drag": "^3.0.4",
79+
"@types/d3-selection": "^3.0.7",
80+
"@types/d3-zoom": "^3.0.5",
7981
"@tooling/eslint-config": "workspace:*",
8082
"@tooling/tsconfig": "workspace:*",
8183
"@vitejs/plugin-vue": "^4.2.3",

packages/core/src/composables/useViewport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,5 +228,5 @@ export function useViewport(state: State, getters: ComputedGetters) {
228228
}
229229

230230
function transition(selection: D3Selection, ms = 0, onEnd: () => void) {
231-
return selection.transition().duration(ms).on('end', onEnd)
231+
return (selection as any).transition().duration(ms).on('end', onEnd)
232232
}

packages/core/src/container/Viewport/Transform.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { id, viewport, d3Zoom, d3Selection, dimensions } = useVueFlow()
99
1010
const viewportReady = ref(!isClient)
1111
12-
until(() => d3Zoom.value && d3Selection.value && dimensions.value.width > 0 && dimensions.value.height > 0)
12+
until(() => !!(d3Zoom.value && d3Selection.value && dimensions.value.width > 0 && dimensions.value.height > 0))
1313
.toBe(true)
1414
.then(() => {
1515
setTimeout(() => {

packages/core/src/store/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ export function useActions(
807807

808808
if (!state.d3Zoom) {
809809
until(() => state.d3Zoom)
810-
.not.toBeUndefined()
810+
.not.toBeNull()
811811
.then(setSkippedOptions)
812812
} else {
813813
setSkippedOptions()

packages/core/src/types/zoom.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import type { Selection, ZoomBehavior } from 'd3'
1+
import type { Selection } from 'd3-selection'
2+
import type { ZoomBehavior } from 'd3-zoom'
23
import type { Rect, XYPosition } from './flow'
34

45
export type D3Zoom = ZoomBehavior<HTMLDivElement, unknown>
5-
export type D3Selection = Selection<HTMLDivElement, unknown, any, any>
6+
export type D3Selection = Selection<HTMLDivElement, any, any, any>
67
export type D3ZoomHandler = (this: HTMLDivElement, event: any, d: unknown) => void
78

89
export enum PanOnScrollMode {

packages/minimap/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
"@tooling/eslint-config": "workspace:*",
6868
"@tooling/tsconfig": "workspace:*",
6969
"@tooling/vite-config": "workspace:*",
70-
"@types/d3-selection": "^3.0.3",
71-
"@types/d3-zoom": "^3.0.1",
70+
"@types/d3-selection": "^3.0.7",
71+
"@types/d3-zoom": "^3.0.5",
7272
"@vue-flow/core": "workspace:*",
7373
"vue": "^3.2.25",
7474
"vue-tsc": "^1.6.5"

packages/node-resizer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
"@tooling/eslint-config": "workspace:*",
7171
"@tooling/tsconfig": "workspace:*",
7272
"@tooling/vite-config": "workspace:*",
73-
"@types/d3-drag": "^3.0.2",
74-
"@types/d3-selection": "^3.0.4",
73+
"@types/d3-drag": "^3.0.4",
74+
"@types/d3-selection": "^3.0.7",
7575
"@vue-flow/core": "workspace:*",
7676
"vite-plugin-vue-type-imports": "^0.2.4",
7777
"vue": "^3.2.25",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)