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
|
@@ -646,7 +646,7 @@
|
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
648
|
|
|
649
|
-
function ensureImported(element, target) {
|
|
649
|
+
function ensureImported$1(element, target) {
|
|
650
650
|
|
|
651
651
|
if (element.ownerDocument !== target.ownerDocument) {
|
|
652
652
|
try {
|
|
@@ -674,8 +674,8 @@
|
|
|
674
674
|
*
|
|
675
675
|
* @return {SVGElement} the appended node
|
|
676
676
|
*/
|
|
677
|
-
function appendTo(element, target) {
|
|
678
|
-
return target.appendChild(ensureImported(element, target));
|
|
677
|
+
function appendTo$1(element, target) {
|
|
678
|
+
return target.appendChild(ensureImported$1(element, target));
|
|
679
679
|
}
|
|
680
680
|
|
|
681
681
|
/**
|
|
@@ -690,8 +690,8 @@
|
|
|
690
690
|
*
|
|
691
691
|
* @return {SVGElement} the element
|
|
692
692
|
*/
|
|
693
|
-
function append(target, node) {
|
|
694
|
-
appendTo(node, target);
|
|
693
|
+
function append$1(target, node) {
|
|
694
|
+
appendTo$1(node, target);
|
|
695
695
|
return target;
|
|
696
696
|
}
|
|
697
697
|
|
|
@@ -699,9 +699,9 @@
|
|
|
699
699
|
* attribute accessor utility
|
|
700
700
|
*/
|
|
701
701
|
|
|
702
|
-
var LENGTH_ATTR = 2;
|
|
702
|
+
var LENGTH_ATTR$1 = 2;
|
|
703
703
|
|
|
704
|
-
var CSS_PROPERTIES = {
|
|
704
|
+
var CSS_PROPERTIES$1 = {
|
|
705
705
|
'alignment-baseline': 1,
|
|
706
706
|
'baseline-shift': 1,
|
|
707
707
|
'clip': 1,
|
|
@@ -725,7 +725,7 @@
|
|
|
725
725
|
'flood-opacity': 1,
|
|
726
726
|
'font': 1,
|
|
727
727
|
'font-family': 1,
|
|
728
|
-
'font-size': LENGTH_ATTR,
|
|
728
|
+
'font-size': LENGTH_ATTR$1,
|
|
729
729
|
'font-size-adjust': 1,
|
|
730
730
|
'font-stretch': 1,
|
|
731
731
|
'font-style': 1,
|
|
@@ -755,7 +755,7 @@
|
|
|
755
755
|
'stroke-linejoin': 1,
|
|
756
756
|
'stroke-miterlimit': 1,
|
|
757
757
|
'stroke-opacity': 1,
|
|
758
|
-
'stroke-width': LENGTH_ATTR,
|
|
758
|
+
'stroke-width': LENGTH_ATTR$1,
|
|
759
759
|
'text-anchor': 1,
|
|
760
760
|
'text-decoration': 1,
|
|
761
761
|
'text-rendering': 1,
|
|
@@ -766,23 +766,23 @@
|
|
|
766
766
|
};
|
|
767
767
|
|
|
768
768
|
|
|
769
|
-
function getAttribute(node, name) {
|
|
770
|
-
if (CSS_PROPERTIES[name]) {
|
|
769
|
+
function getAttribute$1(node, name) {
|
|
770
|
+
if (CSS_PROPERTIES$1[name]) {
|
|
771
771
|
return node.style[name];
|
|
772
772
|
} else {
|
|
773
773
|
return node.getAttributeNS(null, name);
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
776
|
|
|
777
|
-
function setAttribute(node, name, value) {
|
|
777
|
+
function setAttribute$1(node, name, value) {
|
|
778
778
|
var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
779
779
|
|
|
780
|
-
var type = CSS_PROPERTIES[hyphenated];
|
|
780
|
+
var type = CSS_PROPERTIES$1[hyphenated];
|
|
781
781
|
|
|
782
782
|
if (type) {
|
|
783
783
|
|
|
784
784
|
// append pixel unit, unless present
|
|
785
|
-
if (type === LENGTH_ATTR && typeof value === 'number') {
|
|
785
|
+
if (type === LENGTH_ATTR$1 && typeof value === 'number') {
|
|
786
786
|
value = String(value) + 'px';
|
|
787
787
|
}
|
|
788
788
|
|
|
@@ -792,12 +792,12 @@
|
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
|
|
795
|
-
function setAttributes(node, attrs) {
|
|
795
|
+
function setAttributes$1(node, attrs) {
|
|
796
796
|
|
|
797
797
|
var names = Object.keys(attrs), i, name;
|
|
798
798
|
|
|
799
799
|
for (i = 0, name; (name = names[i]); i++) {
|
|
800
|
-
setAttribute(node, name, attrs[name]);
|
|
800
|
+
setAttribute$1(node, name, attrs[name]);
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
|
|
@@ -811,15 +811,15 @@
|
|
|
811
811
|
*
|
|
812
812
|
* @return {String}
|
|
813
813
|
*/
|
|
814
|
-
function attr$
|
|
814
|
+
function attr$2(node, name, value) {
|
|
815
815
|
if (typeof name === 'string') {
|
|
816
816
|
if (value !== undefined) {
|
|
817
|
-
setAttribute(node, name, value);
|
|
817
|
+
setAttribute$1(node, name, value);
|
|
818
818
|
} else {
|
|
819
|
-
return getAttribute(node, name);
|
|
819
|
+
return getAttribute$1(node, name);
|
|
820
820
|
}
|
|
821
821
|
} else {
|
|
822
|
-
setAttributes(node, name);
|
|
822
|
+
setAttributes$1(node, name);
|
|
823
823
|
}
|
|
824
824
|
|
|
825
825
|
return node;
|
|
@@ -835,7 +835,7 @@
|
|
|
835
835
|
* toString reference.
|
|
836
836
|
*/
|
|
837
837
|
|
|
838
|
-
const toString$
|
|
838
|
+
const toString$2 = Object.prototype.toString;
|
|
839
839
|
|
|
840
840
|
/**
|
|
841
841
|
* Wrap `el` in a `ClassList`.
|
|
@@ -845,11 +845,11 @@
|
|
|
845
845
|
* @api public
|
|
846
846
|
*/
|
|
847
847
|
|
|
848
|
-
function classes$
|
|
849
|
-
return new ClassList$
|
|
848
|
+
function classes$2(el) {
|
|
849
|
+
return new ClassList$2(el);
|
|
850
850
|
}
|
|
851
851
|
|
|
852
|
-
function ClassList$
|
|
852
|
+
function ClassList$2(el) {
|
|
853
853
|
if (!el || !el.nodeType) {
|
|
854
854
|
throw new Error('A DOM element reference is required');
|
|
855
855
|
}
|
|
@@ -865,7 +865,7 @@
|
|
|
865
865
|
* @api public
|
|
866
866
|
*/
|
|
867
867
|
|
|
868
|
-
ClassList$
|
|
868
|
+
ClassList$2.prototype.add = function(name) {
|
|
869
869
|
this.list.add(name);
|
|
870
870
|
return this;
|
|
871
871
|
};
|
|
@@ -880,8 +880,8 @@
|
|
|
880
880
|
* @api public
|
|
881
881
|
*/
|
|
882
882
|
|
|
883
|
-
ClassList$
|
|
884
|
-
if ('[object RegExp]' == toString$
|
|
883
|
+
ClassList$2.prototype.remove = function(name) {
|
|
884
|
+
if ('[object RegExp]' == toString$2.call(name)) {
|
|
885
885
|
return this.removeMatching(name);
|
|
886
886
|
}
|
|
887
887
|
|
|
@@ -897,7 +897,7 @@
|
|
|
897
897
|
* @api private
|
|
898
898
|
*/
|
|
899
899
|
|
|
900
|
-
ClassList$
|
|
900
|
+
ClassList$2.prototype.removeMatching = function(re) {
|
|
901
901
|
const arr = this.array();
|
|
902
902
|
for (let i = 0; i < arr.length; i++) {
|
|
903
903
|
if (re.test(arr[i])) {
|
|
@@ -919,7 +919,7 @@
|
|
|
919
919
|
* @api public
|
|
920
920
|
*/
|
|
921
921
|
|
|
922
|
-
ClassList$
|
|
922
|
+
ClassList$2.prototype.toggle = function(name, force) {
|
|
923
923
|
if ('undefined' !== typeof force) {
|
|
924
924
|
if (force !== this.list.toggle(name, force)) {
|
|
925
925
|
this.list.toggle(name); // toggle again to correct
|
|
@@ -937,7 +937,7 @@
|
|
|
937
937
|
* @api public
|
|
938
938
|
*/
|
|
939
939
|
|
|
940
|
-
ClassList$
|
|
940
|
+
ClassList$2.prototype.array = function() {
|
|
941
941
|
return Array.from(this.list);
|
|
942
942
|
};
|
|
943
943
|
|
|
@@ -949,12 +949,12 @@
|
|
|
949
949
|
* @api public
|
|
950
950
|
*/
|
|
951
951
|
|
|
952
|
-
ClassList$
|
|
953
|
-
ClassList$
|
|
952
|
+
ClassList$2.prototype.has =
|
|
953
|
+
ClassList$2.prototype.contains = function(name) {
|
|
954
954
|
return this.list.contains(name);
|
|
955
955
|
};
|
|
956
956
|
|
|
957
|
-
function remove$
|
|
957
|
+
function remove$3(element) {
|
|
958
958
|
var parent = element.parentNode;
|
|
959
959
|
|
|
960
960
|
if (parent) {
|
|
@@ -974,17 +974,17 @@
|
|
|
974
974
|
* @param {DOMElement} element
|
|
975
975
|
* @return {DOMElement} the element (for chaining)
|
|
976
976
|
*/
|
|
977
|
-
function clear$
|
|
977
|
+
function clear$2(element) {
|
|
978
978
|
var child;
|
|
979
979
|
|
|
980
980
|
while ((child = element.firstChild)) {
|
|
981
|
-
remove$
|
|
981
|
+
remove$3(child);
|
|
982
982
|
}
|
|
983
983
|
|
|
984
984
|
return element;
|
|
985
985
|
}
|
|
986
986
|
|
|
987
|
-
var ns = {
|
|
987
|
+
var ns$1 = {
|
|
988
988
|
svg: 'http://www.w3.org/2000/svg'
|
|
989
989
|
};
|
|
990
990
|
|
|
@@ -992,25 +992,25 @@
|
|
|
992
992
|
* DOM parsing utility
|
|
993
993
|
*/
|
|
994
994
|
|
|
995
|
-
var SVG_START = '<svg xmlns="' + ns.svg + '"';
|
|
995
|
+
var SVG_START$1 = '<svg xmlns="' + ns$1.svg + '"';
|
|
996
996
|
|
|
997
|
-
function parse$
|
|
997
|
+
function parse$2(svg) {
|
|
998
998
|
|
|
999
999
|
var unwrap = false;
|
|
1000
1000
|
|
|
1001
1001
|
// ensure we import a valid svg document
|
|
1002
1002
|
if (svg.substring(0, 4) === '<svg') {
|
|
1003
|
-
if (svg.indexOf(ns.svg) === -1) {
|
|
1004
|
-
svg = SVG_START + svg.substring(4);
|
|
1003
|
+
if (svg.indexOf(ns$1.svg) === -1) {
|
|
1004
|
+
svg = SVG_START$1 + svg.substring(4);
|
|
1005
1005
|
}
|
|
1006
1006
|
} else {
|
|
1007
1007
|
|
|
1008
1008
|
// namespace svg
|
|
1009
|
-
svg = SVG_START + '>' + svg + '</svg>';
|
|
1009
|
+
svg = SVG_START$1 + '>' + svg + '</svg>';
|
|
1010
1010
|
unwrap = true;
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
|
-
var parsed = parseDocument(svg);
|
|
1013
|
+
var parsed = parseDocument$1(svg);
|
|
1014
1014
|
|
|
1015
1015
|
if (!unwrap) {
|
|
1016
1016
|
return parsed;
|
|
@@ -1027,7 +1027,7 @@
|
|
|
1027
1027
|
return fragment;
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
|
-
function parseDocument(svg) {
|
|
1030
|
+
function parseDocument$1(svg) {
|
|
1031
1031
|
|
|
1032
1032
|
var parser;
|
|
1033
1033
|
|
|
@@ -1051,18 +1051,18 @@
|
|
|
1051
1051
|
*
|
|
1052
1052
|
* @returns {SVGElement}
|
|
1053
1053
|
*/
|
|
1054
|
-
function create$
|
|
1054
|
+
function create$2(name, attrs) {
|
|
1055
1055
|
var element;
|
|
1056
1056
|
|
|
1057
1057
|
if (name.charAt(0) === '<') {
|
|
1058
|
-
element = parse$
|
|
1058
|
+
element = parse$2(name).firstChild;
|
|
1059
1059
|
element = document.importNode(element, true);
|
|
1060
1060
|
} else {
|
|
1061
|
-
element = document.createElementNS(ns.svg, name);
|
|
1061
|
+
element = document.createElementNS(ns$1.svg, name);
|
|
1062
1062
|
}
|
|
1063
1063
|
|
|
1064
1064
|
if (attrs) {
|
|
1065
|
-
attr$
|
|
1065
|
+
attr$2(element, attrs);
|
|
1066
1066
|
}
|
|
1067
1067
|
|
|
1068
1068
|
return element;
|
|
@@ -1077,7 +1077,7 @@
|
|
|
1077
1077
|
|
|
1078
1078
|
function getNode() {
|
|
1079
1079
|
if (node === null) {
|
|
1080
|
-
node = create$
|
|
1080
|
+
node = create$2('svg');
|
|
1081
1081
|
}
|
|
1082
1082
|
|
|
1083
1083
|
return node;
|
|
@@ -1132,152 +1132,6 @@
|
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
1134
|
|
|
1135
|
-
/**
|
|
1136
|
-
* Serialization util
|
|
1137
|
-
*/
|
|
1138
|
-
|
|
1139
|
-
var TEXT_ENTITIES = /([&<>]{1})/g;
|
|
1140
|
-
var ATTR_ENTITIES = /([\n\r"]{1})/g;
|
|
1141
|
-
|
|
1142
|
-
var ENTITY_REPLACEMENT = {
|
|
1143
|
-
'&': '&',
|
|
1144
|
-
'<': '<',
|
|
1145
|
-
'>': '>',
|
|
1146
|
-
'"': '\''
|
|
1147
|
-
};
|
|
1148
|
-
|
|
1149
|
-
function escape$1(str, pattern) {
|
|
1150
|
-
|
|
1151
|
-
function replaceFn(match, entity) {
|
|
1152
|
-
return ENTITY_REPLACEMENT[entity] || entity;
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
return str.replace(pattern, replaceFn);
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
function serialize(node, output) {
|
|
1159
|
-
|
|
1160
|
-
var i, len, attrMap, attrNode, childNodes;
|
|
1161
|
-
|
|
1162
|
-
switch (node.nodeType) {
|
|
1163
|
-
|
|
1164
|
-
// TEXT
|
|
1165
|
-
case 3:
|
|
1166
|
-
|
|
1167
|
-
// replace special XML characters
|
|
1168
|
-
output.push(escape$1(node.textContent, TEXT_ENTITIES));
|
|
1169
|
-
break;
|
|
1170
|
-
|
|
1171
|
-
// ELEMENT
|
|
1172
|
-
case 1:
|
|
1173
|
-
output.push('<', node.tagName);
|
|
1174
|
-
|
|
1175
|
-
if (node.hasAttributes()) {
|
|
1176
|
-
attrMap = node.attributes;
|
|
1177
|
-
for (i = 0, len = attrMap.length; i < len; ++i) {
|
|
1178
|
-
attrNode = attrMap.item(i);
|
|
1179
|
-
output.push(' ', attrNode.name, '="', escape$1(attrNode.value, ATTR_ENTITIES), '"');
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
if (node.hasChildNodes()) {
|
|
1184
|
-
output.push('>');
|
|
1185
|
-
childNodes = node.childNodes;
|
|
1186
|
-
for (i = 0, len = childNodes.length; i < len; ++i) {
|
|
1187
|
-
serialize(childNodes.item(i), output);
|
|
1188
|
-
}
|
|
1189
|
-
output.push('</', node.tagName, '>');
|
|
1190
|
-
} else {
|
|
1191
|
-
output.push('/>');
|
|
1192
|
-
}
|
|
1193
|
-
break;
|
|
1194
|
-
|
|
1195
|
-
// COMMENT
|
|
1196
|
-
case 8:
|
|
1197
|
-
output.push('<!--', escape$1(node.nodeValue, TEXT_ENTITIES), '-->');
|
|
1198
|
-
break;
|
|
1199
|
-
|
|
1200
|
-
// CDATA
|
|
1201
|
-
case 4:
|
|
1202
|
-
output.push('<![CDATA[', node.nodeValue, ']]>');
|
|
1203
|
-
break;
|
|
1204
|
-
|
|
1205
|
-
default:
|
|
1206
|
-
throw new Error('unable to handle node ' + node.nodeType);
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
return output;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
/**
|
|
1213
|
-
* innerHTML like functionality for SVG elements.
|
|
1214
|
-
* based on innerSVG (https://code.google.com/p/innersvg)
|
|
1215
|
-
*/
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
function set$1(element, svg) {
|
|
1219
|
-
|
|
1220
|
-
var parsed = parse$1(svg);
|
|
1221
|
-
|
|
1222
|
-
// clear element contents
|
|
1223
|
-
clear$1(element);
|
|
1224
|
-
|
|
1225
|
-
if (!svg) {
|
|
1226
|
-
return;
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
if (!isFragment(parsed)) {
|
|
1230
|
-
|
|
1231
|
-
// extract <svg> from parsed document
|
|
1232
|
-
parsed = parsed.documentElement;
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
var nodes = slice$1(parsed.childNodes);
|
|
1236
|
-
|
|
1237
|
-
// import + append each node
|
|
1238
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
1239
|
-
appendTo(nodes[i], element);
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
function get(element) {
|
|
1245
|
-
var child = element.firstChild,
|
|
1246
|
-
output = [];
|
|
1247
|
-
|
|
1248
|
-
while (child) {
|
|
1249
|
-
serialize(child, output);
|
|
1250
|
-
child = child.nextSibling;
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
return output.join('');
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
function isFragment(node) {
|
|
1257
|
-
return node.nodeName === '#document-fragment';
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
function innerSVG(element, svg) {
|
|
1261
|
-
|
|
1262
|
-
if (svg !== undefined) {
|
|
1263
|
-
|
|
1264
|
-
try {
|
|
1265
|
-
set$1(element, svg);
|
|
1266
|
-
} catch (e) {
|
|
1267
|
-
throw new Error('error parsing SVG: ' + e.message);
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
return element;
|
|
1271
|
-
} else {
|
|
1272
|
-
return get(element);
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
function slice$1(arr) {
|
|
1278
|
-
return Array.prototype.slice.call(arr);
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
1135
|
/**
|
|
1282
1136
|
* transform accessor utility
|
|
1283
1137
|
*/
|
|
@@ -1340,18 +1194,18 @@
|
|
|
1340
1194
|
|
|
1341
1195
|
function createLine(points, attrs) {
|
|
1342
1196
|
|
|
1343
|
-
var line = create$
|
|
1344
|
-
attr$
|
|
1197
|
+
var line = create$2('polyline');
|
|
1198
|
+
attr$2(line, { points: toSVGPoints(points) });
|
|
1345
1199
|
|
|
1346
1200
|
if (attrs) {
|
|
1347
|
-
attr$
|
|
1201
|
+
attr$2(line, attrs);
|
|
1348
1202
|
}
|
|
1349
1203
|
|
|
1350
1204
|
return line;
|
|
1351
1205
|
}
|
|
1352
1206
|
|
|
1353
1207
|
function updateLine(gfx, points) {
|
|
1354
|
-
attr$
|
|
1208
|
+
attr$2(gfx, { points: toSVGPoints(points) });
|
|
1355
1209
|
|
|
1356
1210
|
return gfx;
|
|
1357
1211
|
}
|
|
@@ -1620,7 +1474,7 @@
|
|
|
1620
1474
|
* @param {String} [val]
|
|
1621
1475
|
* @api public
|
|
1622
1476
|
*/
|
|
1623
|
-
function attr(el, name, val) {
|
|
1477
|
+
function attr$1(el, name, val) {
|
|
1624
1478
|
|
|
1625
1479
|
// get
|
|
1626
1480
|
if (arguments.length == 2) {
|
|
@@ -1648,7 +1502,7 @@
|
|
|
1648
1502
|
* toString reference.
|
|
1649
1503
|
*/
|
|
1650
1504
|
|
|
1651
|
-
const toString = Object.prototype.toString;
|
|
1505
|
+
const toString$1 = Object.prototype.toString;
|
|
1652
1506
|
|
|
1653
1507
|
/**
|
|
1654
1508
|
* Wrap `el` in a `ClassList`.
|
|
@@ -1658,8 +1512,8 @@
|
|
|
1658
1512
|
* @api public
|
|
1659
1513
|
*/
|
|
1660
1514
|
|
|
1661
|
-
function classes(el) {
|
|
1662
|
-
return new ClassList(el);
|
|
1515
|
+
function classes$1(el) {
|
|
1516
|
+
return new ClassList$1(el);
|
|
1663
1517
|
}
|
|
1664
1518
|
|
|
1665
1519
|
/**
|
|
@@ -1669,7 +1523,7 @@
|
|
|
1669
1523
|
* @api private
|
|
1670
1524
|
*/
|
|
1671
1525
|
|
|
1672
|
-
function ClassList(el) {
|
|
1526
|
+
function ClassList$1(el) {
|
|
1673
1527
|
if (!el || !el.nodeType) {
|
|
1674
1528
|
throw new Error('A DOM element reference is required');
|
|
1675
1529
|
}
|
|
@@ -1685,7 +1539,7 @@
|
|
|
1685
1539
|
* @api public
|
|
1686
1540
|
*/
|
|
1687
1541
|
|
|
1688
|
-
ClassList.prototype.add = function(name) {
|
|
1542
|
+
ClassList$1.prototype.add = function(name) {
|
|
1689
1543
|
this.list.add(name);
|
|
1690
1544
|
return this;
|
|
1691
1545
|
};
|
|
@@ -1700,8 +1554,8 @@
|
|
|
1700
1554
|
* @api public
|
|
1701
1555
|
*/
|
|
1702
1556
|
|
|
1703
|
-
ClassList.prototype.remove = function(name) {
|
|
1704
|
-
if ('[object RegExp]' == toString.call(name)) {
|
|
1557
|
+
ClassList$1.prototype.remove = function(name) {
|
|
1558
|
+
if ('[object RegExp]' == toString$1.call(name)) {
|
|
1705
1559
|
return this.removeMatching(name);
|
|
1706
1560
|
}
|
|
1707
1561
|
|
|
@@ -1717,7 +1571,7 @@
|
|
|
1717
1571
|
* @api private
|
|
1718
1572
|
*/
|
|
1719
1573
|
|
|
1720
|
-
ClassList.prototype.removeMatching = function(re) {
|
|
1574
|
+
ClassList$1.prototype.removeMatching = function(re) {
|
|
1721
1575
|
const arr = this.array();
|
|
1722
1576
|
for (let i = 0; i < arr.length; i++) {
|
|
1723
1577
|
if (re.test(arr[i])) {
|
|
@@ -1739,7 +1593,7 @@
|
|
|
1739
1593
|
* @api public
|
|
1740
1594
|
*/
|
|
1741
1595
|
|
|
1742
|
-
ClassList.prototype.toggle = function(name, force) {
|
|
1596
|
+
ClassList$1.prototype.toggle = function(name, force) {
|
|
1743
1597
|
if ('undefined' !== typeof force) {
|
|
1744
1598
|
if (force !== this.list.toggle(name, force)) {
|
|
1745
1599
|
this.list.toggle(name); // toggle again to correct
|
|
@@ -1757,7 +1611,7 @@
|
|
|
1757
1611
|
* @api public
|
|
1758
1612
|
*/
|
|
1759
1613
|
|
|
1760
|
-
ClassList.prototype.array = function() {
|
|
1614
|
+
ClassList$1.prototype.array = function() {
|
|
1761
1615
|
return Array.from(this.list);
|
|
1762
1616
|
};
|
|
1763
1617
|
|
|
@@ -1769,15 +1623,15 @@
|
|
|
1769
1623
|
* @api public
|
|
1770
1624
|
*/
|
|
1771
1625
|
|
|
1772
|
-
ClassList.prototype.has =
|
|
1773
|
-
ClassList.prototype.contains = function(name) {
|
|
1626
|
+
ClassList$1.prototype.has =
|
|
1627
|
+
ClassList$1.prototype.contains = function(name) {
|
|
1774
1628
|
return this.list.contains(name);
|
|
1775
1629
|
};
|
|
1776
1630
|
|
|
1777
1631
|
/**
|
|
1778
1632
|
* Remove all children from the given element.
|
|
1779
1633
|
*/
|
|
1780
|
-
function clear(el) {
|
|
1634
|
+
function clear$1(el) {
|
|
1781
1635
|
|
|
1782
1636
|
var c;
|
|
1783
1637
|
|
|
@@ -1929,7 +1783,7 @@
|
|
|
1929
1783
|
* Expose `parse`.
|
|
1930
1784
|
*/
|
|
1931
1785
|
|
|
1932
|
-
var domify = parse;
|
|
1786
|
+
var domify = parse$1;
|
|
1933
1787
|
|
|
1934
1788
|
/**
|
|
1935
1789
|
* Tests for browser support.
|
|
@@ -1993,7 +1847,7 @@
|
|
|
1993
1847
|
* @api private
|
|
1994
1848
|
*/
|
|
1995
1849
|
|
|
1996
|
-
function parse(html, doc) {
|
|
1850
|
+
function parse$1(html, doc) {
|
|
1997
1851
|
if ('string' != typeof html) throw new TypeError('String expected');
|
|
1998
1852
|
|
|
1999
1853
|
// default to the global `document` object
|
|
@@ -2051,10 +1905,578 @@
|
|
|
2051
1905
|
return el.querySelectorAll(selector);
|
|
2052
1906
|
}
|
|
2053
1907
|
|
|
2054
|
-
function remove$
|
|
1908
|
+
function remove$2(el) {
|
|
2055
1909
|
el.parentNode && el.parentNode.removeChild(el);
|
|
2056
1910
|
}
|
|
2057
1911
|
|
|
1912
|
+
function ensureImported(element, target) {
|
|
1913
|
+
|
|
1914
|
+
if (element.ownerDocument !== target.ownerDocument) {
|
|
1915
|
+
try {
|
|
1916
|
+
|
|
1917
|
+
// may fail on webkit
|
|
1918
|
+
return target.ownerDocument.importNode(element, true);
|
|
1919
|
+
} catch (e) {
|
|
1920
|
+
|
|
1921
|
+
// ignore
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
return element;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
/**
|
|
1929
|
+
* appendTo utility
|
|
1930
|
+
*/
|
|
1931
|
+
|
|
1932
|
+
/**
|
|
1933
|
+
* Append a node to a target element and return the appended node.
|
|
1934
|
+
*
|
|
1935
|
+
* @param {SVGElement} element
|
|
1936
|
+
* @param {SVGElement} target
|
|
1937
|
+
*
|
|
1938
|
+
* @return {SVGElement} the appended node
|
|
1939
|
+
*/
|
|
1940
|
+
function appendTo(element, target) {
|
|
1941
|
+
return target.appendChild(ensureImported(element, target));
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
/**
|
|
1945
|
+
* append utility
|
|
1946
|
+
*/
|
|
1947
|
+
|
|
1948
|
+
/**
|
|
1949
|
+
* Append a node to an element
|
|
1950
|
+
*
|
|
1951
|
+
* @param {SVGElement} element
|
|
1952
|
+
* @param {SVGElement} node
|
|
1953
|
+
*
|
|
1954
|
+
* @return {SVGElement} the element
|
|
1955
|
+
*/
|
|
1956
|
+
function append(target, node) {
|
|
1957
|
+
appendTo(node, target);
|
|
1958
|
+
return target;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
/**
|
|
1962
|
+
* attribute accessor utility
|
|
1963
|
+
*/
|
|
1964
|
+
|
|
1965
|
+
var LENGTH_ATTR = 2;
|
|
1966
|
+
|
|
1967
|
+
var CSS_PROPERTIES = {
|
|
1968
|
+
'alignment-baseline': 1,
|
|
1969
|
+
'baseline-shift': 1,
|
|
1970
|
+
'clip': 1,
|
|
1971
|
+
'clip-path': 1,
|
|
1972
|
+
'clip-rule': 1,
|
|
1973
|
+
'color': 1,
|
|
1974
|
+
'color-interpolation': 1,
|
|
1975
|
+
'color-interpolation-filters': 1,
|
|
1976
|
+
'color-profile': 1,
|
|
1977
|
+
'color-rendering': 1,
|
|
1978
|
+
'cursor': 1,
|
|
1979
|
+
'direction': 1,
|
|
1980
|
+
'display': 1,
|
|
1981
|
+
'dominant-baseline': 1,
|
|
1982
|
+
'enable-background': 1,
|
|
1983
|
+
'fill': 1,
|
|
1984
|
+
'fill-opacity': 1,
|
|
1985
|
+
'fill-rule': 1,
|
|
1986
|
+
'filter': 1,
|
|
1987
|
+
'flood-color': 1,
|
|
1988
|
+
'flood-opacity': 1,
|
|
1989
|
+
'font': 1,
|
|
1990
|
+
'font-family': 1,
|
|
1991
|
+
'font-size': LENGTH_ATTR,
|
|
1992
|
+
'font-size-adjust': 1,
|
|
1993
|
+
'font-stretch': 1,
|
|
1994
|
+
'font-style': 1,
|
|
1995
|
+
'font-variant': 1,
|
|
1996
|
+
'font-weight': 1,
|
|
1997
|
+
'glyph-orientation-horizontal': 1,
|
|
1998
|
+
'glyph-orientation-vertical': 1,
|
|
1999
|
+
'image-rendering': 1,
|
|
2000
|
+
'kerning': 1,
|
|
2001
|
+
'letter-spacing': 1,
|
|
2002
|
+
'lighting-color': 1,
|
|
2003
|
+
'marker': 1,
|
|
2004
|
+
'marker-end': 1,
|
|
2005
|
+
'marker-mid': 1,
|
|
2006
|
+
'marker-start': 1,
|
|
2007
|
+
'mask': 1,
|
|
2008
|
+
'opacity': 1,
|
|
2009
|
+
'overflow': 1,
|
|
2010
|
+
'pointer-events': 1,
|
|
2011
|
+
'shape-rendering': 1,
|
|
2012
|
+
'stop-color': 1,
|
|
2013
|
+
'stop-opacity': 1,
|
|
2014
|
+
'stroke': 1,
|
|
2015
|
+
'stroke-dasharray': 1,
|
|
2016
|
+
'stroke-dashoffset': 1,
|
|
2017
|
+
'stroke-linecap': 1,
|
|
2018
|
+
'stroke-linejoin': 1,
|
|
2019
|
+
'stroke-miterlimit': 1,
|
|
2020
|
+
'stroke-opacity': 1,
|
|
2021
|
+
'stroke-width': LENGTH_ATTR,
|
|
2022
|
+
'text-anchor': 1,
|
|
2023
|
+
'text-decoration': 1,
|
|
2024
|
+
'text-rendering': 1,
|
|
2025
|
+
'unicode-bidi': 1,
|
|
2026
|
+
'visibility': 1,
|
|
2027
|
+
'word-spacing': 1,
|
|
2028
|
+
'writing-mode': 1
|
|
2029
|
+
};
|
|
2030
|
+
|
|
2031
|
+
|
|
2032
|
+
function getAttribute(node, name) {
|
|
2033
|
+
if (CSS_PROPERTIES[name]) {
|
|
2034
|
+
return node.style[name];
|
|
2035
|
+
} else {
|
|
2036
|
+
return node.getAttributeNS(null, name);
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
function setAttribute(node, name, value) {
|
|
2041
|
+
var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
2042
|
+
|
|
2043
|
+
var type = CSS_PROPERTIES[hyphenated];
|
|
2044
|
+
|
|
2045
|
+
if (type) {
|
|
2046
|
+
|
|
2047
|
+
// append pixel unit, unless present
|
|
2048
|
+
if (type === LENGTH_ATTR && typeof value === 'number') {
|
|
2049
|
+
value = String(value) + 'px';
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
node.style[hyphenated] = value;
|
|
2053
|
+
} else {
|
|
2054
|
+
node.setAttributeNS(null, name, value);
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
function setAttributes(node, attrs) {
|
|
2059
|
+
|
|
2060
|
+
var names = Object.keys(attrs), i, name;
|
|
2061
|
+
|
|
2062
|
+
for (i = 0, name; (name = names[i]); i++) {
|
|
2063
|
+
setAttribute(node, name, attrs[name]);
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* Gets or sets raw attributes on a node.
|
|
2069
|
+
*
|
|
2070
|
+
* @param {SVGElement} node
|
|
2071
|
+
* @param {Object} [attrs]
|
|
2072
|
+
* @param {String} [name]
|
|
2073
|
+
* @param {String} [value]
|
|
2074
|
+
*
|
|
2075
|
+
* @return {String}
|
|
2076
|
+
*/
|
|
2077
|
+
function attr(node, name, value) {
|
|
2078
|
+
if (typeof name === 'string') {
|
|
2079
|
+
if (value !== undefined) {
|
|
2080
|
+
setAttribute(node, name, value);
|
|
2081
|
+
} else {
|
|
2082
|
+
return getAttribute(node, name);
|
|
2083
|
+
}
|
|
2084
|
+
} else {
|
|
2085
|
+
setAttributes(node, name);
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
return node;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
/**
|
|
2092
|
+
* Taken from https://github.com/component/classes
|
|
2093
|
+
*
|
|
2094
|
+
* Without the component bits.
|
|
2095
|
+
*/
|
|
2096
|
+
|
|
2097
|
+
/**
|
|
2098
|
+
* toString reference.
|
|
2099
|
+
*/
|
|
2100
|
+
|
|
2101
|
+
const toString = Object.prototype.toString;
|
|
2102
|
+
|
|
2103
|
+
/**
|
|
2104
|
+
* Wrap `el` in a `ClassList`.
|
|
2105
|
+
*
|
|
2106
|
+
* @param {Element} el
|
|
2107
|
+
* @return {ClassList}
|
|
2108
|
+
* @api public
|
|
2109
|
+
*/
|
|
2110
|
+
|
|
2111
|
+
function classes(el) {
|
|
2112
|
+
return new ClassList(el);
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
function ClassList(el) {
|
|
2116
|
+
if (!el || !el.nodeType) {
|
|
2117
|
+
throw new Error('A DOM element reference is required');
|
|
2118
|
+
}
|
|
2119
|
+
this.el = el;
|
|
2120
|
+
this.list = el.classList;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
/**
|
|
2124
|
+
* Add class `name` if not already present.
|
|
2125
|
+
*
|
|
2126
|
+
* @param {String} name
|
|
2127
|
+
* @return {ClassList}
|
|
2128
|
+
* @api public
|
|
2129
|
+
*/
|
|
2130
|
+
|
|
2131
|
+
ClassList.prototype.add = function(name) {
|
|
2132
|
+
this.list.add(name);
|
|
2133
|
+
return this;
|
|
2134
|
+
};
|
|
2135
|
+
|
|
2136
|
+
/**
|
|
2137
|
+
* Remove class `name` when present, or
|
|
2138
|
+
* pass a regular expression to remove
|
|
2139
|
+
* any which match.
|
|
2140
|
+
*
|
|
2141
|
+
* @param {String|RegExp} name
|
|
2142
|
+
* @return {ClassList}
|
|
2143
|
+
* @api public
|
|
2144
|
+
*/
|
|
2145
|
+
|
|
2146
|
+
ClassList.prototype.remove = function(name) {
|
|
2147
|
+
if ('[object RegExp]' == toString.call(name)) {
|
|
2148
|
+
return this.removeMatching(name);
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
this.list.remove(name);
|
|
2152
|
+
return this;
|
|
2153
|
+
};
|
|
2154
|
+
|
|
2155
|
+
/**
|
|
2156
|
+
* Remove all classes matching `re`.
|
|
2157
|
+
*
|
|
2158
|
+
* @param {RegExp} re
|
|
2159
|
+
* @return {ClassList}
|
|
2160
|
+
* @api private
|
|
2161
|
+
*/
|
|
2162
|
+
|
|
2163
|
+
ClassList.prototype.removeMatching = function(re) {
|
|
2164
|
+
const arr = this.array();
|
|
2165
|
+
for (let i = 0; i < arr.length; i++) {
|
|
2166
|
+
if (re.test(arr[i])) {
|
|
2167
|
+
this.remove(arr[i]);
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
return this;
|
|
2171
|
+
};
|
|
2172
|
+
|
|
2173
|
+
/**
|
|
2174
|
+
* Toggle class `name`, can force state via `force`.
|
|
2175
|
+
*
|
|
2176
|
+
* For browsers that support classList, but do not support `force` yet,
|
|
2177
|
+
* the mistake will be detected and corrected.
|
|
2178
|
+
*
|
|
2179
|
+
* @param {String} name
|
|
2180
|
+
* @param {Boolean} force
|
|
2181
|
+
* @return {ClassList}
|
|
2182
|
+
* @api public
|
|
2183
|
+
*/
|
|
2184
|
+
|
|
2185
|
+
ClassList.prototype.toggle = function(name, force) {
|
|
2186
|
+
if ('undefined' !== typeof force) {
|
|
2187
|
+
if (force !== this.list.toggle(name, force)) {
|
|
2188
|
+
this.list.toggle(name); // toggle again to correct
|
|
2189
|
+
}
|
|
2190
|
+
} else {
|
|
2191
|
+
this.list.toggle(name);
|
|
2192
|
+
}
|
|
2193
|
+
return this;
|
|
2194
|
+
};
|
|
2195
|
+
|
|
2196
|
+
/**
|
|
2197
|
+
* Return an array of classes.
|
|
2198
|
+
*
|
|
2199
|
+
* @return {Array}
|
|
2200
|
+
* @api public
|
|
2201
|
+
*/
|
|
2202
|
+
|
|
2203
|
+
ClassList.prototype.array = function() {
|
|
2204
|
+
return Array.from(this.list);
|
|
2205
|
+
};
|
|
2206
|
+
|
|
2207
|
+
/**
|
|
2208
|
+
* Check if class `name` is present.
|
|
2209
|
+
*
|
|
2210
|
+
* @param {String} name
|
|
2211
|
+
* @return {ClassList}
|
|
2212
|
+
* @api public
|
|
2213
|
+
*/
|
|
2214
|
+
|
|
2215
|
+
ClassList.prototype.has =
|
|
2216
|
+
ClassList.prototype.contains = function(name) {
|
|
2217
|
+
return this.list.contains(name);
|
|
2218
|
+
};
|
|
2219
|
+
|
|
2220
|
+
function remove$1(element) {
|
|
2221
|
+
var parent = element.parentNode;
|
|
2222
|
+
|
|
2223
|
+
if (parent) {
|
|
2224
|
+
parent.removeChild(element);
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
return element;
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
/**
|
|
2231
|
+
* Clear utility
|
|
2232
|
+
*/
|
|
2233
|
+
|
|
2234
|
+
/**
|
|
2235
|
+
* Removes all children from the given element
|
|
2236
|
+
*
|
|
2237
|
+
* @param {DOMElement} element
|
|
2238
|
+
* @return {DOMElement} the element (for chaining)
|
|
2239
|
+
*/
|
|
2240
|
+
function clear(element) {
|
|
2241
|
+
var child;
|
|
2242
|
+
|
|
2243
|
+
while ((child = element.firstChild)) {
|
|
2244
|
+
remove$1(child);
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
return element;
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
var ns = {
|
|
2251
|
+
svg: 'http://www.w3.org/2000/svg'
|
|
2252
|
+
};
|
|
2253
|
+
|
|
2254
|
+
/**
|
|
2255
|
+
* DOM parsing utility
|
|
2256
|
+
*/
|
|
2257
|
+
|
|
2258
|
+
var SVG_START = '<svg xmlns="' + ns.svg + '"';
|
|
2259
|
+
|
|
2260
|
+
function parse(svg) {
|
|
2261
|
+
|
|
2262
|
+
var unwrap = false;
|
|
2263
|
+
|
|
2264
|
+
// ensure we import a valid svg document
|
|
2265
|
+
if (svg.substring(0, 4) === '<svg') {
|
|
2266
|
+
if (svg.indexOf(ns.svg) === -1) {
|
|
2267
|
+
svg = SVG_START + svg.substring(4);
|
|
2268
|
+
}
|
|
2269
|
+
} else {
|
|
2270
|
+
|
|
2271
|
+
// namespace svg
|
|
2272
|
+
svg = SVG_START + '>' + svg + '</svg>';
|
|
2273
|
+
unwrap = true;
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
var parsed = parseDocument(svg);
|
|
2277
|
+
|
|
2278
|
+
if (!unwrap) {
|
|
2279
|
+
return parsed;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
var fragment = document.createDocumentFragment();
|
|
2283
|
+
|
|
2284
|
+
var parent = parsed.firstChild;
|
|
2285
|
+
|
|
2286
|
+
while (parent.firstChild) {
|
|
2287
|
+
fragment.appendChild(parent.firstChild);
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
return fragment;
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
function parseDocument(svg) {
|
|
2294
|
+
|
|
2295
|
+
var parser;
|
|
2296
|
+
|
|
2297
|
+
// parse
|
|
2298
|
+
parser = new DOMParser();
|
|
2299
|
+
parser.async = false;
|
|
2300
|
+
|
|
2301
|
+
return parser.parseFromString(svg, 'text/xml');
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
/**
|
|
2305
|
+
* Create utility for SVG elements
|
|
2306
|
+
*/
|
|
2307
|
+
|
|
2308
|
+
|
|
2309
|
+
/**
|
|
2310
|
+
* Create a specific type from name or SVG markup.
|
|
2311
|
+
*
|
|
2312
|
+
* @param {String} name the name or markup of the element
|
|
2313
|
+
* @param {Object} [attrs] attributes to set on the element
|
|
2314
|
+
*
|
|
2315
|
+
* @returns {SVGElement}
|
|
2316
|
+
*/
|
|
2317
|
+
function create$1(name, attrs) {
|
|
2318
|
+
var element;
|
|
2319
|
+
|
|
2320
|
+
if (name.charAt(0) === '<') {
|
|
2321
|
+
element = parse(name).firstChild;
|
|
2322
|
+
element = document.importNode(element, true);
|
|
2323
|
+
} else {
|
|
2324
|
+
element = document.createElementNS(ns.svg, name);
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
if (attrs) {
|
|
2328
|
+
attr(element, attrs);
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
return element;
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
/**
|
|
2335
|
+
* Serialization util
|
|
2336
|
+
*/
|
|
2337
|
+
|
|
2338
|
+
var TEXT_ENTITIES = /([&<>]{1})/g;
|
|
2339
|
+
var ATTR_ENTITIES = /([\n\r"]{1})/g;
|
|
2340
|
+
|
|
2341
|
+
var ENTITY_REPLACEMENT = {
|
|
2342
|
+
'&': '&',
|
|
2343
|
+
'<': '<',
|
|
2344
|
+
'>': '>',
|
|
2345
|
+
'"': '\''
|
|
2346
|
+
};
|
|
2347
|
+
|
|
2348
|
+
function escape$1(str, pattern) {
|
|
2349
|
+
|
|
2350
|
+
function replaceFn(match, entity) {
|
|
2351
|
+
return ENTITY_REPLACEMENT[entity] || entity;
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
return str.replace(pattern, replaceFn);
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
function serialize(node, output) {
|
|
2358
|
+
|
|
2359
|
+
var i, len, attrMap, attrNode, childNodes;
|
|
2360
|
+
|
|
2361
|
+
switch (node.nodeType) {
|
|
2362
|
+
|
|
2363
|
+
// TEXT
|
|
2364
|
+
case 3:
|
|
2365
|
+
|
|
2366
|
+
// replace special XML characters
|
|
2367
|
+
output.push(escape$1(node.textContent, TEXT_ENTITIES));
|
|
2368
|
+
break;
|
|
2369
|
+
|
|
2370
|
+
// ELEMENT
|
|
2371
|
+
case 1:
|
|
2372
|
+
output.push('<', node.tagName);
|
|
2373
|
+
|
|
2374
|
+
if (node.hasAttributes()) {
|
|
2375
|
+
attrMap = node.attributes;
|
|
2376
|
+
for (i = 0, len = attrMap.length; i < len; ++i) {
|
|
2377
|
+
attrNode = attrMap.item(i);
|
|
2378
|
+
output.push(' ', attrNode.name, '="', escape$1(attrNode.value, ATTR_ENTITIES), '"');
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
if (node.hasChildNodes()) {
|
|
2383
|
+
output.push('>');
|
|
2384
|
+
childNodes = node.childNodes;
|
|
2385
|
+
for (i = 0, len = childNodes.length; i < len; ++i) {
|
|
2386
|
+
serialize(childNodes.item(i), output);
|
|
2387
|
+
}
|
|
2388
|
+
output.push('</', node.tagName, '>');
|
|
2389
|
+
} else {
|
|
2390
|
+
output.push('/>');
|
|
2391
|
+
}
|
|
2392
|
+
break;
|
|
2393
|
+
|
|
2394
|
+
// COMMENT
|
|
2395
|
+
case 8:
|
|
2396
|
+
output.push('<!--', escape$1(node.nodeValue, TEXT_ENTITIES), '-->');
|
|
2397
|
+
break;
|
|
2398
|
+
|
|
2399
|
+
// CDATA
|
|
2400
|
+
case 4:
|
|
2401
|
+
output.push('<![CDATA[', node.nodeValue, ']]>');
|
|
2402
|
+
break;
|
|
2403
|
+
|
|
2404
|
+
default:
|
|
2405
|
+
throw new Error('unable to handle node ' + node.nodeType);
|
|
2406
|
+
}
|
|
2407
|
+
|
|
2408
|
+
return output;
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
/**
|
|
2412
|
+
* innerHTML like functionality for SVG elements.
|
|
2413
|
+
* based on innerSVG (https://code.google.com/p/innersvg)
|
|
2414
|
+
*/
|
|
2415
|
+
|
|
2416
|
+
|
|
2417
|
+
function set$1(element, svg) {
|
|
2418
|
+
|
|
2419
|
+
var parsed = parse(svg);
|
|
2420
|
+
|
|
2421
|
+
// clear element contents
|
|
2422
|
+
clear(element);
|
|
2423
|
+
|
|
2424
|
+
if (!svg) {
|
|
2425
|
+
return;
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
if (!isFragment(parsed)) {
|
|
2429
|
+
|
|
2430
|
+
// extract <svg> from parsed document
|
|
2431
|
+
parsed = parsed.documentElement;
|
|
2432
|
+
}
|
|
2433
|
+
|
|
2434
|
+
var nodes = slice$1(parsed.childNodes);
|
|
2435
|
+
|
|
2436
|
+
// import + append each node
|
|
2437
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
2438
|
+
appendTo(nodes[i], element);
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
function get(element) {
|
|
2444
|
+
var child = element.firstChild,
|
|
2445
|
+
output = [];
|
|
2446
|
+
|
|
2447
|
+
while (child) {
|
|
2448
|
+
serialize(child, output);
|
|
2449
|
+
child = child.nextSibling;
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
return output.join('');
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
function isFragment(node) {
|
|
2456
|
+
return node.nodeName === '#document-fragment';
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
function innerSVG(element, svg) {
|
|
2460
|
+
|
|
2461
|
+
if (svg !== undefined) {
|
|
2462
|
+
|
|
2463
|
+
try {
|
|
2464
|
+
set$1(element, svg);
|
|
2465
|
+
} catch (e) {
|
|
2466
|
+
throw new Error('error parsing SVG: ' + e.message);
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
return element;
|
|
2470
|
+
} else {
|
|
2471
|
+
return get(element);
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
|
|
2476
|
+
function slice$1(arr) {
|
|
2477
|
+
return Array.prototype.slice.call(arr);
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2058
2480
|
/**
|
|
2059
2481
|
* @param {<SVGElement>} element
|
|
2060
2482
|
* @param {number} x
|
|
@@ -2309,11 +2731,11 @@
|
|
|
2309
2731
|
|
|
2310
2732
|
var marker = create$1('marker');
|
|
2311
2733
|
|
|
2312
|
-
attr
|
|
2734
|
+
attr(options.element, attrs);
|
|
2313
2735
|
|
|
2314
2736
|
append(marker, options.element);
|
|
2315
2737
|
|
|
2316
|
-
attr
|
|
2738
|
+
attr(marker, {
|
|
2317
2739
|
id: id,
|
|
2318
2740
|
viewBox: '0 0 20 20',
|
|
2319
2741
|
refX: ref.x,
|
|
@@ -2356,7 +2778,7 @@
|
|
|
2356
2778
|
|
|
2357
2779
|
if (type === 'sequenceflow-end') {
|
|
2358
2780
|
var sequenceflowEnd = create$1('path');
|
|
2359
|
-
attr
|
|
2781
|
+
attr(sequenceflowEnd, { d: 'M 1 5 L 11 10 L 1 15 Z' });
|
|
2360
2782
|
|
|
2361
2783
|
addMarker(id, {
|
|
2362
2784
|
element: sequenceflowEnd,
|
|
@@ -2371,7 +2793,7 @@
|
|
|
2371
2793
|
|
|
2372
2794
|
if (type === 'messageflow-start') {
|
|
2373
2795
|
var messageflowStart = create$1('circle');
|
|
2374
|
-
attr
|
|
2796
|
+
attr(messageflowStart, { cx: 6, cy: 6, r: 3.5 });
|
|
2375
2797
|
|
|
2376
2798
|
addMarker(id, {
|
|
2377
2799
|
element: messageflowStart,
|
|
@@ -2385,7 +2807,7 @@
|
|
|
2385
2807
|
|
|
2386
2808
|
if (type === 'messageflow-end') {
|
|
2387
2809
|
var messageflowEnd = create$1('path');
|
|
2388
|
-
attr
|
|
2810
|
+
attr(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
|
|
2389
2811
|
|
|
2390
2812
|
addMarker(id, {
|
|
2391
2813
|
element: messageflowEnd,
|
|
@@ -2400,7 +2822,7 @@
|
|
|
2400
2822
|
|
|
2401
2823
|
if (type === 'association-start') {
|
|
2402
2824
|
var associationStart = create$1('path');
|
|
2403
|
-
attr
|
|
2825
|
+
attr(associationStart, { d: 'M 11 5 L 1 10 L 11 15' });
|
|
2404
2826
|
|
|
2405
2827
|
addMarker(id, {
|
|
2406
2828
|
element: associationStart,
|
|
@@ -2416,7 +2838,7 @@
|
|
|
2416
2838
|
|
|
2417
2839
|
if (type === 'association-end') {
|
|
2418
2840
|
var associationEnd = create$1('path');
|
|
2419
|
-
attr
|
|
2841
|
+
attr(associationEnd, { d: 'M 1 5 L 11 10 L 1 15' });
|
|
2420
2842
|
|
|
2421
2843
|
addMarker(id, {
|
|
2422
2844
|
element: associationEnd,
|
|
@@ -2432,7 +2854,7 @@
|
|
|
2432
2854
|
|
|
2433
2855
|
if (type === 'conditional-flow-marker') {
|
|
2434
2856
|
var conditionalflowMarker = create$1('path');
|
|
2435
|
-
attr
|
|
2857
|
+
attr(conditionalflowMarker, { d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z' });
|
|
2436
2858
|
|
|
2437
2859
|
addMarker(id, {
|
|
2438
2860
|
element: conditionalflowMarker,
|
|
@@ -2447,7 +2869,7 @@
|
|
|
2447
2869
|
|
|
2448
2870
|
if (type === 'conditional-default-flow-marker') {
|
|
2449
2871
|
var conditionaldefaultflowMarker = create$1('path');
|
|
2450
|
-
attr
|
|
2872
|
+
attr(conditionaldefaultflowMarker, { d: 'M 6 4 L 10 16' });
|
|
2451
2873
|
|
|
2452
2874
|
addMarker(id, {
|
|
2453
2875
|
element: conditionaldefaultflowMarker,
|
|
@@ -2483,12 +2905,12 @@
|
|
|
2483
2905
|
cy = height / 2;
|
|
2484
2906
|
|
|
2485
2907
|
var circle = create$1('circle');
|
|
2486
|
-
attr
|
|
2908
|
+
attr(circle, {
|
|
2487
2909
|
cx: cx,
|
|
2488
2910
|
cy: cy,
|
|
2489
2911
|
r: Math.round((width + height) / 4 - offset)
|
|
2490
2912
|
});
|
|
2491
|
-
attr
|
|
2913
|
+
attr(circle, attrs);
|
|
2492
2914
|
|
|
2493
2915
|
append(parentGfx, circle);
|
|
2494
2916
|
|
|
@@ -2511,7 +2933,7 @@
|
|
|
2511
2933
|
});
|
|
2512
2934
|
|
|
2513
2935
|
var rect = create$1('rect');
|
|
2514
|
-
attr
|
|
2936
|
+
attr(rect, {
|
|
2515
2937
|
x: offset,
|
|
2516
2938
|
y: offset,
|
|
2517
2939
|
width: width - offset * 2,
|
|
@@ -2519,7 +2941,7 @@
|
|
|
2519
2941
|
rx: r,
|
|
2520
2942
|
ry: r
|
|
2521
2943
|
});
|
|
2522
|
-
attr
|
|
2944
|
+
attr(rect, attrs);
|
|
2523
2945
|
|
|
2524
2946
|
append(parentGfx, rect);
|
|
2525
2947
|
|
|
@@ -2544,10 +2966,10 @@
|
|
|
2544
2966
|
});
|
|
2545
2967
|
|
|
2546
2968
|
var polygon = create$1('polygon');
|
|
2547
|
-
attr
|
|
2969
|
+
attr(polygon, {
|
|
2548
2970
|
points: pointsString
|
|
2549
2971
|
});
|
|
2550
|
-
attr
|
|
2972
|
+
attr(polygon, attrs);
|
|
2551
2973
|
|
|
2552
2974
|
append(parentGfx, polygon);
|
|
2553
2975
|
|
|
@@ -2576,8 +2998,8 @@
|
|
|
2576
2998
|
});
|
|
2577
2999
|
|
|
2578
3000
|
var path = create$1('path');
|
|
2579
|
-
attr
|
|
2580
|
-
attr
|
|
3001
|
+
attr(path, { d: d });
|
|
3002
|
+
attr(path, attrs);
|
|
2581
3003
|
|
|
2582
3004
|
append(parentGfx, path);
|
|
2583
3005
|
|
|
@@ -2665,7 +3087,7 @@
|
|
|
2665
3087
|
|
|
2666
3088
|
var text = textRenderer.createText(label || '', options);
|
|
2667
3089
|
|
|
2668
|
-
classes
|
|
3090
|
+
classes(text).add('djs-label');
|
|
2669
3091
|
|
|
2670
3092
|
append(parentGfx, text);
|
|
2671
3093
|
|
|
@@ -3277,7 +3699,7 @@
|
|
|
3277
3699
|
});
|
|
3278
3700
|
|
|
3279
3701
|
var businessHeaderPath = drawPath(parentGfx, headerPathData);
|
|
3280
|
-
attr
|
|
3702
|
+
attr(businessHeaderPath, {
|
|
3281
3703
|
strokeWidth: 1,
|
|
3282
3704
|
fill: getFillColor(element, '#aaaaaa'),
|
|
3283
3705
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
@@ -3291,7 +3713,7 @@
|
|
|
3291
3713
|
});
|
|
3292
3714
|
|
|
3293
3715
|
var businessPath = drawPath(parentGfx, headerData);
|
|
3294
|
-
attr
|
|
3716
|
+
attr(businessPath, {
|
|
3295
3717
|
strokeWidth: 1,
|
|
3296
3718
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3297
3719
|
});
|
|
@@ -3309,7 +3731,7 @@
|
|
|
3309
3731
|
var expanded = isExpanded(element);
|
|
3310
3732
|
|
|
3311
3733
|
if (isEventSubProcess(element)) {
|
|
3312
|
-
attr
|
|
3734
|
+
attr(rect, {
|
|
3313
3735
|
strokeDasharray: '1,2'
|
|
3314
3736
|
});
|
|
3315
3737
|
}
|
|
@@ -3531,7 +3953,7 @@
|
|
|
3531
3953
|
});
|
|
3532
3954
|
|
|
3533
3955
|
var parallelPath = drawPath(parentGfx, pathData);
|
|
3534
|
-
attr
|
|
3956
|
+
attr(parallelPath, {
|
|
3535
3957
|
strokeWidth: 1,
|
|
3536
3958
|
fill: 'none'
|
|
3537
3959
|
});
|
|
@@ -3539,7 +3961,7 @@
|
|
|
3539
3961
|
|
|
3540
3962
|
if (!instantiate) {
|
|
3541
3963
|
var innerCircle = drawCircle(parentGfx, element.width, element.height, element.height * 0.26);
|
|
3542
|
-
attr
|
|
3964
|
+
attr(innerCircle, {
|
|
3543
3965
|
strokeWidth: 1,
|
|
3544
3966
|
fill: 'none',
|
|
3545
3967
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
@@ -3584,7 +4006,7 @@
|
|
|
3584
4006
|
|
|
3585
4007
|
// conditional flow marker
|
|
3586
4008
|
if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Activity')) {
|
|
3587
|
-
attr
|
|
4009
|
+
attr(path, {
|
|
3588
4010
|
markerStart: marker('conditional-flow-marker', fill, stroke)
|
|
3589
4011
|
});
|
|
3590
4012
|
}
|
|
@@ -3592,7 +4014,7 @@
|
|
|
3592
4014
|
// default marker
|
|
3593
4015
|
if (source.default && (source.$instanceOf('bpmn:Gateway') || source.$instanceOf('bpmn:Activity')) &&
|
|
3594
4016
|
source.default === sequenceFlow) {
|
|
3595
|
-
attr
|
|
4017
|
+
attr(path, {
|
|
3596
4018
|
markerStart: marker('conditional-default-flow-marker', fill, stroke)
|
|
3597
4019
|
});
|
|
3598
4020
|
}
|
|
@@ -4310,9 +4732,9 @@
|
|
|
4310
4732
|
var helperSvg = document.getElementById('helper-svg');
|
|
4311
4733
|
|
|
4312
4734
|
if (!helperSvg) {
|
|
4313
|
-
helperSvg = create$
|
|
4735
|
+
helperSvg = create$2('svg');
|
|
4314
4736
|
|
|
4315
|
-
attr$
|
|
4737
|
+
attr$2(helperSvg, {
|
|
4316
4738
|
id: 'helper-svg'
|
|
4317
4739
|
});
|
|
4318
4740
|
|
|
@@ -4406,13 +4828,13 @@
|
|
|
4406
4828
|
var maxWidth = box.width - padding.left - padding.right;
|
|
4407
4829
|
|
|
4408
4830
|
// ensure correct rendering by attaching helper text node to invisible SVG
|
|
4409
|
-
var helperText = create$
|
|
4410
|
-
attr$
|
|
4411
|
-
attr$
|
|
4831
|
+
var helperText = create$2('text');
|
|
4832
|
+
attr$2(helperText, { x: 0, y: 0 });
|
|
4833
|
+
attr$2(helperText, style);
|
|
4412
4834
|
|
|
4413
4835
|
var helperSvg = getHelperSvg();
|
|
4414
4836
|
|
|
4415
|
-
append(helperSvg, helperText);
|
|
4837
|
+
append$1(helperSvg, helperText);
|
|
4416
4838
|
|
|
4417
4839
|
while (lines.length) {
|
|
4418
4840
|
layouted.push(layoutNext(lines, maxWidth, helperText));
|
|
@@ -4441,9 +4863,9 @@
|
|
|
4441
4863
|
y -= (lineHeight || layouted[0].height) / 4;
|
|
4442
4864
|
|
|
4443
4865
|
|
|
4444
|
-
var textElement = create$
|
|
4866
|
+
var textElement = create$2('text');
|
|
4445
4867
|
|
|
4446
|
-
attr$
|
|
4868
|
+
attr$2(textElement, style);
|
|
4447
4869
|
|
|
4448
4870
|
// layout each line taking into account that parent
|
|
4449
4871
|
// shape might resize to fit text size
|
|
@@ -4470,15 +4892,15 @@
|
|
|
4470
4892
|
- line.width) / 2 + padding.left), 0);
|
|
4471
4893
|
}
|
|
4472
4894
|
|
|
4473
|
-
var tspan = create$
|
|
4474
|
-
attr$
|
|
4895
|
+
var tspan = create$2('tspan');
|
|
4896
|
+
attr$2(tspan, { x: x, y: y });
|
|
4475
4897
|
|
|
4476
4898
|
tspan.textContent = line.text;
|
|
4477
4899
|
|
|
4478
|
-
append(textElement, tspan);
|
|
4900
|
+
append$1(textElement, tspan);
|
|
4479
4901
|
});
|
|
4480
4902
|
|
|
4481
|
-
remove$
|
|
4903
|
+
remove$3(helperText);
|
|
4482
4904
|
|
|
4483
4905
|
var dimensions = {
|
|
4484
4906
|
width: maxLineWidth,
|
|
@@ -6072,13 +6494,13 @@
|
|
|
6072
6494
|
throw new Error('invalid hit type <' + type + '>');
|
|
6073
6495
|
}
|
|
6074
6496
|
|
|
6075
|
-
attr$
|
|
6497
|
+
attr$2(hit, attrs);
|
|
6076
6498
|
|
|
6077
6499
|
return hit;
|
|
6078
6500
|
}
|
|
6079
6501
|
|
|
6080
6502
|
function appendHit(gfx, hit) {
|
|
6081
|
-
append(gfx, hit);
|
|
6503
|
+
append$1(gfx, hit);
|
|
6082
6504
|
}
|
|
6083
6505
|
|
|
6084
6506
|
|
|
@@ -6092,7 +6514,7 @@
|
|
|
6092
6514
|
this.removeHits = function(gfx) {
|
|
6093
6515
|
var hits = all('.djs-hit', gfx);
|
|
6094
6516
|
|
|
6095
|
-
forEach$1(hits, remove$
|
|
6517
|
+
forEach$1(hits, remove$3);
|
|
6096
6518
|
};
|
|
6097
6519
|
|
|
6098
6520
|
/**
|
|
@@ -6156,11 +6578,11 @@
|
|
|
6156
6578
|
y: 0
|
|
6157
6579
|
}, attrs);
|
|
6158
6580
|
|
|
6159
|
-
var hit = create$
|
|
6581
|
+
var hit = create$2('rect');
|
|
6160
6582
|
|
|
6161
6583
|
applyStyle(hit, type);
|
|
6162
6584
|
|
|
6163
|
-
attr$
|
|
6585
|
+
attr$2(hit, attrs);
|
|
6164
6586
|
|
|
6165
6587
|
appendHit(gfx, hit);
|
|
6166
6588
|
|
|
@@ -6186,7 +6608,7 @@
|
|
|
6186
6608
|
if (element.waypoints) {
|
|
6187
6609
|
updateLine(hit, element.waypoints);
|
|
6188
6610
|
} else {
|
|
6189
|
-
attr$
|
|
6611
|
+
attr$2(hit, {
|
|
6190
6612
|
width: element.width,
|
|
6191
6613
|
height: element.height
|
|
6192
6614
|
});
|
|
@@ -6394,9 +6816,9 @@
|
|
|
6394
6816
|
var self = this;
|
|
6395
6817
|
|
|
6396
6818
|
function createOutline(gfx, bounds) {
|
|
6397
|
-
var outline = create$
|
|
6819
|
+
var outline = create$2('rect');
|
|
6398
6820
|
|
|
6399
|
-
attr$
|
|
6821
|
+
attr$2(outline, assign$1({
|
|
6400
6822
|
x: 10,
|
|
6401
6823
|
y: 10,
|
|
6402
6824
|
rx: 3,
|
|
@@ -6404,7 +6826,7 @@
|
|
|
6404
6826
|
height: 100
|
|
6405
6827
|
}, OUTLINE_STYLE));
|
|
6406
6828
|
|
|
6407
|
-
append(gfx, outline);
|
|
6829
|
+
append$1(gfx, outline);
|
|
6408
6830
|
|
|
6409
6831
|
return outline;
|
|
6410
6832
|
}
|
|
@@ -6448,7 +6870,7 @@
|
|
|
6448
6870
|
*/
|
|
6449
6871
|
Outline.prototype.updateShapeOutline = function(outline, element) {
|
|
6450
6872
|
|
|
6451
|
-
attr$
|
|
6873
|
+
attr$2(outline, {
|
|
6452
6874
|
x: -this.offset,
|
|
6453
6875
|
y: -this.offset,
|
|
6454
6876
|
width: element.width + this.offset * 2,
|
|
@@ -6469,7 +6891,7 @@
|
|
|
6469
6891
|
|
|
6470
6892
|
var bbox = getBBox(connection);
|
|
6471
6893
|
|
|
6472
|
-
attr$
|
|
6894
|
+
attr$2(outline, {
|
|
6473
6895
|
x: bbox.x - this.offset,
|
|
6474
6896
|
y: bbox.y - this.offset,
|
|
6475
6897
|
width: bbox.width + this.offset * 2,
|
|
@@ -6673,13 +7095,13 @@
|
|
|
6673
7095
|
SelectionVisuals.prototype._updateSelectionOutline = function(selection) {
|
|
6674
7096
|
var layer = this._canvas.getLayer('selectionOutline');
|
|
6675
7097
|
|
|
6676
|
-
clear$
|
|
7098
|
+
clear$2(layer);
|
|
6677
7099
|
|
|
6678
7100
|
var enabled = selection.length > 1;
|
|
6679
7101
|
|
|
6680
7102
|
var container = this._canvas.getContainer();
|
|
6681
7103
|
|
|
6682
|
-
classes$
|
|
7104
|
+
classes$2(container)[enabled ? 'add' : 'remove']('djs-multi-select');
|
|
6683
7105
|
|
|
6684
7106
|
if (!enabled) {
|
|
6685
7107
|
return;
|
|
@@ -6687,15 +7109,15 @@
|
|
|
6687
7109
|
|
|
6688
7110
|
var bBox = addSelectionOutlinePadding(getBBox(selection));
|
|
6689
7111
|
|
|
6690
|
-
var rect = create$
|
|
7112
|
+
var rect = create$2('rect');
|
|
6691
7113
|
|
|
6692
|
-
attr$
|
|
7114
|
+
attr$2(rect, assign$1({
|
|
6693
7115
|
rx: 3
|
|
6694
7116
|
}, bBox));
|
|
6695
7117
|
|
|
6696
|
-
classes$
|
|
7118
|
+
classes$2(rect).add('djs-selection-outline');
|
|
6697
7119
|
|
|
6698
|
-
append(layer, rect);
|
|
7120
|
+
append$1(layer, rect);
|
|
6699
7121
|
};
|
|
6700
7122
|
|
|
6701
7123
|
// helpers //////////
|
|
@@ -7104,8 +7526,8 @@
|
|
|
7104
7526
|
var container = self._getOverlayContainer(overlay.element, true);
|
|
7105
7527
|
|
|
7106
7528
|
if (overlay) {
|
|
7107
|
-
remove$
|
|
7108
|
-
remove$
|
|
7529
|
+
remove$2(overlay.html);
|
|
7530
|
+
remove$2(overlay.htmlContainer);
|
|
7109
7531
|
|
|
7110
7532
|
delete overlay.htmlContainer;
|
|
7111
7533
|
delete overlay.element;
|
|
@@ -7138,7 +7560,7 @@
|
|
|
7138
7560
|
|
|
7139
7561
|
this._overlayContainers = [];
|
|
7140
7562
|
|
|
7141
|
-
clear(this._overlayRoot);
|
|
7563
|
+
clear$1(this._overlayRoot);
|
|
7142
7564
|
};
|
|
7143
7565
|
|
|
7144
7566
|
Overlays.prototype._updateOverlayContainer = function(container) {
|
|
@@ -7159,7 +7581,7 @@
|
|
|
7159
7581
|
|
|
7160
7582
|
setPosition(html, x, y);
|
|
7161
7583
|
|
|
7162
|
-
attr(container.html, 'data-container-id', element.id);
|
|
7584
|
+
attr$1(container.html, 'data-container-id', element.id);
|
|
7163
7585
|
};
|
|
7164
7586
|
|
|
7165
7587
|
|
|
@@ -7286,7 +7708,7 @@
|
|
|
7286
7708
|
htmlContainer.appendChild(html);
|
|
7287
7709
|
|
|
7288
7710
|
if (overlay.type) {
|
|
7289
|
-
classes(htmlContainer).add('djs-overlay-' + overlay.type);
|
|
7711
|
+
classes$1(htmlContainer).add('djs-overlay-' + overlay.type);
|
|
7290
7712
|
}
|
|
7291
7713
|
|
|
7292
7714
|
var elementRoot = this._canvas.findRoot(element);
|
|
@@ -7415,7 +7837,7 @@
|
|
|
7415
7837
|
var container = self._getOverlayContainer(element);
|
|
7416
7838
|
|
|
7417
7839
|
if (container) {
|
|
7418
|
-
remove$
|
|
7840
|
+
remove$2(container.html);
|
|
7419
7841
|
var i = self._overlayContainers.indexOf(container);
|
|
7420
7842
|
if (i !== -1) {
|
|
7421
7843
|
self._overlayContainers.splice(i, 1);
|
|
@@ -7446,7 +7868,7 @@
|
|
|
7446
7868
|
eventBus.on('element.marker.update', function(e) {
|
|
7447
7869
|
var container = self._getOverlayContainer(e.element, true);
|
|
7448
7870
|
if (container) {
|
|
7449
|
-
classes(container.html)[e.add ? 'add' : 'remove'](e.marker);
|
|
7871
|
+
classes$1(container.html)[e.add ? 'add' : 'remove'](e.marker);
|
|
7450
7872
|
}
|
|
7451
7873
|
});
|
|
7452
7874
|
|
|
@@ -7911,7 +8333,7 @@
|
|
|
7911
8333
|
function DrilldownBreadcrumbs(eventBus, elementRegistry, overlays, canvas) {
|
|
7912
8334
|
var breadcrumbs = domify$1('<ul class="bjs-breadcrumbs"></ul>');
|
|
7913
8335
|
var container = canvas.getContainer();
|
|
7914
|
-
var containerClasses = classes(container);
|
|
8336
|
+
var containerClasses = classes$1(container);
|
|
7915
8337
|
container.appendChild(breadcrumbs);
|
|
7916
8338
|
|
|
7917
8339
|
var boParents = [];
|
|
@@ -8467,7 +8889,7 @@
|
|
|
8467
8889
|
}
|
|
8468
8890
|
|
|
8469
8891
|
var hasContent = bo && bo.flowElements && bo.flowElements.length;
|
|
8470
|
-
classes(overlay.html).toggle(EMPTY_MARKER, !hasContent);
|
|
8892
|
+
classes$1(overlay.html).toggle(EMPTY_MARKER, !hasContent);
|
|
8471
8893
|
};
|
|
8472
8894
|
|
|
8473
8895
|
/**
|
|
@@ -9019,9 +9441,9 @@
|
|
|
9019
9441
|
};
|
|
9020
9442
|
|
|
9021
9443
|
DefaultRenderer.prototype.drawShape = function drawShape(visuals, element, attrs) {
|
|
9022
|
-
var rect = create$
|
|
9444
|
+
var rect = create$2('rect');
|
|
9023
9445
|
|
|
9024
|
-
attr$
|
|
9446
|
+
attr$2(rect, {
|
|
9025
9447
|
x: 0,
|
|
9026
9448
|
y: 0,
|
|
9027
9449
|
width: element.width || 0,
|
|
@@ -9029,12 +9451,12 @@
|
|
|
9029
9451
|
});
|
|
9030
9452
|
|
|
9031
9453
|
if (isFrameElement(element)) {
|
|
9032
|
-
attr$
|
|
9454
|
+
attr$2(rect, assign$1({}, this.FRAME_STYLE, attrs || {}));
|
|
9033
9455
|
} else {
|
|
9034
|
-
attr$
|
|
9456
|
+
attr$2(rect, assign$1({}, this.SHAPE_STYLE, attrs || {}));
|
|
9035
9457
|
}
|
|
9036
9458
|
|
|
9037
|
-
append(visuals, rect);
|
|
9459
|
+
append$1(visuals, rect);
|
|
9038
9460
|
|
|
9039
9461
|
return rect;
|
|
9040
9462
|
};
|
|
@@ -9042,7 +9464,7 @@
|
|
|
9042
9464
|
DefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) {
|
|
9043
9465
|
|
|
9044
9466
|
var line = createLine(connection.waypoints, assign$1({}, this.CONNECTION_STYLE, attrs || {}));
|
|
9045
|
-
append(visuals, line);
|
|
9467
|
+
append$1(visuals, line);
|
|
9046
9468
|
|
|
9047
9469
|
return line;
|
|
9048
9470
|
};
|
|
@@ -9280,8 +9702,8 @@
|
|
|
9280
9702
|
}
|
|
9281
9703
|
|
|
9282
9704
|
function createGroup(parent, cls, childIndex) {
|
|
9283
|
-
const group = create$
|
|
9284
|
-
classes$
|
|
9705
|
+
const group = create$2('g');
|
|
9706
|
+
classes$2(group).add(cls);
|
|
9285
9707
|
|
|
9286
9708
|
const index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;
|
|
9287
9709
|
|
|
@@ -9359,10 +9781,10 @@
|
|
|
9359
9781
|
// html container
|
|
9360
9782
|
const container = this._container = createContainer(config);
|
|
9361
9783
|
|
|
9362
|
-
const svg = this._svg = create$
|
|
9363
|
-
attr$
|
|
9784
|
+
const svg = this._svg = create$2('svg');
|
|
9785
|
+
attr$2(svg, { width: '100%', height: '100%' });
|
|
9364
9786
|
|
|
9365
|
-
append(container, svg);
|
|
9787
|
+
append$1(container, svg);
|
|
9366
9788
|
|
|
9367
9789
|
const viewport = this._viewport = createGroup(svg, 'viewport');
|
|
9368
9790
|
|
|
@@ -9600,7 +10022,7 @@
|
|
|
9600
10022
|
return group;
|
|
9601
10023
|
}
|
|
9602
10024
|
|
|
9603
|
-
remove$
|
|
10025
|
+
remove$3(group);
|
|
9604
10026
|
|
|
9605
10027
|
layer.visible = false;
|
|
9606
10028
|
|
|
@@ -9615,7 +10037,7 @@
|
|
|
9615
10037
|
if (layer) {
|
|
9616
10038
|
delete this._layers[name];
|
|
9617
10039
|
|
|
9618
|
-
remove$
|
|
10040
|
+
remove$3(layer.group);
|
|
9619
10041
|
}
|
|
9620
10042
|
};
|
|
9621
10043
|
|
|
@@ -9708,9 +10130,9 @@
|
|
|
9708
10130
|
|
|
9709
10131
|
// invoke either addClass or removeClass based on mode
|
|
9710
10132
|
if (add) {
|
|
9711
|
-
classes$
|
|
10133
|
+
classes$2(gfx).add(marker);
|
|
9712
10134
|
} else {
|
|
9713
|
-
classes$
|
|
10135
|
+
classes$2(gfx).remove(marker);
|
|
9714
10136
|
}
|
|
9715
10137
|
}
|
|
9716
10138
|
});
|
|
@@ -9776,7 +10198,7 @@
|
|
|
9776
10198
|
|
|
9777
10199
|
const gfx = this.getGraphics(element);
|
|
9778
10200
|
|
|
9779
|
-
return classes$
|
|
10201
|
+
return classes$2(gfx).has(marker);
|
|
9780
10202
|
};
|
|
9781
10203
|
|
|
9782
10204
|
/**
|
|
@@ -10674,10 +11096,10 @@
|
|
|
10674
11096
|
this._validateId(id);
|
|
10675
11097
|
|
|
10676
11098
|
// associate dom node with element
|
|
10677
|
-
attr$
|
|
11099
|
+
attr$2(gfx, ELEMENT_ID, id);
|
|
10678
11100
|
|
|
10679
11101
|
if (secondaryGfx) {
|
|
10680
|
-
attr$
|
|
11102
|
+
attr$2(secondaryGfx, ELEMENT_ID, id);
|
|
10681
11103
|
}
|
|
10682
11104
|
|
|
10683
11105
|
this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };
|
|
@@ -10696,10 +11118,10 @@
|
|
|
10696
11118
|
if (container) {
|
|
10697
11119
|
|
|
10698
11120
|
// unset element id on gfx
|
|
10699
|
-
attr$
|
|
11121
|
+
attr$2(container.gfx, ELEMENT_ID, '');
|
|
10700
11122
|
|
|
10701
11123
|
if (container.secondaryGfx) {
|
|
10702
|
-
attr$
|
|
11124
|
+
attr$2(container.secondaryGfx, ELEMENT_ID, '');
|
|
10703
11125
|
}
|
|
10704
11126
|
|
|
10705
11127
|
delete elements[id];
|
|
@@ -10754,7 +11176,7 @@
|
|
|
10754
11176
|
}
|
|
10755
11177
|
|
|
10756
11178
|
if (gfx) {
|
|
10757
|
-
attr$
|
|
11179
|
+
attr$2(gfx, ELEMENT_ID, id);
|
|
10758
11180
|
}
|
|
10759
11181
|
|
|
10760
11182
|
return gfx;
|
|
@@ -10779,7 +11201,7 @@
|
|
|
10779
11201
|
if (typeof filter === 'string') {
|
|
10780
11202
|
id = filter;
|
|
10781
11203
|
} else {
|
|
10782
|
-
id = filter && attr$
|
|
11204
|
+
id = filter && attr$2(filter, ELEMENT_ID);
|
|
10783
11205
|
}
|
|
10784
11206
|
|
|
10785
11207
|
var container = this._elements[id];
|
|
@@ -12062,10 +12484,10 @@
|
|
|
12062
12484
|
} else {
|
|
12063
12485
|
childrenGfx = getChildren(gfx);
|
|
12064
12486
|
if (!childrenGfx) {
|
|
12065
|
-
childrenGfx = create$
|
|
12066
|
-
classes$
|
|
12487
|
+
childrenGfx = create$2('g');
|
|
12488
|
+
classes$2(childrenGfx).add('djs-children');
|
|
12067
12489
|
|
|
12068
|
-
append(gfx.parentNode, childrenGfx);
|
|
12490
|
+
append$1(gfx.parentNode, childrenGfx);
|
|
12069
12491
|
}
|
|
12070
12492
|
}
|
|
12071
12493
|
|
|
@@ -12079,7 +12501,7 @@
|
|
|
12079
12501
|
GraphicsFactory.prototype._clear = function(gfx) {
|
|
12080
12502
|
var visual = getVisual(gfx);
|
|
12081
12503
|
|
|
12082
|
-
clear(visual);
|
|
12504
|
+
clear$1(visual);
|
|
12083
12505
|
|
|
12084
12506
|
return visual;
|
|
12085
12507
|
};
|
|
@@ -12114,31 +12536,31 @@
|
|
|
12114
12536
|
GraphicsFactory.prototype._createContainer = function(
|
|
12115
12537
|
type, childrenGfx, parentIndex, isFrame
|
|
12116
12538
|
) {
|
|
12117
|
-
var outerGfx = create$
|
|
12118
|
-
classes$
|
|
12539
|
+
var outerGfx = create$2('g');
|
|
12540
|
+
classes$2(outerGfx).add('djs-group');
|
|
12119
12541
|
|
|
12120
12542
|
// insert node at position
|
|
12121
12543
|
if (typeof parentIndex !== 'undefined') {
|
|
12122
12544
|
prependTo(outerGfx, childrenGfx, childrenGfx.childNodes[parentIndex]);
|
|
12123
12545
|
} else {
|
|
12124
|
-
append(childrenGfx, outerGfx);
|
|
12546
|
+
append$1(childrenGfx, outerGfx);
|
|
12125
12547
|
}
|
|
12126
12548
|
|
|
12127
|
-
var gfx = create$
|
|
12128
|
-
classes$
|
|
12129
|
-
classes$
|
|
12549
|
+
var gfx = create$2('g');
|
|
12550
|
+
classes$2(gfx).add('djs-element');
|
|
12551
|
+
classes$2(gfx).add('djs-' + type);
|
|
12130
12552
|
|
|
12131
12553
|
if (isFrame) {
|
|
12132
|
-
classes$
|
|
12554
|
+
classes$2(gfx).add('djs-frame');
|
|
12133
12555
|
}
|
|
12134
12556
|
|
|
12135
|
-
append(outerGfx, gfx);
|
|
12557
|
+
append$1(outerGfx, gfx);
|
|
12136
12558
|
|
|
12137
12559
|
// create visual
|
|
12138
|
-
var visual = create$
|
|
12139
|
-
classes$
|
|
12560
|
+
var visual = create$2('g');
|
|
12561
|
+
classes$2(visual).add('djs-visual');
|
|
12140
12562
|
|
|
12141
|
-
append(gfx, visual);
|
|
12563
|
+
append$1(gfx, visual);
|
|
12142
12564
|
|
|
12143
12565
|
return gfx;
|
|
12144
12566
|
};
|
|
@@ -12230,9 +12652,9 @@
|
|
|
12230
12652
|
}
|
|
12231
12653
|
|
|
12232
12654
|
if (element.hidden) {
|
|
12233
|
-
attr$
|
|
12655
|
+
attr$2(gfx, 'display', 'none');
|
|
12234
12656
|
} else {
|
|
12235
|
-
attr$
|
|
12657
|
+
attr$2(gfx, 'display', 'block');
|
|
12236
12658
|
}
|
|
12237
12659
|
};
|
|
12238
12660
|
|
|
@@ -12240,7 +12662,7 @@
|
|
|
12240
12662
|
var gfx = this._elementRegistry.getGraphics(element);
|
|
12241
12663
|
|
|
12242
12664
|
// remove
|
|
12243
|
-
remove$
|
|
12665
|
+
remove$3(gfx.parentNode);
|
|
12244
12666
|
};
|
|
12245
12667
|
|
|
12246
12668
|
|
|
@@ -21257,7 +21679,7 @@
|
|
|
21257
21679
|
Diagram.prototype.destroy.call(this);
|
|
21258
21680
|
|
|
21259
21681
|
// dom detach
|
|
21260
|
-
remove$
|
|
21682
|
+
remove$2(this._container);
|
|
21261
21683
|
};
|
|
21262
21684
|
|
|
21263
21685
|
/**
|
|
@@ -22106,12 +22528,12 @@
|
|
|
22106
22528
|
|
|
22107
22529
|
|
|
22108
22530
|
function set(mode) {
|
|
22109
|
-
var classes
|
|
22531
|
+
var classes = classes$1(document.body);
|
|
22110
22532
|
|
|
22111
|
-
classes
|
|
22533
|
+
classes.removeMatching(CURSOR_CLS_PATTERN);
|
|
22112
22534
|
|
|
22113
22535
|
if (mode) {
|
|
22114
|
-
classes
|
|
22536
|
+
classes.add('djs-cursor-' + mode);
|
|
22115
22537
|
}
|
|
22116
22538
|
}
|
|
22117
22539
|
|