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.15.0-next.7444211.0 to 0.15.0-next.044bba2.13

7

lib/base/actions/action-dispatcher.js

@@ -34,2 +34,5 @@ "use strict";

const animation_frame_syncer_1 = require("../animations/animation-frame-syncer");
// This code should be used only in the client part of a Sprotty application.
// We set the request context to 'client' to avoid collisions with requests created by the server.
(0, actions_1.setRequestContext)('client');
/**

@@ -161,2 +164,3 @@ * Collects actions, converts them to commands and dispatches them.

};
exports.ActionDispatcher = ActionDispatcher;
__decorate([

@@ -182,6 +186,5 @@ (0, inversify_1.inject)(types_1.TYPES.ActionHandlerRegistryProvider),

], ActionDispatcher.prototype, "diagramLocker", void 0);
ActionDispatcher = __decorate([
exports.ActionDispatcher = ActionDispatcher = __decorate([
(0, inversify_1.injectable)()
], ActionDispatcher);
exports.ActionDispatcher = ActionDispatcher;
//# sourceMappingURL=action-dispatcher.js.map

@@ -48,3 +48,4 @@ "use strict";

};
ActionHandlerRegistry = __decorate([
exports.ActionHandlerRegistry = ActionHandlerRegistry;
exports.ActionHandlerRegistry = ActionHandlerRegistry = __decorate([
(0, inversify_1.injectable)(),

@@ -57,3 +58,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.ActionHandlerRegistration)),

], ActionHandlerRegistry);
exports.ActionHandlerRegistry = ActionHandlerRegistry;
/**

@@ -60,0 +60,0 @@ * Utility function to register an action handler for an action kind.

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

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

@@ -26,67 +25,7 @@ * A list of actions with a label.

readonly label: string;
readonly actions: ProtocolAction[];
readonly actions: Action[];
readonly icon?: string | undefined;
constructor(label: string, actions: ProtocolAction[], icon?: string | undefined);
constructor(label: string, actions: Action[], icon?: string | undefined);
}
export declare function isLabeledAction(element: unknown): element is LabeledAction;
/**
* An action describes a change to the model declaratively.
* It is a plain data structure, and as such transferable between server and client. An action must never contain actual
* SModelElement instances, but either refer to them via their ids or contain serializable schema for model elements.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Action {
readonly kind: string;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function isAction(object?: unknown): object is Action;
/**
* A request action is tied to the expectation of receiving a corresponding response action.
* The `requestId` property is used to match the received response with the original request.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface RequestAction<Res extends ResponseAction> extends Action {
readonly requestId: string;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function isRequestAction(object?: unknown): object is RequestAction<ResponseAction>;
/**
* Generate a unique `requestId` for a request action.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare const generateRequestId: () => string;
/**
* A response action is sent to respond to a request action. The `responseId` must match
* the `requestId` of the preceding request. In case the `responseId` is empty or undefined,
* the action is handled as standalone, i.e. it was fired without a preceding request.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ResponseAction extends Action {
readonly responseId: string;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function isResponseAction(object?: unknown): object is ResponseAction;
/**
* A reject action is fired to indicate that a request must be rejected.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class RejectAction implements ResponseAction {
readonly message: string;
readonly responseId: string;
readonly detail?: JsonAny | undefined;
static readonly KIND = "rejectRequest";
readonly kind = "rejectRequest";
constructor(message: string, responseId: string, detail?: JsonAny | undefined);
}
//# sourceMappingURL=action.d.ts.map

@@ -18,5 +18,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.RejectAction = exports.isResponseAction = exports.generateRequestId = exports.isRequestAction = exports.isAction = exports.isLabeledAction = exports.LabeledAction = void 0;
const actions_1 = require("sprotty-protocol/lib/actions");
const object_1 = require("sprotty-protocol/lib/utils/object");
exports.isLabeledAction = exports.LabeledAction = void 0;
/**

@@ -41,45 +39,2 @@ * A list of actions with a label.

exports.isLabeledAction = isLabeledAction;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function isAction(object) {
return (0, object_1.hasOwnProperty)(object, 'kind', 'string');
}
exports.isAction = isAction;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function isRequestAction(object) {
return isAction(object) && (0, object_1.hasOwnProperty)(object, 'requestId', 'string');
}
exports.isRequestAction = isRequestAction;
/**
* Generate a unique `requestId` for a request action.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
exports.generateRequestId = actions_1.generateRequestId;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function isResponseAction(object) {
return isAction(object) && (0, object_1.hasOwnProperty)(object, 'responseId', 'string')
&& object.responseId !== '';
}
exports.isResponseAction = isResponseAction;
/**
* A reject action is fired to indicate that a request must be rejected.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class RejectAction {
constructor(message, responseId, detail) {
this.message = message;
this.responseId = responseId;
this.detail = detail;
this.kind = RejectAction.KIND;
}
}
RejectAction.KIND = 'rejectRequest';
exports.RejectAction = RejectAction;
//# sourceMappingURL=action.js.map

@@ -31,6 +31,6 @@ "use strict";

};
DefaultDiagramLocker = __decorate([
exports.DefaultDiagramLocker = DefaultDiagramLocker;
exports.DefaultDiagramLocker = DefaultDiagramLocker = __decorate([
(0, inversify_1.injectable)()
], DefaultDiagramLocker);
exports.DefaultDiagramLocker = DefaultDiagramLocker;
//# sourceMappingURL=diagram-locker.js.map

@@ -62,6 +62,6 @@ "use strict";

};
AnimationFrameSyncer = __decorate([
exports.AnimationFrameSyncer = AnimationFrameSyncer;
exports.AnimationFrameSyncer = AnimationFrameSyncer = __decorate([
(0, inversify_1.injectable)()
], AnimationFrameSyncer);
exports.AnimationFrameSyncer = AnimationFrameSyncer;
//# sourceMappingURL=animation-frame-syncer.js.map

@@ -51,3 +51,4 @@ "use strict";

};
CommandActionHandlerInitializer = __decorate([
exports.CommandActionHandlerInitializer = CommandActionHandlerInitializer;
exports.CommandActionHandlerInitializer = CommandActionHandlerInitializer = __decorate([
(0, inversify_1.injectable)(),

@@ -58,3 +59,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.CommandRegistration)),

], CommandActionHandlerInitializer);
exports.CommandActionHandlerInitializer = CommandActionHandlerInitializer;
/**

@@ -61,0 +61,0 @@ * Use this method in your DI configuration to register a new command to the diagram.

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

};
exports.CommandStack = CommandStack;
__decorate([

@@ -378,6 +379,5 @@ (0, inversify_1.inject)(types_1.TYPES.IModelFactory),

], CommandStack.prototype, "initialize", null);
CommandStack = __decorate([
exports.CommandStack = CommandStack = __decorate([
(0, inversify_1.injectable)()
], CommandStack);
exports.CommandStack = CommandStack;
function copyState(state) {

@@ -384,0 +384,0 @@ return {

@@ -153,3 +153,3 @@ /********************************************************************************

root: SModelRootImpl;
/** Used to turn sprotty schema elements (e.g. from the action) into model elements */
/** Used to turn sprotty external model elements (e.g. from the action) into internal model elements */
modelFactory: IModelFactory;

@@ -156,0 +156,0 @@ /** Allows to give some feedback to the console */

@@ -45,6 +45,6 @@ "use strict";

};
Command = __decorate([
exports.Command = Command;
exports.Command = Command = __decorate([
(0, inversify_1.injectable)()
], Command);
exports.Command = Command;
/**

@@ -69,6 +69,6 @@ * A mergeable command can accumulate subsequent commands of the same kind.

};
MergeableCommand = __decorate([
exports.MergeableCommand = MergeableCommand;
exports.MergeableCommand = MergeableCommand = __decorate([
(0, inversify_1.injectable)()
], MergeableCommand);
exports.MergeableCommand = MergeableCommand;
/**

@@ -98,12 +98,12 @@ * A hidden command is used to trigger the rendering of a model on a

};
HiddenCommand = __decorate([
exports.HiddenCommand = HiddenCommand;
exports.HiddenCommand = HiddenCommand = __decorate([
(0, inversify_1.injectable)()
], HiddenCommand);
exports.HiddenCommand = HiddenCommand;
let PopupCommand = class PopupCommand extends Command {
};
PopupCommand = __decorate([
exports.PopupCommand = PopupCommand;
exports.PopupCommand = PopupCommand = __decorate([
(0, inversify_1.injectable)()
], PopupCommand);
exports.PopupCommand = PopupCommand;
/**

@@ -121,6 +121,6 @@ * A system command is triggered by the system, e.g. in order to update bounds

};
SystemCommand = __decorate([
exports.SystemCommand = SystemCommand;
exports.SystemCommand = SystemCommand = __decorate([
(0, inversify_1.injectable)()
], SystemCommand);
exports.SystemCommand = SystemCommand;
/**

@@ -133,6 +133,6 @@ * A reset command deletes all undo/redo stacks and cannot be undone.

};
ResetCommand = __decorate([
exports.ResetCommand = ResetCommand;
exports.ResetCommand = ResetCommand = __decorate([
(0, inversify_1.injectable)()
], ResetCommand);
exports.ResetCommand = ResetCommand;
//# sourceMappingURL=command.js.map

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

};
exports.ModelRequestCommand = ModelRequestCommand;
__decorate([

@@ -53,6 +54,5 @@ (0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),

], ModelRequestCommand.prototype, "actionDispatcher", void 0);
ModelRequestCommand = __decorate([
exports.ModelRequestCommand = ModelRequestCommand = __decorate([
(0, inversify_1.injectable)()
], ModelRequestCommand);
exports.ModelRequestCommand = ModelRequestCommand;
//# sourceMappingURL=request-command.js.map

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

};
exports.CanvasBoundsInitializer = CanvasBoundsInitializer;
__decorate([

@@ -80,6 +81,5 @@ (0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),

], CanvasBoundsInitializer.prototype, "actionDispatcher", void 0);
CanvasBoundsInitializer = __decorate([
exports.CanvasBoundsInitializer = CanvasBoundsInitializer = __decorate([
(0, inversify_1.injectable)()
], CanvasBoundsInitializer);
exports.CanvasBoundsInitializer = CanvasBoundsInitializer;
var InitializeCanvasBoundsAction;

@@ -95,3 +95,3 @@ (function (InitializeCanvasBoundsAction) {

InitializeCanvasBoundsAction.create = create;
})(InitializeCanvasBoundsAction = exports.InitializeCanvasBoundsAction || (exports.InitializeCanvasBoundsAction = {}));
})(InitializeCanvasBoundsAction || (exports.InitializeCanvasBoundsAction = InitializeCanvasBoundsAction = {}));
let InitializeCanvasBoundsCommand = class InitializeCanvasBoundsCommand extends command_1.SystemCommand {

@@ -114,4 +114,5 @@ constructor(action) {

};
exports.InitializeCanvasBoundsCommand = InitializeCanvasBoundsCommand;
InitializeCanvasBoundsCommand.KIND = InitializeCanvasBoundsAction.KIND;
InitializeCanvasBoundsCommand = __decorate([
exports.InitializeCanvasBoundsCommand = InitializeCanvasBoundsCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -121,3 +122,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], InitializeCanvasBoundsCommand);
exports.InitializeCanvasBoundsCommand = InitializeCanvasBoundsCommand;
//# sourceMappingURL=initialize-canvas.js.map

@@ -16,13 +16,11 @@ /********************************************************************************

********************************************************************************/
import { Action, RequestAction, ResponseAction, RequestModelAction as ProtocolRequestModelAction, SetModelAction as ProtocolSetModelAction } from "sprotty-protocol/lib/actions";
import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { JsonPrimitive } from "sprotty-protocol/lib/utils/json";
import { Action, SetModelAction } from "sprotty-protocol/lib/actions";
import { CommandExecutionContext, ResetCommand } from "../commands/command";
import { SModelRootImpl } from "../model/smodel";
export declare class SetModelCommand extends ResetCommand {
protected readonly action: ProtocolSetModelAction;
protected readonly action: SetModelAction;
static readonly KIND = "setModel";
oldRoot: SModelRootImpl;
newRoot: SModelRootImpl;
constructor(action: ProtocolSetModelAction);
constructor(action: SetModelAction);
execute(context: CommandExecutionContext): SModelRootImpl;

@@ -33,36 +31,2 @@ undo(context: CommandExecutionContext): SModelRootImpl;

}
/**
* Sent from the client to the model source (e.g. a DiagramServer) in order to request a model. Usually this
* is the first message that is sent to the source, so it is also used to initiate the communication.
* The response is a SetModelAction or an UpdateModelAction.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class RequestModelAction implements ProtocolRequestModelAction {
readonly options?: {
[key: string]: JsonPrimitive;
} | undefined;
readonly requestId: string;
static readonly KIND = "requestModel";
readonly kind = "requestModel";
constructor(options?: {
[key: string]: JsonPrimitive;
} | undefined, requestId?: string);
/** Factory function to dispatch a request with the `IActionDispatcher` */
static create(options?: {
[key: string]: JsonPrimitive;
}): RequestAction<SetModelAction>;
}
/**
* Sent from the model source to the client in order to set the model. If a model is already present, it is replaced.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class SetModelAction implements ResponseAction, ProtocolSetModelAction {
readonly newRoot: SModelRootSchema;
readonly responseId: string;
static readonly KIND = "setModel";
readonly kind = "setModel";
constructor(newRoot: SModelRootSchema, responseId?: string);
}
//# sourceMappingURL=set-model.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.SetModelAction = exports.RequestModelAction = exports.SetModelCommand = void 0;
exports.SetModelCommand = void 0;
const inversify_1 = require("inversify");

@@ -57,4 +57,5 @@ const actions_1 = require("sprotty-protocol/lib/actions");

};
exports.SetModelCommand = SetModelCommand;
SetModelCommand.KIND = actions_1.SetModelAction.KIND;
SetModelCommand = __decorate([
exports.SetModelCommand = SetModelCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -64,38 +65,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], SetModelCommand);
exports.SetModelCommand = SetModelCommand;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Sent from the client to the model source (e.g. a DiagramServer) in order to request a model. Usually this
* is the first message that is sent to the source, so it is also used to initiate the communication.
* The response is a SetModelAction or an UpdateModelAction.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class RequestModelAction {
constructor(options, requestId = '') {
this.options = options;
this.requestId = requestId;
this.kind = RequestModelAction.KIND;
}
/** Factory function to dispatch a request with the `IActionDispatcher` */
static create(options) {
return new RequestModelAction(options, (0, actions_1.generateRequestId)());
}
}
RequestModelAction.KIND = 'requestModel';
exports.RequestModelAction = RequestModelAction;
/**
* Sent from the model source to the client in order to set the model. If a model is already present, it is replaced.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class SetModelAction {
constructor(newRoot, responseId = '') {
this.newRoot = newRoot;
this.responseId = responseId;
this.kind = SetModelAction.KIND;
}
}
SetModelAction.KIND = 'setModel';
exports.SetModelAction = SetModelAction;
//# sourceMappingURL=set-model.js.map

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

********************************************************************************/
import { SModelElement as SModelElementSchema, SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { SModelElement, SModelRoot } from 'sprotty-protocol/lib/model';
import { FactoryRegistry } from '../../utils/registry';

@@ -32,5 +32,5 @@ import { SChildElementImpl, SModelElementImpl, SModelRootImpl, SParentElementImpl, FeatureSet } from './smodel';

export interface IModelFactory {
createElement(schema: SModelElementSchema | SModelElementImpl, parent?: SParentElementImpl): SChildElementImpl;
createRoot(schema: SModelRootSchema | SModelRootImpl): SModelRootImpl;
createSchema(element: SModelElementImpl): SModelElementSchema;
createElement(schema: SModelElement | SModelElementImpl, parent?: SParentElementImpl): SChildElementImpl;
createRoot(schema: SModelRoot | SModelRootImpl): SModelRootImpl;
createSchema(element: SModelElementImpl): SModelElement;
}

@@ -43,12 +43,12 @@ /**

protected readonly registry: SModelRegistry;
createElement(schema: SModelElementSchema | SModelElementImpl, parent?: SParentElementImpl): SChildElementImpl;
createRoot(schema: SModelRootSchema | SModelRootImpl): SModelRootImpl;
createSchema(element: SModelElementImpl): SModelElementSchema;
protected initializeElement(element: SModelElementImpl, schema: SModelElementSchema | SModelElementImpl): SModelElementImpl;
createElement(schema: SModelElement | SModelElementImpl, parent?: SParentElementImpl): SChildElementImpl;
createRoot(schema: SModelRoot | SModelRootImpl): SModelRootImpl;
createSchema(element: SModelElementImpl): SModelElement;
protected initializeElement(element: SModelElementImpl, schema: SModelElement | SModelElementImpl): SModelElementImpl;
protected isReserved(element: SModelElementImpl, propertyName: string): boolean;
protected initializeParent(parent: SParentElementImpl, schema: SModelElementSchema | SParentElementImpl): SParentElementImpl;
protected initializeChild(child: SChildElementImpl, schema: SModelElementSchema, parent?: SParentElementImpl): SChildElementImpl;
protected initializeRoot(root: SModelRootImpl, schema: SModelRootSchema | SModelRootImpl): SModelRootImpl;
protected initializeParent(parent: SParentElementImpl, schema: SModelElement | SParentElementImpl): SParentElementImpl;
protected initializeChild(child: SChildElementImpl, schema: SModelElement, parent?: SParentElementImpl): SChildElementImpl;
protected initializeRoot(root: SModelRootImpl, schema: SModelRoot | SModelRootImpl): SModelRootImpl;
}
export declare const EMPTY_ROOT: Readonly<SModelRootSchema>;
export declare const EMPTY_ROOT: Readonly<SModelRoot>;
/**

@@ -55,0 +55,0 @@ * Used to bind a model element type to a class constructor in the SModelRegistry.

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

};
SModelRegistry = __decorate([
exports.SModelRegistry = SModelRegistry;
exports.SModelRegistry = SModelRegistry = __decorate([
(0, inversify_1.injectable)(),

@@ -76,3 +77,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.SModelElementRegistration)),

], SModelRegistry);
exports.SModelRegistry = SModelRegistry;
/**

@@ -164,2 +164,3 @@ * The default model factory creates SModelRoot for the root element and SChildElement for all other

};
exports.SModelFactory = SModelFactory;
__decorate([

@@ -169,6 +170,5 @@ (0, inversify_1.inject)(types_1.TYPES.SModelRegistry),

], SModelFactory.prototype, "registry", void 0);
SModelFactory = __decorate([
exports.SModelFactory = SModelFactory = __decorate([
(0, inversify_1.injectable)()
], SModelFactory);
exports.SModelFactory = SModelFactory;
exports.EMPTY_ROOT = Object.freeze({

@@ -175,0 +175,0 @@ type: 'NONE',

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

import { interfaces } from "inversify";
import { SModelElement as SModelElementSchema } from 'sprotty-protocol/lib/model';
import { Bounds, Point } from "sprotty-protocol/lib/utils/geometry";

@@ -55,23 +54,2 @@ import { SChildElementImpl, SModelElementImpl, SModelRootImpl, SParentElementImpl } from "./smodel";

export declare function transformToRootBounds(parent: SParentElementImpl, bounds: Bounds): Bounds;
/**
* Model element types can include a colon to separate the basic type and a sub-type. This function
* extracts the basic type of a model element.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function getBasicType(schema: SModelElementSchema | SModelElementImpl): string;
/**
* Model element types can include a colon to separate the basic type and a sub-type. This function
* extracts the sub-type of a model element.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function getSubType(schema: SModelElementSchema | SModelElementImpl): string;
/**
* Find the element with the given identifier. If you need to find multiple elements, using an
* SModelIndex might be more effective.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function findElement(parent: SModelElementSchema, elementId: string): SModelElementSchema | undefined;
//# sourceMappingURL=smodel-utils.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.findElement = exports.getSubType = exports.getBasicType = exports.transformToRootBounds = exports.containsSome = exports.translateBounds = exports.translatePoint = exports.findParentByFeature = exports.findParent = exports.registerModelElement = void 0;
exports.transformToRootBounds = exports.containsSome = exports.translateBounds = exports.translatePoint = exports.findParentByFeature = exports.findParent = exports.registerModelElement = void 0;
const types_1 = require("../types");

@@ -126,54 +126,2 @@ const smodel_1 = require("./smodel");

exports.transformToRootBounds = transformToRootBounds;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Model element types can include a colon to separate the basic type and a sub-type. This function
* extracts the basic type of a model element.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function getBasicType(schema) {
if (!schema.type)
return '';
const colonIndex = schema.type.indexOf(':');
if (colonIndex >= 0)
return schema.type.substring(0, colonIndex);
else
return schema.type;
}
exports.getBasicType = getBasicType;
/**
* Model element types can include a colon to separate the basic type and a sub-type. This function
* extracts the sub-type of a model element.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function getSubType(schema) {
if (!schema.type)
return '';
const colonIndex = schema.type.indexOf(':');
if (colonIndex >= 0)
return schema.type.substring(colonIndex + 1);
else
return schema.type;
}
exports.getSubType = getSubType;
/**
* Find the element with the given identifier. If you need to find multiple elements, using an
* SModelIndex might be more effective.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function findElement(parent, elementId) {
if (parent.id === elementId)
return parent;
if (parent.children !== undefined) {
for (const child of parent.children) {
const result = findElement(child, elementId);
if (result !== undefined)
return result;
}
}
return undefined;
}
exports.findElement = findElement;
//# sourceMappingURL=smodel-utils.js.map

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

********************************************************************************/
import { SModelElement as ProtocolSModelElement } from 'sprotty-protocol';
import { SModelElement } from 'sprotty-protocol/lib/model';
import { Bounds, Point } from 'sprotty-protocol/lib/utils/geometry';

@@ -40,4 +40,4 @@ import { FluentIterable } from '../../utils/iterable';

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

@@ -92,6 +92,6 @@ /**

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

@@ -110,32 +110,2 @@ /**

}
/**
* The schema of an SModelElement describes its serializable form. The actual model is created from
* its schema with an IModelFactory.
* Each model element must have a unique ID and a type that is used to look up its view.
*
* @deprecated Use `SModelElement` from `sprotty-protocol` instead.
*/
export interface SModelElementSchema {
type: string;
id: string;
children?: SModelElementSchema[];
cssClasses?: string[];
}
/**
* Serializable schema for the root element of the model tree.
*
* @deprecated Use `SModelRoot` from `sprotty-protocol` instead.
*/
export interface SModelRootSchema extends SModelElementSchema {
canvasBounds?: Bounds;
revision?: number;
}
/** @deprecated Use `SParentElementImpl` instead. */
export declare const SParentElement: typeof SParentElementImpl;
/** @deprecated Use `SChildElementImpl` instead. */
export declare const SChildElement: typeof SChildElementImpl;
/** @deprecated Use `SModelElementImpl` instead. */
export declare const SModelElement: typeof SModelElementImpl;
/** @deprecated Use `SModelRootImpl` instead. */
export declare const SModelRoot: typeof SModelRootImpl;
//# sourceMappingURL=smodel.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.SModelRoot = exports.SModelElement = exports.SChildElement = exports.SParentElement = exports.ModelIndexImpl = exports.createRandomId = exports.SModelRootImpl = exports.SChildElementImpl = exports.SParentElementImpl = exports.isParent = exports.SModelElementImpl = void 0;
exports.ModelIndexImpl = exports.createRandomId = exports.SModelRootImpl = exports.SChildElementImpl = exports.SParentElementImpl = exports.isParent = exports.SModelElementImpl = void 0;
const geometry_1 = require("sprotty-protocol/lib/utils/geometry");

@@ -218,10 +218,2 @@ const iterable_1 = require("../../utils/iterable");

exports.ModelIndexImpl = ModelIndexImpl;
/** @deprecated Use `SParentElementImpl` instead. */
exports.SParentElement = SParentElementImpl;
/** @deprecated Use `SChildElementImpl` instead. */
exports.SChildElement = SChildElementImpl;
/** @deprecated Use `SModelElementImpl` instead. */
exports.SModelElement = SModelElementImpl;
/** @deprecated Use `SModelRootImpl` instead. */
exports.SModelRoot = SModelRootImpl;
//# sourceMappingURL=smodel.js.map

@@ -75,7 +75,3 @@ /********************************************************************************

IViewerProvider: symbol;
/** @deprecated deprecated since 0.12.0 - please use `configureButtonHandler` */
IButtonHandler: symbol;
/** @deprecated `deprecated since 0.14.0 - the Tool/Toolmanager API is no longer supported */
IToolManager: symbol;
};
//# sourceMappingURL=types.d.ts.map

@@ -79,8 +79,4 @@ "use strict";

IViewerProvider: Symbol('IViewerProvider'),
/** @deprecated deprecated since 0.12.0 - please use `configureButtonHandler` */
IButtonHandler: Symbol('IButtonHandler'),
/** @deprecated `deprecated since 0.14.0 - the Tool/Toolmanager API is no longer supported */
IToolManager: Symbol('IToolManager')
};
/* eslint-enable */
//# sourceMappingURL=types.js.map

@@ -44,3 +44,4 @@ "use strict";

};
UIExtensionRegistry = __decorate([
exports.UIExtensionRegistry = UIExtensionRegistry;
exports.UIExtensionRegistry = UIExtensionRegistry = __decorate([
(0, inversify_1.injectable)(),

@@ -51,3 +52,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.IUIExtension)),

], UIExtensionRegistry);
exports.UIExtensionRegistry = UIExtensionRegistry;
var SetUIExtensionVisibilityAction;

@@ -66,3 +66,3 @@ (function (SetUIExtensionVisibilityAction) {

SetUIExtensionVisibilityAction.create = create;
})(SetUIExtensionVisibilityAction = exports.SetUIExtensionVisibilityAction || (exports.SetUIExtensionVisibilityAction = {}));
})(SetUIExtensionVisibilityAction || (exports.SetUIExtensionVisibilityAction = SetUIExtensionVisibilityAction = {}));
let SetUIExtensionVisibilityCommand = class SetUIExtensionVisibilityCommand extends command_1.SystemCommand {

@@ -87,2 +87,3 @@ constructor(action) {

};
exports.SetUIExtensionVisibilityCommand = SetUIExtensionVisibilityCommand;
SetUIExtensionVisibilityCommand.KIND = SetUIExtensionVisibilityAction.KIND;

@@ -93,3 +94,3 @@ __decorate([

], SetUIExtensionVisibilityCommand.prototype, "registry", void 0);
SetUIExtensionVisibilityCommand = __decorate([
exports.SetUIExtensionVisibilityCommand = SetUIExtensionVisibilityCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -99,3 +100,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], SetUIExtensionVisibilityCommand);
exports.SetUIExtensionVisibilityCommand = SetUIExtensionVisibilityCommand;
//# sourceMappingURL=ui-extension-registry.js.map

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

};
exports.AbstractUIExtension = AbstractUIExtension;
__decorate([

@@ -115,6 +116,5 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], AbstractUIExtension.prototype, "logger", void 0);
AbstractUIExtension = __decorate([
exports.AbstractUIExtension = AbstractUIExtension = __decorate([
(0, inversify_1.injectable)()
], AbstractUIExtension);
exports.AbstractUIExtension = AbstractUIExtension;
//# sourceMappingURL=ui-extension.js.map

@@ -45,6 +45,6 @@ "use strict";

};
CssClassPostprocessor = __decorate([
exports.CssClassPostprocessor = CssClassPostprocessor;
exports.CssClassPostprocessor = CssClassPostprocessor = __decorate([
(0, inversify_1.injectable)()
], CssClassPostprocessor);
exports.CssClassPostprocessor = CssClassPostprocessor;
//# sourceMappingURL=css-class-postprocessor.js.map

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

};
exports.DOMHelper = DOMHelper;
__decorate([

@@ -48,6 +49,5 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], DOMHelper.prototype, "viewerOptions", void 0);
DOMHelper = __decorate([
exports.DOMHelper = DOMHelper = __decorate([
(0, inversify_1.injectable)()
], DOMHelper);
exports.DOMHelper = DOMHelper;
//# sourceMappingURL=dom-helper.js.map

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

};
exports.IdPostprocessor = IdPostprocessor;
__decorate([

@@ -54,6 +55,5 @@ (0, inversify_1.inject)(types_1.TYPES.ILogger),

], IdPostprocessor.prototype, "domHelper", void 0);
IdPostprocessor = __decorate([
exports.IdPostprocessor = IdPostprocessor = __decorate([
(0, inversify_1.injectable)()
], IdPostprocessor);
exports.IdPostprocessor = IdPostprocessor;
//# sourceMappingURL=id-postprocessor.js.map

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

};
exports.KeyTool = KeyTool;
__decorate([

@@ -79,3 +80,3 @@ (0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),

], KeyTool.prototype, "actionDispatcher", void 0);
KeyTool = __decorate([
exports.KeyTool = KeyTool = __decorate([
(0, inversify_1.injectable)(),

@@ -86,3 +87,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.KeyListener)),

], KeyTool);
exports.KeyTool = KeyTool;
let KeyListener = class KeyListener {

@@ -96,6 +96,6 @@ keyDown(element, event) {

};
KeyListener = __decorate([
exports.KeyListener = KeyListener;
exports.KeyListener = KeyListener = __decorate([
(0, inversify_1.injectable)()
], KeyListener);
exports.KeyListener = KeyListener;
//# sourceMappingURL=key-tool.js.map

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

};
exports.MouseTool = MouseTool;
__decorate([

@@ -152,3 +153,3 @@ (0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),

], MouseTool.prototype, "domHelper", void 0);
MouseTool = __decorate([
exports.MouseTool = MouseTool = __decorate([
(0, inversify_1.injectable)(),

@@ -159,3 +160,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.MouseListener)),

], MouseTool);
exports.MouseTool = MouseTool;
let PopupMouseTool = class PopupMouseTool extends MouseTool {

@@ -167,3 +167,4 @@ constructor(mouseListeners = []) {

};
PopupMouseTool = __decorate([
exports.PopupMouseTool = PopupMouseTool;
exports.PopupMouseTool = PopupMouseTool = __decorate([
(0, inversify_1.injectable)(),

@@ -174,3 +175,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.PopupMouseListener)),

], PopupMouseTool);
exports.PopupMouseTool = PopupMouseTool;
let MouseListener = class MouseListener {

@@ -217,6 +217,6 @@ mouseOver(target, event) {

};
MouseListener = __decorate([
exports.MouseListener = MouseListener;
exports.MouseListener = MouseListener = __decorate([
(0, inversify_1.injectable)()
], MouseListener);
exports.MouseListener = MouseListener;
let MousePositionTracker = class MousePositionTracker extends MouseListener {

@@ -235,6 +235,6 @@ mouseMove(target, event) {

};
MousePositionTracker = __decorate([
exports.MousePositionTracker = MousePositionTracker;
exports.MousePositionTracker = MousePositionTracker = __decorate([
(0, inversify_1.injectable)()
], MousePositionTracker);
exports.MousePositionTracker = MousePositionTracker;
//# sourceMappingURL=mouse-tool.js.map

@@ -93,6 +93,6 @@ "use strict";

};
ThunkView = __decorate([
exports.ThunkView = ThunkView;
exports.ThunkView = ThunkView = __decorate([
(0, inversify_1.injectable)()
], ThunkView);
exports.ThunkView = ThunkView;
function isThunk(vnode) {

@@ -99,0 +99,0 @@ return 'thunk' in vnode;

@@ -71,3 +71,4 @@ "use strict";

};
ViewRegistry = __decorate([
exports.ViewRegistry = ViewRegistry;
exports.ViewRegistry = ViewRegistry = __decorate([
(0, inversify_1.injectable)(),

@@ -78,3 +79,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.ViewRegistration)),

], ViewRegistry);
exports.ViewRegistry = ViewRegistry;
/**

@@ -114,6 +114,6 @@ * Combines `registerModelElement` and `configureView`.

};
EmptyView = __decorate([
exports.EmptyView = EmptyView;
exports.EmptyView = EmptyView = __decorate([
(0, inversify_1.injectable)()
], EmptyView);
exports.EmptyView = EmptyView;
/**

@@ -131,6 +131,6 @@ * This view is used when no view has been registered for a model element type.

};
MissingView = __decorate([
exports.MissingView = MissingView;
exports.MissingView = MissingView = __decorate([
(0, inversify_1.injectable)()
], MissingView);
exports.MissingView = MissingView;
//# sourceMappingURL=view.js.map

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

};
exports.ViewerCache = ViewerCache;
__decorate([

@@ -70,6 +71,5 @@ (0, inversify_1.inject)(types_1.TYPES.IViewer),

], ViewerCache.prototype, "syncer", void 0);
ViewerCache = __decorate([
exports.ViewerCache = ViewerCache = __decorate([
(0, inversify_1.injectable)()
], ViewerCache);
exports.ViewerCache = ViewerCache;
//# sourceMappingURL=viewer-cache.js.map

@@ -90,7 +90,7 @@ "use strict";

};
PatcherProvider = __decorate([
exports.PatcherProvider = PatcherProvider;
exports.PatcherProvider = PatcherProvider = __decorate([
(0, inversify_1.injectable)(),
__metadata("design:paramtypes", [])
], PatcherProvider);
exports.PatcherProvider = PatcherProvider;
/**

@@ -170,2 +170,3 @@ * The component that turns the model into an SVG DOM.

};
exports.ModelViewer = ModelViewer;
__decorate([

@@ -183,3 +184,3 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], ModelViewer.prototype, "actiondispatcher", void 0);
ModelViewer = __decorate([
exports.ModelViewer = ModelViewer = __decorate([
(0, inversify_1.injectable)(),

@@ -192,3 +193,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.ModelRendererFactory)),

], ModelViewer);
exports.ModelViewer = ModelViewer;
/**

@@ -237,2 +237,3 @@ * Viewer for the _hidden_ model. This serves as an intermediate step to compute bounds

};
exports.HiddenModelViewer = HiddenModelViewer;
__decorate([

@@ -246,3 +247,3 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], HiddenModelViewer.prototype, "logger", void 0);
HiddenModelViewer = __decorate([
exports.HiddenModelViewer = HiddenModelViewer = __decorate([
(0, inversify_1.injectable)(),

@@ -255,3 +256,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.ModelRendererFactory)),

], HiddenModelViewer);
exports.HiddenModelViewer = HiddenModelViewer;
let PopupModelViewer = class PopupModelViewer {

@@ -299,2 +299,3 @@ constructor(modelRendererFactory, patcherProvider, popupPostprocessors) {

};
exports.PopupModelViewer = PopupModelViewer;
__decorate([

@@ -308,3 +309,3 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], PopupModelViewer.prototype, "logger", void 0);
PopupModelViewer = __decorate([
exports.PopupModelViewer = PopupModelViewer = __decorate([
(0, inversify_1.injectable)(),

@@ -317,3 +318,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.ModelRendererFactory)),

], PopupModelViewer);
exports.PopupModelViewer = PopupModelViewer;
//# sourceMappingURL=viewer.js.map

@@ -37,6 +37,6 @@ "use strict";

};
FocusFixPostprocessor = __decorate([
exports.FocusFixPostprocessor = FocusFixPostprocessor;
exports.FocusFixPostprocessor = FocusFixPostprocessor = __decorate([
(0, inversify_1.injectable)()
], FocusFixPostprocessor);
exports.FocusFixPostprocessor = FocusFixPostprocessor;
//# sourceMappingURL=vnode-postprocessor.js.map

@@ -132,6 +132,6 @@ "use strict";

};
AbstractLayout = __decorate([
exports.AbstractLayout = AbstractLayout;
exports.AbstractLayout = AbstractLayout = __decorate([
(0, inversify_1.injectable)()
], AbstractLayout);
exports.AbstractLayout = AbstractLayout;
//# sourceMappingURL=abstract-layout.js.map

@@ -16,8 +16,6 @@ /********************************************************************************

********************************************************************************/
import { Action, RequestAction, ResponseAction } from 'sprotty-protocol/lib/actions';
import * as protocol from "sprotty-protocol/lib/actions";
import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { Bounds, Dimension, Point } from "sprotty-protocol/lib/utils/geometry";
import { CommandExecutionContext, CommandResult, CommandReturn, HiddenCommand, SystemCommand } from "../../base/commands/command";
import { SModelElementImpl } from "../../base/model/smodel";
import { Action, RequestBoundsAction, SetBoundsAction } from 'sprotty-protocol/lib/actions';
import { Bounds, Dimension, Point } from 'sprotty-protocol/lib/utils/geometry';
import { CommandExecutionContext, CommandResult, CommandReturn, HiddenCommand, SystemCommand } from '../../base/commands/command';
import { SModelElementImpl } from '../../base/model/smodel';
import { Alignable, BoundsAware } from './model';

@@ -36,6 +34,6 @@ export interface ResolvedElementAndBounds {

export declare class SetBoundsCommand extends SystemCommand {
protected readonly action: protocol.SetBoundsAction;
protected readonly action: SetBoundsAction;
static readonly KIND: string;
protected bounds: ResolvedElementAndBounds[];
constructor(action: protocol.SetBoundsAction);
constructor(action: SetBoundsAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -46,85 +44,8 @@ undo(context: CommandExecutionContext): CommandReturn;

export declare class RequestBoundsCommand extends HiddenCommand {
protected action: protocol.RequestBoundsAction;
protected action: RequestBoundsAction;
static readonly KIND: string;
constructor(action: protocol.RequestBoundsAction);
constructor(action: RequestBoundsAction);
execute(context: CommandExecutionContext): CommandResult;
get blockUntil(): (action: Action) => boolean;
}
/**
* Sent from the model source (e.g. a DiagramServer) to the client to update the bounds of some
* (or all) model elements.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class SetBoundsAction implements Action, protocol.SetBoundsAction {
readonly bounds: ElementAndBounds[];
static readonly KIND = "setBounds";
readonly kind = "setBounds";
constructor(bounds: ElementAndBounds[]);
}
/**
* Sent from the model source to the client to request bounds for the given model. The model is
* rendered invisibly so the bounds can derived from the DOM. The response is a ComputedBoundsAction.
* This hidden rendering round-trip is necessary if the client is responsible for parts of the layout
* (see `needsClientLayout` viewer option).
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class RequestBoundsAction implements RequestAction<ComputedBoundsAction>, protocol.RequestBoundsAction {
readonly newRoot: SModelRootSchema;
readonly requestId: string;
static readonly KIND = "requestBounds";
readonly kind = "requestBounds";
constructor(newRoot: SModelRootSchema, requestId?: string);
/** Factory function to dispatch a request with the `IActionDispatcher` */
static create(newRoot: SModelRootSchema): RequestAction<ComputedBoundsAction>;
}
/**
* Sent from the client to the model source (e.g. a DiagramServer) to transmit the result of bounds
* computation as a response to a RequestBoundsAction. If the server is responsible for parts of
* the layout (see `needsServerLayout` viewer option), it can do so after applying the computed bounds
* received with this action. Otherwise there is no need to send the computed bounds to the server,
* so they can be processed locally by the client.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class ComputedBoundsAction implements ResponseAction, protocol.ComputedBoundsAction {
readonly bounds: ElementAndBounds[];
readonly revision?: number | undefined;
readonly alignments?: ElementAndAlignment[] | undefined;
readonly responseId: string;
static readonly KIND = "computedBounds";
readonly kind = "computedBounds";
constructor(bounds: ElementAndBounds[], revision?: number | undefined, alignments?: ElementAndAlignment[] | undefined, responseId?: string);
}
/**
* Associates new bounds with a model element, which is referenced via its id.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ElementAndBounds extends protocol.ElementAndBounds {
elementId: string;
newPosition?: Point;
newSize: Dimension;
}
/**
* Associates a new alignment with a model element, which is referenced via its id.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ElementAndAlignment extends protocol.ElementAndAlignment {
elementId: string;
newAlignment: Point;
}
/**
* Request a layout of the diagram or the selected elements only.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class LayoutAction implements Action, protocol.LayoutAction {
static readonly KIND = "layout";
readonly kind = "layout";
layoutType: string;
elementIds: string[];
}
//# sourceMappingURL=bounds-manipulation.d.ts.map

@@ -17,18 +17,2 @@ "use strict";

********************************************************************************/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

@@ -40,9 +24,2 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __metadata = (this && this.__metadata) || function (k, v) {

@@ -55,6 +32,5 @@ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);

Object.defineProperty(exports, "__esModule", { value: true });
exports.LayoutAction = exports.ComputedBoundsAction = exports.RequestBoundsAction = exports.SetBoundsAction = exports.RequestBoundsCommand = exports.SetBoundsCommand = void 0;
exports.RequestBoundsCommand = exports.SetBoundsCommand = void 0;
const inversify_1 = require("inversify");
const actions_1 = require("sprotty-protocol/lib/actions");
const protocol = __importStar(require("sprotty-protocol/lib/actions"));
const command_1 = require("../../base/commands/command");

@@ -98,4 +74,5 @@ const types_1 = require("../../base/types");

};
SetBoundsCommand.KIND = protocol.SetBoundsAction.KIND;
SetBoundsCommand = __decorate([
exports.SetBoundsCommand = SetBoundsCommand;
SetBoundsCommand.KIND = actions_1.SetBoundsAction.KIND;
exports.SetBoundsCommand = SetBoundsCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -105,3 +82,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], SetBoundsCommand);
exports.SetBoundsCommand = SetBoundsCommand;
let RequestBoundsCommand = class RequestBoundsCommand extends command_1.HiddenCommand {

@@ -123,4 +99,5 @@ constructor(action) {

};
RequestBoundsCommand.KIND = protocol.RequestBoundsAction.KIND;
RequestBoundsCommand = __decorate([
exports.RequestBoundsCommand = RequestBoundsCommand;
RequestBoundsCommand.KIND = actions_1.RequestBoundsAction.KIND;
exports.RequestBoundsCommand = RequestBoundsCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -130,71 +107,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], RequestBoundsCommand);
exports.RequestBoundsCommand = RequestBoundsCommand;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Sent from the model source (e.g. a DiagramServer) to the client to update the bounds of some
* (or all) model elements.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class SetBoundsAction {
constructor(bounds) {
this.bounds = bounds;
this.kind = SetBoundsAction.KIND;
}
}
SetBoundsAction.KIND = 'setBounds';
exports.SetBoundsAction = SetBoundsAction;
/**
* Sent from the model source to the client to request bounds for the given model. The model is
* rendered invisibly so the bounds can derived from the DOM. The response is a ComputedBoundsAction.
* This hidden rendering round-trip is necessary if the client is responsible for parts of the layout
* (see `needsClientLayout` viewer option).
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class RequestBoundsAction {
constructor(newRoot, requestId = '') {
this.newRoot = newRoot;
this.requestId = requestId;
this.kind = RequestBoundsAction.KIND;
}
/** Factory function to dispatch a request with the `IActionDispatcher` */
static create(newRoot) {
return new RequestBoundsAction(newRoot, (0, actions_1.generateRequestId)());
}
}
RequestBoundsAction.KIND = 'requestBounds';
exports.RequestBoundsAction = RequestBoundsAction;
/**
* Sent from the client to the model source (e.g. a DiagramServer) to transmit the result of bounds
* computation as a response to a RequestBoundsAction. If the server is responsible for parts of
* the layout (see `needsServerLayout` viewer option), it can do so after applying the computed bounds
* received with this action. Otherwise there is no need to send the computed bounds to the server,
* so they can be processed locally by the client.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class ComputedBoundsAction {
constructor(bounds, revision, alignments, responseId = '') {
this.bounds = bounds;
this.revision = revision;
this.alignments = alignments;
this.responseId = responseId;
this.kind = ComputedBoundsAction.KIND;
}
}
ComputedBoundsAction.KIND = 'computedBounds';
exports.ComputedBoundsAction = ComputedBoundsAction;
/**
* Request a layout of the diagram or the selected elements only.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class LayoutAction {
constructor() {
this.kind = LayoutAction.KIND;
}
}
LayoutAction.KIND = 'layout';
exports.LayoutAction = LayoutAction;
//# sourceMappingURL=bounds-manipulation.js.map

@@ -87,7 +87,7 @@ "use strict";

};
exports.HBoxLayouter = HBoxLayouter;
HBoxLayouter.KIND = 'hbox';
HBoxLayouter = __decorate([
exports.HBoxLayouter = HBoxLayouter = __decorate([
(0, inversify_1.injectable)()
], HBoxLayouter);
exports.HBoxLayouter = HBoxLayouter;
//# sourceMappingURL=hbox-layout.js.map

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

};
exports.HiddenBoundsUpdater = HiddenBoundsUpdater;
__decorate([

@@ -178,6 +179,5 @@ (0, inversify_1.inject)(types_1.TYPES.ILogger),

], HiddenBoundsUpdater.prototype, "layouter", void 0);
HiddenBoundsUpdater = __decorate([
exports.HiddenBoundsUpdater = HiddenBoundsUpdater = __decorate([
(0, inversify_1.injectable)()
], HiddenBoundsUpdater);
exports.HiddenBoundsUpdater = HiddenBoundsUpdater;
/**

@@ -184,0 +184,0 @@ * Attribute name identifying the SVG element that determines the bounding box of a rendered view.

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

};
exports.LayoutRegistry = LayoutRegistry;
__decorate([

@@ -55,3 +56,3 @@ (0, inversify_1.inject)(types_1.TYPES.ILogger),

], LayoutRegistry.prototype, "logger", void 0);
LayoutRegistry = __decorate([
exports.LayoutRegistry = LayoutRegistry = __decorate([
(0, inversify_1.injectable)(),

@@ -62,3 +63,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.LayoutRegistration)),

], LayoutRegistry);
exports.LayoutRegistry = LayoutRegistry;
let Layouter = class Layouter {

@@ -69,2 +69,3 @@ layout(element2boundsData) {

};
exports.Layouter = Layouter;
__decorate([

@@ -78,6 +79,5 @@ (0, inversify_1.inject)(types_1.TYPES.LayoutRegistry),

], Layouter.prototype, "logger", void 0);
Layouter = __decorate([
exports.Layouter = Layouter = __decorate([
(0, inversify_1.injectable)()
], Layouter);
exports.Layouter = Layouter;
class StatefulLayouter {

@@ -84,0 +84,0 @@ constructor(element2boundsData, layoutRegistry, log) {

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

import { Bounds, Dimension, Point } from 'sprotty-protocol/lib/utils/geometry';
import { SModelElement as SModelElementSchema } from 'sprotty-protocol/lib/model';
import { SChildElementImpl, SModelElementImpl, SParentElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
import { DOMHelper } from '../../base/views/dom-helper';

@@ -32,4 +30,6 @@ import { ViewerOptions } from '../../base/views/viewer-options';

* used in the _internal model_, while the other is used in the _external model_.
*
* Feature extension interface for {@link boundsFeature}.
*/
export interface BoundsAware extends SModelExtension {
export interface BoundsAware {
bounds: Bounds;

@@ -46,3 +46,6 @@ }

};
export interface LayoutableChild extends SModelExtension, BoundsAware {
/**
* Feature extension interface for {@link layoutableChildFeature}.
*/
export interface LayoutableChild extends BoundsAware {
layoutOptions?: ModelLayoutOptions;

@@ -53,4 +56,6 @@ }

* labels, or pre-rendered SVG figures.
*
* Feature extension interface for {@link alignFeature}.
*/
export interface Alignable extends SModelExtension {
export interface Alignable {
alignment: Point;

@@ -87,14 +92,2 @@ }

}
/** @deprecated Use `SShapeElementImpl` instead. */
export declare const SShapeElement: typeof SShapeElementImpl;
/**
* Serializable schema for SShapeElement.
*
* @deprecated Use `SShapeElement` from `sprotty-protocol` instead.
*/
export interface SShapeElementSchema extends SModelElementSchema {
position?: Point;
size?: Dimension;
layoutOptions?: ModelLayoutOptions;
}
//# sourceMappingURL=model.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.SShapeElement = exports.SShapeElementImpl = exports.findChildrenAtPosition = exports.getAbsoluteClientBounds = exports.getAbsoluteBounds = exports.isAlignable = exports.isSizeable = exports.isLayoutableChild = exports.isLayoutContainer = exports.isBoundsAware = exports.alignFeature = exports.layoutableChildFeature = exports.layoutContainerFeature = exports.boundsFeature = void 0;
exports.SShapeElementImpl = exports.findChildrenAtPosition = exports.getAbsoluteClientBounds = exports.getAbsoluteBounds = exports.isAlignable = exports.isSizeable = exports.isLayoutableChild = exports.isLayoutContainer = exports.isBoundsAware = exports.alignFeature = exports.layoutableChildFeature = exports.layoutContainerFeature = exports.boundsFeature = void 0;
const geometry_1 = require("sprotty-protocol/lib/utils/geometry");

@@ -179,5 +179,2 @@ const smodel_1 = require("../../base/model/smodel");

exports.SShapeElementImpl = SShapeElementImpl;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/** @deprecated Use `SShapeElementImpl` instead. */
exports.SShapeElement = SShapeElementImpl;
//# sourceMappingURL=model.js.map

@@ -77,7 +77,7 @@ "use strict";

};
exports.StackLayouter = StackLayouter;
StackLayouter.KIND = 'stack';
StackLayouter = __decorate([
exports.StackLayouter = StackLayouter = __decorate([
(0, inversify_1.injectable)()
], StackLayouter);
exports.StackLayouter = StackLayouter;
//# sourceMappingURL=stack-layout.js.map

@@ -87,7 +87,7 @@ "use strict";

};
exports.VBoxLayouter = VBoxLayouter;
VBoxLayouter.KIND = 'vbox';
VBoxLayouter = __decorate([
exports.VBoxLayouter = VBoxLayouter = __decorate([
(0, inversify_1.injectable)()
], VBoxLayouter);
exports.VBoxLayouter = VBoxLayouter;
//# sourceMappingURL=vbox-layout.js.map

@@ -51,6 +51,6 @@ "use strict";

};
ShapeView = __decorate([
exports.ShapeView = ShapeView;
exports.ShapeView = ShapeView = __decorate([
(0, inversify_1.injectable)()
], ShapeView);
exports.ShapeView = ShapeView;
//# sourceMappingURL=views.js.map

@@ -23,7 +23,2 @@ /********************************************************************************

}
/** @deprecated deprecated since 0.12.0 - please use `configureButtonHandler` */
export interface IButtonHandlerFactory {
TYPE: string;
new (): IButtonHandler;
}
export interface IButtonHandlerRegistration {

@@ -34,3 +29,3 @@ TYPE: string;

export declare class ButtonHandlerRegistry extends InstanceRegistry<IButtonHandler> {
constructor(buttonHandlerRegistrations: IButtonHandlerRegistration[], buttonHandlerFactories: IButtonHandlerFactory[]);
constructor(buttonHandlerRegistrations: IButtonHandlerRegistration[]);
}

@@ -37,0 +32,0 @@ /**

@@ -36,18 +36,14 @@ "use strict";

let ButtonHandlerRegistry = class ButtonHandlerRegistry extends registry_1.InstanceRegistry {
constructor(buttonHandlerRegistrations, buttonHandlerFactories) {
constructor(buttonHandlerRegistrations) {
super();
buttonHandlerRegistrations.forEach(factory => this.register(factory.TYPE, factory.factory()));
// deprecated, but keep support for now
buttonHandlerFactories.forEach(factory => this.register(factory.TYPE, new factory()));
}
};
ButtonHandlerRegistry = __decorate([
exports.ButtonHandlerRegistry = ButtonHandlerRegistry;
exports.ButtonHandlerRegistry = ButtonHandlerRegistry = __decorate([
(0, inversify_1.injectable)(),
__param(0, (0, inversify_1.multiInject)(types_1.TYPES.IButtonHandlerRegistration)),
__param(0, (0, inversify_1.optional)()),
__param(1, (0, inversify_1.multiInject)(types_1.TYPES.IButtonHandler)),
__param(1, (0, inversify_1.optional)()),
__metadata("design:paramtypes", [Array, Array])
__metadata("design:paramtypes", [Array])
], ButtonHandlerRegistry);
exports.ButtonHandlerRegistry = ButtonHandlerRegistry;
/**

@@ -54,0 +50,0 @@ * Utility function to register a button handler for an button type.

@@ -16,5 +16,5 @@ /********************************************************************************

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

@@ -27,4 +27,2 @@ enabled: boolean;

}
/** @deprecated Use `SButtonImpl` instead. */
export declare const SButton: typeof SButtonImpl;
//# sourceMappingURL=model.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.SButton = exports.SButtonImpl = void 0;
exports.SButtonImpl = void 0;
const model_1 = require("../bounds/model");

@@ -28,7 +28,4 @@ const model_2 = require("../fade/model");

}
exports.SButtonImpl = SButtonImpl;
SButtonImpl.DEFAULT_FEATURES = [model_1.boundsFeature, model_1.layoutableChildFeature, model_2.fadeFeature];
exports.SButtonImpl = SButtonImpl;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/** @deprecated Use `SButtonImpl` instead. */
exports.SButton = SButtonImpl;
//# sourceMappingURL=model.js.map

@@ -46,3 +46,4 @@ "use strict";

};
CommandPaletteActionProviderRegistry = __decorate([
exports.CommandPaletteActionProviderRegistry = CommandPaletteActionProviderRegistry;
exports.CommandPaletteActionProviderRegistry = CommandPaletteActionProviderRegistry = __decorate([
(0, inversify_1.injectable)(),

@@ -53,3 +54,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.ICommandPaletteActionProvider)),

], CommandPaletteActionProviderRegistry);
exports.CommandPaletteActionProviderRegistry = CommandPaletteActionProviderRegistry;
let RevealNamedElementActionProvider = class RevealNamedElementActionProvider {

@@ -70,3 +70,4 @@ constructor(logger) {

};
RevealNamedElementActionProvider = __decorate([
exports.RevealNamedElementActionProvider = RevealNamedElementActionProvider;
exports.RevealNamedElementActionProvider = RevealNamedElementActionProvider = __decorate([
(0, inversify_1.injectable)(),

@@ -76,3 +77,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.ILogger)),

], RevealNamedElementActionProvider);
exports.RevealNamedElementActionProvider = RevealNamedElementActionProvider;
//# sourceMappingURL=action-providers.js.map

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

};
exports.CommandPalette = CommandPalette;
CommandPalette.ID = "command-palette";

@@ -221,6 +222,5 @@ CommandPalette.isInvokePaletteKey = (event) => (0, keyboard_1.matchesKeystroke)(event, 'Space', 'ctrl');

], CommandPalette.prototype, "mousePositionTracker", void 0);
CommandPalette = CommandPalette_1 = __decorate([
exports.CommandPalette = CommandPalette = CommandPalette_1 = __decorate([
(0, inversify_1.injectable)()
], CommandPalette);
exports.CommandPalette = CommandPalette;
function toActionArray(input) {

@@ -227,0 +227,0 @@ if ((0, action_1.isLabeledAction)(input)) {

@@ -71,3 +71,4 @@ "use strict";

};
ContextMenuProviderRegistry = __decorate([
exports.ContextMenuProviderRegistry = ContextMenuProviderRegistry;
exports.ContextMenuProviderRegistry = ContextMenuProviderRegistry = __decorate([
(0, inversify_1.injectable)(),

@@ -78,3 +79,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.IContextMenuItemProvider)),

], ContextMenuProviderRegistry);
exports.ContextMenuProviderRegistry = ContextMenuProviderRegistry;
let DeleteContextMenuItemProvider = class DeleteContextMenuItemProvider {

@@ -95,6 +95,6 @@ getItems(root, lastMousePosition) {

};
DeleteContextMenuItemProvider = __decorate([
exports.DeleteContextMenuItemProvider = DeleteContextMenuItemProvider;
exports.DeleteContextMenuItemProvider = DeleteContextMenuItemProvider = __decorate([
(0, inversify_1.injectable)()
], DeleteContextMenuItemProvider);
exports.DeleteContextMenuItemProvider = DeleteContextMenuItemProvider;
//# sourceMappingURL=menu-providers.js.map

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

};
exports.ContextMenuMouseListener = ContextMenuMouseListener;
__decorate([

@@ -86,3 +87,3 @@ (0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),

], ContextMenuMouseListener.prototype, "actionDispatcher", void 0);
ContextMenuMouseListener = __decorate([
exports.ContextMenuMouseListener = ContextMenuMouseListener = __decorate([
__param(0, (0, inversify_1.inject)(types_1.TYPES.IContextMenuServiceProvider)),

@@ -92,3 +93,2 @@ __param(1, (0, inversify_1.inject)(types_1.TYPES.IContextMenuProviderRegistry)),

], ContextMenuMouseListener);
exports.ContextMenuMouseListener = ContextMenuMouseListener;
//# sourceMappingURL=mouse-listener.js.map

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

};
exports.DecorationPlacer = DecorationPlacer;
__decorate([

@@ -77,6 +78,5 @@ (0, inversify_1.inject)(routing_1.EdgeRouterRegistry),

], DecorationPlacer.prototype, "edgeRouterRegistry", void 0);
DecorationPlacer = __decorate([
exports.DecorationPlacer = DecorationPlacer = __decorate([
(0, inversify_1.injectable)()
], DecorationPlacer);
exports.DecorationPlacer = DecorationPlacer;
//# sourceMappingURL=decoration-placer.js.map

@@ -16,7 +16,9 @@ /********************************************************************************

********************************************************************************/
import { SModelExtension } from '../../base/model/smodel-extension';
import { SModelElementImpl } from '../../base/model/smodel';
import { SShapeElementImpl } from '../bounds/model';
export declare const decorationFeature: unique symbol;
export interface Decoration extends SModelExtension {
/**
* Feature extension interface for {@link decorationFeature}.
*/
export interface Decoration {
}

@@ -23,0 +25,0 @@ export declare function isDecoration<T extends SModelElementImpl>(e: T): e is T & Decoration;

@@ -28,4 +28,4 @@ "use strict";

}
exports.SDecoration = SDecoration;
SDecoration.DEFAULT_FEATURES = [exports.decorationFeature, model_1.boundsFeature, model_2.hoverFeedbackFeature, model_2.popupFeature];
exports.SDecoration = SDecoration;
class SIssueMarker extends SDecoration {

@@ -32,0 +32,0 @@ }

@@ -60,6 +60,6 @@ "use strict";

};
IssueMarkerView = __decorate([
exports.IssueMarkerView = IssueMarkerView;
exports.IssueMarkerView = IssueMarkerView = __decorate([
(0, inversify_1.injectable)()
], IssueMarkerView);
exports.IssueMarkerView = IssueMarkerView;
//# sourceMappingURL=views.js.map

@@ -122,6 +122,6 @@ "use strict";

};
IntersectionFinder = __decorate([
exports.IntersectionFinder = IntersectionFinder;
exports.IntersectionFinder = IntersectionFinder = __decorate([
(0, inversify_1.injectable)()
], IntersectionFinder);
exports.IntersectionFinder = IntersectionFinder;
//# sourceMappingURL=intersection-finder.js.map

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

};
exports.EdgeLayoutPostprocessor = EdgeLayoutPostprocessor;
__decorate([

@@ -214,6 +215,5 @@ (0, inversify_1.inject)(routing_1.EdgeRouterRegistry),

], EdgeLayoutPostprocessor.prototype, "edgeRouterRegistry", void 0);
EdgeLayoutPostprocessor = __decorate([
exports.EdgeLayoutPostprocessor = EdgeLayoutPostprocessor = __decorate([
(0, inversify_1.injectable)()
], EdgeLayoutPostprocessor);
exports.EdgeLayoutPostprocessor = EdgeLayoutPostprocessor;
//# sourceMappingURL=edge-layout.js.map

@@ -16,7 +16,9 @@ /********************************************************************************

********************************************************************************/
import { SModelExtension } from '../../base/model/smodel-extension';
import { SModelElementImpl, SChildElementImpl } from '../../base/model/smodel';
import { BoundsAware } from '../bounds/model';
export declare const edgeLayoutFeature: unique symbol;
export interface EdgeLayoutable extends SModelExtension {
/**
* Feature extension interface for {@link edgeLayoutFeature}.
*/
export interface EdgeLayoutable {
edgePlacement: EdgePlacement;

@@ -23,0 +25,0 @@ }

@@ -18,5 +18,7 @@ /********************************************************************************

import { SModelElementImpl } from "../../base/model/smodel";
import { SModelExtension } from "../../base/model/smodel-extension";
export declare const creatingOnDragFeature: unique symbol;
export interface CreatingOnDrag extends SModelExtension {
/**
* Feature extension interface for {@link creatingOnDragFeature}.
*/
export interface CreatingOnDrag {
createAction(id: string): Action;

@@ -23,0 +25,0 @@ }

@@ -16,12 +16,11 @@ /********************************************************************************

********************************************************************************/
import { Action, CreateElementAction as ProtocolCreateElementAction } from 'sprotty-protocol/lib/actions';
import { SModelElement as SModelElementSchema } from 'sprotty-protocol/lib/model';
import { CreateElementAction } from 'sprotty-protocol/lib/actions';
import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';
import { SParentElementImpl, SChildElementImpl } from '../../base/model/smodel';
export declare class CreateElementCommand extends Command {
protected readonly action: ProtocolCreateElementAction;
protected readonly action: CreateElementAction;
static readonly KIND = "createElement";
container: SParentElementImpl;
newElement: SChildElementImpl;
constructor(action: ProtocolCreateElementAction);
constructor(action: CreateElementAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -31,18 +30,2 @@ undo(context: CommandExecutionContext): CommandReturn;

}
/**
* Create an element with the given schema and add it to the diagram.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface CreateElementAction extends Action {
kind: typeof CreateElementAction.KIND;
containerId: string;
elementSchema: SModelElementSchema;
}
export declare namespace CreateElementAction {
const KIND = "createElement";
function create(elementSchema: SModelElementSchema, options: {
containerId: string;
}): CreateElementAction;
}
//# sourceMappingURL=create.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateElementAction = exports.CreateElementCommand = void 0;
exports.CreateElementCommand = void 0;
const inversify_1 = require("inversify");

@@ -60,4 +60,5 @@ const actions_1 = require("sprotty-protocol/lib/actions");

};
exports.CreateElementCommand = CreateElementCommand;
CreateElementCommand.KIND = actions_1.CreateElementAction.KIND;
CreateElementCommand = __decorate([
exports.CreateElementCommand = CreateElementCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -67,15 +68,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], CreateElementCommand);
exports.CreateElementCommand = CreateElementCommand;
var CreateElementAction;
(function (CreateElementAction) {
CreateElementAction.KIND = 'createElement';
function create(elementSchema, options) {
return {
kind: CreateElementAction.KIND,
elementSchema,
containerId: options.containerId
};
}
CreateElementAction.create = create;
})(CreateElementAction = exports.CreateElementAction || (exports.CreateElementAction = {}));
//# sourceMappingURL=create.js.map

@@ -16,8 +16,10 @@ /********************************************************************************

********************************************************************************/
import { Action, DeleteElementAction as ProtocolDeleteElementAction } from 'sprotty-protocol/lib/actions';
import { DeleteElementAction } from 'sprotty-protocol/lib/actions';
import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';
import { SModelElementImpl, SParentElementImpl, SChildElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
export declare const deletableFeature: unique symbol;
export interface Deletable extends SModelExtension {
/**
* Feature extension interface for {@link deletableFeature}.
*/
export interface Deletable {
}

@@ -30,6 +32,6 @@ export declare function isDeletable<T extends SModelElementImpl>(element: T): element is T & Deletable & SChildElementImpl;

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

@@ -39,15 +41,2 @@ undo(context: CommandExecutionContext): CommandReturn;

}
/**
* Delete a set of elements identified by their IDs.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface DeleteElementAction extends Action {
kind: typeof DeleteElementAction.KIND;
elementIds: string[];
}
export declare namespace DeleteElementAction {
const KIND = "delete";
function create(elementIds: string[]): DeleteElementAction;
}
//# sourceMappingURL=delete.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.DeleteElementAction = exports.DeleteElementCommand = exports.ResolvedDelete = exports.isDeletable = exports.deletableFeature = void 0;
exports.DeleteElementCommand = exports.ResolvedDelete = exports.isDeletable = exports.deletableFeature = void 0;
const inversify_1 = require("inversify");

@@ -73,4 +73,5 @@ const actions_1 = require("sprotty-protocol/lib/actions");

};
exports.DeleteElementCommand = DeleteElementCommand;
DeleteElementCommand.KIND = actions_1.DeleteElementAction.KIND;
DeleteElementCommand = __decorate([
exports.DeleteElementCommand = DeleteElementCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -80,14 +81,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], DeleteElementCommand);
exports.DeleteElementCommand = DeleteElementCommand;
var DeleteElementAction;
(function (DeleteElementAction) {
DeleteElementAction.KIND = 'delete';
function create(elementIds) {
return {
kind: DeleteElementAction.KIND,
elementIds
};
}
DeleteElementAction.create = create;
})(DeleteElementAction = exports.DeleteElementAction || (exports.DeleteElementAction = {}));
//# sourceMappingURL=delete.js.map

@@ -49,6 +49,6 @@ "use strict";

};
EditLabelActionHandler = __decorate([
exports.EditLabelActionHandler = EditLabelActionHandler;
exports.EditLabelActionHandler = EditLabelActionHandler = __decorate([
(0, inversify_1.injectable)()
], EditLabelActionHandler);
exports.EditLabelActionHandler = EditLabelActionHandler;
let EditLabelUI = EditLabelUI_1 = class EditLabelUI extends ui_extension_1.AbstractUIExtension {

@@ -238,2 +238,3 @@ constructor() {

};
exports.EditLabelUI = EditLabelUI;
EditLabelUI.ID = 'editLabelUi';

@@ -262,6 +263,5 @@ __decorate([

], EditLabelUI.prototype, "validationDecorator", void 0);
EditLabelUI = EditLabelUI_1 = __decorate([
exports.EditLabelUI = EditLabelUI = EditLabelUI_1 = __decorate([
(0, inversify_1.injectable)()
], EditLabelUI);
exports.EditLabelUI = EditLabelUI;
function hasEditableLabel(contextElementIds, root) {

@@ -268,0 +268,0 @@ return getEditableLabels(contextElementIds, root).length === 1;

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

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

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

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

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

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

@@ -64,17 +64,2 @@ undo(context: CommandExecutionContext): CommandReturn;

export declare function getEditableLabel(element: SModelElementImpl): EditableLabel & SModelElementImpl | undefined;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ApplyLabelEditAction extends Action {
kind: typeof ApplyLabelEditAction.KIND;
labelId: string;
text: string;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare namespace ApplyLabelEditAction {
const KIND = "applyLabelEdit";
function create(labelId: string, text: string): ApplyLabelEditAction;
}
//# sourceMappingURL=edit-label.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplyLabelEditAction = exports.getEditableLabel = exports.EditLabelKeyListener = exports.EditLabelMouseListener = exports.ApplyLabelEditCommand = exports.ResolvedLabelEdit = exports.isApplyLabelEditAction = exports.isEditLabelAction = exports.EditLabelAction = void 0;
exports.getEditableLabel = exports.EditLabelKeyListener = exports.EditLabelMouseListener = exports.ApplyLabelEditCommand = exports.ResolvedLabelEdit = exports.isApplyLabelEditAction = exports.isEditLabelAction = exports.EditLabelAction = void 0;
const inversify_1 = require("inversify");

@@ -52,3 +52,3 @@ const actions_1 = require("sprotty-protocol/lib/actions");

EditLabelAction.create = create;
})(EditLabelAction = exports.EditLabelAction || (exports.EditLabelAction = {}));
})(EditLabelAction || (exports.EditLabelAction = EditLabelAction = {}));
function isEditLabelAction(element) {

@@ -92,8 +92,8 @@ return (0, actions_1.isAction)(element) && element.kind === EditLabelAction.KIND && 'labelId' in element;

};
exports.ApplyLabelEditCommand = ApplyLabelEditCommand;
ApplyLabelEditCommand.KIND = actions_1.ApplyLabelEditAction.KIND;
ApplyLabelEditCommand = __decorate([
exports.ApplyLabelEditCommand = ApplyLabelEditCommand = __decorate([
__param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),
__metadata("design:paramtypes", [Object])
], ApplyLabelEditCommand);
exports.ApplyLabelEditCommand = ApplyLabelEditCommand;
class EditLabelMouseListener extends mouse_tool_1.MouseListener {

@@ -133,17 +133,2 @@ doubleClick(target, event) {

exports.getEditableLabel = getEditableLabel;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
var ApplyLabelEditAction;
(function (ApplyLabelEditAction) {
ApplyLabelEditAction.KIND = 'applyLabelEdit';
function create(labelId, text) {
return {
kind: ApplyLabelEditAction.KIND,
labelId,
text
};
}
ApplyLabelEditAction.create = create;
})(ApplyLabelEditAction = exports.ApplyLabelEditAction || (exports.ApplyLabelEditAction = {}));
//# sourceMappingURL=edit-label.js.map

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

SwitchEditModeAction.create = create;
})(SwitchEditModeAction = exports.SwitchEditModeAction || (exports.SwitchEditModeAction = {}));
})(SwitchEditModeAction || (exports.SwitchEditModeAction = SwitchEditModeAction = {}));
let SwitchEditModeCommand = class SwitchEditModeCommand extends command_1.Command {

@@ -145,2 +145,3 @@ constructor(action) {

};
exports.SwitchEditModeCommand = SwitchEditModeCommand;
SwitchEditModeCommand.KIND = SwitchEditModeAction.KIND;

@@ -151,3 +152,3 @@ __decorate([

], SwitchEditModeCommand.prototype, "edgeRouterRegistry", void 0);
SwitchEditModeCommand = __decorate([
exports.SwitchEditModeCommand = SwitchEditModeCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -157,3 +158,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], SwitchEditModeCommand);
exports.SwitchEditModeCommand = SwitchEditModeCommand;
//# sourceMappingURL=edit-routing.js.map

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

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
import { SRoutableElementImpl } from '../routing/model';

@@ -24,3 +23,6 @@ export declare const editFeature: unique symbol;

export declare const editLabelFeature: unique symbol;
export interface EditableLabel extends SModelExtension {
/**
* Feature extension interface for {@link editLabelFeature}.
*/
export interface EditableLabel {
text: string;

@@ -33,3 +35,6 @@ readonly isMultiLine?: boolean;

export declare const withEditLabelFeature: unique symbol;
export interface WithEditableLabel extends SModelExtension {
/**
* Feature extension interface for {@link withEditLabelFeature}.
*/
export interface WithEditableLabel {
readonly editableLabel?: EditableLabel & SModelElementImpl;

@@ -36,0 +41,0 @@ }

@@ -16,11 +16,11 @@ /********************************************************************************

********************************************************************************/
import { Action, ReconnectAction as ProtocolReconnectAction } from 'sprotty-protocol/lib/actions';
import { ReconnectAction } from 'sprotty-protocol/lib/actions';
import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';
import { EdgeMemento, EdgeRouterRegistry } from '../routing/routing';
export declare class ReconnectCommand extends Command {
protected readonly action: ProtocolReconnectAction;
protected readonly action: ReconnectAction;
static readonly KIND = "reconnect";
edgeRouterRegistry: EdgeRouterRegistry;
memento: EdgeMemento | undefined;
constructor(action: ProtocolReconnectAction);
constructor(action: ReconnectAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -31,22 +31,2 @@ private doExecute;

}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ReconnectAction extends Action {
kind: typeof ReconnectAction.KIND;
routableId: string;
newSourceId?: string;
newTargetId?: string;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare namespace ReconnectAction {
const KIND = "reconnect";
function create(options: {
routableId: string;
newSourceId?: string;
newTargetId?: string;
}): ReconnectAction;
}
//# sourceMappingURL=reconnect.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.ReconnectAction = exports.ReconnectCommand = void 0;
exports.ReconnectCommand = void 0;
const inversify_1 = require("inversify");

@@ -77,2 +77,3 @@ const actions_1 = require("sprotty-protocol/lib/actions");

};
exports.ReconnectCommand = ReconnectCommand;
ReconnectCommand.KIND = actions_1.ReconnectAction.KIND;

@@ -83,3 +84,3 @@ __decorate([

], ReconnectCommand.prototype, "edgeRouterRegistry", void 0);
ReconnectCommand = __decorate([
exports.ReconnectCommand = ReconnectCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -89,19 +90,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], ReconnectCommand);
exports.ReconnectCommand = ReconnectCommand;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
var ReconnectAction;
(function (ReconnectAction) {
ReconnectAction.KIND = 'reconnect';
function create(options) {
return {
kind: ReconnectAction.KIND,
routableId: options.routableId,
newSourceId: options.newSourceId,
newTargetId: options.newTargetId
};
}
ReconnectAction.create = create;
})(ReconnectAction = exports.ReconnectAction || (exports.ReconnectAction = {}));
//# sourceMappingURL=reconnect.js.map

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

********************************************************************************/
import { Action, CollapseExpandAction as ProtocolCollapseExpandAction, CollapseExpandAllAction as ProtocolCollapseExpandAllAction } from 'sprotty-protocol/lib/actions';
import { Action } from 'sprotty-protocol/lib/actions';
import { SButtonImpl } from '../button/model';

@@ -24,29 +24,2 @@ import { IButtonHandler } from '../button/button-handler';

}
/**
* Sent from the client to the model source to recalculate a diagram when elements
* are collapsed/expanded by the client.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class CollapseExpandAction implements Action, ProtocolCollapseExpandAction {
readonly expandIds: string[];
readonly collapseIds: string[];
static readonly KIND = "collapseExpand";
readonly kind = "collapseExpand";
constructor(expandIds: string[], collapseIds: string[]);
}
/**
* Programmatic action for expanding or collapsing all elements.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class CollapseExpandAllAction implements Action, ProtocolCollapseExpandAllAction {
readonly expand: boolean;
static readonly KIND = "collapseExpandAll";
readonly kind = "collapseExpandAll";
/**
* If `expand` is true, all elements are expanded, othewise they are collapsed.
*/
constructor(expand?: boolean);
}
//# sourceMappingURL=expand.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.CollapseExpandAllAction = exports.CollapseExpandAction = exports.ExpandButtonHandler = void 0;
exports.ExpandButtonHandler = void 0;
const inversify_1 = require("inversify");

@@ -44,39 +44,7 @@ const actions_1 = require("sprotty-protocol/lib/actions");

};
exports.ExpandButtonHandler = ExpandButtonHandler;
ExpandButtonHandler.TYPE = 'button:expand';
ExpandButtonHandler = __decorate([
exports.ExpandButtonHandler = ExpandButtonHandler = __decorate([
(0, inversify_1.injectable)()
], ExpandButtonHandler);
exports.ExpandButtonHandler = ExpandButtonHandler;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Sent from the client to the model source to recalculate a diagram when elements
* are collapsed/expanded by the client.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class CollapseExpandAction {
constructor(expandIds, collapseIds) {
this.expandIds = expandIds;
this.collapseIds = collapseIds;
this.kind = CollapseExpandAction.KIND;
}
}
CollapseExpandAction.KIND = 'collapseExpand';
exports.CollapseExpandAction = CollapseExpandAction;
/**
* Programmatic action for expanding or collapsing all elements.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class CollapseExpandAllAction {
/**
* If `expand` is true, all elements are expanded, othewise they are collapsed.
*/
constructor(expand = true) {
this.expand = expand;
this.kind = CollapseExpandAllAction.KIND;
}
}
CollapseExpandAllAction.KIND = 'collapseExpandAll';
exports.CollapseExpandAllAction = CollapseExpandAllAction;
//# sourceMappingURL=expand.js.map

@@ -17,8 +17,9 @@ /********************************************************************************

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
export declare const expandFeature: unique symbol;
/**
* Model elements that implement this interface can be expanded/collapsed
*
* Feature extension interface for {@link expandFeature}.
*/
export interface Expandable extends SModelExtension {
export interface Expandable {
expanded: boolean;

@@ -25,0 +26,0 @@ }

@@ -41,6 +41,6 @@ "use strict";

};
ExpandButtonView = __decorate([
exports.ExpandButtonView = ExpandButtonView;
exports.ExpandButtonView = ExpandButtonView = __decorate([
(0, inversify_1.injectable)()
], ExpandButtonView);
exports.ExpandButtonView = ExpandButtonView;
//# sourceMappingURL=views.js.map

@@ -51,6 +51,6 @@ "use strict";

};
ExportSvgKeyListener = __decorate([
exports.ExportSvgKeyListener = ExportSvgKeyListener;
exports.ExportSvgKeyListener = ExportSvgKeyListener = __decorate([
(0, inversify_1.injectable)()
], ExportSvgKeyListener);
exports.ExportSvgKeyListener = ExportSvgKeyListener;
var RequestExportSvgAction;

@@ -66,3 +66,3 @@ (function (RequestExportSvgAction) {

RequestExportSvgAction.create = create;
})(RequestExportSvgAction = exports.RequestExportSvgAction || (exports.RequestExportSvgAction = {}));
})(RequestExportSvgAction || (exports.RequestExportSvgAction = RequestExportSvgAction = {}));
let ExportSvgCommand = class ExportSvgCommand extends command_1.HiddenCommand {

@@ -100,8 +100,8 @@ constructor(action) {

};
exports.ExportSvgCommand = ExportSvgCommand;
ExportSvgCommand.KIND = RequestExportSvgAction.KIND;
ExportSvgCommand = __decorate([
exports.ExportSvgCommand = ExportSvgCommand = __decorate([
__param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),
__metadata("design:paramtypes", [Object])
], ExportSvgCommand);
exports.ExportSvgCommand = ExportSvgCommand;
let ExportSvgPostprocessor = class ExportSvgPostprocessor {

@@ -119,2 +119,3 @@ decorate(vnode, element) {

};
exports.ExportSvgPostprocessor = ExportSvgPostprocessor;
__decorate([

@@ -124,6 +125,5 @@ (0, inversify_1.inject)(types_1.TYPES.SvgExporter),

], ExportSvgPostprocessor.prototype, "svgExporter", void 0);
ExportSvgPostprocessor = __decorate([
exports.ExportSvgPostprocessor = ExportSvgPostprocessor = __decorate([
(0, inversify_1.injectable)()
], ExportSvgPostprocessor);
exports.ExportSvgPostprocessor = ExportSvgPostprocessor;
//# sourceMappingURL=export.js.map

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

ExportSvgAction.create = create;
})(ExportSvgAction = exports.ExportSvgAction || (exports.ExportSvgAction = {}));
})(ExportSvgAction || (exports.ExportSvgAction = ExportSvgAction = {}));
let SvgExporter = class SvgExporter {

@@ -111,2 +111,3 @@ export(root, request) {

};
exports.SvgExporter = SvgExporter;
__decorate([

@@ -124,6 +125,5 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], SvgExporter.prototype, "log", void 0);
SvgExporter = __decorate([
exports.SvgExporter = SvgExporter = __decorate([
(0, inversify_1.injectable)()
], SvgExporter);
exports.SvgExporter = SvgExporter;
//# sourceMappingURL=svg-exporter.js.map

@@ -64,6 +64,6 @@ "use strict";

};
ElementFader = __decorate([
exports.ElementFader = ElementFader;
exports.ElementFader = ElementFader = __decorate([
(0, inversify_1.injectable)()
], ElementFader);
exports.ElementFader = ElementFader;
//# sourceMappingURL=fade.js.map

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

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
export declare const fadeFeature: unique symbol;
export interface Fadeable extends SModelExtension {
/**
* Feature extension interface for {@link fadeFeature}.
*/
export interface Fadeable {
opacity: number;

@@ -22,0 +24,0 @@ }

@@ -16,15 +16,14 @@ /********************************************************************************

********************************************************************************/
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';
import { Bounds, Point } from "sprotty-protocol/lib/utils/geometry";
import { SModelElementImpl, SModelRootImpl } from "../../base/model/smodel";
import { MouseListener } from "../../base/views/mouse-tool";
import { CommandExecutionContext, PopupCommand, SystemCommand, CommandReturn, ICommand } from "../../base/commands/command";
import { IActionHandler } from "../../base/actions/action-handler";
import { KeyListener } from "../../base/views/key-tool";
import { ViewerOptions } from "../../base/views/viewer-options";
import { Action, SetPopupModelAction, HoverFeedbackAction } from 'sprotty-protocol/lib/actions';
import { Bounds, Point } from 'sprotty-protocol/lib/utils/geometry';
import { SModelElementImpl, SModelRootImpl } from '../../base/model/smodel';
import { MouseListener } from '../../base/views/mouse-tool';
import { CommandExecutionContext, PopupCommand, SystemCommand, CommandReturn, ICommand } from '../../base/commands/command';
import { IActionHandler } from '../../base/actions/action-handler';
import { KeyListener } from '../../base/views/key-tool';
import { ViewerOptions } from '../../base/views/viewer-options';
export declare class HoverFeedbackCommand extends SystemCommand {
protected readonly action: ProtocolHoverFeedbackAction;
protected readonly action: HoverFeedbackAction;
static readonly KIND = "hoverFeedback";
constructor(action: ProtocolHoverFeedbackAction);
constructor(action: HoverFeedbackAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -35,7 +34,7 @@ undo(context: CommandExecutionContext): CommandReturn;

export declare class SetPopupModelCommand extends PopupCommand {
protected readonly action: ProtocolSetPopupModelAction;
protected readonly action: SetPopupModelAction;
static readonly KIND = "setPopupModel";
oldRoot: SModelRootImpl;
newRoot: SModelRootImpl;
constructor(action: ProtocolSetPopupModelAction);
constructor(action: SetPopupModelAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -85,52 +84,2 @@ undo(context: CommandExecutionContext): CommandReturn;

}
/**
* Triggered when the user puts the mouse pointer over an element.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface HoverFeedbackAction extends Action {
kind: typeof HoverFeedbackAction.KIND;
mouseoverElement: string;
mouseIsOver: boolean;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare namespace HoverFeedbackAction {
const KIND = "hoverFeedback";
function create(options: {
mouseoverElement: string;
mouseIsOver: boolean;
}): HoverFeedbackAction;
}
/**
* Triggered when the user hovers the mouse pointer over an element to get a popup with details on
* that element. This action is sent from the client to the model source, e.g. a DiagramServer.
* The response is a SetPopupModelAction.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class RequestPopupModelAction implements RequestAction<SetPopupModelAction>, ProtocolRequestPopupModelAction {
readonly elementId: string;
readonly bounds: Bounds;
readonly requestId: string;
static readonly KIND = "requestPopupModel";
readonly kind = "requestPopupModel";
constructor(elementId: string, bounds: Bounds, requestId?: string);
/** Factory function to dispatch a request with the `IActionDispatcher` */
static create(elementId: string, bounds: Bounds): RequestAction<SetPopupModelAction>;
}
/**
* Sent from the model source to the client to display a popup in response to a RequestPopupModelAction.
* This action can also be used to remove any existing popup by choosing EMPTY_ROOT as root element.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class SetPopupModelAction implements ResponseAction, ProtocolSetPopupModelAction {
readonly newRoot: SModelRootSchema;
readonly responseId: string;
static readonly KIND = "setPopupModel";
readonly kind = "setPopupModel";
constructor(newRoot: SModelRootSchema, responseId?: string);
}
//# sourceMappingURL=hover.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.SetPopupModelAction = exports.RequestPopupModelAction = exports.HoverFeedbackAction = exports.ClosePopupActionHandler = exports.HoverKeyListener = exports.PopupHoverMouseListener = exports.HoverMouseListener = exports.AbstractHoverMouseListener = exports.SetPopupModelCommand = exports.HoverFeedbackCommand = void 0;
exports.ClosePopupActionHandler = exports.HoverKeyListener = exports.PopupHoverMouseListener = exports.HoverMouseListener = exports.AbstractHoverMouseListener = exports.SetPopupModelCommand = exports.HoverFeedbackCommand = void 0;
const inversify_1 = require("inversify");

@@ -67,4 +67,5 @@ const actions_1 = require("sprotty-protocol/lib/actions");

};
exports.HoverFeedbackCommand = HoverFeedbackCommand;
HoverFeedbackCommand.KIND = actions_1.HoverFeedbackAction.KIND;
HoverFeedbackCommand = __decorate([
exports.HoverFeedbackCommand = HoverFeedbackCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -74,3 +75,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], HoverFeedbackCommand);
exports.HoverFeedbackCommand = HoverFeedbackCommand;
let SetPopupModelCommand = class SetPopupModelCommand extends command_1.PopupCommand {

@@ -93,4 +93,5 @@ constructor(action) {

};
exports.SetPopupModelCommand = SetPopupModelCommand;
SetPopupModelCommand.KIND = actions_1.SetPopupModelAction.KIND;
SetPopupModelCommand = __decorate([
exports.SetPopupModelCommand = SetPopupModelCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -100,3 +101,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], SetPopupModelCommand);
exports.SetPopupModelCommand = SetPopupModelCommand;
class AbstractHoverMouseListener extends mouse_tool_1.MouseListener {

@@ -134,2 +134,3 @@ mouseDown(target, event) {

}
exports.AbstractHoverMouseListener = AbstractHoverMouseListener;
__decorate([

@@ -143,3 +144,2 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], AbstractHoverMouseListener.prototype, "state", void 0);
exports.AbstractHoverMouseListener = AbstractHoverMouseListener;
let HoverMouseListener = class HoverMouseListener extends AbstractHoverMouseListener {

@@ -267,2 +267,3 @@ computePopupBounds(target, mousePosition) {

};
exports.HoverMouseListener = HoverMouseListener;
__decorate([

@@ -272,6 +273,5 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], HoverMouseListener.prototype, "options", void 0);
HoverMouseListener = __decorate([
exports.HoverMouseListener = HoverMouseListener = __decorate([
(0, inversify_1.injectable)()
], HoverMouseListener);
exports.HoverMouseListener = HoverMouseListener;
let PopupHoverMouseListener = class PopupHoverMouseListener extends AbstractHoverMouseListener {

@@ -287,6 +287,6 @@ mouseOut(target, event) {

};
PopupHoverMouseListener = __decorate([
exports.PopupHoverMouseListener = PopupHoverMouseListener;
exports.PopupHoverMouseListener = PopupHoverMouseListener = __decorate([
(0, inversify_1.injectable)()
], PopupHoverMouseListener);
exports.PopupHoverMouseListener = PopupHoverMouseListener;
class HoverKeyListener extends key_tool_1.KeyListener {

@@ -314,57 +314,6 @@ keyDown(element, event) {

};
ClosePopupActionHandler = __decorate([
exports.ClosePopupActionHandler = ClosePopupActionHandler;
exports.ClosePopupActionHandler = ClosePopupActionHandler = __decorate([
(0, inversify_1.injectable)()
], ClosePopupActionHandler);
exports.ClosePopupActionHandler = ClosePopupActionHandler;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
var HoverFeedbackAction;
(function (HoverFeedbackAction) {
HoverFeedbackAction.KIND = 'hoverFeedback';
function create(options) {
return {
kind: HoverFeedbackAction.KIND,
mouseoverElement: options.mouseoverElement,
mouseIsOver: options.mouseIsOver
};
}
HoverFeedbackAction.create = create;
})(HoverFeedbackAction = exports.HoverFeedbackAction || (exports.HoverFeedbackAction = {}));
/**
* Triggered when the user hovers the mouse pointer over an element to get a popup with details on
* that element. This action is sent from the client to the model source, e.g. a DiagramServer.
* The response is a SetPopupModelAction.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class RequestPopupModelAction {
constructor(elementId, bounds, requestId = '') {
this.elementId = elementId;
this.bounds = bounds;
this.requestId = requestId;
this.kind = RequestPopupModelAction.KIND;
}
/** Factory function to dispatch a request with the `IActionDispatcher` */
static create(elementId, bounds) {
return new RequestPopupModelAction(elementId, bounds, (0, actions_1.generateRequestId)());
}
}
RequestPopupModelAction.KIND = 'requestPopupModel';
exports.RequestPopupModelAction = RequestPopupModelAction;
/**
* Sent from the model source to the client to display a popup in response to a RequestPopupModelAction.
* This action can also be used to remove any existing popup by choosing EMPTY_ROOT as root element.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class SetPopupModelAction {
constructor(newRoot, responseId = '') {
this.newRoot = newRoot;
this.responseId = responseId;
this.kind = SetPopupModelAction.KIND;
}
}
SetPopupModelAction.KIND = 'setPopupModel';
exports.SetPopupModelAction = SetPopupModelAction;
//# sourceMappingURL=hover.js.map

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

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
export declare const hoverFeedbackFeature: unique symbol;
export interface Hoverable extends SModelExtension {
/**
* Feature extension interface for {@link hoverFeedbackFeature}.
*/
export interface Hoverable {
hoverFeedback: boolean;

@@ -22,0 +24,0 @@ }

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

};
exports.PopupPositionUpdater = PopupPositionUpdater;
__decorate([

@@ -58,6 +59,5 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], PopupPositionUpdater.prototype, "options", void 0);
PopupPositionUpdater = __decorate([
exports.PopupPositionUpdater = PopupPositionUpdater = __decorate([
(0, inversify_1.injectable)()
], PopupPositionUpdater);
exports.PopupPositionUpdater = PopupPositionUpdater;
//# sourceMappingURL=popup-position-updater.js.map

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

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
export declare const moveFeature: unique symbol;

@@ -24,4 +23,6 @@ /**

* property.
*
* Feature extension interface for {@link moveFeature}.
*/
export interface Locateable extends SModelExtension {
export interface Locateable {
position: Point;

@@ -28,0 +29,0 @@ }

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

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

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

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

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

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

@@ -98,3 +98,3 @@ protected resolveHandleMove(handle: SRoutingHandleImpl, edge: SRoutableElementImpl, move: ElementMove): ResolvedHandleMove | undefined;

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

@@ -113,19 +113,3 @@ protected snap(position: Point, element: SModelElementImpl, isSnap: boolean): Point;

}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface MoveAction extends Action {
kind: typeof MoveAction.KIND;
moves: ElementMove[];
animate: boolean;
finished: boolean;
}
export declare namespace MoveAction {
const KIND = "move";
function create(moves: ElementMove[], options?: {
animate?: boolean;
finished?: boolean;
}): MoveAction;
}
export {};
//# sourceMappingURL=move.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.MoveAction = exports.LocationPostprocessor = exports.MoveMouseListener = exports.MorphEdgesAnimation = exports.MoveAnimation = exports.MoveCommand = void 0;
exports.LocationPostprocessor = exports.MoveMouseListener = exports.MorphEdgesAnimation = exports.MoveAnimation = exports.MoveCommand = void 0;
const inversify_1 = require("inversify");

@@ -226,2 +226,3 @@ const geometry_1 = require("sprotty-protocol/lib/utils/geometry");

};
exports.MoveCommand = MoveCommand;
MoveCommand.KIND = actions_1.MoveAction.KIND;

@@ -233,3 +234,3 @@ __decorate([

], MoveCommand.prototype, "edgeRouterRegistry", void 0);
MoveCommand = MoveCommand_1 = __decorate([
exports.MoveCommand = MoveCommand = MoveCommand_1 = __decorate([
(0, inversify_1.injectable)(),

@@ -239,3 +240,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], MoveCommand);
exports.MoveCommand = MoveCommand;
class MoveAnimation extends animation_1.Animation {

@@ -562,2 +562,3 @@ constructor(model, elementMoves, context, reverse = false) {

}
exports.MoveMouseListener = MoveMouseListener;
__decorate([

@@ -573,3 +574,2 @@ (0, inversify_1.inject)(routing_1.EdgeRouterRegistry),

], MoveMouseListener.prototype, "snapper", void 0);
exports.MoveMouseListener = MoveMouseListener;
let LocationPostprocessor = class LocationPostprocessor {

@@ -605,20 +605,6 @@ decorate(vnode, element) {

};
LocationPostprocessor = __decorate([
exports.LocationPostprocessor = LocationPostprocessor;
exports.LocationPostprocessor = LocationPostprocessor = __decorate([
(0, inversify_1.injectable)()
], LocationPostprocessor);
exports.LocationPostprocessor = LocationPostprocessor;
var MoveAction;
(function (MoveAction) {
MoveAction.KIND = 'move';
function create(moves, options = {}) {
var _a, _b;
return {
kind: MoveAction.KIND,
moves,
animate: (_a = options.animate) !== null && _a !== void 0 ? _a : true,
finished: (_b = options.finished) !== null && _b !== void 0 ? _b : false
};
}
MoveAction.create = create;
})(MoveAction = exports.MoveAction || (exports.MoveAction = {}));
//# sourceMappingURL=move.js.map

@@ -50,6 +50,6 @@ "use strict";

};
CenterGridSnapper = __decorate([
exports.CenterGridSnapper = CenterGridSnapper;
exports.CenterGridSnapper = CenterGridSnapper = __decorate([
(0, inversify_1.injectable)()
], CenterGridSnapper);
exports.CenterGridSnapper = CenterGridSnapper;
//# sourceMappingURL=snap.js.map

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

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
export declare const nameFeature: unique symbol;
export interface Nameable extends SModelExtension {
/**
* Feature extension interface for {@link nameableFeature}.
*/
export interface Nameable {
name: string;

@@ -22,0 +24,0 @@ }

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

import { SChildElementImpl, SModelRootImpl, SParentElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
/**

@@ -26,3 +25,3 @@ * Model elements implementing this interface can be displayed on a projection bar.

*/
export interface Projectable extends SModelExtension {
export interface Projectable {
projectionCssClasses: string[];

@@ -29,0 +28,0 @@ projectedBounds?: Bounds;

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

import { IView, IViewArgs, RenderingContext } from '../../base/views/view';
import { ViewportRootElement } from '../viewport/viewport-root';
import { ViewportRootElementImpl } from '../viewport/viewport-root';
import { ViewProjection } from './model';

@@ -26,8 +26,8 @@ /**

export declare class ProjectedViewportView implements IView {
render(model: Readonly<ViewportRootElement>, context: RenderingContext, args?: IViewArgs): VNode;
protected renderSvg(model: Readonly<ViewportRootElement>, context: RenderingContext, args?: IViewArgs): VNode;
protected renderProjections(model: Readonly<ViewportRootElement>, context: RenderingContext, args?: IViewArgs): VNode[];
protected renderProjectionBar(projections: ViewProjection[], model: Readonly<ViewportRootElement>, modelBounds: Bounds, orientation: 'horizontal' | 'vertical'): VNode;
protected renderViewport(model: Readonly<ViewportRootElement>, params: ProjectionParams): VNode;
protected renderProjection(projection: ViewProjection, model: Readonly<ViewportRootElement>, params: ProjectionParams): VNode;
render(model: Readonly<ViewportRootElementImpl>, context: RenderingContext, args?: IViewArgs): VNode;
protected renderSvg(model: Readonly<ViewportRootElementImpl>, context: RenderingContext, args?: IViewArgs): VNode;
protected renderProjections(model: Readonly<ViewportRootElementImpl>, context: RenderingContext, args?: IViewArgs): VNode[];
protected renderProjectionBar(projections: ViewProjection[], model: Readonly<ViewportRootElementImpl>, modelBounds: Bounds, orientation: 'horizontal' | 'vertical'): VNode;
protected renderViewport(model: Readonly<ViewportRootElementImpl>, params: ProjectionParams): VNode;
protected renderProjection(projection: ViewProjection, model: Readonly<ViewportRootElementImpl>, params: ProjectionParams): VNode;
}

@@ -34,0 +34,0 @@ export type ProjectionParams = {

@@ -141,6 +141,6 @@ "use strict";

};
ProjectedViewportView = __decorate([
exports.ProjectedViewportView = ProjectedViewportView;
exports.ProjectedViewportView = ProjectedViewportView = __decorate([
(0, inversify_1.injectable)()
], ProjectedViewportView);
exports.ProjectedViewportView = ProjectedViewportView;
//# sourceMappingURL=views.js.map

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

Side[Side["BOTTOM"] = 3] = "BOTTOM";
})(Side = exports.Side || (exports.Side = {}));
})(Side || (exports.Side = Side = {}));
class DefaultAnchors {

@@ -354,2 +354,3 @@ constructor(element, edgeParent, kind) {

};
exports.AbstractEdgeRouter = AbstractEdgeRouter;
__decorate([

@@ -359,6 +360,5 @@ (0, inversify_1.inject)(anchor_1.AnchorComputerRegistry),

], AbstractEdgeRouter.prototype, "anchorRegistry", void 0);
AbstractEdgeRouter = __decorate([
exports.AbstractEdgeRouter = AbstractEdgeRouter = __decorate([
(0, inversify_1.injectable)()
], AbstractEdgeRouter);
exports.AbstractEdgeRouter = AbstractEdgeRouter;
//# sourceMappingURL=abstract-edge-router.js.map

@@ -49,3 +49,4 @@ "use strict";

};
AnchorComputerRegistry = __decorate([
exports.AnchorComputerRegistry = AnchorComputerRegistry;
exports.AnchorComputerRegistry = AnchorComputerRegistry = __decorate([
(0, inversify_1.injectable)(),

@@ -55,3 +56,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.IAnchorComputer)),

], AnchorComputerRegistry);
exports.AnchorComputerRegistry = AnchorComputerRegistry;
//# sourceMappingURL=anchor.js.map

@@ -34,6 +34,6 @@ "use strict";

};
BezierEllipseAnchor = __decorate([
exports.BezierEllipseAnchor = BezierEllipseAnchor;
exports.BezierEllipseAnchor = BezierEllipseAnchor = __decorate([
(0, inversify_1.injectable)()
], BezierEllipseAnchor);
exports.BezierEllipseAnchor = BezierEllipseAnchor;
let BezierRectangleAnchor = class BezierRectangleAnchor extends polyline_anchors_1.RectangleAnchor {

@@ -44,6 +44,6 @@ get kind() {

};
BezierRectangleAnchor = __decorate([
exports.BezierRectangleAnchor = BezierRectangleAnchor;
exports.BezierRectangleAnchor = BezierRectangleAnchor = __decorate([
(0, inversify_1.injectable)()
], BezierRectangleAnchor);
exports.BezierRectangleAnchor = BezierRectangleAnchor;
let BezierDiamondAnchor = class BezierDiamondAnchor extends polyline_anchors_1.DiamondAnchor {

@@ -54,6 +54,6 @@ get kind() {

};
BezierDiamondAnchor = __decorate([
exports.BezierDiamondAnchor = BezierDiamondAnchor;
exports.BezierDiamondAnchor = BezierDiamondAnchor = __decorate([
(0, inversify_1.injectable)()
], BezierDiamondAnchor);
exports.BezierDiamondAnchor = BezierDiamondAnchor;
//# sourceMappingURL=bezier-anchors.js.map

@@ -298,8 +298,8 @@ "use strict";

};
exports.BezierEdgeRouter = BezierEdgeRouter;
BezierEdgeRouter.KIND = 'bezier';
BezierEdgeRouter.DEFAULT_BEZIER_HANDLE_OFFSET = 25;
BezierEdgeRouter = BezierEdgeRouter_1 = __decorate([
exports.BezierEdgeRouter = BezierEdgeRouter = BezierEdgeRouter_1 = __decorate([
(0, inversify_1.injectable)()
], BezierEdgeRouter);
exports.BezierEdgeRouter = BezierEdgeRouter;
/**

@@ -335,3 +335,3 @@ * Reacts on mouseDown events if the target kind is bezier-add or bezier-remove

AddRemoveBezierSegmentAction.create = create;
})(AddRemoveBezierSegmentAction = exports.AddRemoveBezierSegmentAction || (exports.AddRemoveBezierSegmentAction = {}));
})(AddRemoveBezierSegmentAction || (exports.AddRemoveBezierSegmentAction = AddRemoveBezierSegmentAction = {}));
let AddRemoveBezierSegmentCommand = class AddRemoveBezierSegmentCommand extends command_1.Command {

@@ -372,4 +372,5 @@ constructor(action, edgeRouterRegistry) {

};
exports.AddRemoveBezierSegmentCommand = AddRemoveBezierSegmentCommand;
AddRemoveBezierSegmentCommand.KIND = AddRemoveBezierSegmentAction.KIND;
AddRemoveBezierSegmentCommand = __decorate([
exports.AddRemoveBezierSegmentCommand = AddRemoveBezierSegmentCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -380,3 +381,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], AddRemoveBezierSegmentCommand);
exports.AddRemoveBezierSegmentCommand = AddRemoveBezierSegmentCommand;
//# sourceMappingURL=bezier-edge-router.js.map

@@ -61,7 +61,7 @@ "use strict";

};
exports.ManhattanRectangularAnchor = ManhattanRectangularAnchor;
ManhattanRectangularAnchor.KIND = manhattan_edge_router_1.ManhattanEdgeRouter.KIND + ':' + anchor_1.RECTANGULAR_ANCHOR_KIND;
ManhattanRectangularAnchor = ManhattanRectangularAnchor_1 = __decorate([
exports.ManhattanRectangularAnchor = ManhattanRectangularAnchor = ManhattanRectangularAnchor_1 = __decorate([
(0, inversify_1.injectable)()
], ManhattanRectangularAnchor);
exports.ManhattanRectangularAnchor = ManhattanRectangularAnchor;
let ManhattanDiamondAnchor = ManhattanDiamondAnchor_1 = class ManhattanDiamondAnchor {

@@ -123,7 +123,7 @@ get kind() {

};
exports.ManhattanDiamondAnchor = ManhattanDiamondAnchor;
ManhattanDiamondAnchor.KIND = manhattan_edge_router_1.ManhattanEdgeRouter.KIND + ':' + anchor_1.DIAMOND_ANCHOR_KIND;
ManhattanDiamondAnchor = ManhattanDiamondAnchor_1 = __decorate([
exports.ManhattanDiamondAnchor = ManhattanDiamondAnchor = ManhattanDiamondAnchor_1 = __decorate([
(0, inversify_1.injectable)()
], ManhattanDiamondAnchor);
exports.ManhattanDiamondAnchor = ManhattanDiamondAnchor;
let ManhattanEllipticAnchor = ManhattanEllipticAnchor_1 = class ManhattanEllipticAnchor {

@@ -167,7 +167,7 @@ get kind() {

};
exports.ManhattanEllipticAnchor = ManhattanEllipticAnchor;
ManhattanEllipticAnchor.KIND = manhattan_edge_router_1.ManhattanEdgeRouter.KIND + ':' + anchor_1.ELLIPTIC_ANCHOR_KIND;
ManhattanEllipticAnchor = ManhattanEllipticAnchor_1 = __decorate([
exports.ManhattanEllipticAnchor = ManhattanEllipticAnchor = ManhattanEllipticAnchor_1 = __decorate([
(0, inversify_1.injectable)()
], ManhattanEllipticAnchor);
exports.ManhattanEllipticAnchor = ManhattanEllipticAnchor;
//# sourceMappingURL=manhattan-anchors.js.map

@@ -497,4 +497,4 @@ "use strict";

}
exports.ManhattanEdgeRouter = ManhattanEdgeRouter;
ManhattanEdgeRouter.KIND = 'manhattan';
exports.ManhattanEdgeRouter = ManhattanEdgeRouter;
//# sourceMappingURL=manhattan-edge-router.js.map

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

import { SChildElementImpl, SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
import { FluentIterable } from '../../utils/iterable';

@@ -36,3 +35,6 @@ import { SShapeElementImpl } from '../bounds/model';

export declare const connectableFeature: unique symbol;
export interface Connectable extends SModelExtension {
/**
* Feature extension interface for {@link connectableFeature}.
*/
export interface Connectable {
canConnect(routable: SRoutableElementImpl, role: 'source' | 'target'): boolean;

@@ -93,10 +95,2 @@ }

export declare const edgeInProgressTargetHandleID: string;
/** @deprecated Use `SRoutableElementImpl` instead. */
export declare const SRoutableElement: typeof SRoutableElementImpl;
/** @deprecated Use `SConnectableElementImpl` instead. */
export declare const SConnectableElement: typeof SConnectableElementImpl;
/** @deprecated Use `SRoutingHandleImpl` instead. */
export declare const SRoutingHandle: typeof SRoutingHandleImpl;
/** @deprecated Use `SDanglingAnchorImpl` instead. */
export declare const SDanglingAnchor: typeof SDanglingAnchorImpl;
//# sourceMappingURL=model.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.SDanglingAnchor = exports.SRoutingHandle = exports.SConnectableElement = exports.SRoutableElement = exports.edgeInProgressTargetHandleID = exports.edgeInProgressID = exports.SDanglingAnchorImpl = exports.SRoutingHandleImpl = exports.SConnectableElementImpl = exports.getRouteBounds = exports.getAbsoluteRouteBounds = exports.isConnectable = exports.connectableFeature = exports.SRoutableElementImpl = void 0;
exports.edgeInProgressTargetHandleID = exports.edgeInProgressID = exports.SDanglingAnchorImpl = exports.SRoutingHandleImpl = exports.SConnectableElementImpl = exports.getRouteBounds = exports.getAbsoluteRouteBounds = exports.isConnectable = exports.connectableFeature = exports.SRoutableElementImpl = void 0;
const geometry_1 = require("sprotty-protocol/lib/utils/geometry");

@@ -142,4 +142,4 @@ const smodel_1 = require("../../base/model/smodel");

}
exports.SRoutingHandleImpl = SRoutingHandleImpl;
SRoutingHandleImpl.DEFAULT_FEATURES = [model_2.selectFeature, model_4.moveFeature, model_3.hoverFeedbackFeature];
exports.SRoutingHandleImpl = SRoutingHandleImpl;
class SDanglingAnchorImpl extends SConnectableElementImpl {

@@ -152,15 +152,6 @@ constructor() {

}
exports.SDanglingAnchorImpl = SDanglingAnchorImpl;
SDanglingAnchorImpl.DEFAULT_FEATURES = [delete_1.deletableFeature];
exports.SDanglingAnchorImpl = SDanglingAnchorImpl;
exports.edgeInProgressID = 'edge-in-progress';
exports.edgeInProgressTargetHandleID = exports.edgeInProgressID + '-target-anchor';
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/** @deprecated Use `SRoutableElementImpl` instead. */
exports.SRoutableElement = SRoutableElementImpl;
/** @deprecated Use `SConnectableElementImpl` instead. */
exports.SConnectableElement = SConnectableElementImpl;
/** @deprecated Use `SRoutingHandleImpl` instead. */
exports.SRoutingHandle = SRoutingHandleImpl;
/** @deprecated Use `SDanglingAnchorImpl` instead. */
exports.SDanglingAnchor = SDanglingAnchorImpl;
//# sourceMappingURL=model.js.map

@@ -48,6 +48,6 @@ "use strict";

};
EllipseAnchor = __decorate([
exports.EllipseAnchor = EllipseAnchor;
exports.EllipseAnchor = EllipseAnchor = __decorate([
(0, inversify_1.injectable)()
], EllipseAnchor);
exports.EllipseAnchor = EllipseAnchor;
let RectangleAnchor = class RectangleAnchor {

@@ -88,6 +88,6 @@ get kind() {

};
RectangleAnchor = __decorate([
exports.RectangleAnchor = RectangleAnchor;
exports.RectangleAnchor = RectangleAnchor = __decorate([
(0, inversify_1.injectable)()
], RectangleAnchor);
exports.RectangleAnchor = RectangleAnchor;
class NearestPointFinder {

@@ -130,6 +130,6 @@ constructor(centerPoint, refPoint) {

};
DiamondAnchor = __decorate([
exports.DiamondAnchor = DiamondAnchor;
exports.DiamondAnchor = DiamondAnchor = __decorate([
(0, inversify_1.injectable)()
], DiamondAnchor);
exports.DiamondAnchor = DiamondAnchor;
//# sourceMappingURL=polyline-anchors.js.map

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

};
exports.PolylineEdgeRouter = PolylineEdgeRouter;
PolylineEdgeRouter.KIND = 'polyline';

@@ -164,6 +165,5 @@ __decorate([

], PolylineEdgeRouter.prototype, "anchorRegistry", void 0);
PolylineEdgeRouter = PolylineEdgeRouter_1 = __decorate([
exports.PolylineEdgeRouter = PolylineEdgeRouter = PolylineEdgeRouter_1 = __decorate([
(0, inversify_1.injectable)()
], PolylineEdgeRouter);
exports.PolylineEdgeRouter = PolylineEdgeRouter;
//# sourceMappingURL=polyline-edge-router.js.map

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

};
exports.EdgeRouterRegistry = EdgeRouterRegistry;
__decorate([

@@ -129,3 +130,3 @@ (0, inversify_1.multiInject)(types_1.TYPES.IEdgeRoutePostprocessor),

], EdgeRouterRegistry.prototype, "postProcessors", void 0);
EdgeRouterRegistry = __decorate([
exports.EdgeRouterRegistry = EdgeRouterRegistry = __decorate([
(0, inversify_1.injectable)(),

@@ -135,3 +136,2 @@ __param(0, (0, inversify_1.multiInject)(types_1.TYPES.IEdgeRouter)),

], EdgeRouterRegistry);
exports.EdgeRouterRegistry = EdgeRouterRegistry;
/**

@@ -138,0 +138,0 @@ * Map of edges and their computed routes.

@@ -50,6 +50,6 @@ "use strict";

};
RoutableView = __decorate([
exports.RoutableView = RoutableView;
exports.RoutableView = RoutableView = __decorate([
(0, inversify_1.injectable)()
], RoutableView);
exports.RoutableView = RoutableView;
//# sourceMappingURL=views.js.map

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

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
export declare const selectFeature: unique symbol;
export interface Selectable extends SModelExtension {
/**
* Feature extension interface for {@link selectFeature}.
*/
export interface Selectable {
selected: boolean;

@@ -22,0 +24,0 @@ }

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

import { VNode } from 'snabbdom';
import { Action, RequestAction, ResponseAction } from 'sprotty-protocol/lib/actions';
import * as protocol from "sprotty-protocol/lib/actions";
import { Action, GetSelectionAction, ResponseAction, SelectAction, SelectAllAction } from 'sprotty-protocol/lib/actions';
import { Command, CommandExecutionContext } from '../../base/commands/command';

@@ -28,7 +27,7 @@ import { ModelRequestCommand } from '../../base/commands/request-command';

export declare class SelectCommand extends Command {
action: protocol.SelectAction;
action: SelectAction;
static readonly KIND = "elementSelected";
protected selected: (SChildElementImpl & Selectable)[];
protected deselected: (SChildElementImpl & Selectable)[];
constructor(action: protocol.SelectAction);
constructor(action: SelectAction);
execute(context: CommandExecutionContext): SModelRootImpl;

@@ -39,6 +38,6 @@ undo(context: CommandExecutionContext): SModelRootImpl;

export declare class SelectAllCommand extends Command {
protected readonly action: protocol.SelectAllAction;
protected readonly action: SelectAllAction;
static readonly KIND = "allSelected";
protected previousSelection: Record<string, boolean>;
constructor(action: protocol.SelectAllAction);
constructor(action: SelectAllAction);
execute(context: CommandExecutionContext): SModelRootImpl;

@@ -64,6 +63,6 @@ protected selectAll(element: SParentElementImpl, newState: boolean): void;

export declare class GetSelectionCommand extends ModelRequestCommand {
protected readonly action: protocol.GetSelectionAction;
protected readonly action: GetSelectionAction;
static readonly KIND = "getSelection";
protected previousSelection: Record<string, boolean>;
constructor(action: protocol.GetSelectionAction);
constructor(action: GetSelectionAction);
protected retrieveResult(context: CommandExecutionContext): ResponseAction;

@@ -74,53 +73,2 @@ }

}
/**
* Triggered when the user changes the selection, e.g. by clicking on a selectable element. The resulting
* SelectCommand changes the `selected` state accordingly, so the elements can be rendered differently.
* This action is also forwarded to the diagram server, if present, so it may react on the selection change.
* Furthermore, the server can send such an action to the client in order to change the selection programmatically.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class SelectAction implements Action, protocol.SelectAction {
readonly selectedElementsIDs: string[];
readonly deselectedElementsIDs: string[];
static readonly KIND = "elementSelected";
readonly kind = "elementSelected";
constructor(selectedElementsIDs?: string[], deselectedElementsIDs?: string[]);
}
/**
* Programmatic action for selecting or deselecting all elements.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class SelectAllAction implements Action, protocol.SelectAllAction {
readonly select: boolean;
static readonly KIND = "allSelected";
readonly kind = "allSelected";
/**
* If `select` is true, all elements are selected, otherwise they are deselected.
*/
constructor(select?: boolean);
}
/**
* Request action for retrieving the current selection.
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface GetSelectionAction extends RequestAction<SelectionResult> {
kind: typeof GetSelectionAction.KIND;
}
export declare namespace GetSelectionAction {
const KIND = "getSelection";
function create(): GetSelectionAction;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface SelectionResult extends ResponseAction {
kind: typeof SelectionResult.KIND;
selectedElementsIDs: string[];
}
export declare namespace SelectionResult {
const KIND = "selectionResult";
function create(selectedElementsIDs: string[], requestId: string): SelectionResult;
}
//# sourceMappingURL=select.d.ts.map

@@ -17,18 +17,2 @@ "use strict";

********************************************************************************/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

@@ -40,9 +24,2 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __metadata = (this && this.__metadata) || function (k, v) {

@@ -55,6 +32,5 @@ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);

Object.defineProperty(exports, "__esModule", { value: true });
exports.SelectionResult = exports.GetSelectionAction = exports.SelectAllAction = exports.SelectAction = exports.SelectKeyboardListener = exports.GetSelectionCommand = exports.SelectMouseListener = exports.SelectAllCommand = exports.SelectCommand = void 0;
exports.SelectKeyboardListener = exports.GetSelectionCommand = exports.SelectMouseListener = exports.SelectAllCommand = exports.SelectCommand = void 0;
const inversify_1 = require("inversify");
const actions_1 = require("sprotty-protocol/lib/actions");
const protocol = __importStar(require("sprotty-protocol/lib/actions"));
const command_1 = require("../../base/commands/command");

@@ -120,4 +96,5 @@ const request_command_1 = require("../../base/commands/request-command");

};
SelectCommand.KIND = protocol.SelectAction.KIND;
SelectCommand = __decorate([
exports.SelectCommand = SelectCommand;
SelectCommand.KIND = actions_1.SelectAction.KIND;
exports.SelectCommand = SelectCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -127,3 +104,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], SelectCommand);
exports.SelectCommand = SelectCommand;
let SelectAllCommand = class SelectAllCommand extends command_1.Command {

@@ -162,4 +138,5 @@ constructor(action) {

};
SelectAllCommand.KIND = protocol.SelectAllAction.KIND;
SelectAllCommand = __decorate([
exports.SelectAllCommand = SelectAllCommand;
SelectAllCommand.KIND = actions_1.SelectAllAction.KIND;
exports.SelectAllCommand = SelectAllCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -169,3 +146,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], SelectAllCommand);
exports.SelectAllCommand = SelectAllCommand;
class SelectMouseListener extends mouse_tool_1.MouseListener {

@@ -230,3 +206,3 @@ constructor() {

const result = [];
result.push(protocol.SelectAction.create({ selectedElementsIDs: [selectableTarget.id], deselectedElementsIDs: 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]));

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

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

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

const result = [];
result.push(protocol.SelectAction.create({ selectedElementsIDs: [], deselectedElementsIDs: 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.SRoutableElementImpl).map(e => e.id);

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

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

@@ -292,2 +268,3 @@ }

}
exports.SelectMouseListener = SelectMouseListener;
__decorate([

@@ -298,3 +275,2 @@ (0, inversify_1.inject)(button_handler_1.ButtonHandlerRegistry),

], SelectMouseListener.prototype, "buttonHandlerRegistry", void 0);
exports.SelectMouseListener = SelectMouseListener;
let GetSelectionCommand = class GetSelectionCommand extends request_command_1.ModelRequestCommand {

@@ -310,7 +286,8 @@ constructor(action) {

.map(e => e.id);
return SelectionResult.create((0, iterable_1.toArray)(selection), this.action.requestId);
return actions_1.SelectionResult.create((0, iterable_1.toArray)(selection), this.action.requestId);
}
};
GetSelectionCommand.KIND = protocol.GetSelectionAction.KIND;
GetSelectionCommand = __decorate([
exports.GetSelectionCommand = GetSelectionCommand;
GetSelectionCommand.KIND = actions_1.GetSelectionAction.KIND;
exports.GetSelectionCommand = GetSelectionCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -320,7 +297,6 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], GetSelectionCommand);
exports.GetSelectionCommand = GetSelectionCommand;
class SelectKeyboardListener extends key_tool_1.KeyListener {
keyDown(element, event) {
if ((0, keyboard_1.matchesKeystroke)(event, 'KeyA', 'ctrlCmd')) {
return [protocol.SelectAllAction.create()];
return [actions_1.SelectAllAction.create()];
}

@@ -331,59 +307,2 @@ return [];

exports.SelectKeyboardListener = SelectKeyboardListener;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Triggered when the user changes the selection, e.g. by clicking on a selectable element. The resulting
* SelectCommand changes the `selected` state accordingly, so the elements can be rendered differently.
* This action is also forwarded to the diagram server, if present, so it may react on the selection change.
* Furthermore, the server can send such an action to the client in order to change the selection programmatically.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class SelectAction {
constructor(selectedElementsIDs = [], deselectedElementsIDs = []) {
this.selectedElementsIDs = selectedElementsIDs;
this.deselectedElementsIDs = deselectedElementsIDs;
this.kind = SelectAction.KIND;
}
}
SelectAction.KIND = 'elementSelected';
exports.SelectAction = SelectAction;
/**
* Programmatic action for selecting or deselecting all elements.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class SelectAllAction {
/**
* If `select` is true, all elements are selected, otherwise they are deselected.
*/
constructor(select = true) {
this.select = select;
this.kind = SelectAllAction.KIND;
}
}
SelectAllAction.KIND = 'allSelected';
exports.SelectAllAction = SelectAllAction;
var GetSelectionAction;
(function (GetSelectionAction) {
GetSelectionAction.KIND = 'getSelection';
function create() {
return {
kind: GetSelectionAction.KIND,
requestId: (0, actions_1.generateRequestId)()
};
}
GetSelectionAction.create = create;
})(GetSelectionAction = exports.GetSelectionAction || (exports.GetSelectionAction = {}));
var SelectionResult;
(function (SelectionResult) {
SelectionResult.KIND = 'selectionResult';
function create(selectedElementsIDs, requestId) {
return {
kind: SelectionResult.KIND,
selectedElementsIDs,
responseId: requestId
};
}
SelectionResult.create = create;
})(SelectionResult = exports.SelectionResult || (exports.SelectionResult = {}));
//# sourceMappingURL=select.js.map

@@ -22,22 +22,2 @@ /********************************************************************************

}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface UndoAction extends Action {
kind: typeof UndoAction.KIND;
}
export declare namespace UndoAction {
const KIND = "undo";
function create(): UndoAction;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface RedoAction extends Action {
kind: typeof RedoAction.KIND;
}
export declare namespace RedoAction {
const KIND = "redo";
function create(): RedoAction;
}
//# sourceMappingURL=undo-redo.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.RedoAction = exports.UndoAction = exports.UndoRedoKeyListener = void 0;
exports.UndoRedoKeyListener = void 0;
const actions_1 = require("sprotty-protocol/lib/actions");

@@ -34,22 +34,2 @@ const keyboard_1 = require("../../utils/keyboard");

exports.UndoRedoKeyListener = UndoRedoKeyListener;
var UndoAction;
(function (UndoAction) {
UndoAction.KIND = 'undo';
function create() {
return {
kind: UndoAction.KIND
};
}
UndoAction.create = create;
})(UndoAction = exports.UndoAction || (exports.UndoAction = {}));
var RedoAction;
(function (RedoAction) {
RedoAction.KIND = 'redo';
function create() {
return {
kind: RedoAction.KIND
};
}
RedoAction.create = create;
})(RedoAction = exports.RedoAction || (exports.RedoAction = {}));
//# sourceMappingURL=undo-redo.js.map

@@ -16,7 +16,7 @@ /********************************************************************************

********************************************************************************/
import { SModelElement as SModelElementSchema, SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { SModelElement, SModelRoot } from 'sprotty-protocol/lib/model';
import { SModelRootImpl, SModelElementImpl, IModelIndex } from '../../base/model/smodel';
export interface Match {
left?: SModelElementSchema;
right?: SModelElementSchema;
left?: SModelElement;
right?: SModelElement;
leftParentId?: string;

@@ -30,7 +30,7 @@ rightParentId?: string;

export declare class ModelMatcher {
match(left: SModelRootSchema | SModelRootImpl, right: SModelRootSchema | SModelRootImpl): MatchResult;
protected matchLeft(element: SModelElementSchema | SModelElementImpl, result: MatchResult, parentId?: string): void;
protected matchRight(element: SModelElementSchema | SModelElementImpl, result: MatchResult, parentId?: string): void;
match(left: SModelRoot | SModelRootImpl, right: SModelRoot | SModelRootImpl): MatchResult;
protected matchLeft(element: SModelElement | SModelElementImpl, result: MatchResult, parentId?: string): void;
protected matchRight(element: SModelElement | SModelElementImpl, result: MatchResult, parentId?: string): void;
}
export declare function applyMatches(root: SModelRootSchema, matches: Match[], index?: IModelIndex): void;
export declare function applyMatches(root: SModelRoot, matches: Match[], index?: IModelIndex): void;
//# sourceMappingURL=model-matching.d.ts.map

@@ -16,13 +16,12 @@ /********************************************************************************

********************************************************************************/
import { Action, UpdateModelAction as ProtocolUpdateModelAction } from "sprotty-protocol/lib/actions";
import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { UpdateModelAction } from 'sprotty-protocol/lib/actions';
import { Animation } from '../../base/animations/animation';
import { CommandExecutionContext, CommandReturn, Command } from '../../base/commands/command';
import { ResolvedElementFade } from '../fade/fade';
import { SModelRootImpl, SModelElementImpl } from "../../base/model/smodel";
import { ResolvedElementMove } from "../move/move";
import { MatchResult, Match } from "./model-matching";
import { SModelRootImpl, SModelElementImpl } from '../../base/model/smodel';
import { ResolvedElementMove } from '../move/move';
import { MatchResult, Match } from './model-matching';
import { ResolvedElementResize } from '../bounds/resize';
import { EdgeRouterRegistry, EdgeSnapshot, EdgeMemento } from "../routing/routing";
import { SRoutableElementImpl } from "../routing/model";
import { EdgeRouterRegistry, EdgeSnapshot, EdgeMemento } from '../routing/routing';
import { SRoutableElementImpl } from '../routing/model';
export interface UpdateAnimationData {

@@ -35,3 +34,3 @@ fades: ResolvedElementFade[];

export declare class UpdateModelCommand extends Command {
protected readonly action: ProtocolUpdateModelAction;
protected readonly action: UpdateModelAction;
static readonly KIND = "updateModel";

@@ -41,3 +40,3 @@ oldRoot: SModelRootImpl;

edgeRouterRegistry?: EdgeRouterRegistry;
constructor(action: ProtocolUpdateModelAction);
constructor(action: UpdateModelAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -54,17 +53,2 @@ protected performUpdate(oldRoot: SModelRootImpl, newRoot: SModelRootImpl, context: CommandExecutionContext): CommandReturn;

}
/**
* Sent from the model source to the client in order to update the model. If no model is present yet,
* this behaves the same as a SetModelAction. The transition from the old model to the new one can be animated.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class UpdateModelAction implements Action, ProtocolUpdateModelAction {
readonly animate: boolean;
readonly cause?: Action | undefined;
static readonly KIND = "updateModel";
readonly kind = "updateModel";
readonly newRoot?: SModelRootSchema;
readonly matches?: Match[];
constructor(input: SModelRootSchema | Match[], animate?: boolean, cause?: Action | undefined);
}
//# sourceMappingURL=update-model.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateModelAction = exports.UpdateModelCommand = void 0;
exports.UpdateModelCommand = void 0;
const inversify_1 = require("inversify");

@@ -244,3 +244,3 @@ const actions_1 = require("sprotty-protocol/lib/actions");

}
if (left instanceof viewport_root_1.ViewportRootElement && right instanceof viewport_root_1.ViewportRootElement) {
if (left instanceof viewport_root_1.ViewportRootElementImpl && right instanceof viewport_root_1.ViewportRootElementImpl) {
right.scroll = left.scroll;

@@ -285,2 +285,3 @@ right.zoom = left.zoom;

};
exports.UpdateModelCommand = UpdateModelCommand;
UpdateModelCommand.KIND = actions_1.UpdateModelAction.KIND;

@@ -292,3 +293,3 @@ __decorate([

], UpdateModelCommand.prototype, "edgeRouterRegistry", void 0);
UpdateModelCommand = __decorate([
exports.UpdateModelCommand = UpdateModelCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -298,23 +299,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], UpdateModelCommand);
exports.UpdateModelCommand = UpdateModelCommand;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Sent from the model source to the client in order to update the model. If no model is present yet,
* this behaves the same as a SetModelAction. The transition from the old model to the new one can be animated.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class UpdateModelAction {
constructor(input, animate = true, cause) {
this.animate = animate;
this.cause = cause;
this.kind = UpdateModelAction.KIND;
if (input.id !== undefined)
this.newRoot = input;
else
this.matches = input;
}
}
UpdateModelAction.KIND = 'updateModel';
exports.UpdateModelAction = UpdateModelAction;
//# sourceMappingURL=update-model.js.map

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

********************************************************************************/
import { Action, CenterAction as ProtocolCenterAction, FitToScreenAction as ProtocolFitToScreenAction } from 'sprotty-protocol/lib/actions';
import { Action, CenterAction, FitToScreenAction } from 'sprotty-protocol/lib/actions';
import { Viewport } from 'sprotty-protocol/lib/model';

@@ -40,5 +40,5 @@ import { Bounds } from 'sprotty-protocol/lib/utils/geometry';

export declare class CenterCommand extends BoundsAwareViewportCommand {
protected action: ProtocolCenterAction;
protected action: CenterAction;
static readonly KIND = "center";
constructor(action: ProtocolCenterAction);
constructor(action: CenterAction);
getElementIds(): string[];

@@ -48,5 +48,5 @@ getNewViewport(bounds: Bounds, model: SModelRootImpl): Viewport | undefined;

export declare class FitToScreenCommand extends BoundsAwareViewportCommand {
protected readonly action: ProtocolFitToScreenAction;
protected readonly action: FitToScreenAction;
static readonly KIND = "fit";
constructor(action: ProtocolFitToScreenAction);
constructor(action: FitToScreenAction);
getElementIds(): string[];

@@ -58,37 +58,2 @@ getNewViewport(bounds: Bounds, model: SModelRootImpl): Viewport | undefined;

}
/**
* Triggered when the user requests the viewer to center on the current model. The resulting
* CenterCommand changes the scroll setting of the viewport accordingly.
* It also resets the zoom to its default if retainZoom is false.
* This action can also be sent from the model source to the client in order to perform such a
* viewport change programmatically.
*
* @deprecated Use the declaration in `sprotty-protocol` instead.
*/
export declare class CenterAction implements Action, ProtocolCenterAction {
readonly elementIds: string[];
readonly animate: boolean;
readonly retainZoom: boolean;
readonly zoomScale?: number | undefined;
static readonly KIND = "center";
readonly kind = "center";
constructor(elementIds: string[], animate?: boolean, retainZoom?: boolean, zoomScale?: number | undefined);
}
/**
* Triggered when the user requests the viewer to fit its content to the available drawing area.
* The resulting FitToScreenCommand changes the zoom and scroll settings of the viewport so the model
* can be shown completely. This action can also be sent from the model source to the client in order
* to perform such a viewport change programmatically.
*
* @deprecated Use the declaration in `sprotty-protocol` instead.
*/
export declare class FitToScreenAction implements Action, ProtocolFitToScreenAction {
readonly elementIds: string[];
readonly padding?: number | undefined;
readonly maxZoom?: number | undefined;
readonly animate: boolean;
static readonly KIND = "fit";
readonly kind = "fit";
constructor(elementIds: string[], padding?: number | undefined, maxZoom?: number | undefined, animate?: boolean);
}
//# sourceMappingURL=center-fit.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.FitToScreenAction = exports.CenterAction = exports.CenterKeyboardListener = exports.FitToScreenCommand = exports.CenterCommand = exports.BoundsAwareViewportCommand = void 0;
exports.CenterKeyboardListener = exports.FitToScreenCommand = exports.CenterCommand = exports.BoundsAwareViewportCommand = void 0;
const actions_1 = require("sprotty-protocol/lib/actions");

@@ -128,2 +128,3 @@ const geometry_1 = require("sprotty-protocol/lib/utils/geometry");

};
exports.BoundsAwareViewportCommand = BoundsAwareViewportCommand;
__decorate([

@@ -133,7 +134,6 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], BoundsAwareViewportCommand.prototype, "viewerOptions", void 0);
BoundsAwareViewportCommand = __decorate([
exports.BoundsAwareViewportCommand = BoundsAwareViewportCommand = __decorate([
(0, inversify_1.injectable)(),
__metadata("design:paramtypes", [Boolean])
], BoundsAwareViewportCommand);
exports.BoundsAwareViewportCommand = BoundsAwareViewportCommand;
let CenterCommand = class CenterCommand extends BoundsAwareViewportCommand {

@@ -168,8 +168,8 @@ constructor(action) {

};
exports.CenterCommand = CenterCommand;
CenterCommand.KIND = actions_1.CenterAction.KIND;
CenterCommand = __decorate([
exports.CenterCommand = CenterCommand = __decorate([
__param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),
__metadata("design:paramtypes", [Object])
], CenterCommand);
exports.CenterCommand = CenterCommand;
let FitToScreenCommand = class FitToScreenCommand extends BoundsAwareViewportCommand {

@@ -206,8 +206,8 @@ constructor(action) {

};
exports.FitToScreenCommand = FitToScreenCommand;
FitToScreenCommand.KIND = actions_1.FitToScreenAction.KIND;
FitToScreenCommand = __decorate([
exports.FitToScreenCommand = FitToScreenCommand = __decorate([
__param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),
__metadata("design:paramtypes", [Object])
], FitToScreenCommand);
exports.FitToScreenCommand = FitToScreenCommand;
class CenterKeyboardListener extends key_tool_1.KeyListener {

@@ -223,42 +223,2 @@ keyDown(element, event) {

exports.CenterKeyboardListener = CenterKeyboardListener;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Triggered when the user requests the viewer to center on the current model. The resulting
* CenterCommand changes the scroll setting of the viewport accordingly.
* It also resets the zoom to its default if retainZoom is false.
* This action can also be sent from the model source to the client in order to perform such a
* viewport change programmatically.
*
* @deprecated Use the declaration in `sprotty-protocol` instead.
*/
class CenterAction {
constructor(elementIds, animate = true, retainZoom = false, zoomScale) {
this.elementIds = elementIds;
this.animate = animate;
this.retainZoom = retainZoom;
this.zoomScale = zoomScale;
this.kind = CenterAction.KIND;
}
}
CenterAction.KIND = 'center';
exports.CenterAction = CenterAction;
/**
* Triggered when the user requests the viewer to fit its content to the available drawing area.
* The resulting FitToScreenCommand changes the zoom and scroll settings of the viewport so the model
* can be shown completely. This action can also be sent from the model source to the client in order
* to perform such a viewport change programmatically.
*
* @deprecated Use the declaration in `sprotty-protocol` instead.
*/
class FitToScreenAction {
constructor(elementIds, padding, maxZoom, animate = true) {
this.elementIds = elementIds;
this.padding = padding;
this.maxZoom = maxZoom;
this.animate = animate;
this.kind = FitToScreenAction.KIND;
}
}
FitToScreenAction.KIND = 'fit';
exports.FitToScreenAction = FitToScreenAction;
//# sourceMappingURL=center-fit.js.map

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

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

@@ -25,12 +25,7 @@ import { Limits } from '../../utils/geometry';

*/
export declare function isViewport(element: SModelElementImpl): element is SModelRootImpl & ProtocolViewport;
export declare function isViewport(element: SModelElementImpl): element is SModelRootImpl & Viewport;
/**
* Apply limits to the given viewport.
*/
export declare function limitViewport(viewport: ProtocolViewport, canvasBounds: Bounds | undefined, horizontalScrollLimits: Limits | undefined, verticalScrollLimits: Limits | undefined, zoomLimits: Limits | undefined): ProtocolViewport;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Viewport extends Scrollable, Zoomable {
}
export declare function limitViewport(viewport: Viewport, canvasBounds: Bounds | undefined, horizontalScrollLimits: Limits | undefined, verticalScrollLimits: Limits | undefined, zoomLimits: Limits | undefined): Viewport;
//# sourceMappingURL=model.d.ts.map

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

import { MouseListener } from '../../base/views/mouse-tool';
import { SModelExtension } from '../../base/model/smodel-extension';
import { ViewerOptions } from '../../base/views/viewer-options';

@@ -42,12 +41,2 @@ export declare class ScrollMouseListener extends MouseListener {

export declare function findViewportScrollbar(event: MouseEvent): HTMLElement | undefined;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Scrollable extends SModelExtension {
scroll: Point;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function isScrollable(element: SModelElementImpl | Scrollable): element is Scrollable;
//# sourceMappingURL=scroll.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.isScrollable = exports.findViewportScrollbar = exports.ScrollMouseListener = void 0;
exports.findViewportScrollbar = exports.ScrollMouseListener = void 0;
const inversify_1 = require("inversify");

@@ -223,2 +223,3 @@ const actions_1 = require("sprotty-protocol/lib/actions");

}
exports.ScrollMouseListener = ScrollMouseListener;
__decorate([

@@ -228,3 +229,2 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], ScrollMouseListener.prototype, "viewerOptions", void 0);
exports.ScrollMouseListener = ScrollMouseListener;
function findViewportScrollbar(event) {

@@ -241,9 +241,2 @@ let element = event.target;

exports.findViewportScrollbar = findViewportScrollbar;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function isScrollable(element) {
return 'scroll' in element;
}
exports.isScrollable = isScrollable;
//# sourceMappingURL=scroll.js.map

@@ -16,12 +16,6 @@ /********************************************************************************

********************************************************************************/
import { SModelRoot as SModelRootSchema, Viewport } from 'sprotty-protocol/lib/model';
import { Viewport } from 'sprotty-protocol/lib/model';
import { Bounds, Dimension, Point } from 'sprotty-protocol/lib/utils/geometry';
import { SModelRootImpl, ModelIndexImpl } from '../../base/model/smodel';
import { BoundsAware } from "../bounds/model";
export interface ViewportRootElementSchema extends SModelRootSchema {
scroll?: Point;
zoom?: number;
position?: Point;
size?: Dimension;
}
/**

@@ -31,3 +25,3 @@ * Model root element that defines a viewport, so it transforms the coordinate system with

*/
export declare class ViewportRootElement extends SModelRootImpl implements Viewport, BoundsAware {
export declare class ViewportRootElementImpl extends SModelRootImpl implements Viewport, BoundsAware {
static readonly DEFAULT_FEATURES: symbol[];

@@ -34,0 +28,0 @@ scroll: Point;

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.ViewportRootElement = void 0;
exports.ViewportRootElementImpl = void 0;
const geometry_1 = require("sprotty-protocol/lib/utils/geometry");

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

*/
class ViewportRootElement extends smodel_1.SModelRootImpl {
class ViewportRootElementImpl extends smodel_1.SModelRootImpl {
constructor(index) {

@@ -82,4 +82,4 @@ super(index);

}
ViewportRootElement.DEFAULT_FEATURES = [model_1.viewportFeature, model_2.exportFeature];
exports.ViewportRootElement = ViewportRootElement;
exports.ViewportRootElementImpl = ViewportRootElementImpl;
ViewportRootElementImpl.DEFAULT_FEATURES = [model_1.viewportFeature, model_2.exportFeature];
//# sourceMappingURL=viewport-root.js.map

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

********************************************************************************/
import { Action, RequestAction, ResponseAction, SetViewportAction as ProtocolSetViewPortAction } from 'sprotty-protocol/lib/actions';
import { GetViewportAction, ResponseAction, SetViewportAction } from 'sprotty-protocol/lib/actions';
import { Viewport } from 'sprotty-protocol/lib/model';
import { Bounds } from 'sprotty-protocol/lib/utils/geometry';
import { SModelElementImpl, SModelRootImpl } from '../../base/model/smodel';

@@ -25,27 +24,4 @@ import { MergeableCommand, ICommand, CommandExecutionContext, CommandReturn } from '../../base/commands/command';

import { ViewerOptions } from '../../base/views/viewer-options';
/**
* Request action for retrieving the current viewport and canvas bounds.
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface GetViewportAction extends RequestAction<ViewportResult> {
kind: typeof GetViewportAction.KIND;
}
export declare namespace GetViewportAction {
const KIND = "getViewport";
function create(): GetViewportAction;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ViewportResult extends ResponseAction {
kind: typeof ViewportResult.KIND;
viewport: Viewport;
canvasBounds: Bounds;
}
export declare namespace ViewportResult {
const KIND = "viewportResult";
function create(viewport: Viewport, canvasBounds: Bounds, requestId: string): ViewportResult;
}
export declare class SetViewportCommand extends MergeableCommand {
protected readonly action: ProtocolSetViewPortAction;
protected readonly action: SetViewportAction;
static readonly KIND = "viewport";

@@ -56,3 +32,3 @@ protected viewerOptions: ViewerOptions;

protected newViewport: Viewport;
constructor(action: ProtocolSetViewPortAction);
constructor(action: SetViewportAction);
execute(context: CommandExecutionContext): CommandReturn;

@@ -79,13 +55,2 @@ protected setViewport(element: SModelElementImpl, oldViewport: Viewport, newViewport: Viewport, context: CommandExecutionContext): CommandReturn;

}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare class SetViewportAction implements Action, ProtocolSetViewPortAction {
readonly elementId: string;
readonly newViewport: Viewport;
readonly animate: boolean;
static readonly KIND = "viewport";
readonly kind = "viewport";
constructor(elementId: string, newViewport: Viewport, animate: boolean);
}
//# sourceMappingURL=viewport.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.SetViewportAction = exports.ViewportAnimation = exports.GetViewportCommand = exports.SetViewportCommand = exports.ViewportResult = exports.GetViewportAction = void 0;
exports.ViewportAnimation = exports.GetViewportCommand = exports.SetViewportCommand = void 0;
const inversify_1 = require("inversify");

@@ -41,26 +41,2 @@ const actions_1 = require("sprotty-protocol/lib/actions");

const request_command_1 = require("../../base/commands/request-command");
var GetViewportAction;
(function (GetViewportAction) {
GetViewportAction.KIND = 'getViewport';
function create() {
return {
kind: GetViewportAction.KIND,
requestId: (0, actions_1.generateRequestId)()
};
}
GetViewportAction.create = create;
})(GetViewportAction = exports.GetViewportAction || (exports.GetViewportAction = {}));
var ViewportResult;
(function (ViewportResult) {
ViewportResult.KIND = 'viewportResult';
function create(viewport, canvasBounds, requestId) {
return {
kind: ViewportResult.KIND,
viewport,
canvasBounds,
responseId: requestId
};
}
ViewportResult.create = create;
})(ViewportResult = exports.ViewportResult || (exports.ViewportResult = {}));
let SetViewportCommand = SetViewportCommand_1 = class SetViewportCommand extends command_1.MergeableCommand {

@@ -113,2 +89,3 @@ constructor(action) {

};
exports.SetViewportCommand = SetViewportCommand;
SetViewportCommand.KIND = actions_1.SetViewportAction.KIND;

@@ -119,3 +96,3 @@ __decorate([

], SetViewportCommand.prototype, "viewerOptions", void 0);
SetViewportCommand = SetViewportCommand_1 = __decorate([
exports.SetViewportCommand = SetViewportCommand = SetViewportCommand_1 = __decorate([
(0, inversify_1.injectable)(),

@@ -125,3 +102,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], SetViewportCommand);
exports.SetViewportCommand = SetViewportCommand;
let GetViewportCommand = class GetViewportCommand extends request_command_1.ModelRequestCommand {

@@ -141,11 +117,11 @@ constructor(action) {

}
return ViewportResult.create(viewport, elem.canvasBounds, this.action.requestId);
return actions_1.ViewportResult.create(viewport, elem.canvasBounds, this.action.requestId);
}
};
GetViewportCommand.KIND = GetViewportAction.KIND;
GetViewportCommand = __decorate([
exports.GetViewportCommand = GetViewportCommand;
GetViewportCommand.KIND = actions_1.GetViewportAction.KIND;
exports.GetViewportCommand = GetViewportCommand = __decorate([
__param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),
__metadata("design:paramtypes", [Object])
], GetViewportCommand);
exports.GetViewportCommand = GetViewportCommand;
class ViewportAnimation extends animation_1.Animation {

@@ -170,16 +146,2 @@ constructor(element, oldViewport, newViewport, context) {

exports.ViewportAnimation = ViewportAnimation;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
class SetViewportAction {
constructor(elementId, newViewport, animate) {
this.elementId = elementId;
this.newViewport = newViewport;
this.animate = animate;
this.kind = SetViewportAction.KIND;
}
}
SetViewportAction.KIND = 'viewport';
exports.SetViewportAction = SetViewportAction;
//# sourceMappingURL=viewport.js.map

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

import { SModelElementImpl, SModelRootImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
import { MouseListener } from '../../base/views/mouse-tool';

@@ -34,12 +33,2 @@ import { ViewerOptions } from '../../base/views/viewer-options';

}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Zoomable extends SModelExtension {
zoom: number;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function isZoomable(element: SModelElementImpl | Zoomable): element is Zoomable;
//# sourceMappingURL=zoom.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.isZoomable = exports.ZoomMouseListener = exports.getZoom = void 0;
exports.ZoomMouseListener = exports.getZoom = void 0;
const inversify_1 = require("inversify");

@@ -104,2 +104,3 @@ const actions_1 = require("sprotty-protocol/lib/actions");

}
exports.ZoomMouseListener = ZoomMouseListener;
__decorate([

@@ -109,10 +110,2 @@ (0, inversify_1.inject)(types_1.TYPES.ViewerOptions),

], ZoomMouseListener.prototype, "viewerOptions", void 0);
exports.ZoomMouseListener = ZoomMouseListener;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function isZoomable(element) {
return 'zoom' in element;
}
exports.isZoomable = isZoomable;
//# sourceMappingURL=zoom.js.map

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

********************************************************************************/
import { Action, BringToFrontAction as ProtocolBringToFrontAction } from 'sprotty-protocol/lib/actions';
import { BringToFrontAction } from 'sprotty-protocol/lib/actions';
import { SModelRootImpl, SChildElementImpl, SModelElementImpl } from '../../base/model/smodel';

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

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

@@ -37,15 +37,2 @@ protected includeConnectedEdges(element?: SModelElementImpl): void;

}
/**
* Action to render the selected elements in front of others by manipulating the z-order.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface BringToFrontAction extends Action {
kind: typeof BringToFrontAction.KIND;
elementIDs: string[];
}
export declare namespace BringToFrontAction {
const KIND = "bringToFront";
function create(elementIDs: string[]): BringToFrontAction;
}
//# sourceMappingURL=zorder.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.BringToFrontAction = exports.BringToFrontCommand = void 0;
exports.BringToFrontCommand = void 0;
const inversify_1 = require("inversify");

@@ -98,4 +98,5 @@ const actions_1 = require("sprotty-protocol/lib/actions");

};
exports.BringToFrontCommand = BringToFrontCommand;
BringToFrontCommand.KIND = actions_1.BringToFrontAction.KIND;
BringToFrontCommand = __decorate([
exports.BringToFrontCommand = BringToFrontCommand = __decorate([
(0, inversify_1.injectable)(),

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

], BringToFrontCommand);
exports.BringToFrontCommand = BringToFrontCommand;
var BringToFrontAction;
(function (BringToFrontAction) {
BringToFrontAction.KIND = 'bringToFront';
function create(elementIDs) {
return {
kind: BringToFrontAction.KIND,
elementIDs
};
}
BringToFrontAction.create = create;
})(BringToFrontAction = exports.BringToFrontAction || (exports.BringToFrontAction = {}));
//# sourceMappingURL=zorder.js.map

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

********************************************************************************/
import { SModelElement as SModelElementSchema, SModelRoot as SModelRootSchema, SShapeElement as SShapeElementSchema } from 'sprotty-protocol/lib/model';
import { Bounds, Point } from 'sprotty-protocol/lib/utils/geometry';
import { Point } from 'sprotty-protocol/lib/utils/geometry';
import { ModelIndexImpl, SChildElementImpl, SModelElementImpl } from '../base/model/smodel';

@@ -26,3 +25,3 @@ import { Alignable, BoundsAware, ModelLayoutOptions, SShapeElementImpl } from '../features/bounds/model';

import { Selectable } from '../features/select/model';
import { ViewportRootElement } from '../features/viewport/viewport-root';
import { ViewportRootElementImpl } from '../features/viewport/viewport-root';
import { FluentIterable } from '../utils/iterable';

@@ -32,3 +31,3 @@ /**

*/
export declare class SGraphImpl extends ViewportRootElement {
export declare class SGraphImpl extends ViewportRootElementImpl {
layoutOptions?: ModelLayoutOptions;

@@ -111,80 +110,2 @@ constructor(index?: SGraphIndex);

}
/**
* Serializable schema for graph-like models.
*
* @deprecated Use `SGraph` from `sprotty-protocol` instead.
*/
export interface SGraphSchema extends SModelRootSchema {
children: SModelElementSchema[];
bounds?: Bounds;
scroll?: Point;
zoom?: number;
layoutOptions?: ModelLayoutOptions;
}
/** @deprecated Use `SCompartmentImpl` instead. */
export declare const SCompartment: typeof SCompartmentImpl;
/** @deprecated Use `SGraphImpl` instead. */
export declare const SGraph: typeof SGraphImpl;
/**
* Serializable schema for SNode.
*
* @deprecated Use `SNode` from `sprotty-protocol` instead.
*/
export interface SNodeSchema extends SShapeElementSchema {
layout?: string;
selected?: boolean;
hoverFeedback?: boolean;
opacity?: number;
anchorKind?: string;
}
/** @deprecated Use `SNodeImpl` instead. */
export declare const SNode: typeof SNodeImpl;
/**
* Serializable schema for SPort.
*
* @deprecated Use `SPort` from `sprotty-protocol` instead.
*/
export interface SPortSchema extends SShapeElementSchema {
selected?: boolean;
hoverFeedback?: boolean;
opacity?: number;
anchorKind?: string;
}
/** @deprecated Use `SPortImpl` instead. */
export declare const SPort: typeof SPortImpl;
/**
* Serializable schema for SEdge.
*
* @deprecated Use `SEdge` from `sprotty-protocol` instead.
*/
export interface SEdgeSchema extends SModelElementSchema {
sourceId: string;
targetId: string;
routerKind?: string;
routingPoints?: Point[];
selected?: boolean;
hoverFeedback?: boolean;
opacity?: number;
}
/** @deprecated Use `SEdgeImpl` instead. */
export declare const SEdge: typeof SEdgeImpl;
/**
* Serializable schema for SLabel.
*
* @deprecated Use `SLabel` from `sprotty-protocol` instead.
*/
export interface SLabelSchema extends SShapeElementSchema {
text: string;
selected?: boolean;
}
/** @deprecated Use `SLabelImpl` instead. */
export declare const SLabel: typeof SLabelImpl;
/**
* Serializable schema for SCompartment.
*
* @deprecated Use `SCompartment` from `sprotty-protocol` instead.
*/
export interface SCompartmentSchema extends SShapeElementSchema {
layout?: string;
}
//# sourceMappingURL=sgraph.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.SLabel = exports.SEdge = exports.SPort = exports.SNode = exports.SGraph = exports.SCompartment = exports.SGraphIndex = exports.SCompartmentImpl = exports.SLabelImpl = exports.SEdgeImpl = exports.SPortImpl = exports.SNodeImpl = exports.SGraphImpl = void 0;
exports.SGraphIndex = exports.SCompartmentImpl = exports.SLabelImpl = exports.SEdgeImpl = exports.SPortImpl = exports.SNodeImpl = exports.SGraphImpl = void 0;
const geometry_1 = require("sprotty-protocol/lib/utils/geometry");

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

*/
class SGraphImpl extends viewport_root_1.ViewportRootElement {
class SGraphImpl extends viewport_root_1.ViewportRootElementImpl {
constructor(index = new SGraphIndex()) {

@@ -75,5 +75,5 @@ super(index);

}
exports.SNodeImpl = SNodeImpl;
SNodeImpl.DEFAULT_FEATURES = [model_7.connectableFeature, delete_1.deletableFeature, model_8.selectFeature, model_1.boundsFeature,
model_6.moveFeature, model_1.layoutContainerFeature, model_4.fadeFeature, model_5.hoverFeedbackFeature, model_5.popupFeature];
exports.SNodeImpl = SNodeImpl;
/**

@@ -104,5 +104,5 @@ * A port is a connection point for edges. It should always be contained in an SNode.

}
exports.SPortImpl = SPortImpl;
SPortImpl.DEFAULT_FEATURES = [model_7.connectableFeature, model_8.selectFeature, model_1.boundsFeature, model_4.fadeFeature,
model_5.hoverFeedbackFeature];
exports.SPortImpl = SPortImpl;
/**

@@ -121,5 +121,5 @@ * Model element class for edges, which are the connectors in a graph. An edge has a source and a target,

}
exports.SEdgeImpl = SEdgeImpl;
SEdgeImpl.DEFAULT_FEATURES = [model_3.editFeature, delete_1.deletableFeature, model_8.selectFeature, model_4.fadeFeature,
model_5.hoverFeedbackFeature];
exports.SEdgeImpl = SEdgeImpl;
/**

@@ -136,5 +136,5 @@ * A label can be attached to a node, edge, or port, and contains some text to be rendered in its view.

}
exports.SLabelImpl = SLabelImpl;
SLabelImpl.DEFAULT_FEATURES = [model_1.boundsFeature, model_1.alignFeature, model_1.layoutableChildFeature,
model_2.edgeLayoutFeature, model_4.fadeFeature];
exports.SLabelImpl = SLabelImpl;
/**

@@ -150,5 +150,5 @@ * A compartment is used to group multiple child elements such as labels of a node. Usually a `vbox`

}
exports.SCompartmentImpl = SCompartmentImpl;
SCompartmentImpl.DEFAULT_FEATURES = [model_1.boundsFeature, model_1.layoutContainerFeature, model_1.layoutableChildFeature,
model_4.fadeFeature];
exports.SCompartmentImpl = SCompartmentImpl;
/**

@@ -246,14 +246,2 @@ * A specialized model index that tracks outgoing and incoming edges.

exports.SGraphIndex = SGraphIndex;
/** @deprecated Use `SCompartmentImpl` instead. */
exports.SCompartment = SCompartmentImpl;
/** @deprecated Use `SGraphImpl` instead. */
exports.SGraph = SGraphImpl;
/** @deprecated Use `SNodeImpl` instead. */
exports.SNode = SNodeImpl;
/** @deprecated Use `SPortImpl` instead. */
exports.SPort = SPortImpl;
/** @deprecated Use `SEdgeImpl` instead. */
exports.SEdge = SEdgeImpl;
/** @deprecated Use `SLabelImpl` instead. */
exports.SLabel = SLabelImpl;
//# sourceMappingURL=sgraph.js.map

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

};
exports.SGraphView = SGraphView;
__decorate([

@@ -57,6 +58,5 @@ (0, inversify_1.inject)(routing_1.EdgeRouterRegistry),

], SGraphView.prototype, "edgeRouterRegistry", void 0);
SGraphView = __decorate([
exports.SGraphView = SGraphView = __decorate([
(0, inversify_1.injectable)()
], SGraphView);
exports.SGraphView = SGraphView;
let PolylineEdgeView = class PolylineEdgeView extends views_2.RoutableView {

@@ -98,2 +98,3 @@ render(edge, context, args) {

};
exports.PolylineEdgeView = PolylineEdgeView;
__decorate([

@@ -103,6 +104,5 @@ (0, inversify_1.inject)(routing_1.EdgeRouterRegistry),

], PolylineEdgeView.prototype, "edgeRouterRegistry", void 0);
PolylineEdgeView = __decorate([
exports.PolylineEdgeView = PolylineEdgeView = __decorate([
(0, inversify_1.injectable)()
], PolylineEdgeView);
exports.PolylineEdgeView = PolylineEdgeView;
/**

@@ -245,6 +245,6 @@ * A `PolylineEdgeView` that renders jumps over intersections.

};
JumpingPolylineEdgeView = __decorate([
exports.JumpingPolylineEdgeView = JumpingPolylineEdgeView;
exports.JumpingPolylineEdgeView = JumpingPolylineEdgeView = __decorate([
(0, inversify_1.injectable)()
], JumpingPolylineEdgeView);
exports.JumpingPolylineEdgeView = JumpingPolylineEdgeView;
/**

@@ -280,6 +280,6 @@ * A `PolylineEdgeView` that renders gaps on intersections.

};
PolylineEdgeViewWithGapsOnIntersections = __decorate([
exports.PolylineEdgeViewWithGapsOnIntersections = PolylineEdgeViewWithGapsOnIntersections;
exports.PolylineEdgeViewWithGapsOnIntersections = PolylineEdgeViewWithGapsOnIntersections = __decorate([
(0, inversify_1.injectable)()
], PolylineEdgeViewWithGapsOnIntersections);
exports.PolylineEdgeViewWithGapsOnIntersections = PolylineEdgeViewWithGapsOnIntersections;
let BezierCurveEdgeView = class BezierCurveEdgeView extends views_2.RoutableView {

@@ -351,2 +351,3 @@ render(edge, context, args) {

};
exports.BezierCurveEdgeView = BezierCurveEdgeView;
__decorate([

@@ -356,6 +357,5 @@ (0, inversify_1.inject)(routing_1.EdgeRouterRegistry),

], BezierCurveEdgeView.prototype, "edgeRouterRegistry", void 0);
BezierCurveEdgeView = __decorate([
exports.BezierCurveEdgeView = BezierCurveEdgeView = __decorate([
(0, inversify_1.injectable)()
], BezierCurveEdgeView);
exports.BezierCurveEdgeView = BezierCurveEdgeView;
let SRoutingHandleView = class SRoutingHandleView {

@@ -385,2 +385,3 @@ constructor() {

};
exports.SRoutingHandleView = SRoutingHandleView;
__decorate([

@@ -390,6 +391,5 @@ (0, inversify_1.inject)(routing_1.EdgeRouterRegistry),

], SRoutingHandleView.prototype, "edgeRouterRegistry", void 0);
SRoutingHandleView = __decorate([
exports.SRoutingHandleView = SRoutingHandleView = __decorate([
(0, inversify_1.injectable)()
], SRoutingHandleView);
exports.SRoutingHandleView = SRoutingHandleView;
let SLabelView = class SLabelView extends views_1.ShapeView {

@@ -408,6 +408,6 @@ render(label, context) {

};
SLabelView = __decorate([
exports.SLabelView = SLabelView;
exports.SLabelView = SLabelView = __decorate([
(0, inversify_1.injectable)()
], SLabelView);
exports.SLabelView = SLabelView;
let SCompartmentView = class SCompartmentView {

@@ -423,6 +423,6 @@ render(compartment, context, args) {

};
SCompartmentView = __decorate([
exports.SCompartmentView = SCompartmentView;
exports.SCompartmentView = SCompartmentView = __decorate([
(0, inversify_1.injectable)()
], SCompartmentView);
exports.SCompartmentView = SCompartmentView;
let SBezierCreateHandleView = class SBezierCreateHandleView extends SRoutingHandleView {

@@ -452,6 +452,6 @@ render(handle, context, args) {

};
SBezierCreateHandleView = __decorate([
exports.SBezierCreateHandleView = SBezierCreateHandleView;
exports.SBezierCreateHandleView = SBezierCreateHandleView = __decorate([
(0, inversify_1.injectable)()
], SBezierCreateHandleView);
exports.SBezierCreateHandleView = SBezierCreateHandleView;
let SBezierControlHandleView = class SBezierControlHandleView extends SRoutingHandleView {

@@ -498,6 +498,6 @@ render(handle, context, args) {

};
SBezierControlHandleView = __decorate([
exports.SBezierControlHandleView = SBezierControlHandleView;
exports.SBezierControlHandleView = SBezierControlHandleView = __decorate([
(0, inversify_1.injectable)()
], SBezierControlHandleView);
exports.SBezierControlHandleView = SBezierControlHandleView;
//# sourceMappingURL=views.js.map

@@ -29,8 +29,5 @@ /********************************************************************************

export * from './base/features/set-model';
export * from './base/model/smodel-extension';
export * from './base/model/smodel-factory';
export * from './base/model/smodel-utils';
export * from './base/model/smodel';
export * from './base/tool-manager/tool-manager';
export * from './base/tool-manager/tool';
export * from './base/ui-extensions/ui-extension-registry';

@@ -50,121 +47,118 @@ export * from './base/ui-extensions/ui-extension';

export { defaultModule };
export * from "./features/bounds/bounds-manipulation";
export * from "./features/bounds/hidden-bounds-updater";
export * from "./features/bounds/layout";
export * from "./features/bounds/model";
export * from "./features/bounds/vbox-layout";
export * from "./features/bounds/hbox-layout";
export * from "./features/bounds/stack-layout";
export * from "./features/bounds/views";
export * from "./features/button/button-handler";
export * from "./features/button/model";
export * from "./features/command-palette/action-providers";
export * from "./features/command-palette/command-palette";
export * from "./features/context-menu/context-menu-service";
export * from "./features/context-menu/menu-providers";
export * from "./features/context-menu/mouse-listener";
export * from "./features/edge-layout/di.config";
export * from "./features/edge-layout/edge-layout";
export * from "./features/edge-layout/model";
export * from "./features/edit/create";
export * from "./features/edit/create-on-drag";
export * from "./features/edit/di.config";
export * from "./features/edit/delete";
export * from "./features/edit/edit-label";
export * from "./features/edit/edit-label-ui";
export * from "./features/edit/edit-routing";
export * from "./features/edit/model";
export * from "./features/edit/reconnect";
export * from "./features/expand/expand";
export * from "./features/expand/model";
export * from "./features/expand/views";
export * from "./features/export/export";
export * from "./features/export/model";
export * from "./features/export/svg-exporter";
export * from "./features/fade/fade";
export * from "./features/fade/model";
export * from "./features/hover/hover";
export * from "./features/hover/model";
export * from "./features/decoration/model";
export * from "./features/decoration/views";
export * from "./features/decoration/decoration-placer";
export * from "./features/edge-intersection/intersection-finder";
export * from "./features/edge-intersection/sweepline";
export * from "./features/move/model";
export * from "./features/move/move";
export * from "./features/move/snap";
export * from "./features/nameable/model";
export * from "./features/open/open";
export * from "./features/open/model";
export * from "./features/projection/model";
export * from "./features/projection/views";
export * from "./features/routing/anchor";
export * from "./features/routing/abstract-edge-router";
export * from "./features/routing/bezier-anchors";
export * from "./features/routing/bezier-edge-router";
export * from "./features/routing/manhattan-anchors";
export * from "./features/routing/manhattan-edge-router";
export * from "./features/routing/model";
export * from "./features/routing/polyline-anchors";
export * from "./features/routing/polyline-edge-router";
export * from "./features/routing/routing";
export * from "./features/routing/views";
export * from "./features/select/model";
export * from "./features/select/select";
export * from "./features/undo-redo/undo-redo";
export * from "./features/update/model-matching";
export * from "./features/update/update-model";
export * from "./features/viewport/center-fit";
export * from "./features/viewport/model";
export * from "./features/viewport/scroll";
export * from "./features/viewport/viewport-root";
export * from "./features/viewport/viewport";
export * from "./features/viewport/zoom";
export * from "./features/zorder/zorder";
import graphModule from "./graph/di.config";
import boundsModule from "./features/bounds/di.config";
import buttonModule from "./features/button/di.config";
import commandPaletteModule from "./features/command-palette/di.config";
import contextMenuModule from "./features/context-menu/di.config";
import decorationModule from "./features/decoration/di.config";
import edgeIntersectionModule from "./features/edge-intersection/di.config";
import edgeLayoutModule from "./features/edge-layout/di.config";
import expandModule from "./features/expand/di.config";
import exportModule from "./features/export/di.config";
import fadeModule from "./features/fade/di.config";
import hoverModule from "./features/hover/di.config";
import moveModule from "./features/move/di.config";
import openModule from "./features/open/di.config";
import routingModule from "./features/routing/di.config";
import selectModule from "./features/select/di.config";
import undoRedoModule from "./features/undo-redo/di.config";
import updateModule from "./features/update/di.config";
import viewportModule from "./features/viewport/di.config";
export * from './features/bounds/bounds-manipulation';
export * from './features/bounds/hidden-bounds-updater';
export * from './features/bounds/layout';
export * from './features/bounds/model';
export * from './features/bounds/vbox-layout';
export * from './features/bounds/hbox-layout';
export * from './features/bounds/stack-layout';
export * from './features/bounds/views';
export * from './features/button/button-handler';
export * from './features/button/model';
export * from './features/command-palette/action-providers';
export * from './features/command-palette/command-palette';
export * from './features/context-menu/context-menu-service';
export * from './features/context-menu/menu-providers';
export * from './features/context-menu/mouse-listener';
export * from './features/edge-layout/di.config';
export * from './features/edge-layout/edge-layout';
export * from './features/edge-layout/model';
export * from './features/edit/create';
export * from './features/edit/create-on-drag';
export * from './features/edit/di.config';
export * from './features/edit/delete';
export * from './features/edit/edit-label';
export * from './features/edit/edit-label-ui';
export * from './features/edit/edit-routing';
export * from './features/edit/model';
export * from './features/edit/reconnect';
export * from './features/expand/expand';
export * from './features/expand/model';
export * from './features/expand/views';
export * from './features/export/export';
export * from './features/export/model';
export * from './features/export/svg-exporter';
export * from './features/fade/fade';
export * from './features/fade/model';
export * from './features/hover/hover';
export * from './features/hover/model';
export * from './features/decoration/model';
export * from './features/decoration/views';
export * from './features/decoration/decoration-placer';
export * from './features/edge-intersection/intersection-finder';
export * from './features/edge-intersection/sweepline';
export * from './features/move/model';
export * from './features/move/move';
export * from './features/move/snap';
export * from './features/nameable/model';
export * from './features/open/open';
export * from './features/open/model';
export * from './features/projection/model';
export * from './features/projection/views';
export * from './features/routing/anchor';
export * from './features/routing/abstract-edge-router';
export * from './features/routing/bezier-anchors';
export * from './features/routing/bezier-edge-router';
export * from './features/routing/manhattan-anchors';
export * from './features/routing/manhattan-edge-router';
export * from './features/routing/model';
export * from './features/routing/polyline-anchors';
export * from './features/routing/polyline-edge-router';
export * from './features/routing/routing';
export * from './features/routing/views';
export * from './features/select/model';
export * from './features/select/select';
export * from './features/undo-redo/undo-redo';
export * from './features/update/model-matching';
export * from './features/update/update-model';
export * from './features/viewport/center-fit';
export * from './features/viewport/model';
export * from './features/viewport/scroll';
export * from './features/viewport/viewport-root';
export * from './features/viewport/viewport';
export * from './features/viewport/zoom';
export * from './features/zorder/zorder';
import boundsModule from './features/bounds/di.config';
import buttonModule from './features/button/di.config';
import commandPaletteModule from './features/command-palette/di.config';
import contextMenuModule from './features/context-menu/di.config';
import decorationModule from './features/decoration/di.config';
import edgeIntersectionModule from './features/edge-intersection/di.config';
import edgeLayoutModule from './features/edge-layout/di.config';
import expandModule from './features/expand/di.config';
import exportModule from './features/export/di.config';
import fadeModule from './features/fade/di.config';
import hoverModule from './features/hover/di.config';
import moveModule from './features/move/di.config';
import openModule from './features/open/di.config';
import routingModule from './features/routing/di.config';
import selectModule from './features/select/di.config';
import undoRedoModule from './features/undo-redo/di.config';
import updateModule from './features/update/di.config';
import viewportModule from './features/viewport/di.config';
import zorderModule from './features/zorder/di.config';
export { graphModule, boundsModule, buttonModule, commandPaletteModule, contextMenuModule, decorationModule, edgeIntersectionModule, edgeLayoutModule, expandModule, exportModule, fadeModule, hoverModule, moveModule, openModule, routingModule, selectModule, undoRedoModule, updateModule, viewportModule, zorderModule };
export * from "./graph/sgraph-factory";
export * from "./graph/sgraph";
export * from "./graph/views";
export * from "./lib/modules";
export * from "./lib/generic-views";
export * from "./lib/html-views";
export * from "./lib/jsx";
export * from "./lib/model";
export * from "./lib/svg-views";
export * from "./model-source/commit-model";
export * from "./model-source/diagram-server";
export * from "./model-source/local-model-source";
export * from "./model-source/logging";
export * from "./model-source/model-source";
export * from "./model-source/websocket";
import modelSourceModule from "./model-source/di.config";
export { boundsModule, buttonModule, commandPaletteModule, contextMenuModule, decorationModule, edgeIntersectionModule, edgeLayoutModule, expandModule, exportModule, fadeModule, hoverModule, moveModule, openModule, routingModule, selectModule, undoRedoModule, updateModule, viewportModule, zorderModule };
export * from './graph/sgraph';
export * from './graph/views';
export * from './lib/modules';
export * from './lib/generic-views';
export * from './lib/html-views';
export * from './lib/jsx';
export * from './lib/model';
export * from './lib/svg-views';
export * from './model-source/commit-model';
export * from './model-source/diagram-server';
export * from './model-source/local-model-source';
export * from './model-source/logging';
export * from './model-source/model-source';
export * from './model-source/websocket';
import modelSourceModule from './model-source/di.config';
export { modelSourceModule };
export * from "./utils/browser";
export * from "./utils/codicon";
export * from "./utils/color";
export * from "./utils/geometry";
export * from "./utils/inversify";
export * from "./utils/json";
export * from "./utils/logging";
export * from "./utils/registry";
export * from './utils/browser';
export * from './utils/codicon';
export * from './utils/color';
export * from './utils/geometry';
export * from './utils/inversify';
export * from './utils/logging';
export * from './utils/registry';
//# sourceMappingURL=index.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.modelSourceModule = exports.zorderModule = exports.viewportModule = exports.updateModule = exports.undoRedoModule = exports.selectModule = exports.routingModule = exports.openModule = exports.moveModule = exports.hoverModule = exports.fadeModule = exports.exportModule = exports.expandModule = exports.edgeLayoutModule = exports.edgeIntersectionModule = exports.decorationModule = exports.contextMenuModule = exports.commandPaletteModule = exports.buttonModule = exports.boundsModule = exports.graphModule = exports.defaultModule = void 0;
exports.modelSourceModule = exports.zorderModule = exports.viewportModule = exports.updateModule = exports.undoRedoModule = exports.selectModule = exports.routingModule = exports.openModule = exports.moveModule = exports.hoverModule = exports.fadeModule = exports.exportModule = exports.expandModule = exports.edgeLayoutModule = exports.edgeIntersectionModule = exports.decorationModule = exports.contextMenuModule = exports.commandPaletteModule = exports.buttonModule = exports.boundsModule = exports.defaultModule = void 0;
// ------------------ Base ------------------

@@ -51,8 +51,5 @@ __exportStar(require("./base/actions/action"), exports);

__exportStar(require("./base/features/set-model"), exports);
__exportStar(require("./base/model/smodel-extension"), exports);
__exportStar(require("./base/model/smodel-factory"), exports);
__exportStar(require("./base/model/smodel-utils"), exports);
__exportStar(require("./base/model/smodel"), exports);
__exportStar(require("./base/tool-manager/tool-manager"), exports);
__exportStar(require("./base/tool-manager/tool"), exports);
__exportStar(require("./base/ui-extensions/ui-extension-registry"), exports);

@@ -146,44 +143,41 @@ __exportStar(require("./base/ui-extensions/ui-extension"), exports);

__exportStar(require("./features/zorder/zorder"), exports);
const di_config_2 = __importDefault(require("./graph/di.config"));
exports.graphModule = di_config_2.default;
const di_config_3 = __importDefault(require("./features/bounds/di.config"));
exports.boundsModule = di_config_3.default;
const di_config_4 = __importDefault(require("./features/button/di.config"));
exports.buttonModule = di_config_4.default;
const di_config_5 = __importDefault(require("./features/command-palette/di.config"));
exports.commandPaletteModule = di_config_5.default;
const di_config_6 = __importDefault(require("./features/context-menu/di.config"));
exports.contextMenuModule = di_config_6.default;
const di_config_7 = __importDefault(require("./features/decoration/di.config"));
exports.decorationModule = di_config_7.default;
const di_config_8 = __importDefault(require("./features/edge-intersection/di.config"));
exports.edgeIntersectionModule = di_config_8.default;
const di_config_9 = __importDefault(require("./features/edge-layout/di.config"));
exports.edgeLayoutModule = di_config_9.default;
const di_config_10 = __importDefault(require("./features/expand/di.config"));
exports.expandModule = di_config_10.default;
const di_config_11 = __importDefault(require("./features/export/di.config"));
exports.exportModule = di_config_11.default;
const di_config_12 = __importDefault(require("./features/fade/di.config"));
exports.fadeModule = di_config_12.default;
const di_config_13 = __importDefault(require("./features/hover/di.config"));
exports.hoverModule = di_config_13.default;
const di_config_14 = __importDefault(require("./features/move/di.config"));
exports.moveModule = di_config_14.default;
const di_config_15 = __importDefault(require("./features/open/di.config"));
exports.openModule = di_config_15.default;
const di_config_16 = __importDefault(require("./features/routing/di.config"));
exports.routingModule = di_config_16.default;
const di_config_17 = __importDefault(require("./features/select/di.config"));
exports.selectModule = di_config_17.default;
const di_config_18 = __importDefault(require("./features/undo-redo/di.config"));
exports.undoRedoModule = di_config_18.default;
const di_config_19 = __importDefault(require("./features/update/di.config"));
exports.updateModule = di_config_19.default;
const di_config_20 = __importDefault(require("./features/viewport/di.config"));
exports.viewportModule = di_config_20.default;
const di_config_21 = __importDefault(require("./features/zorder/di.config"));
exports.zorderModule = di_config_21.default;
const di_config_2 = __importDefault(require("./features/bounds/di.config"));
exports.boundsModule = di_config_2.default;
const di_config_3 = __importDefault(require("./features/button/di.config"));
exports.buttonModule = di_config_3.default;
const di_config_4 = __importDefault(require("./features/command-palette/di.config"));
exports.commandPaletteModule = di_config_4.default;
const di_config_5 = __importDefault(require("./features/context-menu/di.config"));
exports.contextMenuModule = di_config_5.default;
const di_config_6 = __importDefault(require("./features/decoration/di.config"));
exports.decorationModule = di_config_6.default;
const di_config_7 = __importDefault(require("./features/edge-intersection/di.config"));
exports.edgeIntersectionModule = di_config_7.default;
const di_config_8 = __importDefault(require("./features/edge-layout/di.config"));
exports.edgeLayoutModule = di_config_8.default;
const di_config_9 = __importDefault(require("./features/expand/di.config"));
exports.expandModule = di_config_9.default;
const di_config_10 = __importDefault(require("./features/export/di.config"));
exports.exportModule = di_config_10.default;
const di_config_11 = __importDefault(require("./features/fade/di.config"));
exports.fadeModule = di_config_11.default;
const di_config_12 = __importDefault(require("./features/hover/di.config"));
exports.hoverModule = di_config_12.default;
const di_config_13 = __importDefault(require("./features/move/di.config"));
exports.moveModule = di_config_13.default;
const di_config_14 = __importDefault(require("./features/open/di.config"));
exports.openModule = di_config_14.default;
const di_config_15 = __importDefault(require("./features/routing/di.config"));
exports.routingModule = di_config_15.default;
const di_config_16 = __importDefault(require("./features/select/di.config"));
exports.selectModule = di_config_16.default;
const di_config_17 = __importDefault(require("./features/undo-redo/di.config"));
exports.undoRedoModule = di_config_17.default;
const di_config_18 = __importDefault(require("./features/update/di.config"));
exports.updateModule = di_config_18.default;
const di_config_19 = __importDefault(require("./features/viewport/di.config"));
exports.viewportModule = di_config_19.default;
const di_config_20 = __importDefault(require("./features/zorder/di.config"));
exports.zorderModule = di_config_20.default;
// ------------------ Graph ------------------
__exportStar(require("./graph/sgraph-factory"), exports);
__exportStar(require("./graph/sgraph"), exports);

@@ -205,4 +199,4 @@ __exportStar(require("./graph/views"), exports);

__exportStar(require("./model-source/websocket"), exports);
const di_config_22 = __importDefault(require("./model-source/di.config"));
exports.modelSourceModule = di_config_22.default;
const di_config_21 = __importDefault(require("./model-source/di.config"));
exports.modelSourceModule = di_config_21.default;
// ------------------ Utilities ------------------

@@ -214,5 +208,4 @@ __exportStar(require("./utils/browser"), exports);

__exportStar(require("./utils/inversify"), exports);
__exportStar(require("./utils/json"), exports);
__exportStar(require("./utils/logging"), exports);
__exportStar(require("./utils/registry"), exports);
//# sourceMappingURL=index.js.map

@@ -51,6 +51,6 @@ "use strict";

};
PreRenderedView = __decorate([
exports.PreRenderedView = PreRenderedView;
exports.PreRenderedView = PreRenderedView = __decorate([
(0, inversify_1.injectable)()
], PreRenderedView);
exports.PreRenderedView = PreRenderedView;
/**

@@ -73,6 +73,6 @@ * An SVG `foreignObject` view with a namespace specified by the provided `ForeignObjectElement`.

};
ForeignObjectView = __decorate([
exports.ForeignObjectView = ForeignObjectView;
exports.ForeignObjectView = ForeignObjectView = __decorate([
(0, inversify_1.injectable)()
], ForeignObjectView);
exports.ForeignObjectView = ForeignObjectView;
//# sourceMappingURL=generic-views.js.map

@@ -41,6 +41,6 @@ "use strict";

};
HtmlRootView = __decorate([
exports.HtmlRootView = HtmlRootView;
exports.HtmlRootView = HtmlRootView = __decorate([
(0, inversify_1.injectable)()
], HtmlRootView);
exports.HtmlRootView = HtmlRootView;
//# sourceMappingURL=html-views.js.map

@@ -122,4 +122,4 @@ "use strict";

}
exports.ShapedPreRenderedElementImpl = ShapedPreRenderedElementImpl;
ShapedPreRenderedElementImpl.DEFAULT_FEATURES = [model_2.moveFeature, model_1.boundsFeature, model_3.selectFeature, model_1.alignFeature];
exports.ShapedPreRenderedElementImpl = ShapedPreRenderedElementImpl;
/** @deprecated Use `ShapedPreRenderedElementImpl` instead. */

@@ -126,0 +126,0 @@ exports.ShapedPreRenderedElement = ShapedPreRenderedElementImpl;

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

import { IView, IViewArgs, RenderingContext } from "../base/views/view";
import { ViewportRootElement } from "../features/viewport/viewport-root";
import { ViewportRootElementImpl } from "../features/viewport/viewport-root";
import { SShapeElementImpl } from '../features/bounds/model';

@@ -26,3 +26,3 @@ import { ShapeView } from '../features/bounds/views';

export declare class SvgViewportView implements IView {
render(model: Readonly<ViewportRootElement>, context: RenderingContext, args?: IViewArgs): VNode;
render(model: Readonly<ViewportRootElementImpl>, context: RenderingContext, args?: IViewArgs): VNode;
}

@@ -29,0 +29,0 @@ export declare class CircularNodeView extends ShapeView {

@@ -38,6 +38,6 @@ "use strict";

};
SvgViewportView = __decorate([
exports.SvgViewportView = SvgViewportView;
exports.SvgViewportView = SvgViewportView = __decorate([
(0, inversify_1.injectable)()
], SvgViewportView);
exports.SvgViewportView = SvgViewportView;
let CircularNodeView = class CircularNodeView extends views_1.ShapeView {

@@ -58,6 +58,6 @@ render(node, context, args) {

};
CircularNodeView = __decorate([
exports.CircularNodeView = CircularNodeView;
exports.CircularNodeView = CircularNodeView = __decorate([
(0, inversify_1.injectable)()
], CircularNodeView);
exports.CircularNodeView = CircularNodeView;
let RectangularNodeView = class RectangularNodeView extends views_1.ShapeView {

@@ -73,6 +73,6 @@ render(node, context, args) {

};
RectangularNodeView = __decorate([
exports.RectangularNodeView = RectangularNodeView;
exports.RectangularNodeView = RectangularNodeView = __decorate([
(0, inversify_1.injectable)()
], RectangularNodeView);
exports.RectangularNodeView = RectangularNodeView;
let DiamondNodeView = class DiamondNodeView extends views_1.ShapeView {

@@ -90,6 +90,6 @@ render(node, context, args) {

};
DiamondNodeView = __decorate([
exports.DiamondNodeView = DiamondNodeView;
exports.DiamondNodeView = DiamondNodeView = __decorate([
(0, inversify_1.injectable)()
], DiamondNodeView);
exports.DiamondNodeView = DiamondNodeView;
function svgStr(point) {

@@ -103,6 +103,6 @@ return `${point.x},${point.y}`;

};
EmptyGroupView = __decorate([
exports.EmptyGroupView = EmptyGroupView;
exports.EmptyGroupView = EmptyGroupView = __decorate([
(0, inversify_1.injectable)()
], EmptyGroupView);
exports.EmptyGroupView = EmptyGroupView;
//# sourceMappingURL=svg-views.js.map

@@ -16,7 +16,7 @@ /********************************************************************************

********************************************************************************/
import { Action } from "sprotty-protocol/lib/actions";
import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { CommandExecutionContext, CommandReturn, SystemCommand } from "../base/commands/command";
import { SModelRootImpl } from "../base/model/smodel";
import { ModelSource } from "./model-source";
import { Action } from 'sprotty-protocol/lib/actions';
import { SModelRoot } from 'sprotty-protocol/lib/model';
import { CommandExecutionContext, CommandReturn, SystemCommand } from '../base/commands/command';
import { SModelRootImpl } from '../base/model/smodel';
import { ModelSource } from './model-source';
/**

@@ -41,7 +41,7 @@ * Commit the current SModel back to the model source.

modelSource: ModelSource;
originalModel: SModelRootSchema;
newModel: SModelRootSchema;
originalModel: SModelRoot;
newModel: SModelRoot;
constructor(action: CommitModelAction);
execute(context: CommandExecutionContext): CommandReturn;
protected doCommit(model: SModelRootSchema, result: SModelRootImpl, doSetOriginal: boolean): CommandReturn;
protected doCommit(model: SModelRoot, result: SModelRootImpl, doSetOriginal: boolean): CommandReturn;
undo(context: CommandExecutionContext): CommandReturn;

@@ -48,0 +48,0 @@ redo(context: CommandExecutionContext): CommandReturn;

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

CommitModelAction.create = create;
})(CommitModelAction = exports.CommitModelAction || (exports.CommitModelAction = {}));
})(CommitModelAction || (exports.CommitModelAction = CommitModelAction = {}));
let CommitModelCommand = class CommitModelCommand extends command_1.SystemCommand {

@@ -77,2 +77,3 @@ constructor(action) {

};
exports.CommitModelCommand = CommitModelCommand;
CommitModelCommand.KIND = CommitModelAction.KIND;

@@ -83,3 +84,3 @@ __decorate([

], CommitModelCommand.prototype, "modelSource", void 0);
CommitModelCommand = __decorate([
exports.CommitModelCommand = CommitModelCommand = __decorate([
(0, inversify_1.injectable)(),

@@ -89,3 +90,2 @@ __param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),

], CommitModelCommand);
exports.CommitModelCommand = CommitModelCommand;
//# sourceMappingURL=commit-model.js.map

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

********************************************************************************/
import { ActionMessage as ProtocolActionMessage } from 'sprotty-protocol';
import { Action, ComputedBoundsAction, RequestModelAction } from 'sprotty-protocol/lib/actions';
import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { Action, ActionMessage, ComputedBoundsAction, RequestModelAction } from 'sprotty-protocol/lib/actions';
import { SModelRoot } from 'sprotty-protocol/lib/model';
import { ActionHandlerRegistry } from '../base/actions/action-handler';

@@ -45,5 +44,5 @@ import { ICommand } from '../base/commands/command';

clientId: string;
protected currentRoot: SModelRootSchema;
protected currentRoot: SModelRoot;
protected lastSubmittedModelType: string;
get model(): SModelRootSchema;
get model(): SModelRoot;
initialize(registry: ActionHandlerRegistry): void;

@@ -55,3 +54,3 @@ handle(action: Action): void | ICommand | Action;

*/
protected abstract sendMessage(message: ProtocolActionMessage): void;
protected abstract sendMessage(message: ActionMessage): void;
/**

@@ -78,21 +77,4 @@ * Called when a message is received from the remote diagram server.

protected handleServerStateAction(action: ServerStatusAction): boolean;
commitModel(newRoot: SModelRootSchema): Promise<SModelRootSchema> | SModelRootSchema;
commitModel(newRoot: SModelRoot): Promise<SModelRoot> | SModelRoot;
}
/**
* @deprecated Use `DiagramServerProxy` instead.
*/
export declare const DiagramServer: typeof DiagramServerProxy;
/**
* Wrapper for actions when transferring them between client and server via a DiagramServer.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ActionMessage {
clientId: string;
action: Action;
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function isActionMessage(object: unknown): object is ActionMessage;
//# sourceMappingURL=diagram-server.d.ts.map

@@ -27,8 +27,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.isActionMessage = exports.DiagramServer = exports.DiagramServerProxy = exports.ServerStatusAction = void 0;
exports.DiagramServerProxy = exports.ServerStatusAction = void 0;
const file_saver_1 = require("file-saver");
const inversify_1 = require("inversify");
const sprotty_protocol_1 = require("sprotty-protocol");
const actions_1 = require("sprotty-protocol/lib/actions");
const object_1 = require("sprotty-protocol/lib/utils/object");
const set_model_1 = require("../base/features/set-model");

@@ -48,4 +46,4 @@ const types_1 = require("../base/types");

}
exports.ServerStatusAction = ServerStatusAction;
ServerStatusAction.KIND = 'serverStatus';
exports.ServerStatusAction = ServerStatusAction;
const receivedFromServerProperty = '__receivedFromServer';

@@ -78,3 +76,3 @@ /**

registry.register(actions_1.CollapseExpandAllAction.KIND, this);
registry.register(sprotty_protocol_1.OpenAction.KIND, this);
registry.register(actions_1.OpenAction.KIND, this);
registry.register(ServerStatusAction.KIND, this);

@@ -104,3 +102,3 @@ if (!this.clientId) {

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

@@ -195,2 +193,3 @@ object.action[receivedFromServerProperty] = true;

};
exports.DiagramServerProxy = DiagramServerProxy;
__decorate([

@@ -204,18 +203,5 @@ (0, inversify_1.inject)(types_1.TYPES.ILogger),

], DiagramServerProxy.prototype, "computedBoundsApplicator", void 0);
DiagramServerProxy = __decorate([
exports.DiagramServerProxy = DiagramServerProxy = __decorate([
(0, inversify_1.injectable)()
], DiagramServerProxy);
exports.DiagramServerProxy = DiagramServerProxy;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use `DiagramServerProxy` instead.
*/
exports.DiagramServer = DiagramServerProxy;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function isActionMessage(object) {
return (0, object_1.hasOwnProperty)(object, 'action');
}
exports.isActionMessage = isActionMessage;
//# sourceMappingURL=diagram-server.js.map

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

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

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

export interface IPopupModelProvider {
getPopupModel(request: RequestPopupModelAction, element?: SModelElementSchema): SModelRootSchema | undefined;
getPopupModel(request: RequestPopupModelAction, element?: SModelElement): SModelRoot | undefined;
}

@@ -41,4 +41,4 @@ /**

protected popupModelProvider?: IPopupModelProvider;
protected layoutEngine?: ProtocolIModelLayoutEngine;
protected currentRoot: SModelRootSchema;
protected layoutEngine?: IModelLayoutEngine;
protected currentRoot: SModelRoot;
/**

@@ -49,4 +49,4 @@ * The `type` property of the model root is used to determine whether a model update

protected lastSubmittedModelType: string;
get model(): SModelRootSchema;
set model(root: SModelRootSchema);
get model(): SModelRoot;
set model(root: SModelRoot);
initialize(registry: ActionHandlerRegistry): void;

@@ -56,4 +56,4 @@ /**

*/
setModel(newRoot: SModelRootSchema): Promise<void>;
commitModel(newRoot: SModelRootSchema): Promise<SModelRootSchema> | SModelRootSchema;
setModel(newRoot: SModelRoot): Promise<void>;
commitModel(newRoot: SModelRoot): Promise<SModelRoot> | SModelRoot;
/**

@@ -64,7 +64,7 @@ * Apply an incremental update to the model with an animation showing the transition to

*/
updateModel(newRoot?: SModelRootSchema): Promise<void>;
updateModel(newRoot?: SModelRoot): Promise<void>;
/**
* Get the current selection from the model.
*/
getSelection(): Promise<FluentIterable<SModelElementSchema>>;
getSelection(): Promise<FluentIterable<SModelElement>>;
private gatherSelectedElements;

@@ -81,3 +81,3 @@ /**

*/
protected submitModel(newRoot: SModelRootSchema, update: boolean | Match[], cause?: Action): Promise<void>;
protected submitModel(newRoot: SModelRoot, update: boolean | Match[], cause?: Action): Promise<void>;
/**

@@ -87,3 +87,3 @@ * Submit the given model with an `UpdateModelAction` or a `SetModelAction` depending on the

*/
protected doSubmitModel(newRoot: SModelRootSchema, update: boolean | Match[], cause?: Action, index?: SModelIndex): Promise<void>;
protected doSubmitModel(newRoot: SModelRoot, update: boolean | Match[], cause?: Action, index?: SModelIndex): Promise<void>;
/**

@@ -96,4 +96,4 @@ * Modify the current model with an array of matches.

*/
addElements(elements: (SModelElementSchema | {
element: SModelElementSchema;
addElements(elements: (SModelElement | {
element: SModelElement;
parentId: string;

@@ -113,12 +113,2 @@ })[]): Promise<void>;

}
/**
* @deprecated Use IPopupModelProvider instead.
*/
export type PopupModelFactory = (request: RequestPopupModelAction, element?: SModelElementSchema) => SModelRootSchema | undefined;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface IModelLayoutEngine {
layout(model: SModelRootSchema, index?: SModelIndex): SModelRootSchema | Promise<SModelRootSchema>;
}
//# sourceMappingURL=local-model-source.d.ts.map

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

};
exports.LocalModelSource = LocalModelSource;
__decorate([

@@ -275,6 +276,5 @@ (0, inversify_1.inject)(types_1.TYPES.ILogger),

], LocalModelSource.prototype, "layoutEngine", void 0);
LocalModelSource = __decorate([
exports.LocalModelSource = LocalModelSource = __decorate([
(0, inversify_1.injectable)()
], LocalModelSource);
exports.LocalModelSource = LocalModelSource;
//# sourceMappingURL=local-model-source.js.map

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

********************************************************************************/
import { Action } from 'sprotty-protocol/lib/actions';
import { ILogger, LogLevel } from '../utils/logging';

@@ -32,23 +31,2 @@ import { ModelSource } from './model-source';

}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface LoggingAction extends Action {
kind: typeof LoggingAction.KIND;
severity: string;
time: string;
caller: string;
message: string;
params: string[];
}
export declare namespace LoggingAction {
const KIND = "logging";
function create(options: {
severity: string;
time: string;
caller: string;
message: string;
params: string[];
}): LoggingAction;
}
//# sourceMappingURL=logging.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.LoggingAction = exports.ForwardingLogger = void 0;
exports.ForwardingLogger = void 0;
const inversify_1 = require("inversify");

@@ -81,2 +81,3 @@ const actions_1 = require("sprotty-protocol/lib/actions");

};
exports.ForwardingLogger = ForwardingLogger;
__decorate([

@@ -90,14 +91,5 @@ (0, inversify_1.inject)(types_1.TYPES.ModelSourceProvider),

], ForwardingLogger.prototype, "logLevel", void 0);
ForwardingLogger = __decorate([
exports.ForwardingLogger = ForwardingLogger = __decorate([
(0, inversify_1.injectable)()
], ForwardingLogger);
exports.ForwardingLogger = ForwardingLogger;
var LoggingAction;
(function (LoggingAction) {
LoggingAction.KIND = 'logging';
function create(options) {
return Object.assign({ kind: LoggingAction.KIND }, options);
}
LoggingAction.create = create;
})(LoggingAction = exports.LoggingAction || (exports.LoggingAction = {}));
//# sourceMappingURL=logging.js.map

@@ -16,10 +16,10 @@ /********************************************************************************

********************************************************************************/
import { Action, ComputedBoundsAction } from "sprotty-protocol/lib/actions";
import { SModelElement as SModelElementSchema, SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { Action, ComputedBoundsAction } from 'sprotty-protocol/lib/actions';
import { SModelElement, SModelRoot } from 'sprotty-protocol/lib/model';
import { Dimension, Point } from 'sprotty-protocol/lib/utils/geometry';
import { SModelIndex } from "sprotty-protocol/lib/utils/model-utils";
import { IActionDispatcher } from "../base/actions/action-dispatcher";
import { ActionHandlerRegistry, IActionHandler, IActionHandlerInitializer } from "../base/actions/action-handler";
import { ICommand } from "../base/commands/command";
import { ViewerOptions } from "../base/views/viewer-options";
import { SModelIndex } from 'sprotty-protocol/lib/utils/model-utils';
import { IActionDispatcher } from '../base/actions/action-dispatcher';
import { ActionHandlerRegistry, IActionHandler, IActionHandlerInitializer } from '../base/actions/action-handler';
import { ICommand } from '../base/commands/command';
import { ViewerOptions } from '../base/views/viewer-options';
/**

@@ -47,3 +47,3 @@ * A model source is serving the model to the event cycle. It represents

initialize(registry: ActionHandlerRegistry): void;
abstract get model(): SModelRootSchema;
abstract get model(): SModelRoot;
abstract handle(action: Action): ICommand | Action | void;

@@ -61,9 +61,9 @@ /**

*/
abstract commitModel(newRoot: SModelRootSchema): Promise<SModelRootSchema> | SModelRootSchema;
abstract commitModel(newRoot: SModelRoot): Promise<SModelRoot> | SModelRoot;
}
export declare class ComputedBoundsApplicator {
apply(root: SModelRootSchema, action: ComputedBoundsAction): SModelIndex;
protected applyAlignment(element: SModelElementSchema, newAlignment: Point): void;
protected applyBounds(element: SModelElementSchema, newPosition: Point | undefined, newSize: Dimension): void;
apply(root: SModelRoot, action: ComputedBoundsAction): SModelIndex;
protected applyAlignment(element: SModelElement, newAlignment: Point): void;
protected applyBounds(element: SModelElement, newPosition: Point | undefined, newSize: Dimension): void;
}
//# sourceMappingURL=model-source.d.ts.map

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

};
exports.ModelSource = ModelSource;
__decorate([

@@ -67,6 +68,5 @@ (0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),

], ModelSource.prototype, "viewerOptions", void 0);
ModelSource = __decorate([
exports.ModelSource = ModelSource = __decorate([
(0, inversify_1.injectable)()
], ModelSource);
exports.ModelSource = ModelSource;
let ComputedBoundsApplicator = class ComputedBoundsApplicator {

@@ -101,6 +101,6 @@ apply(root, action) {

};
ComputedBoundsApplicator = __decorate([
exports.ComputedBoundsApplicator = ComputedBoundsApplicator;
exports.ComputedBoundsApplicator = ComputedBoundsApplicator = __decorate([
(0, inversify_1.injectable)()
], ComputedBoundsApplicator);
exports.ComputedBoundsApplicator = ComputedBoundsApplicator;
//# sourceMappingURL=model-source.js.map

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

********************************************************************************/
import { ActionMessage } from "sprotty-protocol/lib/actions";
import { DiagramServerProxy } from "./diagram-server";
import { ActionMessage } from 'sprotty-protocol/lib/actions';
import { DiagramServerProxy } from './diagram-server';
/**

@@ -28,6 +28,2 @@ * An external ModelSource that connects to the model provider using a websocket.

}
/**
* @deprecated Use `WebSocketDiagramServerProxy` instead;
*/
export declare const WebSocketDiagramServer: typeof WebSocketDiagramServerProxy;
//# sourceMappingURL=websocket.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.WebSocketDiagramServer = exports.WebSocketDiagramServerProxy = void 0;
exports.WebSocketDiagramServerProxy = void 0;
const inversify_1 = require("inversify");

@@ -56,11 +56,6 @@ const diagram_server_1 = require("./diagram-server");

};
WebSocketDiagramServerProxy = __decorate([
exports.WebSocketDiagramServerProxy = WebSocketDiagramServerProxy;
exports.WebSocketDiagramServerProxy = WebSocketDiagramServerProxy = __decorate([
(0, inversify_1.injectable)()
], WebSocketDiagramServerProxy);
exports.WebSocketDiagramServerProxy = WebSocketDiagramServerProxy;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use `WebSocketDiagramServerProxy` instead;
*/
exports.WebSocketDiagramServer = WebSocketDiagramServerProxy;
//# sourceMappingURL=websocket.js.map

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

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

@@ -35,8 +35,8 @@ * Represents an object's insets, for top, bottom, left and right

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

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

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

@@ -67,5 +67,5 @@ /**

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

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

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

@@ -110,14 +110,4 @@ * @param otherLine the other line

*/
export declare function intersection(l1: Line, l2: Line): ProtocolPoint;
export declare function intersection(l1: Line, l2: Line): Point;
/**
* Enumeration of possible directions (left, right, up, down)
* @deprecated do we use this? We should rather use a string type
*/
export declare enum Direction {
left = 0,
right = 1,
up = 2,
down = 3
}
/**
* A minimum and maximum value of a numeric type.

@@ -135,221 +125,2 @@ */

export declare function limit(value: number, limits: Limits): number;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function isBounds(element: any): element is Bounds;
/**
* Combines the bounds of two objects into one, so that the new bounds
* are the minimum bounds that covers both of the original bounds.
* @param {Bounds} b0 - First bounds object
* @param {Bounds} b1 - Second bounds object
* @returns {Bounds} The combined bounds
*
* @deprecated Use `Bounds.combine` from `sprotty-protocol` instead.
*/
export declare function combine(b0: Bounds, b1: Bounds): Bounds;
/**
* Translates the given bounds.
* @param {Bounds} b - Bounds object
* @param {Point} p - Vector by which to translate the bounds
* @returns {Bounds} The translated bounds
*
* @deprecated Use `Bounds.translate` from `sprotty-protocol` instead.
*/
export declare function translate(b: Bounds, p: Point): Bounds;
/**
* Returns the center point of the bounds of an object
* @param {Bounds} b - Bounds object
* @returns {Point} the center point
*
* @deprecated Use `Bounds.center` from `sprotty-protocol` instead.
*/
export declare function center(b: Bounds): Point;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function centerOfLine(s: Point, e: Point): Point;
/**
* Checks whether the point p is included in the bounds b.
*
* @deprecated Use `Bounds.includes` from `sprotty-protocol` instead.
*/
export declare function includes(b: Bounds, p: Point): boolean;
/**
* Returns the "straight line" distance between two points.
* @param {Point} a - First point
* @param {Point} b - Second point
* @returns {number} The Eucledian distance
*
* @deprecated Use `Point.euclideanDistance` from `sprotty-protocol` instead.
*/
export declare function euclideanDistance(a: Point, b: Point): number;
/**
* Returns the distance between two points in a grid, using a
* strictly vertical and/or horizontal path (versus straight line).
* @param {Point} a - First point
* @param {Point} b - Second point
* @returns {number} The Manhattan distance
*
* @deprecated Use `Point.manhattanDistance` from `sprotty-protocol` instead.
*/
export declare function manhattanDistance(a: Point, b: Point): number;
/**
* Returns the maximum of the horizontal and the vertical distance.
* @param {Point} a - First point
* @param {Point} b - Second point
* @returns {number} The maximum distance
*
* @deprecated Use `Point.maxDistance` from `sprotty-protocol` instead.
*/
export declare function maxDistance(a: Point, b: Point): number;
/**
* Computes the angle in radians of the given point to the x-axis of the coordinate system.
* The result is in the range [-pi, pi].
* @param {Point} p - A point in the Eucledian plane
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function angleOfPoint(p: Point): number;
/**
* Computes the angle in radians between the two given points (relative to the origin of the coordinate system).
* The result is in the range [0, pi]. Returns NaN if the points are equal.
* @param {Point} a - First point
* @param {Point} b - Second point
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function angleBetweenPoints(a: Point, b: Point): number;
/**
* Computes a point that is the original `point` shifted towards `refPoint` by the given `distance`.
* @param {Point} point - Point to shift
* @param {Point} refPoint - Point to shift towards
* @param {Point} distance - Distance to shift
*
* @deprecated Use `Point.shiftTowards` from `sprotty-protocol` instead.
*/
export declare function shiftTowards(point: Point, refPoint: Point, distance: number): Point;
/**
* Computes the normalized vector from the vector given in `point`; that is, computing its unit vector.
* @param {Point} point - Point representing the vector to be normalized
* @returns {Point} The normalized point
*
* @deprecated Use `Point.normalize` from `sprotty-protocol` instead.
*/
export declare function normalize(point: Point): Point;
/**
* Computes the magnitude of the vector given in `point`.
* @param {Point} point - Point representing the vector to compute the magnitude for
* @returns {number} The magnitude or also known as length of the `point`
*
* @deprecated Use `Point.magnitude` from `sprotty-protocol` instead.
*/
export declare function magnitude(point: Point): number;
/**
* Converts from radians to degrees
* @param {number} a - A value in radians
* @returns {number} The converted value
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function toDegrees(a: number): number;
/**
* Converts from degrees to radians
* @param {number} a - A value in degrees
* @returns {number} The converted value
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function toRadians(a: number): number;
/**
* Returns whether two numbers are almost equal, within a small margin (0.001)
* @param {number} a - First number
* @param {number} b - Second number
* @returns {boolean} True if the two numbers are almost equal
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export declare function almostEquals(a: number, b: number): boolean;
/**
* Calculates a linear combination of p0 and p1 using lambda, i.e.
* (1-lambda) * p0 + lambda * p1
*
* @deprecated Use `Point.linear` from `sprotty-protocol` instead.
*/
export declare function linear(p0: Point, p1: Point, lambda: number): Point;
/**
* A Point is composed of the (x,y) coordinates of an object.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Point {
readonly x: number;
readonly y: number;
}
/**
* (x,y) coordinates of the origin.
*
* @deprecated Use `Point.ORIGIN` from `sprotty-protocol` instead.
*/
export declare const ORIGIN_POINT: Point;
/**
* Adds two points.
* @param {Point} p1 - First point
* @param {Point} p2 - Second point
* @returns {Point} The sum of the two points
*
* @deprecated Use `Point.add` from `sprotty-protocol` instead.
*/
export declare function add(p1: Point, p2: Point): Point;
/**
* Subtracts two points.
* @param {Point} p1 - First point
* @param {Point} p2 - Second point
* @returns {Point} The difference of the two points
*
* @deprecated Use `Point.subtract` from `sprotty-protocol` instead.
*/
export declare function subtract(p1: Point, p2: Point): Point;
/**
* Specifies whether a point has exactly the same coordinates as another point.
* @param {Point} point1 a point
* @param {Point} point2 another point
* @returns {boolean} `true` if `point1` has exactly the same `x` and `y` values as `point2`, `false` otherwise.
*
* @deprecated Use `Point.equals` from `sprotty-protocol` instead.
*/
export declare function pointEquals(point1: Point, point2: Point): boolean;
/**
* The Dimension of an object is composed of its width and height.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Dimension {
readonly width: number;
readonly height: number;
}
/**
* A dimension with both width and height set to a negative value, which is considered as undefined.
*
* @deprecated Use `Dimension.EMPTY` from `sprotty-protocol` instead.
*/
export declare const EMPTY_DIMENSION: Dimension;
/**
* Checks whether the given dimention is valid, i.e. the width and height are non-zero.
* @param {Dimension} b - Dimension object
* @returns {boolean}
*
* @deprecated Use `Dimension.isValid` from `sprotty-protocol` instead.
*/
export declare function isValidDimension(d: Dimension): boolean;
/**
* The bounds are the position (x, y) and dimension (width, height) of an object.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Bounds extends Point, Dimension {
}
/**
* @deprecated Use `Bounds.EMPTY` from `sprotty-protocol` instead.
*/
export declare const EMPTY_BOUNDS: Bounds;
//# sourceMappingURL=geometry.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.EMPTY_BOUNDS = exports.isValidDimension = exports.EMPTY_DIMENSION = exports.pointEquals = exports.subtract = exports.add = exports.ORIGIN_POINT = 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.includes = exports.centerOfLine = exports.center = exports.translate = exports.combine = exports.isBounds = exports.limit = exports.Direction = exports.intersection = exports.PointToPointLine = exports.Diamond = void 0;
exports.limit = exports.intersection = exports.PointToPointLine = exports.Diamond = void 0;
const sprotty_protocol_1 = require("sprotty-protocol");

@@ -228,13 +228,2 @@ /**

/**
* Enumeration of possible directions (left, right, up, down)
* @deprecated do we use this? We should rather use a string type
*/
var Direction;
(function (Direction) {
Direction[Direction["left"] = 0] = "left";
Direction[Direction["right"] = 1] = "right";
Direction[Direction["up"] = 2] = "up";
Direction[Direction["down"] = 3] = "down";
})(Direction = exports.Direction || (exports.Direction = {}));
/**
* Limits a value to the specified `limits`.

@@ -254,326 +243,2 @@ * @param {number} value - The value to limit

exports.limit = limit;
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function isBounds(element) {
return 'x' in element
&& 'y' in element
&& 'width' in element
&& 'height' in element;
}
exports.isBounds = isBounds;
/**
* Combines the bounds of two objects into one, so that the new bounds
* are the minimum bounds that covers both of the original bounds.
* @param {Bounds} b0 - First bounds object
* @param {Bounds} b1 - Second bounds object
* @returns {Bounds} The combined bounds
*
* @deprecated Use `Bounds.combine` from `sprotty-protocol` instead.
*/
function combine(b0, b1) {
if (!isValidDimension(b0))
return isValidDimension(b1) ? b1 : exports.EMPTY_BOUNDS;
if (!isValidDimension(b1))
return b0;
const minX = Math.min(b0.x, b1.x);
const minY = Math.min(b0.y, b1.y);
const maxX = Math.max(b0.x + (b0.width >= 0 ? b0.width : 0), b1.x + (b1.width >= 0 ? b1.width : 0));
const maxY = Math.max(b0.y + (b0.height >= 0 ? b0.height : 0), b1.y + (b1.height >= 0 ? b1.height : 0));
return {
x: minX, y: minY, width: maxX - minX, height: maxY - minY
};
}
exports.combine = combine;
/**
* Translates the given bounds.
* @param {Bounds} b - Bounds object
* @param {Point} p - Vector by which to translate the bounds
* @returns {Bounds} The translated bounds
*
* @deprecated Use `Bounds.translate` from `sprotty-protocol` instead.
*/
function translate(b, p) {
return {
x: b.x + p.x,
y: b.y + p.y,
width: b.width,
height: b.height
};
}
exports.translate = translate;
/**
* Returns the center point of the bounds of an object
* @param {Bounds} b - Bounds object
* @returns {Point} the center point
*
* @deprecated Use `Bounds.center` from `sprotty-protocol` instead.
*/
function center(b) {
return {
x: b.x + (b.width >= 0 ? 0.5 * b.width : 0),
y: b.y + (b.height >= 0 ? 0.5 * b.height : 0)
};
}
exports.center = center;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function centerOfLine(s, e) {
const b = {
x: s.x > e.x ? e.x : s.x,
y: s.y > e.y ? e.y : s.y,
width: Math.abs(e.x - s.x),
height: Math.abs(e.y - s.y)
};
return center(b);
}
exports.centerOfLine = centerOfLine;
/**
* Checks whether the point p is included in the bounds b.
*
* @deprecated Use `Bounds.includes` from `sprotty-protocol` instead.
*/
function includes(b, p) {
return p.x >= b.x && p.x <= b.x + b.width && p.y >= b.y && p.y <= b.y + b.height;
}
exports.includes = includes;
/**
* Returns the "straight line" distance between two points.
* @param {Point} a - First point
* @param {Point} b - Second point
* @returns {number} The Eucledian distance
*
* @deprecated Use `Point.euclideanDistance` from `sprotty-protocol` instead.
*/
function euclideanDistance(a, b) {
const dx = b.x - a.x;
const dy = b.y - a.y;
return Math.sqrt(dx * dx + dy * dy);
}
exports.euclideanDistance = euclideanDistance;
/**
* Returns the distance between two points in a grid, using a
* strictly vertical and/or horizontal path (versus straight line).
* @param {Point} a - First point
* @param {Point} b - Second point
* @returns {number} The Manhattan distance
*
* @deprecated Use `Point.manhattanDistance` from `sprotty-protocol` instead.
*/
function manhattanDistance(a, b) {
return Math.abs(b.x - a.x) + Math.abs(b.y - a.y);
}
exports.manhattanDistance = manhattanDistance;
/**
* Returns the maximum of the horizontal and the vertical distance.
* @param {Point} a - First point
* @param {Point} b - Second point
* @returns {number} The maximum distance
*
* @deprecated Use `Point.maxDistance` from `sprotty-protocol` instead.
*/
function maxDistance(a, b) {
return Math.max(Math.abs(b.x - a.x), Math.abs(b.y - a.y));
}
exports.maxDistance = maxDistance;
/**
* Computes the angle in radians of the given point to the x-axis of the coordinate system.
* The result is in the range [-pi, pi].
* @param {Point} p - A point in the Eucledian plane
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function angleOfPoint(p) {
return Math.atan2(p.y, p.x);
}
exports.angleOfPoint = angleOfPoint;
/**
* Computes the angle in radians between the two given points (relative to the origin of the coordinate system).
* The result is in the range [0, pi]. Returns NaN if the points are equal.
* @param {Point} a - First point
* @param {Point} b - Second point
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function angleBetweenPoints(a, b) {
const lengthProduct = Math.sqrt((a.x * a.x + a.y * a.y) * (b.x * b.x + b.y * b.y));
if (isNaN(lengthProduct) || lengthProduct === 0)
return NaN;
const dotProduct = a.x * b.x + a.y * b.y;
return Math.acos(dotProduct / lengthProduct);
}
exports.angleBetweenPoints = angleBetweenPoints;
/**
* Computes a point that is the original `point` shifted towards `refPoint` by the given `distance`.
* @param {Point} point - Point to shift
* @param {Point} refPoint - Point to shift towards
* @param {Point} distance - Distance to shift
*
* @deprecated Use `Point.shiftTowards` from `sprotty-protocol` instead.
*/
function shiftTowards(point, refPoint, distance) {
const diff = subtract(refPoint, point);
const normalized = normalize(diff);
const shift = { x: normalized.x * distance, y: normalized.y * distance };
return add(point, shift);
}
exports.shiftTowards = shiftTowards;
/**
* Computes the normalized vector from the vector given in `point`; that is, computing its unit vector.
* @param {Point} point - Point representing the vector to be normalized
* @returns {Point} The normalized point
*
* @deprecated Use `Point.normalize` from `sprotty-protocol` instead.
*/
function normalize(point) {
const mag = magnitude(point);
if (mag === 0 || mag === 1) {
return exports.ORIGIN_POINT;
}
return {
x: point.x / mag,
y: point.y / mag
};
}
exports.normalize = normalize;
/**
* Computes the magnitude of the vector given in `point`.
* @param {Point} point - Point representing the vector to compute the magnitude for
* @returns {number} The magnitude or also known as length of the `point`
*
* @deprecated Use `Point.magnitude` from `sprotty-protocol` instead.
*/
function magnitude(point) {
return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
}
exports.magnitude = magnitude;
/**
* Converts from radians to degrees
* @param {number} a - A value in radians
* @returns {number} The converted value
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function toDegrees(a) {
return a * 180 / Math.PI;
}
exports.toDegrees = toDegrees;
/**
* Converts from degrees to radians
* @param {number} a - A value in degrees
* @returns {number} The converted value
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function toRadians(a) {
return a * Math.PI / 180;
}
exports.toRadians = toRadians;
/**
* Returns whether two numbers are almost equal, within a small margin (0.001)
* @param {number} a - First number
* @param {number} b - Second number
* @returns {boolean} True if the two numbers are almost equal
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
function almostEquals(a, b) {
return Math.abs(a - b) < 1e-3;
}
exports.almostEquals = almostEquals;
/**
* Calculates a linear combination of p0 and p1 using lambda, i.e.
* (1-lambda) * p0 + lambda * p1
*
* @deprecated Use `Point.linear` from `sprotty-protocol` instead.
*/
function linear(p0, p1, lambda) {
return {
x: (1 - lambda) * p0.x + lambda * p1.x,
y: (1 - lambda) * p0.y + lambda * p1.y
};
}
exports.linear = linear;
/**
* (x,y) coordinates of the origin.
*
* @deprecated Use `Point.ORIGIN` from `sprotty-protocol` instead.
*/
exports.ORIGIN_POINT = Object.freeze({
x: 0,
y: 0
});
/**
* Adds two points.
* @param {Point} p1 - First point
* @param {Point} p2 - Second point
* @returns {Point} The sum of the two points
*
* @deprecated Use `Point.add` from `sprotty-protocol` instead.
*/
function add(p1, p2) {
return {
x: p1.x + p2.x,
y: p1.y + p2.y
};
}
exports.add = add;
/**
* Subtracts two points.
* @param {Point} p1 - First point
* @param {Point} p2 - Second point
* @returns {Point} The difference of the two points
*
* @deprecated Use `Point.subtract` from `sprotty-protocol` instead.
*/
function subtract(p1, p2) {
return {
x: p1.x - p2.x,
y: p1.y - p2.y
};
}
exports.subtract = subtract;
/**
* Specifies whether a point has exactly the same coordinates as another point.
* @param {Point} point1 a point
* @param {Point} point2 another point
* @returns {boolean} `true` if `point1` has exactly the same `x` and `y` values as `point2`, `false` otherwise.
*
* @deprecated Use `Point.equals` from `sprotty-protocol` instead.
*/
function pointEquals(point1, point2) {
return point1.x === point2.x && point1.y === point2.y;
}
exports.pointEquals = pointEquals;
/**
* A dimension with both width and height set to a negative value, which is considered as undefined.
*
* @deprecated Use `Dimension.EMPTY` from `sprotty-protocol` instead.
*/
exports.EMPTY_DIMENSION = Object.freeze({
width: -1,
height: -1
});
/**
* Checks whether the given dimention is valid, i.e. the width and height are non-zero.
* @param {Dimension} b - Dimension object
* @returns {boolean}
*
* @deprecated Use `Dimension.isValid` from `sprotty-protocol` instead.
*/
function isValidDimension(d) {
return d.width >= 0 && d.height >= 0;
}
exports.isValidDimension = isValidDimension;
/**
* @deprecated Use `Bounds.EMPTY` from `sprotty-protocol` instead.
*/
exports.EMPTY_BOUNDS = Object.freeze({
x: 0,
y: 0,
width: -1,
height: -1
});
//# sourceMappingURL=geometry.js.map

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

LogLevel[LogLevel["log"] = 4] = "log";
})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
})(LogLevel || (exports.LogLevel = LogLevel = {}));
let NullLogger = class NullLogger {

@@ -48,6 +48,6 @@ constructor() {

};
NullLogger = __decorate([
exports.NullLogger = NullLogger;
exports.NullLogger = NullLogger = __decorate([
(0, inversify_1.injectable)()
], NullLogger);
exports.NullLogger = NullLogger;
let ConsoleLogger = class ConsoleLogger {

@@ -96,2 +96,3 @@ constructor() {

};
exports.ConsoleLogger = ConsoleLogger;
__decorate([

@@ -105,6 +106,5 @@ (0, inversify_1.inject)(types_1.TYPES.LogLevel),

], ConsoleLogger.prototype, "viewOptions", void 0);
ConsoleLogger = __decorate([
exports.ConsoleLogger = ConsoleLogger = __decorate([
(0, inversify_1.injectable)()
], ConsoleLogger);
exports.ConsoleLogger = ConsoleLogger;
//# sourceMappingURL=logging.js.map

@@ -56,6 +56,6 @@ "use strict";

};
ProviderRegistry = __decorate([
exports.ProviderRegistry = ProviderRegistry;
exports.ProviderRegistry = ProviderRegistry = __decorate([
(0, inversify_1.injectable)()
], ProviderRegistry);
exports.ProviderRegistry = ProviderRegistry;
let FactoryRegistry = class FactoryRegistry {

@@ -66,11 +66,14 @@ constructor() {

register(key, factory) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
if (this.hasKey(key))
}
if (this.hasKey(key)) {
throw new Error('Key is already registered: ' + key);
}
this.elements.set(key, factory);
}
deregister(key) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
}
this.elements.delete(key);

@@ -83,6 +86,8 @@ }

const existingFactory = this.elements.get(key);
if (existingFactory)
if (existingFactory) {
return existingFactory(arg);
else
}
else {
return this.missing(key, arg);
}
}

@@ -93,6 +98,6 @@ missing(key, arg) {

};
FactoryRegistry = __decorate([
exports.FactoryRegistry = FactoryRegistry;
exports.FactoryRegistry = FactoryRegistry = __decorate([
(0, inversify_1.injectable)()
], FactoryRegistry);
exports.FactoryRegistry = FactoryRegistry;
let InstanceRegistry = class InstanceRegistry {

@@ -103,11 +108,14 @@ constructor() {

register(key, instance) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
if (this.hasKey(key))
}
if (this.hasKey(key)) {
throw new Error('Key is already registered: ' + key);
}
this.elements.set(key, instance);
}
deregister(key) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
}
this.elements.delete(key);

@@ -120,6 +128,8 @@ }

const existingInstance = this.elements.get(key);
if (existingInstance)
if (existingInstance) {
return existingInstance;
else
}
else {
return this.missing(key);
}
}

@@ -130,6 +140,6 @@ missing(key) {

};
InstanceRegistry = __decorate([
exports.InstanceRegistry = InstanceRegistry;
exports.InstanceRegistry = InstanceRegistry = __decorate([
(0, inversify_1.injectable)()
], InstanceRegistry);
exports.InstanceRegistry = InstanceRegistry;
let MultiInstanceRegistry = class MultiInstanceRegistry {

@@ -140,13 +150,17 @@ constructor() {

register(key, instance) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
}
const instances = this.elements.get(key);
if (instances !== undefined)
if (instances !== undefined) {
instances.push(instance);
else
}
else {
this.elements.set(key, [instance]);
}
}
deregisterAll(key) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
}
this.elements.delete(key);

@@ -156,12 +170,14 @@ }

const existingInstances = this.elements.get(key);
if (existingInstances !== undefined)
if (existingInstances !== undefined) {
return existingInstances;
else
}
else {
return [];
}
}
};
MultiInstanceRegistry = __decorate([
exports.MultiInstanceRegistry = MultiInstanceRegistry;
exports.MultiInstanceRegistry = MultiInstanceRegistry = __decorate([
(0, inversify_1.injectable)()
], MultiInstanceRegistry);
exports.MultiInstanceRegistry = MultiInstanceRegistry;
//# sourceMappingURL=registry.js.map
{
"name": "sprotty",
"version": "0.15.0-next.7444211.0+7444211",
"version": "0.15.0-next.044bba2.13+044bba2",
"description": "A next-gen framework for graphical views",

@@ -14,72 +14,32 @@ "license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",

],
"homepage": "https://github.com/eclipse/sprotty",
"bugs": "https://github.com/eclipse/sprotty/issues",
"homepage": "https://github.com/eclipse-sprotty/sprotty",
"bugs": "https://github.com/eclipse-sprotty/sprotty/issues",
"author": {
"name": "Eclipse Sprotty"
},
"contributors": [
{
"name": "Marc Dumais",
"email": "marc.dumais@ericsson.com",
"url": "https://www.ericsson.com/"
},
{
"name": "Takashi Katou"
},
{
"name": "Jan Köhnlein",
"email": "jan.koehnlein@typefox.io",
"url": "https://www.typefox.io"
},
{
"name": "Philip Langer",
"email": "planger@eclipsesource.com",
"url": "https://www.eclipsesource.com"
},
{
"name": "Tobias Ortmayr",
"email": "tortmayr@eclipsesource.com",
"url": "https://www.eclipsesource.com"
},
{
"name": "Miro Spönemann",
"email": "miro.spoenemann@typefox.io",
"url": "https://www.typefox.io"
}
],
"repository": {
"type": "git",
"url": "https://github.com/eclipse/sprotty",
"url": "https://github.com/eclipse-sprotty/sprotty",
"directory": "packages/sprotty"
},
"peerDependencies": {
"inversify": "~6.0.1"
"inversify": "^6.0.1"
},
"dependencies": {
"autocompleter": "^7.0.1",
"autocompleter": "^9.1.0",
"file-saver": "^2.0.5",
"snabbdom": "^3.5.1",
"sprotty-protocol": "0.15.0-next.7444211.0+7444211",
"sprotty-protocol": "0.15.0-next.044bba2.13+044bba2",
"tinyqueue": "^2.0.3"
},
"devDependencies": {
"@types/chai": "^4.3.4",
"@types/chai": "^4.3.6",
"@types/file-saver": "^2.0.5",
"@types/jsdom": "^20.0.1",
"@types/mocha": "^10.0.1",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"chai": "^4.3.7",
"eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-no-null": "^1.0.2",
"jsdom": "^20.0.3",
"@types/jsdom": "^21.1.3",
"@types/mocha": "^10.0.2",
"chai": "^4.3.10",
"jsdom": "^22.1.0",
"mocha": "^10.2.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"semver": "^7.3.8",
"snabbdom-to-html": "^7.1.0",
"ts-mocha": "^10.0.0",
"typescript": "~5.0.4"
"ts-mocha": "^10.0.0"
},

@@ -105,3 +65,3 @@ "scripts": {

],
"gitHead": "7444211c45750bd26aca2ba149c411ce4924c034"
"gitHead": "044bba2532322afd96dfec2cb68586c200eea188"
}

@@ -24,5 +24,5 @@ # Sprotty

For further information please consult the [Wiki](https://github.com/eclipse/sprotty/wiki).
For further information please consult the [documentation on the website](https://sprotty.org/docs/).
The version history is documented in the [CHANGELOG](https://github.com/eclipse/sprotty/blob/master/packages/sprotty/CHANGELOG.md).
The version history is documented in the [CHANGELOG](https://github.com/eclipse-sprotty/sprotty/blob/master/packages/sprotty/CHANGELOG.md).

@@ -29,0 +29,0 @@ ## References

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

Action, isAction, isRequestAction, isResponseAction, RedoAction, RejectAction, RequestAction,
ResponseAction, SetModelAction, UndoAction
ResponseAction, SetModelAction, setRequestContext, UndoAction
} from 'sprotty-protocol/lib/actions';

@@ -38,2 +38,6 @@ import { Deferred } from 'sprotty-protocol/lib/utils/async';

// This code should be used only in the client part of a Sprotty application.
// We set the request context to 'client' to avoid collisions with requests created by the server.
setRequestContext('client');
/**

@@ -40,0 +44,0 @@ * Collects actions, converts them to commands and dispatches them.

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

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

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

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

@@ -37,79 +35,1 @@

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* An action describes a change to the model declaratively.
* It is a plain data structure, and as such transferable between server and client. An action must never contain actual
* SModelElement instances, but either refer to them via their ids or contain serializable schema for model elements.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Action {
readonly kind: string
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function isAction(object?: unknown): object is Action {
return hasOwnProperty<string, string>(object, 'kind', 'string');
}
/**
* A request action is tied to the expectation of receiving a corresponding response action.
* The `requestId` property is used to match the received response with the original request.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface RequestAction<Res extends ResponseAction> extends Action {
readonly requestId: string
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function isRequestAction(object?: unknown): object is RequestAction<ResponseAction> {
return isAction(object) && hasOwnProperty<string, string>(object, 'requestId', 'string');
}
/**
* Generate a unique `requestId` for a request action.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export const generateRequestId: () => string = generateRequestId2;
/**
* A response action is sent to respond to a request action. The `responseId` must match
* the `requestId` of the preceding request. In case the `responseId` is empty or undefined,
* the action is handled as standalone, i.e. it was fired without a preceding request.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ResponseAction extends Action {
readonly responseId: string
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function isResponseAction(object?: unknown): object is ResponseAction {
return isAction(object) && hasOwnProperty<string, string>(object, 'responseId', 'string')
&& object.responseId !== '';
}
/**
* A reject action is fired to indicate that a request must be rejected.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class RejectAction implements ResponseAction {
static readonly KIND = 'rejectRequest';
readonly kind = RejectAction.KIND;
constructor(public readonly message: string,
public readonly responseId: string,
public readonly detail?: JsonAny) {}
}

@@ -184,3 +184,3 @@ /********************************************************************************

/** Used to turn sprotty schema elements (e.g. from the action) into model elements */
/** Used to turn sprotty external model elements (e.g. from the action) into internal model elements */
modelFactory: IModelFactory

@@ -187,0 +187,0 @@

@@ -19,13 +19,12 @@ /********************************************************************************

import 'mocha';
import { expect } from "chai";
import { expect } from 'chai';
import { Container } from 'inversify';
import { TYPES } from '../types';
import { SModelElementImpl } from "../model/smodel";
import { EMPTY_ROOT } from '../model/smodel-factory';
import { SGraphFactory } from "../../graph/sgraph-factory";
import { CommandExecutionContext } from "../commands/command";
import { ConsoleLogger } from "../../utils/logging";
import { AnimationFrameSyncer } from "../animations/animation-frame-syncer";
import { SetModelCommand } from "./set-model";
import defaultModule from "../di.config";
import { SModelElementImpl } from '../model/smodel';
import { EMPTY_ROOT, IModelFactory } from '../model/smodel-factory';
import { CommandExecutionContext } from '../commands/command';
import { ConsoleLogger } from '../../utils/logging';
import { AnimationFrameSyncer } from '../animations/animation-frame-syncer';
import { SetModelCommand } from './set-model';
import defaultModule from '../di.config';
import { SModelElement, SModelRoot, SetModelAction } from 'sprotty-protocol';

@@ -40,4 +39,5 @@

for (const i in expectedProp) {
if (expectedProp.hasOwnProperty(i))
if (expectedProp.hasOwnProperty(i)) {
compare(expectedProp[i], actualProp[i]);
}
}

@@ -54,5 +54,4 @@ } else {

container.load(defaultModule);
container.rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const graphFactory = container.get<SGraphFactory>(TYPES.IModelFactory);
const graphFactory = container.get<IModelFactory>(TYPES.IModelFactory);

@@ -100,3 +99,3 @@ const emptyRoot = graphFactory.createRoot(EMPTY_ROOT);

it('undo() returns the previous model', () => {
// test "undo": returns old model
// test 'undo': returns old model
expect(model1.id).to.equal(cmd.undo(context).id);

@@ -106,3 +105,3 @@ });

it('redo() returns the new model', () => {
// test "redo": returns new model
// test 'redo': returns new model
const newModel = cmd.redo(context);

@@ -109,0 +108,0 @@ compare(model2, newModel);

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

import { inject, injectable } from "inversify";
import {
Action, generateRequestId, RequestAction, ResponseAction,
RequestModelAction as ProtocolRequestModelAction, SetModelAction as ProtocolSetModelAction
} from "sprotty-protocol/lib/actions";
import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { JsonPrimitive } from "sprotty-protocol/lib/utils/json";
import { Action, SetModelAction } from "sprotty-protocol/lib/actions";
import { CommandExecutionContext, ResetCommand } from "../commands/command";

@@ -32,3 +27,3 @@ import { SModelRootImpl } from "../model/smodel";

export class SetModelCommand extends ResetCommand {
static readonly KIND = ProtocolSetModelAction.KIND;
static readonly KIND = SetModelAction.KIND;

@@ -38,3 +33,3 @@ oldRoot: SModelRootImpl;

constructor(@inject(TYPES.Action) protected readonly action: ProtocolSetModelAction) {
constructor(@inject(TYPES.Action) protected readonly action: SetModelAction) {
super();

@@ -61,36 +56,1 @@ }

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Sent from the client to the model source (e.g. a DiagramServer) in order to request a model. Usually this
* is the first message that is sent to the source, so it is also used to initiate the communication.
* The response is a SetModelAction or an UpdateModelAction.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class RequestModelAction implements ProtocolRequestModelAction {
static readonly KIND = 'requestModel';
readonly kind = RequestModelAction.KIND;
constructor(public readonly options?: { [key: string]: JsonPrimitive },
public readonly requestId = '') { }
/** Factory function to dispatch a request with the `IActionDispatcher` */
static create(options?: { [key: string]: JsonPrimitive }): RequestAction<SetModelAction> {
return new RequestModelAction(options, generateRequestId());
}
}
/**
* Sent from the model source to the client in order to set the model. If a model is already present, it is replaced.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class SetModelAction implements ResponseAction, ProtocolSetModelAction {
static readonly KIND = 'setModel';
readonly kind = SetModelAction.KIND;
constructor(public readonly newRoot: SModelRootSchema,
public readonly responseId = '') { }
}

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

import { injectable, multiInject, optional, inject } from 'inversify';
import { SModelElement as SModelElementSchema, SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { SModelElement, SModelRoot } from 'sprotty-protocol/lib/model';
import { TYPES } from "../types";

@@ -66,7 +66,7 @@ import { FactoryRegistry } from '../../utils/registry';

export interface IModelFactory {
createElement(schema: SModelElementSchema | SModelElementImpl, parent?: SParentElementImpl): SChildElementImpl
createElement(schema: SModelElement | SModelElementImpl, parent?: SParentElementImpl): SChildElementImpl
createRoot(schema: SModelRootSchema | SModelRootImpl): SModelRootImpl
createRoot(schema: SModelRoot | SModelRootImpl): SModelRootImpl
createSchema(element: SModelElementImpl): SModelElementSchema
createSchema(element: SModelElementImpl): SModelElement
}

@@ -83,3 +83,3 @@

createElement(schema: SModelElementSchema | SModelElementImpl, parent?: SParentElementImpl): SChildElementImpl {
createElement(schema: SModelElement | SModelElementImpl, parent?: SParentElementImpl): SChildElementImpl {
let child: SChildElementImpl;

@@ -97,3 +97,3 @@ if (this.registry.hasKey(schema.type)) {

createRoot(schema: SModelRootSchema | SModelRootImpl): SModelRootImpl {
createRoot(schema: SModelRoot | SModelRootImpl): SModelRootImpl {
let root: SModelRootImpl;

@@ -111,3 +111,3 @@ if (this.registry.hasKey(schema.type)) {

createSchema(element: SModelElementImpl): SModelElementSchema {
createSchema(element: SModelElementImpl): SModelElement {
const schema = {};

@@ -123,6 +123,6 @@ for (const key in element) {

(schema as any)['children'] = element.children.map(child => this.createSchema(child));
return schema as SModelElementSchema;
return schema as SModelElement;
}
protected initializeElement(element: SModelElementImpl, schema: SModelElementSchema | SModelElementImpl): SModelElementImpl {
protected initializeElement(element: SModelElementImpl, schema: SModelElement | SModelElementImpl): SModelElementImpl {
for (const key in schema) {

@@ -151,3 +151,3 @@ if (!this.isReserved(element, key)) {

protected initializeParent(parent: SParentElementImpl, schema: SModelElementSchema | SParentElementImpl): SParentElementImpl {
protected initializeParent(parent: SParentElementImpl, schema: SModelElement | SParentElementImpl): SParentElementImpl {
this.initializeElement(parent, schema);

@@ -160,3 +160,3 @@ if (isParent(schema)) {

protected initializeChild(child: SChildElementImpl, schema: SModelElementSchema, parent?: SParentElementImpl): SChildElementImpl {
protected initializeChild(child: SChildElementImpl, schema: SModelElement, parent?: SParentElementImpl): SChildElementImpl {
this.initializeParent(child, schema);

@@ -169,3 +169,3 @@ if (parent !== undefined) {

protected initializeRoot(root: SModelRootImpl, schema: SModelRootSchema | SModelRootImpl): SModelRootImpl {
protected initializeRoot(root: SModelRootImpl, schema: SModelRoot | SModelRootImpl): SModelRootImpl {
this.initializeParent(root, schema);

@@ -177,3 +177,3 @@ root.index.add(root);

export const EMPTY_ROOT: Readonly<SModelRootSchema> = Object.freeze({
export const EMPTY_ROOT: Readonly<SModelRoot> = Object.freeze({
type: 'NONE',

@@ -180,0 +180,0 @@ id: 'EMPTY'

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

import { interfaces } from "inversify";
import { SModelElement as SModelElementSchema } from 'sprotty-protocol/lib/model';
import { Bounds, Point } from "sprotty-protocol/lib/utils/geometry";

@@ -129,54 +128,1 @@ import { TYPES } from "../types";

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Model element types can include a colon to separate the basic type and a sub-type. This function
* extracts the basic type of a model element.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function getBasicType(schema: SModelElementSchema | SModelElementImpl): string {
if (!schema.type)
return '';
const colonIndex = schema.type.indexOf(':');
if (colonIndex >= 0)
return schema.type.substring(0, colonIndex);
else
return schema.type;
}
/**
* Model element types can include a colon to separate the basic type and a sub-type. This function
* extracts the sub-type of a model element.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function getSubType(schema: SModelElementSchema | SModelElementImpl): string {
if (!schema.type)
return '';
const colonIndex = schema.type.indexOf(':');
if (colonIndex >= 0)
return schema.type.substring(colonIndex + 1);
else
return schema.type;
}
/**
* Find the element with the given identifier. If you need to find multiple elements, using an
* SModelIndex might be more effective.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function findElement(parent: SModelElementSchema, elementId: string): SModelElementSchema | undefined {
if (parent.id === elementId)
return parent;
if (parent.children !== undefined) {
for (const child of parent.children) {
const result = findElement(child, elementId);
if (result !== undefined)
return result;
}
}
return undefined;
}

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

import { SModelElement as ProtocolSModelElement } from 'sprotty-protocol';
import { SModelElement } from 'sprotty-protocol/lib/model';
import { Bounds, isBounds, Point } from 'sprotty-protocol/lib/utils/geometry';

@@ -63,4 +63,4 @@ import { FluentIterable, mapIterable } from '../../utils/iterable';

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

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

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

@@ -252,39 +252,1 @@

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* The schema of an SModelElement describes its serializable form. The actual model is created from
* its schema with an IModelFactory.
* Each model element must have a unique ID and a type that is used to look up its view.
*
* @deprecated Use `SModelElement` from `sprotty-protocol` instead.
*/
export interface SModelElementSchema {
type: string
id: string
children?: SModelElementSchema[]
cssClasses?: string[]
}
/**
* Serializable schema for the root element of the model tree.
*
* @deprecated Use `SModelRoot` from `sprotty-protocol` instead.
*/
export interface SModelRootSchema extends SModelElementSchema {
canvasBounds?: Bounds
revision?: number
}
/** @deprecated Use `SParentElementImpl` instead. */
export const SParentElement = SParentElementImpl;
/** @deprecated Use `SChildElementImpl` instead. */
export const SChildElement = SChildElementImpl;
/** @deprecated Use `SModelElementImpl` instead. */
export const SModelElement = SModelElementImpl;
/** @deprecated Use `SModelRootImpl` instead. */
export const SModelRoot = SModelRootImpl;

@@ -77,7 +77,3 @@ /********************************************************************************

IViewerProvider: Symbol('IViewerProvider'),
/** @deprecated deprecated since 0.12.0 - please use `configureButtonHandler` */
IButtonHandler: Symbol('IButtonHandler'),
/** @deprecated `deprecated since 0.14.0 - the Tool/Toolmanager API is no longer supported */
IToolManager: Symbol('IToolManager')
};
/* eslint-enable */

@@ -17,11 +17,8 @@ /********************************************************************************

import { inject, injectable } from "inversify";
import {
Action, generateRequestId, RequestAction, ResponseAction, ComputedBoundsAction as ProtocolComputedBoundsAction} from 'sprotty-protocol/lib/actions';
import * as protocol from "sprotty-protocol/lib/actions";
import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { Bounds, Dimension, Point } from "sprotty-protocol/lib/utils/geometry";
import { CommandExecutionContext, CommandResult, CommandReturn, HiddenCommand, SystemCommand } from "../../base/commands/command";
import { SModelElementImpl } from "../../base/model/smodel";
import { TYPES } from "../../base/types";
import { inject, injectable } from 'inversify';
import { Action, ComputedBoundsAction, RequestBoundsAction, SetBoundsAction } from 'sprotty-protocol/lib/actions';
import { Bounds, Dimension, Point } from 'sprotty-protocol/lib/utils/geometry';
import { CommandExecutionContext, CommandResult, CommandReturn, HiddenCommand, SystemCommand } from '../../base/commands/command';
import { SModelElementImpl } from '../../base/model/smodel';
import { TYPES } from '../../base/types';
import { Alignable, BoundsAware, isBoundsAware } from './model';

@@ -44,7 +41,7 @@

export class SetBoundsCommand extends SystemCommand {
static readonly KIND: string = protocol.SetBoundsAction.KIND;
static readonly KIND: string = SetBoundsAction.KIND;
protected bounds: ResolvedElementAndBounds[] = [];
constructor(@inject(TYPES.Action) protected readonly action: protocol.SetBoundsAction) {
constructor(@inject(TYPES.Action) protected readonly action: SetBoundsAction) {
super();

@@ -100,5 +97,5 @@ }

export class RequestBoundsCommand extends HiddenCommand {
static readonly KIND: string = protocol.RequestBoundsAction.KIND;
static readonly KIND: string = RequestBoundsAction.KIND;
constructor(@inject(TYPES.Action) protected action: protocol.RequestBoundsAction) {
constructor(@inject(TYPES.Action) protected action: RequestBoundsAction) {
super();

@@ -116,94 +113,4 @@ }

get blockUntil(): (action: Action) => boolean {
return action => action.kind === ProtocolComputedBoundsAction.KIND;
return action => action.kind === ComputedBoundsAction.KIND;
}
}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Sent from the model source (e.g. a DiagramServer) to the client to update the bounds of some
* (or all) model elements.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class SetBoundsAction implements Action, protocol.SetBoundsAction {
static readonly KIND = 'setBounds';
readonly kind = SetBoundsAction.KIND;
constructor(public readonly bounds: ElementAndBounds[]) {
}
}
/**
* Sent from the model source to the client to request bounds for the given model. The model is
* rendered invisibly so the bounds can derived from the DOM. The response is a ComputedBoundsAction.
* This hidden rendering round-trip is necessary if the client is responsible for parts of the layout
* (see `needsClientLayout` viewer option).
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class RequestBoundsAction implements RequestAction<ComputedBoundsAction>, protocol.RequestBoundsAction {
static readonly KIND = 'requestBounds';
readonly kind = RequestBoundsAction.KIND;
constructor(public readonly newRoot: SModelRootSchema,
public readonly requestId: string = '') { }
/** Factory function to dispatch a request with the `IActionDispatcher` */
static create(newRoot: SModelRootSchema): RequestAction<ComputedBoundsAction> {
return new RequestBoundsAction(newRoot, generateRequestId());
}
}
/**
* Sent from the client to the model source (e.g. a DiagramServer) to transmit the result of bounds
* computation as a response to a RequestBoundsAction. If the server is responsible for parts of
* the layout (see `needsServerLayout` viewer option), it can do so after applying the computed bounds
* received with this action. Otherwise there is no need to send the computed bounds to the server,
* so they can be processed locally by the client.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class ComputedBoundsAction implements ResponseAction, protocol.ComputedBoundsAction {
static readonly KIND = 'computedBounds';
readonly kind = ComputedBoundsAction.KIND;
constructor(public readonly bounds: ElementAndBounds[],
public readonly revision?: number,
public readonly alignments?: ElementAndAlignment[],
public readonly responseId = '') { }
}
/**
* Associates new bounds with a model element, which is referenced via its id.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ElementAndBounds extends protocol.ElementAndBounds {
elementId: string
newPosition?: Point
newSize: Dimension
}
/**
* Associates a new alignment with a model element, which is referenced via its id.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ElementAndAlignment extends protocol.ElementAndAlignment{
elementId: string
newAlignment: Point
}
/**
* Request a layout of the diagram or the selected elements only.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class LayoutAction implements Action, protocol.LayoutAction {
static readonly KIND = 'layout';
readonly kind = LayoutAction.KIND;
layoutType: string;
elementIds: string[];
}

@@ -17,15 +17,15 @@ /********************************************************************************

import { expect } from "chai";
import { expect } from 'chai';
import { Container } from 'inversify';
import 'mocha';
import 'reflect-metadata';
import { AnimationFrameSyncer } from "../../base/animations/animation-frame-syncer";
import { CommandExecutionContext } from "../../base/commands/command";
import defaultModule from "../../base/di.config";
import { AnimationFrameSyncer } from '../../base/animations/animation-frame-syncer';
import { CommandExecutionContext } from '../../base/commands/command';
import defaultModule from '../../base/di.config';
import { TYPES } from '../../base/types';
import { SGraphImpl, SNodeImpl } from "../../graph/sgraph";
import { SGraphFactory } from "../../graph/sgraph-factory";
import { ConsoleLogger } from "../../utils/logging";
import { SetBoundsCommand } from "../bounds/bounds-manipulation";
import { SNode, SetBoundsAction } from "sprotty-protocol";
import { SGraphImpl, SNodeImpl } from '../../graph/sgraph';
import { ConsoleLogger } from '../../utils/logging';
import { SetBoundsCommand } from '../bounds/bounds-manipulation';
import { SNode, SetBoundsAction } from 'sprotty-protocol';
import { IModelFactory } from '../../base/model/smodel-factory';

@@ -35,5 +35,4 @@ describe('SetBoundsCommand', () => {

container.load(defaultModule);
container.rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const graphFactory = container.get<SGraphFactory>(TYPES.IModelFactory);
const graphFactory = container.get<IModelFactory>(TYPES.IModelFactory);

@@ -40,0 +39,0 @@ const boundsInitial = { x: 0, y: 0, width: 0, height: 0 };

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

import { Bounds, Dimension, isBounds, Point } from 'sprotty-protocol/lib/utils/geometry';
import { SModelElement as SModelElementSchema } from 'sprotty-protocol/lib/model';
import { SChildElementImpl, SModelElementImpl, SModelRootImpl, SParentElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
import { findParentByFeature } from '../../base/model/smodel-utils';

@@ -37,4 +35,6 @@ import { DOMHelper } from '../../base/views/dom-helper';

* used in the _internal model_, while the other is used in the _external model_.
*
* Feature extension interface for {@link boundsFeature}.
*/
export interface BoundsAware extends SModelExtension {
export interface BoundsAware {
bounds: Bounds

@@ -52,3 +52,6 @@ }

export interface LayoutableChild extends SModelExtension, BoundsAware {
/**
* Feature extension interface for {@link layoutableChildFeature}.
*/
export interface LayoutableChild extends BoundsAware {
layoutOptions?: ModelLayoutOptions

@@ -60,4 +63,6 @@ }

* labels, or pre-rendered SVG figures.
*
* Feature extension interface for {@link alignFeature}.
*/
export interface Alignable extends SModelExtension {
export interface Alignable {
alignment: Point

@@ -222,17 +227,1 @@ }

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/** @deprecated Use `SShapeElementImpl` instead. */
export const SShapeElement = SShapeElementImpl;
/**
* Serializable schema for SShapeElement.
*
* @deprecated Use `SShapeElement` from `sprotty-protocol` instead.
*/
export interface SShapeElementSchema extends SModelElementSchema {
position?: Point
size?: Dimension
layoutOptions?: ModelLayoutOptions
}

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

import { IViewArgs, RenderingContext } from '../../base/views/view';
import { ViewportRootElement } from '../viewport/viewport-root';
import { ViewportRootElementImpl } from '../viewport/viewport-root';
import { SShapeElementImpl } from './model';

@@ -37,4 +37,4 @@ import { ShapeView } from './views';

function createModel(): ViewportRootElement {
const root = new ViewportRootElement();
function createModel(): ViewportRootElementImpl {
const root = new ViewportRootElementImpl();
root.canvasBounds = { x: 0, y: 0, width: 100, height: 100 };

@@ -41,0 +41,0 @@ const node1 = new TestNode();

@@ -28,8 +28,2 @@ /********************************************************************************

/** @deprecated deprecated since 0.12.0 - please use `configureButtonHandler` */
export interface IButtonHandlerFactory {
TYPE: string
new(): IButtonHandler
}
export interface IButtonHandlerRegistration {

@@ -44,9 +38,5 @@ TYPE: string

constructor(
@multiInject(TYPES.IButtonHandlerRegistration)@optional() buttonHandlerRegistrations: IButtonHandlerRegistration[],
// deprecated, but keep support for now
@multiInject(TYPES.IButtonHandler)@optional() buttonHandlerFactories: IButtonHandlerFactory[]) {
@multiInject(TYPES.IButtonHandlerRegistration)@optional() buttonHandlerRegistrations: IButtonHandlerRegistration[]) {
super();
buttonHandlerRegistrations.forEach(factory => this.register(factory.TYPE, factory.factory()));
// deprecated, but keep support for now
buttonHandlerFactories.forEach(factory => this.register(factory.TYPE, new factory()));
}

@@ -53,0 +43,0 @@ }

@@ -17,7 +17,7 @@ /********************************************************************************

import { SShapeElement } from 'sprotty-protocol';
import { boundsFeature, layoutableChildFeature, SShapeElementImpl } from '../bounds/model';
import { fadeFeature } from '../fade/model';
import { SShapeElement as SShapeElementSchema } from 'sprotty-protocol';
export interface SButtonSchema extends SShapeElementSchema {
export interface SButtonSchema extends SShapeElement {
pressed: boolean

@@ -32,6 +32,1 @@ enabled: boolean

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/** @deprecated Use `SButtonImpl` instead. */
export const SButton = SButtonImpl;

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

import { SModelExtension } from '../../base/model/smodel-extension';
import { SModelElementImpl } from '../../base/model/smodel';

@@ -25,3 +24,6 @@ import { SShapeElementImpl, boundsFeature } from '../bounds/model';

export interface Decoration extends SModelExtension {
/**
* Feature extension interface for {@link decorationFeature}.
*/
export interface Decoration {
}

@@ -28,0 +30,0 @@

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

import { SModelExtension } from '../../base/model/smodel-extension';
import { SModelElementImpl, SChildElementImpl } from '../../base/model/smodel';

@@ -25,3 +24,6 @@ import { BoundsAware, isBoundsAware } from '../bounds/model';

export interface EdgeLayoutable extends SModelExtension {
/**
* Feature extension interface for {@link edgeLayoutFeature}.
*/
export interface EdgeLayoutable {
edgePlacement: EdgePlacement

@@ -38,3 +40,3 @@ }

function checkEdgeLayoutable(element: SChildElementImpl): element is SChildElementImpl & EdgeLayoutable{
function checkEdgeLayoutable(element: SChildElementImpl): element is SChildElementImpl & EdgeLayoutable {
return 'edgePlacement' in element;

@@ -41,0 +43,0 @@ }

@@ -19,7 +19,9 @@ /********************************************************************************

import { SModelElementImpl } from "../../base/model/smodel";
import { SModelExtension } from "../../base/model/smodel-extension";
export const creatingOnDragFeature = Symbol('creatingOnDragFeature');
export interface CreatingOnDrag extends SModelExtension {
/**
* Feature extension interface for {@link creatingOnDragFeature}.
*/
export interface CreatingOnDrag {
createAction(id: string): Action;

@@ -26,0 +28,0 @@ }

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

import { inject, injectable } from 'inversify';
import { Action, CreateElementAction as ProtocolCreateElementAction } from 'sprotty-protocol/lib/actions';
import { SModelElement as SModelElementSchema } from 'sprotty-protocol/lib/model';
import { CreateElementAction } from 'sprotty-protocol/lib/actions';
import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';

@@ -25,6 +24,5 @@ import { SParentElementImpl, SChildElementImpl } from '../../base/model/smodel';

@injectable()
export class CreateElementCommand extends Command {
static readonly KIND = ProtocolCreateElementAction.KIND;
static readonly KIND = CreateElementAction.KIND;

@@ -34,3 +32,3 @@ container: SParentElementImpl;

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

@@ -59,25 +57,1 @@ }

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Create an element with the given schema and add it to the diagram.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface CreateElementAction extends Action {
kind: typeof CreateElementAction.KIND
containerId: string
elementSchema: SModelElementSchema
}
export namespace CreateElementAction {
export const KIND = 'createElement';
export function create(elementSchema: SModelElementSchema, options: { containerId: string }): CreateElementAction {
return {
kind: KIND,
elementSchema,
containerId: options.containerId
};
}
}

@@ -18,6 +18,5 @@ /********************************************************************************

import { inject, injectable } from 'inversify';
import { Action, DeleteElementAction as ProtocolDeleteElementAction} from 'sprotty-protocol/lib/actions';
import { DeleteElementAction } from 'sprotty-protocol/lib/actions';
import { Command, CommandExecutionContext, CommandReturn } from '../../base/commands/command';
import { SModelElementImpl, SParentElementImpl, SChildElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
import { TYPES } from '../../base/types';

@@ -27,3 +26,6 @@

export interface Deletable extends SModelExtension {
/**
* Feature extension interface for {@link deletableFeature}.
*/
export interface Deletable {
}

@@ -42,7 +44,7 @@

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

@@ -75,23 +77,1 @@ }

}
// // Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Delete a set of elements identified by their IDs.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface DeleteElementAction extends Action {
kind: typeof DeleteElementAction.KIND
elementIds: string[]
}
export namespace DeleteElementAction {
export const KIND = 'delete';
export function create(elementIds: string[]): DeleteElementAction {
return {
kind: KIND,
elementIds
};
}
}

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

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

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

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

@@ -61,7 +61,7 @@

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

@@ -139,27 +139,1 @@ }

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ApplyLabelEditAction extends Action {
kind: typeof ApplyLabelEditAction.KIND;
labelId: string,
text: string
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export namespace ApplyLabelEditAction {
export const KIND = 'applyLabelEdit';
export function create(labelId: string, text: string): ApplyLabelEditAction {
return {
kind: KIND,
labelId,
text
};
}
}

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

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
import { SRoutableElementImpl } from '../routing/model';

@@ -29,5 +28,9 @@

export const editLabelFeature = Symbol('editLabelFeature');
export interface EditableLabel extends SModelExtension {
/**
* Feature extension interface for {@link editLabelFeature}.
*/
export interface EditableLabel {
text: string;

@@ -45,3 +48,6 @@ readonly isMultiLine?: boolean;

export interface WithEditableLabel extends SModelExtension {
/**
* Feature extension interface for {@link withEditLabelFeature}.
*/
export interface WithEditableLabel {
readonly editableLabel?: EditableLabel & SModelElementImpl;

@@ -48,0 +54,0 @@ }

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

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

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

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

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

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

@@ -76,29 +76,1 @@ }

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ReconnectAction extends Action {
kind: typeof ReconnectAction.KIND
routableId: string
newSourceId?: string
newTargetId?: string
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export namespace ReconnectAction {
export const KIND = 'reconnect';
export function create(options: { routableId: string, newSourceId?: string, newTargetId?: string }): ReconnectAction {
return {
kind: KIND,
routableId: options.routableId,
newSourceId: options.newSourceId,
newTargetId: options.newTargetId
};
}
}

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

import { injectable } from 'inversify';
import { Action, CollapseExpandAction as ProtocolCollapseExpandAction, CollapseExpandAllAction as ProtocolCollapseExpandAllAction} from 'sprotty-protocol/lib/actions';
import { Action, CollapseExpandAction } from 'sprotty-protocol/lib/actions';
import { SButtonImpl } from '../button/model';

@@ -32,3 +32,3 @@ import { findParentByFeature } from '../../base/model/smodel-utils';

if (expandable !== undefined) {
return [ ProtocolCollapseExpandAction.create({
return [ CollapseExpandAction.create({
expandIds: expandable.expanded ? [] : [ expandable.id ],

@@ -42,34 +42,1 @@ collapseIds: expandable.expanded ? [ expandable.id ] : []

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Sent from the client to the model source to recalculate a diagram when elements
* are collapsed/expanded by the client.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class CollapseExpandAction implements Action,ProtocolCollapseExpandAction {
static readonly KIND = 'collapseExpand';
readonly kind = CollapseExpandAction.KIND;
constructor(public readonly expandIds: string[],
public readonly collapseIds: string[]) {
}
}
/**
* Programmatic action for expanding or collapsing all elements.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class CollapseExpandAllAction implements Action,ProtocolCollapseExpandAllAction {
static readonly KIND = 'collapseExpandAll';
readonly kind = CollapseExpandAllAction.KIND;
/**
* If `expand` is true, all elements are expanded, othewise they are collapsed.
*/
constructor(public readonly expand: boolean = true) {
}
}

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

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';

@@ -25,4 +24,6 @@ export const expandFeature = Symbol('expandFeature');

* Model elements that implement this interface can be expanded/collapsed
*
* Feature extension interface for {@link expandFeature}.
*/
export interface Expandable extends SModelExtension {
export interface Expandable {
expanded: boolean

@@ -29,0 +30,0 @@ }

@@ -19,12 +19,13 @@ /********************************************************************************

import 'mocha';
import { expect } from "chai";
import { expect } from 'chai';
import { Container } from 'inversify';
import { TYPES } from '../../base/types';
import { ConsoleLogger } from "../../utils/logging";
import { CommandExecutionContext } from "../../base/commands/command";
import { SGraphFactory } from "../../graph/sgraph-factory";
import { SNodeImpl, SGraphImpl } from "../../graph/sgraph";
import { ConsoleLogger } from '../../utils/logging';
import { CommandExecutionContext } from '../../base/commands/command';
import { SNodeImpl, SGraphImpl } from '../../graph/sgraph';
import { ExportSvgCommand, RequestExportSvgAction } from './export';
import defaultModule from "../../base/di.config";
import defaultModule from '../../base/di.config';
import { SNode } from 'sprotty-protocol';
import { IModelFactory } from '../../base/model/smodel-factory';
import { registerModelElement } from '../../base/model/smodel-utils';

@@ -34,6 +35,8 @@ describe('ExportSvgCommand', () => {

container.load(defaultModule);
container.rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const graphFactory = container.get<SGraphFactory>(TYPES.IModelFactory);
registerModelElement(container, 'graph', SGraphImpl);
registerModelElement(container, 'node:circle', SNodeImpl);
const graphFactory = container.get<IModelFactory>(TYPES.IModelFactory);
const myNodeSchema: SNode = {

@@ -40,0 +43,0 @@ id: 'node', type: 'node:circle',

@@ -18,7 +18,9 @@ /********************************************************************************

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
export const fadeFeature = Symbol('fadeFeature');
export interface Fadeable extends SModelExtension {
/**
* Feature extension interface for {@link fadeFeature}.
*/
export interface Fadeable {
opacity: number

@@ -25,0 +27,0 @@ }

@@ -17,30 +17,24 @@ /********************************************************************************

import { inject, injectable } from "inversify";
import {
Action, generateRequestId, 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';
import { Bounds, Point } from "sprotty-protocol/lib/utils/geometry";
import { inject, injectable } from 'inversify';
import { Action, RequestPopupModelAction, SetPopupModelAction, HoverFeedbackAction } from 'sprotty-protocol/lib/actions';
import { Bounds, Point } from 'sprotty-protocol/lib/utils/geometry';
import { matchesKeystroke } from '../../utils/keyboard';
import { TYPES } from "../../base/types";
import { SModelElementImpl, SModelRootImpl } from "../../base/model/smodel";
import { MouseListener } from "../../base/views/mouse-tool";
import { CommandExecutionContext, PopupCommand, SystemCommand, CommandReturn, ICommand } from "../../base/commands/command";
import { IActionHandler } from "../../base/actions/action-handler";
import { EMPTY_ROOT } from "../../base/model/smodel-factory";
import { KeyListener } from "../../base/views/key-tool";
import { findParentByFeature, findParent } from "../../base/model/smodel-utils";
import { ViewerOptions } from "../../base/views/viewer-options";
import { TYPES } from '../../base/types';
import { SModelElementImpl, SModelRootImpl } from '../../base/model/smodel';
import { MouseListener } from '../../base/views/mouse-tool';
import { CommandExecutionContext, PopupCommand, SystemCommand, CommandReturn, ICommand } from '../../base/commands/command';
import { IActionHandler } from '../../base/actions/action-handler';
import { EMPTY_ROOT } from '../../base/model/smodel-factory';
import { KeyListener } from '../../base/views/key-tool';
import { findParentByFeature, findParent } from '../../base/model/smodel-utils';
import { ViewerOptions } from '../../base/views/viewer-options';
import { getAbsoluteBounds } from '../bounds/model';
import { hasPopupFeature, isHoverable } from "./model";
import { hasPopupFeature, isHoverable } from './model';
@injectable()
export class HoverFeedbackCommand extends SystemCommand {
static readonly KIND = ProtocolHoverFeedbackAction.KIND;
static readonly KIND = HoverFeedbackAction.KIND;
constructor(@inject(TYPES.Action) protected readonly action: ProtocolHoverFeedbackAction) {
constructor(@inject(TYPES.Action) protected readonly action: HoverFeedbackAction) {
super();

@@ -73,3 +67,3 @@ }

export class SetPopupModelCommand extends PopupCommand {
static readonly KIND = ProtocolSetPopupModelAction.KIND;
static readonly KIND = SetPopupModelAction.KIND;

@@ -79,3 +73,3 @@ oldRoot: SModelRootImpl;

constructor(@inject(TYPES.Action) protected readonly action: ProtocolSetPopupModelAction) {
constructor(@inject(TYPES.Action) protected readonly action: SetPopupModelAction) {
super();

@@ -137,3 +131,3 @@ }

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

@@ -196,3 +190,3 @@ });

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

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

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

@@ -227,3 +221,3 @@ }

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

@@ -249,5 +243,5 @@ }

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

@@ -313,3 +307,3 @@ this.lastHoverFeedbackElementId = undefined;

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

@@ -326,70 +320,7 @@ return [];

if (action.kind === SetPopupModelCommand.KIND) {
this.popupOpen = (action as ProtocolSetPopupModelAction).newRoot.type !== EMPTY_ROOT.type;
this.popupOpen = (action as SetPopupModelAction).newRoot.type !== EMPTY_ROOT.type;
} else if (this.popupOpen) {
return ProtocolSetPopupModelAction.create({ id: EMPTY_ROOT.id, type: EMPTY_ROOT.type });
return SetPopupModelAction.create({ id: EMPTY_ROOT.id, type: EMPTY_ROOT.type });
}
}
}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Triggered when the user puts the mouse pointer over an element.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface HoverFeedbackAction extends Action {
kind: typeof HoverFeedbackAction.KIND
mouseoverElement: string
mouseIsOver: boolean
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export namespace HoverFeedbackAction {
export const KIND = 'hoverFeedback';
export function create(options: { mouseoverElement: string, mouseIsOver: boolean }): HoverFeedbackAction {
return {
kind: KIND,
mouseoverElement: options.mouseoverElement,
mouseIsOver: options.mouseIsOver
};
}
}
/**
* Triggered when the user hovers the mouse pointer over an element to get a popup with details on
* that element. This action is sent from the client to the model source, e.g. a DiagramServer.
* The response is a SetPopupModelAction.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class RequestPopupModelAction implements RequestAction<SetPopupModelAction>, ProtocolRequestPopupModelAction {
static readonly KIND = 'requestPopupModel';
readonly kind = RequestPopupModelAction.KIND;
constructor(public readonly elementId: string,
public readonly bounds: Bounds,
public readonly requestId = '') { }
/** Factory function to dispatch a request with the `IActionDispatcher` */
static create(elementId: string, bounds: Bounds): RequestAction<SetPopupModelAction> {
return new RequestPopupModelAction(elementId, bounds, generateRequestId());
}
}
/**
* Sent from the model source to the client to display a popup in response to a RequestPopupModelAction.
* This action can also be used to remove any existing popup by choosing EMPTY_ROOT as root element.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class SetPopupModelAction implements ResponseAction, ProtocolSetPopupModelAction {
static readonly KIND = 'setPopupModel';
readonly kind = SetPopupModelAction.KIND;
constructor(public readonly newRoot: SModelRootSchema,
public readonly responseId = '') { }
}

@@ -18,7 +18,9 @@ /********************************************************************************

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
export const hoverFeedbackFeature = Symbol('hoverFeedbackFeature');
export interface Hoverable extends SModelExtension {
/**
* Feature extension interface for {@link hoverFeedbackFeature}.
*/
export interface Hoverable {
hoverFeedback: boolean

@@ -25,0 +27,0 @@ }

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

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';

@@ -27,4 +26,6 @@ export const moveFeature = Symbol('moveFeature');

* property.
*
* Feature extension interface for {@link moveFeature}.
*/
export interface Locateable extends SModelExtension {
export interface Locateable {
position: Point

@@ -31,0 +32,0 @@ }

@@ -19,14 +19,15 @@ /********************************************************************************

import 'mocha';
import { expect } from "chai";
import { expect } from 'chai';
import { Container } from 'inversify';
import { TYPES } from '../../base/types';
import { ConsoleLogger } from "../../utils/logging";
import { CommandExecutionContext } from "../../base/commands/command";
import { SModelRootImpl } from "../../base/model/smodel";
import { SGraphFactory } from "../../graph/sgraph-factory";
import { SNodeImpl } from "../../graph/sgraph";
import { AnimationFrameSyncer } from "../../base/animations/animation-frame-syncer";
import { ElementMove, MoveCommand } from "./move";
import defaultModule from "../../base/di.config";
import { ConsoleLogger } from '../../utils/logging';
import { CommandExecutionContext } from '../../base/commands/command';
import { SModelRootImpl } from '../../base/model/smodel';
import { SGraphImpl, SNodeImpl } from '../../graph/sgraph';
import { AnimationFrameSyncer } from '../../base/animations/animation-frame-syncer';
import { ElementMove, MoveCommand } from './move';
import defaultModule from '../../base/di.config';
import { MoveAction, Point } from 'sprotty-protocol';
import { IModelFactory } from '../../base/model/smodel-factory';
import { registerModelElement } from '../../base/model/smodel-utils';

@@ -36,6 +37,8 @@ describe('move', () => {

container.load(defaultModule);
container.rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const graphFactory = container.get<SGraphFactory>(TYPES.IModelFactory);
registerModelElement(container, 'graph', SGraphImpl);
registerModelElement(container, 'node:circle', SNodeImpl);
const graphFactory = container.get<IModelFactory>(TYPES.IModelFactory);
const pointNW: Point = { x: 0, y: 0 };

@@ -140,3 +143,3 @@ const pointNE: Point = { x: 300, y: 1 };

it('undo() works as expected', async () => {
// test "undo"
// test 'undo'
context.root = newModel;

@@ -157,3 +160,3 @@ undoneModel = await cmd.undo(context);

it('redo() works as expected', async () => {
// test "redo":
// test 'redo':
context.root = undoneModel;

@@ -160,0 +163,0 @@ const redoneModel = await cmd.redo(context);

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

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

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

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

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

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

@@ -459,3 +459,3 @@ }

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

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

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

@@ -640,25 +640,1 @@ return undefined;

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface MoveAction extends Action {
kind: typeof MoveAction.KIND
moves: ElementMove[]
animate: boolean
finished: boolean
}
export namespace MoveAction {
export const KIND = 'move';
export function create(moves: ElementMove[], options: { animate?: boolean, finished?: boolean } = {}): MoveAction {
return {
kind: KIND,
moves,
animate: options.animate ?? true,
finished: options.finished ?? false
};
}
}

@@ -18,7 +18,9 @@ /********************************************************************************

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
export const nameFeature = Symbol('nameableFeature');
export interface Nameable extends SModelExtension {
/**
* Feature extension interface for {@link nameableFeature}.
*/
export interface Nameable {
name: string

@@ -31,3 +33,3 @@ }

export function name(element: SModelElementImpl): string|undefined {
export function name(element: SModelElementImpl): string | undefined {
if (isNameable(element)) {

@@ -34,0 +36,0 @@ return element.name;

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

import { SChildElementImpl, SModelRootImpl, SParentElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
import { transformToRootBounds } from '../../base/model/smodel-utils';

@@ -31,3 +30,3 @@ import { isBoundsAware } from '../bounds/model';

*/
export interface Projectable extends SModelExtension {
export interface Projectable {
projectionCssClasses: string[],

@@ -34,0 +33,0 @@ projectedBounds?: Bounds,

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

import { SChildElementImpl, SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
import { FluentIterable } from '../../utils/iterable';

@@ -58,3 +57,6 @@ import { SShapeElementImpl } from '../bounds/model';

export interface Connectable extends SModelExtension {
/**
* Feature extension interface for {@link connectableFeature}.
*/
export interface Connectable {
canConnect(routable: SRoutableElementImpl, role: 'source' | 'target'): boolean;

@@ -79,3 +81,3 @@ }

export function getRouteBounds(route: Point[]): Bounds {
const bounds = { x: NaN, y: NaN, width: 0, height: 0};
const bounds = { x: NaN, y: NaN, width: 0, height: 0 };
for (const point of route) {

@@ -110,5 +112,5 @@ if (isNaN(bounds.x)) {

get anchorKind(): string | undefined{
return undefined;
}
get anchorKind(): string | undefined {
return undefined;
}

@@ -185,17 +187,1 @@ strokeWidth: number = 0;

export const edgeInProgressTargetHandleID = edgeInProgressID + '-target-anchor';
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/** @deprecated Use `SRoutableElementImpl` instead. */
export const SRoutableElement = SRoutableElementImpl;
/** @deprecated Use `SConnectableElementImpl` instead. */
export const SConnectableElement = SConnectableElementImpl;
/** @deprecated Use `SRoutingHandleImpl` instead. */
export const SRoutingHandle = SRoutingHandleImpl;
/** @deprecated Use `SDanglingAnchorImpl` instead. */
export const SDanglingAnchor = SDanglingAnchorImpl;

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

import { SShapeElementImpl } from '../bounds/model';
import { ViewportRootElement } from '../viewport/viewport-root';
import { ViewportRootElementImpl } from '../viewport/viewport-root';
import { SRoutableElementImpl } from './model';

@@ -41,4 +41,4 @@ import { RoutableView } from './views';

function createModel(): ViewportRootElement {
const root = new ViewportRootElement();
function createModel(): ViewportRootElementImpl {
const root = new ViewportRootElementImpl();
root.canvasBounds = { x: 0, y: 0, width: 100, height: 100 };

@@ -45,0 +45,0 @@ const node1 = new TestNode();

@@ -18,7 +18,9 @@ /********************************************************************************

import { SModelElementImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
export const selectFeature = Symbol('selectFeature');
export interface Selectable extends SModelExtension {
/**
* Feature extension interface for {@link selectFeature}.
*/
export interface Selectable {
selected: boolean

@@ -25,0 +27,0 @@ }

@@ -19,15 +19,15 @@ /********************************************************************************

import 'mocha';
import { expect } from "chai";
import { expect } from 'chai';
import { Container } from 'inversify';
import { TYPES } from '../../base/types';
import { ConsoleLogger } from "../../utils/logging";
import { SModelRootImpl } from "../../base/model/smodel";
import { EMPTY_ROOT } from "../../base/model/smodel-factory";
import { CommandExecutionContext } from "../../base/commands/command";
import { AnimationFrameSyncer } from "../../base/animations/animation-frame-syncer";
import { SGraphFactory } from "../../graph/sgraph-factory";
import { SNodeImpl } from "../../graph/sgraph";
import { SelectCommand, SelectAllCommand } from "./select";
import defaultModule from "../../base/di.config";
import { ConsoleLogger } from '../../utils/logging';
import { SModelRootImpl } from '../../base/model/smodel';
import { EMPTY_ROOT, IModelFactory } from '../../base/model/smodel-factory';
import { CommandExecutionContext } from '../../base/commands/command';
import { AnimationFrameSyncer } from '../../base/animations/animation-frame-syncer';
import { SGraphImpl, SNodeImpl } from '../../graph/sgraph';
import { SelectCommand, SelectAllCommand } from './select';
import defaultModule from '../../base/di.config';
import { SelectAction, SelectAllAction } from 'sprotty-protocol';
import { registerModelElement } from '../../base/model/smodel-utils';

@@ -45,6 +45,8 @@ function getNode(nodeId: string, model: SModelRootImpl) {

container.load(defaultModule);
container.rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const graphFactory = container.get<SGraphFactory>(TYPES.IModelFactory);
registerModelElement(container, 'graph', SGraphImpl);
registerModelElement(container, 'node:circle', SNodeImpl);
const graphFactory = container.get<IModelFactory>(TYPES.IModelFactory);
const myNode0 = { id: 'node0', type: 'node:circle', x: 100, y: 100, selected: true };

@@ -88,8 +90,8 @@ const myNode1 = { id: 'node1', type: 'node:circle', x: 200, y: 200, selected: false };

// Confirm selection is as expected
expect(true).to.equal(isNodeSelected('node1', newModel));
expect(false).to.equal(isNodeSelected('node0', newModel));
expect(isNodeSelected('node1', newModel)).to.equal(true);
expect(isNodeSelected('node0', newModel)).to.equal(false);
});
it('undo() works as expected', () => {
// Test "undo"
// Test 'undo'
context.root = newModel;

@@ -99,8 +101,8 @@ newModel = cmd.undo(context);

// Confirm selection is as expected
expect(true).to.equal(isNodeSelected('node0', newModel));
expect(false).to.equal(isNodeSelected('node1', newModel));
expect(isNodeSelected('node0', newModel)).to.equal(true);
expect(isNodeSelected('node1', newModel)).to.equal(false);
});
it('redo() works as expected', () => {
// Test "redo"
// Test 'redo'
context.root = newModel;

@@ -110,4 +112,4 @@ newModel = cmd.redo(context);

// Confirm selection is as expected
expect(true).to.equal(isNodeSelected('node1', newModel));
expect(false).to.equal(isNodeSelected('node0', newModel));
expect(isNodeSelected('node1', newModel)).to.equal(true);
expect(isNodeSelected('node0', newModel)).to.equal(false);
});

@@ -119,6 +121,8 @@ });

container.load(defaultModule);
container.rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const graphFactory = container.get<SGraphFactory>(TYPES.IModelFactory);
registerModelElement(container, 'graph', SGraphImpl);
registerModelElement(container, 'node:circle', SNodeImpl);
const graphFactory = container.get<IModelFactory>(TYPES.IModelFactory);
const myNode0 = { id: 'node0', type: 'node:circle', x: 100, y: 100, selected: true };

@@ -155,8 +159,8 @@ const myNode1 = { id: 'node1', type: 'node:circle', x: 200, y: 200, selected: false };

// Confirm selection is as expected
expect(true).to.equal(isNodeSelected('node0', newModel));
expect(true).to.equal(isNodeSelected('node1', newModel));
expect(isNodeSelected('node0', newModel)).to.equal(true);
expect(isNodeSelected('node1', newModel)).to.equal(true);
});
it('undo() works as expected', () => {
// Test "undo"
// Test 'undo'
context.root = newModel;

@@ -166,8 +170,8 @@ newModel = selectCmd.undo(context);

// confirm selection is as expected
expect(true).to.equal(isNodeSelected('node0', newModel));
expect(false).to.equal(isNodeSelected('node1', newModel));
expect(isNodeSelected('node0', newModel)).to.equal(true);
expect(isNodeSelected('node1', newModel)).to.equal(false);
});
it('redo() works as expected', () => {
// Test "redo"
// Test 'redo'
context.root = newModel;

@@ -177,4 +181,4 @@ newModel = selectCmd.redo(context);

// Confirm selection is as expected
expect(true).to.equal(isNodeSelected('node0', newModel));
expect(true).to.equal(isNodeSelected('node1', newModel));
expect(isNodeSelected('node0', newModel)).to.equal(true);
expect(isNodeSelected('node1', newModel)).to.equal(true);
});

@@ -188,8 +192,8 @@

// Confirm selection is as expected
expect(false).to.equal(isNodeSelected('node0', newModel));
expect(false).to.equal(isNodeSelected('node1', newModel));
expect(isNodeSelected('node0', newModel)).to.equal(false);
expect(isNodeSelected('node1', newModel)).to.equal(false);
});
it('undo() works as expected with deselect', () => {
// Test "undo" with deselect: true
// Test 'undo' with deselect: true
context.root = newModel;

@@ -199,8 +203,8 @@ newModel = deselectCmd.undo(context);

// confirm selection is as expected
expect(true).to.equal(isNodeSelected('node0', newModel));
expect(true).to.equal(isNodeSelected('node1', newModel));
expect(isNodeSelected('node0', newModel)).to.equal(true);
expect(isNodeSelected('node1', newModel)).to.equal(true);
});
it('redo() works as expected with deselect', () => {
// Test "redo" with deselect: true
// Test 'redo' with deselect: true
context.root = newModel;

@@ -210,5 +214,5 @@ newModel = deselectCmd.redo(context);

// Confirm selection is as expected
expect(false).to.equal(isNodeSelected('node0', newModel));
expect(false).to.equal(isNodeSelected('node1', newModel));
expect(isNodeSelected('node0', newModel)).to.equal(false);
expect(isNodeSelected('node1', newModel)).to.equal(false);
});
});

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

import { VNode } from 'snabbdom';
import {
Action, BringToFrontAction, generateRequestId, RequestAction, ResponseAction
} from 'sprotty-protocol/lib/actions';
import * as protocol from "sprotty-protocol/lib/actions";
import { Action, BringToFrontAction, GetSelectionAction, ResponseAction, SelectAction, SelectAllAction, SelectionResult } from 'sprotty-protocol/lib/actions';
import { Command, CommandExecutionContext } from '../../base/commands/command';

@@ -45,3 +42,3 @@ import { ModelRequestCommand } from '../../base/commands/request-command';

export class SelectCommand extends Command {
static readonly KIND = protocol.SelectAction.KIND;
static readonly KIND = SelectAction.KIND;

@@ -51,3 +48,3 @@ protected selected: (SChildElementImpl & Selectable)[] = [];

constructor(@inject(TYPES.Action) public action: protocol.SelectAction) {
constructor(@inject(TYPES.Action) public action: SelectAction) {
super();

@@ -96,7 +93,7 @@ }

export class SelectAllCommand extends Command {
static readonly KIND = protocol.SelectAllAction.KIND;
static readonly KIND = SelectAllAction.KIND;
protected previousSelection: Record<string, boolean> = {};
constructor(@inject(TYPES.Action) protected readonly action: protocol.SelectAllAction) {
constructor(@inject(TYPES.Action) protected readonly action: SelectAllAction) {
super();

@@ -196,3 +193,3 @@ }

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

@@ -210,3 +207,3 @@ const routableDeselect = deselectedElements.filter(e => e instanceof SRoutableElementImpl).map(e => e.id);

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

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

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

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

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

@@ -264,7 +261,7 @@ } else if (target instanceof SModelRootImpl && !findViewportScrollbar(event)) {

export class GetSelectionCommand extends ModelRequestCommand {
static readonly KIND = protocol.GetSelectionAction.KIND;
static readonly KIND = GetSelectionAction.KIND;
protected previousSelection: Record<string, boolean> = {};
constructor(@inject(TYPES.Action) protected readonly action: protocol.GetSelectionAction) {
constructor(@inject(TYPES.Action) protected readonly action: GetSelectionAction) {
super();

@@ -285,3 +282,3 @@ }

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

@@ -291,73 +288,1 @@ return [];

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Triggered when the user changes the selection, e.g. by clicking on a selectable element. The resulting
* SelectCommand changes the `selected` state accordingly, so the elements can be rendered differently.
* This action is also forwarded to the diagram server, if present, so it may react on the selection change.
* Furthermore, the server can send such an action to the client in order to change the selection programmatically.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class SelectAction implements Action, protocol.SelectAction {
static readonly KIND = 'elementSelected';
readonly kind = SelectAction.KIND;
constructor(public readonly selectedElementsIDs: string[] = [],
public readonly deselectedElementsIDs: string[] = []) {
}
}
/**
* Programmatic action for selecting or deselecting all elements.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class SelectAllAction implements Action, protocol.SelectAllAction {
static readonly KIND = 'allSelected';
readonly kind = SelectAllAction.KIND;
/**
* If `select` is true, all elements are selected, otherwise they are deselected.
*/
constructor(public readonly select: boolean = true) {
}
}
/**
* Request action for retrieving the current selection.
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface GetSelectionAction extends RequestAction<SelectionResult> {
kind: typeof GetSelectionAction.KIND
}
export namespace GetSelectionAction {
export const KIND = 'getSelection';
export function create(): GetSelectionAction {
return {
kind: KIND,
requestId: generateRequestId()
};
}
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface SelectionResult extends ResponseAction {
kind: typeof SelectionResult.KIND
selectedElementsIDs: string[]
}
export namespace SelectionResult {
export const KIND = 'selectionResult';
export function create(selectedElementsIDs: string[], requestId: string): SelectionResult {
return {
kind: KIND,
selectedElementsIDs,
responseId: requestId
};
}
}

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

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

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

if (matchesKeystroke(event, 'KeyZ', 'ctrlCmd'))
return [ProtocolUndoAction.create()];
return [UndoAction.create()];
if (matchesKeystroke(event, 'KeyZ', 'ctrlCmd', 'shift') || (!isMac() && matchesKeystroke(event, 'KeyY', 'ctrlCmd')))
return [ProtocolRedoAction.create()];
return [RedoAction.create()];
return [];
}
}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface UndoAction extends Action {
kind: typeof UndoAction.KIND;
}
export namespace UndoAction {
export const KIND = 'undo';
export function create(): UndoAction {
return {
kind: KIND
};
}
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface RedoAction extends Action {
kind: typeof RedoAction.KIND;
}
export namespace RedoAction {
export const KIND = 'redo';
export function create(): RedoAction {
return {
kind: KIND
};
}
}

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

import { SModelElement as SModelElementSchema, SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { SModelElement, SModelRoot } from 'sprotty-protocol/lib/model';
import { SModelRootImpl, SModelElementImpl, isParent, IModelIndex } from '../../base/model/smodel';

@@ -23,4 +23,4 @@ import { SModelIndex } from 'sprotty-protocol';

export interface Match {
left?: SModelElementSchema
right?: SModelElementSchema
left?: SModelElement
right?: SModelElement
leftParentId?: string

@@ -39,3 +39,3 @@ rightParentId?: string

export class ModelMatcher {
match(left: SModelRootSchema | SModelRootImpl, right: SModelRootSchema | SModelRootImpl): MatchResult {
match(left: SModelRoot | SModelRootImpl, right: SModelRoot | SModelRootImpl): MatchResult {
const result: MatchResult = {};

@@ -47,3 +47,3 @@ this.matchLeft(left, result);

protected matchLeft(element: SModelElementSchema | SModelElementImpl, result: MatchResult, parentId?: string): void {
protected matchLeft(element: SModelElement | SModelElementImpl, result: MatchResult, parentId?: string): void {
let match = result[element.id];

@@ -67,3 +67,3 @@ if (match !== undefined) {

protected matchRight(element: SModelElementSchema | SModelElementImpl, result: MatchResult, parentId?: string) {
protected matchRight(element: SModelElement | SModelElementImpl, result: MatchResult, parentId?: string) {
let match = result[element.id];

@@ -88,3 +88,3 @@ if (match !== undefined) {

export function applyMatches(root: SModelRootSchema, matches: Match[], index?: IModelIndex): void {
export function applyMatches(root: SModelRoot, matches: Match[], index?: IModelIndex): void {
if (root instanceof SModelRootImpl) {

@@ -91,0 +91,0 @@ index = root.index;

@@ -19,19 +19,18 @@ /********************************************************************************

import 'mocha';
import { expect } from "chai";
import { expect } from 'chai';
import { Container } from 'inversify';
import { TYPES } from '../../base/types';
import { ConsoleLogger } from "../../utils/logging";
import { EMPTY_ROOT } from "../../base/model/smodel-factory";
import { SModelElementImpl, SModelRootImpl } from "../../base/model/smodel";
import { CommandExecutionContext } from "../../base/commands/command";
import { AnimationFrameSyncer } from "../../base/animations/animation-frame-syncer";
import { CompoundAnimation, Animation } from "../../base/animations/animation";
import { SEdgeImpl } from "../../graph/sgraph";
import { SGraphFactory } from "../../graph/sgraph-factory";
import { FadeAnimation } from "../../features/fade/fade";
import { MoveAnimation, MorphEdgesAnimation } from "../../features/move/move";
import { UpdateModelCommand } from "./update-model";
import { ModelMatcher } from "./model-matching";
import { ManhattanEdgeRouter } from "../routing/manhattan-edge-router";
import defaultModule from "../../base/di.config";
import { ConsoleLogger } from '../../utils/logging';
import { EMPTY_ROOT, IModelFactory } from '../../base/model/smodel-factory';
import { SModelElementImpl, SModelRootImpl } from '../../base/model/smodel';
import { CommandExecutionContext } from '../../base/commands/command';
import { AnimationFrameSyncer } from '../../base/animations/animation-frame-syncer';
import { CompoundAnimation, Animation } from '../../base/animations/animation';
import { SEdgeImpl, SGraphImpl, SNodeImpl } from '../../graph/sgraph';
import { FadeAnimation } from '../../features/fade/fade';
import { MoveAnimation, MorphEdgesAnimation } from '../../features/move/move';
import { UpdateModelCommand } from './update-model';
import { ModelMatcher } from './model-matching';
import { ManhattanEdgeRouter } from '../routing/manhattan-edge-router';
import defaultModule from '../../base/di.config';
import { EdgeRouterRegistry } from '../routing/routing';

@@ -41,2 +40,3 @@ import { AnchorComputerRegistry } from '../routing/anchor';

import { Point, SEdge, SGraph, SModelElement, SModelRoot,SNode, UpdateModelAction } from 'sprotty-protocol';
import { registerModelElement } from '../../base/model/smodel-utils';

@@ -64,6 +64,9 @@ function compare(expected: SModelElement, actual: SModelElementImpl) {

container.load(defaultModule);
container.rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const graphFactory = container.get<SGraphFactory>(TYPES.IModelFactory);
registerModelElement(container, 'graph', SGraphImpl);
registerModelElement(container, 'node', SNodeImpl);
registerModelElement(container, 'edge', SEdgeImpl);
const graphFactory = container.get<IModelFactory>(TYPES.IModelFactory);
const emptyRoot = graphFactory.createRoot(EMPTY_ROOT);

@@ -365,3 +368,3 @@

// connects node1 left with node2 right at respective midpoints
const command1 = new TestUpdateModelCommand({
const command3 = new TestUpdateModelCommand({
kind: UpdateModelCommand.KIND,

@@ -371,3 +374,3 @@ animate: false,

}, edgeRouterRegistry);
const animation1 = command1.testAnimation(context.root, context);
const animation1 = command3.testAnimation(context.root, context);
expect(animation1).to.be.instanceof(MorphEdgesAnimation);

@@ -396,3 +399,3 @@ if (animation1 instanceof Animation) {

}, edgeRouterRegistry);
const animation2 = command2.testAnimation(command1.newRoot, context);
const animation2 = command2.testAnimation(command3.newRoot, context);
expect(animation2).to.be.instanceof(MorphEdgesAnimation);

@@ -399,0 +402,0 @@ if (animation2 instanceof Animation) {

@@ -17,23 +17,22 @@ /********************************************************************************

import { injectable, inject, optional } from "inversify";
import { Action, UpdateModelAction as ProtocolUpdateModelAction } from "sprotty-protocol/lib/actions";
import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { almostEquals, Dimension } from "sprotty-protocol/lib/utils/geometry";
import { injectable, inject, optional } from 'inversify';
import { UpdateModelAction } from 'sprotty-protocol/lib/actions';
import { almostEquals, Dimension } from 'sprotty-protocol/lib/utils/geometry';
import { Animation, CompoundAnimation } from '../../base/animations/animation';
import { CommandExecutionContext, CommandReturn, Command } from '../../base/commands/command';
import { FadeAnimation, ResolvedElementFade } from '../fade/fade';
import { SModelRootImpl, SChildElementImpl, SModelElementImpl, SParentElementImpl } from "../../base/model/smodel";
import { MoveAnimation, ResolvedElementMove, MorphEdgesAnimation } from "../move/move";
import { Fadeable, isFadeable } from "../fade/model";
import { isLocateable } from "../move/model";
import { isSizeable } from "../bounds/model";
import { ViewportRootElement } from "../viewport/viewport-root";
import { isSelectable } from "../select/model";
import { MatchResult, ModelMatcher, Match, forEachMatch } from "./model-matching";
import { SModelRootImpl, SChildElementImpl, SModelElementImpl, SParentElementImpl } from '../../base/model/smodel';
import { MoveAnimation, ResolvedElementMove, MorphEdgesAnimation } from '../move/move';
import { Fadeable, isFadeable } from '../fade/model';
import { isLocateable } from '../move/model';
import { isSizeable } from '../bounds/model';
import { ViewportRootElementImpl } from '../viewport/viewport-root';
import { isSelectable } from '../select/model';
import { MatchResult, ModelMatcher, Match, forEachMatch } from './model-matching';
import { ResolvedElementResize, ResizeAnimation } from '../bounds/resize';
import { TYPES } from "../../base/types";
import { isViewport } from "../viewport/model";
import { EdgeRouterRegistry, EdgeSnapshot, EdgeMemento } from "../routing/routing";
import { SRoutableElementImpl } from "../routing/model";
import { containsSome } from "../../base/model/smodel-utils";
import { TYPES } from '../../base/types';
import { isViewport } from '../viewport/model';
import { EdgeRouterRegistry, EdgeSnapshot, EdgeMemento } from '../routing/routing';
import { SRoutableElementImpl } from '../routing/model';
import { containsSome } from '../../base/model/smodel-utils';

@@ -50,3 +49,3 @@

export class UpdateModelCommand extends Command {
static readonly KIND = ProtocolUpdateModelAction.KIND;
static readonly KIND = UpdateModelAction.KIND;

@@ -58,3 +57,3 @@ oldRoot: SModelRootImpl;

constructor(@inject(TYPES.Action) protected readonly action: ProtocolUpdateModelAction) {
constructor(@inject(TYPES.Action) protected readonly action: UpdateModelAction) {
super();

@@ -248,3 +247,3 @@ }

}
if (left instanceof ViewportRootElement && right instanceof ViewportRootElement) {
if (left instanceof ViewportRootElementImpl && right instanceof ViewportRootElementImpl) {
right.scroll = left.scroll;

@@ -293,26 +292,1 @@ right.zoom = left.zoom;

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Sent from the model source to the client in order to update the model. If no model is present yet,
* this behaves the same as a SetModelAction. The transition from the old model to the new one can be animated.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class UpdateModelAction implements Action, ProtocolUpdateModelAction {
static readonly KIND = 'updateModel';
readonly kind = UpdateModelAction.KIND;
public readonly newRoot?: SModelRootSchema;
public readonly matches?: Match[];
constructor(input: SModelRootSchema | Match[],
public readonly animate: boolean = true,
public readonly cause?: Action) {
if ((input as SModelRootSchema).id !== undefined)
this.newRoot = input as SModelRootSchema;
else
this.matches = input as Match[];
}
}

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

import { Action, CenterAction as ProtocolCenterAction, FitToScreenAction as ProtocolFitToScreenAction} from 'sprotty-protocol/lib/actions';
import { Action, CenterAction, FitToScreenAction } from 'sprotty-protocol/lib/actions';
import { Viewport } from 'sprotty-protocol/lib/model';

@@ -134,5 +134,5 @@ import { almostEquals, Bounds, Dimension } from 'sprotty-protocol/lib/utils/geometry';

export class CenterCommand extends BoundsAwareViewportCommand {
static readonly KIND = ProtocolCenterAction.KIND;
static readonly KIND = CenterAction.KIND;
constructor(@inject(TYPES.Action) protected action: ProtocolCenterAction) {
constructor(@inject(TYPES.Action) protected action: CenterAction) {
super(action.animate);

@@ -167,5 +167,5 @@ }

export class FitToScreenCommand extends BoundsAwareViewportCommand {
static readonly KIND = ProtocolFitToScreenAction.KIND;
static readonly KIND = FitToScreenAction.KIND;
constructor(@inject(TYPES.Action) protected readonly action: ProtocolFitToScreenAction) {
constructor(@inject(TYPES.Action) protected readonly action: FitToScreenAction) {
super(action.animate);

@@ -207,48 +207,7 @@ }

if (matchesKeystroke(event, 'KeyC', 'ctrlCmd', 'shift'))
return [ProtocolCenterAction.create([])];
return [CenterAction.create([])];
if (matchesKeystroke(event, 'KeyF', 'ctrlCmd', 'shift'))
return [ProtocolFitToScreenAction.create([])];
return [FitToScreenAction.create([])];
return [];
}
}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Triggered when the user requests the viewer to center on the current model. The resulting
* CenterCommand changes the scroll setting of the viewport accordingly.
* It also resets the zoom to its default if retainZoom is false.
* This action can also be sent from the model source to the client in order to perform such a
* viewport change programmatically.
*
* @deprecated Use the declaration in `sprotty-protocol` instead.
*/
export class CenterAction implements Action, ProtocolCenterAction {
static readonly KIND = 'center';
readonly kind = CenterAction.KIND;
constructor(public readonly elementIds: string[],
public readonly animate: boolean = true,
public readonly retainZoom: boolean = false,
public readonly zoomScale?: number) {
}
}
/**
* Triggered when the user requests the viewer to fit its content to the available drawing area.
* The resulting FitToScreenCommand changes the zoom and scroll settings of the viewport so the model
* can be shown completely. This action can also be sent from the model source to the client in order
* to perform such a viewport change programmatically.
*
* @deprecated Use the declaration in `sprotty-protocol` instead.
*/
export class FitToScreenAction implements Action, ProtocolFitToScreenAction {
static readonly KIND = 'fit';
readonly kind = FitToScreenAction.KIND;
constructor(public readonly elementIds: string[],
public readonly padding?: number,
public readonly maxZoom?: number,
public readonly animate: boolean = true) {
}
}

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

import { Bounds, Dimension } from 'sprotty-protocol';
import { Scrollable, Zoomable, Viewport as ProtocolViewport } from 'sprotty-protocol/lib/model';
import { Viewport } from 'sprotty-protocol/lib/model';
import { SModelElementImpl, SModelRootImpl } from '../../base/model/smodel';

@@ -28,3 +28,3 @@ import { limit, Limits } from '../../utils/geometry';

*/
export function isViewport(element: SModelElementImpl): element is SModelRootImpl & ProtocolViewport {
export function isViewport(element: SModelElementImpl): element is SModelRootImpl & Viewport {
return element instanceof SModelRootImpl

@@ -39,7 +39,7 @@ && element.hasFeature(viewportFeature)

*/
export function limitViewport(viewport: ProtocolViewport,
export function limitViewport(viewport: Viewport,
canvasBounds: Bounds | undefined,
horizontalScrollLimits: Limits | undefined,
verticalScrollLimits: Limits | undefined,
zoomLimits: Limits | undefined): ProtocolViewport {
zoomLimits: Limits | undefined): Viewport {
if (canvasBounds && !Dimension.isValid(canvasBounds)) {

@@ -82,9 +82,1 @@ canvasBounds = undefined;

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Viewport extends Scrollable, Zoomable {
}

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

import { MouseListener } from '../../base/views/mouse-tool';
import { SModelExtension } from '../../base/model/smodel-extension';
import { findParentByFeature } from '../../base/model/smodel-utils';

@@ -235,17 +234,1 @@ import { isViewport } from './model';

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Scrollable extends SModelExtension {
scroll: Point
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function isScrollable(element: SModelElementImpl | Scrollable): element is Scrollable {
return 'scroll' in element;
}

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

import { SModelRoot as SModelRootSchema, Viewport } from 'sprotty-protocol/lib/model';
import { Viewport } from 'sprotty-protocol/lib/model';
import { Bounds, Dimension, isBounds, Point } from 'sprotty-protocol/lib/utils/geometry';

@@ -25,9 +25,2 @@ import { SModelRootImpl, ModelIndexImpl } from '../../base/model/smodel';

export interface ViewportRootElementSchema extends SModelRootSchema {
scroll?: Point
zoom?: number
position?: Point
size?: Dimension
}
/**

@@ -37,3 +30,3 @@ * Model root element that defines a viewport, so it transforms the coordinate system with

*/
export class ViewportRootElement extends SModelRootImpl implements Viewport, BoundsAware {
export class ViewportRootElementImpl extends SModelRootImpl implements Viewport, BoundsAware {
static readonly DEFAULT_FEATURES = [viewportFeature, exportFeature];

@@ -40,0 +33,0 @@

@@ -25,7 +25,9 @@ /********************************************************************************

import { CommandExecutionContext } from '../../base/commands/command';
import { SGraphFactory } from '../../graph/sgraph-factory';
import { SetViewportCommand } from './viewport';
import { ViewportRootElement } from './viewport-root';
import defaultModule from "../../base/di.config";
import { ViewportRootElementImpl } from './viewport-root';
import defaultModule from '../../base/di.config';
import { SetViewportAction, Viewport, almostEquals } from 'sprotty-protocol';
import { IModelFactory } from '../../base/model/smodel-factory';
import { registerModelElement } from '../../base/model/smodel-utils';
import { SGraphImpl, SNodeImpl } from '../../graph/sgraph';

@@ -35,8 +37,10 @@ describe('BoundsAwareViewportCommand', () => {

container.load(defaultModule);
container.rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const graphFactory = container.get<SGraphFactory>(TYPES.IModelFactory);
registerModelElement(container, 'graph', SGraphImpl);
registerModelElement(container, 'node', SNodeImpl);
const graphFactory = container.get<IModelFactory>(TYPES.IModelFactory);
const viewportData: Viewport = { scroll: { x: 0, y: 0 }, zoom: 1 };
const viewport: ViewportRootElement = graphFactory.createRoot({ id: 'viewport1', type: 'graph', children: [] }) as ViewportRootElement;
const viewport: ViewportRootElementImpl = graphFactory.createRoot({ id: 'viewport1', type: 'graph', children: [] }) as ViewportRootElementImpl;
viewport.zoom = viewportData.zoom;

@@ -43,0 +47,0 @@ viewport.scroll = viewportData.scroll;

@@ -18,5 +18,5 @@ /********************************************************************************

import { injectable, inject } from 'inversify';
import { Action, generateRequestId, RequestAction, ResponseAction, SetViewportAction as ProtocolSetViewPortAction} from 'sprotty-protocol/lib/actions';
import { GetViewportAction, ResponseAction, SetViewportAction, ViewportResult } from 'sprotty-protocol/lib/actions';
import { Viewport } from 'sprotty-protocol/lib/model';
import { Bounds, Point } from 'sprotty-protocol/lib/utils/geometry';
import { Point } from 'sprotty-protocol/lib/utils/geometry';
import { SModelElementImpl, SModelRootImpl } from '../../base/model/smodel';

@@ -30,44 +30,5 @@ import { MergeableCommand, ICommand, CommandExecutionContext, CommandReturn } from '../../base/commands/command';

/**
* Request action for retrieving the current viewport and canvas bounds.
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface GetViewportAction extends RequestAction<ViewportResult> {
kind: typeof GetViewportAction.KIND;
}
export namespace GetViewportAction {
export const KIND = 'getViewport';
export function create(): GetViewportAction {
return {
kind: KIND,
requestId: generateRequestId()
};
}
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ViewportResult extends ResponseAction {
kind: typeof ViewportResult.KIND;
viewport: Viewport
canvasBounds: Bounds
}
export namespace ViewportResult {
export const KIND = 'viewportResult';
export function create(viewport: Viewport, canvasBounds: Bounds, requestId: string): ViewportResult {
return {
kind: KIND,
viewport,
canvasBounds,
responseId: requestId
};
}
}
@injectable()
export class SetViewportCommand extends MergeableCommand {
static readonly KIND = ProtocolSetViewPortAction.KIND;
static readonly KIND = SetViewportAction.KIND;

@@ -79,3 +40,3 @@ @inject(TYPES.ViewerOptions) protected viewerOptions: ViewerOptions;

constructor(@inject(TYPES.Action) protected readonly action: ProtocolSetViewPortAction) {
constructor(@inject(TYPES.Action) protected readonly action: SetViewportAction) {
super();

@@ -170,16 +131,1 @@ this.newViewport = action.newViewport;

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export class SetViewportAction implements Action, ProtocolSetViewPortAction {
static readonly KIND = 'viewport';
readonly kind = SetViewportAction.KIND;
constructor(public readonly elementId: string,
public readonly newViewport: Viewport,
public readonly animate: boolean) {
}
}

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

import { SModelElementImpl, SModelRootImpl } from '../../base/model/smodel';
import { SModelExtension } from '../../base/model/smodel-extension';
import { findParentByFeature } from '../../base/model/smodel-utils';

@@ -107,17 +106,1 @@ import { TYPES } from '../../base/types';

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Zoomable extends SModelExtension {
zoom: number
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function isZoomable(element: SModelElementImpl | Zoomable): element is Zoomable {
return 'zoom' in element;
}

@@ -19,13 +19,12 @@ /********************************************************************************

import 'mocha';
import { expect } from "chai";
import { expect } from 'chai';
import { Container } from 'inversify';
import { TYPES } from '../../base/types';
import { ConsoleLogger } from "../../utils/logging";
import { SModelRootImpl } from "../../base/model/smodel";
import { EMPTY_ROOT } from "../../base/model/smodel-factory";
import { CommandExecutionContext } from "../../base/commands/command";
import { AnimationFrameSyncer } from "../../base/animations/animation-frame-syncer";
import { SGraphFactory } from "../../graph/sgraph-factory";
import { ConsoleLogger } from '../../utils/logging';
import { SModelRootImpl } from '../../base/model/smodel';
import { EMPTY_ROOT, IModelFactory } from '../../base/model/smodel-factory';
import { CommandExecutionContext } from '../../base/commands/command';
import { AnimationFrameSyncer } from '../../base/animations/animation-frame-syncer';
import { BringToFrontCommand } from './zorder';
import defaultModule from "../../base/di.config";
import defaultModule from '../../base/di.config';
import { SNodeImpl } from '../../graph/sgraph';

@@ -45,5 +44,4 @@ import { BringToFrontAction } from 'sprotty-protocol';

container.load(defaultModule);
container.rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const graphFactory = container.get<SGraphFactory>(TYPES.IModelFactory);
const graphFactory = container.get<IModelFactory>(TYPES.IModelFactory);

@@ -89,3 +87,3 @@ const myNode0 = {id: 'node0', type: 'node:circle', x: 100, y: 100, selected: true};

it('undo() works as expected', () => {
// Test "undo"
// Test 'undo'
context.root = newModel;

@@ -100,3 +98,3 @@ newModel = cmd.undo(context);

it('redo() works as expected', () => {
// Test "redo"
// Test 'redo'
context.root = newModel;

@@ -103,0 +101,0 @@ newModel = cmd.redo(context);

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

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

@@ -32,7 +32,7 @@ import { SModelRootImpl, SChildElementImpl, SModelElementImpl, SParentElementImpl } from '../../base/model/smodel';

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

@@ -100,23 +100,1 @@ }

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Action to render the selected elements in front of others by manipulating the z-order.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface BringToFrontAction extends Action {
kind: typeof BringToFrontAction.KIND;
elementIDs: string[]
}
export namespace BringToFrontAction {
export const KIND = 'bringToFront';
export function create(elementIDs: string[]): BringToFrontAction {
return {
kind: KIND,
elementIDs
};
}
}

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

import {
SModelElement as SModelElementSchema, SModelRoot as SModelRootSchema, SShapeElement as SShapeElementSchema
} from 'sprotty-protocol/lib/model';
import { Bounds, Point } from 'sprotty-protocol/lib/utils/geometry';
import { Point } from 'sprotty-protocol/lib/utils/geometry';
import { ModelIndexImpl, SChildElementImpl, SModelElementImpl } from '../base/model/smodel';

@@ -35,3 +32,3 @@ import {

import { Selectable, selectFeature } from '../features/select/model';
import { ViewportRootElement } from '../features/viewport/viewport-root';
import { ViewportRootElementImpl } from '../features/viewport/viewport-root';
import { FluentIterable, FluentIterableImpl } from '../utils/iterable';

@@ -42,3 +39,3 @@

*/
export class SGraphImpl extends ViewportRootElement {
export class SGraphImpl extends ViewportRootElementImpl {
layoutOptions?: ModelLayoutOptions;

@@ -265,93 +262,1 @@

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* Serializable schema for graph-like models.
*
* @deprecated Use `SGraph` from `sprotty-protocol` instead.
*/
export interface SGraphSchema extends SModelRootSchema {
children: SModelElementSchema[]
bounds?: Bounds
scroll?: Point
zoom?: number
layoutOptions?: ModelLayoutOptions
}
/** @deprecated Use `SCompartmentImpl` instead. */
export const SCompartment = SCompartmentImpl;
/** @deprecated Use `SGraphImpl` instead. */
export const SGraph = SGraphImpl;
/**
* Serializable schema for SNode.
*
* @deprecated Use `SNode` from `sprotty-protocol` instead.
*/
export interface SNodeSchema extends SShapeElementSchema {
layout?: string
selected?: boolean
hoverFeedback?: boolean
opacity?: number
anchorKind?: string
}
/** @deprecated Use `SNodeImpl` instead. */
export const SNode = SNodeImpl;
/**
* Serializable schema for SPort.
*
* @deprecated Use `SPort` from `sprotty-protocol` instead.
*/
export interface SPortSchema extends SShapeElementSchema {
selected?: boolean
hoverFeedback?: boolean
opacity?: number
anchorKind?: string;
}
/** @deprecated Use `SPortImpl` instead. */
export const SPort = SPortImpl;
/**
* Serializable schema for SEdge.
*
* @deprecated Use `SEdge` from `sprotty-protocol` instead.
*/
export interface SEdgeSchema extends SModelElementSchema {
sourceId: string
targetId: string
routerKind?: string;
routingPoints?: Point[]
selected?: boolean
hoverFeedback?: boolean
opacity?: number
}
/** @deprecated Use `SEdgeImpl` instead. */
export const SEdge = SEdgeImpl;
/**
* Serializable schema for SLabel.
*
* @deprecated Use `SLabel` from `sprotty-protocol` instead.
*/
export interface SLabelSchema extends SShapeElementSchema {
text: string
selected?: boolean
}
/** @deprecated Use `SLabelImpl` instead. */
export const SLabel = SLabelImpl;
/**
* Serializable schema for SCompartment.
*
* @deprecated Use `SCompartment` from `sprotty-protocol` instead.
*/
export interface SCompartmentSchema extends SShapeElementSchema {
layout?: string
}

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

export * from './base/model/smodel-extension';
export * from './base/model/smodel-factory';

@@ -42,5 +41,2 @@ export * from './base/model/smodel-utils';

export * from './base/tool-manager/tool-manager';
export * from './base/tool-manager/tool';
export * from './base/ui-extensions/ui-extension-registry';

@@ -67,121 +63,119 @@ export * from './base/ui-extensions/ui-extension';

export * from "./features/bounds/bounds-manipulation";
export * from "./features/bounds/hidden-bounds-updater";
export * from "./features/bounds/layout";
export * from "./features/bounds/model";
export * from "./features/bounds/vbox-layout";
export * from "./features/bounds/hbox-layout";
export * from "./features/bounds/stack-layout";
export * from "./features/bounds/views";
export * from './features/bounds/bounds-manipulation';
export * from './features/bounds/hidden-bounds-updater';
export * from './features/bounds/layout';
export * from './features/bounds/model';
export * from './features/bounds/vbox-layout';
export * from './features/bounds/hbox-layout';
export * from './features/bounds/stack-layout';
export * from './features/bounds/views';
export * from "./features/button/button-handler";
export * from "./features/button/model";
export * from './features/button/button-handler';
export * from './features/button/model';
export * from "./features/command-palette/action-providers";
export * from "./features/command-palette/command-palette";
export * from './features/command-palette/action-providers';
export * from './features/command-palette/command-palette';
export * from "./features/context-menu/context-menu-service";
export * from "./features/context-menu/menu-providers";
export * from "./features/context-menu/mouse-listener";
export * from './features/context-menu/context-menu-service';
export * from './features/context-menu/menu-providers';
export * from './features/context-menu/mouse-listener';
export * from "./features/edge-layout/di.config";
export * from "./features/edge-layout/edge-layout";
export * from "./features/edge-layout/model";
export * from './features/edge-layout/di.config';
export * from './features/edge-layout/edge-layout';
export * from './features/edge-layout/model';
export * from "./features/edit/create";
export * from "./features/edit/create-on-drag";
export * from "./features/edit/di.config";
export * from "./features/edit/delete";
export * from "./features/edit/edit-label";
export * from "./features/edit/edit-label-ui";
export * from "./features/edit/edit-routing";
export * from "./features/edit/model";
export * from "./features/edit/reconnect";
export * from './features/edit/create';
export * from './features/edit/create-on-drag';
export * from './features/edit/di.config';
export * from './features/edit/delete';
export * from './features/edit/edit-label';
export * from './features/edit/edit-label-ui';
export * from './features/edit/edit-routing';
export * from './features/edit/model';
export * from './features/edit/reconnect';
export * from "./features/expand/expand";
export * from "./features/expand/model";
export * from "./features/expand/views";
export * from './features/expand/expand';
export * from './features/expand/model';
export * from './features/expand/views';
export * from "./features/export/export";
export * from "./features/export/model";
export * from "./features/export/svg-exporter";
export * from './features/export/export';
export * from './features/export/model';
export * from './features/export/svg-exporter';
export * from "./features/fade/fade";
export * from "./features/fade/model";
export * from './features/fade/fade';
export * from './features/fade/model';
export * from "./features/hover/hover";
export * from "./features/hover/model";
export * from './features/hover/hover';
export * from './features/hover/model';
export * from "./features/decoration/model";
export * from "./features/decoration/views";
export * from "./features/decoration/decoration-placer";
export * from './features/decoration/model';
export * from './features/decoration/views';
export * from './features/decoration/decoration-placer';
export * from "./features/edge-intersection/intersection-finder";
export * from "./features/edge-intersection/sweepline";
export * from './features/edge-intersection/intersection-finder';
export * from './features/edge-intersection/sweepline';
export * from "./features/move/model";
export * from "./features/move/move";
export * from "./features/move/snap";
export * from './features/move/model';
export * from './features/move/move';
export * from './features/move/snap';
export * from "./features/nameable/model";
export * from './features/nameable/model';
export * from "./features/open/open";
export * from "./features/open/model";
export * from './features/open/open';
export * from './features/open/model';
export * from "./features/projection/model";
export * from "./features/projection/views";
export * from './features/projection/model';
export * from './features/projection/views';
export * from "./features/routing/anchor";
export * from "./features/routing/abstract-edge-router";
export * from "./features/routing/bezier-anchors";
export * from "./features/routing/bezier-edge-router";
export * from "./features/routing/manhattan-anchors";
export * from "./features/routing/manhattan-edge-router";
export * from "./features/routing/model";
export * from "./features/routing/polyline-anchors";
export * from "./features/routing/polyline-edge-router";
export * from "./features/routing/routing";
export * from "./features/routing/views";
export * from './features/routing/anchor';
export * from './features/routing/abstract-edge-router';
export * from './features/routing/bezier-anchors';
export * from './features/routing/bezier-edge-router';
export * from './features/routing/manhattan-anchors';
export * from './features/routing/manhattan-edge-router';
export * from './features/routing/model';
export * from './features/routing/polyline-anchors';
export * from './features/routing/polyline-edge-router';
export * from './features/routing/routing';
export * from './features/routing/views';
export * from "./features/select/model";
export * from "./features/select/select";
export * from './features/select/model';
export * from './features/select/select';
export * from "./features/undo-redo/undo-redo";
export * from './features/undo-redo/undo-redo';
export * from "./features/update/model-matching";
export * from "./features/update/update-model";
export * from './features/update/model-matching';
export * from './features/update/update-model';
export * from "./features/viewport/center-fit";
export * from "./features/viewport/model";
export * from "./features/viewport/scroll";
export * from "./features/viewport/viewport-root";
export * from "./features/viewport/viewport";
export * from "./features/viewport/zoom";
export * from './features/viewport/center-fit';
export * from './features/viewport/model';
export * from './features/viewport/scroll';
export * from './features/viewport/viewport-root';
export * from './features/viewport/viewport';
export * from './features/viewport/zoom';
export * from "./features/zorder/zorder";
export * from './features/zorder/zorder';
import graphModule from "./graph/di.config";
import boundsModule from "./features/bounds/di.config";
import buttonModule from "./features/button/di.config";
import commandPaletteModule from "./features/command-palette/di.config";
import contextMenuModule from "./features/context-menu/di.config";
import decorationModule from "./features/decoration/di.config";
import edgeIntersectionModule from "./features/edge-intersection/di.config";
import edgeLayoutModule from "./features/edge-layout/di.config";
import expandModule from "./features/expand/di.config";
import exportModule from "./features/export/di.config";
import fadeModule from "./features/fade/di.config";
import hoverModule from "./features/hover/di.config";
import moveModule from "./features/move/di.config";
import openModule from "./features/open/di.config";
import routingModule from "./features/routing/di.config";
import selectModule from "./features/select/di.config";
import undoRedoModule from "./features/undo-redo/di.config";
import updateModule from "./features/update/di.config";
import viewportModule from "./features/viewport/di.config";
import boundsModule from './features/bounds/di.config';
import buttonModule from './features/button/di.config';
import commandPaletteModule from './features/command-palette/di.config';
import contextMenuModule from './features/context-menu/di.config';
import decorationModule from './features/decoration/di.config';
import edgeIntersectionModule from './features/edge-intersection/di.config';
import edgeLayoutModule from './features/edge-layout/di.config';
import expandModule from './features/expand/di.config';
import exportModule from './features/export/di.config';
import fadeModule from './features/fade/di.config';
import hoverModule from './features/hover/di.config';
import moveModule from './features/move/di.config';
import openModule from './features/open/di.config';
import routingModule from './features/routing/di.config';
import selectModule from './features/select/di.config';
import undoRedoModule from './features/undo-redo/di.config';
import updateModule from './features/update/di.config';
import viewportModule from './features/viewport/di.config';
import zorderModule from './features/zorder/di.config';
export {
graphModule, boundsModule, buttonModule, commandPaletteModule, contextMenuModule, decorationModule,
boundsModule, buttonModule, commandPaletteModule, contextMenuModule, decorationModule,
edgeIntersectionModule, edgeLayoutModule, expandModule, exportModule, fadeModule, hoverModule, moveModule,

@@ -193,5 +187,4 @@ openModule, routingModule, selectModule, undoRedoModule, updateModule, viewportModule, zorderModule

export * from "./graph/sgraph-factory";
export * from "./graph/sgraph";
export * from "./graph/views";
export * from './graph/sgraph';
export * from './graph/views';

@@ -201,8 +194,8 @@

export * from "./lib/modules";
export * from "./lib/generic-views";
export * from "./lib/html-views";
export * from "./lib/jsx";
export * from "./lib/model";
export * from "./lib/svg-views";
export * from './lib/modules';
export * from './lib/generic-views';
export * from './lib/html-views';
export * from './lib/jsx';
export * from './lib/model';
export * from './lib/svg-views';

@@ -212,10 +205,10 @@

export * from "./model-source/commit-model";
export * from "./model-source/diagram-server";
export * from "./model-source/local-model-source";
export * from "./model-source/logging";
export * from "./model-source/model-source";
export * from "./model-source/websocket";
export * from './model-source/commit-model';
export * from './model-source/diagram-server';
export * from './model-source/local-model-source';
export * from './model-source/logging';
export * from './model-source/model-source';
export * from './model-source/websocket';
import modelSourceModule from "./model-source/di.config";
import modelSourceModule from './model-source/di.config';
export { modelSourceModule };

@@ -226,9 +219,8 @@

export * from "./utils/browser";
export * from "./utils/codicon";
export * from "./utils/color";
export * from "./utils/geometry";
export * from "./utils/inversify";
export * from "./utils/json";
export * from "./utils/logging";
export * from "./utils/registry";
export * from './utils/browser';
export * from './utils/codicon';
export * from './utils/color';
export * from './utils/geometry';
export * from './utils/inversify';
export * from './utils/logging';
export * from './utils/registry';

@@ -17,9 +17,9 @@ /********************************************************************************

import { inject, injectable } from "inversify";
import { Action } from "sprotty-protocol/lib/actions";
import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { CommandExecutionContext, CommandReturn, SystemCommand } from "../base/commands/command";
import { SModelRootImpl } from "../base/model/smodel";
import { TYPES } from "../base/types";
import { ModelSource } from "./model-source";
import { inject, injectable } from 'inversify';
import { Action } from 'sprotty-protocol/lib/actions';
import { SModelRoot } from 'sprotty-protocol/lib/model';
import { CommandExecutionContext, CommandReturn, SystemCommand } from '../base/commands/command';
import { SModelRootImpl } from '../base/model/smodel';
import { TYPES } from '../base/types';
import { ModelSource } from './model-source';

@@ -53,4 +53,4 @@ /**

originalModel: SModelRootSchema;
newModel: SModelRootSchema;
originalModel: SModelRoot;
newModel: SModelRoot;

@@ -66,3 +66,3 @@ constructor(@inject(TYPES.Action) protected readonly action: CommitModelAction) {

protected doCommit(model: SModelRootSchema, result: SModelRootImpl, doSetOriginal: boolean): CommandReturn {
protected doCommit(model: SModelRoot, result: SModelRootImpl, doSetOriginal: boolean): CommandReturn {
const commitResult = this.modelSource.commitModel(model);

@@ -69,0 +69,0 @@ if (commitResult instanceof Promise) {

@@ -19,9 +19,7 @@ /********************************************************************************

import { inject, injectable } from 'inversify';
import { OpenAction, ActionMessage as ProtocolActionMessage, isActionMessage as isProtocolActionMessage } from 'sprotty-protocol';
import {
Action, CollapseExpandAction, CollapseExpandAllAction, ComputedBoundsAction, RequestModelAction,
RequestPopupModelAction, SetModelAction, UpdateModelAction
Action, OpenAction, ActionMessage, isActionMessage, CollapseExpandAction, CollapseExpandAllAction,
ComputedBoundsAction, RequestModelAction, RequestPopupModelAction, SetModelAction, UpdateModelAction
} from 'sprotty-protocol/lib/actions';
import { SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { hasOwnProperty } from 'sprotty-protocol/lib/utils/object';
import { SModelRoot } from 'sprotty-protocol/lib/model';
import { ActionHandlerRegistry } from '../base/actions/action-handler';

@@ -64,3 +62,3 @@ import { ICommand } from '../base/commands/command';

protected currentRoot: SModelRootSchema = {
protected currentRoot: SModelRoot = {
type: 'NONE',

@@ -72,3 +70,3 @@ id: 'ROOT'

override get model(): SModelRootSchema {
override get model(): SModelRoot {
return this.currentRoot;

@@ -102,3 +100,3 @@ }

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

@@ -114,3 +112,3 @@ action: action

*/
protected abstract sendMessage(message: ProtocolActionMessage): void;
protected abstract sendMessage(message: ActionMessage): void;

@@ -122,3 +120,3 @@ /**

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

@@ -166,3 +164,3 @@ (object.action as any)[receivedFromServerProperty] = true;

if (newRoot) {
this.currentRoot = newRoot as SModelRootSchema;
this.currentRoot = newRoot as SModelRoot;
if (action.kind === SetModelCommand.KIND || action.kind === UpdateModelCommand.KIND) {

@@ -219,3 +217,3 @@ this.lastSubmittedModelType = newRoot.type;

commitModel(newRoot: SModelRootSchema): Promise<SModelRootSchema> | SModelRootSchema {
commitModel(newRoot: SModelRoot): Promise<SModelRoot> | SModelRoot {
const previousRoot = this.currentRoot;

@@ -226,25 +224,1 @@ this.currentRoot = newRoot;

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use `DiagramServerProxy` instead.
*/
export const DiagramServer = DiagramServerProxy;
/**
* Wrapper for actions when transferring them between client and server via a DiagramServer.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface ActionMessage {
clientId: string
action: Action
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function isActionMessage(object: unknown): object is ActionMessage {
return hasOwnProperty(object, 'action');
}

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

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

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

export interface IPopupModelProvider {
getPopupModel(request: RequestPopupModelAction, element?: SModelElementSchema): SModelRootSchema | undefined;
getPopupModel(request: RequestPopupModelAction, element?: SModelElement): SModelRoot | undefined;
}

@@ -53,5 +53,5 @@

@inject(TYPES.IPopupModelProvider)@optional() protected popupModelProvider?: IPopupModelProvider;
@inject(TYPES.IModelLayoutEngine)@optional() protected layoutEngine?: ProtocolIModelLayoutEngine;
@inject(TYPES.IModelLayoutEngine)@optional() protected layoutEngine?: IModelLayoutEngine;
protected currentRoot: SModelRootSchema = EMPTY_ROOT;
protected currentRoot: SModelRoot = EMPTY_ROOT;

@@ -64,7 +64,7 @@ /**

override get model(): SModelRootSchema {
override get model(): SModelRoot {
return this.currentRoot;
}
set model(root: SModelRootSchema) {
set model(root: SModelRoot) {
this.setModel(root);

@@ -84,3 +84,3 @@ }

*/
setModel(newRoot: SModelRootSchema): Promise<void> {
setModel(newRoot: SModelRoot): Promise<void> {
this.currentRoot = newRoot;

@@ -90,3 +90,3 @@ return this.submitModel(newRoot, false);

commitModel(newRoot: SModelRootSchema): Promise<SModelRootSchema> | SModelRootSchema {
commitModel(newRoot: SModelRoot): Promise<SModelRoot> | SModelRoot {
const previousRoot = this.currentRoot;

@@ -102,3 +102,3 @@ this.currentRoot = newRoot;

*/
updateModel(newRoot?: SModelRootSchema): Promise<void> {
updateModel(newRoot?: SModelRoot): Promise<void> {
if (newRoot === undefined) {

@@ -115,5 +115,5 @@ return this.submitModel(this.currentRoot, true);

*/
async getSelection(): Promise<FluentIterable<SModelElementSchema>> {
async getSelection(): Promise<FluentIterable<SModelElement>> {
const res = await this.actionDispatcher.request<SelectionResult>(GetSelectionAction.create());
const result: SModelElementSchema[] = [];
const result: SModelElement[] = [];
this.gatherSelectedElements(this.currentRoot, new Set(res.selectedElementsIDs), result);

@@ -123,3 +123,3 @@ return result;

private gatherSelectedElements(element: SModelElementSchema, selected: Set<string>, result: SModelElementSchema[]): void {
private gatherSelectedElements(element: SModelElement, selected: Set<string>, result: SModelElement[]): void {
if (selected.has(element.id)) {

@@ -151,3 +151,3 @@ result.push(element);

*/
protected async submitModel(newRoot: SModelRootSchema, update: boolean | Match[], cause?: Action): Promise<void> {
protected async submitModel(newRoot: SModelRoot, update: boolean | Match[], cause?: Action): Promise<void> {
if (this.viewerOptions.needsClientLayout) {

@@ -166,3 +166,3 @@ const computedBounds = await this.actionDispatcher.request<ComputedBoundsAction>(RequestBoundsAction.create(newRoot));

*/
protected async doSubmitModel(newRoot: SModelRootSchema, update: boolean | Match[],
protected async doSubmitModel(newRoot: SModelRoot, update: boolean | Match[],
cause?: Action, index?: SModelIndex): Promise<void> {

@@ -206,3 +206,3 @@ if (this.layoutEngine !== undefined) {

*/
addElements(elements: (SModelElementSchema | { element: SModelElementSchema, parentId: string })[]): Promise<void> {
addElements(elements: (SModelElement | { element: SModelElement, parentId: string })[]): Promise<void> {
const matches: Match[] = [];

@@ -296,17 +296,1 @@ for (const e of elements) {

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use IPopupModelProvider instead.
*/
export type PopupModelFactory = (request: RequestPopupModelAction, element?: SModelElementSchema)
=> SModelRootSchema | undefined;
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface IModelLayoutEngine {
layout(model: SModelRootSchema, index?: SModelIndex): SModelRootSchema | Promise<SModelRootSchema>;
}

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

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

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

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

@@ -79,25 +79,1 @@ severity: LogLevel[logLevel],

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface LoggingAction extends Action {
kind: typeof LoggingAction.KIND;
severity: string
time: string
caller: string
message: string
params: string[]
}
export namespace LoggingAction {
export const KIND = 'logging';
export function create(options: { severity: string, time: string, caller: string, message: string, params: string[] }): LoggingAction {
return {
kind: KIND,
...options
};
}
}

@@ -17,12 +17,12 @@ /********************************************************************************

import { inject, injectable } from "inversify";
import { Action, ComputedBoundsAction, RequestModelAction } from "sprotty-protocol/lib/actions";
import { SModelElement as SModelElementSchema, SModelRoot as SModelRootSchema } from 'sprotty-protocol/lib/model';
import { inject, injectable } from 'inversify';
import { Action, ComputedBoundsAction, RequestModelAction } from 'sprotty-protocol/lib/actions';
import { SModelElement, SModelRoot } from 'sprotty-protocol/lib/model';
import { Dimension, Point } from 'sprotty-protocol/lib/utils/geometry';
import { SModelIndex } from "sprotty-protocol/lib/utils/model-utils";
import { IActionDispatcher } from "../base/actions/action-dispatcher";
import { ActionHandlerRegistry, IActionHandler, IActionHandlerInitializer } from "../base/actions/action-handler";
import { ICommand } from "../base/commands/command";
import { TYPES } from "../base/types";
import { ViewerOptions } from "../base/views/viewer-options";
import { SModelIndex } from 'sprotty-protocol/lib/utils/model-utils';
import { IActionDispatcher } from '../base/actions/action-dispatcher';
import { ActionHandlerRegistry, IActionHandler, IActionHandlerInitializer } from '../base/actions/action-handler';
import { ICommand } from '../base/commands/command';
import { TYPES } from '../base/types';
import { ViewerOptions } from '../base/views/viewer-options';
import { ExportSvgAction } from '../features/export/svg-exporter';

@@ -60,3 +60,3 @@

abstract get model(): SModelRootSchema;
abstract get model(): SModelRoot;

@@ -76,3 +76,3 @@ abstract handle(action: Action): ICommand | Action | void;

*/
abstract commitModel(newRoot: SModelRootSchema): Promise<SModelRootSchema> | SModelRootSchema;
abstract commitModel(newRoot: SModelRoot): Promise<SModelRoot> | SModelRoot;
}

@@ -83,3 +83,3 @@

export class ComputedBoundsApplicator {
apply(root: SModelRootSchema, action: ComputedBoundsAction): SModelIndex {
apply(root: SModelRoot, action: ComputedBoundsAction): SModelIndex {
const index = new SModelIndex();

@@ -102,3 +102,3 @@ index.add(root);

protected applyAlignment(element: SModelElementSchema, newAlignment: Point) {
protected applyAlignment(element: SModelElement, newAlignment: Point) {
const e = element as any;

@@ -108,3 +108,3 @@ e.alignment = { x: newAlignment.x, y: newAlignment.y };

protected applyBounds(element: SModelElementSchema, newPosition: Point | undefined, newSize: Dimension) {
protected applyBounds(element: SModelElement, newPosition: Point | undefined, newSize: Dimension) {
const e = element as any;

@@ -111,0 +111,0 @@ if (newPosition)

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

import { injectable } from "inversify";
import { ActionMessage } from "sprotty-protocol/lib/actions";
import { DiagramServerProxy } from "./diagram-server";
import { injectable } from 'inversify';
import { ActionMessage } from 'sprotty-protocol/lib/actions';
import { DiagramServerProxy } from './diagram-server';

@@ -55,8 +55,1 @@ /**

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use `WebSocketDiagramServerProxy` instead;
*/
export const WebSocketDiagramServer = WebSocketDiagramServerProxy;

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

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

@@ -40,5 +40,5 @@ /**

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

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

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

@@ -58,3 +58,3 @@ x: this.bounds.x + this.bounds.width,

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

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

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

@@ -95,4 +95,4 @@ x: this.bounds.x,

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

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

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

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

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

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

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

@@ -247,6 +247,6 @@ return undefined;

hasIndistinctPoints(otherLine: PointToPointLine): boolean {
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);
return Point.equals(this.p1, otherLine.p1) ||
Point.equals(this.p1, otherLine.p2) ||
Point.equals(this.p2, otherLine.p1) ||
Point.equals(this.p2, otherLine.p2);
}

@@ -261,3 +261,3 @@ }

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

@@ -270,8 +270,2 @@ x: (l1.c * l2.b - l2.c * l1.b) / (l1.a * l2.b - l2.a * l1.b),

/**
* Enumeration of possible directions (left, right, up, down)
* @deprecated do we use this? We should rather use a string type
*/
export enum Direction { left, right, up, down }
/**
* A minimum and maximum value of a numeric type.

@@ -298,356 +292,1 @@ */

}
// Compatibility deprecation layer (will be removed with the graduation 1.0.0 release)
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function isBounds(element: any): element is Bounds {
return 'x' in element
&& 'y' in element
&& 'width' in element
&& 'height' in element;
}
/**
* Combines the bounds of two objects into one, so that the new bounds
* are the minimum bounds that covers both of the original bounds.
* @param {Bounds} b0 - First bounds object
* @param {Bounds} b1 - Second bounds object
* @returns {Bounds} The combined bounds
*
* @deprecated Use `Bounds.combine` from `sprotty-protocol` instead.
*/
export function combine(b0: Bounds, b1: Bounds): Bounds {
if (!isValidDimension(b0))
return isValidDimension(b1) ? b1 : EMPTY_BOUNDS;
if (!isValidDimension(b1))
return b0;
const minX = Math.min(b0.x, b1.x);
const minY = Math.min(b0.y, b1.y);
const maxX = Math.max(b0.x + (b0.width >= 0 ? b0.width : 0), b1.x + (b1.width >= 0 ? b1.width : 0));
const maxY = Math.max(b0.y + (b0.height >= 0 ? b0.height : 0), b1.y + (b1.height >= 0 ? b1.height : 0));
return {
x: minX, y: minY, width: maxX - minX, height: maxY - minY
};
}
/**
* Translates the given bounds.
* @param {Bounds} b - Bounds object
* @param {Point} p - Vector by which to translate the bounds
* @returns {Bounds} The translated bounds
*
* @deprecated Use `Bounds.translate` from `sprotty-protocol` instead.
*/
export function translate(b: Bounds, p: Point): Bounds {
return {
x: b.x + p.x,
y: b.y + p.y,
width: b.width,
height: b.height
};
}
/**
* Returns the center point of the bounds of an object
* @param {Bounds} b - Bounds object
* @returns {Point} the center point
*
* @deprecated Use `Bounds.center` from `sprotty-protocol` instead.
*/
export function center(b: Bounds): Point {
return {
x: b.x + (b.width >= 0 ? 0.5 * b.width : 0),
y: b.y + (b.height >= 0 ? 0.5 * b.height : 0)
};
}
/**
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function centerOfLine(s: Point, e: Point): Point {
const b: Bounds = {
x: s.x > e.x ? e.x : s.x,
y: s.y > e.y ? e.y : s.y,
width: Math.abs(e.x - s.x),
height: Math.abs(e.y - s.y)
};
return center(b);
}
/**
* Checks whether the point p is included in the bounds b.
*
* @deprecated Use `Bounds.includes` from `sprotty-protocol` instead.
*/
export function includes(b: Bounds, p: Point): boolean {
return p.x >= b.x && p.x <= b.x + b.width && p.y >= b.y && p.y <= b.y + b.height;
}
/**
* Returns the "straight line" distance between two points.
* @param {Point} a - First point
* @param {Point} b - Second point
* @returns {number} The Eucledian distance
*
* @deprecated Use `Point.euclideanDistance` from `sprotty-protocol` instead.
*/
export function euclideanDistance(a: Point, b: Point): number {
const dx = b.x - a.x;
const dy = b.y - a.y;
return Math.sqrt(dx * dx + dy * dy);
}
/**
* Returns the distance between two points in a grid, using a
* strictly vertical and/or horizontal path (versus straight line).
* @param {Point} a - First point
* @param {Point} b - Second point
* @returns {number} The Manhattan distance
*
* @deprecated Use `Point.manhattanDistance` from `sprotty-protocol` instead.
*/
export function manhattanDistance(a: Point, b: Point): number {
return Math.abs(b.x - a.x) + Math.abs(b.y - a.y);
}
/**
* Returns the maximum of the horizontal and the vertical distance.
* @param {Point} a - First point
* @param {Point} b - Second point
* @returns {number} The maximum distance
*
* @deprecated Use `Point.maxDistance` from `sprotty-protocol` instead.
*/
export function maxDistance(a: Point, b: Point): number {
return Math.max(Math.abs(b.x - a.x), Math.abs(b.y - a.y));
}
/**
* Computes the angle in radians of the given point to the x-axis of the coordinate system.
* The result is in the range [-pi, pi].
* @param {Point} p - A point in the Eucledian plane
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function angleOfPoint(p: Point): number {
return Math.atan2(p.y, p.x);
}
/**
* Computes the angle in radians between the two given points (relative to the origin of the coordinate system).
* The result is in the range [0, pi]. Returns NaN if the points are equal.
* @param {Point} a - First point
* @param {Point} b - Second point
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function angleBetweenPoints(a: Point, b: Point): number {
const lengthProduct = Math.sqrt((a.x * a.x + a.y * a.y) * (b.x * b.x + b.y * b.y));
if (isNaN(lengthProduct) || lengthProduct === 0)
return NaN;
const dotProduct = a.x * b.x + a.y * b.y;
return Math.acos(dotProduct / lengthProduct);
}
/**
* Computes a point that is the original `point` shifted towards `refPoint` by the given `distance`.
* @param {Point} point - Point to shift
* @param {Point} refPoint - Point to shift towards
* @param {Point} distance - Distance to shift
*
* @deprecated Use `Point.shiftTowards` from `sprotty-protocol` instead.
*/
export function shiftTowards(point: Point, refPoint: Point, distance: number): Point {
const diff = subtract(refPoint, point);
const normalized = normalize(diff);
const shift = { x: normalized.x * distance, y: normalized.y * distance };
return add(point, shift);
}
/**
* Computes the normalized vector from the vector given in `point`; that is, computing its unit vector.
* @param {Point} point - Point representing the vector to be normalized
* @returns {Point} The normalized point
*
* @deprecated Use `Point.normalize` from `sprotty-protocol` instead.
*/
export function normalize(point: Point): Point {
const mag = magnitude(point);
if (mag === 0 || mag === 1) {
return ORIGIN_POINT;
}
return {
x: point.x / mag,
y: point.y / mag
};
}
/**
* Computes the magnitude of the vector given in `point`.
* @param {Point} point - Point representing the vector to compute the magnitude for
* @returns {number} The magnitude or also known as length of the `point`
*
* @deprecated Use `Point.magnitude` from `sprotty-protocol` instead.
*/
export function magnitude(point: Point): number {
return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
}
/**
* Converts from radians to degrees
* @param {number} a - A value in radians
* @returns {number} The converted value
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function toDegrees(a: number): number {
return a * 180 / Math.PI;
}
/**
* Converts from degrees to radians
* @param {number} a - A value in degrees
* @returns {number} The converted value
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function toRadians(a: number): number {
return a * Math.PI / 180;
}
/**
* Returns whether two numbers are almost equal, within a small margin (0.001)
* @param {number} a - First number
* @param {number} b - Second number
* @returns {boolean} True if the two numbers are almost equal
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export function almostEquals(a: number, b: number): boolean {
return Math.abs(a - b) < 1e-3;
}
/**
* Calculates a linear combination of p0 and p1 using lambda, i.e.
* (1-lambda) * p0 + lambda * p1
*
* @deprecated Use `Point.linear` from `sprotty-protocol` instead.
*/
export function linear(p0: Point, p1: Point, lambda: number): Point {
return {
x: (1 - lambda) * p0.x + lambda * p1.x,
y: (1 - lambda) * p0.y + lambda * p1.y
};
}
/**
* A Point is composed of the (x,y) coordinates of an object.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Point {
readonly x: number
readonly y: number
}
/**
* (x,y) coordinates of the origin.
*
* @deprecated Use `Point.ORIGIN` from `sprotty-protocol` instead.
*/
export const ORIGIN_POINT: Point = Object.freeze({
x: 0,
y: 0
});
/**
* Adds two points.
* @param {Point} p1 - First point
* @param {Point} p2 - Second point
* @returns {Point} The sum of the two points
*
* @deprecated Use `Point.add` from `sprotty-protocol` instead.
*/
export function add(p1: Point, p2: Point): Point {
return {
x: p1.x + p2.x,
y: p1.y + p2.y
};
}
/**
* Subtracts two points.
* @param {Point} p1 - First point
* @param {Point} p2 - Second point
* @returns {Point} The difference of the two points
*
* @deprecated Use `Point.subtract` from `sprotty-protocol` instead.
*/
export function subtract(p1: Point, p2: Point): Point {
return {
x: p1.x - p2.x,
y: p1.y - p2.y
};
}
/**
* Specifies whether a point has exactly the same coordinates as another point.
* @param {Point} point1 a point
* @param {Point} point2 another point
* @returns {boolean} `true` if `point1` has exactly the same `x` and `y` values as `point2`, `false` otherwise.
*
* @deprecated Use `Point.equals` from `sprotty-protocol` instead.
*/
export function pointEquals(point1: Point, point2: Point): boolean {
return point1.x === point2.x && point1.y === point2.y;
}
/**
* The Dimension of an object is composed of its width and height.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Dimension {
readonly width: number
readonly height: number
}
/**
* A dimension with both width and height set to a negative value, which is considered as undefined.
*
* @deprecated Use `Dimension.EMPTY` from `sprotty-protocol` instead.
*/
export const EMPTY_DIMENSION: Dimension = Object.freeze({
width: -1,
height: -1
});
/**
* Checks whether the given dimention is valid, i.e. the width and height are non-zero.
* @param {Dimension} b - Dimension object
* @returns {boolean}
*
* @deprecated Use `Dimension.isValid` from `sprotty-protocol` instead.
*/
export function isValidDimension(d: Dimension): boolean {
return d.width >= 0 && d.height >= 0;
}
/**
* The bounds are the position (x, y) and dimension (width, height) of an object.
*
* @deprecated Use the declaration from `sprotty-protocol` instead.
*/
export interface Bounds extends Point, Dimension {
}
/**
* @deprecated Use `Bounds.EMPTY` from `sprotty-protocol` instead.
*/
export const EMPTY_BOUNDS: Bounds = Object.freeze({
x: 0,
y: 0,
width: -1,
height: -1
});

@@ -59,6 +59,8 @@ /********************************************************************************

register(key: string, factory: (u: U) => T) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
if (this.hasKey(key))
}
if (this.hasKey(key)) {
throw new Error('Key is already registered: ' + key);
}
this.elements.set(key, factory);

@@ -68,4 +70,5 @@ }

deregister(key: string) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
}
this.elements.delete(key);

@@ -80,6 +83,7 @@ }

const existingFactory = this.elements.get(key);
if (existingFactory)
if (existingFactory) {
return existingFactory(arg);
else
} else {
return this.missing(key, arg);
}
}

@@ -97,6 +101,8 @@

register(key: string, instance: T) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
if (this.hasKey(key))
}
if (this.hasKey(key)) {
throw new Error('Key is already registered: ' + key);
}
this.elements.set(key, instance);

@@ -106,4 +112,5 @@ }

deregister(key: string) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
}
this.elements.delete(key);

@@ -118,6 +125,7 @@ }

const existingInstance = this.elements.get(key);
if (existingInstance)
if (existingInstance) {
return existingInstance;
else
} else {
return this.missing(key);
}
}

@@ -135,14 +143,17 @@

register(key: string, instance: T) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
}
const instances = this.elements.get(key);
if (instances !== undefined)
if (instances !== undefined) {
instances.push(instance);
else
} else {
this.elements.set(key, [instance]);
}
}
deregisterAll(key: string) {
if (key === undefined)
if (key === undefined) {
throw new Error('Key is undefined');
}
this.elements.delete(key);

@@ -153,7 +164,8 @@ }

const existingInstances = this.elements.get(key);
if (existingInstances !== undefined)
if (existingInstances !== undefined) {
return existingInstances;
else
} else {
return [];
}
}
}

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

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

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

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

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