bpmn-js 0.28.3 → 0.31.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/CHANGELOG.md +21 -0
- package/dist/bpmn-modeler.development.js +850 -793
- package/dist/bpmn-modeler.production.min.js +2 -2
- package/dist/bpmn-navigated-viewer.development.js +761 -700
- package/dist/bpmn-navigated-viewer.production.min.js +2 -2
- package/dist/bpmn-viewer.development.js +760 -699
- package/dist/bpmn-viewer.production.min.js +2 -2
- package/lib/Viewer.js +1 -1
- package/lib/draw/BpmnRenderer.js +4 -4
- package/lib/features/label-editing/LabelEditingPreview.js +4 -4
- package/lib/features/replace-preview/BpmnReplacePreview.js +1 -1
- package/package.json +6 -6
- package/test/util/MockEvents.js +13 -17
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* bpmn-js - bpmn-viewer v0.
|
|
2
|
+
* bpmn-js - bpmn-viewer v0.31.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2014-present, camunda Services GmbH
|
|
5
5
|
*
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Source Code: https://github.com/bpmn-io/bpmn-js
|
|
10
10
|
*
|
|
11
|
-
* Date: 2018-
|
|
11
|
+
* Date: 2018-04-02
|
|
12
12
|
*/
|
|
13
|
-
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.BpmnJS = f()}})(function(){var define,module,exports;return (function(){function e
|
|
13
|
+
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.BpmnJS = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){
|
|
14
14
|
/**
|
|
15
15
|
* The code in the <project-logo></project-logo> area
|
|
16
16
|
* must not be changed.
|
|
@@ -27,7 +27,7 @@ var domify = _dereq_(64).domify,
|
|
|
27
27
|
domQuery = _dereq_(64).query,
|
|
28
28
|
domRemove = _dereq_(64).remove;
|
|
29
29
|
|
|
30
|
-
var innerSVG = _dereq_(
|
|
30
|
+
var innerSVG = _dereq_(82).innerSVG;
|
|
31
31
|
|
|
32
32
|
var Diagram = _dereq_(24),
|
|
33
33
|
BpmnModdle = _dereq_(16);
|
|
@@ -520,7 +520,7 @@ function addProjectLogo(container) {
|
|
|
520
520
|
|
|
521
521
|
/* </project-logo> */
|
|
522
522
|
|
|
523
|
-
},{"15":15,"16":16,"2":2,"24":24,"41":41,"45":45,"46":46,"62":62,"63":63,"64":64,"
|
|
523
|
+
},{"15":15,"16":16,"2":2,"24":24,"41":41,"45":45,"46":46,"62":62,"63":63,"64":64,"82":82,"9":9}],2:[function(_dereq_,module,exports){
|
|
524
524
|
module.exports = {
|
|
525
525
|
__depends__: [
|
|
526
526
|
_dereq_(6),
|
|
@@ -723,10 +723,10 @@ var getCirclePath = BpmnRenderUtil.getCirclePath,
|
|
|
723
723
|
|
|
724
724
|
var domQuery = _dereq_(64).query;
|
|
725
725
|
|
|
726
|
-
var svgAppend = _dereq_(82),
|
|
727
|
-
svgAttr = _dereq_(
|
|
728
|
-
svgCreate = _dereq_(
|
|
729
|
-
svgClasses = _dereq_(
|
|
726
|
+
var svgAppend = _dereq_(82).append,
|
|
727
|
+
svgAttr = _dereq_(82).attr,
|
|
728
|
+
svgCreate = _dereq_(82).create,
|
|
729
|
+
svgClasses = _dereq_(82).classes;
|
|
730
730
|
|
|
731
731
|
var rotate = _dereq_(57).rotate,
|
|
732
732
|
transform = _dereq_(57).transform,
|
|
@@ -2513,7 +2513,7 @@ BpmnRenderer.prototype.getShapePath = function(element) {
|
|
|
2513
2513
|
return getRectPath(element);
|
|
2514
2514
|
};
|
|
2515
2515
|
|
|
2516
|
-
},{"12":12,"14":14,"3":3,"32":32,"56":56,"57":57,"58":58,"61":61,"62":62,"63":63,"64":64,"82":82
|
|
2516
|
+
},{"12":12,"14":14,"3":3,"32":32,"56":56,"57":57,"58":58,"61":61,"62":62,"63":63,"64":64,"82":82}],5:[function(_dereq_,module,exports){
|
|
2517
2517
|
'use strict';
|
|
2518
2518
|
|
|
2519
2519
|
/**
|
|
@@ -8045,13 +8045,13 @@ var isNumber = _dereq_(63).isNumber,
|
|
|
8045
8045
|
var Collections = _dereq_(49),
|
|
8046
8046
|
Elements = _dereq_(50);
|
|
8047
8047
|
|
|
8048
|
-
var svgAppend = _dereq_(82),
|
|
8049
|
-
svgAttr = _dereq_(
|
|
8050
|
-
svgClasses = _dereq_(
|
|
8051
|
-
svgCreate = _dereq_(
|
|
8052
|
-
svgTransform = _dereq_(
|
|
8048
|
+
var svgAppend = _dereq_(82).append,
|
|
8049
|
+
svgAttr = _dereq_(82).attr,
|
|
8050
|
+
svgClasses = _dereq_(82).classes,
|
|
8051
|
+
svgCreate = _dereq_(82).create,
|
|
8052
|
+
svgTransform = _dereq_(82).transform;
|
|
8053
8053
|
|
|
8054
|
-
var createMatrix = _dereq_(
|
|
8054
|
+
var createMatrix = _dereq_(82).createMatrix;
|
|
8055
8055
|
|
|
8056
8056
|
|
|
8057
8057
|
function round(number, resolution) {
|
|
@@ -9077,7 +9077,7 @@ Canvas.prototype.resized = function() {
|
|
|
9077
9077
|
this._eventBus.fire('canvas.resized');
|
|
9078
9078
|
};
|
|
9079
9079
|
|
|
9080
|
-
},{"49":49,"50":50,"63":63,"82":82
|
|
9080
|
+
},{"49":49,"50":50,"63":63,"82":82}],27:[function(_dereq_,module,exports){
|
|
9081
9081
|
'use strict';
|
|
9082
9082
|
|
|
9083
9083
|
var Model = _dereq_(48);
|
|
@@ -9133,7 +9133,7 @@ ElementFactory.prototype.create = function(type, attrs) {
|
|
|
9133
9133
|
|
|
9134
9134
|
var ELEMENT_ID = 'data-element-id';
|
|
9135
9135
|
|
|
9136
|
-
var svgAttr = _dereq_(
|
|
9136
|
+
var svgAttr = _dereq_(82).attr;
|
|
9137
9137
|
|
|
9138
9138
|
|
|
9139
9139
|
/**
|
|
@@ -9339,7 +9339,7 @@ ElementRegistry.prototype._validateId = function(id) {
|
|
|
9339
9339
|
}
|
|
9340
9340
|
};
|
|
9341
9341
|
|
|
9342
|
-
},{"
|
|
9342
|
+
},{"82":82}],29:[function(_dereq_,module,exports){
|
|
9343
9343
|
'use strict';
|
|
9344
9344
|
|
|
9345
9345
|
var isFunction = _dereq_(63).isFunction,
|
|
@@ -9565,6 +9565,22 @@ EventBus.prototype.off = function(event, callback) {
|
|
|
9565
9565
|
};
|
|
9566
9566
|
|
|
9567
9567
|
|
|
9568
|
+
/**
|
|
9569
|
+
* Create an EventBus event.
|
|
9570
|
+
*
|
|
9571
|
+
* @param {Object} data
|
|
9572
|
+
*
|
|
9573
|
+
* @return {Object} event, recognized by the eventBus
|
|
9574
|
+
*/
|
|
9575
|
+
EventBus.prototype.createEvent = function(data) {
|
|
9576
|
+
var event = new InternalEvent();
|
|
9577
|
+
|
|
9578
|
+
event.init(data);
|
|
9579
|
+
|
|
9580
|
+
return event;
|
|
9581
|
+
};
|
|
9582
|
+
|
|
9583
|
+
|
|
9568
9584
|
/**
|
|
9569
9585
|
* Fires a named event.
|
|
9570
9586
|
*
|
|
@@ -9621,12 +9637,11 @@ EventBus.prototype.fire = function(type, data) {
|
|
|
9621
9637
|
|
|
9622
9638
|
// we make sure we fire instances of our home made
|
|
9623
9639
|
// events here. We wrap them only once, though
|
|
9624
|
-
if (data instanceof
|
|
9640
|
+
if (data instanceof InternalEvent) {
|
|
9625
9641
|
// we are fine, we alread have an event
|
|
9626
9642
|
event = data;
|
|
9627
9643
|
} else {
|
|
9628
|
-
event =
|
|
9629
|
-
event.init(data);
|
|
9644
|
+
event = this.createEvent(data);
|
|
9630
9645
|
}
|
|
9631
9646
|
|
|
9632
9647
|
// ensure we pass the event as the first parameter
|
|
@@ -9768,19 +9783,17 @@ EventBus.prototype._getListeners = function(name) {
|
|
|
9768
9783
|
/**
|
|
9769
9784
|
* A event that is emitted via the event bus.
|
|
9770
9785
|
*/
|
|
9771
|
-
function
|
|
9772
|
-
|
|
9773
|
-
module.exports.Event = Event;
|
|
9786
|
+
function InternalEvent() { }
|
|
9774
9787
|
|
|
9775
|
-
|
|
9788
|
+
InternalEvent.prototype.stopPropagation = function() {
|
|
9776
9789
|
this.cancelBubble = true;
|
|
9777
9790
|
};
|
|
9778
9791
|
|
|
9779
|
-
|
|
9792
|
+
InternalEvent.prototype.preventDefault = function() {
|
|
9780
9793
|
this.defaultPrevented = true;
|
|
9781
9794
|
};
|
|
9782
9795
|
|
|
9783
|
-
|
|
9796
|
+
InternalEvent.prototype.init = function(data) {
|
|
9784
9797
|
assign(this, data || {});
|
|
9785
9798
|
};
|
|
9786
9799
|
|
|
@@ -9809,11 +9822,11 @@ var translate = _dereq_(57).translate;
|
|
|
9809
9822
|
|
|
9810
9823
|
var domClear = _dereq_(64).clear;
|
|
9811
9824
|
|
|
9812
|
-
var svgAppend = _dereq_(82),
|
|
9813
|
-
svgAttr = _dereq_(
|
|
9814
|
-
svgClasses = _dereq_(
|
|
9815
|
-
svgCreate = _dereq_(
|
|
9816
|
-
svgRemove = _dereq_(
|
|
9825
|
+
var svgAppend = _dereq_(82).append,
|
|
9826
|
+
svgAttr = _dereq_(82).attr,
|
|
9827
|
+
svgClasses = _dereq_(82).classes,
|
|
9828
|
+
svgCreate = _dereq_(82).create,
|
|
9829
|
+
svgRemove = _dereq_(82).remove;
|
|
9817
9830
|
|
|
9818
9831
|
|
|
9819
9832
|
/**
|
|
@@ -10022,7 +10035,7 @@ function prependTo(newNode, parentNode, siblingNode) {
|
|
|
10022
10035
|
parentNode.insertBefore(newNode, siblingNode || parentNode.firstChild);
|
|
10023
10036
|
}
|
|
10024
10037
|
|
|
10025
|
-
},{"52":52,"57":57,"63":63,"64":64,"82":82
|
|
10038
|
+
},{"52":52,"57":57,"63":63,"64":64,"82":82}],31:[function(_dereq_,module,exports){
|
|
10026
10039
|
module.exports = {
|
|
10027
10040
|
__depends__: [ _dereq_(35) ],
|
|
10028
10041
|
__init__: [ 'canvas' ],
|
|
@@ -10135,9 +10148,9 @@ var renderUtil = _dereq_(56);
|
|
|
10135
10148
|
var componentsToPath = renderUtil.componentsToPath,
|
|
10136
10149
|
createLine = renderUtil.createLine;
|
|
10137
10150
|
|
|
10138
|
-
var svgAppend = _dereq_(82),
|
|
10139
|
-
svgAttr = _dereq_(
|
|
10140
|
-
svgCreate = _dereq_(
|
|
10151
|
+
var svgAppend = _dereq_(82).append,
|
|
10152
|
+
svgAttr = _dereq_(82).attr,
|
|
10153
|
+
svgCreate = _dereq_(82).create;
|
|
10141
10154
|
|
|
10142
10155
|
// apply default renderer with lowest possible priority
|
|
10143
10156
|
// so that it only kicks in if noone else could render
|
|
@@ -10228,7 +10241,7 @@ DefaultRenderer.$inject = [ 'eventBus', 'styles' ];
|
|
|
10228
10241
|
|
|
10229
10242
|
module.exports = DefaultRenderer;
|
|
10230
10243
|
|
|
10231
|
-
},{"32":32,"56":56,"62":62,"82":82
|
|
10244
|
+
},{"32":32,"56":56,"62":62,"82":82}],34:[function(_dereq_,module,exports){
|
|
10232
10245
|
'use strict';
|
|
10233
10246
|
|
|
10234
10247
|
var isArray = _dereq_(63).isArray,
|
|
@@ -10320,9 +10333,9 @@ var forEach = _dereq_(63).forEach,
|
|
|
10320
10333
|
|
|
10321
10334
|
var isPrimaryButton = _dereq_(54).isPrimaryButton;
|
|
10322
10335
|
|
|
10323
|
-
var svgAppend = _dereq_(82),
|
|
10324
|
-
svgAttr = _dereq_(
|
|
10325
|
-
svgCreate = _dereq_(
|
|
10336
|
+
var svgAppend = _dereq_(82).append,
|
|
10337
|
+
svgAttr = _dereq_(82).attr,
|
|
10338
|
+
svgCreate = _dereq_(82).create;
|
|
10326
10339
|
|
|
10327
10340
|
var domQuery = _dereq_(64).query;
|
|
10328
10341
|
|
|
@@ -10654,7 +10667,7 @@ module.exports = InteractionEvents;
|
|
|
10654
10667
|
* @property {SVGElement} gfx
|
|
10655
10668
|
* @property {Event} originalEvent
|
|
10656
10669
|
*/
|
|
10657
|
-
},{"54":54,"56":56,"63":63,"64":64,"82":82
|
|
10670
|
+
},{"54":54,"56":56,"63":63,"64":64,"82":82}],37:[function(_dereq_,module,exports){
|
|
10658
10671
|
module.exports = {
|
|
10659
10672
|
__init__: [ 'interactionEvents' ],
|
|
10660
10673
|
interactionEvents: [ 'type', _dereq_(36) ]
|
|
@@ -10666,9 +10679,9 @@ var getBBox = _dereq_(50).getBBox;
|
|
|
10666
10679
|
|
|
10667
10680
|
var LOW_PRIORITY = 500;
|
|
10668
10681
|
|
|
10669
|
-
var svgAppend = _dereq_(82),
|
|
10670
|
-
svgAttr = _dereq_(
|
|
10671
|
-
svgCreate = _dereq_(
|
|
10682
|
+
var svgAppend = _dereq_(82).append,
|
|
10683
|
+
svgAttr = _dereq_(82).attr,
|
|
10684
|
+
svgCreate = _dereq_(82).create;
|
|
10672
10685
|
|
|
10673
10686
|
var domQuery = _dereq_(64).query;
|
|
10674
10687
|
|
|
@@ -10782,7 +10795,7 @@ Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
|
|
|
10782
10795
|
|
|
10783
10796
|
module.exports = Outline;
|
|
10784
10797
|
|
|
10785
|
-
},{"50":50,"63":63,"64":64,"82":82
|
|
10798
|
+
},{"50":50,"63":63,"64":64,"82":82}],39:[function(_dereq_,module,exports){
|
|
10786
10799
|
'use strict';
|
|
10787
10800
|
|
|
10788
10801
|
module.exports = {
|
|
@@ -12502,8 +12515,8 @@ module.exports.isMac = function isMac() {
|
|
|
12502
12515
|
},{}],56:[function(_dereq_,module,exports){
|
|
12503
12516
|
'use strict';
|
|
12504
12517
|
|
|
12505
|
-
var svgAttr = _dereq_(
|
|
12506
|
-
svgCreate = _dereq_(
|
|
12518
|
+
var svgAttr = _dereq_(82).attr,
|
|
12519
|
+
svgCreate = _dereq_(82).create;
|
|
12507
12520
|
|
|
12508
12521
|
|
|
12509
12522
|
module.exports.componentsToPath = function(elements) {
|
|
@@ -12540,12 +12553,12 @@ module.exports.updateLine = function(gfx, points) {
|
|
|
12540
12553
|
return gfx;
|
|
12541
12554
|
};
|
|
12542
12555
|
|
|
12543
|
-
},{"
|
|
12556
|
+
},{"82":82}],57:[function(_dereq_,module,exports){
|
|
12544
12557
|
'use strict';
|
|
12545
12558
|
|
|
12546
|
-
var svgTransform = _dereq_(
|
|
12559
|
+
var svgTransform = _dereq_(82).transform;
|
|
12547
12560
|
|
|
12548
|
-
var createTransform = _dereq_(
|
|
12561
|
+
var createTransform = _dereq_(82).createTransform;
|
|
12549
12562
|
|
|
12550
12563
|
|
|
12551
12564
|
/**
|
|
@@ -12605,7 +12618,7 @@ module.exports.scale = function(gfx, amount) {
|
|
|
12605
12618
|
svgTransform(gfx, scale);
|
|
12606
12619
|
};
|
|
12607
12620
|
|
|
12608
|
-
},{"
|
|
12621
|
+
},{"82":82}],58:[function(_dereq_,module,exports){
|
|
12609
12622
|
'use strict';
|
|
12610
12623
|
|
|
12611
12624
|
var isObject = _dereq_(63).isObject,
|
|
@@ -12614,10 +12627,10 @@ var isObject = _dereq_(63).isObject,
|
|
|
12614
12627
|
forEach = _dereq_(63).forEach,
|
|
12615
12628
|
reduce = _dereq_(63).reduce;
|
|
12616
12629
|
|
|
12617
|
-
var svgAppend = _dereq_(82),
|
|
12618
|
-
svgAttr = _dereq_(
|
|
12619
|
-
svgCreate = _dereq_(
|
|
12620
|
-
svgRemove = _dereq_(
|
|
12630
|
+
var svgAppend = _dereq_(82).append,
|
|
12631
|
+
svgAttr = _dereq_(82).attr,
|
|
12632
|
+
svgCreate = _dereq_(82).create,
|
|
12633
|
+
svgRemove = _dereq_(82).remove;
|
|
12621
12634
|
|
|
12622
12635
|
var DEFAULT_BOX_PADDING = 0;
|
|
12623
12636
|
|
|
@@ -12938,10 +12951,12 @@ Text.prototype.layoutText = function(text, options) {
|
|
|
12938
12951
|
|
|
12939
12952
|
module.exports = Text;
|
|
12940
12953
|
|
|
12941
|
-
},{"63":63,"82":82
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12954
|
+
},{"63":63,"82":82}],59:[function(_dereq_,module,exports){
|
|
12955
|
+
(function (global, factory) {
|
|
12956
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
12957
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
12958
|
+
(factory((global.didi = {})));
|
|
12959
|
+
}(this, (function (exports) { 'use strict';
|
|
12945
12960
|
|
|
12946
12961
|
var CLASS_PATTERN = /^class /;
|
|
12947
12962
|
|
|
@@ -13277,6 +13292,10 @@ exports.annotate = annotate;
|
|
|
13277
13292
|
exports.Module = Module;
|
|
13278
13293
|
exports.Injector = Injector;
|
|
13279
13294
|
|
|
13295
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13296
|
+
|
|
13297
|
+
})));
|
|
13298
|
+
|
|
13280
13299
|
},{}],60:[function(_dereq_,module,exports){
|
|
13281
13300
|
var hat = module.exports = function (bits, base) {
|
|
13282
13301
|
if (!base) base = 16;
|
|
@@ -13466,9 +13485,11 @@ if (typeof Object.create === 'function') {
|
|
|
13466
13485
|
}
|
|
13467
13486
|
|
|
13468
13487
|
},{}],63:[function(_dereq_,module,exports){
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13488
|
+
(function (global, factory) {
|
|
13489
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
13490
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
13491
|
+
(factory((global.MinDash = {})));
|
|
13492
|
+
}(this, (function (exports) { 'use strict';
|
|
13472
13493
|
|
|
13473
13494
|
/**
|
|
13474
13495
|
* Flatten array, one level deep.
|
|
@@ -14092,11 +14113,17 @@ exports.pick = pick;
|
|
|
14092
14113
|
exports.omit = omit;
|
|
14093
14114
|
exports.merge = merge;
|
|
14094
14115
|
|
|
14095
|
-
},{}],64:[function(_dereq_,module,exports){
|
|
14096
|
-
'use strict';
|
|
14097
|
-
|
|
14098
14116
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14099
14117
|
|
|
14118
|
+
})));
|
|
14119
|
+
|
|
14120
|
+
},{}],64:[function(_dereq_,module,exports){
|
|
14121
|
+
(function (global, factory) {
|
|
14122
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
14123
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
14124
|
+
(factory((global.MinDom = {})));
|
|
14125
|
+
}(this, (function (exports) { 'use strict';
|
|
14126
|
+
|
|
14100
14127
|
/**
|
|
14101
14128
|
* Set attribute `name` to `val`, or get attr `name`.
|
|
14102
14129
|
*
|
|
@@ -14646,6 +14673,10 @@ exports.query = query;
|
|
|
14646
14673
|
exports.queryAll = all;
|
|
14647
14674
|
exports.remove = remove;
|
|
14648
14675
|
|
|
14676
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14677
|
+
|
|
14678
|
+
})));
|
|
14679
|
+
|
|
14649
14680
|
},{}],65:[function(_dereq_,module,exports){
|
|
14650
14681
|
'use strict';
|
|
14651
14682
|
|
|
@@ -15530,7 +15561,8 @@ var Types = _dereq_(76),
|
|
|
15530
15561
|
serializeAsProperty = common.serializeAsProperty;
|
|
15531
15562
|
|
|
15532
15563
|
var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
|
|
15533
|
-
|
|
15564
|
+
ESCAPE_ATTR_CHARS = /<|>|'|"|&|\n\r|\n/g,
|
|
15565
|
+
ESCAPE_CHARS = /<|>|&/g,
|
|
15534
15566
|
DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
|
|
15535
15567
|
XSI_TYPE = common.XSI_TYPE;
|
|
15536
15568
|
|
|
@@ -15676,16 +15708,32 @@ function getSerializableProperties(element) {
|
|
|
15676
15708
|
});
|
|
15677
15709
|
}
|
|
15678
15710
|
|
|
15711
|
+
var ESCAPE_ATTR_MAP = {
|
|
15712
|
+
'\n': '#10',
|
|
15713
|
+
'\n\r': '#10',
|
|
15714
|
+
'"': '#34',
|
|
15715
|
+
'\'': '#39',
|
|
15716
|
+
'<': '#60',
|
|
15717
|
+
'>': '#62',
|
|
15718
|
+
'&': '#38'
|
|
15719
|
+
};
|
|
15720
|
+
|
|
15679
15721
|
var ESCAPE_MAP = {
|
|
15680
|
-
'
|
|
15681
|
-
'
|
|
15682
|
-
'
|
|
15683
|
-
'\'': '39',
|
|
15684
|
-
'<': '60',
|
|
15685
|
-
'>': '62',
|
|
15686
|
-
'&': '38'
|
|
15722
|
+
'<': 'lt',
|
|
15723
|
+
'>': 'gt',
|
|
15724
|
+
'&': 'amp'
|
|
15687
15725
|
};
|
|
15688
15726
|
|
|
15727
|
+
function escape(str, charPattern, replaceMap) {
|
|
15728
|
+
|
|
15729
|
+
// ensure we are handling strings here
|
|
15730
|
+
str = isString(str) ? str : '' + str;
|
|
15731
|
+
|
|
15732
|
+
return str.replace(charPattern, function(s) {
|
|
15733
|
+
return '&' + replaceMap[s] + ';';
|
|
15734
|
+
});
|
|
15735
|
+
}
|
|
15736
|
+
|
|
15689
15737
|
/**
|
|
15690
15738
|
* Escape a string attribute to not contain any bad values (line breaks, '"', ...)
|
|
15691
15739
|
*
|
|
@@ -15693,13 +15741,11 @@ var ESCAPE_MAP = {
|
|
|
15693
15741
|
* @return {String} the escaped string
|
|
15694
15742
|
*/
|
|
15695
15743
|
function escapeAttr(str) {
|
|
15744
|
+
return escape(str, ESCAPE_ATTR_CHARS, ESCAPE_ATTR_MAP);
|
|
15745
|
+
}
|
|
15696
15746
|
|
|
15697
|
-
|
|
15698
|
-
|
|
15699
|
-
|
|
15700
|
-
return str.replace(ESCAPE_CHARS, function(str) {
|
|
15701
|
-
return '&#' + ESCAPE_MAP[str] + ';';
|
|
15702
|
-
});
|
|
15747
|
+
function escapeBody(str) {
|
|
15748
|
+
return escape(str, ESCAPE_CHARS, ESCAPE_MAP);
|
|
15703
15749
|
}
|
|
15704
15750
|
|
|
15705
15751
|
function filterAttributes(props) {
|
|
@@ -15729,18 +15775,13 @@ ReferenceSerializer.prototype.serializeTo = function(writer) {
|
|
|
15729
15775
|
|
|
15730
15776
|
function BodySerializer() {}
|
|
15731
15777
|
|
|
15732
|
-
BodySerializer.prototype.serializeValue =
|
|
15733
|
-
|
|
15734
|
-
|
|
15735
|
-
|
|
15736
|
-
|
|
15737
|
-
|
|
15738
|
-
|
|
15739
|
-
writer.append(this.value);
|
|
15740
|
-
|
|
15741
|
-
if (escape) {
|
|
15742
|
-
writer.append(']]>');
|
|
15743
|
-
}
|
|
15778
|
+
BodySerializer.prototype.serializeValue =
|
|
15779
|
+
BodySerializer.prototype.serializeTo = function(writer) {
|
|
15780
|
+
writer.append(
|
|
15781
|
+
this.escape
|
|
15782
|
+
? escapeBody(this.value)
|
|
15783
|
+
: this.value
|
|
15784
|
+
);
|
|
15744
15785
|
};
|
|
15745
15786
|
|
|
15746
15787
|
BodySerializer.prototype.build = function(prop, value) {
|
|
@@ -17973,7 +18014,14 @@ module.exports = Refs;
|
|
|
17973
18014
|
for (j = i + 1; j < l; j++) {
|
|
17974
18015
|
w = s.charCodeAt(j);
|
|
17975
18016
|
|
|
17976
|
-
if (
|
|
18017
|
+
if (
|
|
18018
|
+
w > 96 && w < 123 ||
|
|
18019
|
+
w > 64 && w < 91 ||
|
|
18020
|
+
w > 47 && w < 59 ||
|
|
18021
|
+
w === 46 || // '.'
|
|
18022
|
+
w === 45 || // '-'
|
|
18023
|
+
w === 95 // '_'
|
|
18024
|
+
) {
|
|
17977
18025
|
continue;
|
|
17978
18026
|
}
|
|
17979
18027
|
|
|
@@ -18717,771 +18765,784 @@ else {
|
|
|
18717
18765
|
} )( this );
|
|
18718
18766
|
|
|
18719
18767
|
},{}],82:[function(_dereq_,module,exports){
|
|
18720
|
-
|
|
18721
|
-
|
|
18722
|
-
|
|
18768
|
+
(function (global, factory) {
|
|
18769
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
18770
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
18771
|
+
(factory((global.TinySVG = {})));
|
|
18772
|
+
}(this, (function (exports) { 'use strict';
|
|
18723
18773
|
|
|
18724
|
-
|
|
18774
|
+
function ensureImported(element, target) {
|
|
18725
18775
|
|
|
18726
|
-
|
|
18776
|
+
if (element.ownerDocument !== target.ownerDocument) {
|
|
18777
|
+
try {
|
|
18778
|
+
// may fail on webkit
|
|
18779
|
+
return target.ownerDocument.importNode(element, true);
|
|
18780
|
+
} catch (e) {
|
|
18781
|
+
// ignore
|
|
18782
|
+
}
|
|
18783
|
+
}
|
|
18727
18784
|
|
|
18728
|
-
|
|
18729
|
-
|
|
18730
|
-
*
|
|
18731
|
-
* @param {SVGElement} element
|
|
18732
|
-
* @param {SVGElement} node
|
|
18733
|
-
*
|
|
18734
|
-
* @return {SVGElement} the element
|
|
18735
|
-
*/
|
|
18736
|
-
function append(element, node) {
|
|
18737
|
-
appendTo(node, element);
|
|
18738
|
-
return element;
|
|
18739
|
-
}
|
|
18740
|
-
},{"83":83}],83:[function(_dereq_,module,exports){
|
|
18741
|
-
/**
|
|
18742
|
-
* appendTo utility
|
|
18743
|
-
*/
|
|
18744
|
-
module.exports = appendTo;
|
|
18785
|
+
return element;
|
|
18786
|
+
}
|
|
18745
18787
|
|
|
18746
|
-
|
|
18788
|
+
/**
|
|
18789
|
+
* appendTo utility
|
|
18790
|
+
*/
|
|
18747
18791
|
|
|
18748
|
-
/**
|
|
18749
|
-
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
18754
|
-
|
|
18755
|
-
|
|
18756
|
-
function appendTo(element, target) {
|
|
18757
|
-
|
|
18758
|
-
|
|
18759
|
-
}
|
|
18760
|
-
},{"92":92}],84:[function(_dereq_,module,exports){
|
|
18761
|
-
/**
|
|
18762
|
-
* attribute accessor utility
|
|
18763
|
-
*/
|
|
18792
|
+
/**
|
|
18793
|
+
* Append a node to a target element and return the appended node.
|
|
18794
|
+
*
|
|
18795
|
+
* @param {SVGElement} element
|
|
18796
|
+
* @param {SVGElement} node
|
|
18797
|
+
*
|
|
18798
|
+
* @return {SVGElement} the appended node
|
|
18799
|
+
*/
|
|
18800
|
+
function appendTo(element, target) {
|
|
18801
|
+
target.appendChild(ensureImported(element, target));
|
|
18802
|
+
return element;
|
|
18803
|
+
}
|
|
18764
18804
|
|
|
18765
|
-
|
|
18766
|
-
|
|
18767
|
-
|
|
18768
|
-
|
|
18769
|
-
|
|
18770
|
-
|
|
18771
|
-
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
|
|
18777
|
-
|
|
18778
|
-
|
|
18779
|
-
|
|
18780
|
-
'color-rendering': 1,
|
|
18781
|
-
'cursor': 1,
|
|
18782
|
-
'direction': 1,
|
|
18783
|
-
'display': 1,
|
|
18784
|
-
'dominant-baseline': 1,
|
|
18785
|
-
'enable-background': 1,
|
|
18786
|
-
'fill': 1,
|
|
18787
|
-
'fill-opacity': 1,
|
|
18788
|
-
'fill-rule': 1,
|
|
18789
|
-
'filter': 1,
|
|
18790
|
-
'flood-color': 1,
|
|
18791
|
-
'flood-opacity': 1,
|
|
18792
|
-
'font': 1,
|
|
18793
|
-
'font-family': 1,
|
|
18794
|
-
'font-size': LENGTH_ATTR,
|
|
18795
|
-
'font-size-adjust': 1,
|
|
18796
|
-
'font-stretch': 1,
|
|
18797
|
-
'font-style': 1,
|
|
18798
|
-
'font-variant': 1,
|
|
18799
|
-
'font-weight': 1,
|
|
18800
|
-
'glyph-orientation-horizontal': 1,
|
|
18801
|
-
'glyph-orientation-vertical': 1,
|
|
18802
|
-
'image-rendering': 1,
|
|
18803
|
-
'kerning': 1,
|
|
18804
|
-
'letter-spacing': 1,
|
|
18805
|
-
'lighting-color': 1,
|
|
18806
|
-
'marker': 1,
|
|
18807
|
-
'marker-end': 1,
|
|
18808
|
-
'marker-mid': 1,
|
|
18809
|
-
'marker-start': 1,
|
|
18810
|
-
'mask': 1,
|
|
18811
|
-
'opacity': 1,
|
|
18812
|
-
'overflow': 1,
|
|
18813
|
-
'pointer-events': 1,
|
|
18814
|
-
'shape-rendering': 1,
|
|
18815
|
-
'stop-color': 1,
|
|
18816
|
-
'stop-opacity': 1,
|
|
18817
|
-
'stroke': 1,
|
|
18818
|
-
'stroke-dasharray': 1,
|
|
18819
|
-
'stroke-dashoffset': 1,
|
|
18820
|
-
'stroke-linecap': 1,
|
|
18821
|
-
'stroke-linejoin': 1,
|
|
18822
|
-
'stroke-miterlimit': 1,
|
|
18823
|
-
'stroke-opacity': 1,
|
|
18824
|
-
'stroke-width': LENGTH_ATTR,
|
|
18825
|
-
'text-anchor': 1,
|
|
18826
|
-
'text-decoration': 1,
|
|
18827
|
-
'text-rendering': 1,
|
|
18828
|
-
'unicode-bidi': 1,
|
|
18829
|
-
'visibility': 1,
|
|
18830
|
-
'word-spacing': 1,
|
|
18831
|
-
'writing-mode': 1
|
|
18832
|
-
};
|
|
18833
|
-
|
|
18834
|
-
|
|
18835
|
-
function getAttribute(node, name) {
|
|
18836
|
-
if (CSS_PROPERTIES[name]) {
|
|
18837
|
-
return node.style[name];
|
|
18838
|
-
} else {
|
|
18839
|
-
return node.getAttributeNS(null, name);
|
|
18805
|
+
/**
|
|
18806
|
+
* append utility
|
|
18807
|
+
*/
|
|
18808
|
+
|
|
18809
|
+
/**
|
|
18810
|
+
* Append a node to an element
|
|
18811
|
+
*
|
|
18812
|
+
* @param {SVGElement} element
|
|
18813
|
+
* @param {SVGElement} node
|
|
18814
|
+
*
|
|
18815
|
+
* @return {SVGElement} the element
|
|
18816
|
+
*/
|
|
18817
|
+
function append(element, node) {
|
|
18818
|
+
appendTo(node, element);
|
|
18819
|
+
return element;
|
|
18840
18820
|
}
|
|
18841
|
-
}
|
|
18842
18821
|
|
|
18843
|
-
|
|
18844
|
-
|
|
18822
|
+
/**
|
|
18823
|
+
* attribute accessor utility
|
|
18824
|
+
*/
|
|
18825
|
+
|
|
18826
|
+
var LENGTH_ATTR = 2;
|
|
18827
|
+
|
|
18828
|
+
var CSS_PROPERTIES = {
|
|
18829
|
+
'alignment-baseline': 1,
|
|
18830
|
+
'baseline-shift': 1,
|
|
18831
|
+
'clip': 1,
|
|
18832
|
+
'clip-path': 1,
|
|
18833
|
+
'clip-rule': 1,
|
|
18834
|
+
'color': 1,
|
|
18835
|
+
'color-interpolation': 1,
|
|
18836
|
+
'color-interpolation-filters': 1,
|
|
18837
|
+
'color-profile': 1,
|
|
18838
|
+
'color-rendering': 1,
|
|
18839
|
+
'cursor': 1,
|
|
18840
|
+
'direction': 1,
|
|
18841
|
+
'display': 1,
|
|
18842
|
+
'dominant-baseline': 1,
|
|
18843
|
+
'enable-background': 1,
|
|
18844
|
+
'fill': 1,
|
|
18845
|
+
'fill-opacity': 1,
|
|
18846
|
+
'fill-rule': 1,
|
|
18847
|
+
'filter': 1,
|
|
18848
|
+
'flood-color': 1,
|
|
18849
|
+
'flood-opacity': 1,
|
|
18850
|
+
'font': 1,
|
|
18851
|
+
'font-family': 1,
|
|
18852
|
+
'font-size': LENGTH_ATTR,
|
|
18853
|
+
'font-size-adjust': 1,
|
|
18854
|
+
'font-stretch': 1,
|
|
18855
|
+
'font-style': 1,
|
|
18856
|
+
'font-variant': 1,
|
|
18857
|
+
'font-weight': 1,
|
|
18858
|
+
'glyph-orientation-horizontal': 1,
|
|
18859
|
+
'glyph-orientation-vertical': 1,
|
|
18860
|
+
'image-rendering': 1,
|
|
18861
|
+
'kerning': 1,
|
|
18862
|
+
'letter-spacing': 1,
|
|
18863
|
+
'lighting-color': 1,
|
|
18864
|
+
'marker': 1,
|
|
18865
|
+
'marker-end': 1,
|
|
18866
|
+
'marker-mid': 1,
|
|
18867
|
+
'marker-start': 1,
|
|
18868
|
+
'mask': 1,
|
|
18869
|
+
'opacity': 1,
|
|
18870
|
+
'overflow': 1,
|
|
18871
|
+
'pointer-events': 1,
|
|
18872
|
+
'shape-rendering': 1,
|
|
18873
|
+
'stop-color': 1,
|
|
18874
|
+
'stop-opacity': 1,
|
|
18875
|
+
'stroke': 1,
|
|
18876
|
+
'stroke-dasharray': 1,
|
|
18877
|
+
'stroke-dashoffset': 1,
|
|
18878
|
+
'stroke-linecap': 1,
|
|
18879
|
+
'stroke-linejoin': 1,
|
|
18880
|
+
'stroke-miterlimit': 1,
|
|
18881
|
+
'stroke-opacity': 1,
|
|
18882
|
+
'stroke-width': LENGTH_ATTR,
|
|
18883
|
+
'text-anchor': 1,
|
|
18884
|
+
'text-decoration': 1,
|
|
18885
|
+
'text-rendering': 1,
|
|
18886
|
+
'unicode-bidi': 1,
|
|
18887
|
+
'visibility': 1,
|
|
18888
|
+
'word-spacing': 1,
|
|
18889
|
+
'writing-mode': 1
|
|
18890
|
+
};
|
|
18845
18891
|
|
|
18846
|
-
var type = CSS_PROPERTIES[hyphenated];
|
|
18847
18892
|
|
|
18848
|
-
|
|
18849
|
-
|
|
18850
|
-
|
|
18851
|
-
|
|
18893
|
+
function getAttribute(node, name) {
|
|
18894
|
+
if (CSS_PROPERTIES[name]) {
|
|
18895
|
+
return node.style[name];
|
|
18896
|
+
} else {
|
|
18897
|
+
return node.getAttributeNS(null, name);
|
|
18852
18898
|
}
|
|
18899
|
+
}
|
|
18853
18900
|
|
|
18854
|
-
|
|
18855
|
-
|
|
18856
|
-
|
|
18901
|
+
function setAttribute(node, name, value) {
|
|
18902
|
+
var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
18903
|
+
|
|
18904
|
+
var type = CSS_PROPERTIES[hyphenated];
|
|
18905
|
+
|
|
18906
|
+
if (type) {
|
|
18907
|
+
// append pixel unit, unless present
|
|
18908
|
+
if (type === LENGTH_ATTR && typeof value === 'number') {
|
|
18909
|
+
value = String(value) + 'px';
|
|
18910
|
+
}
|
|
18911
|
+
|
|
18912
|
+
node.style[hyphenated] = value;
|
|
18913
|
+
} else {
|
|
18914
|
+
node.setAttributeNS(null, name, value);
|
|
18915
|
+
}
|
|
18857
18916
|
}
|
|
18858
|
-
}
|
|
18859
18917
|
|
|
18860
|
-
function setAttributes(node, attrs) {
|
|
18918
|
+
function setAttributes(node, attrs) {
|
|
18861
18919
|
|
|
18862
|
-
|
|
18920
|
+
var names = Object.keys(attrs), i, name;
|
|
18863
18921
|
|
|
18864
|
-
|
|
18865
|
-
|
|
18922
|
+
for (i = 0, name; (name = names[i]); i++) {
|
|
18923
|
+
setAttribute(node, name, attrs[name]);
|
|
18924
|
+
}
|
|
18866
18925
|
}
|
|
18867
|
-
}
|
|
18868
18926
|
|
|
18869
|
-
/**
|
|
18870
|
-
|
|
18871
|
-
|
|
18872
|
-
|
|
18873
|
-
|
|
18874
|
-
|
|
18875
|
-
|
|
18876
|
-
|
|
18877
|
-
|
|
18878
|
-
|
|
18879
|
-
function attr(node, name, value) {
|
|
18880
|
-
|
|
18881
|
-
|
|
18882
|
-
|
|
18927
|
+
/**
|
|
18928
|
+
* Gets or sets raw attributes on a node.
|
|
18929
|
+
*
|
|
18930
|
+
* @param {SVGElement} node
|
|
18931
|
+
* @param {Object} [attrs]
|
|
18932
|
+
* @param {String} [name]
|
|
18933
|
+
* @param {String} [value]
|
|
18934
|
+
*
|
|
18935
|
+
* @return {String}
|
|
18936
|
+
*/
|
|
18937
|
+
function attr(node, name, value) {
|
|
18938
|
+
if (typeof name === 'string') {
|
|
18939
|
+
if (value !== undefined) {
|
|
18940
|
+
setAttribute(node, name, value);
|
|
18941
|
+
} else {
|
|
18942
|
+
return getAttribute(node, name);
|
|
18943
|
+
}
|
|
18883
18944
|
} else {
|
|
18884
|
-
|
|
18945
|
+
setAttributes(node, name);
|
|
18885
18946
|
}
|
|
18886
|
-
} else {
|
|
18887
|
-
setAttributes(node, name);
|
|
18888
|
-
}
|
|
18889
18947
|
|
|
18890
|
-
|
|
18891
|
-
}
|
|
18948
|
+
return node;
|
|
18949
|
+
}
|
|
18892
18950
|
|
|
18893
|
-
|
|
18894
|
-
|
|
18895
|
-
|
|
18896
|
-
|
|
18897
|
-
|
|
18898
|
-
|
|
18899
|
-
var index = function(arr, obj) {
|
|
18900
|
-
if (arr.indexOf) {
|
|
18901
|
-
return arr.indexOf(obj);
|
|
18902
|
-
}
|
|
18903
|
-
|
|
18904
|
-
|
|
18905
|
-
for (var i = 0; i < arr.length; ++i) {
|
|
18906
|
-
if (arr[i] === obj) {
|
|
18907
|
-
return i;
|
|
18951
|
+
/**
|
|
18952
|
+
* Clear utility
|
|
18953
|
+
*/
|
|
18954
|
+
function index(arr, obj) {
|
|
18955
|
+
if (arr.indexOf) {
|
|
18956
|
+
return arr.indexOf(obj);
|
|
18908
18957
|
}
|
|
18909
|
-
}
|
|
18910
18958
|
|
|
18911
|
-
return -1;
|
|
18912
|
-
};
|
|
18913
18959
|
|
|
18914
|
-
var
|
|
18960
|
+
for (var i = 0; i < arr.length; ++i) {
|
|
18961
|
+
if (arr[i] === obj) {
|
|
18962
|
+
return i;
|
|
18963
|
+
}
|
|
18964
|
+
}
|
|
18915
18965
|
|
|
18916
|
-
|
|
18966
|
+
return -1;
|
|
18967
|
+
}
|
|
18917
18968
|
|
|
18918
|
-
|
|
18919
|
-
return typeof o !== 'undefined';
|
|
18920
|
-
}
|
|
18969
|
+
var re = /\s+/;
|
|
18921
18970
|
|
|
18922
|
-
|
|
18923
|
-
* Wrap `el` in a `ClassList`.
|
|
18924
|
-
*
|
|
18925
|
-
* @param {Element} el
|
|
18926
|
-
* @return {ClassList}
|
|
18927
|
-
* @api public
|
|
18928
|
-
*/
|
|
18971
|
+
var toString = Object.prototype.toString;
|
|
18929
18972
|
|
|
18930
|
-
function
|
|
18931
|
-
|
|
18932
|
-
}
|
|
18933
|
-
|
|
18934
|
-
function ClassList(el) {
|
|
18935
|
-
if (!el || !el.nodeType) {
|
|
18936
|
-
throw new Error('A DOM element reference is required');
|
|
18973
|
+
function defined(o) {
|
|
18974
|
+
return typeof o !== 'undefined';
|
|
18937
18975
|
}
|
|
18938
|
-
this.el = el;
|
|
18939
|
-
this.list = el.classList;
|
|
18940
|
-
}
|
|
18941
18976
|
|
|
18942
|
-
/**
|
|
18943
|
-
|
|
18944
|
-
|
|
18945
|
-
|
|
18946
|
-
|
|
18947
|
-
|
|
18948
|
-
|
|
18977
|
+
/**
|
|
18978
|
+
* Wrap `el` in a `ClassList`.
|
|
18979
|
+
*
|
|
18980
|
+
* @param {Element} el
|
|
18981
|
+
* @return {ClassList}
|
|
18982
|
+
* @api public
|
|
18983
|
+
*/
|
|
18949
18984
|
|
|
18950
|
-
|
|
18951
|
-
|
|
18952
|
-
// classList
|
|
18953
|
-
if (this.list) {
|
|
18954
|
-
this.list.add(name);
|
|
18955
|
-
return this;
|
|
18985
|
+
function classes(el) {
|
|
18986
|
+
return new ClassList(el);
|
|
18956
18987
|
}
|
|
18957
18988
|
|
|
18958
|
-
|
|
18959
|
-
|
|
18960
|
-
|
|
18961
|
-
|
|
18962
|
-
|
|
18989
|
+
function ClassList(el) {
|
|
18990
|
+
if (!el || !el.nodeType) {
|
|
18991
|
+
throw new Error('A DOM element reference is required');
|
|
18992
|
+
}
|
|
18993
|
+
this.el = el;
|
|
18994
|
+
this.list = el.classList;
|
|
18963
18995
|
}
|
|
18964
18996
|
|
|
18965
|
-
|
|
18966
|
-
|
|
18967
|
-
|
|
18968
|
-
|
|
18969
|
-
|
|
18997
|
+
/**
|
|
18998
|
+
* Add class `name` if not already present.
|
|
18999
|
+
*
|
|
19000
|
+
* @param {String} name
|
|
19001
|
+
* @return {ClassList}
|
|
19002
|
+
* @api public
|
|
19003
|
+
*/
|
|
18970
19004
|
|
|
18971
|
-
|
|
18972
|
-
};
|
|
19005
|
+
ClassList.prototype.add = function(name) {
|
|
18973
19006
|
|
|
18974
|
-
|
|
18975
|
-
|
|
18976
|
-
|
|
18977
|
-
|
|
18978
|
-
|
|
18979
|
-
* @param {String|RegExp} name
|
|
18980
|
-
* @return {ClassList}
|
|
18981
|
-
* @api public
|
|
18982
|
-
*/
|
|
19007
|
+
// classList
|
|
19008
|
+
if (this.list) {
|
|
19009
|
+
this.list.add(name);
|
|
19010
|
+
return this;
|
|
19011
|
+
}
|
|
18983
19012
|
|
|
18984
|
-
|
|
18985
|
-
|
|
18986
|
-
|
|
18987
|
-
|
|
19013
|
+
// fallback
|
|
19014
|
+
var arr = this.array();
|
|
19015
|
+
var i = index(arr, name);
|
|
19016
|
+
if (!~i) {
|
|
19017
|
+
arr.push(name);
|
|
19018
|
+
}
|
|
19019
|
+
|
|
19020
|
+
if (defined(this.el.className.baseVal)) {
|
|
19021
|
+
this.el.className.baseVal = arr.join(' ');
|
|
19022
|
+
} else {
|
|
19023
|
+
this.el.className = arr.join(' ');
|
|
19024
|
+
}
|
|
18988
19025
|
|
|
18989
|
-
// classList
|
|
18990
|
-
if (this.list) {
|
|
18991
|
-
this.list.remove(name);
|
|
18992
19026
|
return this;
|
|
18993
|
-
}
|
|
19027
|
+
};
|
|
18994
19028
|
|
|
18995
|
-
|
|
18996
|
-
|
|
18997
|
-
|
|
18998
|
-
|
|
18999
|
-
|
|
19000
|
-
|
|
19001
|
-
|
|
19002
|
-
|
|
19003
|
-
|
|
19029
|
+
/**
|
|
19030
|
+
* Remove class `name` when present, or
|
|
19031
|
+
* pass a regular expression to remove
|
|
19032
|
+
* any which match.
|
|
19033
|
+
*
|
|
19034
|
+
* @param {String|RegExp} name
|
|
19035
|
+
* @return {ClassList}
|
|
19036
|
+
* @api public
|
|
19037
|
+
*/
|
|
19004
19038
|
|
|
19005
|
-
|
|
19006
|
-
|
|
19007
|
-
|
|
19008
|
-
|
|
19009
|
-
* @return {ClassList}
|
|
19010
|
-
* @api private
|
|
19011
|
-
*/
|
|
19039
|
+
ClassList.prototype.remove = function(name) {
|
|
19040
|
+
if ('[object RegExp]' === toString.call(name)) {
|
|
19041
|
+
return this.removeMatching(name);
|
|
19042
|
+
}
|
|
19012
19043
|
|
|
19013
|
-
|
|
19014
|
-
|
|
19015
|
-
|
|
19016
|
-
|
|
19017
|
-
this.remove(arr[i]);
|
|
19044
|
+
// classList
|
|
19045
|
+
if (this.list) {
|
|
19046
|
+
this.list.remove(name);
|
|
19047
|
+
return this;
|
|
19018
19048
|
}
|
|
19019
|
-
}
|
|
19020
|
-
return this;
|
|
19021
|
-
};
|
|
19022
19049
|
|
|
19023
|
-
|
|
19024
|
-
|
|
19025
|
-
|
|
19026
|
-
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
|
|
19030
|
-
|
|
19031
|
-
|
|
19032
|
-
* @api public
|
|
19033
|
-
*/
|
|
19050
|
+
// fallback
|
|
19051
|
+
var arr = this.array();
|
|
19052
|
+
var i = index(arr, name);
|
|
19053
|
+
if (~i) {
|
|
19054
|
+
arr.splice(i, 1);
|
|
19055
|
+
}
|
|
19056
|
+
this.el.className.baseVal = arr.join(' ');
|
|
19057
|
+
return this;
|
|
19058
|
+
};
|
|
19034
19059
|
|
|
19035
|
-
|
|
19036
|
-
|
|
19037
|
-
|
|
19038
|
-
|
|
19039
|
-
|
|
19040
|
-
|
|
19060
|
+
/**
|
|
19061
|
+
* Remove all classes matching `re`.
|
|
19062
|
+
*
|
|
19063
|
+
* @param {RegExp} re
|
|
19064
|
+
* @return {ClassList}
|
|
19065
|
+
* @api private
|
|
19066
|
+
*/
|
|
19067
|
+
|
|
19068
|
+
ClassList.prototype.removeMatching = function(re) {
|
|
19069
|
+
var arr = this.array();
|
|
19070
|
+
for (var i = 0; i < arr.length; i++) {
|
|
19071
|
+
if (re.test(arr[i])) {
|
|
19072
|
+
this.remove(arr[i]);
|
|
19041
19073
|
}
|
|
19042
|
-
} else {
|
|
19043
|
-
this.list.toggle(name);
|
|
19044
19074
|
}
|
|
19045
19075
|
return this;
|
|
19046
|
-
}
|
|
19076
|
+
};
|
|
19047
19077
|
|
|
19048
|
-
|
|
19049
|
-
|
|
19050
|
-
|
|
19051
|
-
|
|
19052
|
-
|
|
19053
|
-
|
|
19078
|
+
/**
|
|
19079
|
+
* Toggle class `name`, can force state via `force`.
|
|
19080
|
+
*
|
|
19081
|
+
* For browsers that support classList, but do not support `force` yet,
|
|
19082
|
+
* the mistake will be detected and corrected.
|
|
19083
|
+
*
|
|
19084
|
+
* @param {String} name
|
|
19085
|
+
* @param {Boolean} force
|
|
19086
|
+
* @return {ClassList}
|
|
19087
|
+
* @api public
|
|
19088
|
+
*/
|
|
19089
|
+
|
|
19090
|
+
ClassList.prototype.toggle = function(name, force) {
|
|
19091
|
+
// classList
|
|
19092
|
+
if (this.list) {
|
|
19093
|
+
if (defined(force)) {
|
|
19094
|
+
if (force !== this.list.toggle(name, force)) {
|
|
19095
|
+
this.list.toggle(name); // toggle again to correct
|
|
19096
|
+
}
|
|
19097
|
+
} else {
|
|
19098
|
+
this.list.toggle(name);
|
|
19099
|
+
}
|
|
19100
|
+
return this;
|
|
19054
19101
|
}
|
|
19055
|
-
|
|
19056
|
-
|
|
19057
|
-
|
|
19102
|
+
|
|
19103
|
+
// fallback
|
|
19104
|
+
if (defined(force)) {
|
|
19105
|
+
if (!force) {
|
|
19106
|
+
this.remove(name);
|
|
19107
|
+
} else {
|
|
19108
|
+
this.add(name);
|
|
19109
|
+
}
|
|
19058
19110
|
} else {
|
|
19059
|
-
this.
|
|
19111
|
+
if (this.has(name)) {
|
|
19112
|
+
this.remove(name);
|
|
19113
|
+
} else {
|
|
19114
|
+
this.add(name);
|
|
19115
|
+
}
|
|
19060
19116
|
}
|
|
19061
|
-
}
|
|
19062
19117
|
|
|
19063
|
-
|
|
19064
|
-
};
|
|
19118
|
+
return this;
|
|
19119
|
+
};
|
|
19065
19120
|
|
|
19066
|
-
/**
|
|
19067
|
-
|
|
19068
|
-
|
|
19069
|
-
|
|
19070
|
-
|
|
19071
|
-
|
|
19121
|
+
/**
|
|
19122
|
+
* Return an array of classes.
|
|
19123
|
+
*
|
|
19124
|
+
* @return {Array}
|
|
19125
|
+
* @api public
|
|
19126
|
+
*/
|
|
19072
19127
|
|
|
19073
|
-
ClassList.prototype.array = function() {
|
|
19074
|
-
|
|
19075
|
-
|
|
19076
|
-
|
|
19077
|
-
|
|
19078
|
-
|
|
19079
|
-
|
|
19080
|
-
|
|
19081
|
-
};
|
|
19128
|
+
ClassList.prototype.array = function() {
|
|
19129
|
+
var className = this.el.getAttribute('class') || '';
|
|
19130
|
+
var str = className.replace(/^\s+|\s+$/g, '');
|
|
19131
|
+
var arr = str.split(re);
|
|
19132
|
+
if ('' === arr[0]) {
|
|
19133
|
+
arr.shift();
|
|
19134
|
+
}
|
|
19135
|
+
return arr;
|
|
19136
|
+
};
|
|
19082
19137
|
|
|
19083
|
-
/**
|
|
19084
|
-
|
|
19085
|
-
|
|
19086
|
-
|
|
19087
|
-
|
|
19088
|
-
|
|
19089
|
-
|
|
19138
|
+
/**
|
|
19139
|
+
* Check if class `name` is present.
|
|
19140
|
+
*
|
|
19141
|
+
* @param {String} name
|
|
19142
|
+
* @return {ClassList}
|
|
19143
|
+
* @api public
|
|
19144
|
+
*/
|
|
19090
19145
|
|
|
19091
|
-
ClassList.prototype.has =
|
|
19092
|
-
ClassList.prototype.contains = function(name) {
|
|
19093
|
-
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
|
|
19097
|
-
|
|
19098
|
-
};
|
|
19099
|
-
|
|
19100
|
-
},{}],86:[function(_dereq_,module,exports){
|
|
19101
|
-
/**
|
|
19102
|
-
* Clear utility
|
|
19103
|
-
*/
|
|
19104
|
-
|
|
19105
|
-
module.exports = clear;
|
|
19106
|
-
|
|
19146
|
+
ClassList.prototype.has =
|
|
19147
|
+
ClassList.prototype.contains = function(name) {
|
|
19148
|
+
return (
|
|
19149
|
+
this.list ?
|
|
19150
|
+
this.list.contains(name) :
|
|
19151
|
+
!! ~index(this.array(), name)
|
|
19152
|
+
);
|
|
19153
|
+
};
|
|
19107
19154
|
|
|
19108
|
-
|
|
19155
|
+
function remove(element) {
|
|
19156
|
+
var parent = element.parentNode;
|
|
19109
19157
|
|
|
19110
|
-
|
|
19111
|
-
|
|
19112
|
-
|
|
19113
|
-
* @param {DOMElement} element
|
|
19114
|
-
* @return {DOMElement} the element (for chaining)
|
|
19115
|
-
*/
|
|
19116
|
-
function clear(element) {
|
|
19117
|
-
var child;
|
|
19158
|
+
if (parent) {
|
|
19159
|
+
parent.removeChild(element);
|
|
19160
|
+
}
|
|
19118
19161
|
|
|
19119
|
-
|
|
19120
|
-
remove(child);
|
|
19162
|
+
return element;
|
|
19121
19163
|
}
|
|
19122
19164
|
|
|
19123
|
-
|
|
19124
|
-
|
|
19125
|
-
|
|
19126
|
-
/**
|
|
19127
|
-
* Create utility for SVG elements
|
|
19128
|
-
*/
|
|
19129
|
-
|
|
19130
|
-
module.exports = create;
|
|
19131
|
-
|
|
19132
|
-
|
|
19133
|
-
var attr = _dereq_(84);
|
|
19134
|
-
var parse = _dereq_(94);
|
|
19135
|
-
var ns = _dereq_(93);
|
|
19165
|
+
/**
|
|
19166
|
+
* Clear utility
|
|
19167
|
+
*/
|
|
19136
19168
|
|
|
19169
|
+
/**
|
|
19170
|
+
* Removes all children from the given element
|
|
19171
|
+
*
|
|
19172
|
+
* @param {DOMElement} element
|
|
19173
|
+
* @return {DOMElement} the element (for chaining)
|
|
19174
|
+
*/
|
|
19175
|
+
function clear(element) {
|
|
19176
|
+
var child;
|
|
19137
19177
|
|
|
19138
|
-
|
|
19139
|
-
|
|
19140
|
-
|
|
19141
|
-
* @param {String} name the name or markup of the element
|
|
19142
|
-
* @param {Object} [attrs] attributes to set on the element
|
|
19143
|
-
*
|
|
19144
|
-
* @returns {SVGElement}
|
|
19145
|
-
*/
|
|
19146
|
-
function create(name, attrs) {
|
|
19147
|
-
var element;
|
|
19178
|
+
while ((child = element.firstChild)) {
|
|
19179
|
+
remove(child);
|
|
19180
|
+
}
|
|
19148
19181
|
|
|
19149
|
-
|
|
19150
|
-
element = parse(name).firstChild;
|
|
19151
|
-
element = document.importNode(element, true);
|
|
19152
|
-
} else {
|
|
19153
|
-
element = document.createElementNS(ns.svg, name);
|
|
19182
|
+
return element;
|
|
19154
19183
|
}
|
|
19155
19184
|
|
|
19156
|
-
|
|
19157
|
-
|
|
19185
|
+
function clone(element) {
|
|
19186
|
+
return element.cloneNode(true);
|
|
19158
19187
|
}
|
|
19159
19188
|
|
|
19160
|
-
|
|
19161
|
-
|
|
19162
|
-
}
|
|
19163
|
-
/**
|
|
19164
|
-
* Geometry helpers
|
|
19165
|
-
*/
|
|
19189
|
+
var ns = {
|
|
19190
|
+
svg: 'http://www.w3.org/2000/svg'
|
|
19191
|
+
};
|
|
19166
19192
|
|
|
19193
|
+
/**
|
|
19194
|
+
* DOM parsing utility
|
|
19195
|
+
*/
|
|
19167
19196
|
|
|
19168
|
-
var
|
|
19197
|
+
var SVG_START = '<svg xmlns="' + ns.svg + '"';
|
|
19169
19198
|
|
|
19170
|
-
|
|
19171
|
-
var node = create('svg');
|
|
19199
|
+
function parse(svg) {
|
|
19172
19200
|
|
|
19173
|
-
|
|
19174
|
-
|
|
19201
|
+
// ensure we import a valid svg document
|
|
19202
|
+
if (svg.substring(0, 4) === '<svg') {
|
|
19203
|
+
if (svg.indexOf(ns.svg) === -1) {
|
|
19204
|
+
svg = SVG_START + svg.substring(4);
|
|
19205
|
+
}
|
|
19206
|
+
} else {
|
|
19207
|
+
// namespace svg
|
|
19208
|
+
svg = SVG_START + '>' + svg + '</svg>';
|
|
19209
|
+
}
|
|
19175
19210
|
|
|
19176
|
-
|
|
19177
|
-
object[k] = props[k];
|
|
19211
|
+
return parseDocument(svg);
|
|
19178
19212
|
}
|
|
19179
19213
|
|
|
19180
|
-
|
|
19181
|
-
}
|
|
19214
|
+
function parseDocument(svg) {
|
|
19182
19215
|
|
|
19216
|
+
var parser;
|
|
19183
19217
|
|
|
19184
|
-
|
|
19185
|
-
|
|
19218
|
+
// parse
|
|
19219
|
+
parser = new DOMParser();
|
|
19220
|
+
parser.async = false;
|
|
19186
19221
|
|
|
19187
|
-
|
|
19188
|
-
case 0:
|
|
19189
|
-
return point;
|
|
19190
|
-
case 2:
|
|
19191
|
-
x = {
|
|
19192
|
-
x: x,
|
|
19193
|
-
y: y
|
|
19194
|
-
};
|
|
19195
|
-
break;
|
|
19222
|
+
return parser.parseFromString(svg, 'text/xml');
|
|
19196
19223
|
}
|
|
19197
19224
|
|
|
19198
|
-
|
|
19199
|
-
|
|
19225
|
+
/**
|
|
19226
|
+
* Create utility for SVG elements
|
|
19227
|
+
*/
|
|
19200
19228
|
|
|
19201
|
-
function createMatrix(a, b, c, d, e, f) {
|
|
19202
|
-
var matrix = node.createSVGMatrix();
|
|
19203
|
-
|
|
19204
|
-
switch (arguments.length) {
|
|
19205
|
-
case 0:
|
|
19206
|
-
return matrix;
|
|
19207
|
-
case 6:
|
|
19208
|
-
a = {
|
|
19209
|
-
a: a,
|
|
19210
|
-
b: b,
|
|
19211
|
-
c: c,
|
|
19212
|
-
d: d,
|
|
19213
|
-
e: e,
|
|
19214
|
-
f: f
|
|
19215
|
-
};
|
|
19216
|
-
break;
|
|
19217
|
-
}
|
|
19218
19229
|
|
|
19219
|
-
|
|
19220
|
-
|
|
19230
|
+
/**
|
|
19231
|
+
* Create a specific type from name or SVG markup.
|
|
19232
|
+
*
|
|
19233
|
+
* @param {String} name the name or markup of the element
|
|
19234
|
+
* @param {Object} [attrs] attributes to set on the element
|
|
19235
|
+
*
|
|
19236
|
+
* @returns {SVGElement}
|
|
19237
|
+
*/
|
|
19238
|
+
function create(name, attrs) {
|
|
19239
|
+
var element;
|
|
19221
19240
|
|
|
19222
|
-
|
|
19223
|
-
|
|
19224
|
-
|
|
19225
|
-
|
|
19226
|
-
|
|
19227
|
-
|
|
19228
|
-
}
|
|
19241
|
+
if (name.charAt(0) === '<') {
|
|
19242
|
+
element = parse(name).firstChild;
|
|
19243
|
+
element = document.importNode(element, true);
|
|
19244
|
+
} else {
|
|
19245
|
+
element = document.createElementNS(ns.svg, name);
|
|
19246
|
+
}
|
|
19229
19247
|
|
|
19248
|
+
if (attrs) {
|
|
19249
|
+
attr(element, attrs);
|
|
19250
|
+
}
|
|
19230
19251
|
|
|
19231
|
-
|
|
19232
|
-
|
|
19233
|
-
module.exports.createPoint = createPoint;
|
|
19234
|
-
},{"87":87}],89:[function(_dereq_,module,exports){
|
|
19235
|
-
/**
|
|
19236
|
-
* innerHTML like functionality for SVG elements.
|
|
19237
|
-
* based on innerSVG (https://code.google.com/p/innersvg)
|
|
19238
|
-
*/
|
|
19252
|
+
return element;
|
|
19253
|
+
}
|
|
19239
19254
|
|
|
19240
|
-
|
|
19255
|
+
/**
|
|
19256
|
+
* Events handling utility
|
|
19257
|
+
*/
|
|
19241
19258
|
|
|
19259
|
+
function on(node, event, listener, useCapture) {
|
|
19260
|
+
node.addEventListener(event, listener, useCapture);
|
|
19261
|
+
}
|
|
19242
19262
|
|
|
19243
|
-
|
|
19244
|
-
|
|
19245
|
-
|
|
19246
|
-
var serialize = _dereq_(95);
|
|
19263
|
+
function off(node, event, listener, useCapture) {
|
|
19264
|
+
node.removeEventListener(event, listener, useCapture);
|
|
19265
|
+
}
|
|
19247
19266
|
|
|
19267
|
+
/**
|
|
19268
|
+
* Geometry helpers
|
|
19269
|
+
*/
|
|
19248
19270
|
|
|
19249
|
-
|
|
19271
|
+
// fake node used to instantiate svg geometry elements
|
|
19272
|
+
var node = create('svg');
|
|
19250
19273
|
|
|
19251
|
-
|
|
19252
|
-
|
|
19274
|
+
function extend(object, props) {
|
|
19275
|
+
var i, k, keys = Object.keys(props);
|
|
19253
19276
|
|
|
19254
|
-
|
|
19255
|
-
|
|
19277
|
+
for (i = 0; (k = keys[i]); i++) {
|
|
19278
|
+
object[k] = props[k];
|
|
19279
|
+
}
|
|
19256
19280
|
|
|
19257
|
-
|
|
19258
|
-
return;
|
|
19281
|
+
return object;
|
|
19259
19282
|
}
|
|
19260
19283
|
|
|
19261
|
-
// import + append each node
|
|
19262
|
-
node = documentElement.firstChild;
|
|
19263
19284
|
|
|
19264
|
-
|
|
19265
|
-
|
|
19266
|
-
node = node.nextSibling;
|
|
19267
|
-
}
|
|
19268
|
-
}
|
|
19285
|
+
function createPoint(x, y) {
|
|
19286
|
+
var point = node.createSVGPoint();
|
|
19269
19287
|
|
|
19270
|
-
|
|
19271
|
-
|
|
19272
|
-
|
|
19288
|
+
switch (arguments.length) {
|
|
19289
|
+
case 0:
|
|
19290
|
+
return point;
|
|
19291
|
+
case 2:
|
|
19292
|
+
x = {
|
|
19293
|
+
x: x,
|
|
19294
|
+
y: y
|
|
19295
|
+
};
|
|
19296
|
+
break;
|
|
19297
|
+
}
|
|
19273
19298
|
|
|
19274
|
-
|
|
19275
|
-
serialize(child, output);
|
|
19276
|
-
child = child.nextSibling;
|
|
19299
|
+
return extend(point, x);
|
|
19277
19300
|
}
|
|
19278
19301
|
|
|
19279
|
-
|
|
19280
|
-
|
|
19302
|
+
function createMatrix(a, b, c, d, e, f) {
|
|
19303
|
+
var matrix = node.createSVGMatrix();
|
|
19281
19304
|
|
|
19282
|
-
|
|
19305
|
+
switch (arguments.length) {
|
|
19306
|
+
case 0:
|
|
19307
|
+
return matrix;
|
|
19308
|
+
case 6:
|
|
19309
|
+
a = {
|
|
19310
|
+
a: a,
|
|
19311
|
+
b: b,
|
|
19312
|
+
c: c,
|
|
19313
|
+
d: d,
|
|
19314
|
+
e: e,
|
|
19315
|
+
f: f
|
|
19316
|
+
};
|
|
19317
|
+
break;
|
|
19318
|
+
}
|
|
19283
19319
|
|
|
19284
|
-
|
|
19320
|
+
return extend(matrix, a);
|
|
19321
|
+
}
|
|
19285
19322
|
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
19289
|
-
|
|
19323
|
+
function createTransform(matrix) {
|
|
19324
|
+
if (matrix) {
|
|
19325
|
+
return node.createSVGTransformFromMatrix(matrix);
|
|
19326
|
+
} else {
|
|
19327
|
+
return node.createSVGTransform();
|
|
19290
19328
|
}
|
|
19291
|
-
|
|
19292
|
-
return element;
|
|
19293
|
-
} else {
|
|
19294
|
-
return get(element);
|
|
19295
19329
|
}
|
|
19296
|
-
}
|
|
19297
|
-
},{"83":83,"86":86,"94":94,"95":95}],90:[function(_dereq_,module,exports){
|
|
19298
|
-
module.exports = remove;
|
|
19299
19330
|
|
|
19300
|
-
|
|
19301
|
-
|
|
19331
|
+
/**
|
|
19332
|
+
* Serialization util
|
|
19333
|
+
*/
|
|
19302
19334
|
|
|
19303
|
-
|
|
19304
|
-
|
|
19305
|
-
}
|
|
19335
|
+
var TEXT_ENTITIES = /([&<>]{1})/g;
|
|
19336
|
+
var ATTR_ENTITIES = /([\n\r"]{1})/g;
|
|
19306
19337
|
|
|
19307
|
-
|
|
19308
|
-
|
|
19309
|
-
|
|
19310
|
-
|
|
19311
|
-
|
|
19312
|
-
|
|
19338
|
+
var ENTITY_REPLACEMENT = {
|
|
19339
|
+
'&': '&',
|
|
19340
|
+
'<': '<',
|
|
19341
|
+
'>': '>',
|
|
19342
|
+
'"': '\''
|
|
19343
|
+
};
|
|
19313
19344
|
|
|
19314
|
-
|
|
19345
|
+
function escape(str, pattern) {
|
|
19315
19346
|
|
|
19316
|
-
function
|
|
19317
|
-
|
|
19318
|
-
|
|
19319
|
-
|
|
19320
|
-
return
|
|
19347
|
+
function replaceFn(match, entity) {
|
|
19348
|
+
return ENTITY_REPLACEMENT[entity] || entity;
|
|
19349
|
+
}
|
|
19350
|
+
|
|
19351
|
+
return str.replace(pattern, replaceFn);
|
|
19321
19352
|
}
|
|
19322
|
-
}
|
|
19323
19353
|
|
|
19324
|
-
function
|
|
19325
|
-
var i, t;
|
|
19354
|
+
function serialize(node, output) {
|
|
19326
19355
|
|
|
19327
|
-
|
|
19356
|
+
var i, len, attrMap, attrNode, childNodes;
|
|
19328
19357
|
|
|
19329
|
-
|
|
19330
|
-
|
|
19331
|
-
|
|
19358
|
+
switch (node.nodeType) {
|
|
19359
|
+
// TEXT
|
|
19360
|
+
case 3:
|
|
19361
|
+
// replace special XML characters
|
|
19362
|
+
output.push(escape(node.textContent, TEXT_ENTITIES));
|
|
19363
|
+
break;
|
|
19332
19364
|
|
|
19333
|
-
|
|
19334
|
-
|
|
19365
|
+
// ELEMENT
|
|
19366
|
+
case 1:
|
|
19367
|
+
output.push('<', node.tagName);
|
|
19335
19368
|
|
|
19336
|
-
|
|
19337
|
-
|
|
19369
|
+
if (node.hasAttributes()) {
|
|
19370
|
+
attrMap = node.attributes;
|
|
19371
|
+
for (i = 0, len = attrMap.length; i < len; ++i) {
|
|
19372
|
+
attrNode = attrMap.item(i);
|
|
19373
|
+
output.push(' ', attrNode.name, '="', escape(attrNode.value, ATTR_ENTITIES), '"');
|
|
19374
|
+
}
|
|
19375
|
+
}
|
|
19338
19376
|
|
|
19339
|
-
|
|
19340
|
-
|
|
19341
|
-
|
|
19342
|
-
|
|
19343
|
-
|
|
19344
|
-
|
|
19345
|
-
|
|
19346
|
-
|
|
19347
|
-
|
|
19348
|
-
}
|
|
19349
|
-
|
|
19350
|
-
module.exports = ensureImported;
|
|
19377
|
+
if (node.hasChildNodes()) {
|
|
19378
|
+
output.push('>');
|
|
19379
|
+
childNodes = node.childNodes;
|
|
19380
|
+
for (i = 0, len = childNodes.length; i < len; ++i) {
|
|
19381
|
+
serialize(childNodes.item(i), output);
|
|
19382
|
+
}
|
|
19383
|
+
output.push('</', node.tagName, '>');
|
|
19384
|
+
} else {
|
|
19385
|
+
output.push('/>');
|
|
19386
|
+
}
|
|
19387
|
+
break;
|
|
19351
19388
|
|
|
19352
|
-
|
|
19389
|
+
// COMMENT
|
|
19390
|
+
case 8:
|
|
19391
|
+
output.push('<!--', escape(node.nodeValue, TEXT_ENTITIES), '-->');
|
|
19392
|
+
break;
|
|
19353
19393
|
|
|
19354
|
-
|
|
19355
|
-
|
|
19356
|
-
|
|
19357
|
-
|
|
19358
|
-
|
|
19359
|
-
|
|
19394
|
+
// CDATA
|
|
19395
|
+
case 4:
|
|
19396
|
+
output.push('<![CDATA[', node.nodeValue, ']]>');
|
|
19397
|
+
break;
|
|
19398
|
+
|
|
19399
|
+
default:
|
|
19400
|
+
throw new Error('unable to handle node ' + node.nodeType);
|
|
19360
19401
|
}
|
|
19402
|
+
|
|
19403
|
+
return output;
|
|
19361
19404
|
}
|
|
19362
19405
|
|
|
19363
|
-
|
|
19364
|
-
|
|
19365
|
-
|
|
19366
|
-
|
|
19367
|
-
svg: 'http://www.w3.org/2000/svg'
|
|
19368
|
-
};
|
|
19406
|
+
/**
|
|
19407
|
+
* innerHTML like functionality for SVG elements.
|
|
19408
|
+
* based on innerSVG (https://code.google.com/p/innersvg)
|
|
19409
|
+
*/
|
|
19369
19410
|
|
|
19370
|
-
module.exports = ns;
|
|
19371
|
-
},{}],94:[function(_dereq_,module,exports){
|
|
19372
|
-
/**
|
|
19373
|
-
* DOM parsing utility
|
|
19374
|
-
*/
|
|
19375
19411
|
|
|
19376
|
-
|
|
19412
|
+
function set(element, svg) {
|
|
19377
19413
|
|
|
19414
|
+
var node,
|
|
19415
|
+
documentElement = parse(svg).documentElement;
|
|
19378
19416
|
|
|
19379
|
-
|
|
19417
|
+
// clear element contents
|
|
19418
|
+
clear(element);
|
|
19380
19419
|
|
|
19381
|
-
|
|
19420
|
+
if (!svg) {
|
|
19421
|
+
return;
|
|
19422
|
+
}
|
|
19382
19423
|
|
|
19383
|
-
|
|
19424
|
+
// import + append each node
|
|
19425
|
+
node = documentElement.firstChild;
|
|
19384
19426
|
|
|
19385
|
-
|
|
19386
|
-
|
|
19387
|
-
|
|
19388
|
-
svg = SVG_START + svg.substring(4);
|
|
19427
|
+
while (node) {
|
|
19428
|
+
appendTo(node, element);
|
|
19429
|
+
node = node.nextSibling;
|
|
19389
19430
|
}
|
|
19390
|
-
} else {
|
|
19391
|
-
// namespace svg
|
|
19392
|
-
svg = SVG_START + '>' + svg + '</svg>';
|
|
19393
19431
|
}
|
|
19394
19432
|
|
|
19395
|
-
|
|
19396
|
-
|
|
19433
|
+
function get(element) {
|
|
19434
|
+
var child = element.firstChild,
|
|
19435
|
+
output = [];
|
|
19397
19436
|
|
|
19398
|
-
|
|
19437
|
+
while (child) {
|
|
19438
|
+
serialize(child, output);
|
|
19439
|
+
child = child.nextSibling;
|
|
19440
|
+
}
|
|
19399
19441
|
|
|
19400
|
-
|
|
19442
|
+
return output.join('');
|
|
19443
|
+
}
|
|
19401
19444
|
|
|
19402
|
-
|
|
19403
|
-
parser = new DOMParser();
|
|
19404
|
-
parser.async = false;
|
|
19445
|
+
function innerSVG(element, svg) {
|
|
19405
19446
|
|
|
19406
|
-
|
|
19407
|
-
}
|
|
19408
|
-
},{"93":93}],95:[function(_dereq_,module,exports){
|
|
19409
|
-
/**
|
|
19410
|
-
* Serialization util
|
|
19411
|
-
*/
|
|
19447
|
+
if (svg !== undefined) {
|
|
19412
19448
|
|
|
19413
|
-
|
|
19449
|
+
try {
|
|
19450
|
+
set(element, svg);
|
|
19451
|
+
} catch (e) {
|
|
19452
|
+
throw new Error('error parsing SVG: ' + e.message);
|
|
19453
|
+
}
|
|
19414
19454
|
|
|
19455
|
+
return element;
|
|
19456
|
+
} else {
|
|
19457
|
+
return get(element);
|
|
19458
|
+
}
|
|
19459
|
+
}
|
|
19415
19460
|
|
|
19416
|
-
|
|
19417
|
-
|
|
19461
|
+
/**
|
|
19462
|
+
* Selection utilities
|
|
19463
|
+
*/
|
|
19418
19464
|
|
|
19419
|
-
|
|
19420
|
-
|
|
19421
|
-
|
|
19422
|
-
'>': '>',
|
|
19423
|
-
'"': '\''
|
|
19424
|
-
};
|
|
19465
|
+
function select(node, selector) {
|
|
19466
|
+
return node.querySelector(selector);
|
|
19467
|
+
}
|
|
19425
19468
|
|
|
19426
|
-
function
|
|
19469
|
+
function selectAll(node, selector) {
|
|
19470
|
+
var nodes = node.querySelectorAll(selector);
|
|
19427
19471
|
|
|
19428
|
-
|
|
19429
|
-
|
|
19472
|
+
return [].map.call(nodes, function(element) {
|
|
19473
|
+
return element;
|
|
19474
|
+
});
|
|
19430
19475
|
}
|
|
19431
19476
|
|
|
19432
|
-
|
|
19433
|
-
|
|
19477
|
+
/**
|
|
19478
|
+
* Replace utility
|
|
19479
|
+
*/
|
|
19434
19480
|
|
|
19435
|
-
function
|
|
19481
|
+
function replace(element, replacement) {
|
|
19482
|
+
element.parentNode.replaceChild(ensureImported(replacement, element), element);
|
|
19483
|
+
return replacement;
|
|
19484
|
+
}
|
|
19436
19485
|
|
|
19437
|
-
|
|
19486
|
+
/**
|
|
19487
|
+
* transform accessor utility
|
|
19488
|
+
*/
|
|
19438
19489
|
|
|
19439
|
-
|
|
19440
|
-
|
|
19441
|
-
|
|
19442
|
-
|
|
19443
|
-
|
|
19444
|
-
|
|
19490
|
+
function wrapMatrix(transformList, transform) {
|
|
19491
|
+
if (transform instanceof SVGMatrix) {
|
|
19492
|
+
return transformList.createSVGTransformFromMatrix(transform);
|
|
19493
|
+
} else {
|
|
19494
|
+
return transform;
|
|
19495
|
+
}
|
|
19496
|
+
}
|
|
19445
19497
|
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
output.push('<', node.tagName);
|
|
19498
|
+
function setTransforms(transformList, transforms) {
|
|
19499
|
+
var i, t;
|
|
19449
19500
|
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
output.push(' ', attrNode.name, '="', escape(attrNode.value, ATTR_ENTITIES), '"');
|
|
19455
|
-
}
|
|
19501
|
+
transformList.clear();
|
|
19502
|
+
|
|
19503
|
+
for (i = 0; (t = transforms[i]); i++) {
|
|
19504
|
+
transformList.appendItem(wrapMatrix(transformList, t));
|
|
19456
19505
|
}
|
|
19457
19506
|
|
|
19458
|
-
|
|
19459
|
-
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
|
|
19463
|
-
|
|
19464
|
-
|
|
19507
|
+
transformList.consolidate();
|
|
19508
|
+
}
|
|
19509
|
+
|
|
19510
|
+
function transform(node, transforms) {
|
|
19511
|
+
var transformList = node.transform.baseVal;
|
|
19512
|
+
|
|
19513
|
+
if (arguments.length === 1) {
|
|
19514
|
+
return transformList.consolidate();
|
|
19465
19515
|
} else {
|
|
19466
|
-
|
|
19516
|
+
if (transforms.length) {
|
|
19517
|
+
setTransforms(transformList, transforms);
|
|
19518
|
+
} else {
|
|
19519
|
+
transformList.initialize(wrapMatrix(transformList, transforms));
|
|
19520
|
+
}
|
|
19467
19521
|
}
|
|
19468
|
-
|
|
19522
|
+
}
|
|
19469
19523
|
|
|
19470
|
-
|
|
19471
|
-
|
|
19472
|
-
|
|
19473
|
-
|
|
19524
|
+
exports.append = append;
|
|
19525
|
+
exports.appendTo = appendTo;
|
|
19526
|
+
exports.attr = attr;
|
|
19527
|
+
exports.classes = classes;
|
|
19528
|
+
exports.clear = clear;
|
|
19529
|
+
exports.clone = clone;
|
|
19530
|
+
exports.create = create;
|
|
19531
|
+
exports.innerSVG = innerSVG;
|
|
19532
|
+
exports.remove = remove;
|
|
19533
|
+
exports.replace = replace;
|
|
19534
|
+
exports.transform = transform;
|
|
19535
|
+
exports.on = on;
|
|
19536
|
+
exports.off = off;
|
|
19537
|
+
exports.createPoint = createPoint;
|
|
19538
|
+
exports.createMatrix = createMatrix;
|
|
19539
|
+
exports.createTransform = createTransform;
|
|
19540
|
+
exports.select = select;
|
|
19541
|
+
exports.selectAll = selectAll;
|
|
19474
19542
|
|
|
19475
|
-
|
|
19476
|
-
case 4:
|
|
19477
|
-
output.push('<![CDATA[', node.nodeValue, ']]>');
|
|
19478
|
-
break;
|
|
19543
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
19479
19544
|
|
|
19480
|
-
|
|
19481
|
-
throw new Error('unable to handle node ' + node.nodeType);
|
|
19482
|
-
}
|
|
19545
|
+
})));
|
|
19483
19546
|
|
|
19484
|
-
return output;
|
|
19485
|
-
}
|
|
19486
19547
|
},{}]},{},[1])(1)
|
|
19487
19548
|
});
|