@fluid-topics/ft-viewer 2.2.17 → 2.2.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.
@@ -35,14 +35,16 @@ export class FtUdViewerAttachments extends toFtUdViewerComponent(withI18n(FtBase
35
35
  return !!this.document && super.canRender();
36
36
  }
37
37
  getAttachmentDownloadLink(attachment) {
38
- var _a, _b;
38
+ var _a;
39
+ var _b;
39
40
  return (_b = (_a = this.service) === null || _a === void 0 ? void 0 : _a.getAttachmentDownloadLink(this.document.id, attachment.id)) !== null && _b !== void 0 ? _b : "";
40
41
  }
41
42
  getAttachmentDownloadLinkAriaLabel(attachment) {
42
43
  return udViewerContext.messages.download(this.getAttachmentAriaLabel(attachment));
43
44
  }
44
45
  getAttachmentViewerLink(attachment) {
45
- var _a, _b;
46
+ var _a;
47
+ var _b;
46
48
  return attachment.externalLink ? attachment.viewerUrl : (_a = this.service) === null || _a === void 0 ? void 0 : _a.makeAbsolute((_b = attachment.viewerUrl) !== null && _b !== void 0 ? _b : "");
47
49
  }
48
50
  }
@@ -35,7 +35,7 @@ export declare class FtUdViewerFeedback extends FtUdViewerFeedback_base implemen
35
35
  i18nProperties: FeedbackI18nProperties;
36
36
  get canAccessFeedback(): boolean | undefined;
37
37
  get canRateThisContent(): boolean | undefined;
38
- get configuredRatingType(): FtRatingType.NO_RATING | "STARS" | "LIKE" | "DICHOTOMOUS" | "NO_RATING";
38
+ get configuredRatingType(): "DICHOTOMOUS" | "LIKE" | "NO_RATING" | "STARS" | FtRatingType.NO_RATING;
39
39
  constructor(guestStorage?: GuestLocalStorage<FtPublicationRatingSummary>);
40
40
  protected render(): import("lit-html").TemplateResult<1>;
41
41
  protected willUpdate(props: PropertyValues): void;
@@ -33,7 +33,8 @@ export class FtUdViewerFeedback extends toFtUdViewerComponent(withI18n(FtViewerC
33
33
  return canAccessRating && this.configuredRatingType != FtRatingType.NO_RATING;
34
34
  }
35
35
  get configuredRatingType() {
36
- var _a, _b;
36
+ var _a;
37
+ var _b;
37
38
  return (_b = (_a = this.ratingSummary) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : FtRatingType.NO_RATING;
38
39
  }
39
40
  constructor(guestStorage = new GuestLocalStorage()) {
@@ -93,13 +94,14 @@ export class FtUdViewerFeedback extends toFtUdViewerComponent(withI18n(FtViewerC
93
94
  `;
94
95
  }
95
96
  willUpdate(props) {
96
- var _a, _b, _c;
97
+ var _a, _b;
98
+ var _c;
97
99
  super.willUpdate(props);
98
100
  if (props.has("editorMode") && this.editorMode) {
99
101
  this.addI18nContext(designer, defaultDesignerMessages);
100
102
  }
101
103
  if (["document", "configuration", "user", "mailSubject"].some((p) => props.has(p)) && this.document && this.configuration) {
102
- this.feedbackLinkBuilder.update(this.mailSubject, (_a = this.document.prettyUrl) !== null && _a !== void 0 ? _a : "", this.document.metadata, this.configuration, ((_c = (_b = this.session) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.userId) != null);
104
+ this.feedbackLinkBuilder.update(this.mailSubject, (_c = this.document.prettyUrl) !== null && _c !== void 0 ? _c : "", this.document.metadata, this.configuration, ((_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.profile) === null || _b === void 0 ? void 0 : _b.userId) != null);
103
105
  }
104
106
  if (["session", "document"].some((p) => props.has(p)) && this.session && this.document) {
105
107
  this.loadGuestRating();
@@ -189,7 +191,8 @@ FtUdViewerFeedback.elementDefinitions = {
189
191
  "ft-viewer-feedback": FtViewerFeedback,
190
192
  };
191
193
  FtUdViewerFeedback.storedRatingIfAuthenticated = (state, self) => {
192
- var _a, _b;
194
+ var _a;
195
+ var _b;
193
196
  if ((_a = self.session) === null || _a === void 0 ? void 0 : _a.sessionAuthenticated) {
194
197
  return state.documentRating;
195
198
  }
@@ -244,13 +247,10 @@ __decorate([
244
247
  query("ft-viewer-feedback")
245
248
  ], FtUdViewerFeedback.prototype, "viewerFeedback", void 0);
246
249
  __decorate([
247
- i18n(server.properties["mail.file_feedback.subject"]((self) => {
248
- var _a, _b;
249
- return [
250
- ((_a = self.document) === null || _a === void 0 ? void 0 : _a.title) || "Document",
251
- ((_b = self.document) === null || _b === void 0 ? void 0 : _b.filename) || "Filename",
252
- ];
253
- }))
250
+ i18n(server.properties["mail.file_feedback.subject"]((self) => { var _a, _b; return [
251
+ ((_a = self.document) === null || _a === void 0 ? void 0 : _a.title) || "Document",
252
+ ((_b = self.document) === null || _b === void 0 ? void 0 : _b.filename) || "Filename",
253
+ ]; }))
254
254
  ], FtUdViewerFeedback.prototype, "mailSubject", void 0);
255
255
  __decorate([
256
256
  redux({ store: "viewer", selector: ({ descriptor }) => descriptor === null || descriptor === void 0 ? void 0 : descriptor.displayName })
@@ -31,11 +31,12 @@ export class FtUdViewerMetadata extends withDateFormat(withI18n(FtUdViewerCompon
31
31
  return this.noValueMessage;
32
32
  }
33
33
  get metadataLabel() {
34
- var _a, _b, _c, _d, _e, _f;
34
+ var _a, _b, _c, _d;
35
+ var _e, _f;
35
36
  if (this.metadata) {
36
37
  return this.metadata.label;
37
38
  }
38
- return (_f = (_d = (_c = (_b = (_a = this.viewerStateManager) === null || _a === void 0 ? void 0 : _a.clusteringHelper) === null || _b === void 0 ? void 0 : _b.getMetadataDescriptor(this.key)) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : (_e = this.relatives.find((item) => item.metadata.value)) === null || _e === void 0 ? void 0 : _e.metadata.label) !== null && _f !== void 0 ? _f : this.key;
39
+ return (_f = (_e = (_c = (_b = (_a = this.viewerStateManager) === null || _a === void 0 ? void 0 : _a.clusteringHelper) === null || _b === void 0 ? void 0 : _b.getMetadataDescriptor(this.key)) === null || _c === void 0 ? void 0 : _c.label) !== null && _e !== void 0 ? _e : (_d = this.relatives.find((item) => item.metadata.value)) === null || _d === void 0 ? void 0 : _d.metadata.label) !== null && _f !== void 0 ? _f : this.key;
39
40
  }
40
41
  setUdvStateManager(stateManager) {
41
42
  super.setUdvStateManager(stateManager);
@@ -57,7 +58,8 @@ export class FtUdViewerMetadata extends withDateFormat(withI18n(FtUdViewerCompon
57
58
  this.addI18nContext(udViewerContext);
58
59
  }
59
60
  willUpdate(props) {
60
- var _a, _b, _c, _d, _e;
61
+ var _a, _b, _c, _d;
62
+ var _e;
61
63
  super.willUpdate(props);
62
64
  if (props.has("key") && this.useForSwitchingToRelatives) {
63
65
  if (props.get("key")) {
@@ -85,7 +87,8 @@ export class FtUdViewerMetadata extends withDateFormat(withI18n(FtUdViewerCompon
85
87
  }
86
88
  }
87
89
  updateRelatives() {
88
- var _a, _b, _c, _d;
90
+ var _a, _b, _c;
91
+ var _d;
89
92
  if (this.useForSwitchingToRelatives && this.key) {
90
93
  this.relatives = (_d = (_b = (_a = this.viewerStateManager) === null || _a === void 0 ? void 0 : _a.clusteringHelper) === null || _b === void 0 ? void 0 : _b.computeClustersItemsForMetadata(this.key, ((_c = this.document) === null || _c === void 0 ? void 0 : _c.lang) || "en", this.noValueMessage, this.hierarchicalValueTruncatingLevel, this.getDateFormatter(this.key))) !== null && _d !== void 0 ? _d : [];
91
94
  }
@@ -126,8 +129,7 @@ export class FtUdViewerMetadata extends withDateFormat(withI18n(FtUdViewerCompon
126
129
  renderRelativeItem(result, metadata) {
127
130
  var _a, _b;
128
131
  const translatedMetadata = this.translateValues
129
- ? (_b = new MetadataValueLocalizer((_a = this.availableContentLocales) !== null && _a !== void 0 ? _a : []).localize(metadata)) !== null && _b !== void 0 ? _b : metadata
130
- : metadata;
132
+ ? (_b = new MetadataValueLocalizer((_a = this.availableContentLocales) !== null && _a !== void 0 ? _a : []).localize(metadata)) !== null && _b !== void 0 ? _b : metadata : metadata;
131
133
  const url = getResultUrl(result);
132
134
  return html `
133
135
  <a part="relative-item-link"
@@ -146,9 +148,10 @@ export class FtUdViewerMetadata extends withDateFormat(withI18n(FtUdViewerCompon
146
148
  `;
147
149
  }
148
150
  renderChip(inFloatingMenu = false) {
149
- var _a, _b, _c, _d, _e, _f;
151
+ var _a, _b, _c, _d;
152
+ var _e, _f;
150
153
  const noTooltip = !this.forceTooltip && this.displayLabel && ((_a = this.flatMetadata) === null || _a === void 0 ? void 0 : _a.displayTooltipValue) == ((_b = this.flatMetadata) === null || _b === void 0 ? void 0 : _b.displayValue);
151
- const tooltipLabel = `${this.metadataLabel}: ${(_d = (_c = this.flatMetadata) === null || _c === void 0 ? void 0 : _c.displayTooltipValue) !== null && _d !== void 0 ? _d : this.noValueMessage}`;
154
+ const tooltipLabel = `${this.metadataLabel}: ${(_e = (_c = this.flatMetadata) === null || _c === void 0 ? void 0 : _c.displayTooltipValue) !== null && _e !== void 0 ? _e : this.noValueMessage}`;
152
155
  const chip = html `
153
156
  <ft-chip part="chip"
154
157
  exportpartsPrefix="chip"
@@ -158,7 +161,7 @@ export class FtUdViewerMetadata extends withDateFormat(withI18n(FtUdViewerCompon
158
161
  ?clickable=${inFloatingMenu}
159
162
  ?multiLine=${this.multiLine}>
160
163
  ${this.displayLabel ? html `
161
- <span part="label">${(_f = (_e = this.metadata) === null || _e === void 0 ? void 0 : _e.label) !== null && _f !== void 0 ? _f : this.key}: </span>
164
+ <span part="label">${(_f = (_d = this.metadata) === null || _d === void 0 ? void 0 : _d.label) !== null && _f !== void 0 ? _f : this.key}: </span>
162
165
  ` : nothing}
163
166
  ${this.metadataValue.length === 0 ? nothing : html `
164
167
  <span part="values">${this.metadataValue}</span>
@@ -19,15 +19,16 @@ export const toFtUdViewerComponent = applyMixinOnce(Symbol("toFtUdViewerComponen
19
19
  return (_a = this.viewerStateManager) === null || _a === void 0 ? void 0 : _a.service;
20
20
  }
21
21
  willUpdate(props) {
22
- var _a, _b, _c;
22
+ var _a, _b;
23
+ var _c;
23
24
  super.willUpdate(props);
24
25
  if (props.has("viewerStateManager")) {
25
26
  this.unregisterFromUdvStateManager(props.get("viewerStateManager"));
26
27
  this.registerToUdvStateManager(this.viewerStateManager);
27
28
  }
28
29
  if (props.has("neededUdvRequests")) {
29
- (_a = this.viewerStateManager) === null || _a === void 0 ? void 0 : _a.unregisterComponent(this, (_b = props.get("neededUdvRequests")) !== null && _b !== void 0 ? _b : []);
30
- (_c = this.viewerStateManager) === null || _c === void 0 ? void 0 : _c.registerComponent(this, this.neededUdvRequests);
30
+ (_a = this.viewerStateManager) === null || _a === void 0 ? void 0 : _a.unregisterComponent(this, (_c = props.get("neededUdvRequests")) !== null && _c !== void 0 ? _c : []);
31
+ (_b = this.viewerStateManager) === null || _b === void 0 ? void 0 : _b.registerComponent(this, this.neededUdvRequests);
31
32
  }
32
33
  }
33
34
  setUdvStateManager(stateManager) {
@@ -96,7 +96,8 @@ export class FtUdViewerStateManager extends FtViewerStateManager {
96
96
  }
97
97
  }
98
98
  createClusteringHelper() {
99
- var _a, _b;
99
+ var _a;
100
+ var _b;
100
101
  if (this.clusteringHelperProvider) {
101
102
  return this.clusteringHelperProvider();
102
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-viewer",
3
- "version": "2.2.17",
3
+ "version": "2.2.19",
4
4
  "description": "File viewer components",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,18 +19,18 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-content-watermark": "2.2.17",
23
- "@fluid-topics/ft-i18n": "2.2.17",
24
- "@fluid-topics/ft-reader-attachments": "2.2.17",
25
- "@fluid-topics/ft-reader-feedback": "2.2.17",
26
- "@fluid-topics/ft-search-result-context": "2.2.17",
27
- "@fluid-topics/ft-wc-utils": "2.2.17",
28
- "@fluid-topics/public-api": "1.0.142",
22
+ "@fluid-topics/ft-content-watermark": "2.2.19",
23
+ "@fluid-topics/ft-i18n": "2.2.19",
24
+ "@fluid-topics/ft-reader-attachments": "2.2.19",
25
+ "@fluid-topics/ft-reader-feedback": "2.2.19",
26
+ "@fluid-topics/ft-search-result-context": "2.2.19",
27
+ "@fluid-topics/ft-wc-utils": "2.2.19",
28
+ "@fluid-topics/public-api": "1.0.143",
29
29
  "@lit/context": "1.1.6",
30
30
  "lit": "3.3.3"
31
31
  },
32
32
  "devDependencies": {
33
- "@fluid-topics/ft-wc-test-utils": "2.2.17"
33
+ "@fluid-topics/ft-wc-test-utils": "2.2.19"
34
34
  },
35
- "gitHead": "36907c574a4cfc29bc07e86865cdb5b7e19d3d03"
35
+ "gitHead": "1ae520afe5e3697dee3c95ba254b53a8f7850594"
36
36
  }