([targets]: [TypedSelection[]])
| 21 | } |
| 22 | |
| 23 | async run([targets]: [TypedSelection[]]): Promise<ActionReturnValue> { |
| 24 | const insideTargets = targets.map((target) => |
| 25 | performInsideOutsideAdjustment(target, "inside") |
| 26 | ); |
| 27 | const outsideTargets = targets.map((target) => |
| 28 | performInsideOutsideAdjustment(target, "outside") |
| 29 | ); |
| 30 | const outsideTargetDecorations = zip(insideTargets, outsideTargets).flatMap( |
| 31 | ([inside, outside]) => getOutsideOverflow(inside!, outside!) |
| 32 | ); |
| 33 | const options = { showDecorations: false }; |
| 34 | |
| 35 | await Promise.all([ |
| 36 | displayPendingEditDecorations( |
| 37 | insideTargets, |
| 38 | this.graph.editStyles.referenced |
| 39 | ), |
| 40 | displayPendingEditDecorations( |
| 41 | outsideTargetDecorations, |
| 42 | this.graph.editStyles.pendingDelete |
| 43 | ), |
| 44 | ]); |
| 45 | |
| 46 | await this.graph.actions.copyToClipboard.run([insideTargets], options); |
| 47 | |
| 48 | const { thatMark } = await this.graph.actions.remove.run( |
| 49 | [outsideTargets], |
| 50 | options |
| 51 | ); |
| 52 | |
| 53 | return { thatMark }; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | export class Copy extends CommandAction { |
nothing calls this directly
no test coverage detected