Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: next release #1610

Merged
merged 3 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @vue-flow/core

## 1.41.1

### Patch Changes

- [#1608](https://github.com/bcakmakoglu/vue-flow/pull/1608) [`0581cd8`](https://github.com/bcakmakoglu/vue-flow/commit/0581cd820f7db3aa04a7247e56d283327906b93b) Thanks [@bcakmakoglu](https://github.com/bcakmakoglu)! - Prevent overwriting width/height in node styles object with `node.width`/`node.height` if `width`/`height` already exist in the styles object.
Fixes NodeResizer not working when initial size was passed to a node through `node.width`/`node.height`.

- [#1609](https://github.com/bcakmakoglu/vue-flow/pull/1609) [`81a81fa`](https://github.com/bcakmakoglu/vue-flow/commit/81a81faf5a2708b34c6b867593480050fbcfb27f) Thanks [@bcakmakoglu](https://github.com/bcakmakoglu)! - Prevent drag-click handler when multi selection is active.

## 1.41.0

### Minor Changes
Expand Down
7 changes: 4 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "@vue-flow/core",
"version": "1.41.0",
"version": "1.41.1",
"private": false,
"license": "MIT",
"author": "Burak Cakmakoglu<[email protected]>",
"repository": {
"type": "git",
"url": "git+https://github.com/bcakmakoglu/vue-flow"
"url": "git+https://github.com/bcakmakoglu/vue-flow",
"directory": "packages/core"
},
"homepage": "https://github.com/bcakmakoglu/vue-flow#readme",
"homepage": "https://vueflow.dev",
"bugs": {
"url": "https://github.com/bcakmakoglu/vue-flow/issues"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/components/Nodes/NodeWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ const NodeWrapper = defineComponent({
const width = node.width instanceof Function ? node.width(node) : node.width
const height = node.height instanceof Function ? node.height(node) : node.height

if (width) {
if (!styles.width && width) {
styles.width = typeof width === 'string' ? width : `${width}px`
}

if (height) {
if (!styles.height && height) {
styles.height = typeof height === 'string' ? height : `${height}px`
}

Expand Down
16 changes: 3 additions & 13 deletions packages/core/src/composables/useDrag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,24 +229,14 @@ export function useDrag(params: UseDragParams) {
}

const eventEnd = (event: UseDragEvent) => {
if (!dragStarted) {
const pointerPos = getPointerPosition(event)

const x = pointerPos.xSnapped - (lastPos.x ?? 0)
const y = pointerPos.ySnapped - (lastPos.y ?? 0)
const distance = Math.sqrt(x * x + y * y)

// dispatch a click event if the node was attempted to be dragged but the threshold was not exceeded
if (distance !== 0 && distance <= nodeDragThreshold.value) {
onClick?.(event.sourceEvent)
}

return
if (!dragging.value && !multiSelectionActive.value) {
onClick?.(event.sourceEvent)
}

dragging.value = false
autoPanStarted = false
dragStarted = false
lastPos = { x: undefined, y: undefined }

cancelAnimationFrame(autoPanId)

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export function applyChanges<
element.dimensions = currentChange.dimensions
}

if (typeof currentChange.updateStyle !== 'undefined') {
if (typeof currentChange.updateStyle !== 'undefined' && currentChange.updateStyle) {
element.style = {
...(element.style || {}),
width: `${currentChange.dimensions?.width}px`,
Expand Down
Loading