refactor(editor): create ndv store (#4409)

* refactor ndv module out

* update active node in root state

* simplify

* fix conflict

* fix dragging
This commit is contained in:
Mutasem Aldmour
2022-10-24 11:35:03 +02:00
committed by GitHub
parent f6733cff9d
commit 127f988400
38 changed files with 331 additions and 308 deletions

View File

@@ -67,10 +67,10 @@ export default Vue.extend({
},
computed: {
canDrop(): boolean {
return this.$store.getters['ui/canDraggableDrop'];
return this.$store.getters['ndv/canDraggableDrop'];
},
stickyPosition(): XYPosition | null {
return this.$store.getters['ui/draggableStickyPos'];
return this.$store.getters['ndv/draggableStickyPos'];
},
},
methods: {
@@ -111,7 +111,7 @@ export default Vue.extend({
this.isDragging = true;
const data = this.targetDataKey && this.draggingEl ? this.draggingEl.dataset.value : (this.data || '');
this.$store.commit('ui/draggableStartDragging', {type: this.type, data });
this.$store.commit('ndv/draggableStartDragging', {type: this.type, data });
this.$emit('dragstart', this.draggingEl);
document.body.style.cursor = 'grabbing';
@@ -141,7 +141,7 @@ export default Vue.extend({
this.$emit('dragend', this.draggingEl);
this.isDragging = false;
this.draggingEl = null;
this.$store.commit('ui/draggableStopDragging');
this.$store.commit('ndv/draggableStopDragging');
}, 0);
},
},