Socket
Socket
Sign inDemoInstall

sprotty

Package Overview
Dependencies
Maintainers
3
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.5.0-next.cf6ff2f to 0.5.0-next.d72b5aa

lib/base/views/css-class-decorator.d.ts

36

lib/base/di.config.js

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

var command_1 = require("./commands/command");
var css_class_decorator_1 = require("./views/css-class-decorator");
var defaultContainerModule = new inversify_1.ContainerModule(function (bind) {

@@ -99,27 +100,16 @@ // Logging ---------------------------------------------

bind(id_decorator_1.IdDecorator).toSelf().inSingletonScope();
bind(types_1.TYPES.IVNodeDecorator).toDynamicValue(function (context) {
return context.container.get(id_decorator_1.IdDecorator);
}).inSingletonScope();
bind(types_1.TYPES.IVNodeDecorator).toService(id_decorator_1.IdDecorator);
bind(types_1.TYPES.HiddenVNodeDecorator).toService(id_decorator_1.IdDecorator);
bind(css_class_decorator_1.CssClassDecorator).toSelf().inSingletonScope();
bind(types_1.TYPES.IVNodeDecorator).toService(css_class_decorator_1.CssClassDecorator);
bind(types_1.TYPES.HiddenVNodeDecorator).toService(css_class_decorator_1.CssClassDecorator);
bind(mouse_tool_1.MouseTool).toSelf().inSingletonScope();
bind(types_1.TYPES.IVNodeDecorator).toDynamicValue(function (context) {
return context.container.get(mouse_tool_1.MouseTool);
}).inSingletonScope();
bind(types_1.TYPES.IVNodeDecorator).toService(mouse_tool_1.MouseTool);
bind(key_tool_1.KeyTool).toSelf().inSingletonScope();
bind(types_1.TYPES.IVNodeDecorator).toDynamicValue(function (context) {
return context.container.get(key_tool_1.KeyTool);
}).inSingletonScope();
bind(types_1.TYPES.IVNodeDecorator).toService(key_tool_1.KeyTool);
bind(vnode_decorators_1.FocusFixDecorator).toSelf().inSingletonScope();
bind(types_1.TYPES.IVNodeDecorator).toDynamicValue(function (context) {
return context.container.get(vnode_decorators_1.FocusFixDecorator);
}).inSingletonScope();
bind(types_1.TYPES.PopupVNodeDecorator).toDynamicValue(function (context) {
return context.container.get(id_decorator_1.IdDecorator);
}).inSingletonScope();
bind(types_1.TYPES.IVNodeDecorator).toService(vnode_decorators_1.FocusFixDecorator);
bind(types_1.TYPES.PopupVNodeDecorator).toService(id_decorator_1.IdDecorator);
bind(mouse_tool_1.PopupMouseTool).toSelf().inSingletonScope();
bind(types_1.TYPES.PopupVNodeDecorator).toDynamicValue(function (context) {
return context.container.get(mouse_tool_1.PopupMouseTool);
}).inSingletonScope();
bind(types_1.TYPES.HiddenVNodeDecorator).toDynamicValue(function (context) {
return context.container.get(id_decorator_1.IdDecorator);
}).inSingletonScope();
bind(types_1.TYPES.PopupVNodeDecorator).toService(mouse_tool_1.PopupMouseTool);
// Animation Frame Sync ------------------------------------------

@@ -130,5 +120,3 @@ bind(types_1.TYPES.AnimationFrameSyncer).to(animation_frame_syncer_1.AnimationFrameSyncer).inSingletonScope();

bind(initialize_canvas_1.CanvasBoundsInitializer).toSelf().inSingletonScope();
bind(types_1.TYPES.IVNodeDecorator).toDynamicValue(function (context) {
return context.container.get(initialize_canvas_1.CanvasBoundsInitializer);
}).inSingletonScope();
bind(types_1.TYPES.IVNodeDecorator).toService(initialize_canvas_1.CanvasBoundsInitializer);
bind(types_1.TYPES.SModelStorage).to(smodel_storage_1.SModelStorage).inSingletonScope();

@@ -135,0 +123,0 @@ });

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

children?: SModelElementSchema[];
cssClasses?: string[];
}

@@ -43,2 +44,3 @@ /**

id: string;
cssClasses?: string[];
readonly root: SModelRoot;

@@ -45,0 +47,0 @@ readonly index: SModelIndex<SModelElement>;

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

keyDown(element: SModelRoot, event: KeyboardEvent): void;
keyUp(element: SModelRoot, event: KeyboardEvent): void;
focus(): void;

@@ -36,3 +37,4 @@ decorate(vnode: VNode, element: SModelElement): VNode;

keyDown(element: SModelElement, event: KeyboardEvent): Action[];
keyUp(element: SModelElement, event: KeyboardEvent): Action[];
}
//# sourceMappingURL=key-tool.d.ts.map

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

};
KeyTool.prototype.keyUp = function (element, event) {
this.handleEvent('keyUp', element, event);
};
KeyTool.prototype.focus = function () { };

@@ -66,2 +69,3 @@ KeyTool.prototype.decorate = function (vnode, element) {

vnode_utils_1.on(vnode, 'keydown', this.keyDown.bind(this), element);
vnode_utils_1.on(vnode, 'keyup', this.keyUp.bind(this), element);
}

@@ -87,2 +91,5 @@ return vnode;

};
KeyListener.prototype.keyUp = function (element, event) {
return [];
};
KeyListener = __decorate([

@@ -89,0 +96,0 @@ inversify_1.injectable()

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

export declare class SIssueMarker extends SDecoration {
messages: string[];
issues: SIssue[];
}
export declare class SIssue {
message: string;
severity: SIssueSeverity;
}
//# sourceMappingURL=model.d.ts.map

@@ -58,2 +58,8 @@ "use strict";

exports.SIssueMarker = SIssueMarker;
var SIssue = /** @class */ (function () {
function SIssue() {
}
return SIssue;
}());
exports.SIssue = SIssue;
//# sourceMappingURL=model.js.map

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

render(marker: SIssueMarker, context: RenderingContext): VNode;
protected getPath(severity: SIssueSeverity): "M768 128q209 0 385.5 103t279.5 279.5 103 385.5-103 385.5-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103zm128 1247v-190q0-14-9-23.5t-22-9.5h-192q-13 0-23 10t-10 23v190q0 13 10 23t23 10h192q13 0 22-9.5t9-23.5zm-2-344l18-621q0-12-10-18-10-8-24-8h-220q-14 0-24 8-10 6-10 18l17 621q0 10 10 17.5t24 7.5h185q14 0 23.5-7.5t10.5-17.5z" | "M1024 1375v-190q0-14-9.5-23.5t-22.5-9.5h-192q-13 0-22.5 9.5t-9.5 23.5v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19-13-11-24-11h-220q-11 0-24 11-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126-17 29-46.5 46t-63.5 17h-1536q-34 0-63.5-17t-46.5-46q-37-63-2-126l768-1408q17-31 47-49t65-18 65 18 47 49z" | "M1024 1376v-160q0-14-9-23t-23-9h-96v-512q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v160q0 14 9 23t23 9h96v320h-96q-14 0-23 9t-9 23v160q0 14 9 23t23 9h448q14 0 23-9t9-23zm-128-896v-160q0-14-9-23t-23-9h-192q-14 0-23 9t-9 23v160q0 14 9 23t23 9h192q14 0 23-9t9-23zm640 416q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z";
protected getMaxSeverity(marker: SIssueMarker): SIssueSeverity;
protected getPath(severity: SIssueSeverity): "M768 128q209 0 385.5 103t279.5 279.5 103 385.5-103 385.5-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103zm128 1247v-190q0-14-9-23.5t-22-9.5h-192q-13 0-23 10t-10 23v190q0 13 10 23t23 10h192q13 0 22-9.5t9-23.5zm-2-344l18-621q0-12-10-18-10-8-24-8h-220q-14 0-24 8-10 6-10 18l17 621q0 10 10 17.5t24 7.5h185q14 0 23.5-7.5t10.5-17.5z" | "M1024 1376v-160q0-14-9-23t-23-9h-96v-512q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v160q0 14 9 23t23 9h96v320h-96q-14 0-23 9t-9 23v160q0 14 9 23t23 9h448q14 0 23-9t9-23zm-128-896v-160q0-14-9-23t-23-9h-192q-14 0-23 9t-9 23v160q0 14 9 23t23 9h192q14 0 23-9t9-23zm640 416q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z";
}
//# sourceMappingURL=views.d.ts.map

@@ -27,16 +27,24 @@ "use strict";

var trafo = "scale(" + scale + ", " + scale + ")";
var maxSeverity = this.getMaxSeverity(marker);
var group = snabbdom_jsx_1.svg("g", { "class-sprotty-issue": true },
snabbdom_jsx_1.svg("g", { transform: trafo },
snabbdom_jsx_1.svg("path", { d: this.getPath(marker.severity) })));
vnode_utils_1.setClass(group, 'sprotty-' + marker.severity, true);
snabbdom_jsx_1.svg("path", { d: this.getPath(maxSeverity) })));
vnode_utils_1.setClass(group, 'sprotty-' + maxSeverity, true);
return group;
};
IssueMarkerView.prototype.getMaxSeverity = function (marker) {
var currentSeverity = 'info';
for (var _i = 0, _a = marker.issues.map(function (s) { return s.severity; }); _i < _a.length; _i++) {
var severity = _a[_i];
if (severity === 'error' || (severity === 'warning' && currentSeverity === 'info'))
currentSeverity = severity;
}
return currentSeverity;
};
IssueMarkerView.prototype.getPath = function (severity) {
switch (severity) {
case 'error':
case 'warning':
// tslint:disable-next-line:max-line-length
return "M768 128q209 0 385.5 103t279.5 279.5 103 385.5-103 385.5-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103zm128 1247v-190q0-14-9-23.5t-22-9.5h-192q-13 0-23 10t-10 23v190q0 13 10 23t23 10h192q13 0 22-9.5t9-23.5zm-2-344l18-621q0-12-10-18-10-8-24-8h-220q-14 0-24 8-10 6-10 18l17 621q0 10 10 17.5t24 7.5h185q14 0 23.5-7.5t10.5-17.5z";
case 'warning':
// tslint:disable-next-line:max-line-length
return "M1024 1375v-190q0-14-9.5-23.5t-22.5-9.5h-192q-13 0-22.5 9.5t-9.5 23.5v190q0 14 9.5 23.5t22.5 9.5h192q13 0 22.5-9.5t9.5-23.5zm-2-374l18-459q0-12-10-19-13-11-24-11h-220q-11 0-24 11-10 7-10 21l17 457q0 10 10 16.5t24 6.5h185q14 0 23.5-6.5t10.5-16.5zm-14-934l768 1408q35 63-2 126-17 29-46.5 46t-63.5 17h-1536q-34 0-63.5-17t-46.5-46q-37-63-2-126l768-1408q17-31 47-49t65-18 65 18 47 49z";
case 'info':

@@ -43,0 +51,0 @@ // tslint:disable-next-line:max-line-length

{
"name": "sprotty",
"version": "0.5.0-next.cf6ff2f",
"version": "0.5.0-next.d72b5aa",
"description": "A next-gen framework for graphical views",

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

"examples:watch": "webpack --watch --progress --config ./configs/webpack.config.js",
"prepublishOnly": "yarn run test",
"publish:next": "yarn publish --new-version \"$(semver $npm_package_version -i minor)-next.$(git rev-parse --short HEAD)\" --tag next",

@@ -98,0 +99,0 @@ "publish:latest": "yarn publish --tag latest"

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

import { CommandActionHandlerInitializer } from "./commands/command";
import { CssClassDecorator } from "./views/css-class-decorator";

@@ -105,20 +106,16 @@ const defaultContainerModule = new ContainerModule(bind => {

bind(IdDecorator).toSelf().inSingletonScope();
bind(TYPES.IVNodeDecorator).toDynamicValue(context =>
context.container.get(IdDecorator)).inSingletonScope();
bind(TYPES.IVNodeDecorator).toService(IdDecorator);
bind(TYPES.HiddenVNodeDecorator).toService(IdDecorator);
bind(CssClassDecorator).toSelf().inSingletonScope();
bind(TYPES.IVNodeDecorator).toService(CssClassDecorator);
bind(TYPES.HiddenVNodeDecorator).toService(CssClassDecorator);
bind(MouseTool).toSelf().inSingletonScope();
bind(TYPES.IVNodeDecorator).toDynamicValue(context =>
context.container.get(MouseTool)).inSingletonScope();
bind(TYPES.IVNodeDecorator).toService(MouseTool);
bind(KeyTool).toSelf().inSingletonScope();
bind(TYPES.IVNodeDecorator).toDynamicValue(context =>
context.container.get(KeyTool)).inSingletonScope();
bind(TYPES.IVNodeDecorator).toService(KeyTool);
bind(FocusFixDecorator).toSelf().inSingletonScope();
bind(TYPES.IVNodeDecorator).toDynamicValue(context =>
context.container.get(FocusFixDecorator)).inSingletonScope();
bind(TYPES.PopupVNodeDecorator).toDynamicValue(context =>
context.container.get(IdDecorator)).inSingletonScope();
bind(TYPES.IVNodeDecorator).toService(FocusFixDecorator);
bind(TYPES.PopupVNodeDecorator).toService(IdDecorator);
bind(PopupMouseTool).toSelf().inSingletonScope();
bind(TYPES.PopupVNodeDecorator).toDynamicValue(context =>
context.container.get(PopupMouseTool)).inSingletonScope();
bind(TYPES.HiddenVNodeDecorator).toDynamicValue(context =>
context.container.get(IdDecorator)).inSingletonScope();
bind(TYPES.PopupVNodeDecorator).toService(PopupMouseTool);

@@ -131,4 +128,3 @@ // Animation Frame Sync ------------------------------------------

bind(CanvasBoundsInitializer).toSelf().inSingletonScope();
bind(TYPES.IVNodeDecorator).toDynamicValue(context =>
context.container.get(CanvasBoundsInitializer)).inSingletonScope();
bind(TYPES.IVNodeDecorator).toService(CanvasBoundsInitializer);
bind(TYPES.SModelStorage).to(SModelStorage).inSingletonScope();

@@ -135,0 +131,0 @@

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

children?: SModelElementSchema[]
cssClasses?: string[]
}

@@ -47,2 +48,3 @@

id: string;
cssClasses?: string[];

@@ -49,0 +51,0 @@ get root(): SModelRoot {

@@ -56,2 +56,6 @@ /********************************************************************************

keyUp(element: SModelRoot, event: KeyboardEvent): void {
this.handleEvent('keyUp', element, event);
}
focus() {}

@@ -63,2 +67,3 @@

on(vnode, 'keydown', this.keyDown.bind(this), element);
on(vnode, 'keyup', this.keyUp.bind(this), element);
}

@@ -77,2 +82,6 @@ return vnode;

}
keyUp(element: SModelElement, event: KeyboardEvent): Action[] {
return [];
}
}

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

export class SIssueMarker extends SDecoration {
messages: string[];
issues: SIssue[];
}
export class SIssue {
message: string;
severity: SIssueSeverity;
}

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