@contrail/documents 1.14.0 → 1.14.2-alpha.3d9f192

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.
@@ -90,7 +90,7 @@ class DocumentElementFactory {
90
90
  return element;
91
91
  }
92
92
  static copyElements(elements, documentId, commonOptions = {}, positionOffset, lastFrameNumber) {
93
- var _a, _b;
93
+ var _a, _b, _c;
94
94
  const oldIdToNewId = new Map();
95
95
  const newElements = [];
96
96
  const groupElements = [];
@@ -118,11 +118,10 @@ class DocumentElementFactory {
118
118
  const oldChildElements = elements.filter((e) => e.tableId === element.id && ['cell', 'column', 'row'].indexOf(e.type) !== -1);
119
119
  let newTableElement, newChildElements = [];
120
120
  try {
121
- [newTableElement, ...newChildElements] = document_table_1.TableCopyService.copy(newElement, oldChildElements);
121
+ [newTableElement, ...newChildElements] = document_table_1.TableCopyService.copy(element, oldChildElements);
122
122
  }
123
- catch (e) { }
124
- if (oldChildElements.length > newChildElements.length || oldChildElements.length === 0) {
125
- telemetry_1.logger.warn({ newElement, oldChildElements, newChildElements }, 'Invalid table element to copy');
123
+ catch (e) {
124
+ telemetry_1.logger.warn({ element, oldChildElements, newChildElements }, (_b = e === null || e === void 0 ? void 0 : e.message) !== null && _b !== void 0 ? _b : 'Invalid table element to copy');
126
125
  continue;
127
126
  }
128
127
  newElement = newTableElement;
@@ -159,7 +158,7 @@ class DocumentElementFactory {
159
158
  newElement.position.x = newElement.position.x + positionOffset.x;
160
159
  newElement.position.y = newElement.position.y + positionOffset.y;
161
160
  }
162
- if (['line', 'callout'].includes(newElement.type) && ((_b = newElement.points) === null || _b === void 0 ? void 0 : _b.length) > 0) {
161
+ if (['line', 'callout'].includes(newElement.type) && ((_c = newElement.points) === null || _c === void 0 ? void 0 : _c.length) > 0) {
163
162
  newElement.points = newElement.points.map(([x, y]) => [x + positionOffset.x, y + positionOffset.y]);
164
163
  }
165
164
  }
@@ -20,6 +20,8 @@ export interface DocumentElement extends Document {
20
20
  sortIndex?: string;
21
21
  type?: string;
22
22
  rotate?: RotationDefinition;
23
+ flipH?: boolean;
24
+ flipV?: boolean;
23
25
  scale?: ScaleTransformation;
24
26
  text?: string;
25
27
  url?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/documents",
3
- "version": "1.14.0",
3
+ "version": "1.14.2-alpha.3d9f192",
4
4
  "description": "Documents library for contrail platform",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@contrail/actions": "^1.0.18",
43
- "@contrail/document-table": "^1.1.0",
43
+ "@contrail/document-table": "^1.2.3",
44
44
  "@contrail/document-util": "^1.2.0",
45
45
  "@contrail/types": "^3.4.0",
46
46
  "fractional-indexing": "^2.1.0",