bpmn-js 0.30.0 → 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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-viewer v0.30.0
2
+ * bpmn-js - bpmn-viewer v0.31.0
3
3
  *
4
4
  * Copyright (c) 2014-present, camunda Services GmbH
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Source Code: https://github.com/bpmn-io/bpmn-js
10
10
  *
11
- * Date: 2018-04-01
11
+ * Date: 2018-04-02
12
12
  */
13
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
  /**
@@ -15561,7 +15561,8 @@ var Types = _dereq_(76),
15561
15561
  serializeAsProperty = common.serializeAsProperty;
15562
15562
 
15563
15563
  var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
15564
- ESCAPE_CHARS = /(<|>|'|"|&|\n\r|\n)/g,
15564
+ ESCAPE_ATTR_CHARS = /<|>|'|"|&|\n\r|\n/g,
15565
+ ESCAPE_CHARS = /<|>|&/g,
15565
15566
  DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
15566
15567
  XSI_TYPE = common.XSI_TYPE;
15567
15568
 
@@ -15707,16 +15708,32 @@ function getSerializableProperties(element) {
15707
15708
  });
15708
15709
  }
15709
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
+
15710
15721
  var ESCAPE_MAP = {
15711
- '\n': '10',
15712
- '\n\r': '10',
15713
- '"': '34',
15714
- '\'': '39',
15715
- '<': '60',
15716
- '>': '62',
15717
- '&': '38'
15722
+ '<': 'lt',
15723
+ '>': 'gt',
15724
+ '&': 'amp'
15718
15725
  };
15719
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
+
15720
15737
  /**
15721
15738
  * Escape a string attribute to not contain any bad values (line breaks, '"', ...)
15722
15739
  *
@@ -15724,13 +15741,11 @@ var ESCAPE_MAP = {
15724
15741
  * @return {String} the escaped string
15725
15742
  */
15726
15743
  function escapeAttr(str) {
15744
+ return escape(str, ESCAPE_ATTR_CHARS, ESCAPE_ATTR_MAP);
15745
+ }
15727
15746
 
15728
- // ensure we are handling strings here
15729
- str = isString(str) ? str : '' + str;
15730
-
15731
- return str.replace(ESCAPE_CHARS, function(str) {
15732
- return '&#' + ESCAPE_MAP[str] + ';';
15733
- });
15747
+ function escapeBody(str) {
15748
+ return escape(str, ESCAPE_CHARS, ESCAPE_MAP);
15734
15749
  }
15735
15750
 
15736
15751
  function filterAttributes(props) {
@@ -15760,18 +15775,13 @@ ReferenceSerializer.prototype.serializeTo = function(writer) {
15760
15775
 
15761
15776
  function BodySerializer() {}
15762
15777
 
15763
- BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {
15764
- var escape = this.escape;
15765
-
15766
- if (escape) {
15767
- writer.append('<![CDATA[');
15768
- }
15769
-
15770
- writer.append(this.value);
15771
-
15772
- if (escape) {
15773
- writer.append(']]>');
15774
- }
15778
+ BodySerializer.prototype.serializeValue =
15779
+ BodySerializer.prototype.serializeTo = function(writer) {
15780
+ writer.append(
15781
+ this.escape
15782
+ ? escapeBody(this.value)
15783
+ : this.value
15784
+ );
15775
15785
  };
15776
15786
 
15777
15787
  BodySerializer.prototype.build = function(prop, value) {