@eclipse-glsp/client
Advanced tools
Comparing version 2.3.0-next.380 to 2.3.0-next.381
@@ -17,10 +17,8 @@ /******************************************************************************** | ||
********************************************************************************/ | ||
import { Action, DOMHelper, GModelElement, MousePositionTracker, ViewerOptions } from '@eclipse-glsp/sprotty'; | ||
import { Action, GModelElement, MousePositionTracker } from '@eclipse-glsp/sprotty'; | ||
import { Ranked } from './ranked'; | ||
export declare class GLSPMousePositionTracker extends MousePositionTracker implements Ranked { | ||
rank: number; | ||
protected viewerOptions: ViewerOptions; | ||
protected domHelper: DOMHelper; | ||
mouseMove(target: GModelElement, event: MouseEvent): (Action | Promise<Action>)[]; | ||
} | ||
//# sourceMappingURL=mouse-position-tracker.d.ts.map |
@@ -8,5 +8,2 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -42,5 +39,5 @@ exports.GLSPMousePositionTracker = void 0; | ||
// such as foreignObjects or the projection bars divs. Instead, we manually translate the client coordinates to the diagram | ||
const clientToRoot = (0, sprotty_1.getAbsoluteClientBounds)(target.root, this.domHelper, this.viewerOptions); | ||
const globalOrigin = target.root.canvasBounds; | ||
const clientToPosition = { x: event.clientX, y: event.clientY }; | ||
const rootToPosition = sprotty_1.Point.subtract(clientToPosition, clientToRoot); | ||
const rootToPosition = sprotty_1.Point.subtract(clientToPosition, globalOrigin); | ||
const positionOnDiagram = target.root.parentToLocal(rootToPosition); | ||
@@ -52,10 +49,2 @@ this.lastPosition = positionOnDiagram; | ||
exports.GLSPMousePositionTracker = GLSPMousePositionTracker; | ||
__decorate([ | ||
(0, inversify_1.inject)(sprotty_1.TYPES.ViewerOptions), | ||
__metadata("design:type", Object) | ||
], GLSPMousePositionTracker.prototype, "viewerOptions", void 0); | ||
__decorate([ | ||
(0, inversify_1.inject)(sprotty_1.TYPES.DOMHelper), | ||
__metadata("design:type", sprotty_1.DOMHelper) | ||
], GLSPMousePositionTracker.prototype, "domHelper", void 0); | ||
exports.GLSPMousePositionTracker = GLSPMousePositionTracker = __decorate([ | ||
@@ -62,0 +51,0 @@ (0, inversify_1.injectable)() |
{ | ||
"name": "@eclipse-glsp/client", | ||
"version": "2.3.0-next.380+b01477a", | ||
"version": "2.3.0-next.381+d472c7a", | ||
"description": "A sprotty-based client for GLSP", | ||
@@ -49,3 +49,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@eclipse-glsp/sprotty": "2.3.0-next.380+b01477a", | ||
"@eclipse-glsp/sprotty": "2.3.0-next.381+d472c7a", | ||
"autocompleter": "^9.1.2", | ||
@@ -67,3 +67,3 @@ "file-saver": "^2.0.5", | ||
}, | ||
"gitHead": "b01477a769ebb7798248491db8576b46838695f8" | ||
"gitHead": "d472c7a8ca5e38a813c9053fe05e12f5dae0e4cd" | ||
} |
@@ -17,13 +17,4 @@ /******************************************************************************** | ||
********************************************************************************/ | ||
import { | ||
Action, | ||
DOMHelper, | ||
GModelElement, | ||
MousePositionTracker, | ||
Point, | ||
TYPES, | ||
ViewerOptions, | ||
getAbsoluteClientBounds | ||
} from '@eclipse-glsp/sprotty'; | ||
import { inject, injectable } from 'inversify'; | ||
import { Action, GModelElement, MousePositionTracker, Point } from '@eclipse-glsp/sprotty'; | ||
import { injectable } from 'inversify'; | ||
import { Ranked } from './ranked'; | ||
@@ -36,11 +27,8 @@ | ||
@inject(TYPES.ViewerOptions) protected viewerOptions: ViewerOptions; | ||
@inject(TYPES.DOMHelper) protected domHelper: DOMHelper; | ||
override mouseMove(target: GModelElement, event: MouseEvent): (Action | Promise<Action>)[] { | ||
// we cannot simply use the offsetX and offsetY properties of the event since they also consider nested HTML elements | ||
// such as foreignObjects or the projection bars divs. Instead, we manually translate the client coordinates to the diagram | ||
const clientToRoot = getAbsoluteClientBounds(target.root, this.domHelper, this.viewerOptions); | ||
const globalOrigin = target.root.canvasBounds; | ||
const clientToPosition = { x: event.clientX, y: event.clientY }; | ||
const rootToPosition = Point.subtract(clientToPosition, clientToRoot); | ||
const rootToPosition = Point.subtract(clientToPosition, globalOrigin); | ||
const positionOnDiagram = target.root.parentToLocal(rootToPosition); | ||
@@ -47,0 +35,0 @@ this.lastPosition = positionOnDiagram; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
3657645
56584