This commit is contained in:
barsdeveloper
2024-12-11 23:23:23 +02:00
parent 3de0e74ef0
commit e405a7245d
26 changed files with 471 additions and 181 deletions

View File

@@ -29,24 +29,8 @@ export default class Copy extends IInput {
window.removeEventListener("copy", this.#copyHandler)
}
getSerializedText() {
const nodes = this.blueprint.getNodes(true).map(n => n.entity)
let exports = false
let result = nodes
.filter(n => {
exports ||= n.exported
return !n.exported
})
.reduce((acc, cur) => acc + cur.serialize(), "")
if (exports) {
const object = new NiagaraClipboardContent(this.blueprint.entity, nodes)
result = object.serialize() + result
}
return result
}
copied() {
const value = this.getSerializedText()
const value = this.blueprint.getSerializedText()
navigator.clipboard.writeText(value)
return value
}

View File

@@ -33,13 +33,6 @@ export default class Cut extends IInput {
window.removeEventListener("cut", this.#cutHandler)
}
getSerializedText() {
return this.blueprint
.getNodes(true)
.map(node => node.entity.serialize())
.join("")
}
cut() {
this.blueprint.template.getCopyInputObject().copied()
this.blueprint.removeGraphElement(...this.blueprint.getNodes(true))