bpmn-js 11.1.1 → 11.2.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/README.md +0 -8
- package/dist/assets/bpmn-font/css/bpmn-codes.css +6 -6
- package/dist/assets/bpmn-font/css/bpmn-embedded.css +18 -13
- package/dist/assets/bpmn-font/css/bpmn.css +14 -15
- package/dist/assets/bpmn-font/font/bpmn.eot +0 -0
- package/dist/assets/bpmn-font/font/bpmn.svg +12 -12
- package/dist/assets/bpmn-font/font/bpmn.ttf +0 -0
- package/dist/assets/bpmn-font/font/bpmn.woff +0 -0
- package/dist/assets/bpmn-font/font/bpmn.woff2 +0 -0
- package/dist/assets/diagram-js.css +6 -3
- package/dist/bpmn-modeler.development.js +2520 -1152
- package/dist/bpmn-modeler.production.min.js +44 -42
- package/dist/bpmn-navigated-viewer.development.js +295 -212
- package/dist/bpmn-navigated-viewer.production.min.js +6 -6
- package/dist/bpmn-viewer.development.js +295 -212
- package/dist/bpmn-viewer.production.min.js +6 -6
- package/lib/Modeler.js +2 -0
- package/lib/draw/BpmnRenderer.js +185 -196
- package/lib/features/align-elements/dist/align-bottom-tool.svg +1 -0
- package/lib/features/align-elements/dist/align-horizontal-center-tool.svg +1 -0
- package/lib/features/align-elements/dist/align-left-tool.svg +1 -0
- package/lib/features/align-elements/dist/align-right-tool.svg +1 -0
- package/lib/features/align-elements/dist/align-tool.svg +1 -0
- package/lib/features/align-elements/dist/align-top-tool.svg +1 -0
- package/lib/features/align-elements/dist/align-vertical-center-tool.svg +1 -0
- package/lib/features/context-pad/ContextPadProvider.js +0 -1
- package/lib/features/create-append-anything/AppendContextPadProvider.js +77 -0
- package/lib/features/create-append-anything/AppendMenuProvider.js +175 -0
- package/lib/features/create-append-anything/AppendRules.js +83 -0
- package/lib/features/create-append-anything/CreateAppendEditorActions.js +51 -0
- package/lib/features/create-append-anything/CreateAppendKeyboardBindings.js +97 -0
- package/lib/features/create-append-anything/CreateMenuProvider.js +112 -0
- package/lib/features/create-append-anything/CreatePaletteProvider.js +77 -0
- package/lib/features/create-append-anything/index.js +37 -0
- package/lib/features/create-append-anything/util/OptionsUtil.js +612 -0
- package/lib/features/editor-actions/BpmnEditorActions.js +0 -1
- package/lib/features/modeling/ElementFactory.js +11 -0
- package/lib/features/palette/dist/create.svg +1 -0
- package/lib/features/popup-menu/ReplaceMenuProvider.js +7 -2
- package/lib/features/popup-menu/index.js +6 -3
- package/lib/icons/Icons.js +11 -0
- package/lib/icons/resources/append.svg +3 -0
- package/lib/icons/resources/create.svg +3 -0
- package/package.json +18 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* bpmn-js - bpmn-navigated-viewer v11.
|
|
2
|
+
* bpmn-js - bpmn-navigated-viewer v11.2.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2014-present, camunda Services GmbH
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Source Code: https://github.com/bpmn-io/bpmn-js
|
|
10
10
|
*
|
|
11
|
-
* Date: 2023-
|
|
11
|
+
* Date: 2023-02-03
|
|
12
12
|
*/
|
|
13
13
|
(function (global, factory) {
|
|
14
14
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -1336,34 +1336,128 @@
|
|
|
1336
1336
|
return transformList.consolidate();
|
|
1337
1337
|
}
|
|
1338
1338
|
|
|
1339
|
+
/**
|
|
1340
|
+
* @param { [ string, ...any[] ][] } elements
|
|
1341
|
+
*
|
|
1342
|
+
* @return { string }
|
|
1343
|
+
*/
|
|
1339
1344
|
function componentsToPath(elements) {
|
|
1340
|
-
return elements.join(',').replace(/,?([A-z]),?/g, '$1');
|
|
1345
|
+
return elements.flat().join(',').replace(/,?([A-z]),?/g, '$1');
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
function move(point) {
|
|
1349
|
+
return [ 'M', point.x, point.y ];
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
function lineTo(point) {
|
|
1353
|
+
return [ 'L', point.x, point.y ];
|
|
1341
1354
|
}
|
|
1342
1355
|
|
|
1343
|
-
function
|
|
1344
|
-
|
|
1356
|
+
function curveTo(p1, p2, p3) {
|
|
1357
|
+
return [ 'C', p1.x, p1.y, p2.x, p2.y, p3.x, p3.y ];
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
function drawPath(waypoints, cornerRadius) {
|
|
1361
|
+
const pointCount = waypoints.length;
|
|
1362
|
+
|
|
1363
|
+
const path = [ move(waypoints[0]) ];
|
|
1364
|
+
|
|
1365
|
+
for (let i = 1; i < pointCount; i++) {
|
|
1366
|
+
|
|
1367
|
+
const pointBefore = waypoints[i - 1];
|
|
1368
|
+
const point = waypoints[i];
|
|
1369
|
+
const pointAfter = waypoints[i + 1];
|
|
1370
|
+
|
|
1371
|
+
if (!pointAfter || !cornerRadius) {
|
|
1372
|
+
path.push(lineTo(point));
|
|
1345
1373
|
|
|
1346
|
-
|
|
1347
|
-
|
|
1374
|
+
continue;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
const effectiveRadius = Math.min(
|
|
1378
|
+
cornerRadius,
|
|
1379
|
+
vectorLength(point.x - pointBefore.x, point.y - pointBefore.y),
|
|
1380
|
+
vectorLength(pointAfter.x - point.x, pointAfter.y - point.y)
|
|
1381
|
+
);
|
|
1382
|
+
|
|
1383
|
+
if (!effectiveRadius) {
|
|
1384
|
+
path.push(lineTo(point));
|
|
1385
|
+
|
|
1386
|
+
continue;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
const beforePoint = getPointAtLength(point, pointBefore, effectiveRadius);
|
|
1390
|
+
const beforePoint2 = getPointAtLength(point, pointBefore, effectiveRadius * .5);
|
|
1391
|
+
|
|
1392
|
+
const afterPoint = getPointAtLength(point, pointAfter, effectiveRadius);
|
|
1393
|
+
const afterPoint2 = getPointAtLength(point, pointAfter, effectiveRadius * .5);
|
|
1394
|
+
|
|
1395
|
+
path.push(lineTo(beforePoint));
|
|
1396
|
+
path.push(curveTo(beforePoint2, afterPoint2, afterPoint));
|
|
1348
1397
|
}
|
|
1349
1398
|
|
|
1350
|
-
return
|
|
1399
|
+
return path;
|
|
1351
1400
|
}
|
|
1352
1401
|
|
|
1353
|
-
function
|
|
1402
|
+
function getPointAtLength(start, end, length) {
|
|
1354
1403
|
|
|
1355
|
-
|
|
1356
|
-
|
|
1404
|
+
const deltaX = end.x - start.x;
|
|
1405
|
+
const deltaY = end.y - start.y;
|
|
1357
1406
|
|
|
1358
|
-
|
|
1359
|
-
|
|
1407
|
+
const totalLength = vectorLength(deltaX, deltaY);
|
|
1408
|
+
|
|
1409
|
+
const percent = length / totalLength;
|
|
1410
|
+
|
|
1411
|
+
return {
|
|
1412
|
+
x: start.x + deltaX * percent,
|
|
1413
|
+
y: start.y + deltaY * percent
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
function vectorLength(x, y) {
|
|
1418
|
+
return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* @param { { x: number, y: number }[] } points
|
|
1423
|
+
* @param { any } [attrs]
|
|
1424
|
+
* @param { number } [radius]
|
|
1425
|
+
*
|
|
1426
|
+
* @return {SVGElement}
|
|
1427
|
+
*/
|
|
1428
|
+
function createLine(points, attrs, radius) {
|
|
1429
|
+
|
|
1430
|
+
if (isNumber(attrs)) {
|
|
1431
|
+
radius = attrs;
|
|
1432
|
+
attrs = null;
|
|
1360
1433
|
}
|
|
1361
1434
|
|
|
1362
|
-
|
|
1435
|
+
if (!attrs) {
|
|
1436
|
+
attrs = {};
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
const line = create$1('path', attrs);
|
|
1440
|
+
|
|
1441
|
+
if (isNumber(radius)) {
|
|
1442
|
+
line.dataset.cornerRadius = String(radius);
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
return updateLine(line, points);
|
|
1363
1446
|
}
|
|
1364
1447
|
|
|
1448
|
+
/**
|
|
1449
|
+
* @param { SVGElement } gfx
|
|
1450
|
+
* @param { { x: number, y: number }[]} points
|
|
1451
|
+
*
|
|
1452
|
+
* @return {SVGElement}
|
|
1453
|
+
*/
|
|
1365
1454
|
function updateLine(gfx, points) {
|
|
1366
|
-
|
|
1455
|
+
|
|
1456
|
+
const cornerRadius = parseInt(gfx.dataset.cornerRadius, 10) || 0;
|
|
1457
|
+
|
|
1458
|
+
attr$1(gfx, {
|
|
1459
|
+
d: componentsToPath(drawPath(points, cornerRadius))
|
|
1460
|
+
});
|
|
1367
1461
|
|
|
1368
1462
|
return gfx;
|
|
1369
1463
|
}
|
|
@@ -2299,33 +2393,33 @@
|
|
|
2299
2393
|
|
|
2300
2394
|
var markers = {};
|
|
2301
2395
|
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
function addMarker(id, options) {
|
|
2305
|
-
var attrs = assign$1({
|
|
2306
|
-
fill: black,
|
|
2307
|
-
strokeWidth: 1,
|
|
2396
|
+
function shapeStyle(attrs) {
|
|
2397
|
+
return styles.computeStyle(attrs, {
|
|
2308
2398
|
strokeLinecap: 'round',
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
// fix for safari / chrome / firefox bug not correctly
|
|
2317
|
-
// resetting stroke dash array
|
|
2318
|
-
if (attrs.strokeDasharray === 'none') {
|
|
2319
|
-
attrs.strokeDasharray = [ 10000, 1 ];
|
|
2320
|
-
}
|
|
2321
|
-
|
|
2322
|
-
var marker = create$1('marker');
|
|
2399
|
+
strokeLinejoin: 'round',
|
|
2400
|
+
stroke: black,
|
|
2401
|
+
strokeWidth: 2,
|
|
2402
|
+
fill: 'white'
|
|
2403
|
+
});
|
|
2404
|
+
}
|
|
2323
2405
|
|
|
2324
|
-
|
|
2406
|
+
function lineStyle(attrs) {
|
|
2407
|
+
return styles.computeStyle(attrs, [ 'no-fill' ], {
|
|
2408
|
+
strokeLinecap: 'round',
|
|
2409
|
+
strokeLinejoin: 'round',
|
|
2410
|
+
stroke: black,
|
|
2411
|
+
strokeWidth: 2
|
|
2412
|
+
});
|
|
2413
|
+
}
|
|
2325
2414
|
|
|
2326
|
-
|
|
2415
|
+
function addMarker(id, options) {
|
|
2416
|
+
var {
|
|
2417
|
+
ref = { x: 0, y: 0 },
|
|
2418
|
+
scale = 1,
|
|
2419
|
+
element
|
|
2420
|
+
} = options;
|
|
2327
2421
|
|
|
2328
|
-
|
|
2422
|
+
var marker = create$1('marker', {
|
|
2329
2423
|
id: id,
|
|
2330
2424
|
viewBox: '0 0 20 20',
|
|
2331
2425
|
refX: ref.x,
|
|
@@ -2335,6 +2429,8 @@
|
|
|
2335
2429
|
orient: 'auto'
|
|
2336
2430
|
});
|
|
2337
2431
|
|
|
2432
|
+
append(marker, element);
|
|
2433
|
+
|
|
2338
2434
|
var defs = query('defs', canvas._svg);
|
|
2339
2435
|
|
|
2340
2436
|
if (!defs) {
|
|
@@ -2367,105 +2463,116 @@
|
|
|
2367
2463
|
function createMarker(id, type, fill, stroke) {
|
|
2368
2464
|
|
|
2369
2465
|
if (type === 'sequenceflow-end') {
|
|
2370
|
-
var sequenceflowEnd = create$1('path'
|
|
2371
|
-
|
|
2466
|
+
var sequenceflowEnd = create$1('path', {
|
|
2467
|
+
d: 'M 1 5 L 11 10 L 1 15 Z',
|
|
2468
|
+
...shapeStyle({
|
|
2469
|
+
fill: stroke,
|
|
2470
|
+
stroke: stroke,
|
|
2471
|
+
strokeWidth: 1
|
|
2472
|
+
})
|
|
2473
|
+
});
|
|
2372
2474
|
|
|
2373
2475
|
addMarker(id, {
|
|
2374
2476
|
element: sequenceflowEnd,
|
|
2375
2477
|
ref: { x: 11, y: 10 },
|
|
2376
|
-
scale: 0.5
|
|
2377
|
-
attrs: {
|
|
2378
|
-
fill: stroke,
|
|
2379
|
-
stroke: stroke
|
|
2380
|
-
}
|
|
2478
|
+
scale: 0.5
|
|
2381
2479
|
});
|
|
2382
2480
|
}
|
|
2383
2481
|
|
|
2384
2482
|
if (type === 'messageflow-start') {
|
|
2385
|
-
var messageflowStart = create$1('circle'
|
|
2386
|
-
|
|
2483
|
+
var messageflowStart = create$1('circle', {
|
|
2484
|
+
cx: 6,
|
|
2485
|
+
cy: 6,
|
|
2486
|
+
r: 3.5,
|
|
2487
|
+
...shapeStyle({
|
|
2488
|
+
fill: fill,
|
|
2489
|
+
stroke: stroke,
|
|
2490
|
+
strokeWidth: 1
|
|
2491
|
+
})
|
|
2492
|
+
});
|
|
2387
2493
|
|
|
2388
2494
|
addMarker(id, {
|
|
2389
2495
|
element: messageflowStart,
|
|
2390
|
-
attrs: {
|
|
2391
|
-
fill: fill,
|
|
2392
|
-
stroke: stroke
|
|
2393
|
-
},
|
|
2394
2496
|
ref: { x: 6, y: 6 }
|
|
2395
2497
|
});
|
|
2396
2498
|
}
|
|
2397
2499
|
|
|
2398
2500
|
if (type === 'messageflow-end') {
|
|
2399
|
-
var messageflowEnd = create$1('path'
|
|
2400
|
-
|
|
2501
|
+
var messageflowEnd = create$1('path', {
|
|
2502
|
+
d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z',
|
|
2503
|
+
...shapeStyle({
|
|
2504
|
+
fill: fill,
|
|
2505
|
+
stroke: stroke,
|
|
2506
|
+
strokeWidth: 1
|
|
2507
|
+
})
|
|
2508
|
+
});
|
|
2401
2509
|
|
|
2402
2510
|
addMarker(id, {
|
|
2403
2511
|
element: messageflowEnd,
|
|
2404
|
-
attrs: {
|
|
2405
|
-
fill: fill,
|
|
2406
|
-
stroke: stroke,
|
|
2407
|
-
strokeLinecap: 'butt'
|
|
2408
|
-
},
|
|
2409
2512
|
ref: { x: 8.5, y: 5 }
|
|
2410
2513
|
});
|
|
2411
2514
|
}
|
|
2412
2515
|
|
|
2413
2516
|
if (type === 'association-start') {
|
|
2414
|
-
var associationStart = create$1('path'
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
addMarker(id, {
|
|
2418
|
-
element: associationStart,
|
|
2419
|
-
attrs: {
|
|
2517
|
+
var associationStart = create$1('path', {
|
|
2518
|
+
d: 'M 11 5 L 1 10 L 11 15',
|
|
2519
|
+
...lineStyle({
|
|
2420
2520
|
fill: 'none',
|
|
2421
2521
|
stroke: stroke,
|
|
2422
2522
|
strokeWidth: 1.5
|
|
2423
|
-
}
|
|
2523
|
+
})
|
|
2524
|
+
});
|
|
2525
|
+
|
|
2526
|
+
addMarker(id, {
|
|
2527
|
+
element: associationStart,
|
|
2424
2528
|
ref: { x: 1, y: 10 },
|
|
2425
2529
|
scale: 0.5
|
|
2426
2530
|
});
|
|
2427
2531
|
}
|
|
2428
2532
|
|
|
2429
2533
|
if (type === 'association-end') {
|
|
2430
|
-
var associationEnd = create$1('path'
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
addMarker(id, {
|
|
2434
|
-
element: associationEnd,
|
|
2435
|
-
attrs: {
|
|
2534
|
+
var associationEnd = create$1('path', {
|
|
2535
|
+
d: 'M 1 5 L 11 10 L 1 15',
|
|
2536
|
+
...lineStyle({
|
|
2436
2537
|
fill: 'none',
|
|
2437
2538
|
stroke: stroke,
|
|
2438
2539
|
strokeWidth: 1.5
|
|
2439
|
-
}
|
|
2440
|
-
|
|
2540
|
+
})
|
|
2541
|
+
});
|
|
2542
|
+
|
|
2543
|
+
addMarker(id, {
|
|
2544
|
+
element: associationEnd,
|
|
2545
|
+
ref: { x: 11, y: 10 },
|
|
2441
2546
|
scale: 0.5
|
|
2442
2547
|
});
|
|
2443
2548
|
}
|
|
2444
2549
|
|
|
2445
2550
|
if (type === 'conditional-flow-marker') {
|
|
2446
|
-
var
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
addMarker(id, {
|
|
2450
|
-
element: conditionalflowMarker,
|
|
2451
|
-
attrs: {
|
|
2551
|
+
var conditionalFlowMarker = create$1('path', {
|
|
2552
|
+
d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z',
|
|
2553
|
+
...shapeStyle({
|
|
2452
2554
|
fill: fill,
|
|
2453
2555
|
stroke: stroke
|
|
2454
|
-
}
|
|
2556
|
+
})
|
|
2557
|
+
});
|
|
2558
|
+
|
|
2559
|
+
addMarker(id, {
|
|
2560
|
+
element: conditionalFlowMarker,
|
|
2455
2561
|
ref: { x: -1, y: 10 },
|
|
2456
2562
|
scale: 0.5
|
|
2457
2563
|
});
|
|
2458
2564
|
}
|
|
2459
2565
|
|
|
2460
2566
|
if (type === 'conditional-default-flow-marker') {
|
|
2461
|
-
var
|
|
2462
|
-
|
|
2567
|
+
var defaultFlowMarker = create$1('path', {
|
|
2568
|
+
d: 'M 6 4 L 10 16',
|
|
2569
|
+
...shapeStyle({
|
|
2570
|
+
stroke: stroke
|
|
2571
|
+
})
|
|
2572
|
+
});
|
|
2463
2573
|
|
|
2464
2574
|
addMarker(id, {
|
|
2465
|
-
element:
|
|
2466
|
-
attrs: {
|
|
2467
|
-
stroke: stroke
|
|
2468
|
-
},
|
|
2575
|
+
element: defaultFlowMarker,
|
|
2469
2576
|
ref: { x: 0, y: 10 },
|
|
2470
2577
|
scale: 0.5
|
|
2471
2578
|
});
|
|
@@ -2481,11 +2588,7 @@
|
|
|
2481
2588
|
|
|
2482
2589
|
offset = offset || 0;
|
|
2483
2590
|
|
|
2484
|
-
attrs =
|
|
2485
|
-
stroke: black,
|
|
2486
|
-
strokeWidth: 2,
|
|
2487
|
-
fill: 'white'
|
|
2488
|
-
});
|
|
2591
|
+
attrs = shapeStyle(attrs);
|
|
2489
2592
|
|
|
2490
2593
|
if (attrs.fill === 'none') {
|
|
2491
2594
|
delete attrs.fillOpacity;
|
|
@@ -2494,13 +2597,12 @@
|
|
|
2494
2597
|
var cx = width / 2,
|
|
2495
2598
|
cy = height / 2;
|
|
2496
2599
|
|
|
2497
|
-
var circle = create$1('circle'
|
|
2498
|
-
attr$1(circle, {
|
|
2600
|
+
var circle = create$1('circle', {
|
|
2499
2601
|
cx: cx,
|
|
2500
2602
|
cy: cy,
|
|
2501
|
-
r: Math.round((width + height) / 4 - offset)
|
|
2603
|
+
r: Math.round((width + height) / 4 - offset),
|
|
2604
|
+
...attrs
|
|
2502
2605
|
});
|
|
2503
|
-
attr$1(circle, attrs);
|
|
2504
2606
|
|
|
2505
2607
|
append(parentGfx, circle);
|
|
2506
2608
|
|
|
@@ -2516,22 +2618,17 @@
|
|
|
2516
2618
|
|
|
2517
2619
|
offset = offset || 0;
|
|
2518
2620
|
|
|
2519
|
-
attrs =
|
|
2520
|
-
stroke: black,
|
|
2521
|
-
strokeWidth: 2,
|
|
2522
|
-
fill: 'white'
|
|
2523
|
-
});
|
|
2621
|
+
attrs = shapeStyle(attrs);
|
|
2524
2622
|
|
|
2525
|
-
var rect = create$1('rect'
|
|
2526
|
-
attr$1(rect, {
|
|
2623
|
+
var rect = create$1('rect', {
|
|
2527
2624
|
x: offset,
|
|
2528
2625
|
y: offset,
|
|
2529
2626
|
width: width - offset * 2,
|
|
2530
2627
|
height: height - offset * 2,
|
|
2531
2628
|
rx: r,
|
|
2532
|
-
ry: r
|
|
2629
|
+
ry: r,
|
|
2630
|
+
...attrs
|
|
2533
2631
|
});
|
|
2534
|
-
attr$1(rect, attrs);
|
|
2535
2632
|
|
|
2536
2633
|
append(parentGfx, rect);
|
|
2537
2634
|
|
|
@@ -2543,53 +2640,66 @@
|
|
|
2543
2640
|
var x_2 = width / 2;
|
|
2544
2641
|
var y_2 = height / 2;
|
|
2545
2642
|
|
|
2546
|
-
var points = [
|
|
2643
|
+
var points = [
|
|
2644
|
+
{ x: x_2, y: 0 },
|
|
2645
|
+
{ x: width, y: y_2 },
|
|
2646
|
+
{ x: x_2, y: height },
|
|
2647
|
+
{ x: 0, y: y_2 }
|
|
2648
|
+
];
|
|
2547
2649
|
|
|
2548
2650
|
var pointsString = points.map(function(point) {
|
|
2549
2651
|
return point.x + ',' + point.y;
|
|
2550
2652
|
}).join(' ');
|
|
2551
2653
|
|
|
2552
|
-
attrs =
|
|
2553
|
-
stroke: black,
|
|
2554
|
-
strokeWidth: 2,
|
|
2555
|
-
fill: 'white'
|
|
2556
|
-
});
|
|
2654
|
+
attrs = shapeStyle(attrs);
|
|
2557
2655
|
|
|
2558
|
-
var polygon = create$1('polygon'
|
|
2559
|
-
|
|
2656
|
+
var polygon = create$1('polygon', {
|
|
2657
|
+
...attrs,
|
|
2560
2658
|
points: pointsString
|
|
2561
2659
|
});
|
|
2562
|
-
attr$1(polygon, attrs);
|
|
2563
2660
|
|
|
2564
2661
|
append(parentGfx, polygon);
|
|
2565
2662
|
|
|
2566
2663
|
return polygon;
|
|
2567
2664
|
}
|
|
2568
2665
|
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2666
|
+
/**
|
|
2667
|
+
* @param {SVGElement} parentGfx
|
|
2668
|
+
* @param {Point[]} waypoints
|
|
2669
|
+
* @param {any} attrs
|
|
2670
|
+
* @param {number} [radius]
|
|
2671
|
+
*
|
|
2672
|
+
* @return {SVGElement}
|
|
2673
|
+
*/
|
|
2674
|
+
function drawLine(parentGfx, waypoints, attrs, radius) {
|
|
2675
|
+
attrs = lineStyle(attrs);
|
|
2575
2676
|
|
|
2576
|
-
var line = createLine(waypoints, attrs);
|
|
2677
|
+
var line = createLine(waypoints, attrs, radius);
|
|
2577
2678
|
|
|
2578
2679
|
append(parentGfx, line);
|
|
2579
2680
|
|
|
2580
2681
|
return line;
|
|
2581
2682
|
}
|
|
2582
2683
|
|
|
2684
|
+
/**
|
|
2685
|
+
* @param {SVGElement} parentGfx
|
|
2686
|
+
* @param {Point[]} waypoints
|
|
2687
|
+
* @param {any} attrs
|
|
2688
|
+
*
|
|
2689
|
+
* @return {SVGElement}
|
|
2690
|
+
*/
|
|
2691
|
+
function drawConnectionSegments(parentGfx, waypoints, attrs) {
|
|
2692
|
+
return drawLine(parentGfx, waypoints, attrs, 5);
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2583
2695
|
function drawPath(parentGfx, d, attrs) {
|
|
2584
2696
|
|
|
2585
|
-
attrs =
|
|
2586
|
-
strokeWidth: 2,
|
|
2587
|
-
stroke: black
|
|
2588
|
-
});
|
|
2697
|
+
attrs = lineStyle(attrs);
|
|
2589
2698
|
|
|
2590
|
-
var path = create$1('path'
|
|
2591
|
-
|
|
2592
|
-
|
|
2699
|
+
var path = create$1('path', {
|
|
2700
|
+
...attrs,
|
|
2701
|
+
d
|
|
2702
|
+
});
|
|
2593
2703
|
|
|
2594
2704
|
append(parentGfx, path);
|
|
2595
2705
|
|
|
@@ -2690,7 +2800,7 @@
|
|
|
2690
2800
|
return renderLabel(parentGfx, semantic.name, {
|
|
2691
2801
|
box: element,
|
|
2692
2802
|
align: align,
|
|
2693
|
-
padding:
|
|
2803
|
+
padding: 7,
|
|
2694
2804
|
style: {
|
|
2695
2805
|
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
2696
2806
|
}
|
|
@@ -2736,16 +2846,6 @@
|
|
|
2736
2846
|
transform(textBox, 0, -top, 270);
|
|
2737
2847
|
}
|
|
2738
2848
|
|
|
2739
|
-
function createPathFromConnection(connection) {
|
|
2740
|
-
var waypoints = connection.waypoints;
|
|
2741
|
-
|
|
2742
|
-
var pathData = 'm ' + waypoints[0].x + ',' + waypoints[0].y;
|
|
2743
|
-
for (var i = 1; i < waypoints.length; i++) {
|
|
2744
|
-
pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';
|
|
2745
|
-
}
|
|
2746
|
-
return pathData;
|
|
2747
|
-
}
|
|
2748
|
-
|
|
2749
2849
|
var handlers = this.handlers = {
|
|
2750
2850
|
'bpmn:Event': function(parentGfx, element, attrs) {
|
|
2751
2851
|
|
|
@@ -2766,7 +2866,6 @@
|
|
|
2766
2866
|
if (!semantic.isInterrupting) {
|
|
2767
2867
|
attrs = {
|
|
2768
2868
|
strokeDasharray: '6',
|
|
2769
|
-
strokeLinecap: 'round',
|
|
2770
2869
|
fill: getFillColor(element, defaultFillColor),
|
|
2771
2870
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
2772
2871
|
};
|
|
@@ -2821,7 +2920,6 @@
|
|
|
2821
2920
|
|
|
2822
2921
|
drawPath(parentGfx, pathData, {
|
|
2823
2922
|
strokeWidth: 2,
|
|
2824
|
-
strokeLinecap: 'square',
|
|
2825
2923
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
2826
2924
|
});
|
|
2827
2925
|
|
|
@@ -2843,7 +2941,6 @@
|
|
|
2843
2941
|
|
|
2844
2942
|
drawPath(parentGfx, linePathData, {
|
|
2845
2943
|
strokeWidth: 1,
|
|
2846
|
-
strokeLinecap: 'square',
|
|
2847
2944
|
transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')',
|
|
2848
2945
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
2849
2946
|
});
|
|
@@ -3051,14 +3148,14 @@
|
|
|
3051
3148
|
},
|
|
3052
3149
|
'bpmn:IntermediateEvent': function(parentGfx, element) {
|
|
3053
3150
|
var outer = renderer('bpmn:Event')(parentGfx, element, {
|
|
3054
|
-
strokeWidth: 1,
|
|
3151
|
+
strokeWidth: 1.5,
|
|
3055
3152
|
fill: getFillColor(element, defaultFillColor),
|
|
3056
3153
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3057
3154
|
});
|
|
3058
3155
|
|
|
3059
3156
|
/* inner */
|
|
3060
3157
|
drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, {
|
|
3061
|
-
strokeWidth: 1,
|
|
3158
|
+
strokeWidth: 1.5,
|
|
3062
3159
|
fill: getFillColor(element, 'none'),
|
|
3063
3160
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3064
3161
|
});
|
|
@@ -3311,10 +3408,11 @@
|
|
|
3311
3408
|
return task;
|
|
3312
3409
|
},
|
|
3313
3410
|
'bpmn:SubProcess': function(parentGfx, element, attrs) {
|
|
3314
|
-
attrs =
|
|
3411
|
+
attrs = {
|
|
3315
3412
|
fill: getFillColor(element, defaultFillColor),
|
|
3316
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3317
|
-
|
|
3413
|
+
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3414
|
+
...attrs
|
|
3415
|
+
};
|
|
3318
3416
|
|
|
3319
3417
|
var rect = renderer('bpmn:Activity')(parentGfx, element, attrs);
|
|
3320
3418
|
|
|
@@ -3322,7 +3420,8 @@
|
|
|
3322
3420
|
|
|
3323
3421
|
if (isEventSubProcess(element)) {
|
|
3324
3422
|
attr$1(rect, {
|
|
3325
|
-
strokeDasharray: '
|
|
3423
|
+
strokeDasharray: '0, 5.5',
|
|
3424
|
+
strokeWidth: 2.5
|
|
3326
3425
|
});
|
|
3327
3426
|
}
|
|
3328
3427
|
|
|
@@ -3340,13 +3439,14 @@
|
|
|
3340
3439
|
return renderer('bpmn:SubProcess')(parentGfx, element);
|
|
3341
3440
|
},
|
|
3342
3441
|
'bpmn:Transaction': function(parentGfx, element) {
|
|
3343
|
-
var outer = renderer('bpmn:SubProcess')(parentGfx, element);
|
|
3442
|
+
var outer = renderer('bpmn:SubProcess')(parentGfx, element, { strokeWidth: 1.5 });
|
|
3344
3443
|
|
|
3345
3444
|
var innerAttrs = styles.style([ 'no-fill', 'no-events' ], {
|
|
3346
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3445
|
+
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3446
|
+
strokeWidth: 1.5
|
|
3347
3447
|
});
|
|
3348
3448
|
|
|
3349
|
-
/* inner path */ drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS -
|
|
3449
|
+
/* inner path */ drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS - 3, INNER_OUTER_DIST, innerAttrs);
|
|
3350
3450
|
|
|
3351
3451
|
return outer;
|
|
3352
3452
|
},
|
|
@@ -3357,10 +3457,13 @@
|
|
|
3357
3457
|
},
|
|
3358
3458
|
'bpmn:Participant': function(parentGfx, element) {
|
|
3359
3459
|
|
|
3460
|
+
var strokeWidth = 1.5;
|
|
3461
|
+
|
|
3360
3462
|
var attrs = {
|
|
3361
3463
|
fillOpacity: DEFAULT_FILL_OPACITY,
|
|
3362
3464
|
fill: getFillColor(element, defaultFillColor),
|
|
3363
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3465
|
+
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3466
|
+
strokeWidth
|
|
3364
3467
|
};
|
|
3365
3468
|
|
|
3366
3469
|
var lane = renderer('bpmn:Lane')(parentGfx, element, attrs);
|
|
@@ -3372,13 +3475,14 @@
|
|
|
3372
3475
|
{ x: 30, y: 0 },
|
|
3373
3476
|
{ x: 30, y: element.height }
|
|
3374
3477
|
], {
|
|
3375
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3478
|
+
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3479
|
+
strokeWidth
|
|
3376
3480
|
});
|
|
3377
3481
|
var text = getSemantic(element).name;
|
|
3378
3482
|
renderLaneLabel(parentGfx, text, element);
|
|
3379
3483
|
} else {
|
|
3380
3484
|
|
|
3381
|
-
//
|
|
3485
|
+
// collapsed pool draw text inline
|
|
3382
3486
|
var text2 = getSemantic(element).name;
|
|
3383
3487
|
renderLabel(parentGfx, text2, {
|
|
3384
3488
|
box: element, align: 'center-middle',
|
|
@@ -3397,11 +3501,13 @@
|
|
|
3397
3501
|
return lane;
|
|
3398
3502
|
},
|
|
3399
3503
|
'bpmn:Lane': function(parentGfx, element, attrs) {
|
|
3400
|
-
var rect = drawRect(parentGfx, element.width, element.height, 0,
|
|
3504
|
+
var rect = drawRect(parentGfx, element.width, element.height, 0, {
|
|
3401
3505
|
fill: getFillColor(element, defaultFillColor),
|
|
3402
3506
|
fillOpacity: HIGH_FILL_OPACITY,
|
|
3403
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3404
|
-
|
|
3507
|
+
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3508
|
+
strokeWidth: 1.5,
|
|
3509
|
+
...attrs
|
|
3510
|
+
});
|
|
3405
3511
|
|
|
3406
3512
|
var semantic = getSemantic(element);
|
|
3407
3513
|
|
|
@@ -3520,13 +3626,11 @@
|
|
|
3520
3626
|
}
|
|
3521
3627
|
});
|
|
3522
3628
|
|
|
3523
|
-
|
|
3629
|
+
/* event path */ drawPath(parentGfx, pathData, {
|
|
3524
3630
|
strokeWidth: 2,
|
|
3525
3631
|
fill: getFillColor(element, 'none'),
|
|
3526
3632
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3527
|
-
};
|
|
3528
|
-
|
|
3529
|
-
/* event path */ drawPath(parentGfx, pathData, attrs);
|
|
3633
|
+
});
|
|
3530
3634
|
}
|
|
3531
3635
|
|
|
3532
3636
|
if (type === 'Parallel') {
|
|
@@ -3542,16 +3646,14 @@
|
|
|
3542
3646
|
}
|
|
3543
3647
|
});
|
|
3544
3648
|
|
|
3545
|
-
|
|
3546
|
-
attr$1(parallelPath, {
|
|
3649
|
+
drawPath(parentGfx, pathData, {
|
|
3547
3650
|
strokeWidth: 1,
|
|
3548
3651
|
fill: 'none'
|
|
3549
3652
|
});
|
|
3550
3653
|
} else if (type === 'Exclusive') {
|
|
3551
3654
|
|
|
3552
3655
|
if (!instantiate) {
|
|
3553
|
-
|
|
3554
|
-
attr$1(innerCircle, {
|
|
3656
|
+
drawCircle(parentGfx, element.width, element.height, element.height * 0.26, {
|
|
3555
3657
|
strokeWidth: 1,
|
|
3556
3658
|
fill: 'none',
|
|
3557
3659
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
@@ -3565,27 +3667,20 @@
|
|
|
3565
3667
|
return diamond;
|
|
3566
3668
|
},
|
|
3567
3669
|
'bpmn:Gateway': function(parentGfx, element) {
|
|
3568
|
-
|
|
3670
|
+
return drawDiamond(parentGfx, element.width, element.height, {
|
|
3569
3671
|
fill: getFillColor(element, defaultFillColor),
|
|
3570
3672
|
fillOpacity: DEFAULT_FILL_OPACITY,
|
|
3571
3673
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3572
|
-
};
|
|
3573
|
-
|
|
3574
|
-
return drawDiamond(parentGfx, element.width, element.height, attrs);
|
|
3674
|
+
});
|
|
3575
3675
|
},
|
|
3576
3676
|
'bpmn:SequenceFlow': function(parentGfx, element) {
|
|
3577
|
-
var pathData = createPathFromConnection(element);
|
|
3578
|
-
|
|
3579
3677
|
var fill = getFillColor(element, defaultFillColor),
|
|
3580
3678
|
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
3581
3679
|
|
|
3582
|
-
var
|
|
3583
|
-
strokeLinejoin: 'round',
|
|
3680
|
+
var path = drawConnectionSegments(parentGfx, element.waypoints, {
|
|
3584
3681
|
markerEnd: marker('sequenceflow-end', fill, stroke),
|
|
3585
3682
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3586
|
-
};
|
|
3587
|
-
|
|
3588
|
-
var path = drawPath(parentGfx, pathData, attrs);
|
|
3683
|
+
});
|
|
3589
3684
|
|
|
3590
3685
|
var sequenceFlow = getSemantic(element);
|
|
3591
3686
|
|
|
@@ -3619,12 +3714,11 @@
|
|
|
3619
3714
|
var fill = getFillColor(element, defaultFillColor),
|
|
3620
3715
|
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
3621
3716
|
|
|
3622
|
-
attrs =
|
|
3623
|
-
strokeDasharray: '0
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
}, attrs || {});
|
|
3717
|
+
attrs = {
|
|
3718
|
+
strokeDasharray: '0, 5',
|
|
3719
|
+
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3720
|
+
...attrs
|
|
3721
|
+
};
|
|
3628
3722
|
|
|
3629
3723
|
if (semantic.associationDirection === 'One' ||
|
|
3630
3724
|
semantic.associationDirection === 'Both') {
|
|
@@ -3635,7 +3729,7 @@
|
|
|
3635
3729
|
attrs.markerStart = marker('association-start', fill, stroke);
|
|
3636
3730
|
}
|
|
3637
3731
|
|
|
3638
|
-
return
|
|
3732
|
+
return drawConnectionSegments(parentGfx, element.waypoints, attrs);
|
|
3639
3733
|
},
|
|
3640
3734
|
'bpmn:DataInputAssociation': function(parentGfx, element) {
|
|
3641
3735
|
var fill = getFillColor(element, defaultFillColor),
|
|
@@ -3661,19 +3755,13 @@
|
|
|
3661
3755
|
var fill = getFillColor(element, defaultFillColor),
|
|
3662
3756
|
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
3663
3757
|
|
|
3664
|
-
var
|
|
3665
|
-
|
|
3666
|
-
var attrs = {
|
|
3758
|
+
var path = drawConnectionSegments(parentGfx, element.waypoints, {
|
|
3667
3759
|
markerEnd: marker('messageflow-end', fill, stroke),
|
|
3668
3760
|
markerStart: marker('messageflow-start', fill, stroke),
|
|
3669
|
-
strokeDasharray: '10,
|
|
3670
|
-
|
|
3671
|
-
strokeLinejoin: 'round',
|
|
3672
|
-
strokeWidth: '1.5px',
|
|
3761
|
+
strokeDasharray: '10, 11',
|
|
3762
|
+
strokeWidth: 1.5,
|
|
3673
3763
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3674
|
-
};
|
|
3675
|
-
|
|
3676
|
-
var path = drawPath(parentGfx, pathData, attrs);
|
|
3764
|
+
});
|
|
3677
3765
|
|
|
3678
3766
|
if (semantic.messageRef) {
|
|
3679
3767
|
var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
|
|
@@ -3796,25 +3884,26 @@
|
|
|
3796
3884
|
cancel = semantic.cancelActivity;
|
|
3797
3885
|
|
|
3798
3886
|
var attrs = {
|
|
3799
|
-
strokeWidth: 1,
|
|
3887
|
+
strokeWidth: 1.5,
|
|
3800
3888
|
fill: getFillColor(element, defaultFillColor),
|
|
3801
3889
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3802
3890
|
};
|
|
3803
3891
|
|
|
3804
3892
|
if (!cancel) {
|
|
3805
3893
|
attrs.strokeDasharray = '6';
|
|
3806
|
-
attrs.strokeLinecap = 'round';
|
|
3807
3894
|
}
|
|
3808
3895
|
|
|
3809
3896
|
// apply fillOpacity
|
|
3810
|
-
var outerAttrs =
|
|
3897
|
+
var outerAttrs = {
|
|
3898
|
+
...attrs,
|
|
3811
3899
|
fillOpacity: 1
|
|
3812
|
-
}
|
|
3900
|
+
};
|
|
3813
3901
|
|
|
3814
3902
|
// apply no-fill
|
|
3815
|
-
var innerAttrs =
|
|
3903
|
+
var innerAttrs = {
|
|
3904
|
+
...attrs,
|
|
3816
3905
|
fill: 'none'
|
|
3817
|
-
}
|
|
3906
|
+
};
|
|
3818
3907
|
|
|
3819
3908
|
var outer = renderer('bpmn:Event')(parentGfx, element, outerAttrs);
|
|
3820
3909
|
|
|
@@ -3825,27 +3914,22 @@
|
|
|
3825
3914
|
return outer;
|
|
3826
3915
|
},
|
|
3827
3916
|
'bpmn:Group': function(parentGfx, element) {
|
|
3828
|
-
|
|
3829
|
-
var group = drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, {
|
|
3917
|
+
return drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, {
|
|
3830
3918
|
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3831
|
-
strokeWidth: 1,
|
|
3832
|
-
strokeDasharray: '
|
|
3919
|
+
strokeWidth: 1.5,
|
|
3920
|
+
strokeDasharray: '10,6,0,6',
|
|
3833
3921
|
fill: 'none',
|
|
3834
3922
|
pointerEvents: 'none'
|
|
3835
3923
|
});
|
|
3836
|
-
|
|
3837
|
-
return group;
|
|
3838
3924
|
},
|
|
3839
3925
|
'label': function(parentGfx, element) {
|
|
3840
3926
|
return renderExternalLabel(parentGfx, element);
|
|
3841
3927
|
},
|
|
3842
3928
|
'bpmn:TextAnnotation': function(parentGfx, element) {
|
|
3843
|
-
var
|
|
3929
|
+
var textElement = drawRect(parentGfx, element.width, element.height, 0, 0, {
|
|
3844
3930
|
'fill': 'none',
|
|
3845
3931
|
'stroke': 'none'
|
|
3846
|
-
};
|
|
3847
|
-
|
|
3848
|
-
var textElement = drawRect(parentGfx, element.width, element.height, 0, 0, style);
|
|
3932
|
+
});
|
|
3849
3933
|
|
|
3850
3934
|
var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
|
|
3851
3935
|
xScaleFactor: 1,
|
|
@@ -3866,7 +3950,7 @@
|
|
|
3866
3950
|
renderLabel(parentGfx, text, {
|
|
3867
3951
|
box: element,
|
|
3868
3952
|
align: 'left-top',
|
|
3869
|
-
padding:
|
|
3953
|
+
padding: 7,
|
|
3870
3954
|
style: {
|
|
3871
3955
|
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
3872
3956
|
}
|
|
@@ -3984,10 +4068,9 @@
|
|
|
3984
4068
|
});
|
|
3985
4069
|
|
|
3986
4070
|
drawMarker('loop', parentGfx, markerPath, {
|
|
3987
|
-
strokeWidth: 1,
|
|
4071
|
+
strokeWidth: 1.5,
|
|
3988
4072
|
fill: getFillColor(element, defaultFillColor),
|
|
3989
4073
|
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3990
|
-
strokeLinecap: 'round',
|
|
3991
4074
|
strokeMiterlimit: 0.5
|
|
3992
4075
|
});
|
|
3993
4076
|
},
|
|
@@ -6411,7 +6494,7 @@
|
|
|
6411
6494
|
attr$1(outline, assign$1({
|
|
6412
6495
|
x: 10,
|
|
6413
6496
|
y: 10,
|
|
6414
|
-
rx:
|
|
6497
|
+
rx: 4,
|
|
6415
6498
|
width: 100,
|
|
6416
6499
|
height: 100
|
|
6417
6500
|
}, OUTLINE_STYLE));
|