camunda-bpmn-js 0.23.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 +13203 -12531
- 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 +9802 -10418
- package/dist/camunda-cloud-modeler.production.min.js +4 -4
- package/dist/camunda-cloud-navigated-viewer.development.js +846 -511
- package/dist/camunda-cloud-navigated-viewer.production.min.js +2 -2
- package/dist/camunda-cloud-viewer.development.js +843 -508
- package/dist/camunda-cloud-viewer.production.min.js +2 -2
- package/dist/camunda-platform-modeler.development.js +10095 -10635
- 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 +3 -3
|
@@ -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(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(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(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(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,
|
|
@@ -6055,13 +6477,13 @@
|
|
|
6055
6477
|
throw new Error('invalid hit type <' + type + '>');
|
|
6056
6478
|
}
|
|
6057
6479
|
|
|
6058
|
-
attr$
|
|
6480
|
+
attr$2(hit, attrs);
|
|
6059
6481
|
|
|
6060
6482
|
return hit;
|
|
6061
6483
|
}
|
|
6062
6484
|
|
|
6063
6485
|
function appendHit(gfx, hit) {
|
|
6064
|
-
append(gfx, hit);
|
|
6486
|
+
append$1(gfx, hit);
|
|
6065
6487
|
}
|
|
6066
6488
|
|
|
6067
6489
|
|
|
@@ -6075,7 +6497,7 @@
|
|
|
6075
6497
|
this.removeHits = function(gfx) {
|
|
6076
6498
|
var hits = all('.djs-hit', gfx);
|
|
6077
6499
|
|
|
6078
|
-
forEach$1(hits, remove$
|
|
6500
|
+
forEach$1(hits, remove$3);
|
|
6079
6501
|
};
|
|
6080
6502
|
|
|
6081
6503
|
/**
|
|
@@ -6139,11 +6561,11 @@
|
|
|
6139
6561
|
y: 0
|
|
6140
6562
|
}, attrs);
|
|
6141
6563
|
|
|
6142
|
-
var hit = create$
|
|
6564
|
+
var hit = create$2('rect');
|
|
6143
6565
|
|
|
6144
6566
|
applyStyle(hit, type);
|
|
6145
6567
|
|
|
6146
|
-
attr$
|
|
6568
|
+
attr$2(hit, attrs);
|
|
6147
6569
|
|
|
6148
6570
|
appendHit(gfx, hit);
|
|
6149
6571
|
|
|
@@ -6169,7 +6591,7 @@
|
|
|
6169
6591
|
if (element.waypoints) {
|
|
6170
6592
|
updateLine(hit, element.waypoints);
|
|
6171
6593
|
} else {
|
|
6172
|
-
attr$
|
|
6594
|
+
attr$2(hit, {
|
|
6173
6595
|
width: element.width,
|
|
6174
6596
|
height: element.height
|
|
6175
6597
|
});
|
|
@@ -6377,9 +6799,9 @@
|
|
|
6377
6799
|
var self = this;
|
|
6378
6800
|
|
|
6379
6801
|
function createOutline(gfx, bounds) {
|
|
6380
|
-
var outline = create$
|
|
6802
|
+
var outline = create$2('rect');
|
|
6381
6803
|
|
|
6382
|
-
attr$
|
|
6804
|
+
attr$2(outline, assign$1({
|
|
6383
6805
|
x: 10,
|
|
6384
6806
|
y: 10,
|
|
6385
6807
|
rx: 3,
|
|
@@ -6387,7 +6809,7 @@
|
|
|
6387
6809
|
height: 100
|
|
6388
6810
|
}, OUTLINE_STYLE));
|
|
6389
6811
|
|
|
6390
|
-
append(gfx, outline);
|
|
6812
|
+
append$1(gfx, outline);
|
|
6391
6813
|
|
|
6392
6814
|
return outline;
|
|
6393
6815
|
}
|
|
@@ -6431,7 +6853,7 @@
|
|
|
6431
6853
|
*/
|
|
6432
6854
|
Outline.prototype.updateShapeOutline = function(outline, element) {
|
|
6433
6855
|
|
|
6434
|
-
attr$
|
|
6856
|
+
attr$2(outline, {
|
|
6435
6857
|
x: -this.offset,
|
|
6436
6858
|
y: -this.offset,
|
|
6437
6859
|
width: element.width + this.offset * 2,
|
|
@@ -6452,7 +6874,7 @@
|
|
|
6452
6874
|
|
|
6453
6875
|
var bbox = getBBox(connection);
|
|
6454
6876
|
|
|
6455
|
-
attr$
|
|
6877
|
+
attr$2(outline, {
|
|
6456
6878
|
x: bbox.x - this.offset,
|
|
6457
6879
|
y: bbox.y - this.offset,
|
|
6458
6880
|
width: bbox.width + this.offset * 2,
|
|
@@ -6656,13 +7078,13 @@
|
|
|
6656
7078
|
SelectionVisuals.prototype._updateSelectionOutline = function(selection) {
|
|
6657
7079
|
var layer = this._canvas.getLayer('selectionOutline');
|
|
6658
7080
|
|
|
6659
|
-
clear$
|
|
7081
|
+
clear$2(layer);
|
|
6660
7082
|
|
|
6661
7083
|
var enabled = selection.length > 1;
|
|
6662
7084
|
|
|
6663
7085
|
var container = this._canvas.getContainer();
|
|
6664
7086
|
|
|
6665
|
-
classes$
|
|
7087
|
+
classes$2(container)[enabled ? 'add' : 'remove']('djs-multi-select');
|
|
6666
7088
|
|
|
6667
7089
|
if (!enabled) {
|
|
6668
7090
|
return;
|
|
@@ -6670,15 +7092,15 @@
|
|
|
6670
7092
|
|
|
6671
7093
|
var bBox = addSelectionOutlinePadding(getBBox(selection));
|
|
6672
7094
|
|
|
6673
|
-
var rect = create$
|
|
7095
|
+
var rect = create$2('rect');
|
|
6674
7096
|
|
|
6675
|
-
attr$
|
|
7097
|
+
attr$2(rect, assign$1({
|
|
6676
7098
|
rx: 3
|
|
6677
7099
|
}, bBox));
|
|
6678
7100
|
|
|
6679
|
-
classes$
|
|
7101
|
+
classes$2(rect).add('djs-selection-outline');
|
|
6680
7102
|
|
|
6681
|
-
append(layer, rect);
|
|
7103
|
+
append$1(layer, rect);
|
|
6682
7104
|
};
|
|
6683
7105
|
|
|
6684
7106
|
// helpers //////////
|
|
@@ -7087,8 +7509,8 @@
|
|
|
7087
7509
|
var container = self._getOverlayContainer(overlay.element, true);
|
|
7088
7510
|
|
|
7089
7511
|
if (overlay) {
|
|
7090
|
-
remove$
|
|
7091
|
-
remove$
|
|
7512
|
+
remove$2(overlay.html);
|
|
7513
|
+
remove$2(overlay.htmlContainer);
|
|
7092
7514
|
|
|
7093
7515
|
delete overlay.htmlContainer;
|
|
7094
7516
|
delete overlay.element;
|
|
@@ -7121,7 +7543,7 @@
|
|
|
7121
7543
|
|
|
7122
7544
|
this._overlayContainers = [];
|
|
7123
7545
|
|
|
7124
|
-
clear(this._overlayRoot);
|
|
7546
|
+
clear$1(this._overlayRoot);
|
|
7125
7547
|
};
|
|
7126
7548
|
|
|
7127
7549
|
Overlays.prototype._updateOverlayContainer = function(container) {
|
|
@@ -7142,7 +7564,7 @@
|
|
|
7142
7564
|
|
|
7143
7565
|
setPosition(html, x, y);
|
|
7144
7566
|
|
|
7145
|
-
attr(container.html, 'data-container-id', element.id);
|
|
7567
|
+
attr$1(container.html, 'data-container-id', element.id);
|
|
7146
7568
|
};
|
|
7147
7569
|
|
|
7148
7570
|
|
|
@@ -7269,7 +7691,7 @@
|
|
|
7269
7691
|
htmlContainer.appendChild(html);
|
|
7270
7692
|
|
|
7271
7693
|
if (overlay.type) {
|
|
7272
|
-
classes(htmlContainer).add('djs-overlay-' + overlay.type);
|
|
7694
|
+
classes$1(htmlContainer).add('djs-overlay-' + overlay.type);
|
|
7273
7695
|
}
|
|
7274
7696
|
|
|
7275
7697
|
var elementRoot = this._canvas.findRoot(element);
|
|
@@ -7398,7 +7820,7 @@
|
|
|
7398
7820
|
var container = self._getOverlayContainer(element);
|
|
7399
7821
|
|
|
7400
7822
|
if (container) {
|
|
7401
|
-
remove$
|
|
7823
|
+
remove$2(container.html);
|
|
7402
7824
|
var i = self._overlayContainers.indexOf(container);
|
|
7403
7825
|
if (i !== -1) {
|
|
7404
7826
|
self._overlayContainers.splice(i, 1);
|
|
@@ -7429,7 +7851,7 @@
|
|
|
7429
7851
|
eventBus.on('element.marker.update', function(e) {
|
|
7430
7852
|
var container = self._getOverlayContainer(e.element, true);
|
|
7431
7853
|
if (container) {
|
|
7432
|
-
classes(container.html)[e.add ? 'add' : 'remove'](e.marker);
|
|
7854
|
+
classes$1(container.html)[e.add ? 'add' : 'remove'](e.marker);
|
|
7433
7855
|
}
|
|
7434
7856
|
});
|
|
7435
7857
|
|
|
@@ -7894,7 +8316,7 @@
|
|
|
7894
8316
|
function DrilldownBreadcrumbs(eventBus, elementRegistry, overlays, canvas) {
|
|
7895
8317
|
var breadcrumbs = domify$1('<ul class="bjs-breadcrumbs"></ul>');
|
|
7896
8318
|
var container = canvas.getContainer();
|
|
7897
|
-
var containerClasses = classes(container);
|
|
8319
|
+
var containerClasses = classes$1(container);
|
|
7898
8320
|
container.appendChild(breadcrumbs);
|
|
7899
8321
|
|
|
7900
8322
|
var boParents = [];
|
|
@@ -8450,7 +8872,7 @@
|
|
|
8450
8872
|
}
|
|
8451
8873
|
|
|
8452
8874
|
var hasContent = bo && bo.flowElements && bo.flowElements.length;
|
|
8453
|
-
classes(overlay.html).toggle(EMPTY_MARKER, !hasContent);
|
|
8875
|
+
classes$1(overlay.html).toggle(EMPTY_MARKER, !hasContent);
|
|
8454
8876
|
};
|
|
8455
8877
|
|
|
8456
8878
|
/**
|
|
@@ -9002,9 +9424,9 @@
|
|
|
9002
9424
|
};
|
|
9003
9425
|
|
|
9004
9426
|
DefaultRenderer.prototype.drawShape = function drawShape(visuals, element, attrs) {
|
|
9005
|
-
var rect = create$
|
|
9427
|
+
var rect = create$2('rect');
|
|
9006
9428
|
|
|
9007
|
-
attr$
|
|
9429
|
+
attr$2(rect, {
|
|
9008
9430
|
x: 0,
|
|
9009
9431
|
y: 0,
|
|
9010
9432
|
width: element.width || 0,
|
|
@@ -9012,12 +9434,12 @@
|
|
|
9012
9434
|
});
|
|
9013
9435
|
|
|
9014
9436
|
if (isFrameElement(element)) {
|
|
9015
|
-
attr$
|
|
9437
|
+
attr$2(rect, assign$1({}, this.FRAME_STYLE, attrs || {}));
|
|
9016
9438
|
} else {
|
|
9017
|
-
attr$
|
|
9439
|
+
attr$2(rect, assign$1({}, this.SHAPE_STYLE, attrs || {}));
|
|
9018
9440
|
}
|
|
9019
9441
|
|
|
9020
|
-
append(visuals, rect);
|
|
9442
|
+
append$1(visuals, rect);
|
|
9021
9443
|
|
|
9022
9444
|
return rect;
|
|
9023
9445
|
};
|
|
@@ -9025,7 +9447,7 @@
|
|
|
9025
9447
|
DefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) {
|
|
9026
9448
|
|
|
9027
9449
|
var line = createLine(connection.waypoints, assign$1({}, this.CONNECTION_STYLE, attrs || {}));
|
|
9028
|
-
append(visuals, line);
|
|
9450
|
+
append$1(visuals, line);
|
|
9029
9451
|
|
|
9030
9452
|
return line;
|
|
9031
9453
|
};
|
|
@@ -9263,8 +9685,8 @@
|
|
|
9263
9685
|
}
|
|
9264
9686
|
|
|
9265
9687
|
function createGroup(parent, cls, childIndex) {
|
|
9266
|
-
const group = create$
|
|
9267
|
-
classes$
|
|
9688
|
+
const group = create$2('g');
|
|
9689
|
+
classes$2(group).add(cls);
|
|
9268
9690
|
|
|
9269
9691
|
const index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;
|
|
9270
9692
|
|
|
@@ -9342,10 +9764,10 @@
|
|
|
9342
9764
|
// html container
|
|
9343
9765
|
const container = this._container = createContainer(config);
|
|
9344
9766
|
|
|
9345
|
-
const svg = this._svg = create$
|
|
9346
|
-
attr$
|
|
9767
|
+
const svg = this._svg = create$2('svg');
|
|
9768
|
+
attr$2(svg, { width: '100%', height: '100%' });
|
|
9347
9769
|
|
|
9348
|
-
append(container, svg);
|
|
9770
|
+
append$1(container, svg);
|
|
9349
9771
|
|
|
9350
9772
|
const viewport = this._viewport = createGroup(svg, 'viewport');
|
|
9351
9773
|
|
|
@@ -9583,7 +10005,7 @@
|
|
|
9583
10005
|
return group;
|
|
9584
10006
|
}
|
|
9585
10007
|
|
|
9586
|
-
remove$
|
|
10008
|
+
remove$3(group);
|
|
9587
10009
|
|
|
9588
10010
|
layer.visible = false;
|
|
9589
10011
|
|
|
@@ -9598,7 +10020,7 @@
|
|
|
9598
10020
|
if (layer) {
|
|
9599
10021
|
delete this._layers[name];
|
|
9600
10022
|
|
|
9601
|
-
remove$
|
|
10023
|
+
remove$3(layer.group);
|
|
9602
10024
|
}
|
|
9603
10025
|
};
|
|
9604
10026
|
|
|
@@ -9691,9 +10113,9 @@
|
|
|
9691
10113
|
|
|
9692
10114
|
// invoke either addClass or removeClass based on mode
|
|
9693
10115
|
if (add) {
|
|
9694
|
-
classes$
|
|
10116
|
+
classes$2(gfx).add(marker);
|
|
9695
10117
|
} else {
|
|
9696
|
-
classes$
|
|
10118
|
+
classes$2(gfx).remove(marker);
|
|
9697
10119
|
}
|
|
9698
10120
|
}
|
|
9699
10121
|
});
|
|
@@ -9759,7 +10181,7 @@
|
|
|
9759
10181
|
|
|
9760
10182
|
const gfx = this.getGraphics(element);
|
|
9761
10183
|
|
|
9762
|
-
return classes$
|
|
10184
|
+
return classes$2(gfx).has(marker);
|
|
9763
10185
|
};
|
|
9764
10186
|
|
|
9765
10187
|
/**
|
|
@@ -10657,10 +11079,10 @@
|
|
|
10657
11079
|
this._validateId(id);
|
|
10658
11080
|
|
|
10659
11081
|
// associate dom node with element
|
|
10660
|
-
attr$
|
|
11082
|
+
attr$2(gfx, ELEMENT_ID, id);
|
|
10661
11083
|
|
|
10662
11084
|
if (secondaryGfx) {
|
|
10663
|
-
attr$
|
|
11085
|
+
attr$2(secondaryGfx, ELEMENT_ID, id);
|
|
10664
11086
|
}
|
|
10665
11087
|
|
|
10666
11088
|
this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };
|
|
@@ -10679,10 +11101,10 @@
|
|
|
10679
11101
|
if (container) {
|
|
10680
11102
|
|
|
10681
11103
|
// unset element id on gfx
|
|
10682
|
-
attr$
|
|
11104
|
+
attr$2(container.gfx, ELEMENT_ID, '');
|
|
10683
11105
|
|
|
10684
11106
|
if (container.secondaryGfx) {
|
|
10685
|
-
attr$
|
|
11107
|
+
attr$2(container.secondaryGfx, ELEMENT_ID, '');
|
|
10686
11108
|
}
|
|
10687
11109
|
|
|
10688
11110
|
delete elements[id];
|
|
@@ -10737,7 +11159,7 @@
|
|
|
10737
11159
|
}
|
|
10738
11160
|
|
|
10739
11161
|
if (gfx) {
|
|
10740
|
-
attr$
|
|
11162
|
+
attr$2(gfx, ELEMENT_ID, id);
|
|
10741
11163
|
}
|
|
10742
11164
|
|
|
10743
11165
|
return gfx;
|
|
@@ -10762,7 +11184,7 @@
|
|
|
10762
11184
|
if (typeof filter === 'string') {
|
|
10763
11185
|
id = filter;
|
|
10764
11186
|
} else {
|
|
10765
|
-
id = filter && attr$
|
|
11187
|
+
id = filter && attr$2(filter, ELEMENT_ID);
|
|
10766
11188
|
}
|
|
10767
11189
|
|
|
10768
11190
|
var container = this._elements[id];
|
|
@@ -12045,10 +12467,10 @@
|
|
|
12045
12467
|
} else {
|
|
12046
12468
|
childrenGfx = getChildren(gfx);
|
|
12047
12469
|
if (!childrenGfx) {
|
|
12048
|
-
childrenGfx = create$
|
|
12049
|
-
classes$
|
|
12470
|
+
childrenGfx = create$2('g');
|
|
12471
|
+
classes$2(childrenGfx).add('djs-children');
|
|
12050
12472
|
|
|
12051
|
-
append(gfx.parentNode, childrenGfx);
|
|
12473
|
+
append$1(gfx.parentNode, childrenGfx);
|
|
12052
12474
|
}
|
|
12053
12475
|
}
|
|
12054
12476
|
|
|
@@ -12062,7 +12484,7 @@
|
|
|
12062
12484
|
GraphicsFactory.prototype._clear = function(gfx) {
|
|
12063
12485
|
var visual = getVisual(gfx);
|
|
12064
12486
|
|
|
12065
|
-
clear(visual);
|
|
12487
|
+
clear$1(visual);
|
|
12066
12488
|
|
|
12067
12489
|
return visual;
|
|
12068
12490
|
};
|
|
@@ -12097,31 +12519,31 @@
|
|
|
12097
12519
|
GraphicsFactory.prototype._createContainer = function(
|
|
12098
12520
|
type, childrenGfx, parentIndex, isFrame
|
|
12099
12521
|
) {
|
|
12100
|
-
var outerGfx = create$
|
|
12101
|
-
classes$
|
|
12522
|
+
var outerGfx = create$2('g');
|
|
12523
|
+
classes$2(outerGfx).add('djs-group');
|
|
12102
12524
|
|
|
12103
12525
|
// insert node at position
|
|
12104
12526
|
if (typeof parentIndex !== 'undefined') {
|
|
12105
12527
|
prependTo(outerGfx, childrenGfx, childrenGfx.childNodes[parentIndex]);
|
|
12106
12528
|
} else {
|
|
12107
|
-
append(childrenGfx, outerGfx);
|
|
12529
|
+
append$1(childrenGfx, outerGfx);
|
|
12108
12530
|
}
|
|
12109
12531
|
|
|
12110
|
-
var gfx = create$
|
|
12111
|
-
classes$
|
|
12112
|
-
classes$
|
|
12532
|
+
var gfx = create$2('g');
|
|
12533
|
+
classes$2(gfx).add('djs-element');
|
|
12534
|
+
classes$2(gfx).add('djs-' + type);
|
|
12113
12535
|
|
|
12114
12536
|
if (isFrame) {
|
|
12115
|
-
classes$
|
|
12537
|
+
classes$2(gfx).add('djs-frame');
|
|
12116
12538
|
}
|
|
12117
12539
|
|
|
12118
|
-
append(outerGfx, gfx);
|
|
12540
|
+
append$1(outerGfx, gfx);
|
|
12119
12541
|
|
|
12120
12542
|
// create visual
|
|
12121
|
-
var visual = create$
|
|
12122
|
-
classes$
|
|
12543
|
+
var visual = create$2('g');
|
|
12544
|
+
classes$2(visual).add('djs-visual');
|
|
12123
12545
|
|
|
12124
|
-
append(gfx, visual);
|
|
12546
|
+
append$1(gfx, visual);
|
|
12125
12547
|
|
|
12126
12548
|
return gfx;
|
|
12127
12549
|
};
|
|
@@ -12213,9 +12635,9 @@
|
|
|
12213
12635
|
}
|
|
12214
12636
|
|
|
12215
12637
|
if (element.hidden) {
|
|
12216
|
-
attr$
|
|
12638
|
+
attr$2(gfx, 'display', 'none');
|
|
12217
12639
|
} else {
|
|
12218
|
-
attr$
|
|
12640
|
+
attr$2(gfx, 'display', 'block');
|
|
12219
12641
|
}
|
|
12220
12642
|
};
|
|
12221
12643
|
|
|
@@ -12223,7 +12645,7 @@
|
|
|
12223
12645
|
var gfx = this._elementRegistry.getGraphics(element);
|
|
12224
12646
|
|
|
12225
12647
|
// remove
|
|
12226
|
-
remove$
|
|
12648
|
+
remove$3(gfx.parentNode);
|
|
12227
12649
|
};
|
|
12228
12650
|
|
|
12229
12651
|
|
|
@@ -21240,7 +21662,7 @@
|
|
|
21240
21662
|
Diagram.prototype.destroy.call(this);
|
|
21241
21663
|
|
|
21242
21664
|
// dom detach
|
|
21243
|
-
remove$
|
|
21665
|
+
remove$2(this._container);
|
|
21244
21666
|
};
|
|
21245
21667
|
|
|
21246
21668
|
/**
|