@contrail/documents 1.3.18 → 1.3.19
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DocumentElement } from '../types';
|
|
2
2
|
export declare class ItemComponentService {
|
|
3
3
|
static isItemComponent(element: DocumentElement): boolean;
|
|
4
|
+
static isThumbnailOnlyComponent(element: DocumentElement): boolean;
|
|
4
5
|
static updateSizeAndPosition(propertyElements: any[], componentElement: DocumentElement, annotatedElements?: any[]): any;
|
|
5
6
|
private static getYMargin;
|
|
6
7
|
private static calculateAnnotationHeight;
|
|
@@ -7,6 +7,14 @@ class ItemComponentService {
|
|
|
7
7
|
var _a;
|
|
8
8
|
return element && element.type === 'component' && ((_a = element.modelBindings) === null || _a === void 0 ? void 0 : _a.item);
|
|
9
9
|
}
|
|
10
|
+
static isThumbnailOnlyComponent(element) {
|
|
11
|
+
var _a;
|
|
12
|
+
if (!((_a = element === null || element === void 0 ? void 0 : element.elements) === null || _a === void 0 ? void 0 : _a.length) || element.elements.length > 2)
|
|
13
|
+
return false;
|
|
14
|
+
const annotationElement = element.elements.find((e) => e.type == 'annotation');
|
|
15
|
+
const imageElement = element.elements.find((e) => e.type == 'image');
|
|
16
|
+
return (!annotationElement || annotationElement.isHidden) && imageElement && !imageElement.isHidden;
|
|
17
|
+
}
|
|
10
18
|
static updateSizeAndPosition(propertyElements, componentElement, annotatedElements = []) {
|
|
11
19
|
const newElements = [];
|
|
12
20
|
let lastYPosition = 0;
|