@contrail/documents 1.0.30 → 1.0.32

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.
@@ -29,8 +29,15 @@ class DocumentElementFactory {
29
29
  return element;
30
30
  }
31
31
  static createElement(type, options = {}) {
32
+ var _a;
32
33
  let element = this.initNewElement(type);
33
34
  element = Object.assign(element, options);
35
+ if (((_a = element === null || element === void 0 ? void 0 : element.elements) === null || _a === void 0 ? void 0 : _a.length) > 0) {
36
+ element.elements = element.elements.map((e) => {
37
+ e.id = (0, nanoid_1.nanoid)(16);
38
+ return e;
39
+ });
40
+ }
34
41
  return element;
35
42
  }
36
43
  static createImageElement(options) {
@@ -39,6 +46,7 @@ class DocumentElementFactory {
39
46
  return element;
40
47
  }
41
48
  static createComponent(componentType, model, modelBindings, options) {
49
+ var _a;
42
50
  let element = this.initNewElement('component');
43
51
  if (options) {
44
52
  element = Object.assign(element, options);
@@ -48,6 +56,12 @@ class DocumentElementFactory {
48
56
  document_element_property_binding_handler_1.DocumentElementPropertyBindingHandler.bindPropertiesToElements(elements, model);
49
57
  element.elements = elements;
50
58
  element.modelBindings = modelBindings;
59
+ if (((_a = element === null || element === void 0 ? void 0 : element.elements) === null || _a === void 0 ? void 0 : _a.length) > 0) {
60
+ element.elements = element.elements.map((e) => {
61
+ e.id = (0, nanoid_1.nanoid)(16);
62
+ return e;
63
+ });
64
+ }
51
65
  return element;
52
66
  }
53
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/documents",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "Documents library for contrail platform",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",