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-navigated-viewer v0.30.0
2
+ * bpmn-js - bpmn-navigated-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
  'use strict';
@@ -16040,7 +16040,8 @@ var Types = _dereq_(85),
16040
16040
  serializeAsProperty = common.serializeAsProperty;
16041
16041
 
16042
16042
  var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
16043
- ESCAPE_CHARS = /(<|>|'|"|&|\n\r|\n)/g,
16043
+ ESCAPE_ATTR_CHARS = /<|>|'|"|&|\n\r|\n/g,
16044
+ ESCAPE_CHARS = /<|>|&/g,
16044
16045
  DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
16045
16046
  XSI_TYPE = common.XSI_TYPE;
16046
16047
 
@@ -16186,16 +16187,32 @@ function getSerializableProperties(element) {
16186
16187
  });
16187
16188
  }
16188
16189
 
16190
+ var ESCAPE_ATTR_MAP = {
16191
+ '\n': '#10',
16192
+ '\n\r': '#10',
16193
+ '"': '#34',
16194
+ '\'': '#39',
16195
+ '<': '#60',
16196
+ '>': '#62',
16197
+ '&': '#38'
16198
+ };
16199
+
16189
16200
  var ESCAPE_MAP = {
16190
- '\n': '10',
16191
- '\n\r': '10',
16192
- '"': '34',
16193
- '\'': '39',
16194
- '<': '60',
16195
- '>': '62',
16196
- '&': '38'
16201
+ '<': 'lt',
16202
+ '>': 'gt',
16203
+ '&': 'amp'
16197
16204
  };
16198
16205
 
16206
+ function escape(str, charPattern, replaceMap) {
16207
+
16208
+ // ensure we are handling strings here
16209
+ str = isString(str) ? str : '' + str;
16210
+
16211
+ return str.replace(charPattern, function(s) {
16212
+ return '&' + replaceMap[s] + ';';
16213
+ });
16214
+ }
16215
+
16199
16216
  /**
16200
16217
  * Escape a string attribute to not contain any bad values (line breaks, '"', ...)
16201
16218
  *
@@ -16203,13 +16220,11 @@ var ESCAPE_MAP = {
16203
16220
  * @return {String} the escaped string
16204
16221
  */
16205
16222
  function escapeAttr(str) {
16223
+ return escape(str, ESCAPE_ATTR_CHARS, ESCAPE_ATTR_MAP);
16224
+ }
16206
16225
 
16207
- // ensure we are handling strings here
16208
- str = isString(str) ? str : '' + str;
16209
-
16210
- return str.replace(ESCAPE_CHARS, function(str) {
16211
- return '&#' + ESCAPE_MAP[str] + ';';
16212
- });
16226
+ function escapeBody(str) {
16227
+ return escape(str, ESCAPE_CHARS, ESCAPE_MAP);
16213
16228
  }
16214
16229
 
16215
16230
  function filterAttributes(props) {
@@ -16239,18 +16254,13 @@ ReferenceSerializer.prototype.serializeTo = function(writer) {
16239
16254
 
16240
16255
  function BodySerializer() {}
16241
16256
 
16242
- BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {
16243
- var escape = this.escape;
16244
-
16245
- if (escape) {
16246
- writer.append('<![CDATA[');
16247
- }
16248
-
16249
- writer.append(this.value);
16250
-
16251
- if (escape) {
16252
- writer.append(']]>');
16253
- }
16257
+ BodySerializer.prototype.serializeValue =
16258
+ BodySerializer.prototype.serializeTo = function(writer) {
16259
+ writer.append(
16260
+ this.escape
16261
+ ? escapeBody(this.value)
16262
+ : this.value
16263
+ );
16254
16264
  };
16255
16265
 
16256
16266
  BodySerializer.prototype.build = function(prop, value) {