@contrail/documents 1.0.64 → 1.0.65

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.
@@ -24,27 +24,30 @@ class DocumentElementPropertyBindingHandler {
24
24
  if (((_b = (_a = element.propertyBindings) === null || _a === void 0 ? void 0 : _a.url) === null || _b === void 0 ? void 0 : _b.indexOf("viewable")) !== -1) {
25
25
  element.alternateUrls = {};
26
26
  let highResUrl = ((_c = model === null || model === void 0 ? void 0 : model.viewable) === null || _c === void 0 ? void 0 : _c.largeViewableDownloadUrl) || ((_d = model === null || model === void 0 ? void 0 : model.viewable) === null || _d === void 0 ? void 0 : _d.largeViewableUrl);
27
- const content = (_e = model === null || model === void 0 ? void 0 : model.viewable) === null || _e === void 0 ? void 0 : _e.content;
27
+ let originalFile = (_e = model === null || model === void 0 ? void 0 : model.viewable) === null || _e === void 0 ? void 0 : _e.primaryFileUrl;
28
+ const content = (_f = model === null || model === void 0 ? void 0 : model.viewable) === null || _f === void 0 ? void 0 : _f.content;
28
29
  if ((content === null || content === void 0 ? void 0 : content.length) > 0) {
29
30
  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); });
30
31
  if ((primaryContent === null || primaryContent === void 0 ? void 0 : primaryContent.contentType) === 'image/svg+xml') {
31
32
  highResUrl = primaryContent.primaryFileUrl;
32
33
  }
34
+ if (primaryContent === null || primaryContent === void 0 ? void 0 : primaryContent.primaryFileUrl) {
35
+ originalFile = primaryContent === null || primaryContent === void 0 ? void 0 : primaryContent.primaryFileUrl;
36
+ }
33
37
  }
34
- else if (((_f = model === null || model === void 0 ? void 0 : model.viewable) === null || _f === void 0 ? void 0 : _f.contentType) === 'image/svg+xml') {
35
- highResUrl = (_g = model === null || model === void 0 ? void 0 : model.viewable) === null || _g === void 0 ? void 0 : _g.primaryFileUrl;
38
+ else if (((_g = model === null || model === void 0 ? void 0 : model.viewable) === null || _g === void 0 ? void 0 : _g.contentType) === 'image/svg+xml') {
39
+ highResUrl = (_h = model === null || model === void 0 ? void 0 : model.viewable) === null || _h === void 0 ? void 0 : _h.primaryFileUrl;
36
40
  }
37
41
  if (highResUrl) {
38
42
  element.alternateUrls.highResolution = highResUrl;
39
43
  }
40
- 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);
41
- if (lowResUrl) {
42
- element.alternateUrls.lowResolution = lowResUrl;
43
- }
44
- let originalFile = (_k = model === null || model === void 0 ? void 0 : model.viewable) === null || _k === void 0 ? void 0 : _k.primaryFileUrl;
45
44
  if (originalFile) {
46
45
  element.alternateUrls.originalFile = originalFile;
47
46
  }
47
+ let lowResUrl = ((_j = model === null || model === void 0 ? void 0 : model.viewable) === null || _j === void 0 ? void 0 : _j.smallViewableDownloadUrl) || ((_k = model === null || model === void 0 ? void 0 : model.viewable) === null || _k === void 0 ? void 0 : _k.smallViewableUrl);
48
+ if (lowResUrl) {
49
+ element.alternateUrls.lowResolution = lowResUrl;
50
+ }
48
51
  }
49
52
  if (element.elements) {
50
53
  this.bindPropertiesToElements(element.elements, localModel);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/documents",
3
- "version": "1.0.64",
3
+ "version": "1.0.65",
4
4
  "description": "Documents library for contrail platform",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",