Socket
Socket
Sign inDemoInstall

sprotty

Package Overview
Dependencies
Maintainers
4
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sprotty - npm Package Compare versions

Comparing version 0.14.0-next.14ff906-1.10 to 0.14.0-next.60db4ac.11

2

lib/base/actions/action-handler.d.ts

@@ -19,3 +19,3 @@ /********************************************************************************

import { ICommand } from "../commands/command";
import { Action } from "./action";
import { Action } from "sprotty-protocol";
/**

@@ -22,0 +22,0 @@ * An action handler accepts an action and reacts to it by returning either a command to be

@@ -16,2 +16,3 @@ /********************************************************************************

********************************************************************************/
import { Action as ProtocolAction } from 'sprotty-protocol/lib/actions';
import { JsonAny } from 'sprotty-protocol/lib/utils/json';

@@ -85,7 +86,7 @@ /**

readonly label: string;
readonly actions: Action[];
readonly actions: ProtocolAction[];
readonly icon?: string | undefined;
constructor(label: string, actions: Action[], icon?: string | undefined);
constructor(label: string, actions: ProtocolAction[], icon?: string | undefined);
}
export declare function isLabeledAction(element: unknown): element is LabeledAction;
//# sourceMappingURL=action.d.ts.map

@@ -28,3 +28,3 @@ /********************************************************************************

*/
export declare class RequestModelAction implements RequestAction<SetModelAction>, ProtocolRequestModelAction {
export declare class RequestModelAction implements ProtocolRequestModelAction {
readonly options?: {

@@ -31,0 +31,0 @@ [key: string]: JsonPrimitive;

@@ -17,2 +17,3 @@ /********************************************************************************

import { Bounds, Point } from "sprotty-protocol/lib/utils/geometry";
import { SModelElement as ProtocolSModelElement } from "sprotty-protocol";
import { FluentIterable } from "../../utils/iterable";

@@ -61,4 +62,4 @@ /**

}
export declare function isParent(element: SModelElementSchema | SModelElement): element is SModelElementSchema & {
children: SModelElementSchema[];
export declare function isParent(element: ProtocolSModelElement | SModelElement): element is ProtocolSModelElement & {
children: ProtocolSModelElement[];
};

@@ -113,6 +114,6 @@ /**

export interface IModelIndex {
add(element: SModelElementSchema): void;
remove(element: SModelElementSchema): void;
contains(element: SModelElementSchema): boolean;
getById(id: string): SModelElementSchema | undefined;
add(element: ProtocolSModelElement): void;
remove(element: ProtocolSModelElement): void;
contains(element: ProtocolSModelElement): boolean;
getById(id: string): ProtocolSModelElement | undefined;
}

@@ -119,0 +120,0 @@ /**

@@ -11,3 +11,5 @@ import { ILogger } from "../../utils/logging";

hide(): void;
enableOnStartup?: boolean;
}
export declare function isUIExtension(object: unknown): object is IUIExtension;
/**

@@ -14,0 +16,0 @@ * Abstract base class for UI extensions.

@@ -12,3 +12,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.AbstractUIExtension = void 0;
exports.AbstractUIExtension = exports.isUIExtension = void 0;
/********************************************************************************

@@ -30,3 +30,10 @@ * Copyright (c) 2019 EclipseSource and others.

const inversify_1 = require("inversify");
const sprotty_protocol_1 = require("sprotty-protocol");
const types_1 = require("../types");
function isUIExtension(object) {
return (0, sprotty_protocol_1.hasOwnProperty)(object, 'id', 'function')
&& (0, sprotty_protocol_1.hasOwnProperty)(object, 'show', 'function')
&& (0, sprotty_protocol_1.hasOwnProperty)(object, 'hide', 'function');
}
exports.isUIExtension = isUIExtension;
/**

@@ -33,0 +40,0 @@ * Abstract base class for UI extensions.

@@ -182,3 +182,3 @@ "use strict";

get blockUntil() {
return action => action.kind === ComputedBoundsAction.KIND;
return action => action.kind === actions_1.ComputedBoundsAction.KIND;
}

@@ -185,0 +185,0 @@ };

@@ -16,3 +16,4 @@ /********************************************************************************

********************************************************************************/
import { SShapeElement, SShapeElementSchema } from '../bounds/model';
import { SShapeElement } from '../bounds/model';
import { SShapeElement as SShapeElementSchema } from 'sprotty-protocol';
export interface SButtonSchema extends SShapeElementSchema {

@@ -19,0 +20,0 @@ pressed: boolean;

@@ -16,3 +16,3 @@ /********************************************************************************

********************************************************************************/
import { Action } from 'sprotty-protocol/lib/actions';
import { Action, CreateElementAction as ProtocolCreateElementAction } from 'sprotty-protocol/lib/actions';
import { SModelElement as SModelElementSchema } from 'sprotty-protocol/lib/model';

@@ -38,7 +38,7 @@ import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';

export declare class CreateElementCommand extends Command {
protected readonly action: CreateElementAction;
protected readonly action: ProtocolCreateElementAction;
static readonly KIND = "createElement";
container: SParentElement;
newElement: SChildElement;
constructor(action: CreateElementAction);
constructor(action: ProtocolCreateElementAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -45,0 +45,0 @@ undo(context: CommandExecutionContext): CommandReturn;

@@ -32,2 +32,3 @@ "use strict";

const inversify_1 = require("inversify");
const actions_1 = require("sprotty-protocol/lib/actions");
const command_1 = require("../../base/commands/command");

@@ -71,3 +72,3 @@ const smodel_1 = require("../../base/model/smodel");

};
CreateElementCommand.KIND = CreateElementAction.KIND;
CreateElementCommand.KIND = actions_1.CreateElementAction.KIND;
CreateElementCommand = __decorate([

@@ -74,0 +75,0 @@ (0, inversify_1.injectable)(),

@@ -16,3 +16,3 @@ /********************************************************************************

********************************************************************************/
import { Action } from 'sprotty-protocol/lib/actions';
import { Action, DeleteElementAction as ProtocolDeleteElementAction } from 'sprotty-protocol/lib/actions';
import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';

@@ -43,6 +43,6 @@ import { SModelElement, SParentElement, SChildElement } from '../../base/model/smodel';

export declare class DeleteElementCommand extends Command {
protected readonly action: DeleteElementAction;
protected readonly action: ProtocolDeleteElementAction;
static readonly KIND = "delete";
resolvedDeletes: ResolvedDelete[];
constructor(action: DeleteElementAction);
constructor(action: ProtocolDeleteElementAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -49,0 +49,0 @@ undo(context: CommandExecutionContext): CommandReturn;

@@ -32,2 +32,3 @@ "use strict";

const inversify_1 = require("inversify");
const actions_1 = require("sprotty-protocol/lib/actions");
const command_1 = require("../../base/commands/command");

@@ -83,3 +84,3 @@ const smodel_1 = require("../../base/model/smodel");

};
DeleteElementCommand.KIND = DeleteElementAction.KIND;
DeleteElementCommand.KIND = actions_1.DeleteElementAction.KIND;
DeleteElementCommand = __decorate([

@@ -86,0 +87,0 @@ (0, inversify_1.injectable)(),

@@ -16,3 +16,3 @@ /********************************************************************************

********************************************************************************/
import { Action } from 'sprotty-protocol/lib/actions';
import { Action, ApplyLabelEditAction as ProtocolApplyLabelEditAction } from 'sprotty-protocol/lib/actions';
import { CommandExecutionContext, CommandReturn, Command } from '../../base/commands/command';

@@ -44,3 +44,3 @@ import { SModelElement } from '../../base/model/smodel';

}
export declare function isApplyLabelEditAction(element?: any): element is ApplyLabelEditAction;
export declare function isApplyLabelEditAction(element?: any): element is ProtocolApplyLabelEditAction;
export declare class ResolvedLabelEdit {

@@ -52,6 +52,6 @@ label: EditableLabel;

export declare class ApplyLabelEditCommand extends Command {
protected readonly action: ApplyLabelEditAction;
protected readonly action: ProtocolApplyLabelEditAction;
static readonly KIND = "applyLabelEdit";
protected resolvedLabelEdit: ResolvedLabelEdit;
constructor(action: ApplyLabelEditAction);
constructor(action: ProtocolApplyLabelEditAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -58,0 +58,0 @@ undo(context: CommandExecutionContext): CommandReturn;

@@ -69,3 +69,3 @@ "use strict";

function isApplyLabelEditAction(element) {
return (0, actions_1.isAction)(element) && element.kind === ApplyLabelEditAction.KIND && 'labelId' in element && 'text' in element;
return (0, actions_1.isAction)(element) && element.kind === actions_1.ApplyLabelEditAction.KIND && 'labelId' in element && 'text' in element;
}

@@ -103,3 +103,3 @@ exports.isApplyLabelEditAction = isApplyLabelEditAction;

};
ApplyLabelEditCommand.KIND = ApplyLabelEditAction.KIND;
ApplyLabelEditCommand.KIND = actions_1.ApplyLabelEditAction.KIND;
ApplyLabelEditCommand = __decorate([

@@ -106,0 +106,0 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

@@ -16,3 +16,3 @@ /********************************************************************************

********************************************************************************/
import { Action } from 'sprotty-protocol/lib/actions';
import { Action, ReconnectAction as ProtocolReconnectAction } from 'sprotty-protocol/lib/actions';
import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';

@@ -38,7 +38,7 @@ import { EdgeMemento, EdgeRouterRegistry } from '../routing/routing';

export declare class ReconnectCommand extends Command {
protected readonly action: ReconnectAction;
protected readonly action: ProtocolReconnectAction;
static readonly KIND = "reconnect";
edgeRouterRegistry: EdgeRouterRegistry;
memento: EdgeMemento | undefined;
constructor(action: ReconnectAction);
constructor(action: ProtocolReconnectAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -45,0 +45,0 @@ private doExecute;

@@ -32,2 +32,3 @@ "use strict";

const inversify_1 = require("inversify");
const actions_1 = require("sprotty-protocol/lib/actions");
const command_1 = require("../../base/commands/command");

@@ -89,3 +90,3 @@ const types_1 = require("../../base/types");

};
ReconnectCommand.KIND = ReconnectAction.KIND;
ReconnectCommand.KIND = actions_1.ReconnectAction.KIND;
__decorate([

@@ -92,0 +93,0 @@ (0, inversify_1.inject)(routing_1.EdgeRouterRegistry),

@@ -16,3 +16,3 @@ /********************************************************************************

********************************************************************************/
import { Action, RequestAction, ResponseAction, RequestPopupModelAction as ProtocolRequestPopupModelAction, SetPopupModelAction as ProtocolSetPopupModelAction } from "sprotty-protocol/lib/actions";
import { Action, RequestAction, ResponseAction, RequestPopupModelAction as ProtocolRequestPopupModelAction, SetPopupModelAction as ProtocolSetPopupModelAction, HoverFeedbackAction as ProtocolHoverFeedbackAction } from "sprotty-protocol/lib/actions";
import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';

@@ -44,5 +44,5 @@ import { Bounds, Point } from "sprotty-protocol/lib/utils/geometry";

export declare class HoverFeedbackCommand extends SystemCommand {
protected readonly action: HoverFeedbackAction;
protected readonly action: ProtocolHoverFeedbackAction;
static readonly KIND = "hoverFeedback";
constructor(action: HoverFeedbackAction);
constructor(action: ProtocolHoverFeedbackAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -49,0 +49,0 @@ undo(context: CommandExecutionContext): CommandReturn;

@@ -78,3 +78,3 @@ "use strict";

};
HoverFeedbackCommand.KIND = HoverFeedbackAction.KIND;
HoverFeedbackCommand.KIND = actions_1.HoverFeedbackAction.KIND;
HoverFeedbackCommand = __decorate([

@@ -167,3 +167,3 @@ (0, inversify_1.injectable)(),

this.state.previousPopupElement = undefined;
resolve(new SetPopupModelAction({ type: smodel_factory_1.EMPTY_ROOT.type, id: smodel_factory_1.EMPTY_ROOT.id }));
resolve(actions_1.SetPopupModelAction.create({ type: smodel_factory_1.EMPTY_ROOT.type, id: smodel_factory_1.EMPTY_ROOT.id }));
}, this.options.popupCloseDelay);

@@ -225,3 +225,3 @@ });

const popupBounds = this.computePopupBounds(target, { x: event.pageX, y: event.pageY });
resolve(new RequestPopupModelAction(target.id, popupBounds));
resolve(actions_1.RequestPopupModelAction.create({ elementId: target.id, bounds: popupBounds }));
this.state.popupOpen = true;

@@ -249,3 +249,3 @@ this.state.previousPopupElement = target;

if (this.lastHoverFeedbackElementId) {
result.push(HoverFeedbackAction.create({ mouseoverElement: this.lastHoverFeedbackElementId, mouseIsOver: false }));
result.push(actions_1.HoverFeedbackAction.create({ mouseoverElement: this.lastHoverFeedbackElementId, mouseIsOver: false }));
this.lastHoverFeedbackElementId = undefined;

@@ -255,3 +255,3 @@ }

if (hoverTarget !== undefined) {
result.push(HoverFeedbackAction.create({ mouseoverElement: hoverTarget.id, mouseIsOver: true }));
result.push(actions_1.HoverFeedbackAction.create({ mouseoverElement: hoverTarget.id, mouseIsOver: true }));
this.lastHoverFeedbackElementId = hoverTarget.id;

@@ -276,5 +276,5 @@ }

if (hoverTarget !== undefined) {
result.push(HoverFeedbackAction.create({ mouseoverElement: hoverTarget.id, mouseIsOver: false }));
result.push(actions_1.HoverFeedbackAction.create({ mouseoverElement: hoverTarget.id, mouseIsOver: false }));
if (this.lastHoverFeedbackElementId && this.lastHoverFeedbackElementId !== hoverTarget.id) {
result.push(HoverFeedbackAction.create({ mouseoverElement: this.lastHoverFeedbackElementId, mouseIsOver: false }));
result.push(actions_1.HoverFeedbackAction.create({ mouseoverElement: this.lastHoverFeedbackElementId, mouseIsOver: false }));
}

@@ -339,3 +339,3 @@ this.lastHoverFeedbackElementId = undefined;

if ((0, keyboard_1.matchesKeystroke)(event, 'Escape')) {
return [new SetPopupModelAction({ type: smodel_factory_1.EMPTY_ROOT.type, id: smodel_factory_1.EMPTY_ROOT.id })];
return [actions_1.SetPopupModelAction.create({ type: smodel_factory_1.EMPTY_ROOT.type, id: smodel_factory_1.EMPTY_ROOT.id })];
}

@@ -355,3 +355,3 @@ return [];

else if (this.popupOpen) {
return new SetPopupModelAction({ id: smodel_factory_1.EMPTY_ROOT.id, type: smodel_factory_1.EMPTY_ROOT.type });
return actions_1.SetPopupModelAction.create({ id: smodel_factory_1.EMPTY_ROOT.id, type: smodel_factory_1.EMPTY_ROOT.type });
}

@@ -358,0 +358,0 @@ }

@@ -18,3 +18,3 @@ /********************************************************************************

import { Point } from 'sprotty-protocol/lib/utils/geometry';
import { Action } from 'sprotty-protocol/lib/actions';
import { Action, MoveAction as ProtocolMoveAction } from 'sprotty-protocol/lib/actions';
import { Animation } from '../../base/animations/animation';

@@ -63,3 +63,3 @@ import { CommandExecutionContext, ICommand, MergeableCommand, CommandReturn } from '../../base/commands/command';

export declare class MoveCommand extends MergeableCommand {
protected readonly action: MoveAction;
protected readonly action: ProtocolMoveAction;
static readonly KIND = "move";

@@ -69,3 +69,3 @@ edgeRouterRegistry?: EdgeRouterRegistry;

protected edgeMementi: EdgeMemento[];
constructor(action: MoveAction);
constructor(action: ProtocolMoveAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -114,3 +114,3 @@ protected resolveHandleMove(handle: SRoutingHandle, edge: SRoutableElement, move: ElementMove): ResolvedHandleMove | undefined;

protected isChildOfSelected(selectedElements: Set<SModelElement>, element: SModelElement): boolean;
protected getElementMoves(target: SModelElement, event: MouseEvent, isFinished: boolean): MoveAction | undefined;
protected getElementMoves(target: SModelElement, event: MouseEvent, isFinished: boolean): ProtocolMoveAction | undefined;
protected createElementMove(element: SModelElement, startPosition: Point, delta: Point, event: MouseEvent): ElementMove | undefined;

@@ -117,0 +117,0 @@ protected snap(position: Point, element: SModelElement, isSnap: boolean): Point;

@@ -239,3 +239,3 @@ "use strict";

};
MoveCommand.KIND = MoveAction.KIND;
MoveCommand.KIND = actions_1.MoveAction.KIND;
__decorate([

@@ -455,3 +455,3 @@ (0, inversify_1.inject)(routing_1.EdgeRouterRegistry),

if (elementMoves.length > 0)
return MoveAction.create(elementMoves, { animate: false, finished: isFinished });
return actions_1.MoveAction.create(elementMoves, { animate: false, finished: isFinished });
else

@@ -458,0 +458,0 @@ return undefined;

@@ -255,3 +255,3 @@ "use strict";

const result = [];
result.push(new SelectAction([selectableTarget.id], deselectedElements.map(e => e.id)));
result.push(actions_1.SelectAction.create({ selectedElementsIDs: [selectableTarget.id], deselectedElementsIDs: deselectedElements.map(e => e.id) }));
result.push(actions_1.BringToFrontAction.create([selectableTarget.id]));

@@ -269,3 +269,3 @@ const routableDeselect = deselectedElements.filter(e => e instanceof model_3.SRoutableElement).map(e => e.id);

const result = [];
result.push(new SelectAction([], [selectableTarget.id]));
result.push(actions_1.SelectAction.create({ selectedElementsIDs: [], deselectedElementsIDs: [selectableTarget.id] }));
if (selectableTarget instanceof model_3.SRoutableElement) {

@@ -278,3 +278,3 @@ result.push(edit_routing_1.SwitchEditModeAction.create({ elementsToDeactivate: [selectableTarget.id] }));

const result = [];
result.push(new SelectAction([], deselectedElements.map(e => e.id)));
result.push(actions_1.SelectAction.create({ selectedElementsIDs: [], deselectedElementsIDs: deselectedElements.map(e => e.id) }));
const routableDeselect = deselectedElements.filter(e => e instanceof model_3.SRoutableElement).map(e => e.id);

@@ -296,3 +296,3 @@ if (routableDeselect.length > 0) {

if (this.wasSelected) {
return [new SelectAction([selectableTarget.id], [])];
return [actions_1.SelectAction.create({ selectedElementsIDs: [selectableTarget.id], deselectedElementsIDs: [] })];
}

@@ -346,3 +346,3 @@ }

if ((0, keyboard_1.matchesKeystroke)(event, 'KeyA', 'ctrlCmd')) {
return [new SelectAllAction()];
return [actions_1.SelectAllAction.create()];
}

@@ -349,0 +349,0 @@ return [];

@@ -19,2 +19,3 @@ "use strict";

exports.UndoRedoKeyListener = exports.RedoAction = exports.UndoAction = void 0;
const actions_1 = require("sprotty-protocol/lib/actions");
const keyboard_1 = require("../../utils/keyboard");

@@ -46,5 +47,5 @@ const key_tool_1 = require("../../base/views/key-tool");

if ((0, keyboard_1.matchesKeystroke)(event, 'KeyZ', 'ctrlCmd'))
return [UndoAction.create()];
return [actions_1.UndoAction.create()];
if ((0, keyboard_1.matchesKeystroke)(event, 'KeyZ', 'ctrlCmd', 'shift') || (!(0, browser_1.isMac)() && (0, keyboard_1.matchesKeystroke)(event, 'KeyY', 'ctrlCmd')))
return [RedoAction.create()];
return [actions_1.RedoAction.create()];
return [];

@@ -51,0 +52,0 @@ }

@@ -230,5 +230,5 @@ "use strict";

if ((0, keyboard_1.matchesKeystroke)(event, 'KeyC', 'ctrlCmd', 'shift'))
return [new CenterAction([])];
return [actions_1.CenterAction.create([])];
if ((0, keyboard_1.matchesKeystroke)(event, 'KeyF', 'ctrlCmd', 'shift'))
return [new FitToScreenAction([])];
return [actions_1.FitToScreenAction.create([])];
return [];

@@ -235,0 +235,0 @@ }

@@ -16,3 +16,3 @@ /********************************************************************************

********************************************************************************/
import { Scrollable, Zoomable } from 'sprotty-protocol/lib/model';
import { Scrollable, Zoomable, Viewport as ProtocolViewport } from 'sprotty-protocol/lib/model';
import { SModelElement, SModelRoot } from '../../base/model/smodel';

@@ -25,3 +25,3 @@ export declare const viewportFeature: unique symbol;

}
export declare function isViewport(element: SModelElement): element is SModelRoot & Viewport;
export declare function isViewport(element: SModelElement): element is SModelRoot & ProtocolViewport;
//# sourceMappingURL=model.d.ts.map

@@ -16,3 +16,3 @@ /********************************************************************************

********************************************************************************/
import { Action } from 'sprotty-protocol/lib/actions';
import { Action, BringToFrontAction as ProtocolBringToFrontAction } from 'sprotty-protocol/lib/actions';
import { SModelRoot, SChildElement, SModelElement } from '../../base/model/smodel';

@@ -38,6 +38,6 @@ import { Command, CommandExecutionContext } from '../../base/commands/command';

export declare class BringToFrontCommand extends Command {
action: BringToFrontAction;
action: ProtocolBringToFrontAction;
static readonly KIND = "bringToFront";
protected selected: ZOrderElement[];
constructor(action: BringToFrontAction);
constructor(action: ProtocolBringToFrontAction);
execute(context: CommandExecutionContext): SModelRoot;

@@ -44,0 +44,0 @@ protected includeConnectedEdges(element?: SModelElement): void;

@@ -32,2 +32,3 @@ "use strict";

const inversify_1 = require("inversify");
const actions_1 = require("sprotty-protocol/lib/actions");
const types_1 = require("../../base/types");

@@ -108,3 +109,3 @@ const smodel_1 = require("../../base/model/smodel");

};
BringToFrontCommand.KIND = BringToFrontAction.KIND;
BringToFrontCommand.KIND = actions_1.BringToFrontAction.KIND;
BringToFrontCommand = __decorate([

@@ -111,0 +112,0 @@ (0, inversify_1.injectable)(),

@@ -16,2 +16,3 @@ /********************************************************************************

********************************************************************************/
import { ActionMessage as ProtocolActionMessage } from 'sprotty-protocol';
import { Action, ComputedBoundsAction, RequestModelAction } from 'sprotty-protocol/lib/actions';

@@ -62,3 +63,3 @@ import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';

protected forwardToServer(action: Action): void;
protected abstract sendMessage(message: ActionMessage): void;
protected abstract sendMessage(message: ProtocolActionMessage): void;
protected messageReceived(data: any): void;

@@ -65,0 +66,0 @@ /**

@@ -100,3 +100,3 @@ "use strict";

const object = typeof (data) === 'string' ? JSON.parse(data) : data;
if (isActionMessage(object) && object.action) {
if ((0, sprotty_protocol_1.isActionMessage)(object) && object.action) {
if (!object.clientId || object.clientId === this.clientId) {

@@ -103,0 +103,0 @@ object.action[receivedFromServerProperty] = true;

@@ -18,2 +18,3 @@ /********************************************************************************

import { SModelElement as SModelElementSchema, SModelRoot as SModelRootSchema, Viewport } from 'sprotty-protocol/lib/model';
import { IModelLayoutEngine as ProtocolIModelLayoutEngine } from 'sprotty-protocol';
import { Bounds } from 'sprotty-protocol/lib/utils/geometry';

@@ -36,3 +37,3 @@ import { SModelIndex } from 'sprotty-protocol/lib/utils/model-utils';

protected popupModelProvider?: IPopupModelProvider;
protected layoutEngine?: IModelLayoutEngine;
protected layoutEngine?: ProtocolIModelLayoutEngine;
protected currentRoot: SModelRootSchema;

@@ -39,0 +40,0 @@ /**

@@ -29,2 +29,3 @@ "use strict";

const inversify_1 = require("inversify");
const actions_1 = require("sprotty-protocol/lib/actions");
const logging_1 = require("../utils/logging");

@@ -68,3 +69,3 @@ const types_1 = require("../base/types");

const date = new Date();
const action = LoggingAction.create({
const action = actions_1.LoggingAction.create({
message,

@@ -71,0 +72,0 @@ severity: logging_1.LogLevel[logLevel],

@@ -16,2 +16,3 @@ /********************************************************************************

********************************************************************************/
import { Bounds as ProtocolBounds, Point as ProtocolPoint } from "sprotty-protocol";
/**

@@ -263,8 +264,8 @@ * A Point is composed of the (x,y) coordinates of an object.

export declare class Diamond {
protected bounds: Bounds;
constructor(bounds: Bounds);
get topPoint(): Point;
get rightPoint(): Point;
get bottomPoint(): Point;
get leftPoint(): Point;
protected bounds: ProtocolBounds;
constructor(bounds: ProtocolBounds);
get topPoint(): ProtocolPoint;
get rightPoint(): ProtocolPoint;
get bottomPoint(): ProtocolPoint;
get leftPoint(): ProtocolPoint;
get topRightSideLine(): Line;

@@ -279,3 +280,3 @@ get topLeftSideLine(): Line;

*/
closestSideLine(refPoint: Point): Line;
closestSideLine(refPoint: ProtocolPoint): Line;
}

@@ -295,5 +296,5 @@ /**

export declare class PointToPointLine implements Line {
p1: Point;
p2: Point;
constructor(p1: Point, p2: Point);
p1: ProtocolPoint;
p2: ProtocolPoint;
constructor(p1: ProtocolPoint, p2: ProtocolPoint);
get a(): number;

@@ -323,3 +324,3 @@ get b(): number;

*/
intersection(otherLine: PointToPointLine): Point | undefined;
intersection(otherLine: PointToPointLine): ProtocolPoint | undefined;
/**

@@ -338,3 +339,3 @@ * @param otherLine the other line

*/
export declare function intersection(l1: Line, l2: Line): Point;
export declare function intersection(l1: Line, l2: Line): ProtocolPoint;
//# sourceMappingURL=geometry.d.ts.map

@@ -19,2 +19,3 @@ "use strict";

exports.intersection = exports.PointToPointLine = exports.Diamond = exports.linear = exports.almostEquals = exports.toRadians = exports.toDegrees = exports.magnitude = exports.normalize = exports.shiftTowards = exports.angleBetweenPoints = exports.angleOfPoint = exports.maxDistance = exports.manhattanDistance = exports.euclideanDistance = exports.Direction = exports.includes = exports.centerOfLine = exports.center = exports.translate = exports.combine = exports.isBounds = exports.EMPTY_BOUNDS = exports.isValidDimension = exports.EMPTY_DIMENSION = exports.pointEquals = exports.subtract = exports.add = exports.ORIGIN_POINT = void 0;
const sprotty_protocol_1 = require("sprotty-protocol");
/**

@@ -406,3 +407,3 @@ * (x,y) coordinates of the origin.

closestSideLine(refPoint) {
const c = center(this.bounds);
const c = sprotty_protocol_1.Bounds.center(this.bounds);
if (refPoint.x > c.x) {

@@ -472,3 +473,3 @@ if (refPoint.y > c.y) {

get direction() {
const hDegrees = toDegrees(this.angle);
const hDegrees = (0, sprotty_protocol_1.toDegrees)(this.angle);
const degrees = hDegrees < 0 ? 360 + hDegrees : hDegrees;

@@ -542,6 +543,6 @@ // degrees are relative to the x-axis

hasIndistinctPoints(otherLine) {
return pointEquals(this.p1, otherLine.p1) ||
pointEquals(this.p1, otherLine.p2) ||
pointEquals(this.p2, otherLine.p1) ||
pointEquals(this.p2, otherLine.p2);
return sprotty_protocol_1.Point.equals(this.p1, otherLine.p1) ||
sprotty_protocol_1.Point.equals(this.p1, otherLine.p2) ||
sprotty_protocol_1.Point.equals(this.p2, otherLine.p1) ||
sprotty_protocol_1.Point.equals(this.p2, otherLine.p2);
}

@@ -548,0 +549,0 @@ }

{
"name": "sprotty",
"version": "0.14.0-next.14ff906-1.10+14ff906",
"version": "0.14.0-next.60db4ac.11+60db4ac",
"description": "A next-gen framework for graphical views",

@@ -59,3 +59,3 @@ "license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",

"snabbdom": "^3.5.1",
"sprotty-protocol": "0.14.0-next.14ff906-1.10+14ff906",
"sprotty-protocol": "0.14.0-next.60db4ac.11+60db4ac",
"tinyqueue": "^2.0.3"

@@ -106,3 +106,3 @@ },

],
"gitHead": "14ff906ff28382d35873763ad434af97b0b069f3"
"gitHead": "60db4acc17e68972ed77eee4f1372d2d7f176778"
}

@@ -22,3 +22,3 @@ /********************************************************************************

import { ICommand } from "../commands/command";
import { Action } from "./action";
import { Action } from "sprotty-protocol";

@@ -25,0 +25,0 @@ /**

@@ -17,3 +17,3 @@ /********************************************************************************

import { generateRequestId as generateRequestId2 } from 'sprotty-protocol/lib/actions';
import { generateRequestId as generateRequestId2, Action as ProtocolAction} from 'sprotty-protocol/lib/actions';
import { JsonAny } from 'sprotty-protocol/lib/utils/json';

@@ -103,3 +103,3 @@ import { hasOwnProperty } from 'sprotty-protocol/lib/utils/object';

export class LabeledAction {
constructor(readonly label: string, readonly actions: Action[], readonly icon?: string) { }
constructor(readonly label: string, readonly actions: ProtocolAction[], readonly icon?: string) { }
}

@@ -106,0 +106,0 @@

@@ -36,3 +36,3 @@ /********************************************************************************

*/
export class RequestModelAction implements RequestAction<SetModelAction>, ProtocolRequestModelAction {
export class RequestModelAction implements ProtocolRequestModelAction {
static readonly KIND = 'requestModel';

@@ -39,0 +39,0 @@ readonly kind = RequestModelAction.KIND;

@@ -18,2 +18,3 @@ /********************************************************************************

import { Bounds, isBounds, Point } from "sprotty-protocol/lib/utils/geometry";
import { SModelElement as ProtocolSModelElement } from "sprotty-protocol";
import { mapIterable, FluentIterable } from "../../utils/iterable";

@@ -85,4 +86,4 @@

export function isParent(element: SModelElementSchema | SModelElement):
element is SModelElementSchema & { children: SModelElementSchema[] } {
export function isParent(element: ProtocolSModelElement | SModelElement):
element is ProtocolSModelElement & { children: ProtocolSModelElement[] } {
const children = (element as any).children;

@@ -218,6 +219,6 @@ return children !== undefined && children.constructor === Array;

export interface IModelIndex {
add(element: SModelElementSchema): void
remove(element: SModelElementSchema): void
contains(element: SModelElementSchema): boolean
getById(id: string): SModelElementSchema | undefined
add(element: ProtocolSModelElement): void
remove(element: ProtocolSModelElement): void
contains(element: ProtocolSModelElement): boolean
getById(id: string): ProtocolSModelElement | undefined
}

@@ -224,0 +225,0 @@

@@ -17,2 +17,3 @@ /********************************************************************************

import { inject, injectable } from "inversify";
import { hasOwnProperty } from "sprotty-protocol";
import { ILogger } from "../../utils/logging";

@@ -30,4 +31,11 @@ import { SModelRoot } from "../model/smodel";

hide(): void;
enableOnStartup?: boolean
}
export function isUIExtension(object: unknown): object is IUIExtension {
return hasOwnProperty<string, Function>(object, 'id', 'function')
&& hasOwnProperty<string, Function>(object, 'show', 'function')
&& hasOwnProperty<string, Function>(object, 'hide', 'function');
}
/**

@@ -34,0 +42,0 @@ * Abstract base class for UI extensions.

@@ -19,3 +19,3 @@ /********************************************************************************

import {
Action, generateRequestId, RequestAction, ResponseAction} from 'sprotty-protocol/lib/actions';
Action, generateRequestId, RequestAction, ResponseAction, ComputedBoundsAction as ProtocolComputedBoundsAction} from 'sprotty-protocol/lib/actions';
import * as protocol from "sprotty-protocol/lib/actions";

@@ -202,4 +202,4 @@ import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';

get blockUntil(): (action: Action) => boolean {
return action => action.kind === ComputedBoundsAction.KIND;
return action => action.kind === ProtocolComputedBoundsAction.KIND;
}
}

@@ -17,4 +17,5 @@ /********************************************************************************

import { boundsFeature, layoutableChildFeature, SShapeElement, SShapeElementSchema } from '../bounds/model';
import { boundsFeature, layoutableChildFeature, SShapeElement } from '../bounds/model';
import { fadeFeature } from '../fade/model';
import { SShapeElement as SShapeElementSchema } from 'sprotty-protocol';

@@ -21,0 +22,0 @@ export interface SButtonSchema extends SShapeElementSchema {

@@ -18,3 +18,3 @@ /********************************************************************************

import { inject, injectable } from 'inversify';
import { Action } from 'sprotty-protocol/lib/actions';
import { Action, CreateElementAction as ProtocolCreateElementAction } from 'sprotty-protocol/lib/actions';
import { SModelElement as SModelElementSchema } from 'sprotty-protocol/lib/model';

@@ -49,3 +49,3 @@ import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';

export class CreateElementCommand extends Command {
static readonly KIND = CreateElementAction.KIND;
static readonly KIND = ProtocolCreateElementAction.KIND;

@@ -55,3 +55,3 @@ container: SParentElement;

constructor(@inject(TYPES.Action) protected readonly action: CreateElementAction) {
constructor(@inject(TYPES.Action) protected readonly action: ProtocolCreateElementAction) {
super();

@@ -58,0 +58,0 @@ }

@@ -18,3 +18,3 @@ /********************************************************************************

import { inject, injectable } from 'inversify';
import { Action } from 'sprotty-protocol/lib/actions';
import { Action, DeleteElementAction as ProtocolDeleteElementAction} from 'sprotty-protocol/lib/actions';
import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';

@@ -61,7 +61,7 @@ import { SModelElement, SParentElement, SChildElement } from '../../base/model/smodel';

export class DeleteElementCommand extends Command {
static readonly KIND = DeleteElementAction.KIND;
static readonly KIND = ProtocolDeleteElementAction.KIND;
resolvedDeletes: ResolvedDelete[] = [];
constructor(@inject(TYPES.Action) protected readonly action: DeleteElementAction) {
constructor(@inject(TYPES.Action) protected readonly action: ProtocolDeleteElementAction) {
super();

@@ -68,0 +68,0 @@ }

@@ -18,3 +18,3 @@ /********************************************************************************

import { inject } from 'inversify';
import { Action, isAction } from 'sprotty-protocol/lib/actions';
import { Action, isAction, ApplyLabelEditAction as ProtocolApplyLabelEditAction } from 'sprotty-protocol/lib/actions';
import { CommandExecutionContext, CommandReturn, Command } from '../../base/commands/command';

@@ -70,4 +70,4 @@ import { SModelElement } from '../../base/model/smodel';

export function isApplyLabelEditAction(element?: any): element is ApplyLabelEditAction {
return isAction(element) && element.kind === ApplyLabelEditAction.KIND && 'labelId' in element && 'text' in element;
export function isApplyLabelEditAction(element?: any): element is ProtocolApplyLabelEditAction {
return isAction(element) && element.kind === ProtocolApplyLabelEditAction.KIND && 'labelId' in element && 'text' in element;
}

@@ -83,7 +83,7 @@

export class ApplyLabelEditCommand extends Command {
static readonly KIND = ApplyLabelEditAction.KIND;
static readonly KIND = ProtocolApplyLabelEditAction.KIND;
protected resolvedLabelEdit: ResolvedLabelEdit;
constructor(@inject(TYPES.Action) protected readonly action: ApplyLabelEditAction) {
constructor(@inject(TYPES.Action) protected readonly action: ProtocolApplyLabelEditAction) {
super();

@@ -90,0 +90,0 @@ }

@@ -18,3 +18,3 @@ /********************************************************************************

import { inject, injectable } from 'inversify';
import { Action } from 'sprotty-protocol/lib/actions';
import { Action, ReconnectAction as ProtocolReconnectAction} from 'sprotty-protocol/lib/actions';
import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';

@@ -49,3 +49,3 @@ import { TYPES } from '../../base/types';

export class ReconnectCommand extends Command {
static readonly KIND = ReconnectAction.KIND;
static readonly KIND = ProtocolReconnectAction.KIND;

@@ -56,3 +56,3 @@ @inject(EdgeRouterRegistry) edgeRouterRegistry: EdgeRouterRegistry;

constructor(@inject(TYPES.Action) protected readonly action: ReconnectAction) {
constructor(@inject(TYPES.Action) protected readonly action: ProtocolReconnectAction) {
super();

@@ -59,0 +59,0 @@ }

@@ -21,3 +21,3 @@ /********************************************************************************

ResponseAction, RequestPopupModelAction as ProtocolRequestPopupModelAction,
SetPopupModelAction as ProtocolSetPopupModelAction
SetPopupModelAction as ProtocolSetPopupModelAction, HoverFeedbackAction as ProtocolHoverFeedbackAction
} from "sprotty-protocol/lib/actions";

@@ -63,5 +63,5 @@ import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';

export class HoverFeedbackCommand extends SystemCommand {
static readonly KIND = HoverFeedbackAction.KIND;
static readonly KIND = ProtocolHoverFeedbackAction.KIND;
constructor(@inject(TYPES.Action) protected readonly action: HoverFeedbackAction) {
constructor(@inject(TYPES.Action) protected readonly action: ProtocolHoverFeedbackAction) {
super();

@@ -191,3 +191,3 @@ }

this.state.previousPopupElement = undefined;
resolve(new SetPopupModelAction({ type: EMPTY_ROOT.type, id: EMPTY_ROOT.id }));
resolve(ProtocolSetPopupModelAction.create({ type: EMPTY_ROOT.type, id: EMPTY_ROOT.id }));
}, this.options.popupCloseDelay);

@@ -250,3 +250,3 @@ });

const popupBounds = this.computePopupBounds(target, { x: event.pageX, y: event.pageY });
resolve(new RequestPopupModelAction(target.id, popupBounds));
resolve(ProtocolRequestPopupModelAction.create({ elementId: target.id, bounds: popupBounds }));

@@ -275,3 +275,3 @@ this.state.popupOpen = true;

if (this.lastHoverFeedbackElementId) {
result.push(HoverFeedbackAction.create({ mouseoverElement: this.lastHoverFeedbackElementId, mouseIsOver: false }));
result.push(ProtocolHoverFeedbackAction.create({ mouseoverElement: this.lastHoverFeedbackElementId, mouseIsOver: false }));
this.lastHoverFeedbackElementId = undefined;

@@ -281,3 +281,3 @@ }

if (hoverTarget !== undefined) {
result.push(HoverFeedbackAction.create({ mouseoverElement: hoverTarget.id, mouseIsOver: true }));
result.push(ProtocolHoverFeedbackAction.create({ mouseoverElement: hoverTarget.id, mouseIsOver: true }));
this.lastHoverFeedbackElementId = hoverTarget.id;

@@ -303,5 +303,5 @@ }

if (hoverTarget !== undefined) {
result.push(HoverFeedbackAction.create({ mouseoverElement: hoverTarget.id, mouseIsOver: false }));
result.push(ProtocolHoverFeedbackAction.create({ mouseoverElement: hoverTarget.id, mouseIsOver: false }));
if (this.lastHoverFeedbackElementId && this.lastHoverFeedbackElementId !== hoverTarget.id) {
result.push(HoverFeedbackAction.create({ mouseoverElement: this.lastHoverFeedbackElementId, mouseIsOver: false }));
result.push(ProtocolHoverFeedbackAction.create({ mouseoverElement: this.lastHoverFeedbackElementId, mouseIsOver: false }));
}

@@ -367,3 +367,3 @@ this.lastHoverFeedbackElementId = undefined;

if (matchesKeystroke(event, 'Escape')) {
return [new SetPopupModelAction({ type: EMPTY_ROOT.type, id: EMPTY_ROOT.id })];
return [ProtocolSetPopupModelAction.create({ type: EMPTY_ROOT.type, id: EMPTY_ROOT.id })];
}

@@ -380,7 +380,7 @@ return [];

if (action.kind === SetPopupModelCommand.KIND) {
this.popupOpen = (action as SetPopupModelAction).newRoot.type !== EMPTY_ROOT.type;
this.popupOpen = (action as ProtocolSetPopupModelAction).newRoot.type !== EMPTY_ROOT.type;
} else if (this.popupOpen) {
return new SetPopupModelAction({ id: EMPTY_ROOT.id, type: EMPTY_ROOT.type });
return ProtocolSetPopupModelAction.create({ id: EMPTY_ROOT.id, type: EMPTY_ROOT.type });
}
}
}

@@ -20,3 +20,3 @@ /********************************************************************************

import { Bounds, Point } from 'sprotty-protocol/lib/utils/geometry';
import { Action, DeleteElementAction, ReconnectAction, SelectAction, SelectAllAction } from 'sprotty-protocol/lib/actions';
import { Action, DeleteElementAction, ReconnectAction, SelectAction, SelectAllAction, MoveAction as ProtocolMoveAction } from 'sprotty-protocol/lib/actions';
import { Animation, CompoundAnimation } from '../../base/animations/animation';

@@ -87,3 +87,3 @@ import { CommandExecutionContext, ICommand, MergeableCommand, CommandReturn } from '../../base/commands/command';

export class MoveCommand extends MergeableCommand {
static readonly KIND = MoveAction.KIND;
static readonly KIND = ProtocolMoveAction.KIND;

@@ -95,3 +95,3 @@ @inject(EdgeRouterRegistry) @optional() edgeRouterRegistry?: EdgeRouterRegistry;

constructor(@inject(TYPES.Action) protected readonly action: MoveAction) {
constructor(@inject(TYPES.Action) protected readonly action: ProtocolMoveAction) {
super();

@@ -481,3 +481,3 @@ }

protected getElementMoves(target: SModelElement, event: MouseEvent, isFinished: boolean): MoveAction | undefined {
protected getElementMoves(target: SModelElement, event: MouseEvent, isFinished: boolean): ProtocolMoveAction | undefined {
if (!this.startDragPosition)

@@ -502,3 +502,3 @@ return undefined;

if (elementMoves.length > 0)
return MoveAction.create(elementMoves, { animate: false, finished: isFinished });
return ProtocolMoveAction.create(elementMoves, { animate: false, finished: isFinished });
else

@@ -505,0 +505,0 @@ return undefined;

@@ -258,3 +258,3 @@ /********************************************************************************

const result: Action[] = [];
result.push(new SelectAction([selectableTarget.id], deselectedElements.map(e => e.id)));
result.push(ProtocolSelectAction.create({ selectedElementsIDs: [selectableTarget.id], deselectedElementsIDs: deselectedElements.map(e => e.id) }));
result.push(BringToFrontAction.create([selectableTarget.id]));

@@ -272,3 +272,3 @@ const routableDeselect = deselectedElements.filter(e => e instanceof SRoutableElement).map(e => e.id);

const result: Action[] = [];
result.push(new SelectAction([], [selectableTarget.id]));
result.push(ProtocolSelectAction.create({ selectedElementsIDs: [], deselectedElementsIDs: [selectableTarget.id] }));
if (selectableTarget instanceof SRoutableElement) {

@@ -282,3 +282,3 @@ result.push(SwitchEditModeAction.create({ elementsToDeactivate: [selectableTarget.id] }));

const result: Action[] = [];
result.push(new SelectAction([], deselectedElements.map(e => e.id)));
result.push(ProtocolSelectAction.create({ selectedElementsIDs: [], deselectedElementsIDs: deselectedElements.map(e => e.id) }));
const routableDeselect = deselectedElements.filter(e => e instanceof SRoutableElement).map(e => e.id);

@@ -302,3 +302,3 @@ if (routableDeselect.length > 0) {

if (this.wasSelected) {
return [new SelectAction([selectableTarget.id], [])];
return [ProtocolSelectAction.create({selectedElementsIDs:[selectableTarget.id],deselectedElementsIDs:[]})];
}

@@ -346,3 +346,3 @@ } else if (target instanceof SModelRoot && !findViewportScrollbar(event)) {

if (matchesKeystroke(event, 'KeyA', 'ctrlCmd')) {
return [new SelectAllAction()];
return [ ProtocolSelectAllActon.create()];
}

@@ -349,0 +349,0 @@ return [];

@@ -17,3 +17,3 @@ /********************************************************************************

import { Action } from 'sprotty-protocol/lib/actions';
import { Action, UndoAction as ProtocolUndoAction, RedoAction as ProtocolRedoAction } from 'sprotty-protocol/lib/actions';
import { matchesKeystroke } from '../../utils/keyboard';

@@ -59,7 +59,7 @@ import { KeyListener } from '../../base/views/key-tool';

if (matchesKeystroke(event, 'KeyZ', 'ctrlCmd'))
return [UndoAction.create()];
return [ProtocolUndoAction.create()];
if (matchesKeystroke(event, 'KeyZ', 'ctrlCmd', 'shift') || (!isMac() && matchesKeystroke(event, 'KeyY', 'ctrlCmd')))
return [RedoAction.create()];
return [ProtocolRedoAction.create()];
return [];
}
}

@@ -232,7 +232,7 @@ /********************************************************************************

if (matchesKeystroke(event, 'KeyC', 'ctrlCmd', 'shift'))
return [new CenterAction([])];
return [ProtocolCenterAction.create([])];
if (matchesKeystroke(event, 'KeyF', 'ctrlCmd', 'shift'))
return [new FitToScreenAction([])];
return [ProtocolFitToScreenAction.create([])];
return [];
}
}

@@ -17,3 +17,3 @@ /********************************************************************************

import { Scrollable, Zoomable } from 'sprotty-protocol/lib/model';
import { Scrollable, Zoomable, Viewport as ProtocolViewport } from 'sprotty-protocol/lib/model';
import { SModelElement, SModelRoot } from '../../base/model/smodel';

@@ -29,3 +29,3 @@

export function isViewport(element: SModelElement): element is SModelRoot & Viewport {
export function isViewport(element: SModelElement): element is SModelRoot & ProtocolViewport {
return element instanceof SModelRoot

@@ -32,0 +32,0 @@ && element.hasFeature(viewportFeature)

@@ -18,3 +18,3 @@ /********************************************************************************

import { injectable, inject } from 'inversify';
import { Action } from 'sprotty-protocol/lib/actions';
import { Action, BringToFrontAction as ProtocolBringToFrontAction} from 'sprotty-protocol/lib/actions';
import { TYPES } from '../../base/types';

@@ -52,7 +52,7 @@ import { SModelRoot, SChildElement, SModelElement, SParentElement } from '../../base/model/smodel';

export class BringToFrontCommand extends Command {
static readonly KIND = BringToFrontAction.KIND;
static readonly KIND = ProtocolBringToFrontAction.KIND;
protected selected: ZOrderElement[] = [];
constructor(@inject(TYPES.Action) public action: BringToFrontAction) {
constructor(@inject(TYPES.Action) public action: ProtocolBringToFrontAction) {
super();

@@ -59,0 +59,0 @@ }

@@ -19,3 +19,3 @@ /********************************************************************************

import { inject, injectable } from "inversify";
import { OpenAction } from 'sprotty-protocol';
import { OpenAction, ActionMessage as ProtocolActionMessage, isActionMessage as isProtocolActionMessage } from 'sprotty-protocol';
import {

@@ -111,3 +111,3 @@ Action, CollapseExpandAction, CollapseExpandAllAction, ComputedBoundsAction, RequestModelAction,

protected forwardToServer(action: Action): void {
const message: ActionMessage = {
const message: ProtocolActionMessage = {
clientId: this.clientId,

@@ -120,7 +120,7 @@ action: action

protected abstract sendMessage(message: ActionMessage): void;
protected abstract sendMessage(message: ProtocolActionMessage): void;
protected messageReceived(data: any): void {
const object = typeof(data) === 'string' ? JSON.parse(data) : data;
if (isActionMessage(object) && object.action) {
if (isProtocolActionMessage(object) && object.action) {
if (!object.clientId || object.clientId === this.clientId) {

@@ -127,0 +127,0 @@ (object.action as any)[receivedFromServerProperty] = true;

@@ -23,3 +23,4 @@ /********************************************************************************

} from 'sprotty-protocol/lib/actions';
import { SModelElement as SModelElementSchema, SModelRoot as SModelRootSchema, Viewport } from 'sprotty-protocol/lib/model';
import { SModelElement as SModelElementSchema, SModelRoot as SModelRootSchema, Viewport} from 'sprotty-protocol/lib/model';
import { IModelLayoutEngine as ProtocolIModelLayoutEngine } from 'sprotty-protocol';
import { Bounds } from 'sprotty-protocol/lib/utils/geometry';

@@ -49,3 +50,3 @@ import { SModelIndex, findElement } from 'sprotty-protocol/lib/utils/model-utils';

@inject(TYPES.IPopupModelProvider)@optional() protected popupModelProvider?: IPopupModelProvider;
@inject(TYPES.IModelLayoutEngine)@optional() protected layoutEngine?: IModelLayoutEngine;
@inject(TYPES.IModelLayoutEngine)@optional() protected layoutEngine?: ProtocolIModelLayoutEngine;

@@ -52,0 +53,0 @@ protected currentRoot: SModelRootSchema = EMPTY_ROOT;

@@ -18,3 +18,3 @@ /********************************************************************************

import { injectable, inject } from 'inversify';
import { Action } from 'sprotty-protocol/lib/actions';
import { Action, LoggingAction as ProtocolLoggingAction } from 'sprotty-protocol/lib/actions';
import { ILogger, LogLevel } from '../utils/logging';

@@ -82,3 +82,3 @@ import { TYPES } from '../base/types';

const date = new Date();
const action = LoggingAction.create({
const action = ProtocolLoggingAction.create({
message,

@@ -85,0 +85,0 @@ severity: LogLevel[logLevel],

@@ -17,2 +17,3 @@ /********************************************************************************

import { Bounds as ProtocolBounds, Point as ProtocolPoint, toDegrees as protocolToDegrees } from "sprotty-protocol";
/**

@@ -398,5 +399,5 @@ * A Point is composed of the (x,y) coordinates of an object.

constructor(protected bounds: Bounds) { }
constructor(protected bounds: ProtocolBounds) { }
get topPoint(): Point {
get topPoint(): ProtocolPoint {
return {

@@ -408,3 +409,3 @@ x: this.bounds.x + this.bounds.width / 2,

get rightPoint(): Point {
get rightPoint(): ProtocolPoint {
return {

@@ -416,3 +417,3 @@ x: this.bounds.x + this.bounds.width,

get bottomPoint(): Point {
get bottomPoint(): ProtocolPoint {
return {

@@ -424,3 +425,3 @@ x: this.bounds.x + this.bounds.width / 2,

get leftPoint(): Point {
get leftPoint(): ProtocolPoint {
return {

@@ -453,4 +454,4 @@ x: this.bounds.x,

*/
closestSideLine(refPoint: Point): Line {
const c = center(this.bounds);
closestSideLine(refPoint: ProtocolPoint): Line {
const c = ProtocolBounds.center(this.bounds);
if (refPoint.x > c.x) {

@@ -490,3 +491,3 @@ if (refPoint.y > c.y) {

constructor(public p1: Point, public p2: Point) { }
constructor(public p1: ProtocolPoint, public p2: ProtocolPoint) { }

@@ -535,3 +536,3 @@ get a(): number {

get direction(): CardinalDirection {
const hDegrees = toDegrees(this.angle);
const hDegrees = protocolToDegrees(this.angle);
const degrees = hDegrees < 0 ? 360 + hDegrees : hDegrees;

@@ -563,3 +564,3 @@ // degrees are relative to the x-axis

*/
intersection(otherLine: PointToPointLine): Point | undefined {
intersection(otherLine: PointToPointLine): ProtocolPoint | undefined {
if (this.hasIndistinctPoints(otherLine)) {

@@ -605,6 +606,6 @@ return undefined;

hasIndistinctPoints(otherLine: PointToPointLine): boolean {
return pointEquals(this.p1, otherLine.p1) ||
pointEquals(this.p1, otherLine.p2) ||
pointEquals(this.p2, otherLine.p1) ||
pointEquals(this.p2, otherLine.p2);
return ProtocolPoint.equals(this.p1, otherLine.p1) ||
ProtocolPoint.equals(this.p1, otherLine.p2) ||
ProtocolPoint.equals(this.p2, otherLine.p1) ||
ProtocolPoint.equals(this.p2, otherLine.p2);
}

@@ -619,3 +620,3 @@ }

*/
export function intersection(l1: Line, l2: Line): Point {
export function intersection(l1: Line, l2: Line): ProtocolPoint {
return {

@@ -622,0 +623,0 @@ x: (l1.c * l2.b - l2.c * l1.b) / (l1.a * l2.b - l2.a * l1.b),

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc