camunda-bpmn-js 0.16.0 → 0.16.1

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.
@@ -45661,10 +45661,14 @@
45661
45661
  target = context.parent,
45662
45662
  elements = context.elements;
45663
45663
 
45664
- var canReplace = bpmnRules.canReplace(elements, target);
45664
+ var elementReplacements = reduce(elements, function(replacements, element) {
45665
+ var canReplace = bpmnRules.canReplace([ element ], element.host || element.parent || target);
45665
45666
 
45666
- if (canReplace) {
45667
- this.replaceElements(elements, canReplace.replacements);
45667
+ return canReplace ? replacements.concat(canReplace.replacements) : replacements;
45668
+ }, []);
45669
+
45670
+ if (elementReplacements.length) {
45671
+ this.replaceElements(elements, elementReplacements);
45668
45672
  }
45669
45673
  }, this);
45670
45674