@eclipse-glsp/client 2.7.0-next.3 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/base/action-dispatcher.d.ts +2 -1
- package/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +48 -24
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/default.module.d.ts.map +1 -1
- package/lib/base/default.module.js +2 -0
- package/lib/base/default.module.js.map +1 -1
- package/lib/base/editor-context-service.d.ts +4 -3
- package/lib/base/editor-context-service.d.ts.map +1 -1
- package/lib/base/editor-context-service.js +11 -1
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/model/diagram-loader.d.ts +8 -6
- package/lib/base/model/diagram-loader.d.ts.map +1 -1
- package/lib/base/model/diagram-loader.js +1 -1
- package/lib/base/model/diagram-loader.js.map +1 -1
- package/lib/base/model/glsp-model-source.d.ts +5 -2
- package/lib/base/model/glsp-model-source.d.ts.map +1 -1
- package/lib/base/model/glsp-model-source.js +28 -1
- package/lib/base/model/glsp-model-source.js.map +1 -1
- package/lib/base/selection-service.d.ts +4 -3
- package/lib/base/selection-service.d.ts.map +1 -1
- package/lib/base/selection-service.js +6 -1
- package/lib/base/selection-service.js.map +1 -1
- package/lib/base/shortcuts/available-shortcuts-extension.d.ts +1 -1
- package/lib/base/shortcuts/available-shortcuts-extension.d.ts.map +1 -1
- package/lib/base/shortcuts/available-shortcuts-extension.js +3 -4
- package/lib/base/shortcuts/available-shortcuts-extension.js.map +1 -1
- package/lib/base/view/mouse-tool.d.ts +1 -1
- package/lib/base/view/mouse-tool.d.ts.map +1 -1
- package/lib/base/view/mouse-tool.js +3 -19
- package/lib/base/view/mouse-tool.js.map +1 -1
- package/lib/features/change-bounds/move-element-handler.d.ts +2 -3
- package/lib/features/change-bounds/move-element-handler.d.ts.map +1 -1
- package/lib/features/change-bounds/move-element-handler.js +2 -3
- package/lib/features/change-bounds/move-element-handler.js.map +1 -1
- package/lib/features/change-bounds/resize/resize-handler.d.ts +2 -3
- package/lib/features/change-bounds/resize/resize-handler.d.ts.map +1 -1
- package/lib/features/change-bounds/resize/resize-handler.js +2 -3
- package/lib/features/change-bounds/resize/resize-handler.js.map +1 -1
- package/lib/features/export/default-png-diagram-exporter.d.ts +52 -0
- package/lib/features/export/default-png-diagram-exporter.d.ts.map +1 -0
- package/lib/features/export/default-png-diagram-exporter.js +157 -0
- package/lib/features/export/default-png-diagram-exporter.js.map +1 -0
- package/lib/features/export/default-svg-diagram-exporter.d.ts +32 -0
- package/lib/features/export/default-svg-diagram-exporter.d.ts.map +1 -0
- package/lib/features/export/default-svg-diagram-exporter.js +54 -0
- package/lib/features/export/default-svg-diagram-exporter.js.map +1 -0
- package/lib/features/export/diagram-export-postprocessor.d.ts +33 -0
- package/lib/features/export/diagram-export-postprocessor.d.ts.map +1 -0
- package/lib/features/export/diagram-export-postprocessor.js +84 -0
- package/lib/features/export/diagram-export-postprocessor.js.map +1 -0
- package/lib/features/export/diagram-exporter.d.ts +44 -0
- package/lib/features/export/diagram-exporter.d.ts.map +1 -0
- package/lib/features/export/diagram-exporter.js +18 -0
- package/lib/features/export/diagram-exporter.js.map +1 -0
- package/lib/features/export/export-modules.d.ts +1 -1
- package/lib/features/export/export-modules.d.ts.map +1 -1
- package/lib/features/export/export-modules.js +20 -3
- package/lib/features/export/export-modules.js.map +1 -1
- package/lib/features/export/export-result-action-handler.d.ts +28 -0
- package/lib/features/export/export-result-action-handler.d.ts.map +1 -0
- package/lib/features/export/export-result-action-handler.js +72 -0
- package/lib/features/export/export-result-action-handler.js.map +1 -0
- package/lib/features/export/export-svg-action-handler.d.ts +19 -0
- package/lib/features/export/export-svg-action-handler.d.ts.map +1 -1
- package/lib/features/export/export-svg-action-handler.js +4 -15
- package/lib/features/export/export-svg-action-handler.js.map +1 -1
- package/lib/features/export/glsp-svg-exporter.d.ts +18 -1
- package/lib/features/export/glsp-svg-exporter.d.ts.map +1 -1
- package/lib/features/export/glsp-svg-exporter.js +44 -11
- package/lib/features/export/glsp-svg-exporter.js.map +1 -1
- package/lib/features/export/request-export-command.d.ts +29 -0
- package/lib/features/export/request-export-command.d.ts.map +1 -0
- package/lib/features/export/request-export-command.js +73 -0
- package/lib/features/export/request-export-command.js.map +1 -0
- package/lib/features/export/request-export-key-listener.d.ts +21 -0
- package/lib/features/export/request-export-key-listener.d.ts.map +1 -0
- package/lib/features/export/request-export-key-listener.js +40 -0
- package/lib/features/export/request-export-key-listener.js.map +1 -0
- package/lib/features/helper-lines/helper-line-feedback.d.ts +1 -1
- package/lib/features/helper-lines/helper-line-feedback.d.ts.map +1 -1
- package/lib/features/helper-lines/helper-line-feedback.js +2 -3
- package/lib/features/helper-lines/helper-line-feedback.js.map +1 -1
- package/lib/features/label-edit-ui/label-edit-ui.d.ts +1 -1
- package/lib/features/label-edit-ui/label-edit-ui.js +1 -1
- package/lib/features/routing/edge-router.d.ts +2 -1
- package/lib/features/routing/edge-router.d.ts.map +1 -1
- package/lib/features/routing/edge-router.js +2 -1
- package/lib/features/routing/edge-router.js.map +1 -1
- package/lib/features/routing/routing-module.d.ts +1 -1
- package/lib/features/routing/routing-module.d.ts.map +1 -1
- package/lib/features/routing/routing-module.js +7 -1
- package/lib/features/routing/routing-module.js.map +1 -1
- package/lib/features/routing/sticky-manhattan-anchors.d.ts +29 -0
- package/lib/features/routing/sticky-manhattan-anchors.d.ts.map +1 -0
- package/lib/features/routing/sticky-manhattan-anchors.js +62 -0
- package/lib/features/routing/sticky-manhattan-anchors.js.map +1 -0
- package/lib/features/routing/sticky-manhattan-edge-router.d.ts +107 -0
- package/lib/features/routing/sticky-manhattan-edge-router.d.ts.map +1 -0
- package/lib/features/routing/sticky-manhattan-edge-router.js +626 -0
- package/lib/features/routing/sticky-manhattan-edge-router.js.map +1 -0
- package/lib/features/search-palette/search-palette.d.ts +2 -2
- package/lib/features/search-palette/search-palette.d.ts.map +1 -1
- package/lib/features/search-palette/search-palette.js +3 -4
- package/lib/features/search-palette/search-palette.js.map +1 -1
- package/lib/features/select/select-module.d.ts +1 -1
- package/lib/features/select/select-module.js +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +1 -2
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.d.ts +2 -3
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js +2 -3
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js.map +1 -1
- package/lib/features/viewport/origin-viewport.d.ts +2 -13
- package/lib/features/viewport/origin-viewport.d.ts.map +1 -1
- package/lib/features/viewport/origin-viewport.js +3 -19
- package/lib/features/viewport/origin-viewport.js.map +1 -1
- package/lib/index.d.ts +11 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -1
- package/lib/index.js.map +1 -1
- package/lib/views/gedge-view-with-gaps-on-intersections.d.ts +39 -0
- package/lib/views/gedge-view-with-gaps-on-intersections.d.ts.map +1 -0
- package/lib/views/gedge-view-with-gaps-on-intersections.js +85 -0
- package/lib/views/gedge-view-with-gaps-on-intersections.js.map +1 -0
- package/lib/views/rounded-corner-manhattan-edge-view.d.ts +58 -0
- package/lib/views/rounded-corner-manhattan-edge-view.d.ts.map +1 -0
- package/lib/views/rounded-corner-manhattan-edge-view.js +170 -0
- package/lib/views/rounded-corner-manhattan-edge-view.js.map +1 -0
- package/package.json +4 -6
- package/src/base/action-dispatcher.spec.ts +103 -3
- package/src/base/action-dispatcher.ts +50 -25
- package/src/base/default.module.ts +4 -0
- package/src/base/editor-context-service.ts +17 -5
- package/src/base/model/diagram-loader.ts +8 -6
- package/src/base/model/glsp-model-source.ts +35 -1
- package/src/base/selection-service.ts +11 -2
- package/src/base/shortcuts/available-shortcuts-extension.ts +3 -4
- package/src/base/view/mouse-tool.ts +4 -19
- package/src/features/change-bounds/move-element-handler.ts +3 -2
- package/src/features/change-bounds/resize/resize-handler.ts +4 -3
- package/src/features/export/default-png-diagram-exporter.ts +145 -0
- package/src/features/export/default-svg-diagram-exporter.ts +39 -0
- package/src/features/export/diagram-export-postprocessor.ts +82 -0
- package/src/features/export/diagram-exporter.ts +45 -0
- package/src/features/export/export-modules.ts +24 -4
- package/src/features/export/export-result-action-handler.ts +66 -0
- package/src/features/export/export-svg-action-handler.ts +7 -2
- package/src/features/export/glsp-svg-exporter.ts +48 -12
- package/src/features/export/request-export-command.ts +65 -0
- package/src/features/export/request-export-key-listener.ts +29 -0
- package/src/features/helper-lines/helper-line-feedback.ts +6 -4
- package/src/features/label-edit-ui/label-edit-ui.ts +1 -1
- package/src/features/routing/edge-router.ts +2 -2
- package/src/features/routing/routing-module.ts +8 -1
- package/src/features/routing/sticky-manhattan-anchors.ts +53 -0
- package/src/features/routing/sticky-manhattan-edge-router.spec.ts +212 -0
- package/src/features/routing/sticky-manhattan-edge-router.ts +713 -0
- package/src/features/search-palette/search-palette.ts +3 -4
- package/src/features/select/select-module.ts +1 -1
- package/src/features/tool-palette/tool-palette.ts +1 -1
- package/src/features/tools/change-bounds/change-bounds-tool-move-feedback.ts +13 -3
- package/src/features/viewport/origin-viewport.ts +10 -23
- package/src/index.ts +11 -1
- package/src/views/gedge-view-with-gaps-on-intersections.tsx +99 -0
- package/src/views/rounded-corner-manhattan-edge-view.ts +171 -0
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,2DAAyC;AACzC,iEAA+C;AAC/C,sDAAoC;AACpC,6EAA2D;AAC3D,4EAA0D;AAC1D,wFAAsE;AACtE,iFAA+D;AAC/D,4EAA0D;AAC1D,uDAAqC;AACrC,wDAAsC;AACtC,mEAAiD;AACjD,gEAA8C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ChF,uFAAqE;AACrE,sEAAoD;AACpD,wEAAsD;AACtD,iFAA+D;AAC/D,wFAAsE;AACtE,uFAAqE;AACrE,oFAAkE;AAClE,6FAA2E;AAC3E,sEAAoD;AACpD,8EAA4D;AAC5D,4EAA0D;AAC1D,qFAAmE;AACnE,sFAAoE;AACpE,wFAAsE;AACtE,8FAA4E;AAC5E,kFAAgE;AAChE,2FAAyE;AACzE,2EAAyD;AACzD,0EAAwD;AACxD,mFAAiE;AACjE,kFAAgE;AAChE,sFAAoE;AACpE,oFAAkE;AAClE,qFAAmE;AACnE,0EAAwD;AACxD,8EAA4D;AAC5D,wEAAsD;AACtD,qEAAmD;AACnD,yEAAuD;AACvD,iEAA+C;AAC/C,2EAAyD;AACzD,iFAA+D;AAC/D,sEAAoD;AACpD,iEAA+C;AAC/C,uEAAqD;AACrD,4EAA0D;AAC1D,uEAAqD;AACrD,oEAAkD;AAClD,2EAAyD;AACzD,2EAAyD;AACzD,kEAAgD;AAChD,0CAAwB;AACxB,+CAA6B;AAC7B,uDAAqC;AACrC,yDAAuC;AACvC,wDAAsC;AACtC,sDAAoC;AACpC,qDAAmC;AACnC,uDAAqC;AACrC,iDAA+B;AAC/B,yDAAuC;AACvC,2DAAyC;AACzC,uDAAqC;AACrC,qDAAmC;AACnC,sDAAoC;AACpC,+DAA6C;AAC7C,4DAA0C;AAC1C,yDAAuC;AACvC,8DAA4C;AAC5C,oEAAkD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,2DAAyC;AACzC,iEAA+C;AAC/C,sDAAoC;AACpC,6EAA2D;AAC3D,4EAA0D;AAC1D,wFAAsE;AACtE,iFAA+D;AAC/D,4EAA0D;AAC1D,uDAAqC;AACrC,wDAAsC;AACtC,mEAAiD;AACjD,gEAA8C;AAC9C,+DAA6C;AAC7C,6EAA2D;AAC3D,mEAAiD;AACjD,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AAqE;AACrE,oFAAkE;AAClE,6FAA2E;AAC3E,2FAAyE;AACzE,kGAAgF;AAChF,uFAAqE;AACrE,sEAAoD;AACpD,wEAAsD;AACtD,iFAA+D;AAC/D,wFAAsE;AACtE,uFAAqE;AACrE,oFAAkE;AAClE,6FAA2E;AAC3E,sEAAoD;AACpD,8EAA4D;AAC5D,4EAA0D;AAC1D,qFAAmE;AACnE,sFAAoE;AACpE,wFAAsE;AACtE,8FAA4E;AAC5E,kFAAgE;AAChE,2FAAyE;AACzE,2EAAyD;AACzD,0EAAwD;AACxD,mFAAiE;AACjE,kFAAgE;AAChE,sFAAoE;AACpE,oFAAkE;AAClE,qFAAmE;AACnE,0EAAwD;AACxD,8EAA4D;AAC5D,wEAAsD;AACtD,qEAAmD;AACnD,yEAAuD;AACvD,iEAA+C;AAC/C,2EAAyD;AACzD,iFAA+D;AAC/D,sEAAoD;AACpD,iEAA+C;AAC/C,uEAAqD;AACrD,4EAA0D;AAC1D,uEAAqD;AACrD,oEAAkD;AAClD,2EAAyD;AACzD,2EAAyD;AACzD,kEAAgD;AAChD,0CAAwB;AACxB,+CAA6B;AAC7B,uDAAqC;AACrC,yDAAuC;AACvC,wDAAsC;AACtC,sDAAoC;AACpC,qDAAmC;AACnC,uDAAqC;AACrC,iDAA+B;AAC/B,yDAAuC;AACvC,2DAAyC;AACzC,uDAAqC;AACrC,qDAAmC;AACnC,gFAA8D;AAC9D,sDAAoC;AACpC,+DAA6C;AAC7C,4DAA0C;AAC1C,yDAAuC;AACvC,6EAA2D;AAC3D,8DAA4C;AAC5C,oEAAkD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
/** @jsx svg */
|
|
17
|
+
import { IViewArgs, Point, PolylineEdgeViewWithGapsOnIntersections, RenderingContext } from '@eclipse-glsp/sprotty';
|
|
18
|
+
import { Classes, VNode } from 'snabbdom';
|
|
19
|
+
import { GEdge } from '../model';
|
|
20
|
+
/**
|
|
21
|
+
* Gap-rendering counterpart to {@link GEdgeView}: extends
|
|
22
|
+
* {@link PolylineEdgeViewWithGapsOnIntersections} and re-adds the GLSP-only
|
|
23
|
+
* bits from `GEdgeView` — router dispatch, dangling-edge rendering,
|
|
24
|
+
* `additionalClasses` hook, and the edge-padding mouse-handle overlay.
|
|
25
|
+
*
|
|
26
|
+
* Subclasses override {@link createPathForSegments} to inject per-point path
|
|
27
|
+
* fragments. Intersections are spliced into the rendered line
|
|
28
|
+
* (`addIntersectionPoints = true`) and skipped for the mouse-handle overlay
|
|
29
|
+
* so the hit area stays contiguous.
|
|
30
|
+
*/
|
|
31
|
+
export declare class GEdgeViewWithGapsOnIntersections extends PolylineEdgeViewWithGapsOnIntersections {
|
|
32
|
+
render(edge: Readonly<GEdge>, context: RenderingContext, args?: IViewArgs): VNode;
|
|
33
|
+
protected additionalClasses(_edge: Readonly<GEdge>, _context: RenderingContext): Classes;
|
|
34
|
+
protected renderLine(edge: GEdge, segments: Point[], _context: RenderingContext, args?: IViewArgs): VNode;
|
|
35
|
+
protected renderAdditionals(edge: GEdge, segments: Point[], _context: RenderingContext): VNode[];
|
|
36
|
+
protected renderMouseHandle(edge: GEdge, segments: Point[], padding: number): VNode;
|
|
37
|
+
protected createPathForSegments(segments: Point[], edge: GEdge, addIntersectionPoints: boolean, args?: IViewArgs): string;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=gedge-view-with-gaps-on-intersections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gedge-view-with-gaps-on-intersections.d.ts","sourceRoot":"","sources":["../../src/views/gedge-view-with-gaps-on-intersections.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,eAAe;AACf,OAAO,EACH,SAAS,EACT,KAAK,EACL,uCAAuC,EACvC,gBAAgB,EAGnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGjC;;;;;;;;;;GAUG;AACH,qBACa,gCAAiC,SAAQ,uCAAuC;IAChF,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK;IAgB1F,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO;cAIrE,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK;cAI/F,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,gBAAgB,GAAG,KAAK,EAAE;IAKzG,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK;IAanF,SAAS,CAAC,qBAAqB,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,qBAAqB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM;CAc5H"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.GEdgeViewWithGapsOnIntersections = void 0;
|
|
10
|
+
/********************************************************************************
|
|
11
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
12
|
+
*
|
|
13
|
+
* This program and the accompanying materials are made available under the
|
|
14
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
15
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
16
|
+
*
|
|
17
|
+
* This Source Code may also be made available under the following Secondary
|
|
18
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
19
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
20
|
+
* with the GNU Classpath Exception which is available at
|
|
21
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
22
|
+
*
|
|
23
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
24
|
+
********************************************************************************/
|
|
25
|
+
/** @jsx svg */
|
|
26
|
+
const sprotty_1 = require("@eclipse-glsp/sprotty");
|
|
27
|
+
const inversify_1 = require("inversify");
|
|
28
|
+
const argument_utils_1 = require("../utils/argument-utils");
|
|
29
|
+
/**
|
|
30
|
+
* Gap-rendering counterpart to {@link GEdgeView}: extends
|
|
31
|
+
* {@link PolylineEdgeViewWithGapsOnIntersections} and re-adds the GLSP-only
|
|
32
|
+
* bits from `GEdgeView` — router dispatch, dangling-edge rendering,
|
|
33
|
+
* `additionalClasses` hook, and the edge-padding mouse-handle overlay.
|
|
34
|
+
*
|
|
35
|
+
* Subclasses override {@link createPathForSegments} to inject per-point path
|
|
36
|
+
* fragments. Intersections are spliced into the rendered line
|
|
37
|
+
* (`addIntersectionPoints = true`) and skipped for the mouse-handle overlay
|
|
38
|
+
* so the hit area stays contiguous.
|
|
39
|
+
*/
|
|
40
|
+
let GEdgeViewWithGapsOnIntersections = class GEdgeViewWithGapsOnIntersections extends sprotty_1.PolylineEdgeViewWithGapsOnIntersections {
|
|
41
|
+
render(edge, context, args) {
|
|
42
|
+
// route(edge, args) picks up the postprocessed routing populated by
|
|
43
|
+
// SGraphView — that's where IntersectionFinder tags points.
|
|
44
|
+
const route = this.edgeRouterRegistry.route(edge, args);
|
|
45
|
+
if (route.length === 0) {
|
|
46
|
+
return this.renderDanglingEdge('Cannot compute route', edge, context);
|
|
47
|
+
}
|
|
48
|
+
return ((0, sprotty_1.svg)("g", { "class-sprotty-edge": true, "class-mouseover": edge.hoverFeedback, ...this.additionalClasses(edge, context) },
|
|
49
|
+
this.renderLine(edge, route, context, args),
|
|
50
|
+
this.renderAdditionals(edge, route, context),
|
|
51
|
+
context.renderChildren(edge, { route })));
|
|
52
|
+
}
|
|
53
|
+
additionalClasses(_edge, _context) {
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
56
|
+
renderLine(edge, segments, _context, args) {
|
|
57
|
+
return (0, sprotty_1.svg)("path", { d: this.createPathForSegments(segments, edge, true, args) });
|
|
58
|
+
}
|
|
59
|
+
renderAdditionals(edge, segments, _context) {
|
|
60
|
+
const edgePadding = argument_utils_1.EdgePadding.from(edge);
|
|
61
|
+
return edgePadding ? [this.renderMouseHandle(edge, segments, edgePadding)] : [];
|
|
62
|
+
}
|
|
63
|
+
renderMouseHandle(edge, segments, padding) {
|
|
64
|
+
return ((0, sprotty_1.svg)("path", { "class-mouse-handle": true, d: this.createPathForSegments(segments, edge, false), "style-stroke-width": padding * 2, "style-stroke": 'transparent', "style-stroke-dasharray": 'none', "style-stroke-dashoffset": '0' }));
|
|
65
|
+
}
|
|
66
|
+
createPathForSegments(segments, edge, addIntersectionPoints, args) {
|
|
67
|
+
if (segments.length === 0) {
|
|
68
|
+
return '';
|
|
69
|
+
}
|
|
70
|
+
let path = `M ${segments[0].x},${segments[0].y}`;
|
|
71
|
+
for (let i = 1; i < segments.length; i++) {
|
|
72
|
+
const p = segments[i];
|
|
73
|
+
if (addIntersectionPoints && (0, sprotty_1.isIntersectingRoutedPoint)(p)) {
|
|
74
|
+
path += this.intersectionPath(edge, segments, p, args);
|
|
75
|
+
}
|
|
76
|
+
path += ` L ${p.x},${p.y}`;
|
|
77
|
+
}
|
|
78
|
+
return path;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
exports.GEdgeViewWithGapsOnIntersections = GEdgeViewWithGapsOnIntersections;
|
|
82
|
+
exports.GEdgeViewWithGapsOnIntersections = GEdgeViewWithGapsOnIntersections = __decorate([
|
|
83
|
+
(0, inversify_1.injectable)()
|
|
84
|
+
], GEdgeViewWithGapsOnIntersections);
|
|
85
|
+
//# sourceMappingURL=gedge-view-with-gaps-on-intersections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gedge-view-with-gaps-on-intersections.js","sourceRoot":"","sources":["../../src/views/gedge-view-with-gaps-on-intersections.tsx"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,eAAe;AACf,mDAO+B;AAC/B,yCAAuC;AAGvC,4DAAsD;AAEtD;;;;;;;;;;GAUG;AAEI,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,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pF,CAAC;IAES,iBAAiB,CAAC,IAAW,EAAE,QAAiB,EAAE,OAAe;QACvE,OAAO,CACH,yDAEI,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,wBAChC,OAAO,GAAG,CAAC,kBAClB,aAAa,4BACH,MAAM,6BACL,GAAG,GAC7B,CACL,CAAC;IACN,CAAC;IAES,qBAAqB,CAAC,QAAiB,EAAE,IAAW,EAAE,qBAA8B,EAAE,IAAgB;QAC5G,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC;QACd,CAAC;QACD,IAAI,IAAI,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YACtB,IAAI,qBAAqB,IAAI,IAAA,mCAAyB,EAAC,CAAC,CAAC,EAAE,CAAC;gBACxD,IAAI,IAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;YAC3D,CAAC;YACD,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/B,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AAzDY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,sBAAU,GAAE;GACA,gCAAgC,CAyD5C"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022-2026 Imixs Software Solutions GmbH.
|
|
3
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
import { IntersectingRoutedPoint, IViewArgs, Point } from '@eclipse-glsp/sprotty';
|
|
18
|
+
import { GEdge } from '../model';
|
|
19
|
+
import { GEdgeViewWithGapsOnIntersections } from './gedge-view-with-gaps-on-intersections';
|
|
20
|
+
/**
|
|
21
|
+
* Manhattan edge view with rounded bends rendered as quadratic Béziers.
|
|
22
|
+
* Non-orthogonal inputs render as sharp corners. Radius is clamped per corner;
|
|
23
|
+
* override {@link cornerRadius} or {@link computeMaxRadius} to tune.
|
|
24
|
+
*
|
|
25
|
+
* Inherits gap / line-jump rendering from {@link GEdgeViewWithGapsOnIntersections}.
|
|
26
|
+
* The rendered line splices intersection fragments between points; the mouse-
|
|
27
|
+
* handle overlay skips them so the hit area stays contiguous.
|
|
28
|
+
*
|
|
29
|
+
* Based on Ralph Soika's `BPMNEdgeView`; see
|
|
30
|
+
* https://github.com/eclipse-glsp/glsp/discussions/1642.
|
|
31
|
+
*/
|
|
32
|
+
export declare class RoundedCornerManhattanEdgeView extends GEdgeViewWithGapsOnIntersections {
|
|
33
|
+
/** Target corner radius in pixels. The effective radius is clamped per corner. */
|
|
34
|
+
protected readonly cornerRadius: number;
|
|
35
|
+
/** Lower bound for the effective radius, even on very short adjacent segments. */
|
|
36
|
+
protected readonly minCornerRadius: number;
|
|
37
|
+
/** Upper fraction of the shorter adjacent segment to use for the radius. */
|
|
38
|
+
protected readonly maxRadiusFactor: number;
|
|
39
|
+
/** Segment length (px) below which {@link shortSegmentRadiusFactor} tightens the radius further. */
|
|
40
|
+
protected readonly shortSegmentThreshold: number;
|
|
41
|
+
/** Fraction of the shorter adjacent segment to use as the radius below {@link shortSegmentThreshold}. */
|
|
42
|
+
protected readonly shortSegmentRadiusFactor: number;
|
|
43
|
+
protected createPathForSegments(segments: Point[], edge: GEdge, addIntersectionPoints: boolean, args?: IViewArgs): string;
|
|
44
|
+
/**
|
|
45
|
+
* Drops intersections inside either endpoint's rounded-corner zone (padded
|
|
46
|
+
* by the gap's skip-offset). The gap fragment can't be placed there without
|
|
47
|
+
* drawing backward into the curve on one side, and the crossing is hidden
|
|
48
|
+
* behind the curve anyway.
|
|
49
|
+
*/
|
|
50
|
+
protected filterCornerZoneIntersections(intersectingPoint: IntersectingRoutedPoint, segments: Point[], pointIndex: number): IntersectingRoutedPoint;
|
|
51
|
+
/** Curve radius at `segments[cornerIndex]`, or 0 for source / target. */
|
|
52
|
+
protected getCornerRadius(segments: Point[], cornerIndex: number): number;
|
|
53
|
+
/** SVG fragment for one rounded corner; falls back to `L` if not a right angle. */
|
|
54
|
+
protected renderRoundedCorner(corner: Point, prev: Point, next: Point, radius: number): string;
|
|
55
|
+
/** Clamps {@link cornerRadius} to a fraction of the shorter adjacent segment. */
|
|
56
|
+
protected computeMaxRadius(corner: Point, prev: Point, next: Point): number;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=rounded-corner-manhattan-edge-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rounded-corner-manhattan-edge-view.d.ts","sourceRoot":"","sources":["../../src/views/rounded-corner-manhattan-edge-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;kFAekF;AAClF,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAA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-0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.RoundedCornerManhattanEdgeView = void 0;
|
|
10
|
+
/********************************************************************************
|
|
11
|
+
* Copyright (c) 2022-2026 Imixs Software Solutions GmbH.
|
|
12
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
13
|
+
*
|
|
14
|
+
* This program and the accompanying materials are made available under the
|
|
15
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
16
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
17
|
+
*
|
|
18
|
+
* This Source Code may also be made available under the following Secondary
|
|
19
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
20
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
21
|
+
* with the GNU Classpath Exception which is available at
|
|
22
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
23
|
+
*
|
|
24
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
25
|
+
********************************************************************************/
|
|
26
|
+
const sprotty_1 = require("@eclipse-glsp/sprotty");
|
|
27
|
+
const inversify_1 = require("inversify");
|
|
28
|
+
const gedge_view_with_gaps_on_intersections_1 = require("./gedge-view-with-gaps-on-intersections");
|
|
29
|
+
/**
|
|
30
|
+
* Manhattan edge view with rounded bends rendered as quadratic Béziers.
|
|
31
|
+
* Non-orthogonal inputs render as sharp corners. Radius is clamped per corner;
|
|
32
|
+
* override {@link cornerRadius} or {@link computeMaxRadius} to tune.
|
|
33
|
+
*
|
|
34
|
+
* Inherits gap / line-jump rendering from {@link GEdgeViewWithGapsOnIntersections}.
|
|
35
|
+
* The rendered line splices intersection fragments between points; the mouse-
|
|
36
|
+
* handle overlay skips them so the hit area stays contiguous.
|
|
37
|
+
*
|
|
38
|
+
* Based on Ralph Soika's `BPMNEdgeView`; see
|
|
39
|
+
* https://github.com/eclipse-glsp/glsp/discussions/1642.
|
|
40
|
+
*/
|
|
41
|
+
let RoundedCornerManhattanEdgeView = class RoundedCornerManhattanEdgeView extends gedge_view_with_gaps_on_intersections_1.GEdgeViewWithGapsOnIntersections {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments);
|
|
44
|
+
/** Target corner radius in pixels. The effective radius is clamped per corner. */
|
|
45
|
+
this.cornerRadius = 10;
|
|
46
|
+
/** Lower bound for the effective radius, even on very short adjacent segments. */
|
|
47
|
+
this.minCornerRadius = 2;
|
|
48
|
+
/** Upper fraction of the shorter adjacent segment to use for the radius. */
|
|
49
|
+
this.maxRadiusFactor = 0.45;
|
|
50
|
+
/** Segment length (px) below which {@link shortSegmentRadiusFactor} tightens the radius further. */
|
|
51
|
+
this.shortSegmentThreshold = 5;
|
|
52
|
+
/** Fraction of the shorter adjacent segment to use as the radius below {@link shortSegmentThreshold}. */
|
|
53
|
+
this.shortSegmentRadiusFactor = 0.3;
|
|
54
|
+
}
|
|
55
|
+
createPathForSegments(segments, edge, addIntersectionPoints, args) {
|
|
56
|
+
if (segments.length === 0) {
|
|
57
|
+
return '';
|
|
58
|
+
}
|
|
59
|
+
let path = `M ${segments[0].x},${segments[0].y}`;
|
|
60
|
+
for (let i = 1; i < segments.length; i++) {
|
|
61
|
+
const p = segments[i];
|
|
62
|
+
if (addIntersectionPoints && (0, sprotty_1.isIntersectingRoutedPoint)(p)) {
|
|
63
|
+
const effective = this.filterCornerZoneIntersections(p, segments, i);
|
|
64
|
+
if (effective.intersections.length > 0) {
|
|
65
|
+
path += this.intersectionPath(edge, segments, effective, args);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (i < segments.length - 1) {
|
|
69
|
+
const prev = segments[i - 1];
|
|
70
|
+
const next = segments[i + 1];
|
|
71
|
+
const radius = this.computeMaxRadius(p, prev, next);
|
|
72
|
+
path += this.renderRoundedCorner(p, prev, next, radius);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
path += ` L ${p.x},${p.y}`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return path;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Drops intersections inside either endpoint's rounded-corner zone (padded
|
|
82
|
+
* by the gap's skip-offset). The gap fragment can't be placed there without
|
|
83
|
+
* drawing backward into the curve on one side, and the crossing is hidden
|
|
84
|
+
* behind the curve anyway.
|
|
85
|
+
*/
|
|
86
|
+
filterCornerZoneIntersections(intersectingPoint, segments, pointIndex) {
|
|
87
|
+
const p1 = segments[pointIndex - 1];
|
|
88
|
+
const p2 = segments[pointIndex];
|
|
89
|
+
const p1Threshold = this.getCornerRadius(segments, pointIndex - 1) + this.skipOffsetBefore;
|
|
90
|
+
const p2Threshold = this.getCornerRadius(segments, pointIndex) + this.skipOffsetAfter;
|
|
91
|
+
const filtered = intersectingPoint.intersections.filter(intersection => sprotty_1.Point.maxDistance(intersection.intersectionPoint, p1) > p1Threshold &&
|
|
92
|
+
sprotty_1.Point.maxDistance(intersection.intersectionPoint, p2) > p2Threshold);
|
|
93
|
+
return { ...intersectingPoint, intersections: filtered };
|
|
94
|
+
}
|
|
95
|
+
/** Curve radius at `segments[cornerIndex]`, or 0 for source / target. */
|
|
96
|
+
getCornerRadius(segments, cornerIndex) {
|
|
97
|
+
if (cornerIndex <= 0 || cornerIndex >= segments.length - 1) {
|
|
98
|
+
return 0;
|
|
99
|
+
}
|
|
100
|
+
const corner = segments[cornerIndex];
|
|
101
|
+
const prev = segments[cornerIndex - 1];
|
|
102
|
+
const next = segments[cornerIndex + 1];
|
|
103
|
+
return this.computeMaxRadius(corner, prev, next);
|
|
104
|
+
}
|
|
105
|
+
/** SVG fragment for one rounded corner; falls back to `L` if not a right angle. */
|
|
106
|
+
renderRoundedCorner(corner, prev, next, radius) {
|
|
107
|
+
// Round only right-angle bends; diagonal / collinear inputs render sharp.
|
|
108
|
+
const horizIn = sprotty_1.Point.isHorizontalAligned(prev, corner);
|
|
109
|
+
const vertIn = sprotty_1.Point.isVerticalAligned(prev, corner);
|
|
110
|
+
const horizOut = sprotty_1.Point.isHorizontalAligned(corner, next);
|
|
111
|
+
const vertOut = sprotty_1.Point.isVerticalAligned(corner, next);
|
|
112
|
+
const isRightAngle = (horizIn && vertOut && !vertIn) || (vertIn && horizOut && !horizIn);
|
|
113
|
+
if (!isRightAngle) {
|
|
114
|
+
return ` L ${corner.x},${corner.y}`;
|
|
115
|
+
}
|
|
116
|
+
if (prev.x < corner.x && corner.y < next.y) {
|
|
117
|
+
// right → down
|
|
118
|
+
return ` L ${corner.x - radius},${corner.y} Q ${corner.x},${corner.y} ${corner.x},${corner.y + radius}`;
|
|
119
|
+
}
|
|
120
|
+
if (prev.y < corner.y && corner.x < next.x) {
|
|
121
|
+
// down → right
|
|
122
|
+
return ` L ${corner.x},${corner.y - radius} Q ${corner.x},${corner.y} ${corner.x + radius},${corner.y}`;
|
|
123
|
+
}
|
|
124
|
+
if (prev.x < corner.x && corner.y > next.y) {
|
|
125
|
+
// right → up
|
|
126
|
+
return ` L ${corner.x - radius},${corner.y} Q ${corner.x},${corner.y} ${corner.x},${corner.y - radius}`;
|
|
127
|
+
}
|
|
128
|
+
if (prev.y > corner.y && corner.x < next.x) {
|
|
129
|
+
// up → right
|
|
130
|
+
return ` L ${corner.x},${corner.y + radius} Q ${corner.x},${corner.y} ${corner.x + radius},${corner.y}`;
|
|
131
|
+
}
|
|
132
|
+
if (prev.y < corner.y && corner.x > next.x) {
|
|
133
|
+
// down → left
|
|
134
|
+
return ` L ${corner.x},${corner.y - radius} Q ${corner.x},${corner.y} ${corner.x - radius},${corner.y}`;
|
|
135
|
+
}
|
|
136
|
+
if (prev.x > corner.x && corner.y < next.y) {
|
|
137
|
+
// left → down
|
|
138
|
+
return ` L ${corner.x + radius},${corner.y} Q ${corner.x},${corner.y} ${corner.x},${corner.y + radius}`;
|
|
139
|
+
}
|
|
140
|
+
if (prev.y > corner.y && corner.x > next.x) {
|
|
141
|
+
// up → left
|
|
142
|
+
return ` L ${corner.x},${corner.y + radius} Q ${corner.x},${corner.y} ${corner.x - radius},${corner.y}`;
|
|
143
|
+
}
|
|
144
|
+
if (prev.x > corner.x && corner.y > next.y) {
|
|
145
|
+
// left → up
|
|
146
|
+
return ` L ${corner.x + radius},${corner.y} Q ${corner.x},${corner.y} ${corner.x},${corner.y - radius}`;
|
|
147
|
+
}
|
|
148
|
+
return ` L ${corner.x},${corner.y}`;
|
|
149
|
+
}
|
|
150
|
+
/** Clamps {@link cornerRadius} to a fraction of the shorter adjacent segment. */
|
|
151
|
+
computeMaxRadius(corner, prev, next) {
|
|
152
|
+
const segBefore = sprotty_1.Point.maxDistance(corner, prev);
|
|
153
|
+
const segAfter = sprotty_1.Point.maxDistance(next, corner);
|
|
154
|
+
if (segBefore === 0 || segAfter === 0) {
|
|
155
|
+
return this.minCornerRadius;
|
|
156
|
+
}
|
|
157
|
+
const shortest = Math.min(segBefore, segAfter);
|
|
158
|
+
let radius = Math.min(this.cornerRadius, shortest * this.maxRadiusFactor);
|
|
159
|
+
if (shortest < this.shortSegmentThreshold) {
|
|
160
|
+
radius = Math.min(radius, shortest * this.shortSegmentRadiusFactor);
|
|
161
|
+
}
|
|
162
|
+
radius = Math.min(radius, shortest / 2);
|
|
163
|
+
return Math.max(this.minCornerRadius, radius);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
exports.RoundedCornerManhattanEdgeView = RoundedCornerManhattanEdgeView;
|
|
167
|
+
exports.RoundedCornerManhattanEdgeView = RoundedCornerManhattanEdgeView = __decorate([
|
|
168
|
+
(0, inversify_1.injectable)()
|
|
169
|
+
], RoundedCornerManhattanEdgeView);
|
|
170
|
+
//# sourceMappingURL=rounded-corner-manhattan-edge-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rounded-corner-manhattan-edge-view.js","sourceRoot":"","sources":["../../src/views/rounded-corner-manhattan-edge-view.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;kFAekF;AAClF,mDAA6G;AAC7G,yCAAuC;AAEvC,mGAA2F;AAE3F;;;;;;;;;;;GAWG;AAEI,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,wEAAgC;IAA7E;;QACH,kFAAkF;QAC/D,iBAAY,GAAW,EAAE,CAAC;QAE7C,kFAAkF;QAC/D,oBAAe,GAAW,CAAC,CAAC;QAE/C,4EAA4E;QACzD,oBAAe,GAAW,IAAI,CAAC;QAElD,oGAAoG;QACjF,0BAAqB,GAAW,CAAC,CAAC;QAErD,yGAAyG;QACtF,6BAAwB,GAAW,GAAG,CAAC;IA0H9D,CAAC;IAxHsB,qBAAqB,CAAC,QAAiB,EAAE,IAAW,EAAE,qBAA8B,EAAE,IAAgB;QACrH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC;QACd,CAAC;QACD,IAAI,IAAI,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YACtB,IAAI,qBAAqB,IAAI,IAAA,mCAAyB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AC,wBAAwB,CAAC,CAAC;QACxE,CAAC;QACD,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CACJ,CAAA;AAxIY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,sBAAU,GAAE;GACA,8BAA8B,CAwI1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/client",
|
|
3
|
-
"version": "2.7.0
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "A sprotty-based client for GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -46,16 +46,14 @@
|
|
|
46
46
|
"watch": "tsc -w"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@eclipse-glsp/sprotty": "2.7.0
|
|
49
|
+
"@eclipse-glsp/sprotty": "2.7.0",
|
|
50
50
|
"autocompleter": "^9.1.2",
|
|
51
51
|
"file-saver": "^2.0.5",
|
|
52
|
-
"lodash": "4.17.23",
|
|
53
52
|
"snabbdom": "~3.5.1",
|
|
54
53
|
"vscode-jsonrpc": "8.2.0"
|
|
55
54
|
},
|
|
56
55
|
"devDependencies": {
|
|
57
|
-
"@types/file-saver": "^2.0.5"
|
|
58
|
-
"@types/lodash": "4.14.191"
|
|
56
|
+
"@types/file-saver": "^2.0.5"
|
|
59
57
|
},
|
|
60
58
|
"peerDependencies": {
|
|
61
59
|
"inversify": "^6.1.3"
|
|
@@ -63,5 +61,5 @@
|
|
|
63
61
|
"publishConfig": {
|
|
64
62
|
"access": "public"
|
|
65
63
|
},
|
|
66
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "edfadd9757cd4a7dcfbfaa7e7b8ffaa0fb8eefff"
|
|
67
65
|
}
|
|
@@ -13,10 +13,13 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { ActionHandlerRegistry, IActionHandler, RequestAction, ResponseAction, TYPES } from '@eclipse-glsp/sprotty';
|
|
16
|
+
import { ActionHandlerRegistry, Deferred, IActionHandler, RequestAction, ResponseAction, TYPES } from '@eclipse-glsp/sprotty';
|
|
17
17
|
import { expect } from 'chai';
|
|
18
18
|
import { Container } from 'inversify';
|
|
19
19
|
|
|
20
|
+
/** Yields to the event loop long enough for pending microtasks (and already-queued timers) to run. */
|
|
21
|
+
const flushMicrotasks = (): Promise<void> => new Promise(resolve => setTimeout(resolve, 0));
|
|
22
|
+
|
|
20
23
|
import { GLSPActionDispatcher } from './action-dispatcher';
|
|
21
24
|
import { defaultModule } from './default.module';
|
|
22
25
|
import { IDiagramOptions } from './model/diagram-loader';
|
|
@@ -73,6 +76,21 @@ describe('GLSPActionDispatcher', () => {
|
|
|
73
76
|
);
|
|
74
77
|
expect(gotRejected, 'Response promise should be rejected').to.be.true;
|
|
75
78
|
});
|
|
79
|
+
it('should not leak timeout entries once the request settles', async () => {
|
|
80
|
+
const timeouts = actionDispatcher['timeouts'] as Map<string, unknown>;
|
|
81
|
+
|
|
82
|
+
// resolved-within-timeout path
|
|
83
|
+
testHandlerDelay = 5;
|
|
84
|
+
await actionDispatcher.requestUntil({ kind: 'request', requestId: '' }, 150);
|
|
85
|
+
// timed-out path
|
|
86
|
+
testHandlerDelay = 50;
|
|
87
|
+
await actionDispatcher.requestUntil({ kind: 'request', requestId: '' }, 5);
|
|
88
|
+
// missing-handler path: rejects the request, must still clear the timeout
|
|
89
|
+
await actionDispatcher.requestUntil({ kind: 'noHandlerRequest', requestId: '' }, 50).catch(() => undefined);
|
|
90
|
+
await flushMicrotasks();
|
|
91
|
+
|
|
92
|
+
expect(timeouts.size, 'all timeout entries should be cleared after the requests settle').to.equal(0);
|
|
93
|
+
});
|
|
76
94
|
});
|
|
77
95
|
describe('request & re-dispatch', () => {
|
|
78
96
|
it('should be possible to re-dispatch the response of a `request` call', async () => {
|
|
@@ -101,7 +119,9 @@ describe('GLSPActionDispatcher', () => {
|
|
|
101
119
|
expect(handlerExecuted).to.be.true;
|
|
102
120
|
});
|
|
103
121
|
|
|
104
|
-
it('should
|
|
122
|
+
it('should invoke all handlers in one synchronous burst (parallel-start), without serializing on async ones', async () => {
|
|
123
|
+
// asyncHandler1 (registered first) has the longer delay. Serial execution would yield [1, 2];
|
|
124
|
+
// parallel-start lets the shorter handler finish first, yielding [2, 1].
|
|
105
125
|
const executionOrder: number[] = [];
|
|
106
126
|
const asyncHandler1: IActionHandler = {
|
|
107
127
|
handle: async () => {
|
|
@@ -120,7 +140,87 @@ describe('GLSPActionDispatcher', () => {
|
|
|
120
140
|
registry.register('multiAsyncTest', asyncHandler2);
|
|
121
141
|
await actionDispatcher.dispatch({ kind: 'multiAsyncTest' });
|
|
122
142
|
|
|
123
|
-
expect(executionOrder).to.deep.equal([
|
|
143
|
+
expect(executionOrder).to.deep.equal([2, 1]);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('should not let a slow async handler starve a synchronous sibling registered after it', async () => {
|
|
147
|
+
// Sync handler registered after the gated async one must run during the burst, before the
|
|
148
|
+
// async handler is released.
|
|
149
|
+
const executionOrder: number[] = [];
|
|
150
|
+
const gate = new Deferred<void>();
|
|
151
|
+
const slowAsyncHandler: IActionHandler = {
|
|
152
|
+
handle: async () => {
|
|
153
|
+
await gate.promise;
|
|
154
|
+
executionOrder.push(1);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
const syncHandler: IActionHandler = {
|
|
158
|
+
handle: () => {
|
|
159
|
+
executionOrder.push(2);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
registry.register('starveTest', slowAsyncHandler);
|
|
164
|
+
registry.register('starveTest', syncHandler);
|
|
165
|
+
const dispatched = actionDispatcher.dispatch({ kind: 'starveTest' });
|
|
166
|
+
|
|
167
|
+
// Let the invocation burst run; the async handler is still gated.
|
|
168
|
+
await flushMicrotasks();
|
|
169
|
+
expect(executionOrder, 'sync sibling must run before the gated async handler resolves').to.deep.equal([2]);
|
|
170
|
+
|
|
171
|
+
gate.resolve();
|
|
172
|
+
await dispatched;
|
|
173
|
+
expect(executionOrder).to.deep.equal([2, 1]);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it('should not let a never-resolving async handler starve a synchronous sibling', async () => {
|
|
177
|
+
// A handler whose promise never resolves must not prevent other handlers from being invoked.
|
|
178
|
+
const executionOrder: number[] = [];
|
|
179
|
+
const stuckHandler: IActionHandler = {
|
|
180
|
+
handle: () => new Promise<void>(() => undefined) // never resolves
|
|
181
|
+
};
|
|
182
|
+
const syncHandler: IActionHandler = {
|
|
183
|
+
handle: () => {
|
|
184
|
+
executionOrder.push(1);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
registry.register('stuckTest', stuckHandler);
|
|
189
|
+
registry.register('stuckTest', syncHandler);
|
|
190
|
+
// Intentionally not awaited: the dispatch promise never resolves because of the stuck handler.
|
|
191
|
+
actionDispatcher.dispatch({ kind: 'stuckTest' });
|
|
192
|
+
|
|
193
|
+
await flushMicrotasks();
|
|
194
|
+
expect(executionOrder).to.deep.equal([1]);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it('should not deadlock when an async handler awaits a nested dispatch while a sibling is registered after it', async () => {
|
|
198
|
+
// A serial loop would block the sibling behind the async handler that awaits a nested dispatch,
|
|
199
|
+
// risking deadlock. Parallel-start invokes the sibling in the burst, so nothing waits its turn.
|
|
200
|
+
// Order: 'B' (burst) -> 'sub' (nested) -> 'A' (async tail).
|
|
201
|
+
const executionOrder: string[] = [];
|
|
202
|
+
registry.register('nestedSub', {
|
|
203
|
+
handle: () => {
|
|
204
|
+
executionOrder.push('sub');
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
const nestedDispatchHandler: IActionHandler = {
|
|
208
|
+
handle: async () => {
|
|
209
|
+
await actionDispatcher.dispatch({ kind: 'nestedSub' });
|
|
210
|
+
executionOrder.push('A');
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
const siblingHandler: IActionHandler = {
|
|
214
|
+
handle: () => {
|
|
215
|
+
executionOrder.push('B');
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
registry.register('nestedTest', nestedDispatchHandler);
|
|
220
|
+
registry.register('nestedTest', siblingHandler);
|
|
221
|
+
await actionDispatcher.dispatch({ kind: 'nestedTest' });
|
|
222
|
+
|
|
223
|
+
expect(executionOrder).to.deep.equal(['B', 'sub', 'A']);
|
|
124
224
|
});
|
|
125
225
|
|
|
126
226
|
it('should handle mixed sync and async handlers correctly', async () => {
|