mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-14 00:54:48 +08:00
19 lines
481 B
JavaScript
19 lines
481 B
JavaScript
import GraphNode from "../graph/GraphNode"
|
|
import KeyboardShortcut from "./KeyboardShortcut"
|
|
|
|
export default class Paste extends KeyboardShortcut {
|
|
|
|
constructor(target, blueprint) {
|
|
super(target, blueprint, {
|
|
keys: ["Control", "C"]
|
|
})
|
|
}
|
|
|
|
fire() {
|
|
let value = navigator.clipboard.readText()
|
|
let nodes = this.serializer.readMultiple(value).map(entity => new GraphNode(entity))
|
|
this.blueprint.addNode(...nodes)
|
|
}
|
|
|
|
}
|