camunda-bpmn-js 0.16.1 → 0.17.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.
@@ -108,6 +108,26 @@
108
108
  });
109
109
  return match;
110
110
  }
111
+ /**
112
+ * Find element index in collection.
113
+ *
114
+ * @param {Array|Object} collection
115
+ * @param {Function} matcher
116
+ *
117
+ * @return {Object}
118
+ */
119
+
120
+ function findIndex(collection, matcher) {
121
+ matcher = toMatcher(matcher);
122
+ var idx = isArray(collection) ? -1 : undefined;
123
+ forEach(collection, function (val, key) {
124
+ if (matcher(val, key)) {
125
+ idx = key;
126
+ return false;
127
+ }
128
+ });
129
+ return idx;
130
+ }
111
131
  /**
112
132
  * Find element in collection.
113
133
  *
@@ -1170,149 +1190,6 @@
1170
1190
  }
1171
1191
  }
1172
1192
 
1173
- /**
1174
- * Serialization util
1175
- */
1176
-
1177
- var TEXT_ENTITIES = /([&<>]{1})/g;
1178
- var ATTR_ENTITIES = /([\n\r"]{1})/g;
1179
-
1180
- var ENTITY_REPLACEMENT = {
1181
- '&': '&amp;',
1182
- '<': '&lt;',
1183
- '>': '&gt;',
1184
- '"': '\''
1185
- };
1186
-
1187
- function escape(str, pattern) {
1188
-
1189
- function replaceFn(match, entity) {
1190
- return ENTITY_REPLACEMENT[entity] || entity;
1191
- }
1192
-
1193
- return str.replace(pattern, replaceFn);
1194
- }
1195
-
1196
- function serialize(node, output) {
1197
-
1198
- var i, len, attrMap, attrNode, childNodes;
1199
-
1200
- switch (node.nodeType) {
1201
- // TEXT
1202
- case 3:
1203
- // replace special XML characters
1204
- output.push(escape(node.textContent, TEXT_ENTITIES));
1205
- break;
1206
-
1207
- // ELEMENT
1208
- case 1:
1209
- output.push('<', node.tagName);
1210
-
1211
- if (node.hasAttributes()) {
1212
- attrMap = node.attributes;
1213
- for (i = 0, len = attrMap.length; i < len; ++i) {
1214
- attrNode = attrMap.item(i);
1215
- output.push(' ', attrNode.name, '="', escape(attrNode.value, ATTR_ENTITIES), '"');
1216
- }
1217
- }
1218
-
1219
- if (node.hasChildNodes()) {
1220
- output.push('>');
1221
- childNodes = node.childNodes;
1222
- for (i = 0, len = childNodes.length; i < len; ++i) {
1223
- serialize(childNodes.item(i), output);
1224
- }
1225
- output.push('</', node.tagName, '>');
1226
- } else {
1227
- output.push('/>');
1228
- }
1229
- break;
1230
-
1231
- // COMMENT
1232
- case 8:
1233
- output.push('<!--', escape(node.nodeValue, TEXT_ENTITIES), '-->');
1234
- break;
1235
-
1236
- // CDATA
1237
- case 4:
1238
- output.push('<![CDATA[', node.nodeValue, ']]>');
1239
- break;
1240
-
1241
- default:
1242
- throw new Error('unable to handle node ' + node.nodeType);
1243
- }
1244
-
1245
- return output;
1246
- }
1247
-
1248
- /**
1249
- * innerHTML like functionality for SVG elements.
1250
- * based on innerSVG (https://code.google.com/p/innersvg)
1251
- */
1252
-
1253
-
1254
- function set(element, svg) {
1255
-
1256
- var parsed = parse(svg);
1257
-
1258
- // clear element contents
1259
- clear(element);
1260
-
1261
- if (!svg) {
1262
- return;
1263
- }
1264
-
1265
- if (!isFragment(parsed)) {
1266
- // extract <svg> from parsed document
1267
- parsed = parsed.documentElement;
1268
- }
1269
-
1270
- var nodes = slice(parsed.childNodes);
1271
-
1272
- // import + append each node
1273
- for (var i = 0; i < nodes.length; i++) {
1274
- appendTo(nodes[i], element);
1275
- }
1276
-
1277
- }
1278
-
1279
- function get(element) {
1280
- var child = element.firstChild,
1281
- output = [];
1282
-
1283
- while (child) {
1284
- serialize(child, output);
1285
- child = child.nextSibling;
1286
- }
1287
-
1288
- return output.join('');
1289
- }
1290
-
1291
- function isFragment(node) {
1292
- return node.nodeName === '#document-fragment';
1293
- }
1294
-
1295
- function innerSVG(element, svg) {
1296
-
1297
- if (svg !== undefined) {
1298
-
1299
- try {
1300
- set(element, svg);
1301
- } catch (e) {
1302
- throw new Error('error parsing SVG: ' + e.message);
1303
- }
1304
-
1305
- return element;
1306
- } else {
1307
- return get(element);
1308
- }
1309
- }
1310
-
1311
-
1312
- function slice(arr) {
1313
- return Array.prototype.slice.call(arr);
1314
- }
1315
-
1316
1193
  /**
1317
1194
  * transform accessor utility
1318
1195
  */
@@ -1463,11 +1340,11 @@
1463
1340
  radius = shape.width / 2;
1464
1341
 
1465
1342
  var circlePath = [
1466
- ['M', cx, cy],
1467
- ['m', 0, -radius],
1468
- ['a', radius, radius, 0, 1, 1, 0, 2 * radius],
1469
- ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
1470
- ['z']
1343
+ [ 'M', cx, cy ],
1344
+ [ 'm', 0, -radius ],
1345
+ [ 'a', radius, radius, 0, 1, 1, 0, 2 * radius ],
1346
+ [ 'a', radius, radius, 0, 1, 1, 0, -2 * radius ],
1347
+ [ 'z' ]
1471
1348
  ];
1472
1349
 
1473
1350
  return componentsToPath(circlePath);
@@ -1481,16 +1358,16 @@
1481
1358
  height = shape.height;
1482
1359
 
1483
1360
  var roundRectPath = [
1484
- ['M', x + borderRadius, y],
1485
- ['l', width - borderRadius * 2, 0],
1486
- ['a', borderRadius, borderRadius, 0, 0, 1, borderRadius, borderRadius],
1487
- ['l', 0, height - borderRadius * 2],
1488
- ['a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, borderRadius],
1489
- ['l', borderRadius * 2 - width, 0],
1490
- ['a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, -borderRadius],
1491
- ['l', 0, borderRadius * 2 - height],
1492
- ['a', borderRadius, borderRadius, 0, 0, 1, borderRadius, -borderRadius],
1493
- ['z']
1361
+ [ 'M', x + borderRadius, y ],
1362
+ [ 'l', width - borderRadius * 2, 0 ],
1363
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, borderRadius, borderRadius ],
1364
+ [ 'l', 0, height - borderRadius * 2 ],
1365
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, borderRadius ],
1366
+ [ 'l', borderRadius * 2 - width, 0 ],
1367
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, -borderRadius ],
1368
+ [ 'l', 0, borderRadius * 2 - height ],
1369
+ [ 'a', borderRadius, borderRadius, 0, 0, 1, borderRadius, -borderRadius ],
1370
+ [ 'z' ]
1494
1371
  ];
1495
1372
 
1496
1373
  return componentsToPath(roundRectPath);
@@ -1506,11 +1383,11 @@
1506
1383
  halfHeight = height / 2;
1507
1384
 
1508
1385
  var diamondPath = [
1509
- ['M', x + halfWidth, y],
1510
- ['l', halfWidth, halfHeight],
1511
- ['l', -halfWidth, halfHeight],
1512
- ['l', -halfWidth, -halfHeight],
1513
- ['z']
1386
+ [ 'M', x + halfWidth, y ],
1387
+ [ 'l', halfWidth, halfHeight ],
1388
+ [ 'l', -halfWidth, halfHeight ],
1389
+ [ 'l', -halfWidth, -halfHeight ],
1390
+ [ 'z' ]
1514
1391
  ];
1515
1392
 
1516
1393
  return componentsToPath(diamondPath);
@@ -1523,11 +1400,11 @@
1523
1400
  height = shape.height;
1524
1401
 
1525
1402
  var rectPath = [
1526
- ['M', x, y],
1527
- ['l', width, 0],
1528
- ['l', 0, height],
1529
- ['l', -width, 0],
1530
- ['z']
1403
+ [ 'M', x, y ],
1404
+ [ 'l', width, 0 ],
1405
+ [ 'l', 0, height ],
1406
+ [ 'l', -width, 0 ],
1407
+ [ 'z' ]
1531
1408
  ];
1532
1409
 
1533
1410
  return componentsToPath(rectPath);
@@ -2116,29 +1993,665 @@
2116
1993
  return el.removeChild(el.firstChild);
2117
1994
  }
2118
1995
 
2119
- // several elements
2120
- var fragment = doc.createDocumentFragment();
2121
- while (el.firstChild) {
2122
- fragment.appendChild(el.removeChild(el.firstChild));
1996
+ // several elements
1997
+ var fragment = doc.createDocumentFragment();
1998
+ while (el.firstChild) {
1999
+ fragment.appendChild(el.removeChild(el.firstChild));
2000
+ }
2001
+
2002
+ return fragment;
2003
+ }
2004
+
2005
+ function query(selector, el) {
2006
+ el = el || document;
2007
+
2008
+ return el.querySelector(selector);
2009
+ }
2010
+
2011
+ function all(selector, el) {
2012
+ el = el || document;
2013
+
2014
+ return el.querySelectorAll(selector);
2015
+ }
2016
+
2017
+ function remove$1(el) {
2018
+ el.parentNode && el.parentNode.removeChild(el);
2019
+ }
2020
+
2021
+ function ensureImported$1(element, target) {
2022
+
2023
+ if (element.ownerDocument !== target.ownerDocument) {
2024
+ try {
2025
+ // may fail on webkit
2026
+ return target.ownerDocument.importNode(element, true);
2027
+ } catch (e) {
2028
+ // ignore
2029
+ }
2030
+ }
2031
+
2032
+ return element;
2033
+ }
2034
+
2035
+ /**
2036
+ * appendTo utility
2037
+ */
2038
+
2039
+ /**
2040
+ * Append a node to a target element and return the appended node.
2041
+ *
2042
+ * @param {SVGElement} element
2043
+ * @param {SVGElement} target
2044
+ *
2045
+ * @return {SVGElement} the appended node
2046
+ */
2047
+ function appendTo$1(element, target) {
2048
+ return target.appendChild(ensureImported$1(element, target));
2049
+ }
2050
+
2051
+ /**
2052
+ * append utility
2053
+ */
2054
+
2055
+ /**
2056
+ * Append a node to an element
2057
+ *
2058
+ * @param {SVGElement} element
2059
+ * @param {SVGElement} node
2060
+ *
2061
+ * @return {SVGElement} the element
2062
+ */
2063
+ function append$1(target, node) {
2064
+ appendTo$1(node, target);
2065
+ return target;
2066
+ }
2067
+
2068
+ /**
2069
+ * attribute accessor utility
2070
+ */
2071
+
2072
+ var LENGTH_ATTR$1 = 2;
2073
+
2074
+ var CSS_PROPERTIES$1 = {
2075
+ 'alignment-baseline': 1,
2076
+ 'baseline-shift': 1,
2077
+ 'clip': 1,
2078
+ 'clip-path': 1,
2079
+ 'clip-rule': 1,
2080
+ 'color': 1,
2081
+ 'color-interpolation': 1,
2082
+ 'color-interpolation-filters': 1,
2083
+ 'color-profile': 1,
2084
+ 'color-rendering': 1,
2085
+ 'cursor': 1,
2086
+ 'direction': 1,
2087
+ 'display': 1,
2088
+ 'dominant-baseline': 1,
2089
+ 'enable-background': 1,
2090
+ 'fill': 1,
2091
+ 'fill-opacity': 1,
2092
+ 'fill-rule': 1,
2093
+ 'filter': 1,
2094
+ 'flood-color': 1,
2095
+ 'flood-opacity': 1,
2096
+ 'font': 1,
2097
+ 'font-family': 1,
2098
+ 'font-size': LENGTH_ATTR$1,
2099
+ 'font-size-adjust': 1,
2100
+ 'font-stretch': 1,
2101
+ 'font-style': 1,
2102
+ 'font-variant': 1,
2103
+ 'font-weight': 1,
2104
+ 'glyph-orientation-horizontal': 1,
2105
+ 'glyph-orientation-vertical': 1,
2106
+ 'image-rendering': 1,
2107
+ 'kerning': 1,
2108
+ 'letter-spacing': 1,
2109
+ 'lighting-color': 1,
2110
+ 'marker': 1,
2111
+ 'marker-end': 1,
2112
+ 'marker-mid': 1,
2113
+ 'marker-start': 1,
2114
+ 'mask': 1,
2115
+ 'opacity': 1,
2116
+ 'overflow': 1,
2117
+ 'pointer-events': 1,
2118
+ 'shape-rendering': 1,
2119
+ 'stop-color': 1,
2120
+ 'stop-opacity': 1,
2121
+ 'stroke': 1,
2122
+ 'stroke-dasharray': 1,
2123
+ 'stroke-dashoffset': 1,
2124
+ 'stroke-linecap': 1,
2125
+ 'stroke-linejoin': 1,
2126
+ 'stroke-miterlimit': 1,
2127
+ 'stroke-opacity': 1,
2128
+ 'stroke-width': LENGTH_ATTR$1,
2129
+ 'text-anchor': 1,
2130
+ 'text-decoration': 1,
2131
+ 'text-rendering': 1,
2132
+ 'unicode-bidi': 1,
2133
+ 'visibility': 1,
2134
+ 'word-spacing': 1,
2135
+ 'writing-mode': 1
2136
+ };
2137
+
2138
+
2139
+ function getAttribute$1(node, name) {
2140
+ if (CSS_PROPERTIES$1[name]) {
2141
+ return node.style[name];
2142
+ } else {
2143
+ return node.getAttributeNS(null, name);
2144
+ }
2145
+ }
2146
+
2147
+ function setAttribute$1(node, name, value) {
2148
+ var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
2149
+
2150
+ var type = CSS_PROPERTIES$1[hyphenated];
2151
+
2152
+ if (type) {
2153
+ // append pixel unit, unless present
2154
+ if (type === LENGTH_ATTR$1 && typeof value === 'number') {
2155
+ value = String(value) + 'px';
2156
+ }
2157
+
2158
+ node.style[hyphenated] = value;
2159
+ } else {
2160
+ node.setAttributeNS(null, name, value);
2161
+ }
2162
+ }
2163
+
2164
+ function setAttributes$1(node, attrs) {
2165
+
2166
+ var names = Object.keys(attrs), i, name;
2167
+
2168
+ for (i = 0, name; (name = names[i]); i++) {
2169
+ setAttribute$1(node, name, attrs[name]);
2170
+ }
2171
+ }
2172
+
2173
+ /**
2174
+ * Gets or sets raw attributes on a node.
2175
+ *
2176
+ * @param {SVGElement} node
2177
+ * @param {Object} [attrs]
2178
+ * @param {String} [name]
2179
+ * @param {String} [value]
2180
+ *
2181
+ * @return {String}
2182
+ */
2183
+ function attr$2(node, name, value) {
2184
+ if (typeof name === 'string') {
2185
+ if (value !== undefined) {
2186
+ setAttribute$1(node, name, value);
2187
+ } else {
2188
+ return getAttribute$1(node, name);
2189
+ }
2190
+ } else {
2191
+ setAttributes$1(node, name);
2192
+ }
2193
+
2194
+ return node;
2195
+ }
2196
+
2197
+ /**
2198
+ * Clear utility
2199
+ */
2200
+ function index$1(arr, obj) {
2201
+ if (arr.indexOf) {
2202
+ return arr.indexOf(obj);
2203
+ }
2204
+
2205
+
2206
+ for (var i = 0; i < arr.length; ++i) {
2207
+ if (arr[i] === obj) {
2208
+ return i;
2209
+ }
2210
+ }
2211
+
2212
+ return -1;
2213
+ }
2214
+
2215
+ var re$2 = /\s+/;
2216
+
2217
+ var toString$2 = Object.prototype.toString;
2218
+
2219
+ function defined$1(o) {
2220
+ return typeof o !== 'undefined';
2221
+ }
2222
+
2223
+ /**
2224
+ * Wrap `el` in a `ClassList`.
2225
+ *
2226
+ * @param {Element} el
2227
+ * @return {ClassList}
2228
+ * @api public
2229
+ */
2230
+
2231
+ function classes$2(el) {
2232
+ return new ClassList$2(el);
2233
+ }
2234
+
2235
+ function ClassList$2(el) {
2236
+ if (!el || !el.nodeType) {
2237
+ throw new Error('A DOM element reference is required');
2238
+ }
2239
+ this.el = el;
2240
+ this.list = el.classList;
2241
+ }
2242
+
2243
+ /**
2244
+ * Add class `name` if not already present.
2245
+ *
2246
+ * @param {String} name
2247
+ * @return {ClassList}
2248
+ * @api public
2249
+ */
2250
+
2251
+ ClassList$2.prototype.add = function(name) {
2252
+
2253
+ // classList
2254
+ if (this.list) {
2255
+ this.list.add(name);
2256
+ return this;
2257
+ }
2258
+
2259
+ // fallback
2260
+ var arr = this.array();
2261
+ var i = index$1(arr, name);
2262
+ if (!~i) {
2263
+ arr.push(name);
2264
+ }
2265
+
2266
+ if (defined$1(this.el.className.baseVal)) {
2267
+ this.el.className.baseVal = arr.join(' ');
2268
+ } else {
2269
+ this.el.className = arr.join(' ');
2270
+ }
2271
+
2272
+ return this;
2273
+ };
2274
+
2275
+ /**
2276
+ * Remove class `name` when present, or
2277
+ * pass a regular expression to remove
2278
+ * any which match.
2279
+ *
2280
+ * @param {String|RegExp} name
2281
+ * @return {ClassList}
2282
+ * @api public
2283
+ */
2284
+
2285
+ ClassList$2.prototype.remove = function(name) {
2286
+ if ('[object RegExp]' === toString$2.call(name)) {
2287
+ return this.removeMatching(name);
2288
+ }
2289
+
2290
+ // classList
2291
+ if (this.list) {
2292
+ this.list.remove(name);
2293
+ return this;
2294
+ }
2295
+
2296
+ // fallback
2297
+ var arr = this.array();
2298
+ var i = index$1(arr, name);
2299
+ if (~i) {
2300
+ arr.splice(i, 1);
2301
+ }
2302
+ this.el.className.baseVal = arr.join(' ');
2303
+ return this;
2304
+ };
2305
+
2306
+ /**
2307
+ * Remove all classes matching `re`.
2308
+ *
2309
+ * @param {RegExp} re
2310
+ * @return {ClassList}
2311
+ * @api private
2312
+ */
2313
+
2314
+ ClassList$2.prototype.removeMatching = function(re) {
2315
+ var arr = this.array();
2316
+ for (var i = 0; i < arr.length; i++) {
2317
+ if (re.test(arr[i])) {
2318
+ this.remove(arr[i]);
2319
+ }
2320
+ }
2321
+ return this;
2322
+ };
2323
+
2324
+ /**
2325
+ * Toggle class `name`, can force state via `force`.
2326
+ *
2327
+ * For browsers that support classList, but do not support `force` yet,
2328
+ * the mistake will be detected and corrected.
2329
+ *
2330
+ * @param {String} name
2331
+ * @param {Boolean} force
2332
+ * @return {ClassList}
2333
+ * @api public
2334
+ */
2335
+
2336
+ ClassList$2.prototype.toggle = function(name, force) {
2337
+ // classList
2338
+ if (this.list) {
2339
+ if (defined$1(force)) {
2340
+ if (force !== this.list.toggle(name, force)) {
2341
+ this.list.toggle(name); // toggle again to correct
2342
+ }
2343
+ } else {
2344
+ this.list.toggle(name);
2345
+ }
2346
+ return this;
2347
+ }
2348
+
2349
+ // fallback
2350
+ if (defined$1(force)) {
2351
+ if (!force) {
2352
+ this.remove(name);
2353
+ } else {
2354
+ this.add(name);
2355
+ }
2356
+ } else {
2357
+ if (this.has(name)) {
2358
+ this.remove(name);
2359
+ } else {
2360
+ this.add(name);
2361
+ }
2362
+ }
2363
+
2364
+ return this;
2365
+ };
2366
+
2367
+ /**
2368
+ * Return an array of classes.
2369
+ *
2370
+ * @return {Array}
2371
+ * @api public
2372
+ */
2373
+
2374
+ ClassList$2.prototype.array = function() {
2375
+ var className = this.el.getAttribute('class') || '';
2376
+ var str = className.replace(/^\s+|\s+$/g, '');
2377
+ var arr = str.split(re$2);
2378
+ if ('' === arr[0]) {
2379
+ arr.shift();
2380
+ }
2381
+ return arr;
2382
+ };
2383
+
2384
+ /**
2385
+ * Check if class `name` is present.
2386
+ *
2387
+ * @param {String} name
2388
+ * @return {ClassList}
2389
+ * @api public
2390
+ */
2391
+
2392
+ ClassList$2.prototype.has =
2393
+ ClassList$2.prototype.contains = function(name) {
2394
+ return (
2395
+ this.list ?
2396
+ this.list.contains(name) :
2397
+ !! ~index$1(this.array(), name)
2398
+ );
2399
+ };
2400
+
2401
+ function remove$2(element) {
2402
+ var parent = element.parentNode;
2403
+
2404
+ if (parent) {
2405
+ parent.removeChild(element);
2406
+ }
2407
+
2408
+ return element;
2409
+ }
2410
+
2411
+ /**
2412
+ * Clear utility
2413
+ */
2414
+
2415
+ /**
2416
+ * Removes all children from the given element
2417
+ *
2418
+ * @param {DOMElement} element
2419
+ * @return {DOMElement} the element (for chaining)
2420
+ */
2421
+ function clear$2(element) {
2422
+ var child;
2423
+
2424
+ while ((child = element.firstChild)) {
2425
+ remove$2(child);
2426
+ }
2427
+
2428
+ return element;
2429
+ }
2430
+
2431
+ var ns$1 = {
2432
+ svg: 'http://www.w3.org/2000/svg'
2433
+ };
2434
+
2435
+ /**
2436
+ * DOM parsing utility
2437
+ */
2438
+
2439
+ var SVG_START$1 = '<svg xmlns="' + ns$1.svg + '"';
2440
+
2441
+ function parse$2(svg) {
2442
+
2443
+ var unwrap = false;
2444
+
2445
+ // ensure we import a valid svg document
2446
+ if (svg.substring(0, 4) === '<svg') {
2447
+ if (svg.indexOf(ns$1.svg) === -1) {
2448
+ svg = SVG_START$1 + svg.substring(4);
2449
+ }
2450
+ } else {
2451
+ // namespace svg
2452
+ svg = SVG_START$1 + '>' + svg + '</svg>';
2453
+ unwrap = true;
2454
+ }
2455
+
2456
+ var parsed = parseDocument$1(svg);
2457
+
2458
+ if (!unwrap) {
2459
+ return parsed;
2460
+ }
2461
+
2462
+ var fragment = document.createDocumentFragment();
2463
+
2464
+ var parent = parsed.firstChild;
2465
+
2466
+ while (parent.firstChild) {
2467
+ fragment.appendChild(parent.firstChild);
2468
+ }
2469
+
2470
+ return fragment;
2471
+ }
2472
+
2473
+ function parseDocument$1(svg) {
2474
+
2475
+ var parser;
2476
+
2477
+ // parse
2478
+ parser = new DOMParser();
2479
+ parser.async = false;
2480
+
2481
+ return parser.parseFromString(svg, 'text/xml');
2482
+ }
2483
+
2484
+ /**
2485
+ * Create utility for SVG elements
2486
+ */
2487
+
2488
+
2489
+ /**
2490
+ * Create a specific type from name or SVG markup.
2491
+ *
2492
+ * @param {String} name the name or markup of the element
2493
+ * @param {Object} [attrs] attributes to set on the element
2494
+ *
2495
+ * @returns {SVGElement}
2496
+ */
2497
+ function create$1(name, attrs) {
2498
+ var element;
2499
+
2500
+ if (name.charAt(0) === '<') {
2501
+ element = parse$2(name).firstChild;
2502
+ element = document.importNode(element, true);
2503
+ } else {
2504
+ element = document.createElementNS(ns$1.svg, name);
2505
+ }
2506
+
2507
+ if (attrs) {
2508
+ attr$2(element, attrs);
2509
+ }
2510
+
2511
+ return element;
2512
+ }
2513
+
2514
+ /**
2515
+ * Serialization util
2516
+ */
2517
+
2518
+ var TEXT_ENTITIES = /([&<>]{1})/g;
2519
+ var ATTR_ENTITIES = /([\n\r"]{1})/g;
2520
+
2521
+ var ENTITY_REPLACEMENT = {
2522
+ '&': '&amp;',
2523
+ '<': '&lt;',
2524
+ '>': '&gt;',
2525
+ '"': '\''
2526
+ };
2527
+
2528
+ function escape(str, pattern) {
2529
+
2530
+ function replaceFn(match, entity) {
2531
+ return ENTITY_REPLACEMENT[entity] || entity;
2532
+ }
2533
+
2534
+ return str.replace(pattern, replaceFn);
2535
+ }
2536
+
2537
+ function serialize(node, output) {
2538
+
2539
+ var i, len, attrMap, attrNode, childNodes;
2540
+
2541
+ switch (node.nodeType) {
2542
+ // TEXT
2543
+ case 3:
2544
+ // replace special XML characters
2545
+ output.push(escape(node.textContent, TEXT_ENTITIES));
2546
+ break;
2547
+
2548
+ // ELEMENT
2549
+ case 1:
2550
+ output.push('<', node.tagName);
2551
+
2552
+ if (node.hasAttributes()) {
2553
+ attrMap = node.attributes;
2554
+ for (i = 0, len = attrMap.length; i < len; ++i) {
2555
+ attrNode = attrMap.item(i);
2556
+ output.push(' ', attrNode.name, '="', escape(attrNode.value, ATTR_ENTITIES), '"');
2557
+ }
2558
+ }
2559
+
2560
+ if (node.hasChildNodes()) {
2561
+ output.push('>');
2562
+ childNodes = node.childNodes;
2563
+ for (i = 0, len = childNodes.length; i < len; ++i) {
2564
+ serialize(childNodes.item(i), output);
2565
+ }
2566
+ output.push('</', node.tagName, '>');
2567
+ } else {
2568
+ output.push('/>');
2569
+ }
2570
+ break;
2571
+
2572
+ // COMMENT
2573
+ case 8:
2574
+ output.push('<!--', escape(node.nodeValue, TEXT_ENTITIES), '-->');
2575
+ break;
2576
+
2577
+ // CDATA
2578
+ case 4:
2579
+ output.push('<![CDATA[', node.nodeValue, ']]>');
2580
+ break;
2581
+
2582
+ default:
2583
+ throw new Error('unable to handle node ' + node.nodeType);
2584
+ }
2585
+
2586
+ return output;
2587
+ }
2588
+
2589
+ /**
2590
+ * innerHTML like functionality for SVG elements.
2591
+ * based on innerSVG (https://code.google.com/p/innersvg)
2592
+ */
2593
+
2594
+
2595
+ function set(element, svg) {
2596
+
2597
+ var parsed = parse$2(svg);
2598
+
2599
+ // clear element contents
2600
+ clear$2(element);
2601
+
2602
+ if (!svg) {
2603
+ return;
2604
+ }
2605
+
2606
+ if (!isFragment(parsed)) {
2607
+ // extract <svg> from parsed document
2608
+ parsed = parsed.documentElement;
2609
+ }
2610
+
2611
+ var nodes = slice(parsed.childNodes);
2612
+
2613
+ // import + append each node
2614
+ for (var i = 0; i < nodes.length; i++) {
2615
+ appendTo$1(nodes[i], element);
2123
2616
  }
2124
2617
 
2125
- return fragment;
2126
2618
  }
2127
2619
 
2128
- function query(selector, el) {
2129
- el = el || document;
2620
+ function get(element) {
2621
+ var child = element.firstChild,
2622
+ output = [];
2130
2623
 
2131
- return el.querySelector(selector);
2624
+ while (child) {
2625
+ serialize(child, output);
2626
+ child = child.nextSibling;
2627
+ }
2628
+
2629
+ return output.join('');
2132
2630
  }
2133
2631
 
2134
- function all(selector, el) {
2135
- el = el || document;
2632
+ function isFragment(node) {
2633
+ return node.nodeName === '#document-fragment';
2634
+ }
2136
2635
 
2137
- return el.querySelectorAll(selector);
2636
+ function innerSVG(element, svg) {
2637
+
2638
+ if (svg !== undefined) {
2639
+
2640
+ try {
2641
+ set(element, svg);
2642
+ } catch (e) {
2643
+ throw new Error('error parsing SVG: ' + e.message);
2644
+ }
2645
+
2646
+ return element;
2647
+ } else {
2648
+ return get(element);
2649
+ }
2138
2650
  }
2139
2651
 
2140
- function remove$1(el) {
2141
- el.parentNode && el.parentNode.removeChild(el);
2652
+
2653
+ function slice(arr) {
2654
+ return Array.prototype.slice.call(arr);
2142
2655
  }
2143
2656
 
2144
2657
  /**
@@ -2390,16 +2903,16 @@
2390
2903
  // fix for safari / chrome / firefox bug not correctly
2391
2904
  // resetting stroke dash array
2392
2905
  if (attrs.strokeDasharray === 'none') {
2393
- attrs.strokeDasharray = [10000, 1];
2906
+ attrs.strokeDasharray = [ 10000, 1 ];
2394
2907
  }
2395
2908
 
2396
- var marker = create('marker');
2909
+ var marker = create$1('marker');
2397
2910
 
2398
- attr(options.element, attrs);
2911
+ attr$2(options.element, attrs);
2399
2912
 
2400
- append(marker, options.element);
2913
+ append$1(marker, options.element);
2401
2914
 
2402
- attr(marker, {
2915
+ attr$2(marker, {
2403
2916
  id: id,
2404
2917
  viewBox: '0 0 20 20',
2405
2918
  refX: ref.x,
@@ -2412,12 +2925,12 @@
2412
2925
  var defs = query('defs', canvas._svg);
2413
2926
 
2414
2927
  if (!defs) {
2415
- defs = create('defs');
2928
+ defs = create$1('defs');
2416
2929
 
2417
- append(canvas._svg, defs);
2930
+ append$1(canvas._svg, defs);
2418
2931
  }
2419
2932
 
2420
- append(defs, marker);
2933
+ append$1(defs, marker);
2421
2934
 
2422
2935
  markers[id] = marker;
2423
2936
  }
@@ -2441,8 +2954,8 @@
2441
2954
  function createMarker(id, type, fill, stroke) {
2442
2955
 
2443
2956
  if (type === 'sequenceflow-end') {
2444
- var sequenceflowEnd = create('path');
2445
- attr(sequenceflowEnd, { d: 'M 1 5 L 11 10 L 1 15 Z' });
2957
+ var sequenceflowEnd = create$1('path');
2958
+ attr$2(sequenceflowEnd, { d: 'M 1 5 L 11 10 L 1 15 Z' });
2446
2959
 
2447
2960
  addMarker(id, {
2448
2961
  element: sequenceflowEnd,
@@ -2456,8 +2969,8 @@
2456
2969
  }
2457
2970
 
2458
2971
  if (type === 'messageflow-start') {
2459
- var messageflowStart = create('circle');
2460
- attr(messageflowStart, { cx: 6, cy: 6, r: 3.5 });
2972
+ var messageflowStart = create$1('circle');
2973
+ attr$2(messageflowStart, { cx: 6, cy: 6, r: 3.5 });
2461
2974
 
2462
2975
  addMarker(id, {
2463
2976
  element: messageflowStart,
@@ -2470,8 +2983,8 @@
2470
2983
  }
2471
2984
 
2472
2985
  if (type === 'messageflow-end') {
2473
- var messageflowEnd = create('path');
2474
- attr(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
2986
+ var messageflowEnd = create$1('path');
2987
+ attr$2(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
2475
2988
 
2476
2989
  addMarker(id, {
2477
2990
  element: messageflowEnd,
@@ -2485,8 +2998,8 @@
2485
2998
  }
2486
2999
 
2487
3000
  if (type === 'association-start') {
2488
- var associationStart = create('path');
2489
- attr(associationStart, { d: 'M 11 5 L 1 10 L 11 15' });
3001
+ var associationStart = create$1('path');
3002
+ attr$2(associationStart, { d: 'M 11 5 L 1 10 L 11 15' });
2490
3003
 
2491
3004
  addMarker(id, {
2492
3005
  element: associationStart,
@@ -2501,8 +3014,8 @@
2501
3014
  }
2502
3015
 
2503
3016
  if (type === 'association-end') {
2504
- var associationEnd = create('path');
2505
- attr(associationEnd, { d: 'M 1 5 L 11 10 L 1 15' });
3017
+ var associationEnd = create$1('path');
3018
+ attr$2(associationEnd, { d: 'M 1 5 L 11 10 L 1 15' });
2506
3019
 
2507
3020
  addMarker(id, {
2508
3021
  element: associationEnd,
@@ -2517,8 +3030,8 @@
2517
3030
  }
2518
3031
 
2519
3032
  if (type === 'conditional-flow-marker') {
2520
- var conditionalflowMarker = create('path');
2521
- attr(conditionalflowMarker, { d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z' });
3033
+ var conditionalflowMarker = create$1('path');
3034
+ attr$2(conditionalflowMarker, { d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z' });
2522
3035
 
2523
3036
  addMarker(id, {
2524
3037
  element: conditionalflowMarker,
@@ -2532,8 +3045,8 @@
2532
3045
  }
2533
3046
 
2534
3047
  if (type === 'conditional-default-flow-marker') {
2535
- var conditionaldefaultflowMarker = create('path');
2536
- attr(conditionaldefaultflowMarker, { d: 'M 6 4 L 10 16' });
3048
+ var conditionaldefaultflowMarker = create$1('path');
3049
+ attr$2(conditionaldefaultflowMarker, { d: 'M 6 4 L 10 16' });
2537
3050
 
2538
3051
  addMarker(id, {
2539
3052
  element: conditionaldefaultflowMarker,
@@ -2568,15 +3081,15 @@
2568
3081
  var cx = width / 2,
2569
3082
  cy = height / 2;
2570
3083
 
2571
- var circle = create('circle');
2572
- attr(circle, {
3084
+ var circle = create$1('circle');
3085
+ attr$2(circle, {
2573
3086
  cx: cx,
2574
3087
  cy: cy,
2575
3088
  r: Math.round((width + height) / 4 - offset)
2576
3089
  });
2577
- attr(circle, attrs);
3090
+ attr$2(circle, attrs);
2578
3091
 
2579
- append(parentGfx, circle);
3092
+ append$1(parentGfx, circle);
2580
3093
 
2581
3094
  return circle;
2582
3095
  }
@@ -2596,8 +3109,8 @@
2596
3109
  fill: 'white'
2597
3110
  });
2598
3111
 
2599
- var rect = create('rect');
2600
- attr(rect, {
3112
+ var rect = create$1('rect');
3113
+ attr$2(rect, {
2601
3114
  x: offset,
2602
3115
  y: offset,
2603
3116
  width: width - offset * 2,
@@ -2605,9 +3118,9 @@
2605
3118
  rx: r,
2606
3119
  ry: r
2607
3120
  });
2608
- attr(rect, attrs);
3121
+ attr$2(rect, attrs);
2609
3122
 
2610
- append(parentGfx, rect);
3123
+ append$1(parentGfx, rect);
2611
3124
 
2612
3125
  return rect;
2613
3126
  }
@@ -2617,7 +3130,7 @@
2617
3130
  var x_2 = width / 2;
2618
3131
  var y_2 = height / 2;
2619
3132
 
2620
- var points = [{ x: x_2, y: 0 }, { x: width, y: y_2 }, { x: x_2, y: height }, { x: 0, y: y_2 }];
3133
+ var points = [ { x: x_2, y: 0 }, { x: width, y: y_2 }, { x: x_2, y: height }, { x: 0, y: y_2 } ];
2621
3134
 
2622
3135
  var pointsString = points.map(function(point) {
2623
3136
  return point.x + ',' + point.y;
@@ -2629,13 +3142,13 @@
2629
3142
  fill: 'white'
2630
3143
  });
2631
3144
 
2632
- var polygon = create('polygon');
2633
- attr(polygon, {
3145
+ var polygon = create$1('polygon');
3146
+ attr$2(polygon, {
2634
3147
  points: pointsString
2635
3148
  });
2636
- attr(polygon, attrs);
3149
+ attr$2(polygon, attrs);
2637
3150
 
2638
- append(parentGfx, polygon);
3151
+ append$1(parentGfx, polygon);
2639
3152
 
2640
3153
  return polygon;
2641
3154
  }
@@ -2649,7 +3162,7 @@
2649
3162
 
2650
3163
  var line = createLine(waypoints, attrs);
2651
3164
 
2652
- append(parentGfx, line);
3165
+ append$1(parentGfx, line);
2653
3166
 
2654
3167
  return line;
2655
3168
  }
@@ -2661,11 +3174,11 @@
2661
3174
  stroke: black
2662
3175
  });
2663
3176
 
2664
- var path = create('path');
2665
- attr(path, { d: d });
2666
- attr(path, attrs);
3177
+ var path = create$1('path');
3178
+ attr$2(path, { d: d });
3179
+ attr$2(path, attrs);
2667
3180
 
2668
- append(parentGfx, path);
3181
+ append$1(parentGfx, path);
2669
3182
 
2670
3183
  return path;
2671
3184
  }
@@ -2689,7 +3202,7 @@
2689
3202
  var event = getSemantic(element);
2690
3203
  var isThrowing = isThrowEvent(event);
2691
3204
 
2692
- if (event.eventDefinitions && event.eventDefinitions.length>1) {
3205
+ if (event.eventDefinitions && event.eventDefinitions.length > 1) {
2693
3206
  if (event.parallelMultiple) {
2694
3207
  return renderer('bpmn:ParallelMultipleEventDefinition')(parentGfx, element, isThrowing);
2695
3208
  }
@@ -2751,9 +3264,9 @@
2751
3264
 
2752
3265
  var text = textRenderer.createText(label || '', options);
2753
3266
 
2754
- classes(text).add('djs-label');
3267
+ classes$2(text).add('djs-label');
2755
3268
 
2756
- append(parentGfx, text);
3269
+ append$1(parentGfx, text);
2757
3270
 
2758
3271
  return text;
2759
3272
  }
@@ -3363,7 +3876,7 @@
3363
3876
  });
3364
3877
 
3365
3878
  var businessHeaderPath = drawPath(parentGfx, headerPathData);
3366
- attr(businessHeaderPath, {
3879
+ attr$2(businessHeaderPath, {
3367
3880
  strokeWidth: 1,
3368
3881
  fill: getFillColor(element, '#aaaaaa'),
3369
3882
  stroke: getStrokeColor(element, defaultStrokeColor)
@@ -3377,7 +3890,7 @@
3377
3890
  });
3378
3891
 
3379
3892
  var businessPath = drawPath(parentGfx, headerData);
3380
- attr(businessPath, {
3893
+ attr$2(businessPath, {
3381
3894
  strokeWidth: 1,
3382
3895
  stroke: getStrokeColor(element, defaultStrokeColor)
3383
3896
  });
@@ -3395,7 +3908,7 @@
3395
3908
  var expanded = isExpanded(element);
3396
3909
 
3397
3910
  if (isEventSubProcess(element)) {
3398
- attr(rect, {
3911
+ attr$2(rect, {
3399
3912
  strokeDasharray: '1,2'
3400
3913
  });
3401
3914
  }
@@ -3405,7 +3918,7 @@
3405
3918
  if (expanded) {
3406
3919
  attachTaskMarkers(parentGfx, element);
3407
3920
  } else {
3408
- attachTaskMarkers(parentGfx, element, ['SubProcessMarker']);
3921
+ attachTaskMarkers(parentGfx, element, [ 'SubProcessMarker' ]);
3409
3922
  }
3410
3923
 
3411
3924
  return rect;
@@ -3617,7 +4130,7 @@
3617
4130
  });
3618
4131
 
3619
4132
  var parallelPath = drawPath(parentGfx, pathData);
3620
- attr(parallelPath, {
4133
+ attr$2(parallelPath, {
3621
4134
  strokeWidth: 1,
3622
4135
  fill: 'none'
3623
4136
  });
@@ -3625,7 +4138,7 @@
3625
4138
 
3626
4139
  if (!instantiate) {
3627
4140
  var innerCircle = drawCircle(parentGfx, element.width, element.height, element.height * 0.26);
3628
- attr(innerCircle, {
4141
+ attr$2(innerCircle, {
3629
4142
  strokeWidth: 1,
3630
4143
  fill: 'none',
3631
4144
  stroke: getStrokeColor(element, defaultStrokeColor)
@@ -3670,7 +4183,7 @@
3670
4183
 
3671
4184
  // conditional flow marker
3672
4185
  if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Activity')) {
3673
- attr(path, {
4186
+ attr$2(path, {
3674
4187
  markerStart: marker('conditional-flow-marker', fill, stroke)
3675
4188
  });
3676
4189
  }
@@ -3678,7 +4191,7 @@
3678
4191
  // default marker
3679
4192
  if (source.default && (source.$instanceOf('bpmn:Gateway') || source.$instanceOf('bpmn:Activity')) &&
3680
4193
  source.default === sequenceFlow) {
3681
- attr(path, {
4194
+ attr$2(path, {
3682
4195
  markerStart: marker('conditional-default-flow-marker', fill, stroke)
3683
4196
  });
3684
4197
  }
@@ -4739,22 +5252,22 @@
4739
5252
  d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
4740
5253
  height: 36,
4741
5254
  width: 36,
4742
- heightElements: [6, 14],
4743
- widthElements: [10.5, 21]
5255
+ heightElements: [ 6, 14 ],
5256
+ widthElements: [ 10.5, 21 ]
4744
5257
  },
4745
5258
  'EVENT_SIGNAL': {
4746
5259
  d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
4747
5260
  height: 36,
4748
5261
  width: 36,
4749
- heightElements: [18],
4750
- widthElements: [10, 20]
5262
+ heightElements: [ 18 ],
5263
+ widthElements: [ 10, 20 ]
4751
5264
  },
4752
5265
  'EVENT_ESCALATION': {
4753
5266
  d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z',
4754
5267
  height: 36,
4755
5268
  width: 36,
4756
- heightElements: [20, 7],
4757
- widthElements: [8]
5269
+ heightElements: [ 20, 7 ],
5270
+ widthElements: [ 8 ]
4758
5271
  },
4759
5272
  'EVENT_CONDITIONAL': {
4760
5273
  d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
@@ -4766,67 +5279,67 @@
4766
5279
  'M {e.x2},{e.y8} l {e.x0},0 ',
4767
5280
  height: 36,
4768
5281
  width: 36,
4769
- heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],
4770
- widthElements: [10.5, 14.5, 12.5]
5282
+ heightElements: [ 8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5 ],
5283
+ widthElements: [ 10.5, 14.5, 12.5 ]
4771
5284
  },
4772
5285
  'EVENT_LINK': {
4773
5286
  d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',
4774
5287
  height: 36,
4775
5288
  width: 36,
4776
- heightElements: [4.4375, 6.75, 7.8125],
4777
- widthElements: [9.84375, 13.5]
5289
+ heightElements: [ 4.4375, 6.75, 7.8125 ],
5290
+ widthElements: [ 9.84375, 13.5 ]
4778
5291
  },
4779
5292
  'EVENT_ERROR': {
4780
5293
  d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',
4781
5294
  height: 36,
4782
5295
  width: 36,
4783
- heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],
4784
- widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]
5296
+ heightElements: [ 0.023, 8.737, 8.151, 16.564, 10.591, 8.714 ],
5297
+ widthElements: [ 0.085, 6.672, 6.97, 4.273, 5.337, 6.636 ]
4785
5298
  },
4786
5299
  'EVENT_CANCEL_45': {
4787
5300
  d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
4788
5301
  '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
4789
5302
  height: 36,
4790
5303
  width: 36,
4791
- heightElements: [4.75, 8.5],
4792
- widthElements: [4.75, 8.5]
5304
+ heightElements: [ 4.75, 8.5 ],
5305
+ widthElements: [ 4.75, 8.5 ]
4793
5306
  },
4794
5307
  'EVENT_COMPENSATION': {
4795
5308
  d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z',
4796
5309
  height: 36,
4797
5310
  width: 36,
4798
- heightElements: [6.5, 13, 0.4, 6.1],
4799
- widthElements: [9, 9.3, 8.7]
5311
+ heightElements: [ 6.5, 13, 0.4, 6.1 ],
5312
+ widthElements: [ 9, 9.3, 8.7 ]
4800
5313
  },
4801
5314
  'EVENT_TIMER_WH': {
4802
5315
  d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
4803
5316
  height: 36,
4804
5317
  width: 36,
4805
- heightElements: [10, 2],
4806
- widthElements: [3, 7]
5318
+ heightElements: [ 10, 2 ],
5319
+ widthElements: [ 3, 7 ]
4807
5320
  },
4808
5321
  'EVENT_TIMER_LINE': {
4809
5322
  d: 'M {mx},{my} ' +
4810
5323
  'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
4811
5324
  height: 36,
4812
5325
  width: 36,
4813
- heightElements: [10, 3],
4814
- widthElements: [0, 0]
5326
+ heightElements: [ 10, 3 ],
5327
+ widthElements: [ 0, 0 ]
4815
5328
  },
4816
5329
  'EVENT_MULTIPLE': {
4817
5330
  d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
4818
5331
  height: 36,
4819
5332
  width: 36,
4820
- heightElements: [6.28099, 12.56199],
4821
- widthElements: [3.1405, 9.42149, 12.56198]
5333
+ heightElements: [ 6.28099, 12.56199 ],
5334
+ widthElements: [ 3.1405, 9.42149, 12.56198 ]
4822
5335
  },
4823
5336
  'EVENT_PARALLEL_MULTIPLE': {
4824
5337
  d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
4825
5338
  '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
4826
5339
  height: 36,
4827
5340
  width: 36,
4828
- heightElements: [2.56228, 7.68683],
4829
- widthElements: [2.56228, 7.68683]
5341
+ heightElements: [ 2.56228, 7.68683 ],
5342
+ widthElements: [ 2.56228, 7.68683 ]
4830
5343
  },
4831
5344
  'GATEWAY_EXCLUSIVE': {
4832
5345
  d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
@@ -4834,23 +5347,23 @@
4834
5347
  '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
4835
5348
  height: 17.5,
4836
5349
  width: 17.5,
4837
- heightElements: [8.5, 6.5312, -6.5312, -8.5],
4838
- widthElements: [6.5, -6.5, 3, -3, 5, -5]
5350
+ heightElements: [ 8.5, 6.5312, -6.5312, -8.5 ],
5351
+ widthElements: [ 6.5, -6.5, 3, -3, 5, -5 ]
4839
5352
  },
4840
5353
  'GATEWAY_PARALLEL': {
4841
5354
  d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
4842
5355
  '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
4843
5356
  height: 30,
4844
5357
  width: 30,
4845
- heightElements: [5, 12.5],
4846
- widthElements: [5, 12.5]
5358
+ heightElements: [ 5, 12.5 ],
5359
+ widthElements: [ 5, 12.5 ]
4847
5360
  },
4848
5361
  'GATEWAY_EVENT_BASED': {
4849
5362
  d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
4850
5363
  height: 11,
4851
5364
  width: 11,
4852
- heightElements: [-6, 6, 12, -12],
4853
- widthElements: [9, -3, -12]
5365
+ heightElements: [ -6, 6, 12, -12 ],
5366
+ widthElements: [ 9, -3, -12 ]
4854
5367
  },
4855
5368
  'GATEWAY_COMPLEX': {
4856
5369
  d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +
@@ -4859,15 +5372,15 @@
4859
5372
  '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
4860
5373
  height: 17.125,
4861
5374
  width: 17.125,
4862
- heightElements: [4.875, 3.4375, 2.125, 3],
4863
- widthElements: [3.4375, 2.125, 4.875, 3]
5375
+ heightElements: [ 4.875, 3.4375, 2.125, 3 ],
5376
+ widthElements: [ 3.4375, 2.125, 4.875, 3 ]
4864
5377
  },
4865
5378
  'DATA_OBJECT_PATH': {
4866
5379
  d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',
4867
5380
  height: 61,
4868
5381
  width: 51,
4869
- heightElements: [10, 50, 60],
4870
- widthElements: [10, 40, 50, 60]
5382
+ heightElements: [ 10, 50, 60 ],
5383
+ widthElements: [ 10, 40, 50, 60 ]
4871
5384
  },
4872
5385
  'DATA_OBJECT_COLLECTION_PATH': {
4873
5386
  d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
@@ -4896,15 +5409,15 @@
4896
5409
  'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',
4897
5410
  height: 61,
4898
5411
  width: 61,
4899
- heightElements: [7, 10, 45],
4900
- widthElements: [2, 58, 60]
5412
+ heightElements: [ 7, 10, 45 ],
5413
+ widthElements: [ 2, 58, 60 ]
4901
5414
  },
4902
5415
  'TEXT_ANNOTATION': {
4903
5416
  d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
4904
5417
  height: 30,
4905
5418
  width: 10,
4906
- heightElements: [30],
4907
- widthElements: [10]
5419
+ heightElements: [ 30 ],
5420
+ widthElements: [ 10 ]
4908
5421
  },
4909
5422
  'MARKER_SUB_PROCESS': {
4910
5423
  d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
@@ -4959,8 +5472,8 @@
4959
5472
  d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
4960
5473
  height: 14,
4961
5474
  width: 21,
4962
- heightElements: [6, 14],
4963
- widthElements: [10.5, 21]
5475
+ heightElements: [ 6, 14 ],
5476
+ widthElements: [ 10.5, 21 ]
4964
5477
  },
4965
5478
  'TASK_TYPE_SCRIPT': {
4966
5479
  d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
@@ -4971,8 +5484,8 @@
4971
5484
  'm -4,3 l 5,0',
4972
5485
  height: 15,
4973
5486
  width: 12.6,
4974
- heightElements: [6, 14],
4975
- widthElements: [10.5, 21]
5487
+ heightElements: [ 6, 14 ],
5488
+ widthElements: [ 10.5, 21 ]
4976
5489
  },
4977
5490
  'TASK_TYPE_USER_1': {
4978
5491
  d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
@@ -5657,11 +6170,6 @@
5657
6170
  parentElement = this._canvas.findRoot(parentElement);
5658
6171
  }
5659
6172
 
5660
- // insert sequence flows behind other flow nodes (cf. #727)
5661
- if (is(semantic, 'bpmn:SequenceFlow')) {
5662
- parentIndex = 0;
5663
- }
5664
-
5665
6173
  this._canvas.addConnection(element, parentElement, parentIndex);
5666
6174
  } else {
5667
6175
  throw new Error(translate('unknown di {di} for element {semantic}', {
@@ -8423,7 +8931,7 @@
8423
8931
 
8424
8932
  // dataAssociations are children of the subprocess but rendered on process level
8425
8933
  // cf. https://github.com/bpmn-io/bpmn-js/issues/1619
8426
- if (isAny(bo, ['bpmn:DataInputAssociation', 'bpmn:DataOutputAssociation'])) {
8934
+ if (isAny(bo, [ 'bpmn:DataInputAssociation', 'bpmn:DataOutputAssociation' ])) {
8427
8935
  return false;
8428
8936
  }
8429
8937
 
@@ -8471,7 +8979,7 @@
8471
8979
  }, true);
8472
8980
 
8473
8981
 
8474
- this.executed(['shape.create', 'shape.move', 'shape.delete'], LOW_PRIORITY$3,
8982
+ this.executed([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$3,
8475
8983
  function(context) {
8476
8984
  var oldParent = context.oldParent,
8477
8985
  newParent = context.newParent || context.parent,
@@ -8488,7 +8996,7 @@
8488
8996
  }, true);
8489
8997
 
8490
8998
 
8491
- this.reverted(['shape.create', 'shape.move', 'shape.delete'], LOW_PRIORITY$3,
8999
+ this.reverted([ 'shape.create', 'shape.move', 'shape.delete' ], LOW_PRIORITY$3,
8492
9000
  function(context) {
8493
9001
  var oldParent = context.oldParent,
8494
9002
  newParent = context.newParent || context.parent,
@@ -8607,7 +9115,7 @@
8607
9115
 
8608
9116
  var DrilldownModdule = {
8609
9117
  __depends__: [ OverlaysModule, ChangeSupportModule, RootElementsModule ],
8610
- __init__: [ 'drilldownBreadcrumbs', 'drilldownOverlayBehavior', 'drilldownCentering', 'subprocessCompatibility'],
9118
+ __init__: [ 'drilldownBreadcrumbs', 'drilldownOverlayBehavior', 'drilldownCentering', 'subprocessCompatibility' ],
8611
9119
  drilldownBreadcrumbs: [ 'type', DrilldownBreadcrumbs ],
8612
9120
  drilldownCentering: [ 'type', DrilldownCentering ],
8613
9121
  drilldownOverlayBehavior: [ 'type', DrilldownOverlayBehavior ],
@@ -8935,20 +9443,11 @@
8935
9443
  return function() {
8936
9444
  initializers.forEach(function(initializer) {
8937
9445
 
8938
- try {
8939
-
8940
- // eagerly resolve component (fn or string)
8941
- if (typeof initializer === 'string') {
8942
- injector.get(initializer);
8943
- } else {
8944
- injector.invoke(initializer);
8945
- }
8946
- } catch (error) {
8947
- if (typeof AggregateError !== 'undefined') {
8948
- throw new AggregateError([ error ], 'Failed to initialize!');
8949
- }
8950
-
8951
- throw new Error('Failed to initialize! ' + error.message);
9446
+ // eagerly resolve component (fn or string)
9447
+ if (typeof initializer === 'string') {
9448
+ injector.get(initializer);
9449
+ } else {
9450
+ injector.invoke(initializer);
8952
9451
  }
8953
9452
  });
8954
9453
  };
@@ -9264,7 +9763,7 @@
9264
9763
  *
9265
9764
  * @return {number} the previous index of the element
9266
9765
  */
9267
- function remove$2(collection, element) {
9766
+ function remove$3(collection, element) {
9268
9767
 
9269
9768
  if (!collection || !element) {
9270
9769
  return -1;
@@ -10216,7 +10715,7 @@
10216
10715
  graphicsFactory.remove(element);
10217
10716
 
10218
10717
  // unset parent <-> child relationship
10219
- remove$2(element.parent && element.parent.children, element);
10718
+ remove$3(element.parent && element.parent.children, element);
10220
10719
  element.parent = null;
10221
10720
 
10222
10721
  eventBus.fire(type + '.removed', { element: element });
@@ -11540,7 +12039,7 @@
11540
12039
  *
11541
12040
  * @return {Base} the new model instance
11542
12041
  */
11543
- function create$1(type, attrs) {
12042
+ function create$2(type, attrs) {
11544
12043
  var Type = types[type];
11545
12044
  if (!Type) {
11546
12045
  throw new Error('unknown type: <' + type + '>');
@@ -11588,7 +12087,7 @@
11588
12087
  attrs.id = type + '_' + (this._uid++);
11589
12088
  }
11590
12089
 
11591
- return create$1(type, attrs);
12090
+ return create$2(type, attrs);
11592
12091
  };
11593
12092
 
11594
12093
  var FN_REF = '__fn';
@@ -16109,7 +16608,23 @@
16109
16608
  value = escapeAttr(value);
16110
16609
  }
16111
16610
 
16112
- attrs.push({ name: name, value: value });
16611
+ // de-duplicate attributes
16612
+ // https://github.com/bpmn-io/moddle-xml/issues/66
16613
+ var idx = findIndex(attrs, function(element) {
16614
+ return (
16615
+ element.name.localName === name.localName &&
16616
+ element.name.uri === name.uri &&
16617
+ element.name.prefix === name.prefix
16618
+ );
16619
+ });
16620
+
16621
+ var attr = { name: name, value: value };
16622
+
16623
+ if (idx !== -1) {
16624
+ attrs.splice(idx, 1, attr);
16625
+ } else {
16626
+ attrs.push(attr);
16627
+ }
16113
16628
  };
16114
16629
 
16115
16630
  ElementSerializer.prototype.serializeAttributes = function(writer) {
@@ -16369,12 +16884,12 @@
16369
16884
  });
16370
16885
  };
16371
16886
 
16372
- var name = "BPMN20";
16373
- var uri = "http://www.omg.org/spec/BPMN/20100524/MODEL";
16374
- var prefix$1 = "bpmn";
16375
- var associations = [
16887
+ var name$5 = "BPMN20";
16888
+ var uri$5 = "http://www.omg.org/spec/BPMN/20100524/MODEL";
16889
+ var prefix$5 = "bpmn";
16890
+ var associations$5 = [
16376
16891
  ];
16377
- var types$1 = [
16892
+ var types$5 = [
16378
16893
  {
16379
16894
  name: "Interface",
16380
16895
  superClass: [
@@ -19192,7 +19707,7 @@
19192
19707
  ]
19193
19708
  }
19194
19709
  ];
19195
- var enumerations = [
19710
+ var enumerations$3 = [
19196
19711
  {
19197
19712
  name: "ProcessType",
19198
19713
  literalValues: [
@@ -19323,24 +19838,24 @@
19323
19838
  ]
19324
19839
  }
19325
19840
  ];
19326
- var xml = {
19841
+ var xml$1 = {
19327
19842
  tagAlias: "lowerCase",
19328
19843
  typePrefix: "t"
19329
19844
  };
19330
19845
  var BpmnPackage = {
19331
- name: name,
19332
- uri: uri,
19333
- prefix: prefix$1,
19334
- associations: associations,
19335
- types: types$1,
19336
- enumerations: enumerations,
19337
- xml: xml
19846
+ name: name$5,
19847
+ uri: uri$5,
19848
+ prefix: prefix$5,
19849
+ associations: associations$5,
19850
+ types: types$5,
19851
+ enumerations: enumerations$3,
19852
+ xml: xml$1
19338
19853
  };
19339
19854
 
19340
- var name$1 = "BPMNDI";
19341
- var uri$1 = "http://www.omg.org/spec/BPMN/20100524/DI";
19342
- var prefix$1$1 = "bpmndi";
19343
- var types$1$1 = [
19855
+ var name$4 = "BPMNDI";
19856
+ var uri$4 = "http://www.omg.org/spec/BPMN/20100524/DI";
19857
+ var prefix$4 = "bpmndi";
19858
+ var types$4 = [
19344
19859
  {
19345
19860
  name: "BPMNDiagram",
19346
19861
  properties: [
@@ -19491,7 +20006,7 @@
19491
20006
  ]
19492
20007
  }
19493
20008
  ];
19494
- var enumerations$1 = [
20009
+ var enumerations$2 = [
19495
20010
  {
19496
20011
  name: "ParticipantBandKind",
19497
20012
  literalValues: [
@@ -19527,21 +20042,21 @@
19527
20042
  ]
19528
20043
  }
19529
20044
  ];
19530
- var associations$1 = [
20045
+ var associations$4 = [
19531
20046
  ];
19532
20047
  var BpmnDiPackage = {
19533
- name: name$1,
19534
- uri: uri$1,
19535
- prefix: prefix$1$1,
19536
- types: types$1$1,
19537
- enumerations: enumerations$1,
19538
- associations: associations$1
20048
+ name: name$4,
20049
+ uri: uri$4,
20050
+ prefix: prefix$4,
20051
+ types: types$4,
20052
+ enumerations: enumerations$2,
20053
+ associations: associations$4
19539
20054
  };
19540
20055
 
19541
- var name$2 = "DC";
19542
- var uri$2 = "http://www.omg.org/spec/DD/20100524/DC";
19543
- var prefix$2 = "dc";
19544
- var types$2 = [
20056
+ var name$3 = "DC";
20057
+ var uri$3 = "http://www.omg.org/spec/DD/20100524/DC";
20058
+ var prefix$3 = "dc";
20059
+ var types$3 = [
19545
20060
  {
19546
20061
  name: "Boolean"
19547
20062
  },
@@ -19634,20 +20149,20 @@
19634
20149
  ]
19635
20150
  }
19636
20151
  ];
19637
- var associations$2 = [
20152
+ var associations$3 = [
19638
20153
  ];
19639
20154
  var DcPackage = {
19640
- name: name$2,
19641
- uri: uri$2,
19642
- prefix: prefix$2,
19643
- types: types$2,
19644
- associations: associations$2
20155
+ name: name$3,
20156
+ uri: uri$3,
20157
+ prefix: prefix$3,
20158
+ types: types$3,
20159
+ associations: associations$3
19645
20160
  };
19646
20161
 
19647
- var name$3 = "DI";
19648
- var uri$3 = "http://www.omg.org/spec/DD/20100524/DI";
19649
- var prefix$3 = "di";
19650
- var types$3 = [
20162
+ var name$2 = "DI";
20163
+ var uri$2 = "http://www.omg.org/spec/DD/20100524/DI";
20164
+ var prefix$2 = "di";
20165
+ var types$2 = [
19651
20166
  {
19652
20167
  name: "DiagramElement",
19653
20168
  isAbstract: true,
@@ -19876,24 +20391,24 @@
19876
20391
  ]
19877
20392
  }
19878
20393
  ];
19879
- var associations$3 = [
20394
+ var associations$2 = [
19880
20395
  ];
19881
- var xml$1 = {
20396
+ var xml = {
19882
20397
  tagAlias: "lowerCase"
19883
20398
  };
19884
20399
  var DiPackage = {
19885
- name: name$3,
19886
- uri: uri$3,
19887
- prefix: prefix$3,
19888
- types: types$3,
19889
- associations: associations$3,
19890
- xml: xml$1
20400
+ name: name$2,
20401
+ uri: uri$2,
20402
+ prefix: prefix$2,
20403
+ types: types$2,
20404
+ associations: associations$2,
20405
+ xml: xml
19891
20406
  };
19892
20407
 
19893
- var name$4 = "bpmn.io colors for BPMN";
19894
- var uri$4 = "http://bpmn.io/schema/bpmn/biocolor/1.0";
19895
- var prefix$4 = "bioc";
19896
- var types$4 = [
20408
+ var name$1 = "bpmn.io colors for BPMN";
20409
+ var uri$1 = "http://bpmn.io/schema/bpmn/biocolor/1.0";
20410
+ var prefix$1 = "bioc";
20411
+ var types$1 = [
19897
20412
  {
19898
20413
  name: "ColoredShape",
19899
20414
  "extends": [
@@ -19931,23 +20446,23 @@
19931
20446
  ]
19932
20447
  }
19933
20448
  ];
19934
- var enumerations$2 = [
20449
+ var enumerations$1 = [
19935
20450
  ];
19936
- var associations$4 = [
20451
+ var associations$1 = [
19937
20452
  ];
19938
20453
  var BiocPackage = {
19939
- name: name$4,
19940
- uri: uri$4,
19941
- prefix: prefix$4,
19942
- types: types$4,
19943
- enumerations: enumerations$2,
19944
- associations: associations$4
20454
+ name: name$1,
20455
+ uri: uri$1,
20456
+ prefix: prefix$1,
20457
+ types: types$1,
20458
+ enumerations: enumerations$1,
20459
+ associations: associations$1
19945
20460
  };
19946
20461
 
19947
- var name$5 = "BPMN in Color";
19948
- var uri$5 = "http://www.omg.org/spec/BPMN/non-normative/color/1.0";
19949
- var prefix$5 = "color";
19950
- var types$5 = [
20462
+ var name = "BPMN in Color";
20463
+ var uri = "http://www.omg.org/spec/BPMN/non-normative/color/1.0";
20464
+ var prefix$6 = "color";
20465
+ var types$6 = [
19951
20466
  {
19952
20467
  name: "ColoredLabel",
19953
20468
  "extends": [
@@ -19993,17 +20508,17 @@
19993
20508
  ]
19994
20509
  }
19995
20510
  ];
19996
- var enumerations$3 = [
20511
+ var enumerations = [
19997
20512
  ];
19998
- var associations$5 = [
20513
+ var associations = [
19999
20514
  ];
20000
20515
  var BpmnInColorPackage = {
20001
- name: name$5,
20002
- uri: uri$5,
20003
- prefix: prefix$5,
20004
- types: types$5,
20005
- enumerations: enumerations$3,
20006
- associations: associations$5
20516
+ name: name,
20517
+ uri: uri,
20518
+ prefix: prefix$6,
20519
+ types: types$6,
20520
+ enumerations: enumerations,
20521
+ associations: associations
20007
20522
  };
20008
20523
 
20009
20524
  var packages = {
@@ -20083,6 +20598,7 @@
20083
20598
  // bpmnElement can have multiple independent DIs
20084
20599
  if (!has(businessObject, 'di')) {
20085
20600
  Object.defineProperty(businessObject, 'di', {
20601
+ enumerable: false,
20086
20602
  get: function() {
20087
20603
  throw new Error(DI_ERROR_MESSAGE);
20088
20604
  }
@@ -21652,6 +22168,16 @@
21652
22168
  // default moddle extensions the viewer is composed of
21653
22169
  Viewer.prototype._moddleExtensions = {};
21654
22170
 
22171
+ var KEYCODE_C = 67;
22172
+ var KEYCODE_V = 86;
22173
+ var KEYCODE_Y = 89;
22174
+ var KEYCODE_Z = 90;
22175
+
22176
+ var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
22177
+ var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
22178
+ var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
22179
+ var KEYS_UNDO = [ 'z', 'Z', KEYCODE_Z ];
22180
+
21655
22181
  /**
21656
22182
  * Returns true if event was triggered with any modifier
21657
22183
  * @param {KeyboardEvent} event
@@ -21691,6 +22217,26 @@
21691
22217
  */
21692
22218
  function isShift(event) {
21693
22219
  return event.shiftKey;
22220
+ }
22221
+
22222
+ function isCopy(event) {
22223
+ return isCmd(event) && isKey(KEYS_COPY, event);
22224
+ }
22225
+
22226
+ function isPaste(event) {
22227
+ return isCmd(event) && isKey(KEYS_PASTE, event);
22228
+ }
22229
+
22230
+ function isUndo(event) {
22231
+ return isCmd(event) && !isShift(event) && isKey(KEYS_UNDO, event);
22232
+ }
22233
+
22234
+ function isRedo(event) {
22235
+ return isCmd(event) && (
22236
+ isKey(KEYS_REDO, event) || (
22237
+ isKey(KEYS_UNDO, event) && isShift(event)
22238
+ )
22239
+ );
21694
22240
  }
21695
22241
 
21696
22242
  var KEYDOWN_EVENT = 'keyboard.keydown',
@@ -21883,16 +22429,6 @@
21883
22429
 
21884
22430
  var LOW_PRIORITY$4 = 500;
21885
22431
 
21886
- var KEYCODE_C = 67;
21887
- var KEYCODE_V = 86;
21888
- var KEYCODE_Y = 89;
21889
- var KEYCODE_Z = 90;
21890
-
21891
- var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
21892
- var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
21893
- var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
21894
- var KEYS_UNDO = [ 'z', 'Z', KEYCODE_Z ];
21895
-
21896
22432
 
21897
22433
  /**
21898
22434
  * Adds default keyboard bindings.
@@ -21950,7 +22486,7 @@
21950
22486
 
21951
22487
  var event = context.keyEvent;
21952
22488
 
21953
- if (isCmd(event) && !isShift(event) && isKey(KEYS_UNDO, event)) {
22489
+ if (isUndo(event)) {
21954
22490
  editorActions.trigger('undo');
21955
22491
 
21956
22492
  return true;
@@ -21964,7 +22500,7 @@
21964
22500
 
21965
22501
  var event = context.keyEvent;
21966
22502
 
21967
- if (isCmd(event) && (isKey(KEYS_REDO, event) || (isKey(KEYS_UNDO, event) && isShift(event)))) {
22503
+ if (isRedo(event)) {
21968
22504
  editorActions.trigger('redo');
21969
22505
 
21970
22506
  return true;
@@ -21977,7 +22513,7 @@
21977
22513
 
21978
22514
  var event = context.keyEvent;
21979
22515
 
21980
- if (isCmd(event) && isKey(KEYS_COPY, event)) {
22516
+ if (isCopy(event)) {
21981
22517
  editorActions.trigger('copy');
21982
22518
 
21983
22519
  return true;
@@ -21990,7 +22526,7 @@
21990
22526
 
21991
22527
  var event = context.keyEvent;
21992
22528
 
21993
- if (isCmd(event) && isKey(KEYS_PASTE, event)) {
22529
+ if (isPaste(event)) {
21994
22530
  editorActions.trigger('paste');
21995
22531
 
21996
22532
  return true;
@@ -22626,7 +23162,7 @@
22626
23162
  NavigatedViewer.prototype._navigationModules
22627
23163
  );
22628
23164
 
22629
- function ensureImported$1(element, target) {
23165
+ function ensureImported$2(element, target) {
22630
23166
 
22631
23167
  if (element.ownerDocument !== target.ownerDocument) {
22632
23168
  try {
@@ -22652,8 +23188,8 @@
22652
23188
  *
22653
23189
  * @return {SVGElement} the appended node
22654
23190
  */
22655
- function appendTo$1(element, target) {
22656
- return target.appendChild(ensureImported$1(element, target));
23191
+ function appendTo$2(element, target) {
23192
+ return target.appendChild(ensureImported$2(element, target));
22657
23193
  }
22658
23194
 
22659
23195
  /**
@@ -22668,8 +23204,8 @@
22668
23204
  *
22669
23205
  * @return {SVGElement} the element
22670
23206
  */
22671
- function append$1(target, node) {
22672
- appendTo$1(node, target);
23207
+ function append$2(target, node) {
23208
+ appendTo$2(node, target);
22673
23209
  return target;
22674
23210
  }
22675
23211
 
@@ -22677,9 +23213,9 @@
22677
23213
  * attribute accessor utility
22678
23214
  */
22679
23215
 
22680
- var LENGTH_ATTR$1 = 2;
23216
+ var LENGTH_ATTR$2 = 2;
22681
23217
 
22682
- var CSS_PROPERTIES$1 = {
23218
+ var CSS_PROPERTIES$2 = {
22683
23219
  'alignment-baseline': 1,
22684
23220
  'baseline-shift': 1,
22685
23221
  'clip': 1,
@@ -22703,7 +23239,7 @@
22703
23239
  'flood-opacity': 1,
22704
23240
  'font': 1,
22705
23241
  'font-family': 1,
22706
- 'font-size': LENGTH_ATTR$1,
23242
+ 'font-size': LENGTH_ATTR$2,
22707
23243
  'font-size-adjust': 1,
22708
23244
  'font-stretch': 1,
22709
23245
  'font-style': 1,
@@ -22733,7 +23269,7 @@
22733
23269
  'stroke-linejoin': 1,
22734
23270
  'stroke-miterlimit': 1,
22735
23271
  'stroke-opacity': 1,
22736
- 'stroke-width': LENGTH_ATTR$1,
23272
+ 'stroke-width': LENGTH_ATTR$2,
22737
23273
  'text-anchor': 1,
22738
23274
  'text-decoration': 1,
22739
23275
  'text-rendering': 1,
@@ -22744,22 +23280,22 @@
22744
23280
  };
22745
23281
 
22746
23282
 
22747
- function getAttribute$1(node, name) {
22748
- if (CSS_PROPERTIES$1[name]) {
23283
+ function getAttribute$2(node, name) {
23284
+ if (CSS_PROPERTIES$2[name]) {
22749
23285
  return node.style[name];
22750
23286
  } else {
22751
23287
  return node.getAttributeNS(null, name);
22752
23288
  }
22753
23289
  }
22754
23290
 
22755
- function setAttribute$1(node, name, value) {
23291
+ function setAttribute$2(node, name, value) {
22756
23292
  var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
22757
23293
 
22758
- var type = CSS_PROPERTIES$1[hyphenated];
23294
+ var type = CSS_PROPERTIES$2[hyphenated];
22759
23295
 
22760
23296
  if (type) {
22761
23297
  // append pixel unit, unless present
22762
- if (type === LENGTH_ATTR$1 && typeof value === 'number') {
23298
+ if (type === LENGTH_ATTR$2 && typeof value === 'number') {
22763
23299
  value = String(value) + 'px';
22764
23300
  }
22765
23301
 
@@ -22769,12 +23305,12 @@
22769
23305
  }
22770
23306
  }
22771
23307
 
22772
- function setAttributes$1(node, attrs) {
23308
+ function setAttributes$2(node, attrs) {
22773
23309
 
22774
23310
  var names = Object.keys(attrs), i, name;
22775
23311
 
22776
23312
  for (i = 0, name; (name = names[i]); i++) {
22777
- setAttribute$1(node, name, attrs[name]);
23313
+ setAttribute$2(node, name, attrs[name]);
22778
23314
  }
22779
23315
  }
22780
23316
 
@@ -22788,21 +23324,21 @@
22788
23324
  *
22789
23325
  * @return {String}
22790
23326
  */
22791
- function attr$2(node, name, value) {
23327
+ function attr$3(node, name, value) {
22792
23328
  if (typeof name === 'string') {
22793
23329
  if (value !== undefined) {
22794
- setAttribute$1(node, name, value);
23330
+ setAttribute$2(node, name, value);
22795
23331
  } else {
22796
- return getAttribute$1(node, name);
23332
+ return getAttribute$2(node, name);
22797
23333
  }
22798
23334
  } else {
22799
- setAttributes$1(node, name);
23335
+ setAttributes$2(node, name);
22800
23336
  }
22801
23337
 
22802
23338
  return node;
22803
23339
  }
22804
23340
 
22805
- var ns$1 = {
23341
+ var ns$2 = {
22806
23342
  svg: 'http://www.w3.org/2000/svg'
22807
23343
  };
22808
23344
 
@@ -22810,24 +23346,24 @@
22810
23346
  * DOM parsing utility
22811
23347
  */
22812
23348
 
22813
- var SVG_START$1 = '<svg xmlns="' + ns$1.svg + '"';
23349
+ var SVG_START$2 = '<svg xmlns="' + ns$2.svg + '"';
22814
23350
 
22815
- function parse$2(svg) {
23351
+ function parse$3(svg) {
22816
23352
 
22817
23353
  var unwrap = false;
22818
23354
 
22819
23355
  // ensure we import a valid svg document
22820
23356
  if (svg.substring(0, 4) === '<svg') {
22821
- if (svg.indexOf(ns$1.svg) === -1) {
22822
- svg = SVG_START$1 + svg.substring(4);
23357
+ if (svg.indexOf(ns$2.svg) === -1) {
23358
+ svg = SVG_START$2 + svg.substring(4);
22823
23359
  }
22824
23360
  } else {
22825
23361
  // namespace svg
22826
- svg = SVG_START$1 + '>' + svg + '</svg>';
23362
+ svg = SVG_START$2 + '>' + svg + '</svg>';
22827
23363
  unwrap = true;
22828
23364
  }
22829
23365
 
22830
- var parsed = parseDocument$1(svg);
23366
+ var parsed = parseDocument$2(svg);
22831
23367
 
22832
23368
  if (!unwrap) {
22833
23369
  return parsed;
@@ -22844,7 +23380,7 @@
22844
23380
  return fragment;
22845
23381
  }
22846
23382
 
22847
- function parseDocument$1(svg) {
23383
+ function parseDocument$2(svg) {
22848
23384
 
22849
23385
  var parser;
22850
23386
 
@@ -22868,18 +23404,18 @@
22868
23404
  *
22869
23405
  * @returns {SVGElement}
22870
23406
  */
22871
- function create$2(name, attrs) {
23407
+ function create$3(name, attrs) {
22872
23408
  var element;
22873
23409
 
22874
23410
  if (name.charAt(0) === '<') {
22875
- element = parse$2(name).firstChild;
23411
+ element = parse$3(name).firstChild;
22876
23412
  element = document.importNode(element, true);
22877
23413
  } else {
22878
- element = document.createElementNS(ns$1.svg, name);
23414
+ element = document.createElementNS(ns$2.svg, name);
22879
23415
  }
22880
23416
 
22881
23417
  if (attrs) {
22882
- attr$2(element, attrs);
23418
+ attr$3(element, attrs);
22883
23419
  }
22884
23420
 
22885
23421
  return element;
@@ -22890,7 +23426,7 @@
22890
23426
  */
22891
23427
 
22892
23428
  // fake node used to instantiate svg geometry elements
22893
- create$2('svg');
23429
+ create$3('svg');
22894
23430
 
22895
23431
  function getModelerTemplateIcon(element) {
22896
23432
  var modelerTemplateIcon = getBusinessObject(element).get('zeebe:modelerTemplateIcon');
@@ -22931,8 +23467,8 @@
22931
23467
 
22932
23468
  var modelerTemplateIcon = getModelerTemplateIcon(element);
22933
23469
 
22934
- var icon = create$2('image');
22935
- attr$2(icon, {
23470
+ var icon = create$3('image');
23471
+ attr$3(icon, {
22936
23472
  href: modelerTemplateIcon,
22937
23473
  x: 5,
22938
23474
  y: 5,
@@ -22940,7 +23476,7 @@
22940
23476
  height: 18
22941
23477
  });
22942
23478
 
22943
- append$1(parentGfx, icon);
23479
+ append$2(parentGfx, icon);
22944
23480
 
22945
23481
  return gfx;
22946
23482
  };
@@ -22960,14 +23496,14 @@
22960
23496
  };
22961
23497
 
22962
23498
  var name$6 = "zeebe";
22963
- var prefix$6 = "zeebe";
23499
+ var prefix$7 = "zeebe";
22964
23500
  var uri$6 = "http://camunda.org/schema/zeebe/1.0";
22965
23501
  var xml$2 = {
22966
23502
  tagAlias: "lowerCase"
22967
23503
  };
22968
23504
  var associations$6 = [
22969
23505
  ];
22970
- var types$6 = [
23506
+ var types$7 = [
22971
23507
  {
22972
23508
  name: "ZeebeServiceTask",
22973
23509
  "extends": [
@@ -23013,7 +23549,8 @@
23013
23549
  "bpmn:Event",
23014
23550
  "bpmn:ReceiveTask",
23015
23551
  "zeebe:ZeebeServiceTask",
23016
- "bpmn:SubProcess"
23552
+ "bpmn:SubProcess",
23553
+ "bpmn:UserTask"
23017
23554
  ]
23018
23555
  }
23019
23556
  },
@@ -23054,7 +23591,8 @@
23054
23591
  allowedIn: [
23055
23592
  "bpmn:CallActivity",
23056
23593
  "zeebe:ZeebeServiceTask",
23057
- "bpmn:SubProcess"
23594
+ "bpmn:SubProcess",
23595
+ "bpmn:UserTask"
23058
23596
  ]
23059
23597
  }
23060
23598
  },
@@ -23069,7 +23607,8 @@
23069
23607
  "bpmn:Event",
23070
23608
  "bpmn:ReceiveTask",
23071
23609
  "zeebe:ZeebeServiceTask",
23072
- "bpmn:SubProcess"
23610
+ "bpmn:SubProcess",
23611
+ "bpmn:UserTask"
23073
23612
  ]
23074
23613
  }
23075
23614
  },
@@ -23080,7 +23619,8 @@
23080
23619
  ],
23081
23620
  meta: {
23082
23621
  allowedIn: [
23083
- "zeebe:ZeebeServiceTask"
23622
+ "zeebe:ZeebeServiceTask",
23623
+ "bpmn:UserTask"
23084
23624
  ]
23085
23625
  },
23086
23626
  properties: [
@@ -23287,6 +23827,51 @@
23287
23827
  }
23288
23828
  ]
23289
23829
  },
23830
+ {
23831
+ name: "Properties",
23832
+ superClass: [
23833
+ "Element"
23834
+ ],
23835
+ properties: [
23836
+ {
23837
+ name: "properties",
23838
+ type: "Property",
23839
+ isMany: true
23840
+ }
23841
+ ],
23842
+ meta: {
23843
+ allowedIn: [
23844
+ "zeebe:PropertiesHolder"
23845
+ ]
23846
+ }
23847
+ },
23848
+ {
23849
+ name: "Property",
23850
+ properties: [
23851
+ {
23852
+ name: "name",
23853
+ type: "String",
23854
+ isAttr: true
23855
+ },
23856
+ {
23857
+ name: "value",
23858
+ type: "String",
23859
+ isAttr: true
23860
+ }
23861
+ ],
23862
+ meta: {
23863
+ allowedIn: [
23864
+ "zeebe:PropertiesHolder"
23865
+ ]
23866
+ }
23867
+ },
23868
+ {
23869
+ name: "PropertiesHolder",
23870
+ isAbstract: true,
23871
+ "extends": [
23872
+ "bpmn:FlowNode"
23873
+ ]
23874
+ },
23290
23875
  {
23291
23876
  name: "TemplateSupported",
23292
23877
  isAbstract: true,
@@ -23316,11 +23901,11 @@
23316
23901
  ];
23317
23902
  var zeebeModdle = {
23318
23903
  name: name$6,
23319
- prefix: prefix$6,
23904
+ prefix: prefix$7,
23320
23905
  uri: uri$6,
23321
23906
  xml: xml$2,
23322
23907
  associations: associations$6,
23323
- types: types$6
23908
+ types: types$7
23324
23909
  };
23325
23910
 
23326
23911
  const commonModules = [