@fluid-topics/ft-reader-metadata 1.1.34 → 1.1.36

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.
@@ -10,8 +10,11 @@ export const styles = css `
10
10
  position: relative;
11
11
  }
12
12
 
13
- .ft-reader-metadata--container ft-chip {
14
- cursor: pointer;
13
+ [part="tooltip"]:not(.ft-reader-metadata-multi-line),
14
+ [part="tooltip"]:not(.ft-reader-metadata-multi-line) [part="floating-menu-container"],
15
+ [part="tooltip"]:not(.ft-reader-metadata-multi-line) [part="floating-menu"],
16
+ [part="tooltip"]:not(.ft-reader-metadata-multi-line) [part="chip"] {
17
+ max-width: 100%;
15
18
  }
16
19
 
17
20
  a {
@@ -6,6 +6,7 @@ export declare class FtReaderMetadata extends FtReaderComponent implements FtRea
6
6
  static elementDefinitions: ElementDefinitionsMap;
7
7
  static styles: import("lit").CSSResult;
8
8
  key?: string;
9
+ multiLine: boolean;
9
10
  useForSwitchingToRelatives: boolean;
10
11
  editorMode: boolean;
11
12
  private metadata?;
@@ -18,6 +18,7 @@ import { FtRipple } from "@fluid-topics/ft-ripple";
18
18
  class FtReaderMetadata extends FtReaderComponent {
19
19
  constructor() {
20
20
  super(...arguments);
21
+ this.multiLine = false;
21
22
  this.useForSwitchingToRelatives = false;
22
23
  this.editorMode = false;
23
24
  this.relatives = [];
@@ -32,14 +33,16 @@ class FtReaderMetadata extends FtReaderComponent {
32
33
  }
33
34
  render() {
34
35
  return html `
35
- <ft-tooltip text="${this.tooltipText}">
36
+ <ft-tooltip part="tooltip"
37
+ class="${this.multiLine ? "ft-reader-metadata-multi-line" : ""}"
38
+ text="${this.tooltipText}">
36
39
  ${this.useForSwitchingToRelatives && this.metadata && this.metadata.values.length > 0
37
40
  ? this.renderSwitchToRelatives()
38
41
  : html `
39
- <ft-chip>
40
- ${this.renderContent()}
41
- </ft-chip>
42
- `}
42
+ <ft-chip part="chip" ?multiLine=${this.multiLine}>
43
+ ${this.renderContent()}
44
+ </ft-chip>
45
+ `}
43
46
  </ft-tooltip>
44
47
  ${this.hideIfEmpty()}
45
48
  `;
@@ -60,9 +63,13 @@ class FtReaderMetadata extends FtReaderComponent {
60
63
  }
61
64
  renderSwitchToRelatives() {
62
65
  return html `
63
- <div class="ft-reader-metadata--container">
64
- <ft-floating-menu text="Toggle collapsible" trailingIcon>
65
- <ft-chip trailingIcon icon="thin_arrow" slot="toggle" clickable>
66
+ <div part="floating-menu-container" class="ft-reader-metadata--container">
67
+ <ft-floating-menu part="floating-menu" text="Toggle collapsible" trailingIcon>
68
+ <ft-chip part="chip"
69
+ ?multiLine=${this.multiLine}
70
+ trailingIcon icon="thin_arrow"
71
+ slot="toggle"
72
+ clickable>
66
73
  ${this.renderContent()}
67
74
  </ft-chip>
68
75
 
@@ -73,9 +80,11 @@ class FtReaderMetadata extends FtReaderComponent {
73
80
  }
74
81
  renderRelativeItem(result, metadata) {
75
82
  return html `
76
- <a href=${getResultUrl(result)} @click=${(e) => this.addTopicPivotParam(e, result)}>
77
- <ft-ripple></ft-ripple>
78
- <ft-floating-menu-item value="${metadata.value}" notFocusable>
83
+ <a part="relative-item-link"
84
+ href="${getResultUrl(result)}"
85
+ @click=${(e) => this.addTopicPivotParam(e, result)}>
86
+ <ft-ripple part="relative-item-ripple"></ft-ripple>
87
+ <ft-floating-menu-item part="relative-item" value="${metadata.value}" notFocusable>
79
88
  ${this.renderRelativeItemValue(metadata.value, metadata.displayValue)}
80
89
  </ft-floating-menu-item>
81
90
  </a>
@@ -83,7 +92,8 @@ class FtReaderMetadata extends FtReaderComponent {
83
92
  }
84
93
  renderRelativeItemValue(value, displayValue) {
85
94
  return value === displayValue ? value : html `
86
- <ft-tooltip text="${value}">${displayValue}</ft-tooltip>`;
95
+ <ft-tooltip part="relative-item-tooltip" text="${value}">${displayValue}</ft-tooltip>
96
+ `;
87
97
  }
88
98
  hideIfEmpty() {
89
99
  if (!this.editorMode && (!this.metadata || this.metadata.values.length == 0)) {
@@ -170,6 +180,9 @@ __decorate([
170
180
  property(),
171
181
  reduxReactive()
172
182
  ], FtReaderMetadata.prototype, "key", void 0);
183
+ __decorate([
184
+ property({ type: Boolean })
185
+ ], FtReaderMetadata.prototype, "multiLine", void 0);
173
186
  __decorate([
174
187
  property({ type: Boolean })
175
188
  ], FtReaderMetadata.prototype, "useForSwitchingToRelatives", void 0);