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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ All notable changes to [bpmn-js](https://github.com/bpmn-io/bpmn-js) are documen
6
6
 
7
7
  ___Note:__ Yet to be released changes appear here._
8
8
 
9
+ ## 0.31.0
10
+
11
+ * `FEAT`: encode entities in body properties during XML export
12
+ * `CHORE`: bump to [`bpmn-moddle@4.0.0`](https://github.com/bpmn-io/bpmn-moddle/releases/tag/v4.0.0)
13
+ * `CHORE`: bump utility version
14
+
9
15
  ## 0.30.0
10
16
 
11
17
  * `CHORE`: bump to [`diagram-js@0.31.0`](https://github.com/bpmn-io/diagram-js/releases/tag/v0.31.0)
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v0.30.0
2
+ * bpmn-js - bpmn-modeler 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';
@@ -46436,7 +46436,8 @@ var Types = _dereq_(297),
46436
46436
  serializeAsProperty = common.serializeAsProperty;
46437
46437
 
46438
46438
  var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
46439
- ESCAPE_CHARS = /(<|>|'|"|&|\n\r|\n)/g,
46439
+ ESCAPE_ATTR_CHARS = /<|>|'|"|&|\n\r|\n/g,
46440
+ ESCAPE_CHARS = /<|>|&/g,
46440
46441
  DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
46441
46442
  XSI_TYPE = common.XSI_TYPE;
46442
46443
 
@@ -46582,16 +46583,32 @@ function getSerializableProperties(element) {
46582
46583
  });
46583
46584
  }
46584
46585
 
46586
+ var ESCAPE_ATTR_MAP = {
46587
+ '\n': '#10',
46588
+ '\n\r': '#10',
46589
+ '"': '#34',
46590
+ '\'': '#39',
46591
+ '<': '#60',
46592
+ '>': '#62',
46593
+ '&': '#38'
46594
+ };
46595
+
46585
46596
  var ESCAPE_MAP = {
46586
- '\n': '10',
46587
- '\n\r': '10',
46588
- '"': '34',
46589
- '\'': '39',
46590
- '<': '60',
46591
- '>': '62',
46592
- '&': '38'
46597
+ '<': 'lt',
46598
+ '>': 'gt',
46599
+ '&': 'amp'
46593
46600
  };
46594
46601
 
46602
+ function escape(str, charPattern, replaceMap) {
46603
+
46604
+ // ensure we are handling strings here
46605
+ str = isString(str) ? str : '' + str;
46606
+
46607
+ return str.replace(charPattern, function(s) {
46608
+ return '&' + replaceMap[s] + ';';
46609
+ });
46610
+ }
46611
+
46595
46612
  /**
46596
46613
  * Escape a string attribute to not contain any bad values (line breaks, '"', ...)
46597
46614
  *
@@ -46599,13 +46616,11 @@ var ESCAPE_MAP = {
46599
46616
  * @return {String} the escaped string
46600
46617
  */
46601
46618
  function escapeAttr(str) {
46619
+ return escape(str, ESCAPE_ATTR_CHARS, ESCAPE_ATTR_MAP);
46620
+ }
46602
46621
 
46603
- // ensure we are handling strings here
46604
- str = isString(str) ? str : '' + str;
46605
-
46606
- return str.replace(ESCAPE_CHARS, function(str) {
46607
- return '&#' + ESCAPE_MAP[str] + ';';
46608
- });
46622
+ function escapeBody(str) {
46623
+ return escape(str, ESCAPE_CHARS, ESCAPE_MAP);
46609
46624
  }
46610
46625
 
46611
46626
  function filterAttributes(props) {
@@ -46635,18 +46650,13 @@ ReferenceSerializer.prototype.serializeTo = function(writer) {
46635
46650
 
46636
46651
  function BodySerializer() {}
46637
46652
 
46638
- BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {
46639
- var escape = this.escape;
46640
-
46641
- if (escape) {
46642
- writer.append('<![CDATA[');
46643
- }
46644
-
46645
- writer.append(this.value);
46646
-
46647
- if (escape) {
46648
- writer.append(']]>');
46649
- }
46653
+ BodySerializer.prototype.serializeValue =
46654
+ BodySerializer.prototype.serializeTo = function(writer) {
46655
+ writer.append(
46656
+ this.escape
46657
+ ? escapeBody(this.value)
46658
+ : this.value
46659
+ );
46650
46660
  };
46651
46661
 
46652
46662
  BodySerializer.prototype.build = function(prop, value) {