@contrail/documents 1.1.3 → 1.1.5
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.
|
@@ -6,12 +6,12 @@ const common_1 = require("./types/common");
|
|
|
6
6
|
const util_1 = require("@contrail/util");
|
|
7
7
|
class DocumentElementPropertyBindingHandler {
|
|
8
8
|
static bindPropertiesToElements(elements, model) {
|
|
9
|
-
elements.map(
|
|
9
|
+
elements.map(el => {
|
|
10
10
|
this.bindPropertiesToElement(el, model);
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
static bindPropertiesToElement(element, model) {
|
|
14
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
14
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
15
15
|
const localModel = Object.assign({}, model);
|
|
16
16
|
if (!element.propertyBindings) {
|
|
17
17
|
return;
|
|
@@ -34,7 +34,7 @@ class DocumentElementPropertyBindingHandler {
|
|
|
34
34
|
let viewableObject;
|
|
35
35
|
const content = (_e = model === null || model === void 0 ? void 0 : model.viewable) === null || _e === void 0 ? void 0 : _e.content;
|
|
36
36
|
if ((content === null || content === void 0 ? void 0 : content.length) > 0) {
|
|
37
|
-
const primaryContent = content.find(
|
|
37
|
+
const primaryContent = content.find(c => { var _a; return (c === null || c === void 0 ? void 0 : c.id) === ((_a = model === null || model === void 0 ? void 0 : model.viewable) === null || _a === void 0 ? void 0 : _a.primaryViewableId); });
|
|
38
38
|
viewableObject = primaryContent;
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
@@ -58,6 +58,10 @@ class DocumentElementPropertyBindingHandler {
|
|
|
58
58
|
if (lowResUrl) {
|
|
59
59
|
element.alternateUrls.lowResolution = lowResUrl;
|
|
60
60
|
}
|
|
61
|
+
let tinyResUrl = ((_h = model === null || model === void 0 ? void 0 : model.viewable) === null || _h === void 0 ? void 0 : _h.tinyViewableDownloadUrl) || ((_j = model === null || model === void 0 ? void 0 : model.viewable) === null || _j === void 0 ? void 0 : _j.tinyViewableUrl);
|
|
62
|
+
if (tinyResUrl) {
|
|
63
|
+
element.alternateUrls.tinyResolution = tinyResUrl;
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
if (element.elements) {
|
|
63
67
|
this.bindPropertiesToElements(element.elements, localModel);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrail/documents",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
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
|
"dependencies": {
|
|
41
41
|
"@contrail/actions": "^1.0.14",
|
|
42
42
|
"@contrail/document-table": "^1.0.2",
|
|
43
|
-
"@contrail/types": "^3.0.
|
|
43
|
+
"@contrail/types": "^3.0.95",
|
|
44
44
|
"@contrail/util": "^1.0.19",
|
|
45
45
|
"reflect-metadata": "^0.1.13"
|
|
46
46
|
}
|