@contrail/documents 1.0.118 → 1.0.120
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.
|
@@ -186,7 +186,7 @@ exports.PATTERN_VIEW_TEMPLATE = {
|
|
|
186
186
|
position: { x: exports.COLOR_PADDING, y: exports.COLOR_PADDING },
|
|
187
187
|
size: { height: exports.COLOR_WIDTH, width: exports.COLOR_WIDTH },
|
|
188
188
|
style: { background: { size: types_1.BackgroundSizeType.CONTAIN } },
|
|
189
|
-
propertyBindings: { url: '
|
|
189
|
+
propertyBindings: { url: 'viewable.mediumViewableDownloadUrl' },
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
192
|
type: 'text',
|
|
@@ -8,6 +8,7 @@ export declare class DocumentElementFactory {
|
|
|
8
8
|
static createElement(type: string, options?: DocumentElement): DocumentElement;
|
|
9
9
|
static createImageElement(options: DocumentElement): DocumentElement;
|
|
10
10
|
static createFrameElement(options: DocumentElement): DocumentElement;
|
|
11
|
+
static createColorComponent(model: any, modelBindings: any, options?: DocumentElement): DocumentElement;
|
|
11
12
|
static createComponent(componentType: string, model: any, modelBindings: any, options?: DocumentElement): DocumentElement;
|
|
12
13
|
static createComponentFromComponentDefinition(componentDefinition: ComponentDefinition, model: any, modelBindings: any, options?: DocumentElement): DocumentElement;
|
|
13
14
|
static copyElements(elements: DocumentElement[], documentId?: string, commonOptions?: DocumentElement, positionOffset?: PositionDefinition, lastFrameNumber?: number): {
|
|
@@ -52,6 +52,13 @@ class DocumentElementFactory {
|
|
|
52
52
|
element = Object.assign(element, options);
|
|
53
53
|
return element;
|
|
54
54
|
}
|
|
55
|
+
static createColorComponent(model, modelBindings, options) {
|
|
56
|
+
var _a;
|
|
57
|
+
return DocumentElementFactory.createComponent(((_a = model === null || model === void 0 ? void 0 : model.color) === null || _a === void 0 ? void 0 : _a.primaryViewableId) ? 'pattern-view' : 'color-view', model, modelBindings, Object.assign({
|
|
58
|
+
size: components_1.COLOR_WIDTH + components_1.COLOR_PADDING * 2,
|
|
59
|
+
height: components_1.COLOR_WIDTH + components_1.COLOR_FONT_SIZE + components_1.COLOR_PADDING * 4,
|
|
60
|
+
}, options));
|
|
61
|
+
}
|
|
55
62
|
static createComponent(componentType, model, modelBindings, options) {
|
|
56
63
|
const componentDefinition = components_1.ComponentRegistry.getComponentDefinition(componentType);
|
|
57
64
|
return this.createComponentFromComponentDefinition(componentDefinition, model, modelBindings, options);
|