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
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
return result;
|
|
470
470
|
}
|
|
471
471
|
|
|
472
|
-
var DEFAULT_RENDER_PRIORITY$
|
|
472
|
+
var DEFAULT_RENDER_PRIORITY$2 = 1000;
|
|
473
473
|
|
|
474
474
|
/**
|
|
475
475
|
* The base implementation of shape and connection renderers.
|
|
@@ -477,10 +477,10 @@
|
|
|
477
477
|
* @param {EventBus} eventBus
|
|
478
478
|
* @param {number} [renderPriority=1000]
|
|
479
479
|
*/
|
|
480
|
-
function BaseRenderer(eventBus, renderPriority) {
|
|
480
|
+
function BaseRenderer$1(eventBus, renderPriority) {
|
|
481
481
|
var self = this;
|
|
482
482
|
|
|
483
|
-
renderPriority = renderPriority || DEFAULT_RENDER_PRIORITY$
|
|
483
|
+
renderPriority = renderPriority || DEFAULT_RENDER_PRIORITY$2;
|
|
484
484
|
|
|
485
485
|
eventBus.on([ 'render.shape', 'render.connection' ], renderPriority, function(evt, context) {
|
|
486
486
|
var type = evt.type,
|
|
@@ -516,7 +516,7 @@
|
|
|
516
516
|
*
|
|
517
517
|
* @returns {boolean}
|
|
518
518
|
*/
|
|
519
|
-
BaseRenderer.prototype.canRender = function() {};
|
|
519
|
+
BaseRenderer$1.prototype.canRender = function() {};
|
|
520
520
|
|
|
521
521
|
/**
|
|
522
522
|
* Provides the shape's snap svg element to be drawn on the `canvas`.
|
|
@@ -526,7 +526,7 @@
|
|
|
526
526
|
*
|
|
527
527
|
* @returns {Snap.svg} [returns a Snap.svg paper element ]
|
|
528
528
|
*/
|
|
529
|
-
BaseRenderer.prototype.drawShape = function() {};
|
|
529
|
+
BaseRenderer$1.prototype.drawShape = function() {};
|
|
530
530
|
|
|
531
531
|
/**
|
|
532
532
|
* Provides the shape's snap svg element to be drawn on the `canvas`.
|
|
@@ -536,7 +536,7 @@
|
|
|
536
536
|
*
|
|
537
537
|
* @returns {Snap.svg} [returns a Snap.svg paper element ]
|
|
538
538
|
*/
|
|
539
|
-
BaseRenderer.prototype.drawConnection = function() {};
|
|
539
|
+
BaseRenderer$1.prototype.drawConnection = function() {};
|
|
540
540
|
|
|
541
541
|
/**
|
|
542
542
|
* Gets the SVG path of a shape that represents it's visual bounds.
|
|
@@ -545,7 +545,7 @@
|
|
|
545
545
|
*
|
|
546
546
|
* @return {string} svg path
|
|
547
547
|
*/
|
|
548
|
-
BaseRenderer.prototype.getShapePath = function() {};
|
|
548
|
+
BaseRenderer$1.prototype.getShapePath = function() {};
|
|
549
549
|
|
|
550
550
|
/**
|
|
551
551
|
* Gets the SVG path of a connection that represents it's visual bounds.
|
|
@@ -554,7 +554,7 @@
|
|
|
554
554
|
*
|
|
555
555
|
* @return {string} svg path
|
|
556
556
|
*/
|
|
557
|
-
BaseRenderer.prototype.getConnectionPath = function() {};
|
|
557
|
+
BaseRenderer$1.prototype.getConnectionPath = function() {};
|
|
558
558
|
|
|
559
559
|
/**
|
|
560
560
|
* Is an element of the given BPMN type?
|
|
@@ -682,7 +682,7 @@
|
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
684
|
|
|
685
|
-
function ensureImported$
|
|
685
|
+
function ensureImported$1(element, target) {
|
|
686
686
|
|
|
687
687
|
if (element.ownerDocument !== target.ownerDocument) {
|
|
688
688
|
try {
|
|
@@ -710,8 +710,8 @@
|
|
|
710
710
|
*
|
|
711
711
|
* @return {SVGElement} the appended node
|
|
712
712
|
*/
|
|
713
|
-
function appendTo$
|
|
714
|
-
return target.appendChild(ensureImported$
|
|
713
|
+
function appendTo$1(element, target) {
|
|
714
|
+
return target.appendChild(ensureImported$1(element, target));
|
|
715
715
|
}
|
|
716
716
|
|
|
717
717
|
/**
|
|
@@ -726,8 +726,8 @@
|
|
|
726
726
|
*
|
|
727
727
|
* @return {SVGElement} the element
|
|
728
728
|
*/
|
|
729
|
-
function append$
|
|
730
|
-
appendTo$
|
|
729
|
+
function append$1(target, node) {
|
|
730
|
+
appendTo$1(node, target);
|
|
731
731
|
return target;
|
|
732
732
|
}
|
|
733
733
|
|
|
@@ -735,9 +735,9 @@
|
|
|
735
735
|
* attribute accessor utility
|
|
736
736
|
*/
|
|
737
737
|
|
|
738
|
-
var LENGTH_ATTR$
|
|
738
|
+
var LENGTH_ATTR$1 = 2;
|
|
739
739
|
|
|
740
|
-
var CSS_PROPERTIES$
|
|
740
|
+
var CSS_PROPERTIES$1 = {
|
|
741
741
|
'alignment-baseline': 1,
|
|
742
742
|
'baseline-shift': 1,
|
|
743
743
|
'clip': 1,
|
|
@@ -761,7 +761,7 @@
|
|
|
761
761
|
'flood-opacity': 1,
|
|
762
762
|
'font': 1,
|
|
763
763
|
'font-family': 1,
|
|
764
|
-
'font-size': LENGTH_ATTR$
|
|
764
|
+
'font-size': LENGTH_ATTR$1,
|
|
765
765
|
'font-size-adjust': 1,
|
|
766
766
|
'font-stretch': 1,
|
|
767
767
|
'font-style': 1,
|
|
@@ -791,7 +791,7 @@
|
|
|
791
791
|
'stroke-linejoin': 1,
|
|
792
792
|
'stroke-miterlimit': 1,
|
|
793
793
|
'stroke-opacity': 1,
|
|
794
|
-
'stroke-width': LENGTH_ATTR$
|
|
794
|
+
'stroke-width': LENGTH_ATTR$1,
|
|
795
795
|
'text-anchor': 1,
|
|
796
796
|
'text-decoration': 1,
|
|
797
797
|
'text-rendering': 1,
|
|
@@ -802,23 +802,23 @@
|
|
|
802
802
|
};
|
|
803
803
|
|
|
804
804
|
|
|
805
|
-
function getAttribute$
|
|
806
|
-
if (CSS_PROPERTIES$
|
|
805
|
+
function getAttribute$1(node, name) {
|
|
806
|
+
if (CSS_PROPERTIES$1[name]) {
|
|
807
807
|
return node.style[name];
|
|
808
808
|
} else {
|
|
809
809
|
return node.getAttributeNS(null, name);
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
812
|
|
|
813
|
-
function setAttribute$
|
|
813
|
+
function setAttribute$1(node, name, value) {
|
|
814
814
|
var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
815
815
|
|
|
816
|
-
var type = CSS_PROPERTIES$
|
|
816
|
+
var type = CSS_PROPERTIES$1[hyphenated];
|
|
817
817
|
|
|
818
818
|
if (type) {
|
|
819
819
|
|
|
820
820
|
// append pixel unit, unless present
|
|
821
|
-
if (type === LENGTH_ATTR$
|
|
821
|
+
if (type === LENGTH_ATTR$1 && typeof value === 'number') {
|
|
822
822
|
value = String(value) + 'px';
|
|
823
823
|
}
|
|
824
824
|
|
|
@@ -828,12 +828,12 @@
|
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
830
|
|
|
831
|
-
function setAttributes$
|
|
831
|
+
function setAttributes$1(node, attrs) {
|
|
832
832
|
|
|
833
833
|
var names = Object.keys(attrs), i, name;
|
|
834
834
|
|
|
835
835
|
for (i = 0, name; (name = names[i]); i++) {
|
|
836
|
-
setAttribute$
|
|
836
|
+
setAttribute$1(node, name, attrs[name]);
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
839
|
|
|
@@ -847,15 +847,15 @@
|
|
|
847
847
|
*
|
|
848
848
|
* @return {String}
|
|
849
849
|
*/
|
|
850
|
-
function attr$
|
|
850
|
+
function attr$2(node, name, value) {
|
|
851
851
|
if (typeof name === 'string') {
|
|
852
852
|
if (value !== undefined) {
|
|
853
|
-
setAttribute$
|
|
853
|
+
setAttribute$1(node, name, value);
|
|
854
854
|
} else {
|
|
855
|
-
return getAttribute$
|
|
855
|
+
return getAttribute$1(node, name);
|
|
856
856
|
}
|
|
857
857
|
} else {
|
|
858
|
-
setAttributes$
|
|
858
|
+
setAttributes$1(node, name);
|
|
859
859
|
}
|
|
860
860
|
|
|
861
861
|
return node;
|
|
@@ -871,7 +871,7 @@
|
|
|
871
871
|
* toString reference.
|
|
872
872
|
*/
|
|
873
873
|
|
|
874
|
-
const toString$
|
|
874
|
+
const toString$1 = Object.prototype.toString;
|
|
875
875
|
|
|
876
876
|
/**
|
|
877
877
|
* Wrap `el` in a `ClassList`.
|
|
@@ -881,11 +881,11 @@
|
|
|
881
881
|
* @api public
|
|
882
882
|
*/
|
|
883
883
|
|
|
884
|
-
function classes$
|
|
885
|
-
return new ClassList$
|
|
884
|
+
function classes$1(el) {
|
|
885
|
+
return new ClassList$1(el);
|
|
886
886
|
}
|
|
887
887
|
|
|
888
|
-
function ClassList$
|
|
888
|
+
function ClassList$1(el) {
|
|
889
889
|
if (!el || !el.nodeType) {
|
|
890
890
|
throw new Error('A DOM element reference is required');
|
|
891
891
|
}
|
|
@@ -901,7 +901,7 @@
|
|
|
901
901
|
* @api public
|
|
902
902
|
*/
|
|
903
903
|
|
|
904
|
-
ClassList$
|
|
904
|
+
ClassList$1.prototype.add = function(name) {
|
|
905
905
|
this.list.add(name);
|
|
906
906
|
return this;
|
|
907
907
|
};
|
|
@@ -916,8 +916,8 @@
|
|
|
916
916
|
* @api public
|
|
917
917
|
*/
|
|
918
918
|
|
|
919
|
-
ClassList$
|
|
920
|
-
if ('[object RegExp]' == toString$
|
|
919
|
+
ClassList$1.prototype.remove = function(name) {
|
|
920
|
+
if ('[object RegExp]' == toString$1.call(name)) {
|
|
921
921
|
return this.removeMatching(name);
|
|
922
922
|
}
|
|
923
923
|
|
|
@@ -933,7 +933,7 @@
|
|
|
933
933
|
* @api private
|
|
934
934
|
*/
|
|
935
935
|
|
|
936
|
-
ClassList$
|
|
936
|
+
ClassList$1.prototype.removeMatching = function(re) {
|
|
937
937
|
const arr = this.array();
|
|
938
938
|
for (let i = 0; i < arr.length; i++) {
|
|
939
939
|
if (re.test(arr[i])) {
|
|
@@ -955,7 +955,7 @@
|
|
|
955
955
|
* @api public
|
|
956
956
|
*/
|
|
957
957
|
|
|
958
|
-
ClassList$
|
|
958
|
+
ClassList$1.prototype.toggle = function(name, force) {
|
|
959
959
|
if ('undefined' !== typeof force) {
|
|
960
960
|
if (force !== this.list.toggle(name, force)) {
|
|
961
961
|
this.list.toggle(name); // toggle again to correct
|
|
@@ -973,7 +973,7 @@
|
|
|
973
973
|
* @api public
|
|
974
974
|
*/
|
|
975
975
|
|
|
976
|
-
ClassList$
|
|
976
|
+
ClassList$1.prototype.array = function() {
|
|
977
977
|
return Array.from(this.list);
|
|
978
978
|
};
|
|
979
979
|
|
|
@@ -985,12 +985,12 @@
|
|
|
985
985
|
* @api public
|
|
986
986
|
*/
|
|
987
987
|
|
|
988
|
-
ClassList$
|
|
989
|
-
ClassList$
|
|
988
|
+
ClassList$1.prototype.has =
|
|
989
|
+
ClassList$1.prototype.contains = function(name) {
|
|
990
990
|
return this.list.contains(name);
|
|
991
991
|
};
|
|
992
992
|
|
|
993
|
-
function remove$
|
|
993
|
+
function remove$2(element) {
|
|
994
994
|
var parent = element.parentNode;
|
|
995
995
|
|
|
996
996
|
if (parent) {
|
|
@@ -1010,17 +1010,17 @@
|
|
|
1010
1010
|
* @param {DOMElement} element
|
|
1011
1011
|
* @return {DOMElement} the element (for chaining)
|
|
1012
1012
|
*/
|
|
1013
|
-
function clear$
|
|
1013
|
+
function clear$1(element) {
|
|
1014
1014
|
var child;
|
|
1015
1015
|
|
|
1016
1016
|
while ((child = element.firstChild)) {
|
|
1017
|
-
remove$
|
|
1017
|
+
remove$2(child);
|
|
1018
1018
|
}
|
|
1019
1019
|
|
|
1020
1020
|
return element;
|
|
1021
1021
|
}
|
|
1022
1022
|
|
|
1023
|
-
var ns$
|
|
1023
|
+
var ns$1 = {
|
|
1024
1024
|
svg: 'http://www.w3.org/2000/svg'
|
|
1025
1025
|
};
|
|
1026
1026
|
|
|
@@ -1028,25 +1028,25 @@
|
|
|
1028
1028
|
* DOM parsing utility
|
|
1029
1029
|
*/
|
|
1030
1030
|
|
|
1031
|
-
var SVG_START$
|
|
1031
|
+
var SVG_START$1 = '<svg xmlns="' + ns$1.svg + '"';
|
|
1032
1032
|
|
|
1033
|
-
function parse$
|
|
1033
|
+
function parse$2(svg) {
|
|
1034
1034
|
|
|
1035
1035
|
var unwrap = false;
|
|
1036
1036
|
|
|
1037
1037
|
// ensure we import a valid svg document
|
|
1038
1038
|
if (svg.substring(0, 4) === '<svg') {
|
|
1039
|
-
if (svg.indexOf(ns$
|
|
1040
|
-
svg = SVG_START$
|
|
1039
|
+
if (svg.indexOf(ns$1.svg) === -1) {
|
|
1040
|
+
svg = SVG_START$1 + svg.substring(4);
|
|
1041
1041
|
}
|
|
1042
1042
|
} else {
|
|
1043
1043
|
|
|
1044
1044
|
// namespace svg
|
|
1045
|
-
svg = SVG_START$
|
|
1045
|
+
svg = SVG_START$1 + '>' + svg + '</svg>';
|
|
1046
1046
|
unwrap = true;
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
|
-
var parsed = parseDocument$
|
|
1049
|
+
var parsed = parseDocument$1(svg);
|
|
1050
1050
|
|
|
1051
1051
|
if (!unwrap) {
|
|
1052
1052
|
return parsed;
|
|
@@ -1063,7 +1063,7 @@
|
|
|
1063
1063
|
return fragment;
|
|
1064
1064
|
}
|
|
1065
1065
|
|
|
1066
|
-
function parseDocument$
|
|
1066
|
+
function parseDocument$1(svg) {
|
|
1067
1067
|
|
|
1068
1068
|
var parser;
|
|
1069
1069
|
|
|
@@ -1087,18 +1087,18 @@
|
|
|
1087
1087
|
*
|
|
1088
1088
|
* @returns {SVGElement}
|
|
1089
1089
|
*/
|
|
1090
|
-
function create$
|
|
1090
|
+
function create$2(name, attrs) {
|
|
1091
1091
|
var element;
|
|
1092
1092
|
|
|
1093
1093
|
if (name.charAt(0) === '<') {
|
|
1094
|
-
element = parse$
|
|
1094
|
+
element = parse$2(name).firstChild;
|
|
1095
1095
|
element = document.importNode(element, true);
|
|
1096
1096
|
} else {
|
|
1097
|
-
element = document.createElementNS(ns$
|
|
1097
|
+
element = document.createElementNS(ns$1.svg, name);
|
|
1098
1098
|
}
|
|
1099
1099
|
|
|
1100
1100
|
if (attrs) {
|
|
1101
|
-
attr$
|
|
1101
|
+
attr$2(element, attrs);
|
|
1102
1102
|
}
|
|
1103
1103
|
|
|
1104
1104
|
return element;
|
|
@@ -1113,7 +1113,7 @@
|
|
|
1113
1113
|
|
|
1114
1114
|
function getNode() {
|
|
1115
1115
|
if (node === null) {
|
|
1116
|
-
node = create$
|
|
1116
|
+
node = create$2('svg');
|
|
1117
1117
|
}
|
|
1118
1118
|
|
|
1119
1119
|
return node;
|
|
@@ -1168,6 +1168,152 @@
|
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
1170
|
|
|
1171
|
+
/**
|
|
1172
|
+
* Serialization util
|
|
1173
|
+
*/
|
|
1174
|
+
|
|
1175
|
+
var TEXT_ENTITIES = /([&<>]{1})/g;
|
|
1176
|
+
var ATTR_ENTITIES = /([\n\r"]{1})/g;
|
|
1177
|
+
|
|
1178
|
+
var ENTITY_REPLACEMENT = {
|
|
1179
|
+
'&': '&',
|
|
1180
|
+
'<': '<',
|
|
1181
|
+
'>': '>',
|
|
1182
|
+
'"': '\''
|
|
1183
|
+
};
|
|
1184
|
+
|
|
1185
|
+
function escape$1(str, pattern) {
|
|
1186
|
+
|
|
1187
|
+
function replaceFn(match, entity) {
|
|
1188
|
+
return ENTITY_REPLACEMENT[entity] || entity;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
return str.replace(pattern, replaceFn);
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
function serialize(node, output) {
|
|
1195
|
+
|
|
1196
|
+
var i, len, attrMap, attrNode, childNodes;
|
|
1197
|
+
|
|
1198
|
+
switch (node.nodeType) {
|
|
1199
|
+
|
|
1200
|
+
// TEXT
|
|
1201
|
+
case 3:
|
|
1202
|
+
|
|
1203
|
+
// replace special XML characters
|
|
1204
|
+
output.push(escape$1(node.textContent, TEXT_ENTITIES));
|
|
1205
|
+
break;
|
|
1206
|
+
|
|
1207
|
+
// ELEMENT
|
|
1208
|
+
case 1:
|
|
1209
|
+
output.push('<', node.tagName);
|
|
1210
|
+
|
|
1211
|
+
if (node.hasAttributes()) {
|
|
1212
|
+
attrMap = node.attributes;
|
|
1213
|
+
for (i = 0, len = attrMap.length; i < len; ++i) {
|
|
1214
|
+
attrNode = attrMap.item(i);
|
|
1215
|
+
output.push(' ', attrNode.name, '="', escape$1(attrNode.value, ATTR_ENTITIES), '"');
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
if (node.hasChildNodes()) {
|
|
1220
|
+
output.push('>');
|
|
1221
|
+
childNodes = node.childNodes;
|
|
1222
|
+
for (i = 0, len = childNodes.length; i < len; ++i) {
|
|
1223
|
+
serialize(childNodes.item(i), output);
|
|
1224
|
+
}
|
|
1225
|
+
output.push('</', node.tagName, '>');
|
|
1226
|
+
} else {
|
|
1227
|
+
output.push('/>');
|
|
1228
|
+
}
|
|
1229
|
+
break;
|
|
1230
|
+
|
|
1231
|
+
// COMMENT
|
|
1232
|
+
case 8:
|
|
1233
|
+
output.push('<!--', escape$1(node.nodeValue, TEXT_ENTITIES), '-->');
|
|
1234
|
+
break;
|
|
1235
|
+
|
|
1236
|
+
// CDATA
|
|
1237
|
+
case 4:
|
|
1238
|
+
output.push('<![CDATA[', node.nodeValue, ']]>');
|
|
1239
|
+
break;
|
|
1240
|
+
|
|
1241
|
+
default:
|
|
1242
|
+
throw new Error('unable to handle node ' + node.nodeType);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
return output;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* innerHTML like functionality for SVG elements.
|
|
1250
|
+
* based on innerSVG (https://code.google.com/p/innersvg)
|
|
1251
|
+
*/
|
|
1252
|
+
|
|
1253
|
+
|
|
1254
|
+
function set$1(element, svg) {
|
|
1255
|
+
|
|
1256
|
+
var parsed = parse$2(svg);
|
|
1257
|
+
|
|
1258
|
+
// clear element contents
|
|
1259
|
+
clear$1(element);
|
|
1260
|
+
|
|
1261
|
+
if (!svg) {
|
|
1262
|
+
return;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
if (!isFragment(parsed)) {
|
|
1266
|
+
|
|
1267
|
+
// extract <svg> from parsed document
|
|
1268
|
+
parsed = parsed.documentElement;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
var nodes = slice$1(parsed.childNodes);
|
|
1272
|
+
|
|
1273
|
+
// import + append each node
|
|
1274
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
1275
|
+
appendTo$1(nodes[i], element);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
function get(element) {
|
|
1281
|
+
var child = element.firstChild,
|
|
1282
|
+
output = [];
|
|
1283
|
+
|
|
1284
|
+
while (child) {
|
|
1285
|
+
serialize(child, output);
|
|
1286
|
+
child = child.nextSibling;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
return output.join('');
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
function isFragment(node) {
|
|
1293
|
+
return node.nodeName === '#document-fragment';
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
function innerSVG(element, svg) {
|
|
1297
|
+
|
|
1298
|
+
if (svg !== undefined) {
|
|
1299
|
+
|
|
1300
|
+
try {
|
|
1301
|
+
set$1(element, svg);
|
|
1302
|
+
} catch (e) {
|
|
1303
|
+
throw new Error('error parsing SVG: ' + e.message);
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
return element;
|
|
1307
|
+
} else {
|
|
1308
|
+
return get(element);
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
|
|
1313
|
+
function slice$1(arr) {
|
|
1314
|
+
return Array.prototype.slice.call(arr);
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1171
1317
|
/**
|
|
1172
1318
|
* transform accessor utility
|
|
1173
1319
|
*/
|
|
@@ -1230,18 +1376,18 @@
|
|
|
1230
1376
|
|
|
1231
1377
|
function createLine(points, attrs) {
|
|
1232
1378
|
|
|
1233
|
-
var line = create$
|
|
1234
|
-
attr$
|
|
1379
|
+
var line = create$2('polyline');
|
|
1380
|
+
attr$2(line, { points: toSVGPoints(points) });
|
|
1235
1381
|
|
|
1236
1382
|
if (attrs) {
|
|
1237
|
-
attr$
|
|
1383
|
+
attr$2(line, attrs);
|
|
1238
1384
|
}
|
|
1239
1385
|
|
|
1240
1386
|
return line;
|
|
1241
1387
|
}
|
|
1242
1388
|
|
|
1243
1389
|
function updateLine(gfx, points) {
|
|
1244
|
-
attr$
|
|
1390
|
+
attr$2(gfx, { points: toSVGPoints(points) });
|
|
1245
1391
|
|
|
1246
1392
|
return gfx;
|
|
1247
1393
|
}
|
|
@@ -1510,7 +1656,7 @@
|
|
|
1510
1656
|
* @param {String} [val]
|
|
1511
1657
|
* @api public
|
|
1512
1658
|
*/
|
|
1513
|
-
function attr$
|
|
1659
|
+
function attr$1(el, name, val) {
|
|
1514
1660
|
|
|
1515
1661
|
// get
|
|
1516
1662
|
if (arguments.length == 2) {
|
|
@@ -1538,7 +1684,7 @@
|
|
|
1538
1684
|
* toString reference.
|
|
1539
1685
|
*/
|
|
1540
1686
|
|
|
1541
|
-
const toString
|
|
1687
|
+
const toString = Object.prototype.toString;
|
|
1542
1688
|
|
|
1543
1689
|
/**
|
|
1544
1690
|
* Wrap `el` in a `ClassList`.
|
|
@@ -1548,8 +1694,8 @@
|
|
|
1548
1694
|
* @api public
|
|
1549
1695
|
*/
|
|
1550
1696
|
|
|
1551
|
-
function classes
|
|
1552
|
-
return new ClassList
|
|
1697
|
+
function classes(el) {
|
|
1698
|
+
return new ClassList(el);
|
|
1553
1699
|
}
|
|
1554
1700
|
|
|
1555
1701
|
/**
|
|
@@ -1559,7 +1705,7 @@
|
|
|
1559
1705
|
* @api private
|
|
1560
1706
|
*/
|
|
1561
1707
|
|
|
1562
|
-
function ClassList
|
|
1708
|
+
function ClassList(el) {
|
|
1563
1709
|
if (!el || !el.nodeType) {
|
|
1564
1710
|
throw new Error('A DOM element reference is required');
|
|
1565
1711
|
}
|
|
@@ -1575,7 +1721,7 @@
|
|
|
1575
1721
|
* @api public
|
|
1576
1722
|
*/
|
|
1577
1723
|
|
|
1578
|
-
ClassList
|
|
1724
|
+
ClassList.prototype.add = function(name) {
|
|
1579
1725
|
this.list.add(name);
|
|
1580
1726
|
return this;
|
|
1581
1727
|
};
|
|
@@ -1590,8 +1736,8 @@
|
|
|
1590
1736
|
* @api public
|
|
1591
1737
|
*/
|
|
1592
1738
|
|
|
1593
|
-
ClassList
|
|
1594
|
-
if ('[object RegExp]' == toString
|
|
1739
|
+
ClassList.prototype.remove = function(name) {
|
|
1740
|
+
if ('[object RegExp]' == toString.call(name)) {
|
|
1595
1741
|
return this.removeMatching(name);
|
|
1596
1742
|
}
|
|
1597
1743
|
|
|
@@ -1607,7 +1753,7 @@
|
|
|
1607
1753
|
* @api private
|
|
1608
1754
|
*/
|
|
1609
1755
|
|
|
1610
|
-
ClassList
|
|
1756
|
+
ClassList.prototype.removeMatching = function(re) {
|
|
1611
1757
|
const arr = this.array();
|
|
1612
1758
|
for (let i = 0; i < arr.length; i++) {
|
|
1613
1759
|
if (re.test(arr[i])) {
|
|
@@ -1629,7 +1775,7 @@
|
|
|
1629
1775
|
* @api public
|
|
1630
1776
|
*/
|
|
1631
1777
|
|
|
1632
|
-
ClassList
|
|
1778
|
+
ClassList.prototype.toggle = function(name, force) {
|
|
1633
1779
|
if ('undefined' !== typeof force) {
|
|
1634
1780
|
if (force !== this.list.toggle(name, force)) {
|
|
1635
1781
|
this.list.toggle(name); // toggle again to correct
|
|
@@ -1647,7 +1793,7 @@
|
|
|
1647
1793
|
* @api public
|
|
1648
1794
|
*/
|
|
1649
1795
|
|
|
1650
|
-
ClassList
|
|
1796
|
+
ClassList.prototype.array = function() {
|
|
1651
1797
|
return Array.from(this.list);
|
|
1652
1798
|
};
|
|
1653
1799
|
|
|
@@ -1659,15 +1805,15 @@
|
|
|
1659
1805
|
* @api public
|
|
1660
1806
|
*/
|
|
1661
1807
|
|
|
1662
|
-
ClassList
|
|
1663
|
-
ClassList
|
|
1808
|
+
ClassList.prototype.has =
|
|
1809
|
+
ClassList.prototype.contains = function(name) {
|
|
1664
1810
|
return this.list.contains(name);
|
|
1665
1811
|
};
|
|
1666
1812
|
|
|
1667
1813
|
/**
|
|
1668
1814
|
* Remove all children from the given element.
|
|
1669
1815
|
*/
|
|
1670
|
-
function clear
|
|
1816
|
+
function clear(el) {
|
|
1671
1817
|
|
|
1672
1818
|
var c;
|
|
1673
1819
|
|
|
@@ -1802,715 +1948,147 @@
|
|
|
1802
1948
|
* @param {Boolean} capture
|
|
1803
1949
|
* @api public
|
|
1804
1950
|
*/
|
|
1805
|
-
function unbind(el, type, fn, capture) {
|
|
1806
|
-
if (forceCaptureEvents.indexOf(type) !== -1) {
|
|
1807
|
-
capture = true;
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
return event.unbind(el, type, fn, capture);
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
var delegate = {
|
|
1814
|
-
bind,
|
|
1815
|
-
unbind
|
|
1816
|
-
};
|
|
1817
|
-
|
|
1818
|
-
/**
|
|
1819
|
-
* Expose `parse`.
|
|
1820
|
-
*/
|
|
1821
|
-
|
|
1822
|
-
var domify = parse$2;
|
|
1823
|
-
|
|
1824
|
-
/**
|
|
1825
|
-
* Tests for browser support.
|
|
1826
|
-
*/
|
|
1827
|
-
|
|
1828
|
-
var innerHTMLBug = false;
|
|
1829
|
-
var bugTestDiv;
|
|
1830
|
-
if (typeof document !== 'undefined') {
|
|
1831
|
-
bugTestDiv = document.createElement('div');
|
|
1832
|
-
// Setup
|
|
1833
|
-
bugTestDiv.innerHTML = ' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';
|
|
1834
|
-
// Make sure that link elements get serialized correctly by innerHTML
|
|
1835
|
-
// This requires a wrapper element in IE
|
|
1836
|
-
innerHTMLBug = !bugTestDiv.getElementsByTagName('link').length;
|
|
1837
|
-
bugTestDiv = undefined;
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
/**
|
|
1841
|
-
* Wrap map from jquery.
|
|
1842
|
-
*/
|
|
1843
|
-
|
|
1844
|
-
var map = {
|
|
1845
|
-
legend: [1, '<fieldset>', '</fieldset>'],
|
|
1846
|
-
tr: [2, '<table><tbody>', '</tbody></table>'],
|
|
1847
|
-
col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
|
|
1848
|
-
// for script/link/style tags to work in IE6-8, you have to wrap
|
|
1849
|
-
// in a div with a non-whitespace character in front, ha!
|
|
1850
|
-
_default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
|
|
1851
|
-
};
|
|
1852
|
-
|
|
1853
|
-
map.td =
|
|
1854
|
-
map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
|
|
1855
|
-
|
|
1856
|
-
map.option =
|
|
1857
|
-
map.optgroup = [1, '<select multiple="multiple">', '</select>'];
|
|
1858
|
-
|
|
1859
|
-
map.thead =
|
|
1860
|
-
map.tbody =
|
|
1861
|
-
map.colgroup =
|
|
1862
|
-
map.caption =
|
|
1863
|
-
map.tfoot = [1, '<table>', '</table>'];
|
|
1864
|
-
|
|
1865
|
-
map.polyline =
|
|
1866
|
-
map.ellipse =
|
|
1867
|
-
map.polygon =
|
|
1868
|
-
map.circle =
|
|
1869
|
-
map.text =
|
|
1870
|
-
map.line =
|
|
1871
|
-
map.path =
|
|
1872
|
-
map.rect =
|
|
1873
|
-
map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
|
|
1874
|
-
|
|
1875
|
-
/**
|
|
1876
|
-
* Parse `html` and return a DOM Node instance, which could be a TextNode,
|
|
1877
|
-
* HTML DOM Node of some kind (<div> for example), or a DocumentFragment
|
|
1878
|
-
* instance, depending on the contents of the `html` string.
|
|
1879
|
-
*
|
|
1880
|
-
* @param {String} html - HTML string to "domify"
|
|
1881
|
-
* @param {Document} doc - The `document` instance to create the Node for
|
|
1882
|
-
* @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
|
|
1883
|
-
* @api private
|
|
1884
|
-
*/
|
|
1885
|
-
|
|
1886
|
-
function parse$2(html, doc) {
|
|
1887
|
-
if ('string' != typeof html) throw new TypeError('String expected');
|
|
1888
|
-
|
|
1889
|
-
// default to the global `document` object
|
|
1890
|
-
if (!doc) doc = document;
|
|
1891
|
-
|
|
1892
|
-
// tag name
|
|
1893
|
-
var m = /<([\w:]+)/.exec(html);
|
|
1894
|
-
if (!m) return doc.createTextNode(html);
|
|
1895
|
-
|
|
1896
|
-
html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing whitespace
|
|
1897
|
-
|
|
1898
|
-
var tag = m[1];
|
|
1899
|
-
|
|
1900
|
-
// body support
|
|
1901
|
-
if (tag == 'body') {
|
|
1902
|
-
var el = doc.createElement('html');
|
|
1903
|
-
el.innerHTML = html;
|
|
1904
|
-
return el.removeChild(el.lastChild);
|
|
1905
|
-
}
|
|
1906
|
-
|
|
1907
|
-
// wrap map
|
|
1908
|
-
var wrap = Object.prototype.hasOwnProperty.call(map, tag) ? map[tag] : map._default;
|
|
1909
|
-
var depth = wrap[0];
|
|
1910
|
-
var prefix = wrap[1];
|
|
1911
|
-
var suffix = wrap[2];
|
|
1912
|
-
var el = doc.createElement('div');
|
|
1913
|
-
el.innerHTML = prefix + html + suffix;
|
|
1914
|
-
while (depth--) el = el.lastChild;
|
|
1915
|
-
|
|
1916
|
-
// one element
|
|
1917
|
-
if (el.firstChild == el.lastChild) {
|
|
1918
|
-
return el.removeChild(el.firstChild);
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1921
|
-
// several elements
|
|
1922
|
-
var fragment = doc.createDocumentFragment();
|
|
1923
|
-
while (el.firstChild) {
|
|
1924
|
-
fragment.appendChild(el.removeChild(el.firstChild));
|
|
1925
|
-
}
|
|
1926
|
-
|
|
1927
|
-
return fragment;
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
var domify$1 = domify;
|
|
1931
|
-
|
|
1932
|
-
function query(selector, el) {
|
|
1933
|
-
el = el || document;
|
|
1934
|
-
|
|
1935
|
-
return el.querySelector(selector);
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
function all(selector, el) {
|
|
1939
|
-
el = el || document;
|
|
1940
|
-
|
|
1941
|
-
return el.querySelectorAll(selector);
|
|
1942
|
-
}
|
|
1943
|
-
|
|
1944
|
-
function remove$2(el) {
|
|
1945
|
-
el.parentNode && el.parentNode.removeChild(el);
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
|
-
function ensureImported$1(element, target) {
|
|
1949
|
-
|
|
1950
|
-
if (element.ownerDocument !== target.ownerDocument) {
|
|
1951
|
-
try {
|
|
1952
|
-
|
|
1953
|
-
// may fail on webkit
|
|
1954
|
-
return target.ownerDocument.importNode(element, true);
|
|
1955
|
-
} catch (e) {
|
|
1956
|
-
|
|
1957
|
-
// ignore
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
return element;
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
/**
|
|
1965
|
-
* appendTo utility
|
|
1966
|
-
*/
|
|
1967
|
-
|
|
1968
|
-
/**
|
|
1969
|
-
* Append a node to a target element and return the appended node.
|
|
1970
|
-
*
|
|
1971
|
-
* @param {SVGElement} element
|
|
1972
|
-
* @param {SVGElement} target
|
|
1973
|
-
*
|
|
1974
|
-
* @return {SVGElement} the appended node
|
|
1975
|
-
*/
|
|
1976
|
-
function appendTo$1(element, target) {
|
|
1977
|
-
return target.appendChild(ensureImported$1(element, target));
|
|
1978
|
-
}
|
|
1979
|
-
|
|
1980
|
-
/**
|
|
1981
|
-
* append utility
|
|
1982
|
-
*/
|
|
1983
|
-
|
|
1984
|
-
/**
|
|
1985
|
-
* Append a node to an element
|
|
1986
|
-
*
|
|
1987
|
-
* @param {SVGElement} element
|
|
1988
|
-
* @param {SVGElement} node
|
|
1989
|
-
*
|
|
1990
|
-
* @return {SVGElement} the element
|
|
1991
|
-
*/
|
|
1992
|
-
function append$1(target, node) {
|
|
1993
|
-
appendTo$1(node, target);
|
|
1994
|
-
return target;
|
|
1995
|
-
}
|
|
1996
|
-
|
|
1997
|
-
/**
|
|
1998
|
-
* attribute accessor utility
|
|
1999
|
-
*/
|
|
2000
|
-
|
|
2001
|
-
var LENGTH_ATTR$1 = 2;
|
|
2002
|
-
|
|
2003
|
-
var CSS_PROPERTIES$1 = {
|
|
2004
|
-
'alignment-baseline': 1,
|
|
2005
|
-
'baseline-shift': 1,
|
|
2006
|
-
'clip': 1,
|
|
2007
|
-
'clip-path': 1,
|
|
2008
|
-
'clip-rule': 1,
|
|
2009
|
-
'color': 1,
|
|
2010
|
-
'color-interpolation': 1,
|
|
2011
|
-
'color-interpolation-filters': 1,
|
|
2012
|
-
'color-profile': 1,
|
|
2013
|
-
'color-rendering': 1,
|
|
2014
|
-
'cursor': 1,
|
|
2015
|
-
'direction': 1,
|
|
2016
|
-
'display': 1,
|
|
2017
|
-
'dominant-baseline': 1,
|
|
2018
|
-
'enable-background': 1,
|
|
2019
|
-
'fill': 1,
|
|
2020
|
-
'fill-opacity': 1,
|
|
2021
|
-
'fill-rule': 1,
|
|
2022
|
-
'filter': 1,
|
|
2023
|
-
'flood-color': 1,
|
|
2024
|
-
'flood-opacity': 1,
|
|
2025
|
-
'font': 1,
|
|
2026
|
-
'font-family': 1,
|
|
2027
|
-
'font-size': LENGTH_ATTR$1,
|
|
2028
|
-
'font-size-adjust': 1,
|
|
2029
|
-
'font-stretch': 1,
|
|
2030
|
-
'font-style': 1,
|
|
2031
|
-
'font-variant': 1,
|
|
2032
|
-
'font-weight': 1,
|
|
2033
|
-
'glyph-orientation-horizontal': 1,
|
|
2034
|
-
'glyph-orientation-vertical': 1,
|
|
2035
|
-
'image-rendering': 1,
|
|
2036
|
-
'kerning': 1,
|
|
2037
|
-
'letter-spacing': 1,
|
|
2038
|
-
'lighting-color': 1,
|
|
2039
|
-
'marker': 1,
|
|
2040
|
-
'marker-end': 1,
|
|
2041
|
-
'marker-mid': 1,
|
|
2042
|
-
'marker-start': 1,
|
|
2043
|
-
'mask': 1,
|
|
2044
|
-
'opacity': 1,
|
|
2045
|
-
'overflow': 1,
|
|
2046
|
-
'pointer-events': 1,
|
|
2047
|
-
'shape-rendering': 1,
|
|
2048
|
-
'stop-color': 1,
|
|
2049
|
-
'stop-opacity': 1,
|
|
2050
|
-
'stroke': 1,
|
|
2051
|
-
'stroke-dasharray': 1,
|
|
2052
|
-
'stroke-dashoffset': 1,
|
|
2053
|
-
'stroke-linecap': 1,
|
|
2054
|
-
'stroke-linejoin': 1,
|
|
2055
|
-
'stroke-miterlimit': 1,
|
|
2056
|
-
'stroke-opacity': 1,
|
|
2057
|
-
'stroke-width': LENGTH_ATTR$1,
|
|
2058
|
-
'text-anchor': 1,
|
|
2059
|
-
'text-decoration': 1,
|
|
2060
|
-
'text-rendering': 1,
|
|
2061
|
-
'unicode-bidi': 1,
|
|
2062
|
-
'visibility': 1,
|
|
2063
|
-
'word-spacing': 1,
|
|
2064
|
-
'writing-mode': 1
|
|
2065
|
-
};
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
function getAttribute$1(node, name) {
|
|
2069
|
-
if (CSS_PROPERTIES$1[name]) {
|
|
2070
|
-
return node.style[name];
|
|
2071
|
-
} else {
|
|
2072
|
-
return node.getAttributeNS(null, name);
|
|
2073
|
-
}
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
function setAttribute$1(node, name, value) {
|
|
2077
|
-
var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
2078
|
-
|
|
2079
|
-
var type = CSS_PROPERTIES$1[hyphenated];
|
|
2080
|
-
|
|
2081
|
-
if (type) {
|
|
2082
|
-
|
|
2083
|
-
// append pixel unit, unless present
|
|
2084
|
-
if (type === LENGTH_ATTR$1 && typeof value === 'number') {
|
|
2085
|
-
value = String(value) + 'px';
|
|
2086
|
-
}
|
|
2087
|
-
|
|
2088
|
-
node.style[hyphenated] = value;
|
|
2089
|
-
} else {
|
|
2090
|
-
node.setAttributeNS(null, name, value);
|
|
2091
|
-
}
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
|
-
function setAttributes$1(node, attrs) {
|
|
2095
|
-
|
|
2096
|
-
var names = Object.keys(attrs), i, name;
|
|
2097
|
-
|
|
2098
|
-
for (i = 0, name; (name = names[i]); i++) {
|
|
2099
|
-
setAttribute$1(node, name, attrs[name]);
|
|
2100
|
-
}
|
|
2101
|
-
}
|
|
2102
|
-
|
|
2103
|
-
/**
|
|
2104
|
-
* Gets or sets raw attributes on a node.
|
|
2105
|
-
*
|
|
2106
|
-
* @param {SVGElement} node
|
|
2107
|
-
* @param {Object} [attrs]
|
|
2108
|
-
* @param {String} [name]
|
|
2109
|
-
* @param {String} [value]
|
|
2110
|
-
*
|
|
2111
|
-
* @return {String}
|
|
2112
|
-
*/
|
|
2113
|
-
function attr$1(node, name, value) {
|
|
2114
|
-
if (typeof name === 'string') {
|
|
2115
|
-
if (value !== undefined) {
|
|
2116
|
-
setAttribute$1(node, name, value);
|
|
2117
|
-
} else {
|
|
2118
|
-
return getAttribute$1(node, name);
|
|
2119
|
-
}
|
|
2120
|
-
} else {
|
|
2121
|
-
setAttributes$1(node, name);
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
return node;
|
|
2125
|
-
}
|
|
2126
|
-
|
|
2127
|
-
/**
|
|
2128
|
-
* Taken from https://github.com/component/classes
|
|
2129
|
-
*
|
|
2130
|
-
* Without the component bits.
|
|
2131
|
-
*/
|
|
2132
|
-
|
|
2133
|
-
/**
|
|
2134
|
-
* toString reference.
|
|
2135
|
-
*/
|
|
2136
|
-
|
|
2137
|
-
const toString = Object.prototype.toString;
|
|
2138
|
-
|
|
2139
|
-
/**
|
|
2140
|
-
* Wrap `el` in a `ClassList`.
|
|
2141
|
-
*
|
|
2142
|
-
* @param {Element} el
|
|
2143
|
-
* @return {ClassList}
|
|
2144
|
-
* @api public
|
|
2145
|
-
*/
|
|
2146
|
-
|
|
2147
|
-
function classes(el) {
|
|
2148
|
-
return new ClassList(el);
|
|
2149
|
-
}
|
|
2150
|
-
|
|
2151
|
-
function ClassList(el) {
|
|
2152
|
-
if (!el || !el.nodeType) {
|
|
2153
|
-
throw new Error('A DOM element reference is required');
|
|
2154
|
-
}
|
|
2155
|
-
this.el = el;
|
|
2156
|
-
this.list = el.classList;
|
|
2157
|
-
}
|
|
2158
|
-
|
|
2159
|
-
/**
|
|
2160
|
-
* Add class `name` if not already present.
|
|
2161
|
-
*
|
|
2162
|
-
* @param {String} name
|
|
2163
|
-
* @return {ClassList}
|
|
2164
|
-
* @api public
|
|
2165
|
-
*/
|
|
2166
|
-
|
|
2167
|
-
ClassList.prototype.add = function(name) {
|
|
2168
|
-
this.list.add(name);
|
|
2169
|
-
return this;
|
|
2170
|
-
};
|
|
2171
|
-
|
|
2172
|
-
/**
|
|
2173
|
-
* Remove class `name` when present, or
|
|
2174
|
-
* pass a regular expression to remove
|
|
2175
|
-
* any which match.
|
|
2176
|
-
*
|
|
2177
|
-
* @param {String|RegExp} name
|
|
2178
|
-
* @return {ClassList}
|
|
2179
|
-
* @api public
|
|
2180
|
-
*/
|
|
2181
|
-
|
|
2182
|
-
ClassList.prototype.remove = function(name) {
|
|
2183
|
-
if ('[object RegExp]' == toString.call(name)) {
|
|
2184
|
-
return this.removeMatching(name);
|
|
2185
|
-
}
|
|
2186
|
-
|
|
2187
|
-
this.list.remove(name);
|
|
2188
|
-
return this;
|
|
2189
|
-
};
|
|
2190
|
-
|
|
2191
|
-
/**
|
|
2192
|
-
* Remove all classes matching `re`.
|
|
2193
|
-
*
|
|
2194
|
-
* @param {RegExp} re
|
|
2195
|
-
* @return {ClassList}
|
|
2196
|
-
* @api private
|
|
2197
|
-
*/
|
|
2198
|
-
|
|
2199
|
-
ClassList.prototype.removeMatching = function(re) {
|
|
2200
|
-
const arr = this.array();
|
|
2201
|
-
for (let i = 0; i < arr.length; i++) {
|
|
2202
|
-
if (re.test(arr[i])) {
|
|
2203
|
-
this.remove(arr[i]);
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
return this;
|
|
2207
|
-
};
|
|
2208
|
-
|
|
2209
|
-
/**
|
|
2210
|
-
* Toggle class `name`, can force state via `force`.
|
|
2211
|
-
*
|
|
2212
|
-
* For browsers that support classList, but do not support `force` yet,
|
|
2213
|
-
* the mistake will be detected and corrected.
|
|
2214
|
-
*
|
|
2215
|
-
* @param {String} name
|
|
2216
|
-
* @param {Boolean} force
|
|
2217
|
-
* @return {ClassList}
|
|
2218
|
-
* @api public
|
|
2219
|
-
*/
|
|
2220
|
-
|
|
2221
|
-
ClassList.prototype.toggle = function(name, force) {
|
|
2222
|
-
if ('undefined' !== typeof force) {
|
|
2223
|
-
if (force !== this.list.toggle(name, force)) {
|
|
2224
|
-
this.list.toggle(name); // toggle again to correct
|
|
2225
|
-
}
|
|
2226
|
-
} else {
|
|
2227
|
-
this.list.toggle(name);
|
|
2228
|
-
}
|
|
2229
|
-
return this;
|
|
2230
|
-
};
|
|
2231
|
-
|
|
2232
|
-
/**
|
|
2233
|
-
* Return an array of classes.
|
|
2234
|
-
*
|
|
2235
|
-
* @return {Array}
|
|
2236
|
-
* @api public
|
|
2237
|
-
*/
|
|
2238
|
-
|
|
2239
|
-
ClassList.prototype.array = function() {
|
|
2240
|
-
return Array.from(this.list);
|
|
2241
|
-
};
|
|
2242
|
-
|
|
2243
|
-
/**
|
|
2244
|
-
* Check if class `name` is present.
|
|
2245
|
-
*
|
|
2246
|
-
* @param {String} name
|
|
2247
|
-
* @return {ClassList}
|
|
2248
|
-
* @api public
|
|
2249
|
-
*/
|
|
2250
|
-
|
|
2251
|
-
ClassList.prototype.has =
|
|
2252
|
-
ClassList.prototype.contains = function(name) {
|
|
2253
|
-
return this.list.contains(name);
|
|
2254
|
-
};
|
|
2255
|
-
|
|
2256
|
-
function remove$1(element) {
|
|
2257
|
-
var parent = element.parentNode;
|
|
2258
|
-
|
|
2259
|
-
if (parent) {
|
|
2260
|
-
parent.removeChild(element);
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
|
-
return element;
|
|
2264
|
-
}
|
|
2265
|
-
|
|
2266
|
-
/**
|
|
2267
|
-
* Clear utility
|
|
2268
|
-
*/
|
|
2269
|
-
|
|
2270
|
-
/**
|
|
2271
|
-
* Removes all children from the given element
|
|
2272
|
-
*
|
|
2273
|
-
* @param {DOMElement} element
|
|
2274
|
-
* @return {DOMElement} the element (for chaining)
|
|
2275
|
-
*/
|
|
2276
|
-
function clear(element) {
|
|
2277
|
-
var child;
|
|
2278
|
-
|
|
2279
|
-
while ((child = element.firstChild)) {
|
|
2280
|
-
remove$1(child);
|
|
2281
|
-
}
|
|
2282
|
-
|
|
2283
|
-
return element;
|
|
2284
|
-
}
|
|
2285
|
-
|
|
2286
|
-
var ns$1 = {
|
|
2287
|
-
svg: 'http://www.w3.org/2000/svg'
|
|
2288
|
-
};
|
|
2289
|
-
|
|
2290
|
-
/**
|
|
2291
|
-
* DOM parsing utility
|
|
2292
|
-
*/
|
|
2293
|
-
|
|
2294
|
-
var SVG_START$1 = '<svg xmlns="' + ns$1.svg + '"';
|
|
2295
|
-
|
|
2296
|
-
function parse$1(svg) {
|
|
2297
|
-
|
|
2298
|
-
var unwrap = false;
|
|
2299
|
-
|
|
2300
|
-
// ensure we import a valid svg document
|
|
2301
|
-
if (svg.substring(0, 4) === '<svg') {
|
|
2302
|
-
if (svg.indexOf(ns$1.svg) === -1) {
|
|
2303
|
-
svg = SVG_START$1 + svg.substring(4);
|
|
2304
|
-
}
|
|
2305
|
-
} else {
|
|
2306
|
-
|
|
2307
|
-
// namespace svg
|
|
2308
|
-
svg = SVG_START$1 + '>' + svg + '</svg>';
|
|
2309
|
-
unwrap = true;
|
|
2310
|
-
}
|
|
2311
|
-
|
|
2312
|
-
var parsed = parseDocument$1(svg);
|
|
2313
|
-
|
|
2314
|
-
if (!unwrap) {
|
|
2315
|
-
return parsed;
|
|
2316
|
-
}
|
|
2317
|
-
|
|
2318
|
-
var fragment = document.createDocumentFragment();
|
|
2319
|
-
|
|
2320
|
-
var parent = parsed.firstChild;
|
|
2321
|
-
|
|
2322
|
-
while (parent.firstChild) {
|
|
2323
|
-
fragment.appendChild(parent.firstChild);
|
|
2324
|
-
}
|
|
2325
|
-
|
|
2326
|
-
return fragment;
|
|
2327
|
-
}
|
|
2328
|
-
|
|
2329
|
-
function parseDocument$1(svg) {
|
|
2330
|
-
|
|
2331
|
-
var parser;
|
|
2332
|
-
|
|
2333
|
-
// parse
|
|
2334
|
-
parser = new DOMParser();
|
|
2335
|
-
parser.async = false;
|
|
2336
|
-
|
|
2337
|
-
return parser.parseFromString(svg, 'text/xml');
|
|
2338
|
-
}
|
|
2339
|
-
|
|
2340
|
-
/**
|
|
2341
|
-
* Create utility for SVG elements
|
|
2342
|
-
*/
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
/**
|
|
2346
|
-
* Create a specific type from name or SVG markup.
|
|
2347
|
-
*
|
|
2348
|
-
* @param {String} name the name or markup of the element
|
|
2349
|
-
* @param {Object} [attrs] attributes to set on the element
|
|
2350
|
-
*
|
|
2351
|
-
* @returns {SVGElement}
|
|
2352
|
-
*/
|
|
2353
|
-
function create$2(name, attrs) {
|
|
2354
|
-
var element;
|
|
2355
|
-
|
|
2356
|
-
if (name.charAt(0) === '<') {
|
|
2357
|
-
element = parse$1(name).firstChild;
|
|
2358
|
-
element = document.importNode(element, true);
|
|
2359
|
-
} else {
|
|
2360
|
-
element = document.createElementNS(ns$1.svg, name);
|
|
2361
|
-
}
|
|
2362
|
-
|
|
2363
|
-
if (attrs) {
|
|
2364
|
-
attr$1(element, attrs);
|
|
2365
|
-
}
|
|
2366
|
-
|
|
2367
|
-
return element;
|
|
2368
|
-
}
|
|
2369
|
-
|
|
2370
|
-
/**
|
|
2371
|
-
* Serialization util
|
|
2372
|
-
*/
|
|
2373
|
-
|
|
2374
|
-
var TEXT_ENTITIES = /([&<>]{1})/g;
|
|
2375
|
-
var ATTR_ENTITIES = /([\n\r"]{1})/g;
|
|
2376
|
-
|
|
2377
|
-
var ENTITY_REPLACEMENT = {
|
|
2378
|
-
'&': '&',
|
|
2379
|
-
'<': '<',
|
|
2380
|
-
'>': '>',
|
|
2381
|
-
'"': '\''
|
|
2382
|
-
};
|
|
2383
|
-
|
|
2384
|
-
function escape$1(str, pattern) {
|
|
2385
|
-
|
|
2386
|
-
function replaceFn(match, entity) {
|
|
2387
|
-
return ENTITY_REPLACEMENT[entity] || entity;
|
|
2388
|
-
}
|
|
2389
|
-
|
|
2390
|
-
return str.replace(pattern, replaceFn);
|
|
2391
|
-
}
|
|
2392
|
-
|
|
2393
|
-
function serialize(node, output) {
|
|
2394
|
-
|
|
2395
|
-
var i, len, attrMap, attrNode, childNodes;
|
|
2396
|
-
|
|
2397
|
-
switch (node.nodeType) {
|
|
2398
|
-
|
|
2399
|
-
// TEXT
|
|
2400
|
-
case 3:
|
|
2401
|
-
|
|
2402
|
-
// replace special XML characters
|
|
2403
|
-
output.push(escape$1(node.textContent, TEXT_ENTITIES));
|
|
2404
|
-
break;
|
|
2405
|
-
|
|
2406
|
-
// ELEMENT
|
|
2407
|
-
case 1:
|
|
2408
|
-
output.push('<', node.tagName);
|
|
2409
|
-
|
|
2410
|
-
if (node.hasAttributes()) {
|
|
2411
|
-
attrMap = node.attributes;
|
|
2412
|
-
for (i = 0, len = attrMap.length; i < len; ++i) {
|
|
2413
|
-
attrNode = attrMap.item(i);
|
|
2414
|
-
output.push(' ', attrNode.name, '="', escape$1(attrNode.value, ATTR_ENTITIES), '"');
|
|
2415
|
-
}
|
|
2416
|
-
}
|
|
1951
|
+
function unbind(el, type, fn, capture) {
|
|
1952
|
+
if (forceCaptureEvents.indexOf(type) !== -1) {
|
|
1953
|
+
capture = true;
|
|
1954
|
+
}
|
|
2417
1955
|
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
childNodes = node.childNodes;
|
|
2421
|
-
for (i = 0, len = childNodes.length; i < len; ++i) {
|
|
2422
|
-
serialize(childNodes.item(i), output);
|
|
2423
|
-
}
|
|
2424
|
-
output.push('</', node.tagName, '>');
|
|
2425
|
-
} else {
|
|
2426
|
-
output.push('/>');
|
|
2427
|
-
}
|
|
2428
|
-
break;
|
|
1956
|
+
return event.unbind(el, type, fn, capture);
|
|
1957
|
+
}
|
|
2429
1958
|
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
1959
|
+
var delegate = {
|
|
1960
|
+
bind,
|
|
1961
|
+
unbind
|
|
1962
|
+
};
|
|
2434
1963
|
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
break;
|
|
1964
|
+
/**
|
|
1965
|
+
* Expose `parse`.
|
|
1966
|
+
*/
|
|
2439
1967
|
|
|
2440
|
-
|
|
2441
|
-
throw new Error('unable to handle node ' + node.nodeType);
|
|
2442
|
-
}
|
|
1968
|
+
var domify = parse$1;
|
|
2443
1969
|
|
|
2444
|
-
|
|
1970
|
+
/**
|
|
1971
|
+
* Tests for browser support.
|
|
1972
|
+
*/
|
|
1973
|
+
|
|
1974
|
+
var innerHTMLBug = false;
|
|
1975
|
+
var bugTestDiv;
|
|
1976
|
+
if (typeof document !== 'undefined') {
|
|
1977
|
+
bugTestDiv = document.createElement('div');
|
|
1978
|
+
// Setup
|
|
1979
|
+
bugTestDiv.innerHTML = ' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';
|
|
1980
|
+
// Make sure that link elements get serialized correctly by innerHTML
|
|
1981
|
+
// This requires a wrapper element in IE
|
|
1982
|
+
innerHTMLBug = !bugTestDiv.getElementsByTagName('link').length;
|
|
1983
|
+
bugTestDiv = undefined;
|
|
2445
1984
|
}
|
|
2446
1985
|
|
|
2447
1986
|
/**
|
|
2448
|
-
*
|
|
2449
|
-
* based on innerSVG (https://code.google.com/p/innersvg)
|
|
1987
|
+
* Wrap map from jquery.
|
|
2450
1988
|
*/
|
|
2451
1989
|
|
|
1990
|
+
var map = {
|
|
1991
|
+
legend: [1, '<fieldset>', '</fieldset>'],
|
|
1992
|
+
tr: [2, '<table><tbody>', '</tbody></table>'],
|
|
1993
|
+
col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
|
|
1994
|
+
// for script/link/style tags to work in IE6-8, you have to wrap
|
|
1995
|
+
// in a div with a non-whitespace character in front, ha!
|
|
1996
|
+
_default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
|
|
1997
|
+
};
|
|
2452
1998
|
|
|
2453
|
-
|
|
1999
|
+
map.td =
|
|
2000
|
+
map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
|
|
2454
2001
|
|
|
2455
|
-
|
|
2002
|
+
map.option =
|
|
2003
|
+
map.optgroup = [1, '<select multiple="multiple">', '</select>'];
|
|
2456
2004
|
|
|
2457
|
-
|
|
2458
|
-
|
|
2005
|
+
map.thead =
|
|
2006
|
+
map.tbody =
|
|
2007
|
+
map.colgroup =
|
|
2008
|
+
map.caption =
|
|
2009
|
+
map.tfoot = [1, '<table>', '</table>'];
|
|
2459
2010
|
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2011
|
+
map.polyline =
|
|
2012
|
+
map.ellipse =
|
|
2013
|
+
map.polygon =
|
|
2014
|
+
map.circle =
|
|
2015
|
+
map.text =
|
|
2016
|
+
map.line =
|
|
2017
|
+
map.path =
|
|
2018
|
+
map.rect =
|
|
2019
|
+
map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
|
|
2463
2020
|
|
|
2464
|
-
|
|
2021
|
+
/**
|
|
2022
|
+
* Parse `html` and return a DOM Node instance, which could be a TextNode,
|
|
2023
|
+
* HTML DOM Node of some kind (<div> for example), or a DocumentFragment
|
|
2024
|
+
* instance, depending on the contents of the `html` string.
|
|
2025
|
+
*
|
|
2026
|
+
* @param {String} html - HTML string to "domify"
|
|
2027
|
+
* @param {Document} doc - The `document` instance to create the Node for
|
|
2028
|
+
* @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
|
|
2029
|
+
* @api private
|
|
2030
|
+
*/
|
|
2465
2031
|
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
}
|
|
2032
|
+
function parse$1(html, doc) {
|
|
2033
|
+
if ('string' != typeof html) throw new TypeError('String expected');
|
|
2469
2034
|
|
|
2470
|
-
|
|
2035
|
+
// default to the global `document` object
|
|
2036
|
+
if (!doc) doc = document;
|
|
2471
2037
|
|
|
2472
|
-
//
|
|
2473
|
-
|
|
2474
|
-
|
|
2038
|
+
// tag name
|
|
2039
|
+
var m = /<([\w:]+)/.exec(html);
|
|
2040
|
+
if (!m) return doc.createTextNode(html);
|
|
2041
|
+
|
|
2042
|
+
html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing whitespace
|
|
2043
|
+
|
|
2044
|
+
var tag = m[1];
|
|
2045
|
+
|
|
2046
|
+
// body support
|
|
2047
|
+
if (tag == 'body') {
|
|
2048
|
+
var el = doc.createElement('html');
|
|
2049
|
+
el.innerHTML = html;
|
|
2050
|
+
return el.removeChild(el.lastChild);
|
|
2475
2051
|
}
|
|
2476
2052
|
|
|
2477
|
-
|
|
2053
|
+
// wrap map
|
|
2054
|
+
var wrap = Object.prototype.hasOwnProperty.call(map, tag) ? map[tag] : map._default;
|
|
2055
|
+
var depth = wrap[0];
|
|
2056
|
+
var prefix = wrap[1];
|
|
2057
|
+
var suffix = wrap[2];
|
|
2058
|
+
var el = doc.createElement('div');
|
|
2059
|
+
el.innerHTML = prefix + html + suffix;
|
|
2060
|
+
while (depth--) el = el.lastChild;
|
|
2478
2061
|
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2062
|
+
// one element
|
|
2063
|
+
if (el.firstChild == el.lastChild) {
|
|
2064
|
+
return el.removeChild(el.firstChild);
|
|
2065
|
+
}
|
|
2482
2066
|
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2067
|
+
// several elements
|
|
2068
|
+
var fragment = doc.createDocumentFragment();
|
|
2069
|
+
while (el.firstChild) {
|
|
2070
|
+
fragment.appendChild(el.removeChild(el.firstChild));
|
|
2486
2071
|
}
|
|
2487
2072
|
|
|
2488
|
-
return
|
|
2073
|
+
return fragment;
|
|
2489
2074
|
}
|
|
2490
2075
|
|
|
2491
|
-
|
|
2492
|
-
return node.nodeName === '#document-fragment';
|
|
2493
|
-
}
|
|
2076
|
+
var domify$1 = domify;
|
|
2494
2077
|
|
|
2495
|
-
function
|
|
2078
|
+
function query(selector, el) {
|
|
2079
|
+
el = el || document;
|
|
2496
2080
|
|
|
2497
|
-
|
|
2081
|
+
return el.querySelector(selector);
|
|
2082
|
+
}
|
|
2498
2083
|
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
} catch (e) {
|
|
2502
|
-
throw new Error('error parsing SVG: ' + e.message);
|
|
2503
|
-
}
|
|
2084
|
+
function all(selector, el) {
|
|
2085
|
+
el = el || document;
|
|
2504
2086
|
|
|
2505
|
-
|
|
2506
|
-
} else {
|
|
2507
|
-
return get(element);
|
|
2508
|
-
}
|
|
2087
|
+
return el.querySelectorAll(selector);
|
|
2509
2088
|
}
|
|
2510
2089
|
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
return Array.prototype.slice.call(arr);
|
|
2090
|
+
function remove$1(el) {
|
|
2091
|
+
el.parentNode && el.parentNode.removeChild(el);
|
|
2514
2092
|
}
|
|
2515
2093
|
|
|
2516
2094
|
/**
|
|
@@ -2735,7 +2313,7 @@
|
|
|
2735
2313
|
config, eventBus, styles, pathMap,
|
|
2736
2314
|
canvas, textRenderer, priority) {
|
|
2737
2315
|
|
|
2738
|
-
BaseRenderer.call(this, eventBus, priority);
|
|
2316
|
+
BaseRenderer$1.call(this, eventBus, priority);
|
|
2739
2317
|
|
|
2740
2318
|
var defaultFillColor = config && config.defaultFillColor,
|
|
2741
2319
|
defaultStrokeColor = config && config.defaultStrokeColor,
|
|
@@ -2767,11 +2345,11 @@
|
|
|
2767
2345
|
|
|
2768
2346
|
var marker = create$2('marker');
|
|
2769
2347
|
|
|
2770
|
-
attr$
|
|
2348
|
+
attr$2(options.element, attrs);
|
|
2771
2349
|
|
|
2772
2350
|
append$1(marker, options.element);
|
|
2773
2351
|
|
|
2774
|
-
attr$
|
|
2352
|
+
attr$2(marker, {
|
|
2775
2353
|
id: id,
|
|
2776
2354
|
viewBox: '0 0 20 20',
|
|
2777
2355
|
refX: ref.x,
|
|
@@ -2814,7 +2392,7 @@
|
|
|
2814
2392
|
|
|
2815
2393
|
if (type === 'sequenceflow-end') {
|
|
2816
2394
|
var sequenceflowEnd = create$2('path');
|
|
2817
|
-
attr$
|
|
2395
|
+
attr$2(sequenceflowEnd, { d: 'M 1 5 L 11 10 L 1 15 Z' });
|
|
2818
2396
|
|
|
2819
2397
|
addMarker(id, {
|
|
2820
2398
|
element: sequenceflowEnd,
|
|
@@ -2829,7 +2407,7 @@
|
|
|
2829
2407
|
|
|
2830
2408
|
if (type === 'messageflow-start') {
|
|
2831
2409
|
var messageflowStart = create$2('circle');
|
|
2832
|
-
attr$
|
|
2410
|
+
attr$2(messageflowStart, { cx: 6, cy: 6, r: 3.5 });
|
|
2833
2411
|
|
|
2834
2412
|
addMarker(id, {
|
|
2835
2413
|
element: messageflowStart,
|
|
@@ -2843,7 +2421,7 @@
|
|
|
2843
2421
|
|
|
2844
2422
|
if (type === 'messageflow-end') {
|
|
2845
2423
|
var messageflowEnd = create$2('path');
|
|
2846
|
-
attr$
|
|
2424
|
+
attr$2(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
|
|
2847
2425
|
|
|
2848
2426
|
addMarker(id, {
|
|
2849
2427
|
element: messageflowEnd,
|
|
@@ -2858,7 +2436,7 @@
|
|
|
2858
2436
|
|
|
2859
2437
|
if (type === 'association-start') {
|
|
2860
2438
|
var associationStart = create$2('path');
|
|
2861
|
-
attr$
|
|
2439
|
+
attr$2(associationStart, { d: 'M 11 5 L 1 10 L 11 15' });
|
|
2862
2440
|
|
|
2863
2441
|
addMarker(id, {
|
|
2864
2442
|
element: associationStart,
|
|
@@ -2874,7 +2452,7 @@
|
|
|
2874
2452
|
|
|
2875
2453
|
if (type === 'association-end') {
|
|
2876
2454
|
var associationEnd = create$2('path');
|
|
2877
|
-
attr$
|
|
2455
|
+
attr$2(associationEnd, { d: 'M 1 5 L 11 10 L 1 15' });
|
|
2878
2456
|
|
|
2879
2457
|
addMarker(id, {
|
|
2880
2458
|
element: associationEnd,
|
|
@@ -2890,7 +2468,7 @@
|
|
|
2890
2468
|
|
|
2891
2469
|
if (type === 'conditional-flow-marker') {
|
|
2892
2470
|
var conditionalflowMarker = create$2('path');
|
|
2893
|
-
attr$
|
|
2471
|
+
attr$2(conditionalflowMarker, { d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z' });
|
|
2894
2472
|
|
|
2895
2473
|
addMarker(id, {
|
|
2896
2474
|
element: conditionalflowMarker,
|
|
@@ -2905,7 +2483,7 @@
|
|
|
2905
2483
|
|
|
2906
2484
|
if (type === 'conditional-default-flow-marker') {
|
|
2907
2485
|
var conditionaldefaultflowMarker = create$2('path');
|
|
2908
|
-
attr$
|
|
2486
|
+
attr$2(conditionaldefaultflowMarker, { d: 'M 6 4 L 10 16' });
|
|
2909
2487
|
|
|
2910
2488
|
addMarker(id, {
|
|
2911
2489
|
element: conditionaldefaultflowMarker,
|
|
@@ -2941,12 +2519,12 @@
|
|
|
2941
2519
|
cy = height / 2;
|
|
2942
2520
|
|
|
2943
2521
|
var circle = create$2('circle');
|
|
2944
|
-
attr$
|
|
2522
|
+
attr$2(circle, {
|
|
2945
2523
|
cx: cx,
|
|
2946
2524
|
cy: cy,
|
|
2947
2525
|
r: Math.round((width + height) / 4 - offset)
|
|
2948
2526
|
});
|
|
2949
|
-
attr$
|
|
2527
|
+
attr$2(circle, attrs);
|
|
2950
2528
|
|
|
2951
2529
|
append$1(parentGfx, circle);
|
|
2952
2530
|
|
|
@@ -2969,7 +2547,7 @@
|
|
|
2969
2547
|
});
|
|
2970
2548
|
|
|
2971
2549
|
var rect = create$2('rect');
|
|
2972
|
-
attr$
|
|
2550
|
+
attr$2(rect, {
|
|
2973
2551
|
x: offset,
|
|
2974
2552
|
y: offset,
|
|
2975
2553
|
width: width - offset * 2,
|
|
@@ -2977,7 +2555,7 @@
|
|
|
2977
2555
|
rx: r,
|
|
2978
2556
|
ry: r
|
|
2979
2557
|
});
|
|
2980
|
-
attr$
|
|
2558
|
+
attr$2(rect, attrs);
|
|
2981
2559
|
|
|
2982
2560
|
append$1(parentGfx, rect);
|
|
2983
2561
|
|
|
@@ -3002,10 +2580,10 @@
|
|
|
3002
2580
|
});
|
|
3003
2581
|
|
|
3004
2582
|
var polygon = create$2('polygon');
|
|
3005
|
-
attr$
|
|
2583
|
+
attr$2(polygon, {
|
|
3006
2584
|
points: pointsString
|
|
3007
2585
|
});
|
|
3008
|
-
attr$
|
|
2586
|
+
attr$2(polygon, attrs);
|
|
3009
2587
|
|
|
3010
2588
|
append$1(parentGfx, polygon);
|
|
3011
2589
|
|
|
@@ -3034,8 +2612,8 @@
|
|
|
3034
2612
|
});
|
|
3035
2613
|
|
|
3036
2614
|
var path = create$2('path');
|
|
3037
|
-
attr$
|
|
3038
|
-
attr$
|
|
2615
|
+
attr$2(path, { d: d });
|
|
2616
|
+
attr$2(path, attrs);
|
|
3039
2617
|
|
|
3040
2618
|
append$1(parentGfx, path);
|
|
3041
2619
|
|
|
@@ -3123,7 +2701,7 @@
|
|
|
3123
2701
|
|
|
3124
2702
|
var text = textRenderer.createText(label || '', options);
|
|
3125
2703
|
|
|
3126
|
-
classes(text).add('djs-label');
|
|
2704
|
+
classes$1(text).add('djs-label');
|
|
3127
2705
|
|
|
3128
2706
|
append$1(parentGfx, text);
|
|
3129
2707
|
|
|
@@ -3735,7 +3313,7 @@
|
|
|
3735
3313
|
});
|
|
3736
3314
|
|
|
3737
3315
|
var businessHeaderPath = drawPath(parentGfx, headerPathData);
|
|
3738
|
-
attr$
|
|
3316
|
+
attr$2(businessHeaderPath, {
|
|
3739
3317
|
strokeWidth: 1,
|
|
3740
3318
|
fill: getFillColor(element, '#aaaaaa'),
|
|
3741
3319
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
@@ -3749,7 +3327,7 @@
|
|
|
3749
3327
|
});
|
|
3750
3328
|
|
|
3751
3329
|
var businessPath = drawPath(parentGfx, headerData);
|
|
3752
|
-
attr$
|
|
3330
|
+
attr$2(businessPath, {
|
|
3753
3331
|
strokeWidth: 1,
|
|
3754
3332
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3755
3333
|
});
|
|
@@ -3767,7 +3345,7 @@
|
|
|
3767
3345
|
var expanded = isExpanded(element);
|
|
3768
3346
|
|
|
3769
3347
|
if (isEventSubProcess(element)) {
|
|
3770
|
-
attr$
|
|
3348
|
+
attr$2(rect, {
|
|
3771
3349
|
strokeDasharray: '1,2'
|
|
3772
3350
|
});
|
|
3773
3351
|
}
|
|
@@ -3989,7 +3567,7 @@
|
|
|
3989
3567
|
});
|
|
3990
3568
|
|
|
3991
3569
|
var parallelPath = drawPath(parentGfx, pathData);
|
|
3992
|
-
attr$
|
|
3570
|
+
attr$2(parallelPath, {
|
|
3993
3571
|
strokeWidth: 1,
|
|
3994
3572
|
fill: 'none'
|
|
3995
3573
|
});
|
|
@@ -3997,7 +3575,7 @@
|
|
|
3997
3575
|
|
|
3998
3576
|
if (!instantiate) {
|
|
3999
3577
|
var innerCircle = drawCircle(parentGfx, element.width, element.height, element.height * 0.26);
|
|
4000
|
-
attr$
|
|
3578
|
+
attr$2(innerCircle, {
|
|
4001
3579
|
strokeWidth: 1,
|
|
4002
3580
|
fill: 'none',
|
|
4003
3581
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
@@ -4042,7 +3620,7 @@
|
|
|
4042
3620
|
|
|
4043
3621
|
// conditional flow marker
|
|
4044
3622
|
if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Activity')) {
|
|
4045
|
-
attr$
|
|
3623
|
+
attr$2(path, {
|
|
4046
3624
|
markerStart: marker('conditional-flow-marker', fill, stroke)
|
|
4047
3625
|
});
|
|
4048
3626
|
}
|
|
@@ -4050,7 +3628,7 @@
|
|
|
4050
3628
|
// default marker
|
|
4051
3629
|
if (source.default && (source.$instanceOf('bpmn:Gateway') || source.$instanceOf('bpmn:Activity')) &&
|
|
4052
3630
|
source.default === sequenceFlow) {
|
|
4053
|
-
attr$
|
|
3631
|
+
attr$2(path, {
|
|
4054
3632
|
markerStart: marker('conditional-default-flow-marker', fill, stroke)
|
|
4055
3633
|
});
|
|
4056
3634
|
}
|
|
@@ -4540,7 +4118,7 @@
|
|
|
4540
4118
|
}
|
|
4541
4119
|
|
|
4542
4120
|
|
|
4543
|
-
e(BpmnRenderer, BaseRenderer);
|
|
4121
|
+
e(BpmnRenderer, BaseRenderer$1);
|
|
4544
4122
|
|
|
4545
4123
|
BpmnRenderer.$inject = [
|
|
4546
4124
|
'config.bpmnRenderer',
|
|
@@ -4768,9 +4346,9 @@
|
|
|
4768
4346
|
var helperSvg = document.getElementById('helper-svg');
|
|
4769
4347
|
|
|
4770
4348
|
if (!helperSvg) {
|
|
4771
|
-
helperSvg = create$
|
|
4349
|
+
helperSvg = create$2('svg');
|
|
4772
4350
|
|
|
4773
|
-
attr$
|
|
4351
|
+
attr$2(helperSvg, {
|
|
4774
4352
|
id: 'helper-svg'
|
|
4775
4353
|
});
|
|
4776
4354
|
|
|
@@ -4864,13 +4442,13 @@
|
|
|
4864
4442
|
var maxWidth = box.width - padding.left - padding.right;
|
|
4865
4443
|
|
|
4866
4444
|
// ensure correct rendering by attaching helper text node to invisible SVG
|
|
4867
|
-
var helperText = create$
|
|
4868
|
-
attr$
|
|
4869
|
-
attr$
|
|
4445
|
+
var helperText = create$2('text');
|
|
4446
|
+
attr$2(helperText, { x: 0, y: 0 });
|
|
4447
|
+
attr$2(helperText, style);
|
|
4870
4448
|
|
|
4871
4449
|
var helperSvg = getHelperSvg();
|
|
4872
4450
|
|
|
4873
|
-
append$
|
|
4451
|
+
append$1(helperSvg, helperText);
|
|
4874
4452
|
|
|
4875
4453
|
while (lines.length) {
|
|
4876
4454
|
layouted.push(layoutNext(lines, maxWidth, helperText));
|
|
@@ -4899,9 +4477,9 @@
|
|
|
4899
4477
|
y -= (lineHeight || layouted[0].height) / 4;
|
|
4900
4478
|
|
|
4901
4479
|
|
|
4902
|
-
var textElement = create$
|
|
4480
|
+
var textElement = create$2('text');
|
|
4903
4481
|
|
|
4904
|
-
attr$
|
|
4482
|
+
attr$2(textElement, style);
|
|
4905
4483
|
|
|
4906
4484
|
// layout each line taking into account that parent
|
|
4907
4485
|
// shape might resize to fit text size
|
|
@@ -4928,15 +4506,15 @@
|
|
|
4928
4506
|
- line.width) / 2 + padding.left), 0);
|
|
4929
4507
|
}
|
|
4930
4508
|
|
|
4931
|
-
var tspan = create$
|
|
4932
|
-
attr$
|
|
4509
|
+
var tspan = create$2('tspan');
|
|
4510
|
+
attr$2(tspan, { x: x, y: y });
|
|
4933
4511
|
|
|
4934
4512
|
tspan.textContent = line.text;
|
|
4935
4513
|
|
|
4936
|
-
append$
|
|
4514
|
+
append$1(textElement, tspan);
|
|
4937
4515
|
});
|
|
4938
4516
|
|
|
4939
|
-
remove$
|
|
4517
|
+
remove$2(helperText);
|
|
4940
4518
|
|
|
4941
4519
|
var dimensions = {
|
|
4942
4520
|
width: maxLineWidth,
|
|
@@ -6528,13 +6106,13 @@
|
|
|
6528
6106
|
throw new Error('invalid hit type <' + type + '>');
|
|
6529
6107
|
}
|
|
6530
6108
|
|
|
6531
|
-
attr$
|
|
6109
|
+
attr$2(hit, attrs);
|
|
6532
6110
|
|
|
6533
6111
|
return hit;
|
|
6534
6112
|
}
|
|
6535
6113
|
|
|
6536
6114
|
function appendHit(gfx, hit) {
|
|
6537
|
-
append$
|
|
6115
|
+
append$1(gfx, hit);
|
|
6538
6116
|
}
|
|
6539
6117
|
|
|
6540
6118
|
|
|
@@ -6548,7 +6126,7 @@
|
|
|
6548
6126
|
this.removeHits = function(gfx) {
|
|
6549
6127
|
var hits = all('.djs-hit', gfx);
|
|
6550
6128
|
|
|
6551
|
-
forEach$1(hits, remove$
|
|
6129
|
+
forEach$1(hits, remove$2);
|
|
6552
6130
|
};
|
|
6553
6131
|
|
|
6554
6132
|
/**
|
|
@@ -6612,11 +6190,11 @@
|
|
|
6612
6190
|
y: 0
|
|
6613
6191
|
}, attrs);
|
|
6614
6192
|
|
|
6615
|
-
var hit = create$
|
|
6193
|
+
var hit = create$2('rect');
|
|
6616
6194
|
|
|
6617
6195
|
applyStyle(hit, type);
|
|
6618
6196
|
|
|
6619
|
-
attr$
|
|
6197
|
+
attr$2(hit, attrs);
|
|
6620
6198
|
|
|
6621
6199
|
appendHit(gfx, hit);
|
|
6622
6200
|
|
|
@@ -6642,7 +6220,7 @@
|
|
|
6642
6220
|
if (element.waypoints) {
|
|
6643
6221
|
updateLine(hit, element.waypoints);
|
|
6644
6222
|
} else {
|
|
6645
|
-
attr$
|
|
6223
|
+
attr$2(hit, {
|
|
6646
6224
|
width: element.width,
|
|
6647
6225
|
height: element.height
|
|
6648
6226
|
});
|
|
@@ -6850,9 +6428,9 @@
|
|
|
6850
6428
|
var self = this;
|
|
6851
6429
|
|
|
6852
6430
|
function createOutline(gfx, bounds) {
|
|
6853
|
-
var outline = create$
|
|
6431
|
+
var outline = create$2('rect');
|
|
6854
6432
|
|
|
6855
|
-
attr$
|
|
6433
|
+
attr$2(outline, assign$1({
|
|
6856
6434
|
x: 10,
|
|
6857
6435
|
y: 10,
|
|
6858
6436
|
rx: 3,
|
|
@@ -6860,7 +6438,7 @@
|
|
|
6860
6438
|
height: 100
|
|
6861
6439
|
}, OUTLINE_STYLE));
|
|
6862
6440
|
|
|
6863
|
-
append$
|
|
6441
|
+
append$1(gfx, outline);
|
|
6864
6442
|
|
|
6865
6443
|
return outline;
|
|
6866
6444
|
}
|
|
@@ -6904,7 +6482,7 @@
|
|
|
6904
6482
|
*/
|
|
6905
6483
|
Outline.prototype.updateShapeOutline = function(outline, element) {
|
|
6906
6484
|
|
|
6907
|
-
attr$
|
|
6485
|
+
attr$2(outline, {
|
|
6908
6486
|
x: -this.offset,
|
|
6909
6487
|
y: -this.offset,
|
|
6910
6488
|
width: element.width + this.offset * 2,
|
|
@@ -6925,7 +6503,7 @@
|
|
|
6925
6503
|
|
|
6926
6504
|
var bbox = getBBox(connection);
|
|
6927
6505
|
|
|
6928
|
-
attr$
|
|
6506
|
+
attr$2(outline, {
|
|
6929
6507
|
x: bbox.x - this.offset,
|
|
6930
6508
|
y: bbox.y - this.offset,
|
|
6931
6509
|
width: bbox.width + this.offset * 2,
|
|
@@ -7129,13 +6707,13 @@
|
|
|
7129
6707
|
SelectionVisuals.prototype._updateSelectionOutline = function(selection) {
|
|
7130
6708
|
var layer = this._canvas.getLayer('selectionOutline');
|
|
7131
6709
|
|
|
7132
|
-
clear$
|
|
6710
|
+
clear$1(layer);
|
|
7133
6711
|
|
|
7134
6712
|
var enabled = selection.length > 1;
|
|
7135
6713
|
|
|
7136
6714
|
var container = this._canvas.getContainer();
|
|
7137
6715
|
|
|
7138
|
-
classes$
|
|
6716
|
+
classes$1(container)[enabled ? 'add' : 'remove']('djs-multi-select');
|
|
7139
6717
|
|
|
7140
6718
|
if (!enabled) {
|
|
7141
6719
|
return;
|
|
@@ -7143,15 +6721,15 @@
|
|
|
7143
6721
|
|
|
7144
6722
|
var bBox = addSelectionOutlinePadding(getBBox(selection));
|
|
7145
6723
|
|
|
7146
|
-
var rect = create$
|
|
6724
|
+
var rect = create$2('rect');
|
|
7147
6725
|
|
|
7148
|
-
attr$
|
|
6726
|
+
attr$2(rect, assign$1({
|
|
7149
6727
|
rx: 3
|
|
7150
6728
|
}, bBox));
|
|
7151
6729
|
|
|
7152
|
-
classes$
|
|
6730
|
+
classes$1(rect).add('djs-selection-outline');
|
|
7153
6731
|
|
|
7154
|
-
append$
|
|
6732
|
+
append$1(layer, rect);
|
|
7155
6733
|
};
|
|
7156
6734
|
|
|
7157
6735
|
// helpers //////////
|
|
@@ -7560,8 +7138,8 @@
|
|
|
7560
7138
|
var container = self._getOverlayContainer(overlay.element, true);
|
|
7561
7139
|
|
|
7562
7140
|
if (overlay) {
|
|
7563
|
-
remove$
|
|
7564
|
-
remove$
|
|
7141
|
+
remove$1(overlay.html);
|
|
7142
|
+
remove$1(overlay.htmlContainer);
|
|
7565
7143
|
|
|
7566
7144
|
delete overlay.htmlContainer;
|
|
7567
7145
|
delete overlay.element;
|
|
@@ -7594,7 +7172,7 @@
|
|
|
7594
7172
|
|
|
7595
7173
|
this._overlayContainers = [];
|
|
7596
7174
|
|
|
7597
|
-
clear
|
|
7175
|
+
clear(this._overlayRoot);
|
|
7598
7176
|
};
|
|
7599
7177
|
|
|
7600
7178
|
Overlays.prototype._updateOverlayContainer = function(container) {
|
|
@@ -7615,7 +7193,7 @@
|
|
|
7615
7193
|
|
|
7616
7194
|
setPosition(html, x, y);
|
|
7617
7195
|
|
|
7618
|
-
attr$
|
|
7196
|
+
attr$1(container.html, 'data-container-id', element.id);
|
|
7619
7197
|
};
|
|
7620
7198
|
|
|
7621
7199
|
|
|
@@ -7742,7 +7320,7 @@
|
|
|
7742
7320
|
htmlContainer.appendChild(html);
|
|
7743
7321
|
|
|
7744
7322
|
if (overlay.type) {
|
|
7745
|
-
classes
|
|
7323
|
+
classes(htmlContainer).add('djs-overlay-' + overlay.type);
|
|
7746
7324
|
}
|
|
7747
7325
|
|
|
7748
7326
|
var elementRoot = this._canvas.findRoot(element);
|
|
@@ -7871,7 +7449,7 @@
|
|
|
7871
7449
|
var container = self._getOverlayContainer(element);
|
|
7872
7450
|
|
|
7873
7451
|
if (container) {
|
|
7874
|
-
remove$
|
|
7452
|
+
remove$1(container.html);
|
|
7875
7453
|
var i = self._overlayContainers.indexOf(container);
|
|
7876
7454
|
if (i !== -1) {
|
|
7877
7455
|
self._overlayContainers.splice(i, 1);
|
|
@@ -7902,7 +7480,7 @@
|
|
|
7902
7480
|
eventBus.on('element.marker.update', function(e) {
|
|
7903
7481
|
var container = self._getOverlayContainer(e.element, true);
|
|
7904
7482
|
if (container) {
|
|
7905
|
-
classes
|
|
7483
|
+
classes(container.html)[e.add ? 'add' : 'remove'](e.marker);
|
|
7906
7484
|
}
|
|
7907
7485
|
});
|
|
7908
7486
|
|
|
@@ -8367,7 +7945,7 @@
|
|
|
8367
7945
|
function DrilldownBreadcrumbs(eventBus, elementRegistry, overlays, canvas) {
|
|
8368
7946
|
var breadcrumbs = domify$1('<ul class="bjs-breadcrumbs"></ul>');
|
|
8369
7947
|
var container = canvas.getContainer();
|
|
8370
|
-
var containerClasses = classes
|
|
7948
|
+
var containerClasses = classes(container);
|
|
8371
7949
|
container.appendChild(breadcrumbs);
|
|
8372
7950
|
|
|
8373
7951
|
var boParents = [];
|
|
@@ -8923,7 +8501,7 @@
|
|
|
8923
8501
|
}
|
|
8924
8502
|
|
|
8925
8503
|
var hasContent = bo && bo.flowElements && bo.flowElements.length;
|
|
8926
|
-
classes
|
|
8504
|
+
classes(overlay.html).toggle(EMPTY_MARKER, !hasContent);
|
|
8927
8505
|
};
|
|
8928
8506
|
|
|
8929
8507
|
/**
|
|
@@ -9449,7 +9027,7 @@
|
|
|
9449
9027
|
|
|
9450
9028
|
// apply default renderer with lowest possible priority
|
|
9451
9029
|
// so that it only kicks in if noone else could render
|
|
9452
|
-
var DEFAULT_RENDER_PRIORITY = 1;
|
|
9030
|
+
var DEFAULT_RENDER_PRIORITY$1 = 1;
|
|
9453
9031
|
|
|
9454
9032
|
/**
|
|
9455
9033
|
* The default renderer used for shapes and connections.
|
|
@@ -9460,14 +9038,14 @@
|
|
|
9460
9038
|
function DefaultRenderer(eventBus, styles) {
|
|
9461
9039
|
|
|
9462
9040
|
//
|
|
9463
|
-
BaseRenderer.call(this, eventBus, DEFAULT_RENDER_PRIORITY);
|
|
9041
|
+
BaseRenderer$1.call(this, eventBus, DEFAULT_RENDER_PRIORITY$1);
|
|
9464
9042
|
|
|
9465
9043
|
this.CONNECTION_STYLE = styles.style([ 'no-fill' ], { strokeWidth: 5, stroke: 'fuchsia' });
|
|
9466
9044
|
this.SHAPE_STYLE = styles.style({ fill: 'white', stroke: 'fuchsia', strokeWidth: 2 });
|
|
9467
9045
|
this.FRAME_STYLE = styles.style([ 'no-fill' ], { stroke: 'fuchsia', strokeDasharray: 4, strokeWidth: 2 });
|
|
9468
9046
|
}
|
|
9469
9047
|
|
|
9470
|
-
e(DefaultRenderer, BaseRenderer);
|
|
9048
|
+
e(DefaultRenderer, BaseRenderer$1);
|
|
9471
9049
|
|
|
9472
9050
|
|
|
9473
9051
|
DefaultRenderer.prototype.canRender = function() {
|
|
@@ -9475,9 +9053,9 @@
|
|
|
9475
9053
|
};
|
|
9476
9054
|
|
|
9477
9055
|
DefaultRenderer.prototype.drawShape = function drawShape(visuals, element, attrs) {
|
|
9478
|
-
var rect = create$
|
|
9056
|
+
var rect = create$2('rect');
|
|
9479
9057
|
|
|
9480
|
-
attr$
|
|
9058
|
+
attr$2(rect, {
|
|
9481
9059
|
x: 0,
|
|
9482
9060
|
y: 0,
|
|
9483
9061
|
width: element.width || 0,
|
|
@@ -9485,12 +9063,12 @@
|
|
|
9485
9063
|
});
|
|
9486
9064
|
|
|
9487
9065
|
if (isFrameElement(element)) {
|
|
9488
|
-
attr$
|
|
9066
|
+
attr$2(rect, assign$1({}, this.FRAME_STYLE, attrs || {}));
|
|
9489
9067
|
} else {
|
|
9490
|
-
attr$
|
|
9068
|
+
attr$2(rect, assign$1({}, this.SHAPE_STYLE, attrs || {}));
|
|
9491
9069
|
}
|
|
9492
9070
|
|
|
9493
|
-
append$
|
|
9071
|
+
append$1(visuals, rect);
|
|
9494
9072
|
|
|
9495
9073
|
return rect;
|
|
9496
9074
|
};
|
|
@@ -9498,7 +9076,7 @@
|
|
|
9498
9076
|
DefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) {
|
|
9499
9077
|
|
|
9500
9078
|
var line = createLine(connection.waypoints, assign$1({}, this.CONNECTION_STYLE, attrs || {}));
|
|
9501
|
-
append$
|
|
9079
|
+
append$1(visuals, line);
|
|
9502
9080
|
|
|
9503
9081
|
return line;
|
|
9504
9082
|
};
|
|
@@ -9736,8 +9314,8 @@
|
|
|
9736
9314
|
}
|
|
9737
9315
|
|
|
9738
9316
|
function createGroup(parent, cls, childIndex) {
|
|
9739
|
-
const group = create$
|
|
9740
|
-
classes$
|
|
9317
|
+
const group = create$2('g');
|
|
9318
|
+
classes$1(group).add(cls);
|
|
9741
9319
|
|
|
9742
9320
|
const index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;
|
|
9743
9321
|
|
|
@@ -9815,10 +9393,10 @@
|
|
|
9815
9393
|
// html container
|
|
9816
9394
|
const container = this._container = createContainer(config);
|
|
9817
9395
|
|
|
9818
|
-
const svg = this._svg = create$
|
|
9819
|
-
attr$
|
|
9396
|
+
const svg = this._svg = create$2('svg');
|
|
9397
|
+
attr$2(svg, { width: '100%', height: '100%' });
|
|
9820
9398
|
|
|
9821
|
-
append$
|
|
9399
|
+
append$1(container, svg);
|
|
9822
9400
|
|
|
9823
9401
|
const viewport = this._viewport = createGroup(svg, 'viewport');
|
|
9824
9402
|
|
|
@@ -10056,7 +9634,7 @@
|
|
|
10056
9634
|
return group;
|
|
10057
9635
|
}
|
|
10058
9636
|
|
|
10059
|
-
remove$
|
|
9637
|
+
remove$2(group);
|
|
10060
9638
|
|
|
10061
9639
|
layer.visible = false;
|
|
10062
9640
|
|
|
@@ -10071,7 +9649,7 @@
|
|
|
10071
9649
|
if (layer) {
|
|
10072
9650
|
delete this._layers[name];
|
|
10073
9651
|
|
|
10074
|
-
remove$
|
|
9652
|
+
remove$2(layer.group);
|
|
10075
9653
|
}
|
|
10076
9654
|
};
|
|
10077
9655
|
|
|
@@ -10164,9 +9742,9 @@
|
|
|
10164
9742
|
|
|
10165
9743
|
// invoke either addClass or removeClass based on mode
|
|
10166
9744
|
if (add) {
|
|
10167
|
-
classes$
|
|
9745
|
+
classes$1(gfx).add(marker);
|
|
10168
9746
|
} else {
|
|
10169
|
-
classes$
|
|
9747
|
+
classes$1(gfx).remove(marker);
|
|
10170
9748
|
}
|
|
10171
9749
|
}
|
|
10172
9750
|
});
|
|
@@ -10232,7 +9810,7 @@
|
|
|
10232
9810
|
|
|
10233
9811
|
const gfx = this.getGraphics(element);
|
|
10234
9812
|
|
|
10235
|
-
return classes$
|
|
9813
|
+
return classes$1(gfx).has(marker);
|
|
10236
9814
|
};
|
|
10237
9815
|
|
|
10238
9816
|
/**
|
|
@@ -11130,10 +10708,10 @@
|
|
|
11130
10708
|
this._validateId(id);
|
|
11131
10709
|
|
|
11132
10710
|
// associate dom node with element
|
|
11133
|
-
attr$
|
|
10711
|
+
attr$2(gfx, ELEMENT_ID, id);
|
|
11134
10712
|
|
|
11135
10713
|
if (secondaryGfx) {
|
|
11136
|
-
attr$
|
|
10714
|
+
attr$2(secondaryGfx, ELEMENT_ID, id);
|
|
11137
10715
|
}
|
|
11138
10716
|
|
|
11139
10717
|
this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };
|
|
@@ -11152,10 +10730,10 @@
|
|
|
11152
10730
|
if (container) {
|
|
11153
10731
|
|
|
11154
10732
|
// unset element id on gfx
|
|
11155
|
-
attr$
|
|
10733
|
+
attr$2(container.gfx, ELEMENT_ID, '');
|
|
11156
10734
|
|
|
11157
10735
|
if (container.secondaryGfx) {
|
|
11158
|
-
attr$
|
|
10736
|
+
attr$2(container.secondaryGfx, ELEMENT_ID, '');
|
|
11159
10737
|
}
|
|
11160
10738
|
|
|
11161
10739
|
delete elements[id];
|
|
@@ -11210,7 +10788,7 @@
|
|
|
11210
10788
|
}
|
|
11211
10789
|
|
|
11212
10790
|
if (gfx) {
|
|
11213
|
-
attr$
|
|
10791
|
+
attr$2(gfx, ELEMENT_ID, id);
|
|
11214
10792
|
}
|
|
11215
10793
|
|
|
11216
10794
|
return gfx;
|
|
@@ -11235,7 +10813,7 @@
|
|
|
11235
10813
|
if (typeof filter === 'string') {
|
|
11236
10814
|
id = filter;
|
|
11237
10815
|
} else {
|
|
11238
|
-
id = filter && attr$
|
|
10816
|
+
id = filter && attr$2(filter, ELEMENT_ID);
|
|
11239
10817
|
}
|
|
11240
10818
|
|
|
11241
10819
|
var container = this._elements[id];
|
|
@@ -12518,10 +12096,10 @@
|
|
|
12518
12096
|
} else {
|
|
12519
12097
|
childrenGfx = getChildren(gfx);
|
|
12520
12098
|
if (!childrenGfx) {
|
|
12521
|
-
childrenGfx = create$
|
|
12522
|
-
classes$
|
|
12099
|
+
childrenGfx = create$2('g');
|
|
12100
|
+
classes$1(childrenGfx).add('djs-children');
|
|
12523
12101
|
|
|
12524
|
-
append$
|
|
12102
|
+
append$1(gfx.parentNode, childrenGfx);
|
|
12525
12103
|
}
|
|
12526
12104
|
}
|
|
12527
12105
|
|
|
@@ -12535,7 +12113,7 @@
|
|
|
12535
12113
|
GraphicsFactory.prototype._clear = function(gfx) {
|
|
12536
12114
|
var visual = getVisual(gfx);
|
|
12537
12115
|
|
|
12538
|
-
clear
|
|
12116
|
+
clear(visual);
|
|
12539
12117
|
|
|
12540
12118
|
return visual;
|
|
12541
12119
|
};
|
|
@@ -12570,31 +12148,31 @@
|
|
|
12570
12148
|
GraphicsFactory.prototype._createContainer = function(
|
|
12571
12149
|
type, childrenGfx, parentIndex, isFrame
|
|
12572
12150
|
) {
|
|
12573
|
-
var outerGfx = create$
|
|
12574
|
-
classes$
|
|
12151
|
+
var outerGfx = create$2('g');
|
|
12152
|
+
classes$1(outerGfx).add('djs-group');
|
|
12575
12153
|
|
|
12576
12154
|
// insert node at position
|
|
12577
12155
|
if (typeof parentIndex !== 'undefined') {
|
|
12578
12156
|
prependTo(outerGfx, childrenGfx, childrenGfx.childNodes[parentIndex]);
|
|
12579
12157
|
} else {
|
|
12580
|
-
append$
|
|
12158
|
+
append$1(childrenGfx, outerGfx);
|
|
12581
12159
|
}
|
|
12582
12160
|
|
|
12583
|
-
var gfx = create$
|
|
12584
|
-
classes$
|
|
12585
|
-
classes$
|
|
12161
|
+
var gfx = create$2('g');
|
|
12162
|
+
classes$1(gfx).add('djs-element');
|
|
12163
|
+
classes$1(gfx).add('djs-' + type);
|
|
12586
12164
|
|
|
12587
12165
|
if (isFrame) {
|
|
12588
|
-
classes$
|
|
12166
|
+
classes$1(gfx).add('djs-frame');
|
|
12589
12167
|
}
|
|
12590
12168
|
|
|
12591
|
-
append$
|
|
12169
|
+
append$1(outerGfx, gfx);
|
|
12592
12170
|
|
|
12593
12171
|
// create visual
|
|
12594
|
-
var visual = create$
|
|
12595
|
-
classes$
|
|
12172
|
+
var visual = create$2('g');
|
|
12173
|
+
classes$1(visual).add('djs-visual');
|
|
12596
12174
|
|
|
12597
|
-
append$
|
|
12175
|
+
append$1(gfx, visual);
|
|
12598
12176
|
|
|
12599
12177
|
return gfx;
|
|
12600
12178
|
};
|
|
@@ -12686,9 +12264,9 @@
|
|
|
12686
12264
|
}
|
|
12687
12265
|
|
|
12688
12266
|
if (element.hidden) {
|
|
12689
|
-
attr$
|
|
12267
|
+
attr$2(gfx, 'display', 'none');
|
|
12690
12268
|
} else {
|
|
12691
|
-
attr$
|
|
12269
|
+
attr$2(gfx, 'display', 'block');
|
|
12692
12270
|
}
|
|
12693
12271
|
};
|
|
12694
12272
|
|
|
@@ -12696,7 +12274,7 @@
|
|
|
12696
12274
|
var gfx = this._elementRegistry.getGraphics(element);
|
|
12697
12275
|
|
|
12698
12276
|
// remove
|
|
12699
|
-
remove$
|
|
12277
|
+
remove$2(gfx.parentNode);
|
|
12700
12278
|
};
|
|
12701
12279
|
|
|
12702
12280
|
|
|
@@ -21713,7 +21291,7 @@
|
|
|
21713
21291
|
Diagram.prototype.destroy.call(this);
|
|
21714
21292
|
|
|
21715
21293
|
// dom detach
|
|
21716
|
-
remove$
|
|
21294
|
+
remove$1(this._container);
|
|
21717
21295
|
};
|
|
21718
21296
|
|
|
21719
21297
|
/**
|
|
@@ -22562,12 +22140,12 @@
|
|
|
22562
22140
|
|
|
22563
22141
|
|
|
22564
22142
|
function set(mode) {
|
|
22565
|
-
var classes = classes
|
|
22143
|
+
var classes$1 = classes(document.body);
|
|
22566
22144
|
|
|
22567
|
-
classes.removeMatching(CURSOR_CLS_PATTERN);
|
|
22145
|
+
classes$1.removeMatching(CURSOR_CLS_PATTERN);
|
|
22568
22146
|
|
|
22569
22147
|
if (mode) {
|
|
22570
|
-
classes.add('djs-cursor-' + mode);
|
|
22148
|
+
classes$1.add('djs-cursor-' + mode);
|
|
22571
22149
|
}
|
|
22572
22150
|
}
|
|
22573
22151
|
|
|
@@ -23000,6 +22578,93 @@
|
|
|
23000
22578
|
NavigatedViewer$1.prototype._navigationModules
|
|
23001
22579
|
);
|
|
23002
22580
|
|
|
22581
|
+
var DEFAULT_RENDER_PRIORITY = 1000;
|
|
22582
|
+
|
|
22583
|
+
/**
|
|
22584
|
+
* The base implementation of shape and connection renderers.
|
|
22585
|
+
*
|
|
22586
|
+
* @param {EventBus} eventBus
|
|
22587
|
+
* @param {number} [renderPriority=1000]
|
|
22588
|
+
*/
|
|
22589
|
+
function BaseRenderer(eventBus, renderPriority) {
|
|
22590
|
+
var self = this;
|
|
22591
|
+
|
|
22592
|
+
renderPriority = renderPriority || DEFAULT_RENDER_PRIORITY;
|
|
22593
|
+
|
|
22594
|
+
eventBus.on([ 'render.shape', 'render.connection' ], renderPriority, function(evt, context) {
|
|
22595
|
+
var type = evt.type,
|
|
22596
|
+
element = context.element,
|
|
22597
|
+
visuals = context.gfx,
|
|
22598
|
+
attrs = context.attrs;
|
|
22599
|
+
|
|
22600
|
+
if (self.canRender(element)) {
|
|
22601
|
+
if (type === 'render.shape') {
|
|
22602
|
+
return self.drawShape(visuals, element, attrs);
|
|
22603
|
+
} else {
|
|
22604
|
+
return self.drawConnection(visuals, element, attrs);
|
|
22605
|
+
}
|
|
22606
|
+
}
|
|
22607
|
+
});
|
|
22608
|
+
|
|
22609
|
+
eventBus.on([ 'render.getShapePath', 'render.getConnectionPath' ], renderPriority, function(evt, element) {
|
|
22610
|
+
if (self.canRender(element)) {
|
|
22611
|
+
if (evt.type === 'render.getShapePath') {
|
|
22612
|
+
return self.getShapePath(element);
|
|
22613
|
+
} else {
|
|
22614
|
+
return self.getConnectionPath(element);
|
|
22615
|
+
}
|
|
22616
|
+
}
|
|
22617
|
+
});
|
|
22618
|
+
}
|
|
22619
|
+
|
|
22620
|
+
/**
|
|
22621
|
+
* Should check whether *this* renderer can render
|
|
22622
|
+
* the element/connection.
|
|
22623
|
+
*
|
|
22624
|
+
* @param {element} element
|
|
22625
|
+
*
|
|
22626
|
+
* @returns {boolean}
|
|
22627
|
+
*/
|
|
22628
|
+
BaseRenderer.prototype.canRender = function() {};
|
|
22629
|
+
|
|
22630
|
+
/**
|
|
22631
|
+
* Provides the shape's snap svg element to be drawn on the `canvas`.
|
|
22632
|
+
*
|
|
22633
|
+
* @param {djs.Graphics} visuals
|
|
22634
|
+
* @param {Shape} shape
|
|
22635
|
+
*
|
|
22636
|
+
* @returns {Snap.svg} [returns a Snap.svg paper element ]
|
|
22637
|
+
*/
|
|
22638
|
+
BaseRenderer.prototype.drawShape = function() {};
|
|
22639
|
+
|
|
22640
|
+
/**
|
|
22641
|
+
* Provides the shape's snap svg element to be drawn on the `canvas`.
|
|
22642
|
+
*
|
|
22643
|
+
* @param {djs.Graphics} visuals
|
|
22644
|
+
* @param {Connection} connection
|
|
22645
|
+
*
|
|
22646
|
+
* @returns {Snap.svg} [returns a Snap.svg paper element ]
|
|
22647
|
+
*/
|
|
22648
|
+
BaseRenderer.prototype.drawConnection = function() {};
|
|
22649
|
+
|
|
22650
|
+
/**
|
|
22651
|
+
* Gets the SVG path of a shape that represents it's visual bounds.
|
|
22652
|
+
*
|
|
22653
|
+
* @param {Shape} shape
|
|
22654
|
+
*
|
|
22655
|
+
* @return {string} svg path
|
|
22656
|
+
*/
|
|
22657
|
+
BaseRenderer.prototype.getShapePath = function() {};
|
|
22658
|
+
|
|
22659
|
+
/**
|
|
22660
|
+
* Gets the SVG path of a connection that represents it's visual bounds.
|
|
22661
|
+
*
|
|
22662
|
+
* @param {Connection} connection
|
|
22663
|
+
*
|
|
22664
|
+
* @return {string} svg path
|
|
22665
|
+
*/
|
|
22666
|
+
BaseRenderer.prototype.getConnectionPath = function() {};
|
|
22667
|
+
|
|
23003
22668
|
function ensureImported(element, target) {
|
|
23004
22669
|
|
|
23005
22670
|
if (element.ownerDocument !== target.ownerDocument) {
|
|
@@ -23326,10 +22991,6 @@
|
|
|
23326
22991
|
elementTemplatesIconsRenderer: [ 'type', IconsRenderer ]
|
|
23327
22992
|
};
|
|
23328
22993
|
|
|
23329
|
-
var drilldownModule = {
|
|
23330
|
-
drilldownOverlayBehavior: [ 'value', null ],
|
|
23331
|
-
};
|
|
23332
|
-
|
|
23333
22994
|
var name = "zeebe";
|
|
23334
22995
|
var prefix = "zeebe";
|
|
23335
22996
|
var uri = "http://camunda.org/schema/zeebe/1.0";
|
|
@@ -23744,7 +23405,6 @@
|
|
|
23744
23405
|
};
|
|
23745
23406
|
|
|
23746
23407
|
const commonModules = [
|
|
23747
|
-
drilldownModule,
|
|
23748
23408
|
iconRendererModule
|
|
23749
23409
|
];
|
|
23750
23410
|
|