aurea-eden 1.25.1
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/.gitattributes +2 -0
- package/.github/workflows/static.yml +43 -0
- package/CHANGELOG.md +60 -0
- package/LICENSE +17 -0
- package/README.md +171 -0
- package/README_.md +174 -0
- package/assets/3diagram_logo.png +0 -0
- package/assets/aurea-eden-logo.jpeg +0 -0
- package/assets/favicon/about.txt +6 -0
- package/assets/favicon/android-chrome-192x192.png +0 -0
- package/assets/favicon/android-chrome-512x512.png +0 -0
- package/assets/favicon/apple-touch-icon.png +0 -0
- package/assets/favicon/favicon-16x16.png +0 -0
- package/assets/favicon/favicon-32x32.png +0 -0
- package/assets/favicon/favicon.ico +0 -0
- package/assets/favicon/site.webmanifest +1 -0
- package/assets/threejs_camera.jpg.webp +0 -0
- package/assets/threejs_camera3.jpg.webp +0 -0
- package/assets/threejs_cameras.webp +0 -0
- package/assets/threejs_cameras2.webp +0 -0
- package/assets/threejs_objects.webp +0 -0
- package/assets/threejs_scene.webp +0 -0
- package/assets/threejs_scene_graph.webp +0 -0
- package/dist/bpmn-diagram.es.js +33126 -0
- package/dist/bpmn-diagram.umd.js +5790 -0
- package/favicon.ico +0 -0
- package/index.html +34 -0
- package/index.js +153 -0
- package/lib/connectors/Connector.js +47 -0
- package/lib/diagrams/Diagram.js +710 -0
- package/lib/diagrams/DiagramConstants.js +22 -0
- package/lib/elements/Element.js +860 -0
- package/lib/materials/BarMaterial.js +17 -0
- package/lib/materials/DiagramEditMaterial.js +28 -0
- package/lib/notations/BpmnDiagram.js +861 -0
- package/lib/shapes/Shape.js +23 -0
- package/lib/shapes/bar/ValueBarConstants.js +34 -0
- package/lib/shapes/bar/ValueBarShape.js +52 -0
- package/lib/shapes/basic/BasicShapeConstants.js +23 -0
- package/lib/shapes/basic/BoxShape.js +12 -0
- package/lib/shapes/basic/CircleShape.js +55 -0
- package/lib/shapes/basic/DiamondShape.js +169 -0
- package/lib/shapes/basic/RoundedRectangleShape.js +180 -0
- package/lib/shapes/connector/ConnectorConstants.js +7 -0
- package/lib/shapes/connector/RoundedCornerOrthogonalConnectorShape.js +229 -0
- package/lib/shapes/icon/IconConstants.js +7 -0
- package/lib/shapes/icon/IconShape.js +92 -0
- package/lib/shapes/icon/bpmn/activities/ad-hoc-marker.svg +50 -0
- package/lib/shapes/icon/bpmn/activities/business-rule.svg +92 -0
- package/lib/shapes/icon/bpmn/activities/compensation-marker.svg +50 -0
- package/lib/shapes/icon/bpmn/activities/loop-marker.svg +50 -0
- package/lib/shapes/icon/bpmn/activities/manual.svg +51 -0
- package/lib/shapes/icon/bpmn/activities/parallel-mi-marker.svg +70 -0
- package/lib/shapes/icon/bpmn/activities/receive.svg +77 -0
- package/lib/shapes/icon/bpmn/activities/script.svg +54 -0
- package/lib/shapes/icon/bpmn/activities/send.svg +86 -0
- package/lib/shapes/icon/bpmn/activities/sequential-mi-marker.svg +70 -0
- package/lib/shapes/icon/bpmn/activities/service.svg +58 -0
- package/lib/shapes/icon/bpmn/activities/sub-process-marker.svg +51 -0
- package/lib/shapes/icon/bpmn/activities/user.svg +50 -0
- package/lib/shapes/icon/bpmn/events/compensation.svg +47 -0
- package/lib/shapes/icon/bpmn/events/conditional.svg +47 -0
- package/lib/shapes/icon/bpmn/events/error.svg +47 -0
- package/lib/shapes/icon/bpmn/events/escalation.svg +47 -0
- package/lib/shapes/icon/bpmn/events/intermediate-compensation.svg +53 -0
- package/lib/shapes/icon/bpmn/events/intermediate-conditional.svg +53 -0
- package/lib/shapes/icon/bpmn/events/intermediate-escalation.svg +53 -0
- package/lib/shapes/icon/bpmn/events/intermediate-link-catch.svg +53 -0
- package/lib/shapes/icon/bpmn/events/intermediate-link-throw.svg +53 -0
- package/lib/shapes/icon/bpmn/events/intermediate-receive.svg +53 -0
- package/lib/shapes/icon/bpmn/events/intermediate-send.svg +69 -0
- package/lib/shapes/icon/bpmn/events/intermediate-signal-catch.svg +53 -0
- package/lib/shapes/icon/bpmn/events/intermediate-signal-throw.svg +53 -0
- package/lib/shapes/icon/bpmn/events/intermediate-timer.svg +107 -0
- package/lib/shapes/icon/bpmn/events/intermediate.svg +49 -0
- package/lib/shapes/icon/bpmn/events/message-end.svg +54 -0
- package/lib/shapes/icon/bpmn/events/message-start.svg +41 -0
- package/lib/shapes/icon/bpmn/events/signal-end.svg +47 -0
- package/lib/shapes/icon/bpmn/events/signal-start.svg +47 -0
- package/lib/shapes/icon/bpmn/events/terminate.svg +49 -0
- package/lib/shapes/icon/bpmn/events/timer.svg +104 -0
- package/lib/shapes/icon/bpmn/gateways/complex.svg +61 -0
- package/lib/shapes/icon/bpmn/gateways/event-based.svg +68 -0
- package/lib/shapes/icon/bpmn/gateways/exclusive.svg +57 -0
- package/lib/shapes/icon/bpmn/gateways/inclusive.svg +57 -0
- package/lib/shapes/icon/bpmn/gateways/parallel.svg +56 -0
- package/lib/shapes/icon/decorators.svg +262 -0
- package/lib/shapes/icon/hexagon.svg +5 -0
- package/lib/shapes/text/Roboto_Regular.json +5610 -0
- package/lib/shapes/text/TextShape.js +29 -0
- package/lib/shapes/text/fonts/Roboto.zip +0 -0
- package/package.json +45 -0
- package/vite.config.js +15 -0
package/favicon.ico
ADDED
|
Binary file
|
package/index.html
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>Aurea EDEN demo</title>
|
|
6
|
+
<!-- Favicon hack - Add '?' to favicon.ico to be visible in dev mode on vite -->
|
|
7
|
+
<!-- https://stackoverflow.com/questions/7324456/favicon-not-showing-up -->
|
|
8
|
+
<link rel="icon" href="favicon.ico?" type="image/x-icon">
|
|
9
|
+
<style>
|
|
10
|
+
body { margin: 0; }
|
|
11
|
+
|
|
12
|
+
/* 2. set appropriate css for the camera vectors */
|
|
13
|
+
#camera-vectors {
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
background: grey; /* rgba(128, 128, 128, 0); */
|
|
18
|
+
padding: 8px;
|
|
19
|
+
color: white; /* rgba(255, 255, 255, 0); */
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
<script type="module" src="index.js"></script>
|
|
25
|
+
|
|
26
|
+
<!-- CAMERA HELPER 1. create spans for displaying camera position and lookAt vectors -->
|
|
27
|
+
<div id="camera-vectors">
|
|
28
|
+
<span>Free Camera Vectors:</span><br>
|
|
29
|
+
<span id="position"></span><br>
|
|
30
|
+
<span id="lookingAt"></span>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
</body>
|
|
34
|
+
</html>
|
package/index.js
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// Prepare a BPMN diagram
|
|
2
|
+
|
|
3
|
+
import { BpmnDiagram } from "./lib/notations/BpmnDiagram.js";
|
|
4
|
+
import * as dat from 'dat.gui';
|
|
5
|
+
|
|
6
|
+
var diagram = new BpmnDiagram(document.body);
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
// Set GUI
|
|
10
|
+
|
|
11
|
+
const gui = new dat.GUI();
|
|
12
|
+
const parameters =
|
|
13
|
+
{
|
|
14
|
+
mode: "VIEW",
|
|
15
|
+
toggleHelpers: function() { toggleHelpers() },
|
|
16
|
+
reset: function() { resetDiagram() },
|
|
17
|
+
export: function() { exportDiagram() },
|
|
18
|
+
import: function() { importDiagram() },
|
|
19
|
+
clear: function() { clearDiagram() }
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var diagramMode = gui.add( parameters, 'mode', [ "VIEW", "ANALYZE" ] ).name('Diagram mode').listen();
|
|
23
|
+
diagramMode.onChange(function(value)
|
|
24
|
+
{ setDiagramMode(); });
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
gui.add( parameters, 'toggleHelpers' ).name("Toggle Helpers");
|
|
28
|
+
gui.add( parameters, 'reset' ).name("Reset Diagram");
|
|
29
|
+
gui.add( parameters, 'export' ).name("Export Diagram");
|
|
30
|
+
gui.add( parameters, 'import' ).name("Import Diagram");
|
|
31
|
+
gui.add( parameters, 'clear' ).name("Clear Diagram");
|
|
32
|
+
gui.open();
|
|
33
|
+
|
|
34
|
+
function setDiagramMode() {
|
|
35
|
+
var value = parameters.mode;
|
|
36
|
+
diagram.setMode(value);
|
|
37
|
+
console.log(diagram);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function toggleHelpers() {
|
|
41
|
+
if (diagram.helpers) {
|
|
42
|
+
diagram.hideHelpers();
|
|
43
|
+
} else {
|
|
44
|
+
diagram.showHelpers();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function resetDiagram() {
|
|
49
|
+
parameters.mode = "VIEW";
|
|
50
|
+
diagram.reset();
|
|
51
|
+
console.log(diagram);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function importDiagram() {
|
|
55
|
+
console.log('Importing diagram');
|
|
56
|
+
const input = document.createElement('input');
|
|
57
|
+
input.type = 'file';
|
|
58
|
+
input.accept = '.bpmn';
|
|
59
|
+
input.onchange = (event) => {
|
|
60
|
+
const file = event.target.files[0];
|
|
61
|
+
if (file) {
|
|
62
|
+
console.log(file);
|
|
63
|
+
diagram.import(file);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
input.click();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function exportDiagram() {
|
|
70
|
+
diagram.export();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function clearDiagram() {
|
|
74
|
+
diagram.clear();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
// Add diagram elements
|
|
80
|
+
|
|
81
|
+
diagram.addStartEvent('e1');
|
|
82
|
+
|
|
83
|
+
diagram.addTask('a1')
|
|
84
|
+
.positionRightOf('e1')
|
|
85
|
+
.addWrappedText('Handle Quotations')
|
|
86
|
+
.connectFrom('e1', 'E', 'W')
|
|
87
|
+
.addValueBar(20);
|
|
88
|
+
|
|
89
|
+
diagram.addGateway('g1')
|
|
90
|
+
.positionRightOf('a1')
|
|
91
|
+
.connectFrom('a1', 'E', 'W');
|
|
92
|
+
|
|
93
|
+
diagram.addTask('a2')
|
|
94
|
+
.positionRightOf('g1')
|
|
95
|
+
.addWrappedText('Fill Order')
|
|
96
|
+
.addValueBar(35)
|
|
97
|
+
.connectFrom('g1', 'E', 'W');
|
|
98
|
+
|
|
99
|
+
diagram.addTask('a3')
|
|
100
|
+
.positionUpRightOf('a2')
|
|
101
|
+
.addWrappedText('Ship Order')
|
|
102
|
+
.addValueBar(30)
|
|
103
|
+
.connectFrom('a2', 'N', 'W');
|
|
104
|
+
|
|
105
|
+
diagram.addTask('a4')
|
|
106
|
+
.positionDownRightOf('a2')
|
|
107
|
+
.addWrappedText('Send Invoice')
|
|
108
|
+
.addValueBar(60)
|
|
109
|
+
.connectFrom('a2', 'S', 'W');
|
|
110
|
+
|
|
111
|
+
diagram.addTask('a5')
|
|
112
|
+
.positionRightOf('a4')
|
|
113
|
+
.addWrappedText('Make Payment')
|
|
114
|
+
.addValueBar(50)
|
|
115
|
+
.connectFrom('a4', 'E', 'W');
|
|
116
|
+
|
|
117
|
+
diagram.addTask('a6')
|
|
118
|
+
.positionRightOf('a5')
|
|
119
|
+
.addWrappedText('Accept Payment')
|
|
120
|
+
.addValueBar(30)
|
|
121
|
+
.connectFrom('a5', 'E', 'W');
|
|
122
|
+
|
|
123
|
+
diagram.addGateway('g2')
|
|
124
|
+
.positionUpRightOf('a6')
|
|
125
|
+
.connectFrom('a3', 'E', 'N')
|
|
126
|
+
.connectFrom('a6', 'E', 'S');
|
|
127
|
+
|
|
128
|
+
diagram.addUserTask('a7')
|
|
129
|
+
.positionRightOf('g2')
|
|
130
|
+
.addWrappedText('Close Order')
|
|
131
|
+
.addValueBar(30)
|
|
132
|
+
.connectFrom('g2', 'E', 'W');
|
|
133
|
+
|
|
134
|
+
diagram.addEndEvent('e2')
|
|
135
|
+
.positionRightOf('a7')
|
|
136
|
+
.connectFrom('a7', 'E', 'W');
|
|
137
|
+
|
|
138
|
+
// Non-standard connector
|
|
139
|
+
const waypoints = [
|
|
140
|
+
diagram.getElementById('g1').getNorthPoint(),
|
|
141
|
+
{ x: diagram.getElementById('g1').getNorthPoint().x,
|
|
142
|
+
y: diagram.getElementById('a3').getNorthPoint().y + BpmnDiagram.Dimensions.DISTANCE_BETWEEN_ELEMENTS },
|
|
143
|
+
{ x: diagram.getElementById('a7').getNorthPoint().x,
|
|
144
|
+
y: diagram.getElementById('a3').getNorthPoint().y + BpmnDiagram.Dimensions.DISTANCE_BETWEEN_ELEMENTS },
|
|
145
|
+
diagram.getElementById('a7').getNorthPoint()
|
|
146
|
+
];
|
|
147
|
+
diagram.addFlowConnector('f1', waypoints);
|
|
148
|
+
|
|
149
|
+
// End of diagram preparation
|
|
150
|
+
|
|
151
|
+
diagram.arrange();
|
|
152
|
+
diagram.fitScreen();
|
|
153
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { RoundedCornerOrthogonalConnectorShape } from '../shapes/connector/RoundedCornerOrthogonalConnectorShape.js';
|
|
3
|
+
|
|
4
|
+
class Connector extends THREE.Mesh {
|
|
5
|
+
constructor(elementId,
|
|
6
|
+
shape = new RoundedCornerOrthogonalConnectorShape(),
|
|
7
|
+
sourceElement = null,
|
|
8
|
+
targetElement = null,
|
|
9
|
+
sourcePoint = { x: 0, y: 0 },
|
|
10
|
+
targetPoint = { x: 2, y: 2 },
|
|
11
|
+
waypoints = [{ x: 0, y: 1 }, { x: 2, y: 1 }],
|
|
12
|
+
properties = {}) {
|
|
13
|
+
super(shape.geometry, shape.material);
|
|
14
|
+
this.elementId = elementId;
|
|
15
|
+
this.sourceElement = sourceElement;
|
|
16
|
+
this.targetElement = targetElement;
|
|
17
|
+
this.shape = shape;
|
|
18
|
+
this.points = [sourcePoint, ...waypoints, targetPoint];
|
|
19
|
+
this.properties = properties;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
setDiagram(diagram) {
|
|
23
|
+
this.diagram = diagram;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static determinePoints(sourcePoint, targetPoint, sourcePosition, targetPosition) { //TODO: rozbudować o sourcePosition i targetPosition (np. trzyelementowe konektory)
|
|
27
|
+
let waypoints = [];
|
|
28
|
+
|
|
29
|
+
if (sourcePoint.x !== targetPoint.x && sourcePoint.y !== targetPoint.y) {
|
|
30
|
+
// if source position starts with W or E then use the y coordinate of the source point
|
|
31
|
+
// and the x coordinate of the target point
|
|
32
|
+
if (sourcePosition.startsWith('W') || sourcePosition.startsWith('E')) {
|
|
33
|
+
waypoints.push({ x: targetPoint.x, y: sourcePoint.y });
|
|
34
|
+
}
|
|
35
|
+
// if source position starts with N or S then use the x coordinate of the source point
|
|
36
|
+
// and the y coordinate of the target point
|
|
37
|
+
if (sourcePosition.startsWith('N') || sourcePosition.startsWith('S')) {
|
|
38
|
+
waypoints.push({ x: sourcePoint.x, y: targetPoint.y });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return [sourcePoint, ...waypoints, targetPoint];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { Connector };
|