@contrail/documents
Advanced tools
Comparing version 1.0.58 to 1.0.59
@@ -12,3 +12,3 @@ "use strict"; | ||
static bindPropertiesToElement(element, model) { | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
const localModel = Object.assign({}, model); | ||
@@ -29,9 +29,15 @@ if (!element.propertyBindings) { | ||
const content = (_e = model === null || model === void 0 ? void 0 : model.viewable) === null || _e === void 0 ? void 0 : _e.content; | ||
if ((content === null || content === void 0 ? void 0 : content.length) > 0 && content[0].contentType === 'image/svg+xml') { | ||
highResUrl = content[0].primaryFileUrl; | ||
if ((content === null || content === void 0 ? void 0 : content.length) > 0) { | ||
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); }); | ||
if ((primaryContent === null || primaryContent === void 0 ? void 0 : primaryContent.contentType) === 'image/svg+xml') { | ||
highResUrl = primaryContent.primaryFileUrl; | ||
} | ||
} | ||
else if (((_f = model === null || model === void 0 ? void 0 : model.viewable) === null || _f === void 0 ? void 0 : _f.contentType) === 'image/svg+xml') { | ||
highResUrl = (_g = model === null || model === void 0 ? void 0 : model.viewable) === null || _g === void 0 ? void 0 : _g.primaryFileUrl; | ||
} | ||
if (highResUrl) { | ||
element.alternateUrls.highResolution = highResUrl; | ||
} | ||
let lowResUrl = ((_f = model === null || model === void 0 ? void 0 : model.viewable) === null || _f === void 0 ? void 0 : _f.smallViewableDownloadUrl) || ((_g = model === null || model === void 0 ? void 0 : model.viewable) === null || _g === void 0 ? void 0 : _g.smallViewableUrl); | ||
let lowResUrl = ((_h = model === null || model === void 0 ? void 0 : model.viewable) === null || _h === void 0 ? void 0 : _h.smallViewableDownloadUrl) || ((_j = model === null || model === void 0 ? void 0 : model.viewable) === null || _j === void 0 ? void 0 : _j.smallViewableUrl); | ||
if (lowResUrl) { | ||
@@ -38,0 +44,0 @@ element.alternateUrls.lowResolution = lowResUrl; |
{ | ||
"name": "@contrail/documents", | ||
"version": "1.0.58", | ||
"version": "1.0.59", | ||
"description": "Documents library for contrail platform", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30246
856