camunda-bpmn-js 0.22.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-modeler.development.js +13271 -12559
- package/dist/base-modeler.production.min.js +4 -4
- package/dist/base-navigated-viewer.development.js +744 -322
- package/dist/base-navigated-viewer.production.min.js +2 -2
- package/dist/base-viewer.development.js +741 -319
- package/dist/base-viewer.production.min.js +2 -2
- package/dist/camunda-cloud-modeler.development.js +6192 -6663
- package/dist/camunda-cloud-modeler.production.min.js +4 -4
- package/dist/camunda-cloud-navigated-viewer.development.js +861 -521
- package/dist/camunda-cloud-navigated-viewer.production.min.js +2 -2
- package/dist/camunda-cloud-viewer.development.js +858 -518
- package/dist/camunda-cloud-viewer.production.min.js +2 -2
- package/dist/camunda-platform-modeler.development.js +10159 -10649
- package/dist/camunda-platform-modeler.production.min.js +4 -4
- package/dist/camunda-platform-navigated-viewer.development.js +744 -322
- package/dist/camunda-platform-navigated-viewer.production.min.js +2 -2
- package/dist/camunda-platform-viewer.development.js +741 -319
- package/dist/camunda-platform-viewer.production.min.js +2 -2
- package/package.json +8 -8
|
@@ -682,7 +682,7 @@
|
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
684
|
|
|
685
|
-
function ensureImported(element, target) {
|
|
685
|
+
function ensureImported$1(element, target) {
|
|
686
686
|
|
|
687
687
|
if (element.ownerDocument !== target.ownerDocument) {
|
|
688
688
|
try {
|
|
@@ -710,8 +710,8 @@
|
|
|
710
710
|
*
|
|
711
711
|
* @return {SVGElement} the appended node
|
|
712
712
|
*/
|
|
713
|
-
function appendTo(element, target) {
|
|
714
|
-
return target.appendChild(ensureImported(element, target));
|
|
713
|
+
function appendTo$1(element, target) {
|
|
714
|
+
return target.appendChild(ensureImported$1(element, target));
|
|
715
715
|
}
|
|
716
716
|
|
|
717
717
|
/**
|
|
@@ -726,8 +726,8 @@
|
|
|
726
726
|
*
|
|
727
727
|
* @return {SVGElement} the element
|
|
728
728
|
*/
|
|
729
|
-
function append(target, node) {
|
|
730
|
-
appendTo(node, target);
|
|
729
|
+
function append$1(target, node) {
|
|
730
|
+
appendTo$1(node, target);
|
|
731
731
|
return target;
|
|
732
732
|
}
|
|
733
733
|
|
|
@@ -735,9 +735,9 @@
|
|
|
735
735
|
* attribute accessor utility
|
|
736
736
|
*/
|
|
737
737
|
|
|
738
|
-
var LENGTH_ATTR = 2;
|
|
738
|
+
var LENGTH_ATTR$1 = 2;
|
|
739
739
|
|
|
740
|
-
var CSS_PROPERTIES = {
|
|
740
|
+
var CSS_PROPERTIES$1 = {
|
|
741
741
|
'alignment-baseline': 1,
|
|
742
742
|
'baseline-shift': 1,
|
|
743
743
|
'clip': 1,
|
|
@@ -761,7 +761,7 @@
|
|
|
761
761
|
'flood-opacity': 1,
|
|
762
762
|
'font': 1,
|
|
763
763
|
'font-family': 1,
|
|
764
|
-
'font-size': LENGTH_ATTR,
|
|
764
|
+
'font-size': LENGTH_ATTR$1,
|
|
765
765
|
'font-size-adjust': 1,
|
|
766
766
|
'font-stretch': 1,
|
|
767
767
|
'font-style': 1,
|
|
@@ -791,7 +791,7 @@
|
|
|
791
791
|
'stroke-linejoin': 1,
|
|
792
792
|
'stroke-miterlimit': 1,
|
|
793
793
|
'stroke-opacity': 1,
|
|
794
|
-
'stroke-width': LENGTH_ATTR,
|
|
794
|
+
'stroke-width': LENGTH_ATTR$1,
|
|
795
795
|
'text-anchor': 1,
|
|
796
796
|
'text-decoration': 1,
|
|
797
797
|
'text-rendering': 1,
|
|
@@ -802,23 +802,23 @@
|
|
|
802
802
|
};
|
|
803
803
|
|
|
804
804
|
|
|
805
|
-
function getAttribute(node, name) {
|
|
806
|
-
if (CSS_PROPERTIES[name]) {
|
|
805
|
+
function getAttribute$1(node, name) {
|
|
806
|
+
if (CSS_PROPERTIES$1[name]) {
|
|
807
807
|
return node.style[name];
|
|
808
808
|
} else {
|
|
809
809
|
return node.getAttributeNS(null, name);
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
812
|
|
|
813
|
-
function setAttribute(node, name, value) {
|
|
813
|
+
function setAttribute$1(node, name, value) {
|
|
814
814
|
var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
815
815
|
|
|
816
|
-
var type = CSS_PROPERTIES[hyphenated];
|
|
816
|
+
var type = CSS_PROPERTIES$1[hyphenated];
|
|
817
817
|
|
|
818
818
|
if (type) {
|
|
819
819
|
|
|
820
820
|
// append pixel unit, unless present
|
|
821
|
-
if (type === LENGTH_ATTR && typeof value === 'number') {
|
|
821
|
+
if (type === LENGTH_ATTR$1 && typeof value === 'number') {
|
|
822
822
|
value = String(value) + 'px';
|
|
823
823
|
}
|
|
824
824
|
|
|
@@ -828,12 +828,12 @@
|
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
830
|
|
|
831
|
-
function setAttributes(node, attrs) {
|
|
831
|
+
function setAttributes$1(node, attrs) {
|
|
832
832
|
|
|
833
833
|
var names = Object.keys(attrs), i, name;
|
|
834
834
|
|
|
835
835
|
for (i = 0, name; (name = names[i]); i++) {
|
|
836
|
-
setAttribute(node, name, attrs[name]);
|
|
836
|
+
setAttribute$1(node, name, attrs[name]);
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
839
|
|
|
@@ -847,15 +847,15 @@
|
|
|
847
847
|
*
|
|
848
848
|
* @return {String}
|
|
849
849
|
*/
|
|
850
|
-
function attr$
|
|
850
|
+
function attr$2(node, name, value) {
|
|
851
851
|
if (typeof name === 'string') {
|
|
852
852
|
if (value !== undefined) {
|
|
853
|
-
setAttribute(node, name, value);
|
|
853
|
+
setAttribute$1(node, name, value);
|
|
854
854
|
} else {
|
|
855
|
-
return getAttribute(node, name);
|
|
855
|
+
return getAttribute$1(node, name);
|
|
856
856
|
}
|
|
857
857
|
} else {
|
|
858
|
-
setAttributes(node, name);
|
|
858
|
+
setAttributes$1(node, name);
|
|
859
859
|
}
|
|
860
860
|
|
|
861
861
|
return node;
|
|
@@ -871,7 +871,7 @@
|
|
|
871
871
|
* toString reference.
|
|
872
872
|
*/
|
|
873
873
|
|
|
874
|
-
const toString$
|
|
874
|
+
const toString$2 = Object.prototype.toString;
|
|
875
875
|
|
|
876
876
|
/**
|
|
877
877
|
* Wrap `el` in a `ClassList`.
|
|
@@ -881,11 +881,11 @@
|
|
|
881
881
|
* @api public
|
|
882
882
|
*/
|
|
883
883
|
|
|
884
|
-
function classes$
|
|
885
|
-
return new ClassList$
|
|
884
|
+
function classes$2(el) {
|
|
885
|
+
return new ClassList$2(el);
|
|
886
886
|
}
|
|
887
887
|
|
|
888
|
-
function ClassList$
|
|
888
|
+
function ClassList$2(el) {
|
|
889
889
|
if (!el || !el.nodeType) {
|
|
890
890
|
throw new Error('A DOM element reference is required');
|
|
891
891
|
}
|
|
@@ -901,7 +901,7 @@
|
|
|
901
901
|
* @api public
|
|
902
902
|
*/
|
|
903
903
|
|
|
904
|
-
ClassList$
|
|
904
|
+
ClassList$2.prototype.add = function(name) {
|
|
905
905
|
this.list.add(name);
|
|
906
906
|
return this;
|
|
907
907
|
};
|
|
@@ -916,8 +916,8 @@
|
|
|
916
916
|
* @api public
|
|
917
917
|
*/
|
|
918
918
|
|
|
919
|
-
ClassList$
|
|
920
|
-
if ('[object RegExp]' == toString$
|
|
919
|
+
ClassList$2.prototype.remove = function(name) {
|
|
920
|
+
if ('[object RegExp]' == toString$2.call(name)) {
|
|
921
921
|
return this.removeMatching(name);
|
|
922
922
|
}
|
|
923
923
|
|
|
@@ -933,7 +933,7 @@
|
|
|
933
933
|
* @api private
|
|
934
934
|
*/
|
|
935
935
|
|
|
936
|
-
ClassList$
|
|
936
|
+
ClassList$2.prototype.removeMatching = function(re) {
|
|
937
937
|
const arr = this.array();
|
|
938
938
|
for (let i = 0; i < arr.length; i++) {
|
|
939
939
|
if (re.test(arr[i])) {
|
|
@@ -955,7 +955,7 @@
|
|
|
955
955
|
* @api public
|
|
956
956
|
*/
|
|
957
957
|
|
|
958
|
-
ClassList$
|
|
958
|
+
ClassList$2.prototype.toggle = function(name, force) {
|
|
959
959
|
if ('undefined' !== typeof force) {
|
|
960
960
|
if (force !== this.list.toggle(name, force)) {
|
|
961
961
|
this.list.toggle(name); // toggle again to correct
|
|
@@ -973,7 +973,7 @@
|
|
|
973
973
|
* @api public
|
|
974
974
|
*/
|
|
975
975
|
|
|
976
|
-
ClassList$
|
|
976
|
+
ClassList$2.prototype.array = function() {
|
|
977
977
|
return Array.from(this.list);
|
|
978
978
|
};
|
|
979
979
|
|
|
@@ -985,12 +985,12 @@
|
|
|
985
985
|
* @api public
|
|
986
986
|
*/
|
|
987
987
|
|
|
988
|
-
ClassList$
|
|
989
|
-
ClassList$
|
|
988
|
+
ClassList$2.prototype.has =
|
|
989
|
+
ClassList$2.prototype.contains = function(name) {
|
|
990
990
|
return this.list.contains(name);
|
|
991
991
|
};
|
|
992
992
|
|
|
993
|
-
function remove$
|
|
993
|
+
function remove$3(element) {
|
|
994
994
|
var parent = element.parentNode;
|
|
995
995
|
|
|
996
996
|
if (parent) {
|
|
@@ -1010,17 +1010,17 @@
|
|
|
1010
1010
|
* @param {DOMElement} element
|
|
1011
1011
|
* @return {DOMElement} the element (for chaining)
|
|
1012
1012
|
*/
|
|
1013
|
-
function clear$
|
|
1013
|
+
function clear$2(element) {
|
|
1014
1014
|
var child;
|
|
1015
1015
|
|
|
1016
1016
|
while ((child = element.firstChild)) {
|
|
1017
|
-
remove$
|
|
1017
|
+
remove$3(child);
|
|
1018
1018
|
}
|
|
1019
1019
|
|
|
1020
1020
|
return element;
|
|
1021
1021
|
}
|
|
1022
1022
|
|
|
1023
|
-
var ns = {
|
|
1023
|
+
var ns$1 = {
|
|
1024
1024
|
svg: 'http://www.w3.org/2000/svg'
|
|
1025
1025
|
};
|
|
1026
1026
|
|
|
@@ -1028,25 +1028,25 @@
|
|
|
1028
1028
|
* DOM parsing utility
|
|
1029
1029
|
*/
|
|
1030
1030
|
|
|
1031
|
-
var SVG_START = '<svg xmlns="' + ns.svg + '"';
|
|
1031
|
+
var SVG_START$1 = '<svg xmlns="' + ns$1.svg + '"';
|
|
1032
1032
|
|
|
1033
|
-
function parse$
|
|
1033
|
+
function parse$2(svg) {
|
|
1034
1034
|
|
|
1035
1035
|
var unwrap = false;
|
|
1036
1036
|
|
|
1037
1037
|
// ensure we import a valid svg document
|
|
1038
1038
|
if (svg.substring(0, 4) === '<svg') {
|
|
1039
|
-
if (svg.indexOf(ns.svg) === -1) {
|
|
1040
|
-
svg = SVG_START + svg.substring(4);
|
|
1039
|
+
if (svg.indexOf(ns$1.svg) === -1) {
|
|
1040
|
+
svg = SVG_START$1 + svg.substring(4);
|
|
1041
1041
|
}
|
|
1042
1042
|
} else {
|
|
1043
1043
|
|
|
1044
1044
|
// namespace svg
|
|
1045
|
-
svg = SVG_START + '>' + svg + '</svg>';
|
|
1045
|
+
svg = SVG_START$1 + '>' + svg + '</svg>';
|
|
1046
1046
|
unwrap = true;
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
|
-
var parsed = parseDocument(svg);
|
|
1049
|
+
var parsed = parseDocument$1(svg);
|
|
1050
1050
|
|
|
1051
1051
|
if (!unwrap) {
|
|
1052
1052
|
return parsed;
|
|
@@ -1063,7 +1063,7 @@
|
|
|
1063
1063
|
return fragment;
|
|
1064
1064
|
}
|
|
1065
1065
|
|
|
1066
|
-
function parseDocument(svg) {
|
|
1066
|
+
function parseDocument$1(svg) {
|
|
1067
1067
|
|
|
1068
1068
|
var parser;
|
|
1069
1069
|
|
|
@@ -1087,18 +1087,18 @@
|
|
|
1087
1087
|
*
|
|
1088
1088
|
* @returns {SVGElement}
|
|
1089
1089
|
*/
|
|
1090
|
-
function create$
|
|
1090
|
+
function create$2(name, attrs) {
|
|
1091
1091
|
var element;
|
|
1092
1092
|
|
|
1093
1093
|
if (name.charAt(0) === '<') {
|
|
1094
|
-
element = parse$
|
|
1094
|
+
element = parse$2(name).firstChild;
|
|
1095
1095
|
element = document.importNode(element, true);
|
|
1096
1096
|
} else {
|
|
1097
|
-
element = document.createElementNS(ns.svg, name);
|
|
1097
|
+
element = document.createElementNS(ns$1.svg, name);
|
|
1098
1098
|
}
|
|
1099
1099
|
|
|
1100
1100
|
if (attrs) {
|
|
1101
|
-
attr$
|
|
1101
|
+
attr$2(element, attrs);
|
|
1102
1102
|
}
|
|
1103
1103
|
|
|
1104
1104
|
return element;
|
|
@@ -1113,7 +1113,7 @@
|
|
|
1113
1113
|
|
|
1114
1114
|
function getNode() {
|
|
1115
1115
|
if (node === null) {
|
|
1116
|
-
node = create$
|
|
1116
|
+
node = create$2('svg');
|
|
1117
1117
|
}
|
|
1118
1118
|
|
|
1119
1119
|
return node;
|
|
@@ -1168,152 +1168,6 @@
|
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
1170
|
|
|
1171
|
-
/**
|
|
1172
|
-
* Serialization util
|
|
1173
|
-
*/
|
|
1174
|
-
|
|
1175
|
-
var TEXT_ENTITIES = /([&<>]{1})/g;
|
|
1176
|
-
var ATTR_ENTITIES = /([\n\r"]{1})/g;
|
|
1177
|
-
|
|
1178
|
-
var ENTITY_REPLACEMENT = {
|
|
1179
|
-
'&': '&',
|
|
1180
|
-
'<': '<',
|
|
1181
|
-
'>': '>',
|
|
1182
|
-
'"': '\''
|
|
1183
|
-
};
|
|
1184
|
-
|
|
1185
|
-
function escape$1(str, pattern) {
|
|
1186
|
-
|
|
1187
|
-
function replaceFn(match, entity) {
|
|
1188
|
-
return ENTITY_REPLACEMENT[entity] || entity;
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
return str.replace(pattern, replaceFn);
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
function serialize(node, output) {
|
|
1195
|
-
|
|
1196
|
-
var i, len, attrMap, attrNode, childNodes;
|
|
1197
|
-
|
|
1198
|
-
switch (node.nodeType) {
|
|
1199
|
-
|
|
1200
|
-
// TEXT
|
|
1201
|
-
case 3:
|
|
1202
|
-
|
|
1203
|
-
// replace special XML characters
|
|
1204
|
-
output.push(escape$1(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$1(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$1(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$1(element, svg) {
|
|
1255
|
-
|
|
1256
|
-
var parsed = parse$1(svg);
|
|
1257
|
-
|
|
1258
|
-
// clear element contents
|
|
1259
|
-
clear$1(element);
|
|
1260
|
-
|
|
1261
|
-
if (!svg) {
|
|
1262
|
-
return;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
if (!isFragment(parsed)) {
|
|
1266
|
-
|
|
1267
|
-
// extract <svg> from parsed document
|
|
1268
|
-
parsed = parsed.documentElement;
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
var nodes = slice$1(parsed.childNodes);
|
|
1272
|
-
|
|
1273
|
-
// import + append each node
|
|
1274
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
1275
|
-
appendTo(nodes[i], element);
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
function get(element) {
|
|
1281
|
-
var child = element.firstChild,
|
|
1282
|
-
output = [];
|
|
1283
|
-
|
|
1284
|
-
while (child) {
|
|
1285
|
-
serialize(child, output);
|
|
1286
|
-
child = child.nextSibling;
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
return output.join('');
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
function isFragment(node) {
|
|
1293
|
-
return node.nodeName === '#document-fragment';
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
function innerSVG(element, svg) {
|
|
1297
|
-
|
|
1298
|
-
if (svg !== undefined) {
|
|
1299
|
-
|
|
1300
|
-
try {
|
|
1301
|
-
set$1(element, svg);
|
|
1302
|
-
} catch (e) {
|
|
1303
|
-
throw new Error('error parsing SVG: ' + e.message);
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
return element;
|
|
1307
|
-
} else {
|
|
1308
|
-
return get(element);
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
function slice$1(arr) {
|
|
1314
|
-
return Array.prototype.slice.call(arr);
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
1171
|
/**
|
|
1318
1172
|
* transform accessor utility
|
|
1319
1173
|
*/
|
|
@@ -1376,18 +1230,18 @@
|
|
|
1376
1230
|
|
|
1377
1231
|
function createLine(points, attrs) {
|
|
1378
1232
|
|
|
1379
|
-
var line = create$
|
|
1380
|
-
attr$
|
|
1233
|
+
var line = create$2('polyline');
|
|
1234
|
+
attr$2(line, { points: toSVGPoints(points) });
|
|
1381
1235
|
|
|
1382
1236
|
if (attrs) {
|
|
1383
|
-
attr$
|
|
1237
|
+
attr$2(line, attrs);
|
|
1384
1238
|
}
|
|
1385
1239
|
|
|
1386
1240
|
return line;
|
|
1387
1241
|
}
|
|
1388
1242
|
|
|
1389
1243
|
function updateLine(gfx, points) {
|
|
1390
|
-
attr$
|
|
1244
|
+
attr$2(gfx, { points: toSVGPoints(points) });
|
|
1391
1245
|
|
|
1392
1246
|
return gfx;
|
|
1393
1247
|
}
|
|
@@ -1656,7 +1510,7 @@
|
|
|
1656
1510
|
* @param {String} [val]
|
|
1657
1511
|
* @api public
|
|
1658
1512
|
*/
|
|
1659
|
-
function attr(el, name, val) {
|
|
1513
|
+
function attr$1(el, name, val) {
|
|
1660
1514
|
|
|
1661
1515
|
// get
|
|
1662
1516
|
if (arguments.length == 2) {
|
|
@@ -1684,7 +1538,7 @@
|
|
|
1684
1538
|
* toString reference.
|
|
1685
1539
|
*/
|
|
1686
1540
|
|
|
1687
|
-
const toString = Object.prototype.toString;
|
|
1541
|
+
const toString$1 = Object.prototype.toString;
|
|
1688
1542
|
|
|
1689
1543
|
/**
|
|
1690
1544
|
* Wrap `el` in a `ClassList`.
|
|
@@ -1694,8 +1548,8 @@
|
|
|
1694
1548
|
* @api public
|
|
1695
1549
|
*/
|
|
1696
1550
|
|
|
1697
|
-
function classes(el) {
|
|
1698
|
-
return new ClassList(el);
|
|
1551
|
+
function classes$1(el) {
|
|
1552
|
+
return new ClassList$1(el);
|
|
1699
1553
|
}
|
|
1700
1554
|
|
|
1701
1555
|
/**
|
|
@@ -1705,7 +1559,7 @@
|
|
|
1705
1559
|
* @api private
|
|
1706
1560
|
*/
|
|
1707
1561
|
|
|
1708
|
-
function ClassList(el) {
|
|
1562
|
+
function ClassList$1(el) {
|
|
1709
1563
|
if (!el || !el.nodeType) {
|
|
1710
1564
|
throw new Error('A DOM element reference is required');
|
|
1711
1565
|
}
|
|
@@ -1721,7 +1575,7 @@
|
|
|
1721
1575
|
* @api public
|
|
1722
1576
|
*/
|
|
1723
1577
|
|
|
1724
|
-
ClassList.prototype.add = function(name) {
|
|
1578
|
+
ClassList$1.prototype.add = function(name) {
|
|
1725
1579
|
this.list.add(name);
|
|
1726
1580
|
return this;
|
|
1727
1581
|
};
|
|
@@ -1736,8 +1590,8 @@
|
|
|
1736
1590
|
* @api public
|
|
1737
1591
|
*/
|
|
1738
1592
|
|
|
1739
|
-
ClassList.prototype.remove = function(name) {
|
|
1740
|
-
if ('[object RegExp]' == toString.call(name)) {
|
|
1593
|
+
ClassList$1.prototype.remove = function(name) {
|
|
1594
|
+
if ('[object RegExp]' == toString$1.call(name)) {
|
|
1741
1595
|
return this.removeMatching(name);
|
|
1742
1596
|
}
|
|
1743
1597
|
|
|
@@ -1753,7 +1607,7 @@
|
|
|
1753
1607
|
* @api private
|
|
1754
1608
|
*/
|
|
1755
1609
|
|
|
1756
|
-
ClassList.prototype.removeMatching = function(re) {
|
|
1610
|
+
ClassList$1.prototype.removeMatching = function(re) {
|
|
1757
1611
|
const arr = this.array();
|
|
1758
1612
|
for (let i = 0; i < arr.length; i++) {
|
|
1759
1613
|
if (re.test(arr[i])) {
|
|
@@ -1775,7 +1629,7 @@
|
|
|
1775
1629
|
* @api public
|
|
1776
1630
|
*/
|
|
1777
1631
|
|
|
1778
|
-
ClassList.prototype.toggle = function(name, force) {
|
|
1632
|
+
ClassList$1.prototype.toggle = function(name, force) {
|
|
1779
1633
|
if ('undefined' !== typeof force) {
|
|
1780
1634
|
if (force !== this.list.toggle(name, force)) {
|
|
1781
1635
|
this.list.toggle(name); // toggle again to correct
|
|
@@ -1793,7 +1647,7 @@
|
|
|
1793
1647
|
* @api public
|
|
1794
1648
|
*/
|
|
1795
1649
|
|
|
1796
|
-
ClassList.prototype.array = function() {
|
|
1650
|
+
ClassList$1.prototype.array = function() {
|
|
1797
1651
|
return Array.from(this.list);
|
|
1798
1652
|
};
|
|
1799
1653
|
|
|
@@ -1805,15 +1659,15 @@
|
|
|
1805
1659
|
* @api public
|
|
1806
1660
|
*/
|
|
1807
1661
|
|
|
1808
|
-
ClassList.prototype.has =
|
|
1809
|
-
ClassList.prototype.contains = function(name) {
|
|
1662
|
+
ClassList$1.prototype.has =
|
|
1663
|
+
ClassList$1.prototype.contains = function(name) {
|
|
1810
1664
|
return this.list.contains(name);
|
|
1811
1665
|
};
|
|
1812
1666
|
|
|
1813
1667
|
/**
|
|
1814
1668
|
* Remove all children from the given element.
|
|
1815
1669
|
*/
|
|
1816
|
-
function clear(el) {
|
|
1670
|
+
function clear$1(el) {
|
|
1817
1671
|
|
|
1818
1672
|
var c;
|
|
1819
1673
|
|
|
@@ -1965,7 +1819,7 @@
|
|
|
1965
1819
|
* Expose `parse`.
|
|
1966
1820
|
*/
|
|
1967
1821
|
|
|
1968
|
-
var domify = parse;
|
|
1822
|
+
var domify = parse$1;
|
|
1969
1823
|
|
|
1970
1824
|
/**
|
|
1971
1825
|
* Tests for browser support.
|
|
@@ -2029,7 +1883,7 @@
|
|
|
2029
1883
|
* @api private
|
|
2030
1884
|
*/
|
|
2031
1885
|
|
|
2032
|
-
function parse(html, doc) {
|
|
1886
|
+
function parse$1(html, doc) {
|
|
2033
1887
|
if ('string' != typeof html) throw new TypeError('String expected');
|
|
2034
1888
|
|
|
2035
1889
|
// default to the global `document` object
|
|
@@ -2087,10 +1941,578 @@
|
|
|
2087
1941
|
return el.querySelectorAll(selector);
|
|
2088
1942
|
}
|
|
2089
1943
|
|
|
2090
|
-
function remove$
|
|
1944
|
+
function remove$2(el) {
|
|
2091
1945
|
el.parentNode && el.parentNode.removeChild(el);
|
|
2092
1946
|
}
|
|
2093
1947
|
|
|
1948
|
+
function ensureImported(element, target) {
|
|
1949
|
+
|
|
1950
|
+
if (element.ownerDocument !== target.ownerDocument) {
|
|
1951
|
+
try {
|
|
1952
|
+
|
|
1953
|
+
// may fail on webkit
|
|
1954
|
+
return target.ownerDocument.importNode(element, true);
|
|
1955
|
+
} catch (e) {
|
|
1956
|
+
|
|
1957
|
+
// ignore
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
return element;
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
/**
|
|
1965
|
+
* appendTo utility
|
|
1966
|
+
*/
|
|
1967
|
+
|
|
1968
|
+
/**
|
|
1969
|
+
* Append a node to a target element and return the appended node.
|
|
1970
|
+
*
|
|
1971
|
+
* @param {SVGElement} element
|
|
1972
|
+
* @param {SVGElement} target
|
|
1973
|
+
*
|
|
1974
|
+
* @return {SVGElement} the appended node
|
|
1975
|
+
*/
|
|
1976
|
+
function appendTo(element, target) {
|
|
1977
|
+
return target.appendChild(ensureImported(element, target));
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
/**
|
|
1981
|
+
* append utility
|
|
1982
|
+
*/
|
|
1983
|
+
|
|
1984
|
+
/**
|
|
1985
|
+
* Append a node to an element
|
|
1986
|
+
*
|
|
1987
|
+
* @param {SVGElement} element
|
|
1988
|
+
* @param {SVGElement} node
|
|
1989
|
+
*
|
|
1990
|
+
* @return {SVGElement} the element
|
|
1991
|
+
*/
|
|
1992
|
+
function append(target, node) {
|
|
1993
|
+
appendTo(node, target);
|
|
1994
|
+
return target;
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
/**
|
|
1998
|
+
* attribute accessor utility
|
|
1999
|
+
*/
|
|
2000
|
+
|
|
2001
|
+
var LENGTH_ATTR = 2;
|
|
2002
|
+
|
|
2003
|
+
var CSS_PROPERTIES = {
|
|
2004
|
+
'alignment-baseline': 1,
|
|
2005
|
+
'baseline-shift': 1,
|
|
2006
|
+
'clip': 1,
|
|
2007
|
+
'clip-path': 1,
|
|
2008
|
+
'clip-rule': 1,
|
|
2009
|
+
'color': 1,
|
|
2010
|
+
'color-interpolation': 1,
|
|
2011
|
+
'color-interpolation-filters': 1,
|
|
2012
|
+
'color-profile': 1,
|
|
2013
|
+
'color-rendering': 1,
|
|
2014
|
+
'cursor': 1,
|
|
2015
|
+
'direction': 1,
|
|
2016
|
+
'display': 1,
|
|
2017
|
+
'dominant-baseline': 1,
|
|
2018
|
+
'enable-background': 1,
|
|
2019
|
+
'fill': 1,
|
|
2020
|
+
'fill-opacity': 1,
|
|
2021
|
+
'fill-rule': 1,
|
|
2022
|
+
'filter': 1,
|
|
2023
|
+
'flood-color': 1,
|
|
2024
|
+
'flood-opacity': 1,
|
|
2025
|
+
'font': 1,
|
|
2026
|
+
'font-family': 1,
|
|
2027
|
+
'font-size': LENGTH_ATTR,
|
|
2028
|
+
'font-size-adjust': 1,
|
|
2029
|
+
'font-stretch': 1,
|
|
2030
|
+
'font-style': 1,
|
|
2031
|
+
'font-variant': 1,
|
|
2032
|
+
'font-weight': 1,
|
|
2033
|
+
'glyph-orientation-horizontal': 1,
|
|
2034
|
+
'glyph-orientation-vertical': 1,
|
|
2035
|
+
'image-rendering': 1,
|
|
2036
|
+
'kerning': 1,
|
|
2037
|
+
'letter-spacing': 1,
|
|
2038
|
+
'lighting-color': 1,
|
|
2039
|
+
'marker': 1,
|
|
2040
|
+
'marker-end': 1,
|
|
2041
|
+
'marker-mid': 1,
|
|
2042
|
+
'marker-start': 1,
|
|
2043
|
+
'mask': 1,
|
|
2044
|
+
'opacity': 1,
|
|
2045
|
+
'overflow': 1,
|
|
2046
|
+
'pointer-events': 1,
|
|
2047
|
+
'shape-rendering': 1,
|
|
2048
|
+
'stop-color': 1,
|
|
2049
|
+
'stop-opacity': 1,
|
|
2050
|
+
'stroke': 1,
|
|
2051
|
+
'stroke-dasharray': 1,
|
|
2052
|
+
'stroke-dashoffset': 1,
|
|
2053
|
+
'stroke-linecap': 1,
|
|
2054
|
+
'stroke-linejoin': 1,
|
|
2055
|
+
'stroke-miterlimit': 1,
|
|
2056
|
+
'stroke-opacity': 1,
|
|
2057
|
+
'stroke-width': LENGTH_ATTR,
|
|
2058
|
+
'text-anchor': 1,
|
|
2059
|
+
'text-decoration': 1,
|
|
2060
|
+
'text-rendering': 1,
|
|
2061
|
+
'unicode-bidi': 1,
|
|
2062
|
+
'visibility': 1,
|
|
2063
|
+
'word-spacing': 1,
|
|
2064
|
+
'writing-mode': 1
|
|
2065
|
+
};
|
|
2066
|
+
|
|
2067
|
+
|
|
2068
|
+
function getAttribute(node, name) {
|
|
2069
|
+
if (CSS_PROPERTIES[name]) {
|
|
2070
|
+
return node.style[name];
|
|
2071
|
+
} else {
|
|
2072
|
+
return node.getAttributeNS(null, name);
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
function setAttribute(node, name, value) {
|
|
2077
|
+
var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
2078
|
+
|
|
2079
|
+
var type = CSS_PROPERTIES[hyphenated];
|
|
2080
|
+
|
|
2081
|
+
if (type) {
|
|
2082
|
+
|
|
2083
|
+
// append pixel unit, unless present
|
|
2084
|
+
if (type === LENGTH_ATTR && typeof value === 'number') {
|
|
2085
|
+
value = String(value) + 'px';
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
node.style[hyphenated] = value;
|
|
2089
|
+
} else {
|
|
2090
|
+
node.setAttributeNS(null, name, value);
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
|
|
2094
|
+
function setAttributes(node, attrs) {
|
|
2095
|
+
|
|
2096
|
+
var names = Object.keys(attrs), i, name;
|
|
2097
|
+
|
|
2098
|
+
for (i = 0, name; (name = names[i]); i++) {
|
|
2099
|
+
setAttribute(node, name, attrs[name]);
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
/**
|
|
2104
|
+
* Gets or sets raw attributes on a node.
|
|
2105
|
+
*
|
|
2106
|
+
* @param {SVGElement} node
|
|
2107
|
+
* @param {Object} [attrs]
|
|
2108
|
+
* @param {String} [name]
|
|
2109
|
+
* @param {String} [value]
|
|
2110
|
+
*
|
|
2111
|
+
* @return {String}
|
|
2112
|
+
*/
|
|
2113
|
+
function attr(node, name, value) {
|
|
2114
|
+
if (typeof name === 'string') {
|
|
2115
|
+
if (value !== undefined) {
|
|
2116
|
+
setAttribute(node, name, value);
|
|
2117
|
+
} else {
|
|
2118
|
+
return getAttribute(node, name);
|
|
2119
|
+
}
|
|
2120
|
+
} else {
|
|
2121
|
+
setAttributes(node, name);
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
return node;
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
/**
|
|
2128
|
+
* Taken from https://github.com/component/classes
|
|
2129
|
+
*
|
|
2130
|
+
* Without the component bits.
|
|
2131
|
+
*/
|
|
2132
|
+
|
|
2133
|
+
/**
|
|
2134
|
+
* toString reference.
|
|
2135
|
+
*/
|
|
2136
|
+
|
|
2137
|
+
const toString = Object.prototype.toString;
|
|
2138
|
+
|
|
2139
|
+
/**
|
|
2140
|
+
* Wrap `el` in a `ClassList`.
|
|
2141
|
+
*
|
|
2142
|
+
* @param {Element} el
|
|
2143
|
+
* @return {ClassList}
|
|
2144
|
+
* @api public
|
|
2145
|
+
*/
|
|
2146
|
+
|
|
2147
|
+
function classes(el) {
|
|
2148
|
+
return new ClassList(el);
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
function ClassList(el) {
|
|
2152
|
+
if (!el || !el.nodeType) {
|
|
2153
|
+
throw new Error('A DOM element reference is required');
|
|
2154
|
+
}
|
|
2155
|
+
this.el = el;
|
|
2156
|
+
this.list = el.classList;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
/**
|
|
2160
|
+
* Add class `name` if not already present.
|
|
2161
|
+
*
|
|
2162
|
+
* @param {String} name
|
|
2163
|
+
* @return {ClassList}
|
|
2164
|
+
* @api public
|
|
2165
|
+
*/
|
|
2166
|
+
|
|
2167
|
+
ClassList.prototype.add = function(name) {
|
|
2168
|
+
this.list.add(name);
|
|
2169
|
+
return this;
|
|
2170
|
+
};
|
|
2171
|
+
|
|
2172
|
+
/**
|
|
2173
|
+
* Remove class `name` when present, or
|
|
2174
|
+
* pass a regular expression to remove
|
|
2175
|
+
* any which match.
|
|
2176
|
+
*
|
|
2177
|
+
* @param {String|RegExp} name
|
|
2178
|
+
* @return {ClassList}
|
|
2179
|
+
* @api public
|
|
2180
|
+
*/
|
|
2181
|
+
|
|
2182
|
+
ClassList.prototype.remove = function(name) {
|
|
2183
|
+
if ('[object RegExp]' == toString.call(name)) {
|
|
2184
|
+
return this.removeMatching(name);
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
this.list.remove(name);
|
|
2188
|
+
return this;
|
|
2189
|
+
};
|
|
2190
|
+
|
|
2191
|
+
/**
|
|
2192
|
+
* Remove all classes matching `re`.
|
|
2193
|
+
*
|
|
2194
|
+
* @param {RegExp} re
|
|
2195
|
+
* @return {ClassList}
|
|
2196
|
+
* @api private
|
|
2197
|
+
*/
|
|
2198
|
+
|
|
2199
|
+
ClassList.prototype.removeMatching = function(re) {
|
|
2200
|
+
const arr = this.array();
|
|
2201
|
+
for (let i = 0; i < arr.length; i++) {
|
|
2202
|
+
if (re.test(arr[i])) {
|
|
2203
|
+
this.remove(arr[i]);
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
return this;
|
|
2207
|
+
};
|
|
2208
|
+
|
|
2209
|
+
/**
|
|
2210
|
+
* Toggle class `name`, can force state via `force`.
|
|
2211
|
+
*
|
|
2212
|
+
* For browsers that support classList, but do not support `force` yet,
|
|
2213
|
+
* the mistake will be detected and corrected.
|
|
2214
|
+
*
|
|
2215
|
+
* @param {String} name
|
|
2216
|
+
* @param {Boolean} force
|
|
2217
|
+
* @return {ClassList}
|
|
2218
|
+
* @api public
|
|
2219
|
+
*/
|
|
2220
|
+
|
|
2221
|
+
ClassList.prototype.toggle = function(name, force) {
|
|
2222
|
+
if ('undefined' !== typeof force) {
|
|
2223
|
+
if (force !== this.list.toggle(name, force)) {
|
|
2224
|
+
this.list.toggle(name); // toggle again to correct
|
|
2225
|
+
}
|
|
2226
|
+
} else {
|
|
2227
|
+
this.list.toggle(name);
|
|
2228
|
+
}
|
|
2229
|
+
return this;
|
|
2230
|
+
};
|
|
2231
|
+
|
|
2232
|
+
/**
|
|
2233
|
+
* Return an array of classes.
|
|
2234
|
+
*
|
|
2235
|
+
* @return {Array}
|
|
2236
|
+
* @api public
|
|
2237
|
+
*/
|
|
2238
|
+
|
|
2239
|
+
ClassList.prototype.array = function() {
|
|
2240
|
+
return Array.from(this.list);
|
|
2241
|
+
};
|
|
2242
|
+
|
|
2243
|
+
/**
|
|
2244
|
+
* Check if class `name` is present.
|
|
2245
|
+
*
|
|
2246
|
+
* @param {String} name
|
|
2247
|
+
* @return {ClassList}
|
|
2248
|
+
* @api public
|
|
2249
|
+
*/
|
|
2250
|
+
|
|
2251
|
+
ClassList.prototype.has =
|
|
2252
|
+
ClassList.prototype.contains = function(name) {
|
|
2253
|
+
return this.list.contains(name);
|
|
2254
|
+
};
|
|
2255
|
+
|
|
2256
|
+
function remove$1(element) {
|
|
2257
|
+
var parent = element.parentNode;
|
|
2258
|
+
|
|
2259
|
+
if (parent) {
|
|
2260
|
+
parent.removeChild(element);
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
return element;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
/**
|
|
2267
|
+
* Clear utility
|
|
2268
|
+
*/
|
|
2269
|
+
|
|
2270
|
+
/**
|
|
2271
|
+
* Removes all children from the given element
|
|
2272
|
+
*
|
|
2273
|
+
* @param {DOMElement} element
|
|
2274
|
+
* @return {DOMElement} the element (for chaining)
|
|
2275
|
+
*/
|
|
2276
|
+
function clear(element) {
|
|
2277
|
+
var child;
|
|
2278
|
+
|
|
2279
|
+
while ((child = element.firstChild)) {
|
|
2280
|
+
remove$1(child);
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
return element;
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
var ns = {
|
|
2287
|
+
svg: 'http://www.w3.org/2000/svg'
|
|
2288
|
+
};
|
|
2289
|
+
|
|
2290
|
+
/**
|
|
2291
|
+
* DOM parsing utility
|
|
2292
|
+
*/
|
|
2293
|
+
|
|
2294
|
+
var SVG_START = '<svg xmlns="' + ns.svg + '"';
|
|
2295
|
+
|
|
2296
|
+
function parse(svg) {
|
|
2297
|
+
|
|
2298
|
+
var unwrap = false;
|
|
2299
|
+
|
|
2300
|
+
// ensure we import a valid svg document
|
|
2301
|
+
if (svg.substring(0, 4) === '<svg') {
|
|
2302
|
+
if (svg.indexOf(ns.svg) === -1) {
|
|
2303
|
+
svg = SVG_START + svg.substring(4);
|
|
2304
|
+
}
|
|
2305
|
+
} else {
|
|
2306
|
+
|
|
2307
|
+
// namespace svg
|
|
2308
|
+
svg = SVG_START + '>' + svg + '</svg>';
|
|
2309
|
+
unwrap = true;
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
var parsed = parseDocument(svg);
|
|
2313
|
+
|
|
2314
|
+
if (!unwrap) {
|
|
2315
|
+
return parsed;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
var fragment = document.createDocumentFragment();
|
|
2319
|
+
|
|
2320
|
+
var parent = parsed.firstChild;
|
|
2321
|
+
|
|
2322
|
+
while (parent.firstChild) {
|
|
2323
|
+
fragment.appendChild(parent.firstChild);
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
return fragment;
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
function parseDocument(svg) {
|
|
2330
|
+
|
|
2331
|
+
var parser;
|
|
2332
|
+
|
|
2333
|
+
// parse
|
|
2334
|
+
parser = new DOMParser();
|
|
2335
|
+
parser.async = false;
|
|
2336
|
+
|
|
2337
|
+
return parser.parseFromString(svg, 'text/xml');
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
/**
|
|
2341
|
+
* Create utility for SVG elements
|
|
2342
|
+
*/
|
|
2343
|
+
|
|
2344
|
+
|
|
2345
|
+
/**
|
|
2346
|
+
* Create a specific type from name or SVG markup.
|
|
2347
|
+
*
|
|
2348
|
+
* @param {String} name the name or markup of the element
|
|
2349
|
+
* @param {Object} [attrs] attributes to set on the element
|
|
2350
|
+
*
|
|
2351
|
+
* @returns {SVGElement}
|
|
2352
|
+
*/
|
|
2353
|
+
function create$1(name, attrs) {
|
|
2354
|
+
var element;
|
|
2355
|
+
|
|
2356
|
+
if (name.charAt(0) === '<') {
|
|
2357
|
+
element = parse(name).firstChild;
|
|
2358
|
+
element = document.importNode(element, true);
|
|
2359
|
+
} else {
|
|
2360
|
+
element = document.createElementNS(ns.svg, name);
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
if (attrs) {
|
|
2364
|
+
attr(element, attrs);
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
return element;
|
|
2368
|
+
}
|
|
2369
|
+
|
|
2370
|
+
/**
|
|
2371
|
+
* Serialization util
|
|
2372
|
+
*/
|
|
2373
|
+
|
|
2374
|
+
var TEXT_ENTITIES = /([&<>]{1})/g;
|
|
2375
|
+
var ATTR_ENTITIES = /([\n\r"]{1})/g;
|
|
2376
|
+
|
|
2377
|
+
var ENTITY_REPLACEMENT = {
|
|
2378
|
+
'&': '&',
|
|
2379
|
+
'<': '<',
|
|
2380
|
+
'>': '>',
|
|
2381
|
+
'"': '\''
|
|
2382
|
+
};
|
|
2383
|
+
|
|
2384
|
+
function escape$1(str, pattern) {
|
|
2385
|
+
|
|
2386
|
+
function replaceFn(match, entity) {
|
|
2387
|
+
return ENTITY_REPLACEMENT[entity] || entity;
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
return str.replace(pattern, replaceFn);
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
function serialize(node, output) {
|
|
2394
|
+
|
|
2395
|
+
var i, len, attrMap, attrNode, childNodes;
|
|
2396
|
+
|
|
2397
|
+
switch (node.nodeType) {
|
|
2398
|
+
|
|
2399
|
+
// TEXT
|
|
2400
|
+
case 3:
|
|
2401
|
+
|
|
2402
|
+
// replace special XML characters
|
|
2403
|
+
output.push(escape$1(node.textContent, TEXT_ENTITIES));
|
|
2404
|
+
break;
|
|
2405
|
+
|
|
2406
|
+
// ELEMENT
|
|
2407
|
+
case 1:
|
|
2408
|
+
output.push('<', node.tagName);
|
|
2409
|
+
|
|
2410
|
+
if (node.hasAttributes()) {
|
|
2411
|
+
attrMap = node.attributes;
|
|
2412
|
+
for (i = 0, len = attrMap.length; i < len; ++i) {
|
|
2413
|
+
attrNode = attrMap.item(i);
|
|
2414
|
+
output.push(' ', attrNode.name, '="', escape$1(attrNode.value, ATTR_ENTITIES), '"');
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
if (node.hasChildNodes()) {
|
|
2419
|
+
output.push('>');
|
|
2420
|
+
childNodes = node.childNodes;
|
|
2421
|
+
for (i = 0, len = childNodes.length; i < len; ++i) {
|
|
2422
|
+
serialize(childNodes.item(i), output);
|
|
2423
|
+
}
|
|
2424
|
+
output.push('</', node.tagName, '>');
|
|
2425
|
+
} else {
|
|
2426
|
+
output.push('/>');
|
|
2427
|
+
}
|
|
2428
|
+
break;
|
|
2429
|
+
|
|
2430
|
+
// COMMENT
|
|
2431
|
+
case 8:
|
|
2432
|
+
output.push('<!--', escape$1(node.nodeValue, TEXT_ENTITIES), '-->');
|
|
2433
|
+
break;
|
|
2434
|
+
|
|
2435
|
+
// CDATA
|
|
2436
|
+
case 4:
|
|
2437
|
+
output.push('<![CDATA[', node.nodeValue, ']]>');
|
|
2438
|
+
break;
|
|
2439
|
+
|
|
2440
|
+
default:
|
|
2441
|
+
throw new Error('unable to handle node ' + node.nodeType);
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
return output;
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
/**
|
|
2448
|
+
* innerHTML like functionality for SVG elements.
|
|
2449
|
+
* based on innerSVG (https://code.google.com/p/innersvg)
|
|
2450
|
+
*/
|
|
2451
|
+
|
|
2452
|
+
|
|
2453
|
+
function set$1(element, svg) {
|
|
2454
|
+
|
|
2455
|
+
var parsed = parse(svg);
|
|
2456
|
+
|
|
2457
|
+
// clear element contents
|
|
2458
|
+
clear(element);
|
|
2459
|
+
|
|
2460
|
+
if (!svg) {
|
|
2461
|
+
return;
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
if (!isFragment(parsed)) {
|
|
2465
|
+
|
|
2466
|
+
// extract <svg> from parsed document
|
|
2467
|
+
parsed = parsed.documentElement;
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
var nodes = slice$1(parsed.childNodes);
|
|
2471
|
+
|
|
2472
|
+
// import + append each node
|
|
2473
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
2474
|
+
appendTo(nodes[i], element);
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
function get(element) {
|
|
2480
|
+
var child = element.firstChild,
|
|
2481
|
+
output = [];
|
|
2482
|
+
|
|
2483
|
+
while (child) {
|
|
2484
|
+
serialize(child, output);
|
|
2485
|
+
child = child.nextSibling;
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
return output.join('');
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
function isFragment(node) {
|
|
2492
|
+
return node.nodeName === '#document-fragment';
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
function innerSVG(element, svg) {
|
|
2496
|
+
|
|
2497
|
+
if (svg !== undefined) {
|
|
2498
|
+
|
|
2499
|
+
try {
|
|
2500
|
+
set$1(element, svg);
|
|
2501
|
+
} catch (e) {
|
|
2502
|
+
throw new Error('error parsing SVG: ' + e.message);
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
return element;
|
|
2506
|
+
} else {
|
|
2507
|
+
return get(element);
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
|
|
2512
|
+
function slice$1(arr) {
|
|
2513
|
+
return Array.prototype.slice.call(arr);
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2094
2516
|
/**
|
|
2095
2517
|
* @param {<SVGElement>} element
|
|
2096
2518
|
* @param {number} x
|
|
@@ -2345,11 +2767,11 @@
|
|
|
2345
2767
|
|
|
2346
2768
|
var marker = create$1('marker');
|
|
2347
2769
|
|
|
2348
|
-
attr
|
|
2770
|
+
attr(options.element, attrs);
|
|
2349
2771
|
|
|
2350
2772
|
append(marker, options.element);
|
|
2351
2773
|
|
|
2352
|
-
attr
|
|
2774
|
+
attr(marker, {
|
|
2353
2775
|
id: id,
|
|
2354
2776
|
viewBox: '0 0 20 20',
|
|
2355
2777
|
refX: ref.x,
|
|
@@ -2392,7 +2814,7 @@
|
|
|
2392
2814
|
|
|
2393
2815
|
if (type === 'sequenceflow-end') {
|
|
2394
2816
|
var sequenceflowEnd = create$1('path');
|
|
2395
|
-
attr
|
|
2817
|
+
attr(sequenceflowEnd, { d: 'M 1 5 L 11 10 L 1 15 Z' });
|
|
2396
2818
|
|
|
2397
2819
|
addMarker(id, {
|
|
2398
2820
|
element: sequenceflowEnd,
|
|
@@ -2407,7 +2829,7 @@
|
|
|
2407
2829
|
|
|
2408
2830
|
if (type === 'messageflow-start') {
|
|
2409
2831
|
var messageflowStart = create$1('circle');
|
|
2410
|
-
attr
|
|
2832
|
+
attr(messageflowStart, { cx: 6, cy: 6, r: 3.5 });
|
|
2411
2833
|
|
|
2412
2834
|
addMarker(id, {
|
|
2413
2835
|
element: messageflowStart,
|
|
@@ -2421,7 +2843,7 @@
|
|
|
2421
2843
|
|
|
2422
2844
|
if (type === 'messageflow-end') {
|
|
2423
2845
|
var messageflowEnd = create$1('path');
|
|
2424
|
-
attr
|
|
2846
|
+
attr(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
|
|
2425
2847
|
|
|
2426
2848
|
addMarker(id, {
|
|
2427
2849
|
element: messageflowEnd,
|
|
@@ -2436,7 +2858,7 @@
|
|
|
2436
2858
|
|
|
2437
2859
|
if (type === 'association-start') {
|
|
2438
2860
|
var associationStart = create$1('path');
|
|
2439
|
-
attr
|
|
2861
|
+
attr(associationStart, { d: 'M 11 5 L 1 10 L 11 15' });
|
|
2440
2862
|
|
|
2441
2863
|
addMarker(id, {
|
|
2442
2864
|
element: associationStart,
|
|
@@ -2452,7 +2874,7 @@
|
|
|
2452
2874
|
|
|
2453
2875
|
if (type === 'association-end') {
|
|
2454
2876
|
var associationEnd = create$1('path');
|
|
2455
|
-
attr
|
|
2877
|
+
attr(associationEnd, { d: 'M 1 5 L 11 10 L 1 15' });
|
|
2456
2878
|
|
|
2457
2879
|
addMarker(id, {
|
|
2458
2880
|
element: associationEnd,
|
|
@@ -2468,7 +2890,7 @@
|
|
|
2468
2890
|
|
|
2469
2891
|
if (type === 'conditional-flow-marker') {
|
|
2470
2892
|
var conditionalflowMarker = create$1('path');
|
|
2471
|
-
attr
|
|
2893
|
+
attr(conditionalflowMarker, { d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z' });
|
|
2472
2894
|
|
|
2473
2895
|
addMarker(id, {
|
|
2474
2896
|
element: conditionalflowMarker,
|
|
@@ -2483,7 +2905,7 @@
|
|
|
2483
2905
|
|
|
2484
2906
|
if (type === 'conditional-default-flow-marker') {
|
|
2485
2907
|
var conditionaldefaultflowMarker = create$1('path');
|
|
2486
|
-
attr
|
|
2908
|
+
attr(conditionaldefaultflowMarker, { d: 'M 6 4 L 10 16' });
|
|
2487
2909
|
|
|
2488
2910
|
addMarker(id, {
|
|
2489
2911
|
element: conditionaldefaultflowMarker,
|
|
@@ -2519,12 +2941,12 @@
|
|
|
2519
2941
|
cy = height / 2;
|
|
2520
2942
|
|
|
2521
2943
|
var circle = create$1('circle');
|
|
2522
|
-
attr
|
|
2944
|
+
attr(circle, {
|
|
2523
2945
|
cx: cx,
|
|
2524
2946
|
cy: cy,
|
|
2525
2947
|
r: Math.round((width + height) / 4 - offset)
|
|
2526
2948
|
});
|
|
2527
|
-
attr
|
|
2949
|
+
attr(circle, attrs);
|
|
2528
2950
|
|
|
2529
2951
|
append(parentGfx, circle);
|
|
2530
2952
|
|
|
@@ -2547,7 +2969,7 @@
|
|
|
2547
2969
|
});
|
|
2548
2970
|
|
|
2549
2971
|
var rect = create$1('rect');
|
|
2550
|
-
attr
|
|
2972
|
+
attr(rect, {
|
|
2551
2973
|
x: offset,
|
|
2552
2974
|
y: offset,
|
|
2553
2975
|
width: width - offset * 2,
|
|
@@ -2555,7 +2977,7 @@
|
|
|
2555
2977
|
rx: r,
|
|
2556
2978
|
ry: r
|
|
2557
2979
|
});
|
|
2558
|
-
attr
|
|
2980
|
+
attr(rect, attrs);
|
|
2559
2981
|
|
|
2560
2982
|
append(parentGfx, rect);
|
|
2561
2983
|
|
|
@@ -2580,10 +3002,10 @@
|
|
|
2580
3002
|
});
|
|
2581
3003
|
|
|
2582
3004
|
var polygon = create$1('polygon');
|
|
2583
|
-
attr
|
|
3005
|
+
attr(polygon, {
|
|
2584
3006
|
points: pointsString
|
|
2585
3007
|
});
|
|
2586
|
-
attr
|
|
3008
|
+
attr(polygon, attrs);
|
|
2587
3009
|
|
|
2588
3010
|
append(parentGfx, polygon);
|
|
2589
3011
|
|
|
@@ -2612,8 +3034,8 @@
|
|
|
2612
3034
|
});
|
|
2613
3035
|
|
|
2614
3036
|
var path = create$1('path');
|
|
2615
|
-
attr
|
|
2616
|
-
attr
|
|
3037
|
+
attr(path, { d: d });
|
|
3038
|
+
attr(path, attrs);
|
|
2617
3039
|
|
|
2618
3040
|
append(parentGfx, path);
|
|
2619
3041
|
|
|
@@ -2701,7 +3123,7 @@
|
|
|
2701
3123
|
|
|
2702
3124
|
var text = textRenderer.createText(label || '', options);
|
|
2703
3125
|
|
|
2704
|
-
classes
|
|
3126
|
+
classes(text).add('djs-label');
|
|
2705
3127
|
|
|
2706
3128
|
append(parentGfx, text);
|
|
2707
3129
|
|
|
@@ -3313,7 +3735,7 @@
|
|
|
3313
3735
|
});
|
|
3314
3736
|
|
|
3315
3737
|
var businessHeaderPath = drawPath(parentGfx, headerPathData);
|
|
3316
|
-
attr
|
|
3738
|
+
attr(businessHeaderPath, {
|
|
3317
3739
|
strokeWidth: 1,
|
|
3318
3740
|
fill: getFillColor(element, '#aaaaaa'),
|
|
3319
3741
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
@@ -3327,7 +3749,7 @@
|
|
|
3327
3749
|
});
|
|
3328
3750
|
|
|
3329
3751
|
var businessPath = drawPath(parentGfx, headerData);
|
|
3330
|
-
attr
|
|
3752
|
+
attr(businessPath, {
|
|
3331
3753
|
strokeWidth: 1,
|
|
3332
3754
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3333
3755
|
});
|
|
@@ -3345,7 +3767,7 @@
|
|
|
3345
3767
|
var expanded = isExpanded(element);
|
|
3346
3768
|
|
|
3347
3769
|
if (isEventSubProcess(element)) {
|
|
3348
|
-
attr
|
|
3770
|
+
attr(rect, {
|
|
3349
3771
|
strokeDasharray: '1,2'
|
|
3350
3772
|
});
|
|
3351
3773
|
}
|
|
@@ -3567,7 +3989,7 @@
|
|
|
3567
3989
|
});
|
|
3568
3990
|
|
|
3569
3991
|
var parallelPath = drawPath(parentGfx, pathData);
|
|
3570
|
-
attr
|
|
3992
|
+
attr(parallelPath, {
|
|
3571
3993
|
strokeWidth: 1,
|
|
3572
3994
|
fill: 'none'
|
|
3573
3995
|
});
|
|
@@ -3575,7 +3997,7 @@
|
|
|
3575
3997
|
|
|
3576
3998
|
if (!instantiate) {
|
|
3577
3999
|
var innerCircle = drawCircle(parentGfx, element.width, element.height, element.height * 0.26);
|
|
3578
|
-
attr
|
|
4000
|
+
attr(innerCircle, {
|
|
3579
4001
|
strokeWidth: 1,
|
|
3580
4002
|
fill: 'none',
|
|
3581
4003
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
@@ -3620,7 +4042,7 @@
|
|
|
3620
4042
|
|
|
3621
4043
|
// conditional flow marker
|
|
3622
4044
|
if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Activity')) {
|
|
3623
|
-
attr
|
|
4045
|
+
attr(path, {
|
|
3624
4046
|
markerStart: marker('conditional-flow-marker', fill, stroke)
|
|
3625
4047
|
});
|
|
3626
4048
|
}
|
|
@@ -3628,7 +4050,7 @@
|
|
|
3628
4050
|
// default marker
|
|
3629
4051
|
if (source.default && (source.$instanceOf('bpmn:Gateway') || source.$instanceOf('bpmn:Activity')) &&
|
|
3630
4052
|
source.default === sequenceFlow) {
|
|
3631
|
-
attr
|
|
4053
|
+
attr(path, {
|
|
3632
4054
|
markerStart: marker('conditional-default-flow-marker', fill, stroke)
|
|
3633
4055
|
});
|
|
3634
4056
|
}
|
|
@@ -4346,9 +4768,9 @@
|
|
|
4346
4768
|
var helperSvg = document.getElementById('helper-svg');
|
|
4347
4769
|
|
|
4348
4770
|
if (!helperSvg) {
|
|
4349
|
-
helperSvg = create$
|
|
4771
|
+
helperSvg = create$2('svg');
|
|
4350
4772
|
|
|
4351
|
-
attr$
|
|
4773
|
+
attr$2(helperSvg, {
|
|
4352
4774
|
id: 'helper-svg'
|
|
4353
4775
|
});
|
|
4354
4776
|
|
|
@@ -4442,13 +4864,13 @@
|
|
|
4442
4864
|
var maxWidth = box.width - padding.left - padding.right;
|
|
4443
4865
|
|
|
4444
4866
|
// ensure correct rendering by attaching helper text node to invisible SVG
|
|
4445
|
-
var helperText = create$
|
|
4446
|
-
attr$
|
|
4447
|
-
attr$
|
|
4867
|
+
var helperText = create$2('text');
|
|
4868
|
+
attr$2(helperText, { x: 0, y: 0 });
|
|
4869
|
+
attr$2(helperText, style);
|
|
4448
4870
|
|
|
4449
4871
|
var helperSvg = getHelperSvg();
|
|
4450
4872
|
|
|
4451
|
-
append(helperSvg, helperText);
|
|
4873
|
+
append$1(helperSvg, helperText);
|
|
4452
4874
|
|
|
4453
4875
|
while (lines.length) {
|
|
4454
4876
|
layouted.push(layoutNext(lines, maxWidth, helperText));
|
|
@@ -4477,9 +4899,9 @@
|
|
|
4477
4899
|
y -= (lineHeight || layouted[0].height) / 4;
|
|
4478
4900
|
|
|
4479
4901
|
|
|
4480
|
-
var textElement = create$
|
|
4902
|
+
var textElement = create$2('text');
|
|
4481
4903
|
|
|
4482
|
-
attr$
|
|
4904
|
+
attr$2(textElement, style);
|
|
4483
4905
|
|
|
4484
4906
|
// layout each line taking into account that parent
|
|
4485
4907
|
// shape might resize to fit text size
|
|
@@ -4506,15 +4928,15 @@
|
|
|
4506
4928
|
- line.width) / 2 + padding.left), 0);
|
|
4507
4929
|
}
|
|
4508
4930
|
|
|
4509
|
-
var tspan = create$
|
|
4510
|
-
attr$
|
|
4931
|
+
var tspan = create$2('tspan');
|
|
4932
|
+
attr$2(tspan, { x: x, y: y });
|
|
4511
4933
|
|
|
4512
4934
|
tspan.textContent = line.text;
|
|
4513
4935
|
|
|
4514
|
-
append(textElement, tspan);
|
|
4936
|
+
append$1(textElement, tspan);
|
|
4515
4937
|
});
|
|
4516
4938
|
|
|
4517
|
-
remove$
|
|
4939
|
+
remove$3(helperText);
|
|
4518
4940
|
|
|
4519
4941
|
var dimensions = {
|
|
4520
4942
|
width: maxLineWidth,
|
|
@@ -6102,13 +6524,13 @@
|
|
|
6102
6524
|
throw new Error('invalid hit type <' + type + '>');
|
|
6103
6525
|
}
|
|
6104
6526
|
|
|
6105
|
-
attr$
|
|
6527
|
+
attr$2(hit, attrs);
|
|
6106
6528
|
|
|
6107
6529
|
return hit;
|
|
6108
6530
|
}
|
|
6109
6531
|
|
|
6110
6532
|
function appendHit(gfx, hit) {
|
|
6111
|
-
append(gfx, hit);
|
|
6533
|
+
append$1(gfx, hit);
|
|
6112
6534
|
}
|
|
6113
6535
|
|
|
6114
6536
|
|
|
@@ -6122,7 +6544,7 @@
|
|
|
6122
6544
|
this.removeHits = function(gfx) {
|
|
6123
6545
|
var hits = all('.djs-hit', gfx);
|
|
6124
6546
|
|
|
6125
|
-
forEach$1(hits, remove$
|
|
6547
|
+
forEach$1(hits, remove$3);
|
|
6126
6548
|
};
|
|
6127
6549
|
|
|
6128
6550
|
/**
|
|
@@ -6186,11 +6608,11 @@
|
|
|
6186
6608
|
y: 0
|
|
6187
6609
|
}, attrs);
|
|
6188
6610
|
|
|
6189
|
-
var hit = create$
|
|
6611
|
+
var hit = create$2('rect');
|
|
6190
6612
|
|
|
6191
6613
|
applyStyle(hit, type);
|
|
6192
6614
|
|
|
6193
|
-
attr$
|
|
6615
|
+
attr$2(hit, attrs);
|
|
6194
6616
|
|
|
6195
6617
|
appendHit(gfx, hit);
|
|
6196
6618
|
|
|
@@ -6216,7 +6638,7 @@
|
|
|
6216
6638
|
if (element.waypoints) {
|
|
6217
6639
|
updateLine(hit, element.waypoints);
|
|
6218
6640
|
} else {
|
|
6219
|
-
attr$
|
|
6641
|
+
attr$2(hit, {
|
|
6220
6642
|
width: element.width,
|
|
6221
6643
|
height: element.height
|
|
6222
6644
|
});
|
|
@@ -6424,9 +6846,9 @@
|
|
|
6424
6846
|
var self = this;
|
|
6425
6847
|
|
|
6426
6848
|
function createOutline(gfx, bounds) {
|
|
6427
|
-
var outline = create$
|
|
6849
|
+
var outline = create$2('rect');
|
|
6428
6850
|
|
|
6429
|
-
attr$
|
|
6851
|
+
attr$2(outline, assign$1({
|
|
6430
6852
|
x: 10,
|
|
6431
6853
|
y: 10,
|
|
6432
6854
|
rx: 3,
|
|
@@ -6434,7 +6856,7 @@
|
|
|
6434
6856
|
height: 100
|
|
6435
6857
|
}, OUTLINE_STYLE));
|
|
6436
6858
|
|
|
6437
|
-
append(gfx, outline);
|
|
6859
|
+
append$1(gfx, outline);
|
|
6438
6860
|
|
|
6439
6861
|
return outline;
|
|
6440
6862
|
}
|
|
@@ -6478,7 +6900,7 @@
|
|
|
6478
6900
|
*/
|
|
6479
6901
|
Outline.prototype.updateShapeOutline = function(outline, element) {
|
|
6480
6902
|
|
|
6481
|
-
attr$
|
|
6903
|
+
attr$2(outline, {
|
|
6482
6904
|
x: -this.offset,
|
|
6483
6905
|
y: -this.offset,
|
|
6484
6906
|
width: element.width + this.offset * 2,
|
|
@@ -6499,7 +6921,7 @@
|
|
|
6499
6921
|
|
|
6500
6922
|
var bbox = getBBox(connection);
|
|
6501
6923
|
|
|
6502
|
-
attr$
|
|
6924
|
+
attr$2(outline, {
|
|
6503
6925
|
x: bbox.x - this.offset,
|
|
6504
6926
|
y: bbox.y - this.offset,
|
|
6505
6927
|
width: bbox.width + this.offset * 2,
|
|
@@ -6703,13 +7125,13 @@
|
|
|
6703
7125
|
SelectionVisuals.prototype._updateSelectionOutline = function(selection) {
|
|
6704
7126
|
var layer = this._canvas.getLayer('selectionOutline');
|
|
6705
7127
|
|
|
6706
|
-
clear$
|
|
7128
|
+
clear$2(layer);
|
|
6707
7129
|
|
|
6708
7130
|
var enabled = selection.length > 1;
|
|
6709
7131
|
|
|
6710
7132
|
var container = this._canvas.getContainer();
|
|
6711
7133
|
|
|
6712
|
-
classes$
|
|
7134
|
+
classes$2(container)[enabled ? 'add' : 'remove']('djs-multi-select');
|
|
6713
7135
|
|
|
6714
7136
|
if (!enabled) {
|
|
6715
7137
|
return;
|
|
@@ -6717,15 +7139,15 @@
|
|
|
6717
7139
|
|
|
6718
7140
|
var bBox = addSelectionOutlinePadding(getBBox(selection));
|
|
6719
7141
|
|
|
6720
|
-
var rect = create$
|
|
7142
|
+
var rect = create$2('rect');
|
|
6721
7143
|
|
|
6722
|
-
attr$
|
|
7144
|
+
attr$2(rect, assign$1({
|
|
6723
7145
|
rx: 3
|
|
6724
7146
|
}, bBox));
|
|
6725
7147
|
|
|
6726
|
-
classes$
|
|
7148
|
+
classes$2(rect).add('djs-selection-outline');
|
|
6727
7149
|
|
|
6728
|
-
append(layer, rect);
|
|
7150
|
+
append$1(layer, rect);
|
|
6729
7151
|
};
|
|
6730
7152
|
|
|
6731
7153
|
// helpers //////////
|
|
@@ -7134,8 +7556,8 @@
|
|
|
7134
7556
|
var container = self._getOverlayContainer(overlay.element, true);
|
|
7135
7557
|
|
|
7136
7558
|
if (overlay) {
|
|
7137
|
-
remove$
|
|
7138
|
-
remove$
|
|
7559
|
+
remove$2(overlay.html);
|
|
7560
|
+
remove$2(overlay.htmlContainer);
|
|
7139
7561
|
|
|
7140
7562
|
delete overlay.htmlContainer;
|
|
7141
7563
|
delete overlay.element;
|
|
@@ -7168,7 +7590,7 @@
|
|
|
7168
7590
|
|
|
7169
7591
|
this._overlayContainers = [];
|
|
7170
7592
|
|
|
7171
|
-
clear(this._overlayRoot);
|
|
7593
|
+
clear$1(this._overlayRoot);
|
|
7172
7594
|
};
|
|
7173
7595
|
|
|
7174
7596
|
Overlays.prototype._updateOverlayContainer = function(container) {
|
|
@@ -7189,7 +7611,7 @@
|
|
|
7189
7611
|
|
|
7190
7612
|
setPosition(html, x, y);
|
|
7191
7613
|
|
|
7192
|
-
attr(container.html, 'data-container-id', element.id);
|
|
7614
|
+
attr$1(container.html, 'data-container-id', element.id);
|
|
7193
7615
|
};
|
|
7194
7616
|
|
|
7195
7617
|
|
|
@@ -7316,7 +7738,7 @@
|
|
|
7316
7738
|
htmlContainer.appendChild(html);
|
|
7317
7739
|
|
|
7318
7740
|
if (overlay.type) {
|
|
7319
|
-
classes(htmlContainer).add('djs-overlay-' + overlay.type);
|
|
7741
|
+
classes$1(htmlContainer).add('djs-overlay-' + overlay.type);
|
|
7320
7742
|
}
|
|
7321
7743
|
|
|
7322
7744
|
var elementRoot = this._canvas.findRoot(element);
|
|
@@ -7445,7 +7867,7 @@
|
|
|
7445
7867
|
var container = self._getOverlayContainer(element);
|
|
7446
7868
|
|
|
7447
7869
|
if (container) {
|
|
7448
|
-
remove$
|
|
7870
|
+
remove$2(container.html);
|
|
7449
7871
|
var i = self._overlayContainers.indexOf(container);
|
|
7450
7872
|
if (i !== -1) {
|
|
7451
7873
|
self._overlayContainers.splice(i, 1);
|
|
@@ -7476,7 +7898,7 @@
|
|
|
7476
7898
|
eventBus.on('element.marker.update', function(e) {
|
|
7477
7899
|
var container = self._getOverlayContainer(e.element, true);
|
|
7478
7900
|
if (container) {
|
|
7479
|
-
classes(container.html)[e.add ? 'add' : 'remove'](e.marker);
|
|
7901
|
+
classes$1(container.html)[e.add ? 'add' : 'remove'](e.marker);
|
|
7480
7902
|
}
|
|
7481
7903
|
});
|
|
7482
7904
|
|
|
@@ -7941,7 +8363,7 @@
|
|
|
7941
8363
|
function DrilldownBreadcrumbs(eventBus, elementRegistry, overlays, canvas) {
|
|
7942
8364
|
var breadcrumbs = domify$1('<ul class="bjs-breadcrumbs"></ul>');
|
|
7943
8365
|
var container = canvas.getContainer();
|
|
7944
|
-
var containerClasses = classes(container);
|
|
8366
|
+
var containerClasses = classes$1(container);
|
|
7945
8367
|
container.appendChild(breadcrumbs);
|
|
7946
8368
|
|
|
7947
8369
|
var boParents = [];
|
|
@@ -8497,7 +8919,7 @@
|
|
|
8497
8919
|
}
|
|
8498
8920
|
|
|
8499
8921
|
var hasContent = bo && bo.flowElements && bo.flowElements.length;
|
|
8500
|
-
classes(overlay.html).toggle(EMPTY_MARKER, !hasContent);
|
|
8922
|
+
classes$1(overlay.html).toggle(EMPTY_MARKER, !hasContent);
|
|
8501
8923
|
};
|
|
8502
8924
|
|
|
8503
8925
|
/**
|
|
@@ -9049,9 +9471,9 @@
|
|
|
9049
9471
|
};
|
|
9050
9472
|
|
|
9051
9473
|
DefaultRenderer.prototype.drawShape = function drawShape(visuals, element, attrs) {
|
|
9052
|
-
var rect = create$
|
|
9474
|
+
var rect = create$2('rect');
|
|
9053
9475
|
|
|
9054
|
-
attr$
|
|
9476
|
+
attr$2(rect, {
|
|
9055
9477
|
x: 0,
|
|
9056
9478
|
y: 0,
|
|
9057
9479
|
width: element.width || 0,
|
|
@@ -9059,12 +9481,12 @@
|
|
|
9059
9481
|
});
|
|
9060
9482
|
|
|
9061
9483
|
if (isFrameElement(element)) {
|
|
9062
|
-
attr$
|
|
9484
|
+
attr$2(rect, assign$1({}, this.FRAME_STYLE, attrs || {}));
|
|
9063
9485
|
} else {
|
|
9064
|
-
attr$
|
|
9486
|
+
attr$2(rect, assign$1({}, this.SHAPE_STYLE, attrs || {}));
|
|
9065
9487
|
}
|
|
9066
9488
|
|
|
9067
|
-
append(visuals, rect);
|
|
9489
|
+
append$1(visuals, rect);
|
|
9068
9490
|
|
|
9069
9491
|
return rect;
|
|
9070
9492
|
};
|
|
@@ -9072,7 +9494,7 @@
|
|
|
9072
9494
|
DefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) {
|
|
9073
9495
|
|
|
9074
9496
|
var line = createLine(connection.waypoints, assign$1({}, this.CONNECTION_STYLE, attrs || {}));
|
|
9075
|
-
append(visuals, line);
|
|
9497
|
+
append$1(visuals, line);
|
|
9076
9498
|
|
|
9077
9499
|
return line;
|
|
9078
9500
|
};
|
|
@@ -9310,8 +9732,8 @@
|
|
|
9310
9732
|
}
|
|
9311
9733
|
|
|
9312
9734
|
function createGroup(parent, cls, childIndex) {
|
|
9313
|
-
const group = create$
|
|
9314
|
-
classes$
|
|
9735
|
+
const group = create$2('g');
|
|
9736
|
+
classes$2(group).add(cls);
|
|
9315
9737
|
|
|
9316
9738
|
const index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;
|
|
9317
9739
|
|
|
@@ -9389,10 +9811,10 @@
|
|
|
9389
9811
|
// html container
|
|
9390
9812
|
const container = this._container = createContainer(config);
|
|
9391
9813
|
|
|
9392
|
-
const svg = this._svg = create$
|
|
9393
|
-
attr$
|
|
9814
|
+
const svg = this._svg = create$2('svg');
|
|
9815
|
+
attr$2(svg, { width: '100%', height: '100%' });
|
|
9394
9816
|
|
|
9395
|
-
append(container, svg);
|
|
9817
|
+
append$1(container, svg);
|
|
9396
9818
|
|
|
9397
9819
|
const viewport = this._viewport = createGroup(svg, 'viewport');
|
|
9398
9820
|
|
|
@@ -9630,7 +10052,7 @@
|
|
|
9630
10052
|
return group;
|
|
9631
10053
|
}
|
|
9632
10054
|
|
|
9633
|
-
remove$
|
|
10055
|
+
remove$3(group);
|
|
9634
10056
|
|
|
9635
10057
|
layer.visible = false;
|
|
9636
10058
|
|
|
@@ -9645,7 +10067,7 @@
|
|
|
9645
10067
|
if (layer) {
|
|
9646
10068
|
delete this._layers[name];
|
|
9647
10069
|
|
|
9648
|
-
remove$
|
|
10070
|
+
remove$3(layer.group);
|
|
9649
10071
|
}
|
|
9650
10072
|
};
|
|
9651
10073
|
|
|
@@ -9738,9 +10160,9 @@
|
|
|
9738
10160
|
|
|
9739
10161
|
// invoke either addClass or removeClass based on mode
|
|
9740
10162
|
if (add) {
|
|
9741
|
-
classes$
|
|
10163
|
+
classes$2(gfx).add(marker);
|
|
9742
10164
|
} else {
|
|
9743
|
-
classes$
|
|
10165
|
+
classes$2(gfx).remove(marker);
|
|
9744
10166
|
}
|
|
9745
10167
|
}
|
|
9746
10168
|
});
|
|
@@ -9806,7 +10228,7 @@
|
|
|
9806
10228
|
|
|
9807
10229
|
const gfx = this.getGraphics(element);
|
|
9808
10230
|
|
|
9809
|
-
return classes$
|
|
10231
|
+
return classes$2(gfx).has(marker);
|
|
9810
10232
|
};
|
|
9811
10233
|
|
|
9812
10234
|
/**
|
|
@@ -10704,10 +11126,10 @@
|
|
|
10704
11126
|
this._validateId(id);
|
|
10705
11127
|
|
|
10706
11128
|
// associate dom node with element
|
|
10707
|
-
attr$
|
|
11129
|
+
attr$2(gfx, ELEMENT_ID, id);
|
|
10708
11130
|
|
|
10709
11131
|
if (secondaryGfx) {
|
|
10710
|
-
attr$
|
|
11132
|
+
attr$2(secondaryGfx, ELEMENT_ID, id);
|
|
10711
11133
|
}
|
|
10712
11134
|
|
|
10713
11135
|
this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };
|
|
@@ -10726,10 +11148,10 @@
|
|
|
10726
11148
|
if (container) {
|
|
10727
11149
|
|
|
10728
11150
|
// unset element id on gfx
|
|
10729
|
-
attr$
|
|
11151
|
+
attr$2(container.gfx, ELEMENT_ID, '');
|
|
10730
11152
|
|
|
10731
11153
|
if (container.secondaryGfx) {
|
|
10732
|
-
attr$
|
|
11154
|
+
attr$2(container.secondaryGfx, ELEMENT_ID, '');
|
|
10733
11155
|
}
|
|
10734
11156
|
|
|
10735
11157
|
delete elements[id];
|
|
@@ -10784,7 +11206,7 @@
|
|
|
10784
11206
|
}
|
|
10785
11207
|
|
|
10786
11208
|
if (gfx) {
|
|
10787
|
-
attr$
|
|
11209
|
+
attr$2(gfx, ELEMENT_ID, id);
|
|
10788
11210
|
}
|
|
10789
11211
|
|
|
10790
11212
|
return gfx;
|
|
@@ -10809,7 +11231,7 @@
|
|
|
10809
11231
|
if (typeof filter === 'string') {
|
|
10810
11232
|
id = filter;
|
|
10811
11233
|
} else {
|
|
10812
|
-
id = filter && attr$
|
|
11234
|
+
id = filter && attr$2(filter, ELEMENT_ID);
|
|
10813
11235
|
}
|
|
10814
11236
|
|
|
10815
11237
|
var container = this._elements[id];
|
|
@@ -12092,10 +12514,10 @@
|
|
|
12092
12514
|
} else {
|
|
12093
12515
|
childrenGfx = getChildren(gfx);
|
|
12094
12516
|
if (!childrenGfx) {
|
|
12095
|
-
childrenGfx = create$
|
|
12096
|
-
classes$
|
|
12517
|
+
childrenGfx = create$2('g');
|
|
12518
|
+
classes$2(childrenGfx).add('djs-children');
|
|
12097
12519
|
|
|
12098
|
-
append(gfx.parentNode, childrenGfx);
|
|
12520
|
+
append$1(gfx.parentNode, childrenGfx);
|
|
12099
12521
|
}
|
|
12100
12522
|
}
|
|
12101
12523
|
|
|
@@ -12109,7 +12531,7 @@
|
|
|
12109
12531
|
GraphicsFactory.prototype._clear = function(gfx) {
|
|
12110
12532
|
var visual = getVisual(gfx);
|
|
12111
12533
|
|
|
12112
|
-
clear(visual);
|
|
12534
|
+
clear$1(visual);
|
|
12113
12535
|
|
|
12114
12536
|
return visual;
|
|
12115
12537
|
};
|
|
@@ -12144,31 +12566,31 @@
|
|
|
12144
12566
|
GraphicsFactory.prototype._createContainer = function(
|
|
12145
12567
|
type, childrenGfx, parentIndex, isFrame
|
|
12146
12568
|
) {
|
|
12147
|
-
var outerGfx = create$
|
|
12148
|
-
classes$
|
|
12569
|
+
var outerGfx = create$2('g');
|
|
12570
|
+
classes$2(outerGfx).add('djs-group');
|
|
12149
12571
|
|
|
12150
12572
|
// insert node at position
|
|
12151
12573
|
if (typeof parentIndex !== 'undefined') {
|
|
12152
12574
|
prependTo(outerGfx, childrenGfx, childrenGfx.childNodes[parentIndex]);
|
|
12153
12575
|
} else {
|
|
12154
|
-
append(childrenGfx, outerGfx);
|
|
12576
|
+
append$1(childrenGfx, outerGfx);
|
|
12155
12577
|
}
|
|
12156
12578
|
|
|
12157
|
-
var gfx = create$
|
|
12158
|
-
classes$
|
|
12159
|
-
classes$
|
|
12579
|
+
var gfx = create$2('g');
|
|
12580
|
+
classes$2(gfx).add('djs-element');
|
|
12581
|
+
classes$2(gfx).add('djs-' + type);
|
|
12160
12582
|
|
|
12161
12583
|
if (isFrame) {
|
|
12162
|
-
classes$
|
|
12584
|
+
classes$2(gfx).add('djs-frame');
|
|
12163
12585
|
}
|
|
12164
12586
|
|
|
12165
|
-
append(outerGfx, gfx);
|
|
12587
|
+
append$1(outerGfx, gfx);
|
|
12166
12588
|
|
|
12167
12589
|
// create visual
|
|
12168
|
-
var visual = create$
|
|
12169
|
-
classes$
|
|
12590
|
+
var visual = create$2('g');
|
|
12591
|
+
classes$2(visual).add('djs-visual');
|
|
12170
12592
|
|
|
12171
|
-
append(gfx, visual);
|
|
12593
|
+
append$1(gfx, visual);
|
|
12172
12594
|
|
|
12173
12595
|
return gfx;
|
|
12174
12596
|
};
|
|
@@ -12260,9 +12682,9 @@
|
|
|
12260
12682
|
}
|
|
12261
12683
|
|
|
12262
12684
|
if (element.hidden) {
|
|
12263
|
-
attr$
|
|
12685
|
+
attr$2(gfx, 'display', 'none');
|
|
12264
12686
|
} else {
|
|
12265
|
-
attr$
|
|
12687
|
+
attr$2(gfx, 'display', 'block');
|
|
12266
12688
|
}
|
|
12267
12689
|
};
|
|
12268
12690
|
|
|
@@ -12270,7 +12692,7 @@
|
|
|
12270
12692
|
var gfx = this._elementRegistry.getGraphics(element);
|
|
12271
12693
|
|
|
12272
12694
|
// remove
|
|
12273
|
-
remove$
|
|
12695
|
+
remove$3(gfx.parentNode);
|
|
12274
12696
|
};
|
|
12275
12697
|
|
|
12276
12698
|
|
|
@@ -21287,7 +21709,7 @@
|
|
|
21287
21709
|
Diagram.prototype.destroy.call(this);
|
|
21288
21710
|
|
|
21289
21711
|
// dom detach
|
|
21290
|
-
remove$
|
|
21712
|
+
remove$2(this._container);
|
|
21291
21713
|
};
|
|
21292
21714
|
|
|
21293
21715
|
/**
|
|
@@ -22136,12 +22558,12 @@
|
|
|
22136
22558
|
|
|
22137
22559
|
|
|
22138
22560
|
function set(mode) {
|
|
22139
|
-
var classes
|
|
22561
|
+
var classes = classes$1(document.body);
|
|
22140
22562
|
|
|
22141
|
-
classes
|
|
22563
|
+
classes.removeMatching(CURSOR_CLS_PATTERN);
|
|
22142
22564
|
|
|
22143
22565
|
if (mode) {
|
|
22144
|
-
classes
|
|
22566
|
+
classes.add('djs-cursor-' + mode);
|
|
22145
22567
|
}
|
|
22146
22568
|
}
|
|
22147
22569
|
|