camunda-bpmn-js 0.21.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-modeler.development.js +8920 -9441
- package/dist/base-modeler.production.min.js +4 -4
- package/dist/base-navigated-viewer.development.js +322 -744
- package/dist/base-navigated-viewer.production.min.js +2 -2
- package/dist/base-viewer.development.js +319 -741
- package/dist/base-viewer.production.min.js +2 -2
- package/dist/camunda-cloud-modeler.development.js +4863 -4405
- package/dist/camunda-cloud-modeler.production.min.js +4 -4
- package/dist/camunda-cloud-navigated-viewer.development.js +528 -868
- package/dist/camunda-cloud-navigated-viewer.production.min.js +2 -2
- package/dist/camunda-cloud-viewer.development.js +525 -865
- package/dist/camunda-cloud-viewer.production.min.js +2 -2
- package/dist/camunda-platform-modeler.development.js +2768 -2074
- package/dist/camunda-platform-modeler.production.min.js +4 -4
- package/dist/camunda-platform-navigated-viewer.development.js +322 -744
- package/dist/camunda-platform-navigated-viewer.production.min.js +2 -2
- package/dist/camunda-platform-viewer.development.js +319 -741
- package/dist/camunda-platform-viewer.production.min.js +2 -2
- package/lib/camunda-cloud/Modeler.js +0 -12
- package/lib/camunda-cloud/util/commonModules.js +0 -3
- package/package.json +3 -4
- package/lib/camunda-cloud/features/context-pad/ContextPadOptions.js +0 -16
- package/lib/camunda-cloud/features/context-pad/ContextPadProvider.js +0 -45
- package/lib/camunda-cloud/features/context-pad/index.js +0 -6
- package/lib/camunda-cloud/features/drilldown/index.js +0 -3
- package/lib/camunda-cloud/features/palette/PaletteOptions.js +0 -15
- package/lib/camunda-cloud/features/palette/PaletteProvider.js +0 -31
- package/lib/camunda-cloud/features/palette/index.js +0 -6
- package/lib/camunda-cloud/features/popup-menu/ReplaceMenuProvider.js +0 -72
- package/lib/camunda-cloud/features/popup-menu/ReplaceOptions.js +0 -49
- package/lib/camunda-cloud/features/popup-menu/index.js +0 -6
|
@@ -646,7 +646,7 @@
|
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
648
|
|
|
649
|
-
function ensureImported
|
|
649
|
+
function ensureImported(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
|
|
678
|
-
return target.appendChild(ensureImported
|
|
677
|
+
function appendTo(element, target) {
|
|
678
|
+
return target.appendChild(ensureImported(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
|
|
694
|
-
appendTo
|
|
693
|
+
function append(target, node) {
|
|
694
|
+
appendTo(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
|
|
702
|
+
var LENGTH_ATTR = 2;
|
|
703
703
|
|
|
704
|
-
var CSS_PROPERTIES
|
|
704
|
+
var CSS_PROPERTIES = {
|
|
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,
|
|
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,
|
|
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
|
|
770
|
-
if (CSS_PROPERTIES
|
|
769
|
+
function getAttribute(node, name) {
|
|
770
|
+
if (CSS_PROPERTIES[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
|
|
777
|
+
function setAttribute(node, name, value) {
|
|
778
778
|
var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
779
779
|
|
|
780
|
-
var type = CSS_PROPERTIES
|
|
780
|
+
var type = CSS_PROPERTIES[hyphenated];
|
|
781
781
|
|
|
782
782
|
if (type) {
|
|
783
783
|
|
|
784
784
|
// append pixel unit, unless present
|
|
785
|
-
if (type === LENGTH_ATTR
|
|
785
|
+
if (type === LENGTH_ATTR && 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
|
|
795
|
+
function setAttributes(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
|
|
800
|
+
setAttribute(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$1(node, name, value) {
|
|
815
815
|
if (typeof name === 'string') {
|
|
816
816
|
if (value !== undefined) {
|
|
817
|
-
setAttribute
|
|
817
|
+
setAttribute(node, name, value);
|
|
818
818
|
} else {
|
|
819
|
-
return getAttribute
|
|
819
|
+
return getAttribute(node, name);
|
|
820
820
|
}
|
|
821
821
|
} else {
|
|
822
|
-
setAttributes
|
|
822
|
+
setAttributes(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$1 = 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$1(el) {
|
|
849
|
+
return new ClassList$1(el);
|
|
850
850
|
}
|
|
851
851
|
|
|
852
|
-
function ClassList$
|
|
852
|
+
function ClassList$1(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$1.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$1.prototype.remove = function(name) {
|
|
884
|
+
if ('[object RegExp]' == toString$1.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$1.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$1.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$1.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$1.prototype.has =
|
|
953
|
+
ClassList$1.prototype.contains = function(name) {
|
|
954
954
|
return this.list.contains(name);
|
|
955
955
|
};
|
|
956
956
|
|
|
957
|
-
function remove$
|
|
957
|
+
function remove$2(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$1(element) {
|
|
978
978
|
var child;
|
|
979
979
|
|
|
980
980
|
while ((child = element.firstChild)) {
|
|
981
|
-
remove$
|
|
981
|
+
remove$2(child);
|
|
982
982
|
}
|
|
983
983
|
|
|
984
984
|
return element;
|
|
985
985
|
}
|
|
986
986
|
|
|
987
|
-
var ns
|
|
987
|
+
var ns = {
|
|
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
|
|
995
|
+
var SVG_START = '<svg xmlns="' + ns.svg + '"';
|
|
996
996
|
|
|
997
|
-
function parse$
|
|
997
|
+
function parse$1(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
|
|
1004
|
-
svg = SVG_START
|
|
1003
|
+
if (svg.indexOf(ns.svg) === -1) {
|
|
1004
|
+
svg = SVG_START + svg.substring(4);
|
|
1005
1005
|
}
|
|
1006
1006
|
} else {
|
|
1007
1007
|
|
|
1008
1008
|
// namespace svg
|
|
1009
|
-
svg = SVG_START
|
|
1009
|
+
svg = SVG_START + '>' + svg + '</svg>';
|
|
1010
1010
|
unwrap = true;
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
|
-
var parsed = parseDocument
|
|
1013
|
+
var parsed = parseDocument(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
|
|
1030
|
+
function parseDocument(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$1(name, attrs) {
|
|
1055
1055
|
var element;
|
|
1056
1056
|
|
|
1057
1057
|
if (name.charAt(0) === '<') {
|
|
1058
|
-
element = parse$
|
|
1058
|
+
element = parse$1(name).firstChild;
|
|
1059
1059
|
element = document.importNode(element, true);
|
|
1060
1060
|
} else {
|
|
1061
|
-
element = document.createElementNS(ns
|
|
1061
|
+
element = document.createElementNS(ns.svg, name);
|
|
1062
1062
|
}
|
|
1063
1063
|
|
|
1064
1064
|
if (attrs) {
|
|
1065
|
-
attr$
|
|
1065
|
+
attr$1(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$1('svg');
|
|
1081
1081
|
}
|
|
1082
1082
|
|
|
1083
1083
|
return node;
|
|
@@ -1132,6 +1132,152 @@
|
|
|
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
|
+
|
|
1135
1281
|
/**
|
|
1136
1282
|
* transform accessor utility
|
|
1137
1283
|
*/
|
|
@@ -1194,18 +1340,18 @@
|
|
|
1194
1340
|
|
|
1195
1341
|
function createLine(points, attrs) {
|
|
1196
1342
|
|
|
1197
|
-
var line = create$
|
|
1198
|
-
attr$
|
|
1343
|
+
var line = create$1('polyline');
|
|
1344
|
+
attr$1(line, { points: toSVGPoints(points) });
|
|
1199
1345
|
|
|
1200
1346
|
if (attrs) {
|
|
1201
|
-
attr$
|
|
1347
|
+
attr$1(line, attrs);
|
|
1202
1348
|
}
|
|
1203
1349
|
|
|
1204
1350
|
return line;
|
|
1205
1351
|
}
|
|
1206
1352
|
|
|
1207
1353
|
function updateLine(gfx, points) {
|
|
1208
|
-
attr$
|
|
1354
|
+
attr$1(gfx, { points: toSVGPoints(points) });
|
|
1209
1355
|
|
|
1210
1356
|
return gfx;
|
|
1211
1357
|
}
|
|
@@ -1474,7 +1620,7 @@
|
|
|
1474
1620
|
* @param {String} [val]
|
|
1475
1621
|
* @api public
|
|
1476
1622
|
*/
|
|
1477
|
-
function attr
|
|
1623
|
+
function attr(el, name, val) {
|
|
1478
1624
|
|
|
1479
1625
|
// get
|
|
1480
1626
|
if (arguments.length == 2) {
|
|
@@ -1502,7 +1648,7 @@
|
|
|
1502
1648
|
* toString reference.
|
|
1503
1649
|
*/
|
|
1504
1650
|
|
|
1505
|
-
const toString
|
|
1651
|
+
const toString = Object.prototype.toString;
|
|
1506
1652
|
|
|
1507
1653
|
/**
|
|
1508
1654
|
* Wrap `el` in a `ClassList`.
|
|
@@ -1512,8 +1658,8 @@
|
|
|
1512
1658
|
* @api public
|
|
1513
1659
|
*/
|
|
1514
1660
|
|
|
1515
|
-
function classes
|
|
1516
|
-
return new ClassList
|
|
1661
|
+
function classes(el) {
|
|
1662
|
+
return new ClassList(el);
|
|
1517
1663
|
}
|
|
1518
1664
|
|
|
1519
1665
|
/**
|
|
@@ -1523,7 +1669,7 @@
|
|
|
1523
1669
|
* @api private
|
|
1524
1670
|
*/
|
|
1525
1671
|
|
|
1526
|
-
function ClassList
|
|
1672
|
+
function ClassList(el) {
|
|
1527
1673
|
if (!el || !el.nodeType) {
|
|
1528
1674
|
throw new Error('A DOM element reference is required');
|
|
1529
1675
|
}
|
|
@@ -1539,7 +1685,7 @@
|
|
|
1539
1685
|
* @api public
|
|
1540
1686
|
*/
|
|
1541
1687
|
|
|
1542
|
-
ClassList
|
|
1688
|
+
ClassList.prototype.add = function(name) {
|
|
1543
1689
|
this.list.add(name);
|
|
1544
1690
|
return this;
|
|
1545
1691
|
};
|
|
@@ -1554,8 +1700,8 @@
|
|
|
1554
1700
|
* @api public
|
|
1555
1701
|
*/
|
|
1556
1702
|
|
|
1557
|
-
ClassList
|
|
1558
|
-
if ('[object RegExp]' == toString
|
|
1703
|
+
ClassList.prototype.remove = function(name) {
|
|
1704
|
+
if ('[object RegExp]' == toString.call(name)) {
|
|
1559
1705
|
return this.removeMatching(name);
|
|
1560
1706
|
}
|
|
1561
1707
|
|
|
@@ -1571,7 +1717,7 @@
|
|
|
1571
1717
|
* @api private
|
|
1572
1718
|
*/
|
|
1573
1719
|
|
|
1574
|
-
ClassList
|
|
1720
|
+
ClassList.prototype.removeMatching = function(re) {
|
|
1575
1721
|
const arr = this.array();
|
|
1576
1722
|
for (let i = 0; i < arr.length; i++) {
|
|
1577
1723
|
if (re.test(arr[i])) {
|
|
@@ -1593,7 +1739,7 @@
|
|
|
1593
1739
|
* @api public
|
|
1594
1740
|
*/
|
|
1595
1741
|
|
|
1596
|
-
ClassList
|
|
1742
|
+
ClassList.prototype.toggle = function(name, force) {
|
|
1597
1743
|
if ('undefined' !== typeof force) {
|
|
1598
1744
|
if (force !== this.list.toggle(name, force)) {
|
|
1599
1745
|
this.list.toggle(name); // toggle again to correct
|
|
@@ -1611,7 +1757,7 @@
|
|
|
1611
1757
|
* @api public
|
|
1612
1758
|
*/
|
|
1613
1759
|
|
|
1614
|
-
ClassList
|
|
1760
|
+
ClassList.prototype.array = function() {
|
|
1615
1761
|
return Array.from(this.list);
|
|
1616
1762
|
};
|
|
1617
1763
|
|
|
@@ -1623,15 +1769,15 @@
|
|
|
1623
1769
|
* @api public
|
|
1624
1770
|
*/
|
|
1625
1771
|
|
|
1626
|
-
ClassList
|
|
1627
|
-
ClassList
|
|
1772
|
+
ClassList.prototype.has =
|
|
1773
|
+
ClassList.prototype.contains = function(name) {
|
|
1628
1774
|
return this.list.contains(name);
|
|
1629
1775
|
};
|
|
1630
1776
|
|
|
1631
1777
|
/**
|
|
1632
1778
|
* Remove all children from the given element.
|
|
1633
1779
|
*/
|
|
1634
|
-
function clear
|
|
1780
|
+
function clear(el) {
|
|
1635
1781
|
|
|
1636
1782
|
var c;
|
|
1637
1783
|
|
|
@@ -1783,7 +1929,7 @@
|
|
|
1783
1929
|
* Expose `parse`.
|
|
1784
1930
|
*/
|
|
1785
1931
|
|
|
1786
|
-
var domify = parse
|
|
1932
|
+
var domify = parse;
|
|
1787
1933
|
|
|
1788
1934
|
/**
|
|
1789
1935
|
* Tests for browser support.
|
|
@@ -1847,7 +1993,7 @@
|
|
|
1847
1993
|
* @api private
|
|
1848
1994
|
*/
|
|
1849
1995
|
|
|
1850
|
-
function parse
|
|
1996
|
+
function parse(html, doc) {
|
|
1851
1997
|
if ('string' != typeof html) throw new TypeError('String expected');
|
|
1852
1998
|
|
|
1853
1999
|
// default to the global `document` object
|
|
@@ -1905,578 +2051,10 @@
|
|
|
1905
2051
|
return el.querySelectorAll(selector);
|
|
1906
2052
|
}
|
|
1907
2053
|
|
|
1908
|
-
function remove$
|
|
2054
|
+
function remove$1(el) {
|
|
1909
2055
|
el.parentNode && el.parentNode.removeChild(el);
|
|
1910
2056
|
}
|
|
1911
2057
|
|
|
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
|
-
|
|
2480
2058
|
/**
|
|
2481
2059
|
* @param {<SVGElement>} element
|
|
2482
2060
|
* @param {number} x
|
|
@@ -2731,11 +2309,11 @@
|
|
|
2731
2309
|
|
|
2732
2310
|
var marker = create$1('marker');
|
|
2733
2311
|
|
|
2734
|
-
attr(options.element, attrs);
|
|
2312
|
+
attr$1(options.element, attrs);
|
|
2735
2313
|
|
|
2736
2314
|
append(marker, options.element);
|
|
2737
2315
|
|
|
2738
|
-
attr(marker, {
|
|
2316
|
+
attr$1(marker, {
|
|
2739
2317
|
id: id,
|
|
2740
2318
|
viewBox: '0 0 20 20',
|
|
2741
2319
|
refX: ref.x,
|
|
@@ -2778,7 +2356,7 @@
|
|
|
2778
2356
|
|
|
2779
2357
|
if (type === 'sequenceflow-end') {
|
|
2780
2358
|
var sequenceflowEnd = create$1('path');
|
|
2781
|
-
attr(sequenceflowEnd, { d: 'M 1 5 L 11 10 L 1 15 Z' });
|
|
2359
|
+
attr$1(sequenceflowEnd, { d: 'M 1 5 L 11 10 L 1 15 Z' });
|
|
2782
2360
|
|
|
2783
2361
|
addMarker(id, {
|
|
2784
2362
|
element: sequenceflowEnd,
|
|
@@ -2793,7 +2371,7 @@
|
|
|
2793
2371
|
|
|
2794
2372
|
if (type === 'messageflow-start') {
|
|
2795
2373
|
var messageflowStart = create$1('circle');
|
|
2796
|
-
attr(messageflowStart, { cx: 6, cy: 6, r: 3.5 });
|
|
2374
|
+
attr$1(messageflowStart, { cx: 6, cy: 6, r: 3.5 });
|
|
2797
2375
|
|
|
2798
2376
|
addMarker(id, {
|
|
2799
2377
|
element: messageflowStart,
|
|
@@ -2807,7 +2385,7 @@
|
|
|
2807
2385
|
|
|
2808
2386
|
if (type === 'messageflow-end') {
|
|
2809
2387
|
var messageflowEnd = create$1('path');
|
|
2810
|
-
attr(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
|
|
2388
|
+
attr$1(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
|
|
2811
2389
|
|
|
2812
2390
|
addMarker(id, {
|
|
2813
2391
|
element: messageflowEnd,
|
|
@@ -2822,7 +2400,7 @@
|
|
|
2822
2400
|
|
|
2823
2401
|
if (type === 'association-start') {
|
|
2824
2402
|
var associationStart = create$1('path');
|
|
2825
|
-
attr(associationStart, { d: 'M 11 5 L 1 10 L 11 15' });
|
|
2403
|
+
attr$1(associationStart, { d: 'M 11 5 L 1 10 L 11 15' });
|
|
2826
2404
|
|
|
2827
2405
|
addMarker(id, {
|
|
2828
2406
|
element: associationStart,
|
|
@@ -2838,7 +2416,7 @@
|
|
|
2838
2416
|
|
|
2839
2417
|
if (type === 'association-end') {
|
|
2840
2418
|
var associationEnd = create$1('path');
|
|
2841
|
-
attr(associationEnd, { d: 'M 1 5 L 11 10 L 1 15' });
|
|
2419
|
+
attr$1(associationEnd, { d: 'M 1 5 L 11 10 L 1 15' });
|
|
2842
2420
|
|
|
2843
2421
|
addMarker(id, {
|
|
2844
2422
|
element: associationEnd,
|
|
@@ -2854,7 +2432,7 @@
|
|
|
2854
2432
|
|
|
2855
2433
|
if (type === 'conditional-flow-marker') {
|
|
2856
2434
|
var conditionalflowMarker = create$1('path');
|
|
2857
|
-
attr(conditionalflowMarker, { d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z' });
|
|
2435
|
+
attr$1(conditionalflowMarker, { d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z' });
|
|
2858
2436
|
|
|
2859
2437
|
addMarker(id, {
|
|
2860
2438
|
element: conditionalflowMarker,
|
|
@@ -2869,7 +2447,7 @@
|
|
|
2869
2447
|
|
|
2870
2448
|
if (type === 'conditional-default-flow-marker') {
|
|
2871
2449
|
var conditionaldefaultflowMarker = create$1('path');
|
|
2872
|
-
attr(conditionaldefaultflowMarker, { d: 'M 6 4 L 10 16' });
|
|
2450
|
+
attr$1(conditionaldefaultflowMarker, { d: 'M 6 4 L 10 16' });
|
|
2873
2451
|
|
|
2874
2452
|
addMarker(id, {
|
|
2875
2453
|
element: conditionaldefaultflowMarker,
|
|
@@ -2905,12 +2483,12 @@
|
|
|
2905
2483
|
cy = height / 2;
|
|
2906
2484
|
|
|
2907
2485
|
var circle = create$1('circle');
|
|
2908
|
-
attr(circle, {
|
|
2486
|
+
attr$1(circle, {
|
|
2909
2487
|
cx: cx,
|
|
2910
2488
|
cy: cy,
|
|
2911
2489
|
r: Math.round((width + height) / 4 - offset)
|
|
2912
2490
|
});
|
|
2913
|
-
attr(circle, attrs);
|
|
2491
|
+
attr$1(circle, attrs);
|
|
2914
2492
|
|
|
2915
2493
|
append(parentGfx, circle);
|
|
2916
2494
|
|
|
@@ -2933,7 +2511,7 @@
|
|
|
2933
2511
|
});
|
|
2934
2512
|
|
|
2935
2513
|
var rect = create$1('rect');
|
|
2936
|
-
attr(rect, {
|
|
2514
|
+
attr$1(rect, {
|
|
2937
2515
|
x: offset,
|
|
2938
2516
|
y: offset,
|
|
2939
2517
|
width: width - offset * 2,
|
|
@@ -2941,7 +2519,7 @@
|
|
|
2941
2519
|
rx: r,
|
|
2942
2520
|
ry: r
|
|
2943
2521
|
});
|
|
2944
|
-
attr(rect, attrs);
|
|
2522
|
+
attr$1(rect, attrs);
|
|
2945
2523
|
|
|
2946
2524
|
append(parentGfx, rect);
|
|
2947
2525
|
|
|
@@ -2966,10 +2544,10 @@
|
|
|
2966
2544
|
});
|
|
2967
2545
|
|
|
2968
2546
|
var polygon = create$1('polygon');
|
|
2969
|
-
attr(polygon, {
|
|
2547
|
+
attr$1(polygon, {
|
|
2970
2548
|
points: pointsString
|
|
2971
2549
|
});
|
|
2972
|
-
attr(polygon, attrs);
|
|
2550
|
+
attr$1(polygon, attrs);
|
|
2973
2551
|
|
|
2974
2552
|
append(parentGfx, polygon);
|
|
2975
2553
|
|
|
@@ -2998,8 +2576,8 @@
|
|
|
2998
2576
|
});
|
|
2999
2577
|
|
|
3000
2578
|
var path = create$1('path');
|
|
3001
|
-
attr(path, { d: d });
|
|
3002
|
-
attr(path, attrs);
|
|
2579
|
+
attr$1(path, { d: d });
|
|
2580
|
+
attr$1(path, attrs);
|
|
3003
2581
|
|
|
3004
2582
|
append(parentGfx, path);
|
|
3005
2583
|
|
|
@@ -3087,7 +2665,7 @@
|
|
|
3087
2665
|
|
|
3088
2666
|
var text = textRenderer.createText(label || '', options);
|
|
3089
2667
|
|
|
3090
|
-
classes(text).add('djs-label');
|
|
2668
|
+
classes$1(text).add('djs-label');
|
|
3091
2669
|
|
|
3092
2670
|
append(parentGfx, text);
|
|
3093
2671
|
|
|
@@ -3699,7 +3277,7 @@
|
|
|
3699
3277
|
});
|
|
3700
3278
|
|
|
3701
3279
|
var businessHeaderPath = drawPath(parentGfx, headerPathData);
|
|
3702
|
-
attr(businessHeaderPath, {
|
|
3280
|
+
attr$1(businessHeaderPath, {
|
|
3703
3281
|
strokeWidth: 1,
|
|
3704
3282
|
fill: getFillColor(element, '#aaaaaa'),
|
|
3705
3283
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
@@ -3713,7 +3291,7 @@
|
|
|
3713
3291
|
});
|
|
3714
3292
|
|
|
3715
3293
|
var businessPath = drawPath(parentGfx, headerData);
|
|
3716
|
-
attr(businessPath, {
|
|
3294
|
+
attr$1(businessPath, {
|
|
3717
3295
|
strokeWidth: 1,
|
|
3718
3296
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3719
3297
|
});
|
|
@@ -3731,7 +3309,7 @@
|
|
|
3731
3309
|
var expanded = isExpanded(element);
|
|
3732
3310
|
|
|
3733
3311
|
if (isEventSubProcess(element)) {
|
|
3734
|
-
attr(rect, {
|
|
3312
|
+
attr$1(rect, {
|
|
3735
3313
|
strokeDasharray: '1,2'
|
|
3736
3314
|
});
|
|
3737
3315
|
}
|
|
@@ -3953,7 +3531,7 @@
|
|
|
3953
3531
|
});
|
|
3954
3532
|
|
|
3955
3533
|
var parallelPath = drawPath(parentGfx, pathData);
|
|
3956
|
-
attr(parallelPath, {
|
|
3534
|
+
attr$1(parallelPath, {
|
|
3957
3535
|
strokeWidth: 1,
|
|
3958
3536
|
fill: 'none'
|
|
3959
3537
|
});
|
|
@@ -3961,7 +3539,7 @@
|
|
|
3961
3539
|
|
|
3962
3540
|
if (!instantiate) {
|
|
3963
3541
|
var innerCircle = drawCircle(parentGfx, element.width, element.height, element.height * 0.26);
|
|
3964
|
-
attr(innerCircle, {
|
|
3542
|
+
attr$1(innerCircle, {
|
|
3965
3543
|
strokeWidth: 1,
|
|
3966
3544
|
fill: 'none',
|
|
3967
3545
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
@@ -4006,7 +3584,7 @@
|
|
|
4006
3584
|
|
|
4007
3585
|
// conditional flow marker
|
|
4008
3586
|
if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Activity')) {
|
|
4009
|
-
attr(path, {
|
|
3587
|
+
attr$1(path, {
|
|
4010
3588
|
markerStart: marker('conditional-flow-marker', fill, stroke)
|
|
4011
3589
|
});
|
|
4012
3590
|
}
|
|
@@ -4014,7 +3592,7 @@
|
|
|
4014
3592
|
// default marker
|
|
4015
3593
|
if (source.default && (source.$instanceOf('bpmn:Gateway') || source.$instanceOf('bpmn:Activity')) &&
|
|
4016
3594
|
source.default === sequenceFlow) {
|
|
4017
|
-
attr(path, {
|
|
3595
|
+
attr$1(path, {
|
|
4018
3596
|
markerStart: marker('conditional-default-flow-marker', fill, stroke)
|
|
4019
3597
|
});
|
|
4020
3598
|
}
|
|
@@ -4732,9 +4310,9 @@
|
|
|
4732
4310
|
var helperSvg = document.getElementById('helper-svg');
|
|
4733
4311
|
|
|
4734
4312
|
if (!helperSvg) {
|
|
4735
|
-
helperSvg = create$
|
|
4313
|
+
helperSvg = create$1('svg');
|
|
4736
4314
|
|
|
4737
|
-
attr$
|
|
4315
|
+
attr$1(helperSvg, {
|
|
4738
4316
|
id: 'helper-svg'
|
|
4739
4317
|
});
|
|
4740
4318
|
|
|
@@ -4828,13 +4406,13 @@
|
|
|
4828
4406
|
var maxWidth = box.width - padding.left - padding.right;
|
|
4829
4407
|
|
|
4830
4408
|
// ensure correct rendering by attaching helper text node to invisible SVG
|
|
4831
|
-
var helperText = create$
|
|
4832
|
-
attr$
|
|
4833
|
-
attr$
|
|
4409
|
+
var helperText = create$1('text');
|
|
4410
|
+
attr$1(helperText, { x: 0, y: 0 });
|
|
4411
|
+
attr$1(helperText, style);
|
|
4834
4412
|
|
|
4835
4413
|
var helperSvg = getHelperSvg();
|
|
4836
4414
|
|
|
4837
|
-
append
|
|
4415
|
+
append(helperSvg, helperText);
|
|
4838
4416
|
|
|
4839
4417
|
while (lines.length) {
|
|
4840
4418
|
layouted.push(layoutNext(lines, maxWidth, helperText));
|
|
@@ -4863,9 +4441,9 @@
|
|
|
4863
4441
|
y -= (lineHeight || layouted[0].height) / 4;
|
|
4864
4442
|
|
|
4865
4443
|
|
|
4866
|
-
var textElement = create$
|
|
4444
|
+
var textElement = create$1('text');
|
|
4867
4445
|
|
|
4868
|
-
attr$
|
|
4446
|
+
attr$1(textElement, style);
|
|
4869
4447
|
|
|
4870
4448
|
// layout each line taking into account that parent
|
|
4871
4449
|
// shape might resize to fit text size
|
|
@@ -4892,15 +4470,15 @@
|
|
|
4892
4470
|
- line.width) / 2 + padding.left), 0);
|
|
4893
4471
|
}
|
|
4894
4472
|
|
|
4895
|
-
var tspan = create$
|
|
4896
|
-
attr$
|
|
4473
|
+
var tspan = create$1('tspan');
|
|
4474
|
+
attr$1(tspan, { x: x, y: y });
|
|
4897
4475
|
|
|
4898
4476
|
tspan.textContent = line.text;
|
|
4899
4477
|
|
|
4900
|
-
append
|
|
4478
|
+
append(textElement, tspan);
|
|
4901
4479
|
});
|
|
4902
4480
|
|
|
4903
|
-
remove$
|
|
4481
|
+
remove$2(helperText);
|
|
4904
4482
|
|
|
4905
4483
|
var dimensions = {
|
|
4906
4484
|
width: maxLineWidth,
|
|
@@ -6494,13 +6072,13 @@
|
|
|
6494
6072
|
throw new Error('invalid hit type <' + type + '>');
|
|
6495
6073
|
}
|
|
6496
6074
|
|
|
6497
|
-
attr$
|
|
6075
|
+
attr$1(hit, attrs);
|
|
6498
6076
|
|
|
6499
6077
|
return hit;
|
|
6500
6078
|
}
|
|
6501
6079
|
|
|
6502
6080
|
function appendHit(gfx, hit) {
|
|
6503
|
-
append
|
|
6081
|
+
append(gfx, hit);
|
|
6504
6082
|
}
|
|
6505
6083
|
|
|
6506
6084
|
|
|
@@ -6514,7 +6092,7 @@
|
|
|
6514
6092
|
this.removeHits = function(gfx) {
|
|
6515
6093
|
var hits = all('.djs-hit', gfx);
|
|
6516
6094
|
|
|
6517
|
-
forEach$1(hits, remove$
|
|
6095
|
+
forEach$1(hits, remove$2);
|
|
6518
6096
|
};
|
|
6519
6097
|
|
|
6520
6098
|
/**
|
|
@@ -6578,11 +6156,11 @@
|
|
|
6578
6156
|
y: 0
|
|
6579
6157
|
}, attrs);
|
|
6580
6158
|
|
|
6581
|
-
var hit = create$
|
|
6159
|
+
var hit = create$1('rect');
|
|
6582
6160
|
|
|
6583
6161
|
applyStyle(hit, type);
|
|
6584
6162
|
|
|
6585
|
-
attr$
|
|
6163
|
+
attr$1(hit, attrs);
|
|
6586
6164
|
|
|
6587
6165
|
appendHit(gfx, hit);
|
|
6588
6166
|
|
|
@@ -6608,7 +6186,7 @@
|
|
|
6608
6186
|
if (element.waypoints) {
|
|
6609
6187
|
updateLine(hit, element.waypoints);
|
|
6610
6188
|
} else {
|
|
6611
|
-
attr$
|
|
6189
|
+
attr$1(hit, {
|
|
6612
6190
|
width: element.width,
|
|
6613
6191
|
height: element.height
|
|
6614
6192
|
});
|
|
@@ -6816,9 +6394,9 @@
|
|
|
6816
6394
|
var self = this;
|
|
6817
6395
|
|
|
6818
6396
|
function createOutline(gfx, bounds) {
|
|
6819
|
-
var outline = create$
|
|
6397
|
+
var outline = create$1('rect');
|
|
6820
6398
|
|
|
6821
|
-
attr$
|
|
6399
|
+
attr$1(outline, assign$1({
|
|
6822
6400
|
x: 10,
|
|
6823
6401
|
y: 10,
|
|
6824
6402
|
rx: 3,
|
|
@@ -6826,7 +6404,7 @@
|
|
|
6826
6404
|
height: 100
|
|
6827
6405
|
}, OUTLINE_STYLE));
|
|
6828
6406
|
|
|
6829
|
-
append
|
|
6407
|
+
append(gfx, outline);
|
|
6830
6408
|
|
|
6831
6409
|
return outline;
|
|
6832
6410
|
}
|
|
@@ -6870,7 +6448,7 @@
|
|
|
6870
6448
|
*/
|
|
6871
6449
|
Outline.prototype.updateShapeOutline = function(outline, element) {
|
|
6872
6450
|
|
|
6873
|
-
attr$
|
|
6451
|
+
attr$1(outline, {
|
|
6874
6452
|
x: -this.offset,
|
|
6875
6453
|
y: -this.offset,
|
|
6876
6454
|
width: element.width + this.offset * 2,
|
|
@@ -6891,7 +6469,7 @@
|
|
|
6891
6469
|
|
|
6892
6470
|
var bbox = getBBox(connection);
|
|
6893
6471
|
|
|
6894
|
-
attr$
|
|
6472
|
+
attr$1(outline, {
|
|
6895
6473
|
x: bbox.x - this.offset,
|
|
6896
6474
|
y: bbox.y - this.offset,
|
|
6897
6475
|
width: bbox.width + this.offset * 2,
|
|
@@ -7095,13 +6673,13 @@
|
|
|
7095
6673
|
SelectionVisuals.prototype._updateSelectionOutline = function(selection) {
|
|
7096
6674
|
var layer = this._canvas.getLayer('selectionOutline');
|
|
7097
6675
|
|
|
7098
|
-
clear$
|
|
6676
|
+
clear$1(layer);
|
|
7099
6677
|
|
|
7100
6678
|
var enabled = selection.length > 1;
|
|
7101
6679
|
|
|
7102
6680
|
var container = this._canvas.getContainer();
|
|
7103
6681
|
|
|
7104
|
-
classes$
|
|
6682
|
+
classes$1(container)[enabled ? 'add' : 'remove']('djs-multi-select');
|
|
7105
6683
|
|
|
7106
6684
|
if (!enabled) {
|
|
7107
6685
|
return;
|
|
@@ -7109,15 +6687,15 @@
|
|
|
7109
6687
|
|
|
7110
6688
|
var bBox = addSelectionOutlinePadding(getBBox(selection));
|
|
7111
6689
|
|
|
7112
|
-
var rect = create$
|
|
6690
|
+
var rect = create$1('rect');
|
|
7113
6691
|
|
|
7114
|
-
attr$
|
|
6692
|
+
attr$1(rect, assign$1({
|
|
7115
6693
|
rx: 3
|
|
7116
6694
|
}, bBox));
|
|
7117
6695
|
|
|
7118
|
-
classes$
|
|
6696
|
+
classes$1(rect).add('djs-selection-outline');
|
|
7119
6697
|
|
|
7120
|
-
append
|
|
6698
|
+
append(layer, rect);
|
|
7121
6699
|
};
|
|
7122
6700
|
|
|
7123
6701
|
// helpers //////////
|
|
@@ -7526,8 +7104,8 @@
|
|
|
7526
7104
|
var container = self._getOverlayContainer(overlay.element, true);
|
|
7527
7105
|
|
|
7528
7106
|
if (overlay) {
|
|
7529
|
-
remove$
|
|
7530
|
-
remove$
|
|
7107
|
+
remove$1(overlay.html);
|
|
7108
|
+
remove$1(overlay.htmlContainer);
|
|
7531
7109
|
|
|
7532
7110
|
delete overlay.htmlContainer;
|
|
7533
7111
|
delete overlay.element;
|
|
@@ -7560,7 +7138,7 @@
|
|
|
7560
7138
|
|
|
7561
7139
|
this._overlayContainers = [];
|
|
7562
7140
|
|
|
7563
|
-
clear
|
|
7141
|
+
clear(this._overlayRoot);
|
|
7564
7142
|
};
|
|
7565
7143
|
|
|
7566
7144
|
Overlays.prototype._updateOverlayContainer = function(container) {
|
|
@@ -7581,7 +7159,7 @@
|
|
|
7581
7159
|
|
|
7582
7160
|
setPosition(html, x, y);
|
|
7583
7161
|
|
|
7584
|
-
attr
|
|
7162
|
+
attr(container.html, 'data-container-id', element.id);
|
|
7585
7163
|
};
|
|
7586
7164
|
|
|
7587
7165
|
|
|
@@ -7708,7 +7286,7 @@
|
|
|
7708
7286
|
htmlContainer.appendChild(html);
|
|
7709
7287
|
|
|
7710
7288
|
if (overlay.type) {
|
|
7711
|
-
classes
|
|
7289
|
+
classes(htmlContainer).add('djs-overlay-' + overlay.type);
|
|
7712
7290
|
}
|
|
7713
7291
|
|
|
7714
7292
|
var elementRoot = this._canvas.findRoot(element);
|
|
@@ -7837,7 +7415,7 @@
|
|
|
7837
7415
|
var container = self._getOverlayContainer(element);
|
|
7838
7416
|
|
|
7839
7417
|
if (container) {
|
|
7840
|
-
remove$
|
|
7418
|
+
remove$1(container.html);
|
|
7841
7419
|
var i = self._overlayContainers.indexOf(container);
|
|
7842
7420
|
if (i !== -1) {
|
|
7843
7421
|
self._overlayContainers.splice(i, 1);
|
|
@@ -7868,7 +7446,7 @@
|
|
|
7868
7446
|
eventBus.on('element.marker.update', function(e) {
|
|
7869
7447
|
var container = self._getOverlayContainer(e.element, true);
|
|
7870
7448
|
if (container) {
|
|
7871
|
-
classes
|
|
7449
|
+
classes(container.html)[e.add ? 'add' : 'remove'](e.marker);
|
|
7872
7450
|
}
|
|
7873
7451
|
});
|
|
7874
7452
|
|
|
@@ -8333,7 +7911,7 @@
|
|
|
8333
7911
|
function DrilldownBreadcrumbs(eventBus, elementRegistry, overlays, canvas) {
|
|
8334
7912
|
var breadcrumbs = domify$1('<ul class="bjs-breadcrumbs"></ul>');
|
|
8335
7913
|
var container = canvas.getContainer();
|
|
8336
|
-
var containerClasses = classes
|
|
7914
|
+
var containerClasses = classes(container);
|
|
8337
7915
|
container.appendChild(breadcrumbs);
|
|
8338
7916
|
|
|
8339
7917
|
var boParents = [];
|
|
@@ -8889,7 +8467,7 @@
|
|
|
8889
8467
|
}
|
|
8890
8468
|
|
|
8891
8469
|
var hasContent = bo && bo.flowElements && bo.flowElements.length;
|
|
8892
|
-
classes
|
|
8470
|
+
classes(overlay.html).toggle(EMPTY_MARKER, !hasContent);
|
|
8893
8471
|
};
|
|
8894
8472
|
|
|
8895
8473
|
/**
|
|
@@ -9441,9 +9019,9 @@
|
|
|
9441
9019
|
};
|
|
9442
9020
|
|
|
9443
9021
|
DefaultRenderer.prototype.drawShape = function drawShape(visuals, element, attrs) {
|
|
9444
|
-
var rect = create$
|
|
9022
|
+
var rect = create$1('rect');
|
|
9445
9023
|
|
|
9446
|
-
attr$
|
|
9024
|
+
attr$1(rect, {
|
|
9447
9025
|
x: 0,
|
|
9448
9026
|
y: 0,
|
|
9449
9027
|
width: element.width || 0,
|
|
@@ -9451,12 +9029,12 @@
|
|
|
9451
9029
|
});
|
|
9452
9030
|
|
|
9453
9031
|
if (isFrameElement(element)) {
|
|
9454
|
-
attr$
|
|
9032
|
+
attr$1(rect, assign$1({}, this.FRAME_STYLE, attrs || {}));
|
|
9455
9033
|
} else {
|
|
9456
|
-
attr$
|
|
9034
|
+
attr$1(rect, assign$1({}, this.SHAPE_STYLE, attrs || {}));
|
|
9457
9035
|
}
|
|
9458
9036
|
|
|
9459
|
-
append
|
|
9037
|
+
append(visuals, rect);
|
|
9460
9038
|
|
|
9461
9039
|
return rect;
|
|
9462
9040
|
};
|
|
@@ -9464,7 +9042,7 @@
|
|
|
9464
9042
|
DefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) {
|
|
9465
9043
|
|
|
9466
9044
|
var line = createLine(connection.waypoints, assign$1({}, this.CONNECTION_STYLE, attrs || {}));
|
|
9467
|
-
append
|
|
9045
|
+
append(visuals, line);
|
|
9468
9046
|
|
|
9469
9047
|
return line;
|
|
9470
9048
|
};
|
|
@@ -9702,8 +9280,8 @@
|
|
|
9702
9280
|
}
|
|
9703
9281
|
|
|
9704
9282
|
function createGroup(parent, cls, childIndex) {
|
|
9705
|
-
const group = create$
|
|
9706
|
-
classes$
|
|
9283
|
+
const group = create$1('g');
|
|
9284
|
+
classes$1(group).add(cls);
|
|
9707
9285
|
|
|
9708
9286
|
const index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;
|
|
9709
9287
|
|
|
@@ -9781,10 +9359,10 @@
|
|
|
9781
9359
|
// html container
|
|
9782
9360
|
const container = this._container = createContainer(config);
|
|
9783
9361
|
|
|
9784
|
-
const svg = this._svg = create$
|
|
9785
|
-
attr$
|
|
9362
|
+
const svg = this._svg = create$1('svg');
|
|
9363
|
+
attr$1(svg, { width: '100%', height: '100%' });
|
|
9786
9364
|
|
|
9787
|
-
append
|
|
9365
|
+
append(container, svg);
|
|
9788
9366
|
|
|
9789
9367
|
const viewport = this._viewport = createGroup(svg, 'viewport');
|
|
9790
9368
|
|
|
@@ -10022,7 +9600,7 @@
|
|
|
10022
9600
|
return group;
|
|
10023
9601
|
}
|
|
10024
9602
|
|
|
10025
|
-
remove$
|
|
9603
|
+
remove$2(group);
|
|
10026
9604
|
|
|
10027
9605
|
layer.visible = false;
|
|
10028
9606
|
|
|
@@ -10037,7 +9615,7 @@
|
|
|
10037
9615
|
if (layer) {
|
|
10038
9616
|
delete this._layers[name];
|
|
10039
9617
|
|
|
10040
|
-
remove$
|
|
9618
|
+
remove$2(layer.group);
|
|
10041
9619
|
}
|
|
10042
9620
|
};
|
|
10043
9621
|
|
|
@@ -10130,9 +9708,9 @@
|
|
|
10130
9708
|
|
|
10131
9709
|
// invoke either addClass or removeClass based on mode
|
|
10132
9710
|
if (add) {
|
|
10133
|
-
classes$
|
|
9711
|
+
classes$1(gfx).add(marker);
|
|
10134
9712
|
} else {
|
|
10135
|
-
classes$
|
|
9713
|
+
classes$1(gfx).remove(marker);
|
|
10136
9714
|
}
|
|
10137
9715
|
}
|
|
10138
9716
|
});
|
|
@@ -10198,7 +9776,7 @@
|
|
|
10198
9776
|
|
|
10199
9777
|
const gfx = this.getGraphics(element);
|
|
10200
9778
|
|
|
10201
|
-
return classes$
|
|
9779
|
+
return classes$1(gfx).has(marker);
|
|
10202
9780
|
};
|
|
10203
9781
|
|
|
10204
9782
|
/**
|
|
@@ -11096,10 +10674,10 @@
|
|
|
11096
10674
|
this._validateId(id);
|
|
11097
10675
|
|
|
11098
10676
|
// associate dom node with element
|
|
11099
|
-
attr$
|
|
10677
|
+
attr$1(gfx, ELEMENT_ID, id);
|
|
11100
10678
|
|
|
11101
10679
|
if (secondaryGfx) {
|
|
11102
|
-
attr$
|
|
10680
|
+
attr$1(secondaryGfx, ELEMENT_ID, id);
|
|
11103
10681
|
}
|
|
11104
10682
|
|
|
11105
10683
|
this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };
|
|
@@ -11118,10 +10696,10 @@
|
|
|
11118
10696
|
if (container) {
|
|
11119
10697
|
|
|
11120
10698
|
// unset element id on gfx
|
|
11121
|
-
attr$
|
|
10699
|
+
attr$1(container.gfx, ELEMENT_ID, '');
|
|
11122
10700
|
|
|
11123
10701
|
if (container.secondaryGfx) {
|
|
11124
|
-
attr$
|
|
10702
|
+
attr$1(container.secondaryGfx, ELEMENT_ID, '');
|
|
11125
10703
|
}
|
|
11126
10704
|
|
|
11127
10705
|
delete elements[id];
|
|
@@ -11176,7 +10754,7 @@
|
|
|
11176
10754
|
}
|
|
11177
10755
|
|
|
11178
10756
|
if (gfx) {
|
|
11179
|
-
attr$
|
|
10757
|
+
attr$1(gfx, ELEMENT_ID, id);
|
|
11180
10758
|
}
|
|
11181
10759
|
|
|
11182
10760
|
return gfx;
|
|
@@ -11201,7 +10779,7 @@
|
|
|
11201
10779
|
if (typeof filter === 'string') {
|
|
11202
10780
|
id = filter;
|
|
11203
10781
|
} else {
|
|
11204
|
-
id = filter && attr$
|
|
10782
|
+
id = filter && attr$1(filter, ELEMENT_ID);
|
|
11205
10783
|
}
|
|
11206
10784
|
|
|
11207
10785
|
var container = this._elements[id];
|
|
@@ -12484,10 +12062,10 @@
|
|
|
12484
12062
|
} else {
|
|
12485
12063
|
childrenGfx = getChildren(gfx);
|
|
12486
12064
|
if (!childrenGfx) {
|
|
12487
|
-
childrenGfx = create$
|
|
12488
|
-
classes$
|
|
12065
|
+
childrenGfx = create$1('g');
|
|
12066
|
+
classes$1(childrenGfx).add('djs-children');
|
|
12489
12067
|
|
|
12490
|
-
append
|
|
12068
|
+
append(gfx.parentNode, childrenGfx);
|
|
12491
12069
|
}
|
|
12492
12070
|
}
|
|
12493
12071
|
|
|
@@ -12501,7 +12079,7 @@
|
|
|
12501
12079
|
GraphicsFactory.prototype._clear = function(gfx) {
|
|
12502
12080
|
var visual = getVisual(gfx);
|
|
12503
12081
|
|
|
12504
|
-
clear
|
|
12082
|
+
clear(visual);
|
|
12505
12083
|
|
|
12506
12084
|
return visual;
|
|
12507
12085
|
};
|
|
@@ -12536,31 +12114,31 @@
|
|
|
12536
12114
|
GraphicsFactory.prototype._createContainer = function(
|
|
12537
12115
|
type, childrenGfx, parentIndex, isFrame
|
|
12538
12116
|
) {
|
|
12539
|
-
var outerGfx = create$
|
|
12540
|
-
classes$
|
|
12117
|
+
var outerGfx = create$1('g');
|
|
12118
|
+
classes$1(outerGfx).add('djs-group');
|
|
12541
12119
|
|
|
12542
12120
|
// insert node at position
|
|
12543
12121
|
if (typeof parentIndex !== 'undefined') {
|
|
12544
12122
|
prependTo(outerGfx, childrenGfx, childrenGfx.childNodes[parentIndex]);
|
|
12545
12123
|
} else {
|
|
12546
|
-
append
|
|
12124
|
+
append(childrenGfx, outerGfx);
|
|
12547
12125
|
}
|
|
12548
12126
|
|
|
12549
|
-
var gfx = create$
|
|
12550
|
-
classes$
|
|
12551
|
-
classes$
|
|
12127
|
+
var gfx = create$1('g');
|
|
12128
|
+
classes$1(gfx).add('djs-element');
|
|
12129
|
+
classes$1(gfx).add('djs-' + type);
|
|
12552
12130
|
|
|
12553
12131
|
if (isFrame) {
|
|
12554
|
-
classes$
|
|
12132
|
+
classes$1(gfx).add('djs-frame');
|
|
12555
12133
|
}
|
|
12556
12134
|
|
|
12557
|
-
append
|
|
12135
|
+
append(outerGfx, gfx);
|
|
12558
12136
|
|
|
12559
12137
|
// create visual
|
|
12560
|
-
var visual = create$
|
|
12561
|
-
classes$
|
|
12138
|
+
var visual = create$1('g');
|
|
12139
|
+
classes$1(visual).add('djs-visual');
|
|
12562
12140
|
|
|
12563
|
-
append
|
|
12141
|
+
append(gfx, visual);
|
|
12564
12142
|
|
|
12565
12143
|
return gfx;
|
|
12566
12144
|
};
|
|
@@ -12652,9 +12230,9 @@
|
|
|
12652
12230
|
}
|
|
12653
12231
|
|
|
12654
12232
|
if (element.hidden) {
|
|
12655
|
-
attr$
|
|
12233
|
+
attr$1(gfx, 'display', 'none');
|
|
12656
12234
|
} else {
|
|
12657
|
-
attr$
|
|
12235
|
+
attr$1(gfx, 'display', 'block');
|
|
12658
12236
|
}
|
|
12659
12237
|
};
|
|
12660
12238
|
|
|
@@ -12662,7 +12240,7 @@
|
|
|
12662
12240
|
var gfx = this._elementRegistry.getGraphics(element);
|
|
12663
12241
|
|
|
12664
12242
|
// remove
|
|
12665
|
-
remove$
|
|
12243
|
+
remove$2(gfx.parentNode);
|
|
12666
12244
|
};
|
|
12667
12245
|
|
|
12668
12246
|
|
|
@@ -21679,7 +21257,7 @@
|
|
|
21679
21257
|
Diagram.prototype.destroy.call(this);
|
|
21680
21258
|
|
|
21681
21259
|
// dom detach
|
|
21682
|
-
remove$
|
|
21260
|
+
remove$1(this._container);
|
|
21683
21261
|
};
|
|
21684
21262
|
|
|
21685
21263
|
/**
|
|
@@ -22528,12 +22106,12 @@
|
|
|
22528
22106
|
|
|
22529
22107
|
|
|
22530
22108
|
function set(mode) {
|
|
22531
|
-
var classes = classes
|
|
22109
|
+
var classes$1 = classes(document.body);
|
|
22532
22110
|
|
|
22533
|
-
classes.removeMatching(CURSOR_CLS_PATTERN);
|
|
22111
|
+
classes$1.removeMatching(CURSOR_CLS_PATTERN);
|
|
22534
22112
|
|
|
22535
22113
|
if (mode) {
|
|
22536
|
-
classes.add('djs-cursor-' + mode);
|
|
22114
|
+
classes$1.add('djs-cursor-' + mode);
|
|
22537
22115
|
}
|
|
22538
22116
|
}
|
|
22539
22117
|
|