@contrail/documents 1.3.27 → 1.3.29
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 +13 -0
- package/lib/document-element-factory.js +12 -12
- package/lib/types/document-element.d.ts +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@contrail/documents` are documented here.
|
|
4
|
+
|
|
5
|
+
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
|
+
Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.3.25] - (initial changelog entry)
|
|
11
|
+
|
|
12
|
+
- Initial changelog. Prior releases did not include a changelog.
|
|
13
|
+
See git history for changes predating this entry.
|
|
@@ -37,7 +37,7 @@ class DocumentElementFactory {
|
|
|
37
37
|
let element = this.initNewElement(type);
|
|
38
38
|
element = Object.assign(element, options);
|
|
39
39
|
if (((_a = element === null || element === void 0 ? void 0 : element.elements) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
40
|
-
element.elements = element.elements.map(e => {
|
|
40
|
+
element.elements = element.elements.map((e) => {
|
|
41
41
|
e.id = (0, nanoid_1.nanoid)(16);
|
|
42
42
|
return e;
|
|
43
43
|
});
|
|
@@ -81,7 +81,7 @@ class DocumentElementFactory {
|
|
|
81
81
|
element.elements = elements;
|
|
82
82
|
element.modelBindings = modelBindings;
|
|
83
83
|
if (((_a = element === null || element === void 0 ? void 0 : element.elements) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
84
|
-
element.elements = element.elements.map(e => {
|
|
84
|
+
element.elements = element.elements.map((e) => {
|
|
85
85
|
e.id = (0, nanoid_1.nanoid)(16);
|
|
86
86
|
return e;
|
|
87
87
|
});
|
|
@@ -114,7 +114,7 @@ class DocumentElementFactory {
|
|
|
114
114
|
}
|
|
115
115
|
const newInnerElements = [];
|
|
116
116
|
if (newElement.type === 'table') {
|
|
117
|
-
const oldChildElements = elements.filter(e => e.tableId === element.id && ['cell', 'column', 'row'].indexOf(e.type) !== -1);
|
|
117
|
+
const oldChildElements = elements.filter((e) => e.tableId === element.id && ['cell', 'column', 'row'].indexOf(e.type) !== -1);
|
|
118
118
|
let newTableElement, newChildElements = [];
|
|
119
119
|
try {
|
|
120
120
|
[newTableElement, ...newChildElements] = document_table_1.TableCopyService.copy(newElement, oldChildElements);
|
|
@@ -125,7 +125,7 @@ class DocumentElementFactory {
|
|
|
125
125
|
continue;
|
|
126
126
|
}
|
|
127
127
|
newElement = newTableElement;
|
|
128
|
-
newChildElements.forEach(newChildElement => {
|
|
128
|
+
newChildElements.forEach((newChildElement) => {
|
|
129
129
|
var _a;
|
|
130
130
|
let oldChildId;
|
|
131
131
|
if (newChildElement.type === 'row') {
|
|
@@ -137,7 +137,7 @@ class DocumentElementFactory {
|
|
|
137
137
|
else if (newChildElement.type === 'cell') {
|
|
138
138
|
const oldRowId = element.rowIds[newTableElement.rowIds.indexOf(newChildElement.rowId)];
|
|
139
139
|
const oldColumnId = element.columnIds[newTableElement.columnIds.indexOf(newChildElement.columnId)];
|
|
140
|
-
oldChildId = (_a = elements.find(e => e.type === 'cell' && e.rowId === oldRowId && e.columnId === oldColumnId)) === null || _a === void 0 ? void 0 : _a.id;
|
|
140
|
+
oldChildId = (_a = elements.find((e) => e.type === 'cell' && e.rowId === oldRowId && e.columnId === oldColumnId)) === null || _a === void 0 ? void 0 : _a.id;
|
|
141
141
|
}
|
|
142
142
|
newChildElement.documentId = documentId;
|
|
143
143
|
newChildElement.specifiedId = newChildElement.id;
|
|
@@ -175,18 +175,18 @@ class DocumentElementFactory {
|
|
|
175
175
|
if (DocumentElementFactory.isMask(newElement))
|
|
176
176
|
maskElements.push(newElement);
|
|
177
177
|
}
|
|
178
|
-
groupElements.forEach(groupElement => {
|
|
178
|
+
groupElements.forEach((groupElement) => {
|
|
179
179
|
groupElement.elementIds = groupElement.elementIds
|
|
180
|
-
.map(oldElementId => oldIdToNewId.get(oldElementId))
|
|
181
|
-
.filter(id => !!id);
|
|
180
|
+
.map((oldElementId) => oldIdToNewId.get(oldElementId))
|
|
181
|
+
.filter((id) => !!id);
|
|
182
182
|
});
|
|
183
|
-
maskElements.forEach(maskElement => {
|
|
183
|
+
maskElements.forEach((maskElement) => {
|
|
184
184
|
const newElementIds = maskElement.elementIds
|
|
185
|
-
.map(oldElementId => oldIdToNewId.get(oldElementId))
|
|
186
|
-
.filter(id => !!id);
|
|
185
|
+
.map((oldElementId) => oldIdToNewId.get(oldElementId))
|
|
186
|
+
.filter((id) => !!id);
|
|
187
187
|
maskElement.elementIds = (newElementIds === null || newElementIds === void 0 ? void 0 : newElementIds.length) > 0 ? newElementIds : null;
|
|
188
188
|
});
|
|
189
|
-
calloutElements.forEach(calloutElement => {
|
|
189
|
+
calloutElements.forEach((calloutElement) => {
|
|
190
190
|
if (calloutElement.start.id) {
|
|
191
191
|
const startId = oldIdToNewId.get(calloutElement.start.id);
|
|
192
192
|
if (startId) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropertyLevel } from '@contrail/types';
|
|
2
|
-
import { CropDefinition, LineDefinition, PositionDefinition, RotationDefinition } from './common';
|
|
2
|
+
import { CropDefinition, LineDefinition, PositionDefinition, RotationDefinition, SizeDefinition } from './common';
|
|
3
3
|
import { Document } from './document';
|
|
4
4
|
import { ScaleTransformation } from './element-transformation';
|
|
5
5
|
export interface AlternateUrls {
|
|
@@ -45,6 +45,8 @@ export interface DocumentElement extends Document {
|
|
|
45
45
|
rowspan?: number;
|
|
46
46
|
start?: LinkedEdgeDefinition;
|
|
47
47
|
end?: LinkedEdgeDefinition;
|
|
48
|
+
imageSize?: SizeDefinition;
|
|
49
|
+
imagePosition?: PositionDefinition;
|
|
48
50
|
propertyBindingsMetaData?: {
|
|
49
51
|
displayFunction: string;
|
|
50
52
|
propertyType: string;
|