|
@@ -57,6 +57,22 @@ export class CopyShortcut implements ShortcutsHandler {
|
|
|
await this.write(data);
|
|
await this.write(data);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * create clipboard data - 转换为剪贴板数据
|
|
|
|
|
+ */
|
|
|
|
|
+ public toClipboardData(nodes?: WorkflowNodeEntity[]): WorkflowClipboardData {
|
|
|
|
|
+ const validNodes = this.getValidNodes(nodes ? nodes : this.selectedNodes);
|
|
|
|
|
+ const source = this.toSource();
|
|
|
|
|
+ const json = this.toJSON(validNodes);
|
|
|
|
|
+ const bounds = this.getEntireBounds(validNodes);
|
|
|
|
|
+ return {
|
|
|
|
|
+ type: WorkflowClipboardDataID,
|
|
|
|
|
+ source,
|
|
|
|
|
+ json,
|
|
|
|
|
+ bounds,
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* has selected text - 是否有文字被选中
|
|
* has selected text - 是否有文字被选中
|
|
|
*/
|
|
*/
|
|
@@ -93,22 +109,6 @@ export class CopyShortcut implements ShortcutsHandler {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * create clipboard data - 转换为剪贴板数据
|
|
|
|
|
- */
|
|
|
|
|
- toClipboardData(nodes?: WorkflowNodeEntity[]): WorkflowClipboardData {
|
|
|
|
|
- const validNodes = this.getValidNodes(nodes ? nodes : this.selectedNodes);
|
|
|
|
|
- const source = this.toSource();
|
|
|
|
|
- const json = this.toJSON(validNodes);
|
|
|
|
|
- const bounds = this.getEntireBounds(validNodes);
|
|
|
|
|
- return {
|
|
|
|
|
- type: WorkflowClipboardDataID,
|
|
|
|
|
- source,
|
|
|
|
|
- json,
|
|
|
|
|
- bounds,
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* get valid nodes - 获取有效的节点
|
|
* get valid nodes - 获取有效的节点
|
|
|
*/
|
|
*/
|