@fluid-topics/ft-search-result-abstract 1.0.30 → 1.0.33

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.
@@ -1,10 +1,9 @@
1
- import { nothing } from "lit";
2
1
  import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
3
2
  import { FtSearchResultAbstractProperties } from "./ft-search-result-abstract.properties";
4
3
  import { FtSearchResultComponent } from "@fluid-topics/ft-search-result-context/build/registration";
5
4
  export declare class FtSearchResultAbstract extends FtSearchResultComponent implements FtSearchResultAbstractProperties {
6
5
  static elementDefinitions: ElementDefinitionsMap;
7
6
  static styles: import("lit").CSSResult;
8
- protected render(): typeof nothing | import("lit-html").TemplateResult<1>;
7
+ protected render(): import("lit-html").TemplateResult<1>;
9
8
  private selectAbstract;
10
9
  }
@@ -1,13 +1,23 @@
1
- import { html, nothing } from "lit";
1
+ import { html } from "lit";
2
2
  import { FtSearchResultComponent } from "@fluid-topics/ft-search-result-context/build/registration";
3
3
  import { styles } from "./ft-search-result-abstract.css";
4
4
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
5
5
  import { FtTypography } from "@fluid-topics/ft-typography";
6
6
  class FtSearchResultAbstract extends FtSearchResultComponent {
7
7
  render() {
8
- return this.result ? html `
9
- <ft-typography variant="body1" part="text">${unsafeHTML(this.selectAbstract(this.result))}</ft-typography>
10
- ` : nothing;
8
+ let abstract = this.result ? this.selectAbstract(this.result) : undefined;
9
+ if (!abstract) {
10
+ return html `
11
+ <style>
12
+ :host {
13
+ display: none !important;
14
+ }
15
+ </style>
16
+ `;
17
+ }
18
+ return html `
19
+ <ft-typography variant="body1" part="text">${unsafeHTML(abstract)}</ft-typography>
20
+ `;
11
21
  }
12
22
  selectAbstract(result) {
13
23
  switch (result.type) {
@@ -118,6 +118,12 @@ const rt=Symbol.for(""),ht=t=>{if((null==t?void 0:t.r)===rt)return null==t?void
118
118
  </${at(this.element)}>
119
119
  `:pt`
120
120
  <slot class="ft-typography ft-typography--${this.variant}"></slot>
121
- `}}_i.styles=[wi,xi,Ci,zi,Ai,Ui,Si,Ii,Mi,Ni,ji],Oi([s.property()],_i.prototype,"element",void 0),Oi([s.property()],_i.prototype,"variant",void 0),i.customElement("ft-typography")(_i);class Ti extends w{render(){return this.result?e.html`
122
- <ft-typography variant="body1" part="text">${o.unsafeHTML(this.selectAbstract(this.result))}</ft-typography>
123
- `:e.nothing}selectAbstract(t){switch(t.type){case"MAP":return t.map.htmlExcerpt;case"DOCUMENT":return t.document.htmlExcerpt;case"TOPIC":return t.topic.htmlExcerpt}return""}}Ti.elementDefinitions={"ft-typography":_i},Ti.styles=x,i.customElement("ft-search-result-abstract")(Ti),t.FtSearchResultAbstract=Ti,t.FtSearchResultAbstractCssVariables={},t.styles=x}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML);
121
+ `}}_i.styles=[wi,xi,Ci,zi,Ai,Ui,Si,Ii,Mi,Ni,ji],Oi([s.property()],_i.prototype,"element",void 0),Oi([s.property()],_i.prototype,"variant",void 0),i.customElement("ft-typography")(_i);class Ti extends w{render(){let t=this.result?this.selectAbstract(this.result):void 0;return t?e.html`
122
+ <ft-typography variant="body1" part="text">${o.unsafeHTML(t)}</ft-typography>
123
+ `:e.html`
124
+ <style>
125
+ :host {
126
+ display: none !important;
127
+ }
128
+ </style>
129
+ `}selectAbstract(t){switch(t.type){case"MAP":return t.map.htmlExcerpt;case"DOCUMENT":return t.document.htmlExcerpt;case"TOPIC":return t.topic.htmlExcerpt}return""}}Ti.elementDefinitions={"ft-typography":_i},Ti.styles=x,i.customElement("ft-search-result-abstract")(Ti),t.FtSearchResultAbstract=Ti,t.FtSearchResultAbstractCssVariables={},t.styles=x}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML);
@@ -207,6 +207,12 @@ var ft,ht;let dt=class extends R{constructor(){super(...arguments),this.renderOp
207
207
  </${Hr(this.element)}>
208
208
  `:Vr`
209
209
  <slot class="ft-typography ft-typography--${this.variant}"></slot>
210
- `}}bi.styles=[oi,si,ai,ui,ci,li,fi,hi,di,pi,vi],yi([s()],bi.prototype,"element",void 0),yi([s()],bi.prototype,"variant",void 0),l("ft-typography")(bi);class gi extends Tr{render(){return this.result?X`
211
- <ft-typography variant="body1" part="text">${zr(this.selectAbstract(this.result))}</ft-typography>
212
- `:Q}selectAbstract(t){switch(t.type){case"MAP":return t.map.htmlExcerpt;case"DOCUMENT":return t.document.htmlExcerpt;case"TOPIC":return t.topic.htmlExcerpt}return""}}gi.elementDefinitions={"ft-typography":bi},gi.styles=_r,l("ft-search-result-abstract")(gi),t.FtSearchResultAbstract=gi,t.FtSearchResultAbstractCssVariables={},t.styles=_r}({});
210
+ `}}bi.styles=[oi,si,ai,ui,ci,li,fi,hi,di,pi,vi],yi([s()],bi.prototype,"element",void 0),yi([s()],bi.prototype,"variant",void 0),l("ft-typography")(bi);class gi extends Tr{render(){let t=this.result?this.selectAbstract(this.result):void 0;return t?X`
211
+ <ft-typography variant="body1" part="text">${zr(t)}</ft-typography>
212
+ `:X`
213
+ <style>
214
+ :host {
215
+ display: none !important;
216
+ }
217
+ </style>
218
+ `}selectAbstract(t){switch(t.type){case"MAP":return t.map.htmlExcerpt;case"DOCUMENT":return t.document.htmlExcerpt;case"TOPIC":return t.topic.htmlExcerpt}return""}}gi.elementDefinitions={"ft-typography":bi},gi.styles=_r,l("ft-search-result-abstract")(gi),t.FtSearchResultAbstract=gi,t.FtSearchResultAbstractCssVariables={},t.styles=_r}({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-search-result-abstract",
3
- "version": "1.0.30",
3
+ "version": "1.0.33",
4
4
  "description": "Search result abstract for integrated search component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,13 +19,13 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-search-result-context": "1.0.30",
23
- "@fluid-topics/ft-typography": "1.0.30",
24
- "@fluid-topics/ft-wc-utils": "1.0.30",
22
+ "@fluid-topics/ft-search-result-context": "1.0.33",
23
+ "@fluid-topics/ft-typography": "1.0.33",
24
+ "@fluid-topics/ft-wc-utils": "1.0.33",
25
25
  "lit": "2.7.2"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluid-topics/public-api": "1.0.38"
29
29
  },
30
- "gitHead": "72be58696ee1a1c080a094809e9c20e47d9ead73"
30
+ "gitHead": "4524915c2692a78f7cf4c12ebc844e8e83347231"
31
31
  }