@eclipse-glsp-examples/workflow-glsp 0.10.0-next.06ee84f.156 → 0.10.0-next.146a812.165
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/css/diagram.css +30 -147
- package/lib/di.config.js +18 -18
- package/lib/di.config.js.map +1 -1
- package/lib/direct-task-editing/direct-task-editor.d.ts +1 -1
- package/lib/direct-task-editing/direct-task-editor.d.ts.map +1 -1
- package/lib/direct-task-editing/direct-task-editor.js +14 -14
- package/lib/direct-task-editing/direct-task-editor.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/model.d.ts +2 -2
- package/lib/model.d.ts.map +1 -1
- package/lib/model.js +10 -12
- package/lib/model.js.map +1 -1
- package/lib/workflow-views.d.ts +5 -5
- package/lib/workflow-views.d.ts.map +1 -1
- package/lib/workflow-views.js +34 -11
- package/lib/workflow-views.js.map +1 -1
- package/package.json +5 -7
- package/src/direct-task-editing/direct-task-editor.ts +9 -10
- package/src/model.ts +15 -14
- package/src/workflow-views.tsx +40 -14
package/css/diagram.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -20,10 +20,6 @@
|
|
|
20
20
|
height: 100%;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.sprotty-popup {
|
|
24
|
-
z-index: 1;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
23
|
.sprotty-text {
|
|
28
24
|
font-size: 12pt;
|
|
29
25
|
text-anchor: middle;
|
|
@@ -34,15 +30,6 @@
|
|
|
34
30
|
font-weight: bold;
|
|
35
31
|
}
|
|
36
32
|
|
|
37
|
-
.sprotty-node.mouseover:not(.selected) {
|
|
38
|
-
stroke-width: 2;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.sprotty-comp {
|
|
42
|
-
line-height: 3px;
|
|
43
|
-
text-align: left;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
33
|
.sprotty-label {
|
|
47
34
|
stroke-width: 0;
|
|
48
35
|
fill: #000;
|
|
@@ -53,132 +40,59 @@
|
|
|
53
40
|
|
|
54
41
|
.sprotty-label.heading {
|
|
55
42
|
font-weight: normal;
|
|
43
|
+
font-size: 0.7em;
|
|
44
|
+
fill: #f0f3f8;
|
|
56
45
|
}
|
|
57
46
|
|
|
58
|
-
.
|
|
59
|
-
stroke: black;
|
|
60
|
-
stroke-width: 0.5;
|
|
61
|
-
fill: #ffffff;
|
|
62
|
-
opacity: 0.5;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.sprotty-label.icon {
|
|
66
|
-
fill: black;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.sprotty-button {
|
|
70
|
-
fill: #152;
|
|
47
|
+
.icon path {
|
|
71
48
|
stroke-width: 0;
|
|
49
|
+
fill: #f0f3f8;
|
|
72
50
|
}
|
|
73
51
|
|
|
74
|
-
.
|
|
75
|
-
fill:
|
|
76
|
-
stroke-width: 1px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.sprotty-edge.selected {
|
|
80
|
-
stroke-width: 3px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.sprotty-edge.mouseover:not(.selected) {
|
|
84
|
-
stroke-width: 2px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.sprotty-edge > .sprotty-routing-handle {
|
|
88
|
-
r: 7px;
|
|
89
|
-
fill: #884;
|
|
90
|
-
stroke: none;
|
|
91
|
-
z-index: 1000;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.sprotty-edge > .sprotty-routing-handle[data-kind='line'] {
|
|
95
|
-
opacity: 0.35;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.sprotty-edge > .sprotty-routing-handle.selected {
|
|
99
|
-
fill: #66a;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.sprotty-edge > .sprotty-routing-handle.mouseover {
|
|
103
|
-
stroke: #112;
|
|
104
|
-
stroke-width: 1;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.sprotty-missing {
|
|
108
|
-
stroke-width: 1;
|
|
109
|
-
stroke: #f00;
|
|
110
|
-
fill: #f00;
|
|
111
|
-
font-size: 14pt;
|
|
112
|
-
text-anchor: middle;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.sprotty-node:not(.selected) {
|
|
116
|
-
stroke-width: 1px;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.sprotty-node.marquee {
|
|
120
|
-
fill: lightgray;
|
|
121
|
-
opacity: 0.2;
|
|
52
|
+
.icon .icon-background {
|
|
53
|
+
fill: transparent;
|
|
122
54
|
}
|
|
123
55
|
|
|
124
56
|
.task.automated > .sprotty-node {
|
|
125
|
-
fill:
|
|
57
|
+
fill: #5b9fa8;
|
|
126
58
|
}
|
|
127
59
|
|
|
128
60
|
.task.manual > .sprotty-node {
|
|
129
|
-
fill:
|
|
61
|
+
fill: #db8651;
|
|
130
62
|
}
|
|
131
63
|
|
|
132
64
|
.category > .sprotty-node {
|
|
133
|
-
fill:
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
text {
|
|
137
|
-
stroke-width: 0;
|
|
138
|
-
stroke: #000;
|
|
139
|
-
fill: #000;
|
|
140
|
-
font-family: sans-serif;
|
|
141
|
-
font-size: 8pt;
|
|
142
|
-
text-anchor: middle;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.sprotty-edge.weighted.low,
|
|
146
|
-
.sprotty-edge.weighted.low .arrow {
|
|
147
|
-
stroke: lightblue;
|
|
65
|
+
fill: #5c87bd;
|
|
148
66
|
}
|
|
149
67
|
|
|
150
|
-
.sprotty-edge.weighted.low
|
|
151
|
-
|
|
68
|
+
.sprotty-edge.weighted.low:not(.selected),
|
|
69
|
+
.sprotty-edge.weighted.low:not(.selected) .arrow {
|
|
70
|
+
stroke: rgb(128, 90, 233);
|
|
152
71
|
}
|
|
153
72
|
|
|
154
|
-
.sprotty-edge.weighted
|
|
155
|
-
|
|
156
|
-
.sprotty-edge.weighted.medium,
|
|
157
|
-
.sprotty-edge.weighted.medium .arrow {
|
|
158
|
-
stroke: #007fd4;
|
|
73
|
+
.sprotty-edge.weighted.low:not(.selected) .arrow {
|
|
74
|
+
fill: rgb(128, 90, 233);
|
|
159
75
|
}
|
|
160
76
|
|
|
161
|
-
.sprotty-edge.weighted
|
|
162
|
-
.sprotty-edge.weighted.
|
|
163
|
-
|
|
77
|
+
.sprotty-edge.weighted:not(.selected),
|
|
78
|
+
.sprotty-edge.weighted:not(.selected) .arrow,
|
|
79
|
+
.sprotty-edge.weighted.medium:not(.selected),
|
|
80
|
+
.sprotty-edge.weighted.medium:not(.selected) .arrow {
|
|
81
|
+
stroke: rgb(98, 60, 193);
|
|
164
82
|
}
|
|
165
83
|
|
|
166
|
-
.sprotty-edge.weighted.
|
|
167
|
-
.sprotty-edge.weighted.
|
|
168
|
-
|
|
84
|
+
.sprotty-edge.weighted:not(.selected) .arrow,
|
|
85
|
+
.sprotty-edge.weighted.medium:not(.selected) .arrow {
|
|
86
|
+
fill: rgb(98, 60, 193);
|
|
169
87
|
}
|
|
170
88
|
|
|
171
|
-
.sprotty-edge.weighted.high
|
|
172
|
-
|
|
89
|
+
.sprotty-edge.weighted.high:not(.selected),
|
|
90
|
+
.sprotty-edge.weighted.high:not(.selected) .arrow {
|
|
91
|
+
stroke: rgb(68, 30, 163);
|
|
173
92
|
}
|
|
174
93
|
|
|
175
|
-
|
|
176
|
-
fill:
|
|
177
|
-
stroke-width: 1pt;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.sprotty-node.selected {
|
|
181
|
-
stroke-width: 3px;
|
|
94
|
+
.sprotty-edge.weighted.high:not(.selected) .arrow {
|
|
95
|
+
fill: rgb(68, 30, 163);
|
|
182
96
|
}
|
|
183
97
|
|
|
184
98
|
.sprotty-comp {
|
|
@@ -186,38 +100,7 @@ polygon.sprotty-node {
|
|
|
186
100
|
fill: transparent;
|
|
187
101
|
}
|
|
188
102
|
|
|
189
|
-
.sprotty-comp.debug {
|
|
190
|
-
stroke: deepskyblue;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
svg {
|
|
194
|
-
border-style: solid;
|
|
195
|
-
border-width: 1px;
|
|
196
|
-
border-color: #bbb;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
103
|
.label-edit input {
|
|
200
|
-
margin-top: -
|
|
201
|
-
margin-left: -
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
g .movement-not-allowed > .sprotty-node {
|
|
205
|
-
stroke: var(--glsp-error-foreground) !important;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.sprotty-resize-handle.movement-not-allowed {
|
|
209
|
-
stroke: var(--glsp-error-foreground) !important;
|
|
210
|
-
fill: var(--glsp-error-foreground) !important;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.error > .sprotty-node {
|
|
214
|
-
stroke: var(--glsp-error-foreground) !important;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.warning > .sprotty-node {
|
|
218
|
-
stroke: var(--glsp-warning-foreground) !important;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.info > .sprotty-node {
|
|
222
|
-
stroke: var(--glsp-info-foreground) !important;
|
|
104
|
+
margin-top: -3px;
|
|
105
|
+
margin-left: -3px;
|
|
223
106
|
}
|
package/lib/di.config.js
CHANGED
|
@@ -31,26 +31,26 @@ const workflowDiagramModule = new inversify_1.ContainerModule((bind, unbind, isB
|
|
|
31
31
|
bind(client_1.TYPES.ICommandPaletteActionProvider).to(client_1.RevealNamedElementActionProvider);
|
|
32
32
|
bind(client_1.TYPES.IContextMenuItemProvider).to(client_1.DeleteElementContextMenuItemProvider);
|
|
33
33
|
const context = { bind, unbind, isBound, rebind };
|
|
34
|
-
client_1.configureDefaultModelElements(context);
|
|
35
|
-
client_1.configureModelElement(context, 'task:automated', model_1.TaskNode, client_1.RoundedCornerNodeView);
|
|
36
|
-
client_1.configureModelElement(context, 'task:manual', model_1.TaskNode, client_1.RoundedCornerNodeView);
|
|
37
|
-
client_1.configureModelElement(context, 'label:heading', client_1.SLabel, client_1.SLabelView, { enable: [client_1.editLabelFeature] });
|
|
38
|
-
client_1.configureModelElement(context, 'comp:comp', client_1.SCompartment, client_1.SCompartmentView);
|
|
39
|
-
client_1.configureModelElement(context, 'comp:header', client_1.SCompartment, client_1.SCompartmentView);
|
|
40
|
-
client_1.configureModelElement(context, 'label:icon', client_1.SLabel, client_1.SLabelView);
|
|
41
|
-
client_1.configureModelElement(context, protocol_1.DefaultTypes.EDGE, client_1.SEdge, workflow_views_1.WorkflowEdgeView);
|
|
42
|
-
client_1.configureModelElement(context, 'edge:weighted', model_1.WeightedEdge, workflow_views_1.WorkflowEdgeView);
|
|
43
|
-
client_1.configureModelElement(context, 'icon', model_1.Icon, workflow_views_1.IconView);
|
|
44
|
-
client_1.configureModelElement(context, 'activityNode:merge', model_1.ActivityNode, client_1.DiamondNodeView);
|
|
45
|
-
client_1.configureModelElement(context, 'activityNode:decision', model_1.ActivityNode, client_1.DiamondNodeView);
|
|
46
|
-
client_1.configureModelElement(context, 'activityNode:fork', model_1.ActivityNode, client_1.RectangularNodeView);
|
|
47
|
-
client_1.configureModelElement(context, 'activityNode:join', model_1.ActivityNode, client_1.RectangularNodeView);
|
|
48
|
-
client_1.configureModelElement(context, 'category', model_1.CategoryNode, client_1.RoundedCornerNodeView);
|
|
49
|
-
client_1.configureModelElement(context, 'struct', client_1.SCompartment, client_1.StructureCompartmentView);
|
|
34
|
+
(0, client_1.configureDefaultModelElements)(context);
|
|
35
|
+
(0, client_1.configureModelElement)(context, 'task:automated', model_1.TaskNode, client_1.RoundedCornerNodeView);
|
|
36
|
+
(0, client_1.configureModelElement)(context, 'task:manual', model_1.TaskNode, client_1.RoundedCornerNodeView);
|
|
37
|
+
(0, client_1.configureModelElement)(context, 'label:heading', client_1.SLabel, client_1.SLabelView, { enable: [client_1.editLabelFeature] });
|
|
38
|
+
(0, client_1.configureModelElement)(context, 'comp:comp', client_1.SCompartment, client_1.SCompartmentView);
|
|
39
|
+
(0, client_1.configureModelElement)(context, 'comp:header', client_1.SCompartment, client_1.SCompartmentView);
|
|
40
|
+
(0, client_1.configureModelElement)(context, 'label:icon', client_1.SLabel, client_1.SLabelView);
|
|
41
|
+
(0, client_1.configureModelElement)(context, protocol_1.DefaultTypes.EDGE, client_1.SEdge, workflow_views_1.WorkflowEdgeView);
|
|
42
|
+
(0, client_1.configureModelElement)(context, 'edge:weighted', model_1.WeightedEdge, workflow_views_1.WorkflowEdgeView);
|
|
43
|
+
(0, client_1.configureModelElement)(context, 'icon', model_1.Icon, workflow_views_1.IconView);
|
|
44
|
+
(0, client_1.configureModelElement)(context, 'activityNode:merge', model_1.ActivityNode, client_1.DiamondNodeView);
|
|
45
|
+
(0, client_1.configureModelElement)(context, 'activityNode:decision', model_1.ActivityNode, client_1.DiamondNodeView);
|
|
46
|
+
(0, client_1.configureModelElement)(context, 'activityNode:fork', model_1.ActivityNode, client_1.RectangularNodeView);
|
|
47
|
+
(0, client_1.configureModelElement)(context, 'activityNode:join', model_1.ActivityNode, client_1.RectangularNodeView);
|
|
48
|
+
(0, client_1.configureModelElement)(context, 'category', model_1.CategoryNode, client_1.RoundedCornerNodeView);
|
|
49
|
+
(0, client_1.configureModelElement)(context, 'struct', client_1.SCompartment, client_1.StructureCompartmentView);
|
|
50
50
|
});
|
|
51
51
|
function createContainer(widgetId) {
|
|
52
|
-
const container = client_1.createClientContainer(workflowDiagramModule, di_config_1.directTaskEditor);
|
|
53
|
-
client_1.overrideViewerOptions(container, {
|
|
52
|
+
const container = (0, client_1.createClientContainer)(workflowDiagramModule, di_config_1.directTaskEditor);
|
|
53
|
+
(0, client_1.overrideViewerOptions)(container, {
|
|
54
54
|
baseDiv: widgetId,
|
|
55
55
|
hiddenDiv: widgetId + '_hidden'
|
|
56
56
|
});
|
package/lib/di.config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.js","sourceRoot":"","sources":["../src/di.config.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAqB8B;AAC9B,qDAAsD;AACtD,uCAAqC;AACrC,yCAAuD;AACvD,sCAAoC;AACpC,8BAA4B;AAC5B,+DAAmE;AACnE,mCAAmF;AACnF,qDAA8D;AAE9D,MAAM,qBAAqB,GAAG,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAChF,MAAM,CAAC,cAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,sBAAa,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC3D,MAAM,CAAC,cAAK,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,iBAAQ,CAAC,IAAI,CAAC,CAAC;IACtD,IAAI,CAAC,cAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,oBAAW,CAAC,CAAC;IACrC,IAAI,CAAC,cAAK,CAAC,6BAA6B,CAAC,CAAC,EAAE,CAAC,yCAAgC,CAAC,CAAC;IAC/E,IAAI,CAAC,cAAK,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC,6CAAoC,CAAC,CAAC;IAC9E,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAElD,sCAA6B,
|
|
1
|
+
{"version":3,"file":"di.config.js","sourceRoot":"","sources":["../src/di.config.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAqB8B;AAC9B,qDAAsD;AACtD,uCAAqC;AACrC,yCAAuD;AACvD,sCAAoC;AACpC,8BAA4B;AAC5B,+DA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022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direct-task-editor.d.ts","sourceRoot":"","sources":["../../src/direct-task-editing/direct-task-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,mBAAmB,EACnB,MAAM,EACN,kBAAkB,EAClB,oBAAoB,EAEpB,oBAAoB,EACpB,OAAO,EAGP,aAAa,EAIb,UAAU,EAGV,gBAAgB,EAChB,aAAa,EAChB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"direct-task-editor.d.ts","sourceRoot":"","sources":["../../src/direct-task-editing/direct-task-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,mBAAmB,EACnB,MAAM,EACN,kBAAkB,EAClB,oBAAoB,EAEpB,oBAAoB,EACpB,OAAO,EAGP,aAAa,EAIb,UAAU,EAGV,gBAAgB,EAChB,aAAa,EAChB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAc,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEhD,qBAAa,sBAAuB,YAAW,MAAM;IAGrC,QAAQ,CAAC,MAAM,EAAE,MAAM;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM;IAFhE,MAAM,CAAC,QAAQ,CAAC,IAAI,mBAAmB;IACvC,QAAQ,CAAC,IAAI,mBAA+B;gBACvB,MAAM,EAAE,MAAM,EAAW,UAAU,EAAE,MAAM;CACnE;AAED,qBACa,UAAW,SAAQ,mBAAmB;IAC/C,MAAM,CAAC,QAAQ,CAAC,EAAE,iBAAiB;IACnC,QAAQ,CAAC,sBAAsB;;;;;MAK7B;IAGF,SAAS,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;IAGjD,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAGrD,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAGvC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAE/B,UACmB,MAAM,EAAE,OAAO,CAAC;IAEnC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC;IACzB,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC;IAE7C,EAAE,IAAI,MAAM;IAGZ,cAAc,IAAI,MAAM;IAIxB,SAAS,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,WAAW,GAAG,IAAI;IAkBxD,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,iBAAiB,EAAE,MAAM,EAAE,GAAG,IAAI;cAK5D,YAAY,CAAC,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,iBAAiB,EAAE,MAAM,EAAE,GAAG,IAAI;IAMhI,SAAS,CAAC,WAAW,CAAC,gBAAgB,EAAE,WAAW,GAAG,IAAI;cAe1C,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;cAU5D,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAQvE,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI;IAI/E,SAAS,CAAC,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK9C,IAAI,IAAI,IAAI;CAIxB"}
|
|
@@ -12,7 +12,7 @@ var TaskEditor_1;
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.TaskEditor = exports.ApplyTaskEditOperation = void 0;
|
|
14
14
|
/********************************************************************************
|
|
15
|
-
* Copyright (c) 2020-
|
|
15
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
16
16
|
*
|
|
17
17
|
* This program and the accompanying materials are made available under the
|
|
18
18
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -69,7 +69,7 @@ let TaskEditor = TaskEditor_1 = class TaskEditor extends client_1.AbstractUIExte
|
|
|
69
69
|
this.autoSuggestion.open(root);
|
|
70
70
|
}
|
|
71
71
|
onBeforeShow(containerElement, root, ...contextElementIds) {
|
|
72
|
-
this.task = getTask(contextElementIds, root)[0];
|
|
72
|
+
this.task = getTask(contextElementIds, root.index)[0];
|
|
73
73
|
this.autoSuggestion.inputField.value = '';
|
|
74
74
|
this.setPosition(containerElement);
|
|
75
75
|
}
|
|
@@ -77,7 +77,7 @@ let TaskEditor = TaskEditor_1 = class TaskEditor extends client_1.AbstractUIExte
|
|
|
77
77
|
let x = 0;
|
|
78
78
|
let y = 0;
|
|
79
79
|
if (this.task) {
|
|
80
|
-
const bounds = client_1.getAbsoluteClientBounds(this.task, this.domHelper, this.viewerOptions);
|
|
80
|
+
const bounds = (0, client_1.getAbsoluteClientBounds)(this.task, this.domHelper, this.viewerOptions);
|
|
81
81
|
x = bounds.x + 5;
|
|
82
82
|
y = bounds.y + 5;
|
|
83
83
|
}
|
|
@@ -87,20 +87,20 @@ let TaskEditor = TaskEditor_1 = class TaskEditor extends client_1.AbstractUIExte
|
|
|
87
87
|
}
|
|
88
88
|
async retrieveSuggestions(input) {
|
|
89
89
|
const response = await this.actionDispatcher.request(new client_1.RequestContextActions(TaskEditor_1.ID, this.editorContextService.get({ ['text']: input })));
|
|
90
|
-
if (client_1.isSetContextActionsAction(response)) {
|
|
90
|
+
if ((0, client_1.isSetContextActionsAction)(response)) {
|
|
91
91
|
return response.actions;
|
|
92
92
|
}
|
|
93
93
|
return Promise.reject();
|
|
94
94
|
}
|
|
95
95
|
async validateInput(input) {
|
|
96
96
|
const response = await this.actionDispatcher.request(new client_1.RequestEditValidationAction(TaskEditor_1.ID, this.task.id, input));
|
|
97
|
-
if (client_1.isSetEditValidationResultAction(response)) {
|
|
97
|
+
if ((0, client_1.isSetEditValidationResultAction)(response)) {
|
|
98
98
|
return response.status;
|
|
99
99
|
}
|
|
100
100
|
return Promise.reject();
|
|
101
101
|
}
|
|
102
102
|
executeFromSuggestion(input) {
|
|
103
|
-
this.actionDispatcher.dispatchAll(client_1.toActionArray(input));
|
|
103
|
+
this.actionDispatcher.dispatchAll((0, client_1.toActionArray)(input));
|
|
104
104
|
}
|
|
105
105
|
executeFromTextOnlyInput(input) {
|
|
106
106
|
const action = new ApplyTaskEditOperation(this.task.id, input);
|
|
@@ -113,30 +113,30 @@ let TaskEditor = TaskEditor_1 = class TaskEditor extends client_1.AbstractUIExte
|
|
|
113
113
|
};
|
|
114
114
|
TaskEditor.ID = 'task-editor';
|
|
115
115
|
__decorate([
|
|
116
|
-
inversify_1.inject(lib_1.TYPES.IActionDispatcher),
|
|
116
|
+
(0, inversify_1.inject)(lib_1.TYPES.IActionDispatcher),
|
|
117
117
|
__metadata("design:type", client_1.GLSPActionDispatcher)
|
|
118
118
|
], TaskEditor.prototype, "actionDispatcher", void 0);
|
|
119
119
|
__decorate([
|
|
120
|
-
inversify_1.inject(client_1.EditorContextService),
|
|
120
|
+
(0, inversify_1.inject)(client_1.EditorContextService),
|
|
121
121
|
__metadata("design:type", client_1.EditorContextService)
|
|
122
122
|
], TaskEditor.prototype, "editorContextService", void 0);
|
|
123
123
|
__decorate([
|
|
124
|
-
inversify_1.inject(lib_1.TYPES.ViewerOptions),
|
|
124
|
+
(0, inversify_1.inject)(lib_1.TYPES.ViewerOptions),
|
|
125
125
|
__metadata("design:type", Object)
|
|
126
126
|
], TaskEditor.prototype, "viewerOptions", void 0);
|
|
127
127
|
__decorate([
|
|
128
|
-
inversify_1.inject(lib_1.TYPES.DOMHelper),
|
|
128
|
+
(0, inversify_1.inject)(lib_1.TYPES.DOMHelper),
|
|
129
129
|
__metadata("design:type", dom_helper_1.DOMHelper)
|
|
130
130
|
], TaskEditor.prototype, "domHelper", void 0);
|
|
131
131
|
__decorate([
|
|
132
|
-
inversify_1.inject(lib_1.TYPES.ILogger),
|
|
132
|
+
(0, inversify_1.inject)(lib_1.TYPES.ILogger),
|
|
133
133
|
__metadata("design:type", Object)
|
|
134
134
|
], TaskEditor.prototype, "logger", void 0);
|
|
135
135
|
TaskEditor = TaskEditor_1 = __decorate([
|
|
136
|
-
inversify_1.injectable()
|
|
136
|
+
(0, inversify_1.injectable)()
|
|
137
137
|
], TaskEditor);
|
|
138
138
|
exports.TaskEditor = TaskEditor;
|
|
139
|
-
function getTask(ids,
|
|
140
|
-
return ids.map(id =>
|
|
139
|
+
function getTask(ids, index) {
|
|
140
|
+
return ids.map(id => index.getById(id)).filter(element => element && (0, model_1.isTaskNode)(element));
|
|
141
141
|
}
|
|
142
142
|
//# sourceMappingURL=direct-task-editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direct-task-editor.js","sourceRoot":"","sources":["../../src/direct-task-editing/direct-task-editor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAmB8B;AAC9B,yCAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"direct-task-editor.js","sourceRoot":"","sources":["../../src/direct-task-editing/direct-task-editor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAmB8B;AAC9B,yCAA+C;AAC/C,qCAAiD;AACjD,kEAA8D;AAC9D,oCAAgD;AAEhD,MAAa,sBAAsB;IAG/B,YAAqB,MAAc,EAAW,UAAkB;QAA3C,WAAM,GAAN,MAAM,CAAQ;QAAW,eAAU,GAAV,UAAU,CAAQ;QADvD,SAAI,GAAG,sBAAsB,CAAC,IAAI,CAAC;IACuB,CAAC;;AAHxE,wDAIC;AAHmB,2BAAI,GAAG,eAAe,CAAC;AAM3C,IAAa,UAAU,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ADC,IAAA,kBAAM,EAAC,WAAK,CAAC,OAAO,CAAC;;0CACa;AAtB1B,UAAU;IADtB,IAAA,sBAAU,GAAE;GACA,UAAU,CA6GtB;AA7GY,gCAAU;AA+GvB,SAAS,OAAO,CAAC,GAAa,EAAE,KAAiC;IAC7D,OAAO,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,IAAI,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAe,CAAC;AAC5G,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
9
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.createWorkflowDiagramContainer = void 0;
|
package/lib/model.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
import { DiamondNode, EditableLabel, LayoutContainer, Nameable, RectangularNode, SChildElement, SEdge, SModelElement, SShapeElement, WithEditableLabel } from '@eclipse-glsp/client';
|
|
17
17
|
export declare class TaskNode extends RectangularNode implements Nameable, WithEditableLabel {
|
|
18
18
|
static readonly DEFAULT_FEATURES: symbol[];
|
|
19
|
-
name: string;
|
|
20
19
|
duration?: number;
|
|
21
20
|
taskType?: string;
|
|
22
21
|
reference?: string;
|
|
23
22
|
get editableLabel(): (SChildElement & EditableLabel) | undefined;
|
|
23
|
+
get name(): string;
|
|
24
24
|
}
|
|
25
25
|
export declare function isTaskNode(element: SModelElement): element is TaskNode;
|
|
26
26
|
export declare class WeightedEdge extends SEdge {
|
package/lib/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAIH,WAAW,EACX,aAAa,EAKb,eAAe,EAGf,QAAQ,EAGR,eAAe,EACf,aAAa,EACb,KAAK,EAEL,aAAa,EACb,aAAa,EACb,iBAAiB,EAEpB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,QAAS,SAAQ,eAAgB,YAAW,QAAQ,EAAE,iBAAiB;IAChF,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAIH,WAAW,EACX,aAAa,EAKb,eAAe,EAGf,QAAQ,EAGR,eAAe,EACf,aAAa,EACb,KAAK,EAEL,aAAa,EACb,aAAa,EACb,iBAAiB,EAEpB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,QAAS,SAAQ,eAAgB,YAAW,QAAQ,EAAE,iBAAiB;IAChF,gBAAyB,gBAAgB,WAYvC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,IAAI,aAAa,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,GAAG,SAAS,CAM/D;IAED,IAAI,IAAI,IAAI,MAAM,CAGjB;CACJ;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,IAAI,QAAQ,CAEtE;AAED,qBAAa,YAAa,SAAQ,KAAK;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,YAAa,SAAQ,WAAW;IACzC,QAAQ,EAAE,MAAM,CAA+B;IACtC,IAAI;;;MAGX;IACO,WAAW,SAAK;CAC5B;AAED,yBAAiB,YAAY,CAAC;IAC1B,UAAiB,IAAI,CAAC;QACX,MAAM,OAAO,eAAe,CAAC;QAC7B,MAAM,KAAK,cAAc,CAAC;QAC1B,MAAM,QAAQ,iBAAiB,CAAC;QAChC,MAAM,KAAK,cAAc,CAAC;QAC1B,MAAM,IAAI,aAAa,CAAC;QACxB,MAAM,IAAI,aAAa,CAAC;QACxB,MAAM,SAAS,cAAc,CAAC;KACxC;CACJ;AAED,qBAAa,IAAK,SAAQ,aAAc,YAAW,eAAe;IAC9D,MAAM,CAAC,QAAQ,CAAC,gBAAgB,WAAgF;IAEhH,MAAM,EAAE,MAAM,CAAC;IACN,aAAa,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAC7D,IAAI;;;MAGX;CACL;AAED,qBAAa,YAAa,SAAQ,eAAgB,YAAW,QAAQ,EAAE,iBAAiB;IACpF,gBAAyB,gBAAgB,WAWvC;IAEF,IAAI,SAAM;IAEV,IAAI,aAAa,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,GAAG,SAAS,CAM/D;CACJ"}
|
package/lib/model.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CategoryNode = exports.Icon = exports.ActivityNode = exports.WeightedEdge = exports.isTaskNode = exports.TaskNode = void 0;
|
|
4
4
|
/********************************************************************************
|
|
5
|
-
* Copyright (c) 2020-
|
|
5
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
6
6
|
*
|
|
7
7
|
* This program and the accompanying materials are made available under the
|
|
8
8
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -18,20 +18,18 @@ exports.CategoryNode = exports.Icon = exports.ActivityNode = exports.WeightedEdg
|
|
|
18
18
|
********************************************************************************/
|
|
19
19
|
const client_1 = require("@eclipse-glsp/client");
|
|
20
20
|
class TaskNode extends client_1.RectangularNode {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...arguments);
|
|
23
|
-
this.name = '';
|
|
24
|
-
}
|
|
25
21
|
get editableLabel() {
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
if (label && client_1.isEditableLabel(label)) {
|
|
30
|
-
return label;
|
|
31
|
-
}
|
|
22
|
+
const label = this.children.find(element => element.type === 'label:heading');
|
|
23
|
+
if (label && (0, client_1.isEditableLabel)(label)) {
|
|
24
|
+
return label;
|
|
32
25
|
}
|
|
33
26
|
return undefined;
|
|
34
27
|
}
|
|
28
|
+
get name() {
|
|
29
|
+
var _a;
|
|
30
|
+
const labelText = (_a = this.editableLabel) === null || _a === void 0 ? void 0 : _a.text;
|
|
31
|
+
return labelText ? labelText : '<unknown>';
|
|
32
|
+
}
|
|
35
33
|
}
|
|
36
34
|
exports.TaskNode = TaskNode;
|
|
37
35
|
TaskNode.DEFAULT_FEATURES = [
|
|
@@ -96,7 +94,7 @@ class CategoryNode extends client_1.RectangularNode {
|
|
|
96
94
|
}
|
|
97
95
|
get editableLabel() {
|
|
98
96
|
const label = this.children.find(element => element.type === 'label:heading');
|
|
99
|
-
if (label && client_1.isEditableLabel(label)) {
|
|
97
|
+
if (label && (0, client_1.isEditableLabel)(label)) {
|
|
100
98
|
return label;
|
|
101
99
|
}
|
|
102
100
|
return undefined;
|
package/lib/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAwB8B;AAE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Y;IACzB,IAAiB,IAAI,CAQpB;IARD,WAAiB,IAAI;QACJ,YAAO,GAAG,YAAY,CAAC;QACvB,UAAK,GAAG,WAAW,CAAC;QACpB,aAAQ,GAAG,cAAc,CAAC;QAC1B,UAAK,GAAG,WAAW,CAAC;QACpB,SAAI,GAAG,UAAU,CAAC;QAClB,SAAI,GAAG,UAAU,CAAC;QAClB,cAAS,GAAG,WAAW,CAAC;IACzC,CAAC,EARgB,IAAI,GAAJ,iBAAI,KAAJ,iBAAI,QAQpB;AACL,CAAC,EAVgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAU5B;AAED,MAAa,IAAK,SAAQ,sBAAa;IAAvC;;QAKa,SAAI,GAAG;YACZ,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACb,CAAC;IACN,CAAC;;AATD,oBASC;AARmB,qBAAgB,GAAG,CAAC,sBAAa,EAAE,+BAAsB,EAAE,+BAAsB,EAAE,oBAAW,CAAC,CAAC;AAUpH,MAAa,YAAa,SAAQ,wBAAe;IAAjD;;QAcI,SAAI,GAAG,EAAE,CAAC;IASd,CAAC;IAPG,IAAI,aAAa;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC;QAC9E,IAAI,KAAK,IAAI,IAAA,wBAAe,EAAC,KAAK,CAAC,EAAE;YACjC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;;AAtBL,oCAuBC;AAtB4B,6BAAgB,GAAG;IACxC,yBAAgB;IAChB,sBAAa;IACb,sBAAa;IACb,oBAAW;IACX,+BAAsB;IACtB,oBAAW;IACX,6BAAoB;IACpB,qBAAY;IACZ,oBAAW;IACX,6BAAoB;CACvB,CAAC"}
|
package/lib/workflow-views.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import {
|
|
16
|
+
import { Point, PolylineEdgeViewWithGapsOnIntersections, RenderingContext, SEdge } from '@eclipse-glsp/client';
|
|
17
17
|
import { VNode } from 'snabbdom';
|
|
18
|
+
import { ShapeView } from 'sprotty';
|
|
18
19
|
import { Icon } from './model';
|
|
19
20
|
export declare class WorkflowEdgeView extends PolylineEdgeViewWithGapsOnIntersections {
|
|
20
21
|
protected renderAdditionals(edge: SEdge, segments: Point[], context: RenderingContext): VNode[];
|
|
21
22
|
}
|
|
22
|
-
export declare class IconView
|
|
23
|
-
render(element: Icon, context: RenderingContext): VNode;
|
|
24
|
-
getRadius(): number;
|
|
23
|
+
export declare class IconView extends ShapeView {
|
|
24
|
+
render(element: Icon, context: RenderingContext): VNode | undefined;
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=workflow-views.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-views.d.ts","sourceRoot":"","sources":["../src/workflow-views.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,
|
|
1
|
+
{"version":3,"file":"workflow-views.d.ts","sourceRoot":"","sources":["../src/workflow-views.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAGH,KAAK,EACL,uCAAuC,EACvC,gBAAgB,EAChB,KAAK,EAGR,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAuB,SAAS,EAAO,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAc,MAAM,SAAS,CAAC;AAK3C,qBACa,gBAAiB,SAAQ,uCAAuC;cACtD,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,gBAAgB,GAAG,KAAK,EAAE;CAiB3G;AAED,qBACa,QAAS,SAAQ,SAAS;IACnC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,GAAG,KAAK,GAAG,SAAS;CAsCtE"}
|
package/lib/workflow-views.js
CHANGED
|
@@ -8,7 +8,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.IconView = exports.WorkflowEdgeView = void 0;
|
|
10
10
|
/********************************************************************************
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
12
12
|
*
|
|
13
13
|
* This program and the accompanying materials are made available under the
|
|
14
14
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -25,6 +25,7 @@ exports.IconView = exports.WorkflowEdgeView = void 0;
|
|
|
25
25
|
const client_1 = require("@eclipse-glsp/client");
|
|
26
26
|
const inversify_1 = require("inversify");
|
|
27
27
|
const sprotty_1 = require("sprotty");
|
|
28
|
+
const model_1 = require("./model");
|
|
28
29
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
30
|
const JSX = { createElement: sprotty_1.svg };
|
|
30
31
|
let WorkflowEdgeView = class WorkflowEdgeView extends client_1.PolylineEdgeViewWithGapsOnIntersections {
|
|
@@ -32,28 +33,50 @@ let WorkflowEdgeView = class WorkflowEdgeView extends client_1.PolylineEdgeViewW
|
|
|
32
33
|
const additionals = super.renderAdditionals(edge, segments, context);
|
|
33
34
|
const p1 = segments[segments.length - 2];
|
|
34
35
|
const p2 = segments[segments.length - 1];
|
|
35
|
-
const arrow = (JSX.createElement("path", { "class-sprotty-edge": true, "class-arrow": true, d: 'M 1
|
|
36
|
+
const arrow = (JSX.createElement("path", { "class-sprotty-edge": true, "class-arrow": true, d: 'M 1,0 L 10,-4 L 10,4 Z', transform: `rotate(${(0, client_1.toDegrees)((0, client_1.angleOfPoint)({ x: p1.x - p2.x, y: p1.y - p2.y }))} ${p2.x} ${p2.y}) translate(${p2.x} ${p2.y})` }));
|
|
36
37
|
additionals.push(arrow);
|
|
37
38
|
return additionals;
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
41
|
WorkflowEdgeView = __decorate([
|
|
41
|
-
inversify_1.injectable()
|
|
42
|
+
(0, inversify_1.injectable)()
|
|
42
43
|
], WorkflowEdgeView);
|
|
43
44
|
exports.WorkflowEdgeView = WorkflowEdgeView;
|
|
44
|
-
let IconView = class IconView {
|
|
45
|
+
let IconView = class IconView extends sprotty_1.ShapeView {
|
|
45
46
|
render(element, context) {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
const taskNode = (0, sprotty_1.findParentByFeature)(element, model_1.isTaskNode);
|
|
48
|
+
if (!taskNode || !this.isVisible(element, context)) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
let icon;
|
|
52
|
+
if (taskNode.type === 'task:manual') {
|
|
53
|
+
// From codicons: https://github.com/microsoft/vscode-codicons/blob/main/src/icons/account.svg?short_path=8135b2d
|
|
54
|
+
icon =
|
|
55
|
+
// eslint-disable-next-line max-len
|
|
56
|
+
'M16 7.992C16 3.58 12.416 0 8 0S0 3.58 0 7.992c0 2.43 1.104 4.62 2.832 6.09.016.016.032.016.032.032.144.112.288.224.448.336.08.048.144.111.224.175A7.98 7.98 0 0 0 8.016 16a7.98 7.98 0 0 0 4.48-1.375c.08-.048.144-.111.224-.16.144-.111.304-.223.448-.335.016-.016.032-.016.032-.032 1.696-1.487 2.8-3.676 2.8-6.106zm-8 7.001c-1.504 0-2.88-.48-4.016-1.279.016-.128.048-.255.08-.383a4.17 4.17 0 0 1 .416-.991c.176-.304.384-.576.64-.816.24-.24.528-.463.816-.639.304-.176.624-.304.976-.4A4.15 4.15 0 0 1 8 10.342a4.185 4.185 0 0 1 2.928 1.166c.368.368.656.8.864 1.295.112.288.192.592.24.911A7.03 7.03 0 0 1 8 14.993zm-2.448-7.4a2.49 2.49 0 0 1-.208-1.024c0-.351.064-.703.208-1.023.144-.32.336-.607.576-.847.24-.24.528-.431.848-.575.32-.144.672-.208 1.024-.208.368 0 .704.064 1.024.208.32.144.608.336.848.575.24.24.432.528.576.847.144.32.208.672.208 1.023 0 .368-.064.704-.208 1.023a2.84 2.84 0 0 1-.576.848 2.84 2.84 0 0 1-.848.575 2.715 2.715 0 0 1-2.064 0 2.84 2.84 0 0 1-.848-.575 2.526 2.526 0 0 1-.56-.848zm7.424 5.306c0-.032-.016-.048-.016-.08a5.22 5.22 0 0 0-.688-1.406 4.883 4.883 0 0 0-1.088-1.135 5.207 5.207 0 0 0-1.04-.608 2.82 2.82 0 0 0 .464-.383 4.2 4.2 0 0 0 .624-.784 3.624 3.624 0 0 0 .528-1.934 3.71 3.71 0 0 0-.288-1.47 3.799 3.799 0 0 0-.816-1.199 3.845 3.845 0 0 0-1.2-.8 3.72 3.72 0 0 0-1.472-.287 3.72 3.72 0 0 0-1.472.288 3.631 3.631 0 0 0-1.2.815 3.84 3.84 0 0 0-.8 1.199 3.71 3.71 0 0 0-.288 1.47c0 .352.048.688.144 1.007.096.336.224.64.4.927.16.288.384.544.624.784.144.144.304.271.48.383a5.12 5.12 0 0 0-1.04.624c-.416.32-.784.703-1.088 1.119a4.999 4.999 0 0 0-.688 1.406c-.016.032-.016.064-.016.08C1.776 11.636.992 9.91.992 7.992.992 4.14 4.144.991 8 .991s7.008 3.149 7.008 7.001a6.96 6.96 0 0 1-2.032 4.907z';
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// From codicons: https://github.com/microsoft/vscode-codicons/blob/main/src/icons/gear.svg?short_path=8ee3ec4
|
|
60
|
+
icon =
|
|
61
|
+
// eslint-disable-next-line max-len
|
|
62
|
+
'M9.1 4.4L8.6 2H7.4l-.5 2.4-.7.3-2-1.3-.9.8 1.3 2-.2.7-2.4.5v1.2l2.4.5.3.8-1.3 2 .8.8 2-1.3.8.3.4 2.3h1.2l.5-2.4.8-.3 2 1.3.8-.8-1.3-2 .3-.8 2.3-.4V7.4l-2.4-.5-.3-.8 1.3-2-.8-.8-2 1.3-.7-.2zM9.4 1l.5 2.4L12 2.1l2 2-1.4 2.1 2.4.4v2.8l-2.4.5L14 12l-2 2-2.1-1.4-.5 2.4H6.6l-.5-2.4L4 13.9l-2-2 1.4-2.1L1 9.4V6.6l2.4-.5L2.1 4l2-2 2.1 1.4.4-2.4h2.8zm.6 7c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zM8 9c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1z';
|
|
63
|
+
}
|
|
64
|
+
const vnode = (JSX.createElement("g", null,
|
|
65
|
+
JSX.createElement("path", { transform: 'scale(1.15),translate(0.75,0.75)',
|
|
66
|
+
// From codicons: https://github.com/microsoft/vscode-codicons/blob/main/src/icons/terminal.svg?short_path=2ffc08e
|
|
67
|
+
// eslint-disable-next-line max-len
|
|
68
|
+
d: icon }),
|
|
69
|
+
JSX.createElement("rect", { "class-icon-background": true, x: 0, y: 0, width: 25, height: 20 }),
|
|
49
70
|
context.renderChildren(element)));
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
71
|
+
const subType = (0, client_1.getSubType)(element);
|
|
72
|
+
if (subType) {
|
|
73
|
+
(0, client_1.setAttr)(vnode, 'class', subType);
|
|
74
|
+
}
|
|
75
|
+
return vnode;
|
|
53
76
|
}
|
|
54
77
|
};
|
|
55
78
|
IconView = __decorate([
|
|
56
|
-
inversify_1.injectable()
|
|
79
|
+
(0, inversify_1.injectable)()
|
|
57
80
|
], IconView);
|
|
58
81
|
exports.IconView = IconView;
|
|
59
82
|
//# sourceMappingURL=workflow-views.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-views.js","sourceRoot":"","sources":["../src/workflow-views.tsx"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"workflow-views.js","sourceRoot":"","sources":["../src/workflow-views.tsx"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAS8B;AAC9B,yCAAuC;AAEvC,qCAA8D;AAC9D,mCAA2C;AAE3C,6DAA6D;AAC7D,MAAM,GAAG,GAAG,EAAE,aAAa,EAAE,aAAG,EAAE,CAAC;AAGnC,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,gDAAuC;IACtD,iBAAiB,CAAC,IAAW,EAAE,QAAiB,EAAE,OAAyB;QAC1F,MAAM,WAAW,GAAG,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrE,MAAM,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,MAAM,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,CACV,kDACwB,IAAI,iBACX,IAAI,EACjB,CAAC,EAAC,wBAAwB,EAC1B,SAAS,EAAE,UAAU,IAAA,kBAAS,EAAC,IAAA,qBAAY,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,IAC/G,EAAE,CAAC,CACP,GAAG,GACL,CACL,CA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,CAuCpB;AAvCY,4BAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp-examples/workflow-glsp",
|
|
3
|
-
"version": "0.10.0-next.
|
|
3
|
+
"version": "0.10.0-next.146a812.165+146a812",
|
|
4
4
|
"description": "GLSP diagrams for the Workflow DSL",
|
|
5
5
|
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
|
|
6
6
|
"keywords": [
|
|
@@ -26,17 +26,15 @@
|
|
|
26
26
|
}
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@eclipse-glsp/client": "0.10.0-next.
|
|
29
|
+
"@eclipse-glsp/client": "0.10.0-next.146a812.165+146a812",
|
|
30
30
|
"balloon-css": "^0.5.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"mvn-artifact-download": "5.1.0"
|
|
34
|
-
"rimraf": "^2.6.1",
|
|
35
|
-
"typescript": "^3.9.2"
|
|
33
|
+
"mvn-artifact-download": "5.1.0"
|
|
36
34
|
},
|
|
37
35
|
"scripts": {
|
|
38
36
|
"prepare": "yarn clean && yarn build && yarn lint",
|
|
39
|
-
"clean": "rimraf lib",
|
|
37
|
+
"clean": "rimraf tsconfig.tsbuildinfo lib",
|
|
40
38
|
"build": "tsc",
|
|
41
39
|
"lint": "eslint -c ./.eslintrc.js --ext .ts,.tsx ./src",
|
|
42
40
|
"watch": "tsc -w"
|
|
@@ -53,5 +51,5 @@
|
|
|
53
51
|
"publishConfig": {
|
|
54
52
|
"access": "public"
|
|
55
53
|
},
|
|
56
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "146a8123986421e7a3a9e867d0ded74dd6dec2c0"
|
|
57
55
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -34,9 +34,8 @@ import {
|
|
|
34
34
|
ViewerOptions
|
|
35
35
|
} from '@eclipse-glsp/client';
|
|
36
36
|
import { inject, injectable } from 'inversify';
|
|
37
|
-
import { TYPES } from 'sprotty/lib';
|
|
37
|
+
import { SModelIndex, TYPES } from 'sprotty/lib';
|
|
38
38
|
import { DOMHelper } from 'sprotty/lib/base/views/dom-helper';
|
|
39
|
-
|
|
40
39
|
import { isTaskNode, TaskNode } from '../model';
|
|
41
40
|
|
|
42
41
|
export class ApplyTaskEditOperation implements Action {
|
|
@@ -68,7 +67,7 @@ export class TaskEditor extends AbstractUIExtension {
|
|
|
68
67
|
protected domHelper: DOMHelper;
|
|
69
68
|
|
|
70
69
|
@inject(TYPES.ILogger)
|
|
71
|
-
protected logger: ILogger;
|
|
70
|
+
protected override logger: ILogger;
|
|
72
71
|
|
|
73
72
|
protected task: TaskNode;
|
|
74
73
|
protected autoSuggestion: AutoCompleteWidget;
|
|
@@ -98,13 +97,13 @@ export class TaskEditor extends AbstractUIExtension {
|
|
|
98
97
|
this.autoSuggestion.initialize(containerElement);
|
|
99
98
|
}
|
|
100
99
|
|
|
101
|
-
show(root: Readonly<SModelRoot>, ...contextElementIds: string[]): void {
|
|
100
|
+
override show(root: Readonly<SModelRoot>, ...contextElementIds: string[]): void {
|
|
102
101
|
super.show(root, ...contextElementIds);
|
|
103
102
|
this.autoSuggestion.open(root);
|
|
104
103
|
}
|
|
105
104
|
|
|
106
|
-
protected onBeforeShow(containerElement: HTMLElement, root: Readonly<SModelRoot>, ...contextElementIds: string[]): void {
|
|
107
|
-
this.task = getTask(contextElementIds, root)[0];
|
|
105
|
+
protected override onBeforeShow(containerElement: HTMLElement, root: Readonly<SModelRoot>, ...contextElementIds: string[]): void {
|
|
106
|
+
this.task = getTask(contextElementIds, root.index)[0];
|
|
108
107
|
this.autoSuggestion.inputField.value = '';
|
|
109
108
|
this.setPosition(containerElement);
|
|
110
109
|
}
|
|
@@ -151,12 +150,12 @@ export class TaskEditor extends AbstractUIExtension {
|
|
|
151
150
|
this.actionDispatcher.dispatch(action);
|
|
152
151
|
}
|
|
153
152
|
|
|
154
|
-
hide(): void {
|
|
153
|
+
override hide(): void {
|
|
155
154
|
this.autoSuggestion.dispose();
|
|
156
155
|
super.hide();
|
|
157
156
|
}
|
|
158
157
|
}
|
|
159
158
|
|
|
160
|
-
function getTask(ids: string[],
|
|
161
|
-
return ids.map(id =>
|
|
159
|
+
function getTask(ids: string[], index: SModelIndex<SModelElement>): TaskNode[] {
|
|
160
|
+
return ids.map(id => index.getById(id)).filter(element => element && isTaskNode(element)) as TaskNode[];
|
|
162
161
|
}
|
package/src/model.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
} from '@eclipse-glsp/client';
|
|
41
41
|
|
|
42
42
|
export class TaskNode extends RectangularNode implements Nameable, WithEditableLabel {
|
|
43
|
-
static readonly DEFAULT_FEATURES = [
|
|
43
|
+
static override readonly DEFAULT_FEATURES = [
|
|
44
44
|
connectableFeature,
|
|
45
45
|
deletableFeature,
|
|
46
46
|
selectFeature,
|
|
@@ -53,21 +53,22 @@ export class TaskNode extends RectangularNode implements Nameable, WithEditableL
|
|
|
53
53
|
nameFeature,
|
|
54
54
|
withEditLabelFeature
|
|
55
55
|
];
|
|
56
|
-
name = '';
|
|
57
56
|
duration?: number;
|
|
58
57
|
taskType?: string;
|
|
59
58
|
reference?: string;
|
|
60
59
|
|
|
61
60
|
get editableLabel(): (SChildElement & EditableLabel) | undefined {
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
if (label && isEditableLabel(label)) {
|
|
66
|
-
return label;
|
|
67
|
-
}
|
|
61
|
+
const label = this.children.find(element => element.type === 'label:heading');
|
|
62
|
+
if (label && isEditableLabel(label)) {
|
|
63
|
+
return label;
|
|
68
64
|
}
|
|
69
65
|
return undefined;
|
|
70
66
|
}
|
|
67
|
+
|
|
68
|
+
get name(): string {
|
|
69
|
+
const labelText = this.editableLabel?.text;
|
|
70
|
+
return labelText ? labelText : '<unknown>';
|
|
71
|
+
}
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
export function isTaskNode(element: SModelElement): element is TaskNode {
|
|
@@ -80,11 +81,11 @@ export class WeightedEdge extends SEdge {
|
|
|
80
81
|
|
|
81
82
|
export class ActivityNode extends DiamondNode {
|
|
82
83
|
nodeType: string = ActivityNode.Type.UNDEFINED;
|
|
83
|
-
size = {
|
|
84
|
+
override size = {
|
|
84
85
|
width: 32,
|
|
85
86
|
height: 32
|
|
86
87
|
};
|
|
87
|
-
strokeWidth = 1;
|
|
88
|
+
override strokeWidth = 1;
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
export namespace ActivityNode {
|
|
@@ -103,15 +104,15 @@ export class Icon extends SShapeElement implements LayoutContainer {
|
|
|
103
104
|
static readonly DEFAULT_FEATURES = [boundsFeature, layoutContainerFeature, layoutableChildFeature, fadeFeature];
|
|
104
105
|
|
|
105
106
|
layout: string;
|
|
106
|
-
layoutOptions?: { [key: string]: string | number | boolean };
|
|
107
|
-
size = {
|
|
107
|
+
override layoutOptions?: { [key: string]: string | number | boolean };
|
|
108
|
+
override size = {
|
|
108
109
|
width: 32,
|
|
109
110
|
height: 32
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
export class CategoryNode extends RectangularNode implements Nameable, WithEditableLabel {
|
|
114
|
-
static readonly DEFAULT_FEATURES = [
|
|
115
|
+
static override readonly DEFAULT_FEATURES = [
|
|
115
116
|
deletableFeature,
|
|
116
117
|
selectFeature,
|
|
117
118
|
boundsFeature,
|
package/src/workflow-views.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -15,24 +15,25 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import {
|
|
17
17
|
angleOfPoint,
|
|
18
|
-
|
|
18
|
+
getSubType,
|
|
19
19
|
Point,
|
|
20
20
|
PolylineEdgeViewWithGapsOnIntersections,
|
|
21
21
|
RenderingContext,
|
|
22
22
|
SEdge,
|
|
23
|
+
setAttr,
|
|
23
24
|
toDegrees
|
|
24
25
|
} from '@eclipse-glsp/client';
|
|
25
26
|
import { injectable } from 'inversify';
|
|
26
27
|
import { VNode } from 'snabbdom';
|
|
27
|
-
import { svg } from 'sprotty';
|
|
28
|
-
import { Icon } from './model';
|
|
28
|
+
import { findParentByFeature, ShapeView, svg } from 'sprotty';
|
|
29
|
+
import { Icon, isTaskNode } from './model';
|
|
29
30
|
|
|
30
31
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
32
|
const JSX = { createElement: svg };
|
|
32
33
|
|
|
33
34
|
@injectable()
|
|
34
35
|
export class WorkflowEdgeView extends PolylineEdgeViewWithGapsOnIntersections {
|
|
35
|
-
protected renderAdditionals(edge: SEdge, segments: Point[], context: RenderingContext): VNode[] {
|
|
36
|
+
protected override renderAdditionals(edge: SEdge, segments: Point[], context: RenderingContext): VNode[] {
|
|
36
37
|
const additionals = super.renderAdditionals(edge, segments, context);
|
|
37
38
|
const p1 = segments[segments.length - 2];
|
|
38
39
|
const p2 = segments[segments.length - 1];
|
|
@@ -40,7 +41,7 @@ export class WorkflowEdgeView extends PolylineEdgeViewWithGapsOnIntersections {
|
|
|
40
41
|
<path
|
|
41
42
|
class-sprotty-edge={true}
|
|
42
43
|
class-arrow={true}
|
|
43
|
-
d='M 1
|
|
44
|
+
d='M 1,0 L 10,-4 L 10,4 Z'
|
|
44
45
|
transform={`rotate(${toDegrees(angleOfPoint({ x: p1.x - p2.x, y: p1.y - p2.y }))} ${p2.x} ${p2.y}) translate(${p2.x} ${
|
|
45
46
|
p2.y
|
|
46
47
|
})`}
|
|
@@ -52,18 +53,43 @@ export class WorkflowEdgeView extends PolylineEdgeViewWithGapsOnIntersections {
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
@injectable()
|
|
55
|
-
export class IconView
|
|
56
|
-
render(element: Icon, context: RenderingContext): VNode {
|
|
57
|
-
const
|
|
58
|
-
|
|
56
|
+
export class IconView extends ShapeView {
|
|
57
|
+
render(element: Icon, context: RenderingContext): VNode | undefined {
|
|
58
|
+
const taskNode = findParentByFeature(element, isTaskNode);
|
|
59
|
+
if (!taskNode || !this.isVisible(element, context)) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
let icon;
|
|
64
|
+
if (taskNode.type === 'task:manual') {
|
|
65
|
+
// From codicons: https://github.com/microsoft/vscode-codicons/blob/main/src/icons/account.svg?short_path=8135b2d
|
|
66
|
+
icon =
|
|
67
|
+
// eslint-disable-next-line max-len
|
|
68
|
+
'M16 7.992C16 3.58 12.416 0 8 0S0 3.58 0 7.992c0 2.43 1.104 4.62 2.832 6.09.016.016.032.016.032.032.144.112.288.224.448.336.08.048.144.111.224.175A7.98 7.98 0 0 0 8.016 16a7.98 7.98 0 0 0 4.48-1.375c.08-.048.144-.111.224-.16.144-.111.304-.223.448-.335.016-.016.032-.016.032-.032 1.696-1.487 2.8-3.676 2.8-6.106zm-8 7.001c-1.504 0-2.88-.48-4.016-1.279.016-.128.048-.255.08-.383a4.17 4.17 0 0 1 .416-.991c.176-.304.384-.576.64-.816.24-.24.528-.463.816-.639.304-.176.624-.304.976-.4A4.15 4.15 0 0 1 8 10.342a4.185 4.185 0 0 1 2.928 1.166c.368.368.656.8.864 1.295.112.288.192.592.24.911A7.03 7.03 0 0 1 8 14.993zm-2.448-7.4a2.49 2.49 0 0 1-.208-1.024c0-.351.064-.703.208-1.023.144-.32.336-.607.576-.847.24-.24.528-.431.848-.575.32-.144.672-.208 1.024-.208.368 0 .704.064 1.024.208.32.144.608.336.848.575.24.24.432.528.576.847.144.32.208.672.208 1.023 0 .368-.064.704-.208 1.023a2.84 2.84 0 0 1-.576.848 2.84 2.84 0 0 1-.848.575 2.715 2.715 0 0 1-2.064 0 2.84 2.84 0 0 1-.848-.575 2.526 2.526 0 0 1-.56-.848zm7.424 5.306c0-.032-.016-.048-.016-.08a5.22 5.22 0 0 0-.688-1.406 4.883 4.883 0 0 0-1.088-1.135 5.207 5.207 0 0 0-1.04-.608 2.82 2.82 0 0 0 .464-.383 4.2 4.2 0 0 0 .624-.784 3.624 3.624 0 0 0 .528-1.934 3.71 3.71 0 0 0-.288-1.47 3.799 3.799 0 0 0-.816-1.199 3.845 3.845 0 0 0-1.2-.8 3.72 3.72 0 0 0-1.472-.287 3.72 3.72 0 0 0-1.472.288 3.631 3.631 0 0 0-1.2.815 3.84 3.84 0 0 0-.8 1.199 3.71 3.71 0 0 0-.288 1.47c0 .352.048.688.144 1.007.096.336.224.64.4.927.16.288.384.544.624.784.144.144.304.271.48.383a5.12 5.12 0 0 0-1.04.624c-.416.32-.784.703-1.088 1.119a4.999 4.999 0 0 0-.688 1.406c-.016.032-.016.064-.016.08C1.776 11.636.992 9.91.992 7.992.992 4.14 4.144.991 8 .991s7.008 3.149 7.008 7.001a6.96 6.96 0 0 1-2.032 4.907z';
|
|
69
|
+
} else {
|
|
70
|
+
// From codicons: https://github.com/microsoft/vscode-codicons/blob/main/src/icons/gear.svg?short_path=8ee3ec4
|
|
71
|
+
icon =
|
|
72
|
+
// eslint-disable-next-line max-len
|
|
73
|
+
'M9.1 4.4L8.6 2H7.4l-.5 2.4-.7.3-2-1.3-.9.8 1.3 2-.2.7-2.4.5v1.2l2.4.5.3.8-1.3 2 .8.8 2-1.3.8.3.4 2.3h1.2l.5-2.4.8-.3 2 1.3.8-.8-1.3-2 .3-.8 2.3-.4V7.4l-2.4-.5-.3-.8 1.3-2-.8-.8-2 1.3-.7-.2zM9.4 1l.5 2.4L12 2.1l2 2-1.4 2.1 2.4.4v2.8l-2.4.5L14 12l-2 2-2.1-1.4-.5 2.4H6.6l-.5-2.4L4 13.9l-2-2 1.4-2.1L1 9.4V6.6l2.4-.5L2.1 4l2-2 2.1 1.4.4-2.4h2.8zm.6 7c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zM8 9c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1z';
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const vnode = (
|
|
59
77
|
<g>
|
|
60
|
-
<
|
|
78
|
+
<path
|
|
79
|
+
transform={'scale(1.15),translate(0.75,0.75)'}
|
|
80
|
+
// From codicons: https://github.com/microsoft/vscode-codicons/blob/main/src/icons/terminal.svg?short_path=2ffc08e
|
|
81
|
+
// eslint-disable-next-line max-len
|
|
82
|
+
d={icon}
|
|
83
|
+
/>
|
|
84
|
+
<rect class-icon-background x={0} y={0} width={25} height={20} />
|
|
61
85
|
{context.renderChildren(element)}
|
|
62
86
|
</g>
|
|
63
87
|
);
|
|
64
|
-
}
|
|
65
88
|
|
|
66
|
-
|
|
67
|
-
|
|
89
|
+
const subType = getSubType(element);
|
|
90
|
+
if (subType) {
|
|
91
|
+
setAttr(vnode, 'class', subType);
|
|
92
|
+
}
|
|
93
|
+
return vnode;
|
|
68
94
|
}
|
|
69
95
|
}
|