Skip to content

Commit

Permalink
Hopefully fixed #118
Browse files Browse the repository at this point in the history
  • Loading branch information
newcat committed Mar 7, 2021
1 parent 3d44f5e commit 492fdd6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 37 deletions.
6 changes: 3 additions & 3 deletions packages/baklavajs-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
},
"dependencies": {
"vue": "^2.6.12",
"vue-class-component": "^7.2.6",
"vue-property-decorator": "^9.1.2"
"vue-class-component": "7.2.3",
"vue-property-decorator": "9.1.2"
},
"devDependencies": {
"@vue/cli-plugin-typescript": "^4.5.11",
Expand All @@ -23,4 +23,4 @@
"last 2 versions",
"not ie <= 8"
]
}
}
6 changes: 3 additions & 3 deletions packages/baklavajs-plugin-options-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"typescript": "^4.1.2",
"v-click-outside": "^3.1.2",
"vue": "^2.6.12",
"vue-class-component": "^7.2.6",
"vue-class-component": "7.2.3",
"vue-loader": "^15.9.5",
"vue-property-decorator": "8.4.1",
"vue-property-decorator": "9.1.2",
"vue-template-compiler": "^2.6.12",
"webpack": "^4.29.6",
"webpack-cli": "^4.2.0",
Expand All @@ -39,4 +39,4 @@
"access": "public"
},
"gitHead": "ac12fc9a34736475d40dd391b27162be5b73378f"
}
}
4 changes: 2 additions & 2 deletions packages/baklavajs-plugin-renderer-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"typescript": "^4.1.3",
"v-click-outside": "^3.1.2",
"vue": "^2.6.12",
"vue-class-component": "^7.2.6",
"vue-class-component": "7.2.3",
"vue-loader": "^15.9.6",
"vue-property-decorator": "9.1.2",
"vue-template-compiler": "^2.6.12",
Expand All @@ -49,4 +49,4 @@
"access": "public"
},
"gitHead": "723bf8b6249e6b67d9a7a5a9c84cf1ee0ca33739"
}
}
31 changes: 14 additions & 17 deletions packages/baklavajs-plugin-renderer-vue/src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tabindex="-1"
:class="[
'node-editor',
{ 'ignore-mouse': !!temporaryConnection, '--temporary-connection': !!temporaryConnection }
{ 'ignore-mouse': !!temporaryConnection, '--temporary-connection': !!temporaryConnection },
]"
@mousemove.self="mouseMoveHandler"
@mousedown="mouseDown"
Expand Down Expand Up @@ -63,15 +63,12 @@

<script lang="ts">
import { Component, Vue, Prop, Provide, Watch } from "vue-property-decorator";
import { VueConstructor } from "vue";
import {
IEditor,
INode,
ITransferConnection,
INodeInterface,
ITemporaryConnection,
TemporaryConnectionState
TemporaryConnectionState,
} from "../../../baklavajs-core/types";
import { ViewPlugin } from "../viewPlugin";
import { IViewNode } from "../../types";
Expand Down Expand Up @@ -105,13 +102,13 @@ export default class EditorView extends Vue {
items: [] as IMenuItem[],
show: false,
x: 0,
y: 0
y: 0,
};
get styles() {
return {
"transform-origin": "0 0",
"transform": `scale(${this.plugin.scaling}) translate(${this.plugin.panning.x}px, ${this.plugin.panning.y}px)`
"transform": `scale(${this.plugin.scaling}) translate(${this.plugin.panning.x}px, ${this.plugin.panning.y}px)`,
};
}
Expand All @@ -127,7 +124,7 @@ export default class EditorView extends Vue {
: "";
return {
"background-position": `left ${positionLeft}px top ${positionTop}px`,
"background-size": `${backgroundSize} ${subGridBackgroundSize}`
"background-size": `${backgroundSize} ${subGridBackgroundSize}`,
};
}
Expand Down Expand Up @@ -166,14 +163,14 @@ export default class EditorView extends Vue {
.map((c) => {
const nodes = Array.from(this.plugin.editor.nodeCategories.get(c)!).map((n) => ({
value: "addNode:" + n,
label: this.plugin.nodeTypeAliases[n] || n
label: this.plugin.nodeTypeAliases[n] || n,
}));
return { label: c, submenu: nodes };
});
const defaultNodes = this.plugin.editor.nodeCategories.get("default")!.map((n) => ({
value: "addNode:" + n,
label: this.plugin.nodeTypeAliases[n] || n
label: this.plugin.nodeTypeAliases[n] || n,
}));
const addNodeSubmenu: IMenuItem[] = [...categories];
Expand All @@ -185,18 +182,18 @@ export default class EditorView extends Vue {
this.contextMenu.items = [
{
label: "Add Node",
submenu: addNodeSubmenu
submenu: addNodeSubmenu,
},
{
label: "Copy Nodes",
value: "copy",
disabledFunction: () => this.selectedNodes.length === 0
disabledFunction: () => this.selectedNodes.length === 0,
},
{
label: "Paste Nodes",
value: "paste",
disabledFunction: () => this.clipboard.isEmpty
}
disabledFunction: () => this.clipboard.isEmpty,
},
] as IMenuItem[];
}
Expand Down Expand Up @@ -245,13 +242,13 @@ export default class EditorView extends Vue {
if (this.hoveringOver.isInput && connection) {
this.temporaryConnection = {
status: TemporaryConnectionState.NONE,
from: connection.from
from: connection.from,
};
this.plugin.editor.removeConnection(connection);
} else {
this.temporaryConnection = {
status: TemporaryConnectionState.NONE,
from: this.hoveringOver
from: this.hoveringOver,
};
}
Expand Down Expand Up @@ -282,7 +279,7 @@ export default class EditorView extends Vue {
const newScale = this.plugin.scaling * (1 - scrollAmount / 3000);
const currentPoint = [
ev.offsetX / this.plugin.scaling - this.plugin.panning.x,
ev.offsetY / this.plugin.scaling - this.plugin.panning.y
ev.offsetY / this.plugin.scaling - this.plugin.panning.y,
];
const newPoint = [ev.offsetX / newScale - this.plugin.panning.x, ev.offsetY / newScale - this.plugin.panning.y];
const diff = [newPoint[0] - currentPoint[0], newPoint[1] - currentPoint[1]];
Expand Down
17 changes: 5 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10304,10 +10304,10 @@ vscode-textmate@^5.2.0:
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.2.0.tgz#01f01760a391e8222fe4f33fbccbd1ad71aed74e"
integrity sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==

vue-class-component@^7.1.0, vue-class-component@^7.2.6:
version "7.2.6"
resolved "https://registry.yarnpkg.com/vue-class-component/-/vue-class-component-7.2.6.tgz#8471e037b8e4762f5a464686e19e5afc708502e4"
integrity sha512-+eaQXVrAm/LldalI272PpDe3+i4mPis0ORiMYxF6Ae4hyuCh15W8Idet7wPUEs4N4YptgFHGys4UrgNQOMyO6w==
vue-class-component@7.2.3:
version "7.2.3"
resolved "https://registry.yarnpkg.com/vue-class-component/-/vue-class-component-7.2.3.tgz#a5b1abd53513a72ad51098752e2dedd499807cca"
integrity sha512-oEqYpXKaFN+TaXU+mRLEx8dX0ah85aAJEe61mpdoUrq0Bhe/6sWhyZX1JjMQLhVsHAkncyhedhmCdDVSasUtDw==

vue-hot-reload-api@^2.3.0:
version "2.3.4"
Expand All @@ -10334,14 +10334,7 @@ vue-loader@^15.9.2, vue-loader@^15.9.5, vue-loader@^15.9.6:
vue-hot-reload-api "^2.3.0"
vue-style-loader "^4.1.0"

vue-property-decorator@8.4.1:
version "8.4.1"
resolved "https://registry.yarnpkg.com/vue-property-decorator/-/vue-property-decorator-8.4.1.tgz#fd8045b8678e1348fed57f9149279e00e404ed38"
integrity sha512-8R4Us7DxFO0rwAL/2fv6vaZL8Oa4n/HGanHODYGTcvQHwT0FYJr9UuuFm2GoWAIXQu1mDO03HNeHswFp9vmTVA==
dependencies:
vue-class-component "^7.1.0"

vue-property-decorator@9.1.2, vue-property-decorator@^9.1.2:
vue-property-decorator@9.1.2:
version "9.1.2"
resolved "https://registry.yarnpkg.com/vue-property-decorator/-/vue-property-decorator-9.1.2.tgz#266a2eac61ba6527e2e68a6933cfb98fddab5457"
integrity sha512-xYA8MkZynPBGd/w5QFJ2d/NM0z/YeegMqYTphy7NJQXbZcuU6FC6AOdUAcy4SXP+YnkerC6AfH+ldg7PDk9ESQ==
Expand Down

0 comments on commit 492fdd6

Please sign in to comment.