@fluid-topics/ft-reader-search-in-document 1.2.51 → 1.2.52
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.
|
@@ -2,7 +2,7 @@ import { nothing, PropertyValues, TemplateResult } from "lit";
|
|
|
2
2
|
import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
|
|
3
3
|
import { FtReaderSearchInDocumentProperties } from "./ft-reader-search-in-document.properties";
|
|
4
4
|
import { FtReaderComponent } from "@fluid-topics/ft-reader-context/build/registration";
|
|
5
|
-
import { FtMap } from "@fluid-topics/public-api";
|
|
5
|
+
import { FtMap, FtSearchResultClusterEntry } from "@fluid-topics/public-api";
|
|
6
6
|
declare const FtReaderSearchInDocument_base: typeof FtReaderComponent & import("@fluid-topics/ft-wc-utils").Constructor<import("@fluid-topics/ft-i18n").FtLitElementWithI18nInterface>;
|
|
7
7
|
export declare class FtReaderSearchInDocument extends FtReaderSearchInDocument_base implements FtReaderSearchInDocumentProperties {
|
|
8
8
|
static elementDefinitions: ElementDefinitionsMap;
|
|
@@ -20,6 +20,7 @@ export declare class FtReaderSearchInDocument extends FtReaderSearchInDocument_b
|
|
|
20
20
|
private uniqueId;
|
|
21
21
|
private get filters();
|
|
22
22
|
private renderResult;
|
|
23
|
+
onAuxClick(e: MouseEvent, result: FtSearchResultClusterEntry, rank: number): void;
|
|
23
24
|
protected render(): typeof nothing | TemplateResult<1>;
|
|
24
25
|
protected update(props: PropertyValues): void;
|
|
25
26
|
private onLinkClick;
|
|
@@ -43,7 +43,7 @@ class FtReaderSearchInDocument extends withI18n(FtReaderComponent) {
|
|
|
43
43
|
var _a;
|
|
44
44
|
return html `
|
|
45
45
|
<style> ${resultStyles}</style>
|
|
46
|
-
<a href="${getResultUrl(result)}" @click="${() => this.onLinkClick(result, rank)} }">
|
|
46
|
+
<a href="${getResultUrl(result)}" @click="${() => this.onLinkClick(result, rank)}" @auxclick="${(e) => this.onAuxClick(e, result, rank)}">
|
|
47
47
|
<ft-card clickable noheader>
|
|
48
48
|
<div class="result-container">
|
|
49
49
|
${this.hideResultTitle ? nothing : html `
|
|
@@ -59,6 +59,11 @@ class FtReaderSearchInDocument extends withI18n(FtReaderComponent) {
|
|
|
59
59
|
</a>
|
|
60
60
|
`;
|
|
61
61
|
}
|
|
62
|
+
onAuxClick(e, result, rank) {
|
|
63
|
+
if (e.button == 1) {
|
|
64
|
+
this.onLinkClick(result, rank);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
62
67
|
render() {
|
|
63
68
|
if (!this.map) {
|
|
64
69
|
return nothing;
|
|
@@ -1294,11 +1294,12 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1294
1294
|
`}selectAbstract(e){switch(e.type){case"MAP":return e.map.htmlExcerpt;case"DOCUMENT":return e.document.htmlExcerpt;case"TOPIC":return e.topic.htmlExcerpt}return""}contentAvailableCallback(e){super.contentAvailableCallback(e),this.shadowRoot.querySelectorAll(".kwicmatch").forEach(o=>o.setAttribute("part","kwicmatch"))}};sr.elementDefinitions={"ft-typography":se};sr.styles=Qa});var qf=f(()=>{"use strict"});var Qf={};Zt(Qf,{FtSearchResultAbstract:()=>sr,FtSearchResultAbstractCssVariables:()=>en,styles:()=>Qa});var Yf,ys=f(()=>{"use strict";Yf=b(N());hs();tn();qf();hs();(0,Yf.customElement)("ft-search-result-abstract")(sr)});var To,Xf,Jf,sm,Wt,ms=f(()=>{"use strict";To=b(B()),Xf=b(Q());ps();on();ut();Jf=b(Zo());ji();Ki();sm=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Wt=class extends zr{constructor(){super(...arguments),this.withoutLink=!1}render(){var e;return this.result?this.withoutLink?this.renderTitle():To.html`
|
|
1295
1295
|
<a href="${Wn(this.result)}"
|
|
1296
1296
|
@click=${this.onResultClick}
|
|
1297
|
+
@auxclick=${o=>this.onAuxClick(o)}
|
|
1297
1298
|
target="${lf(this.result,(e=this.stateManager)===null||e===void 0?void 0:e.openExternalDocumentInNewTab)}"
|
|
1298
1299
|
part="link">
|
|
1299
1300
|
${this.renderTitle()}
|
|
1300
1301
|
</a>
|
|
1301
|
-
`:To.nothing}renderTitle(){return To.html`
|
|
1302
|
+
`:To.nothing}onAuxClick(e){e.button==1&&this.onResultClick()}renderTitle(){return To.html`
|
|
1302
1303
|
<ft-typography variant="title" part="text">${(0,Jf.unsafeHTML)(this.selectTitle(this.result))}</ft-typography>
|
|
1303
1304
|
`}onResultClick(){this.dispatchEvent(new Ur(this.result,this.rank))}selectTitle(e){switch(e.type){case"MAP":return e.map.htmlTitle;case"DOCUMENT":return e.document.htmlTitle;case"TOPIC":return e.topic.htmlTitle}return""}contentAvailableCallback(e){var o;super.contentAvailableCallback(e),this.shadowRoot.querySelectorAll(".kwicmatch").forEach(n=>n.setAttribute("part","kwicmatch")),!this.withoutLink&&e.has("rank")&&this.rank!=null&&(!((o=this.stateManager)===null||o===void 0)&&o.store.commands.consume(`focus-result-${this.rank}`))&&(this.elementToFocus={selector:"a"})}};Wt.elementDefinitions={"ft-typography":se};Wt.styles=Xa;sm([(0,Xf.property)({type:Boolean})],Wt.prototype,"withoutLink",void 0)});var eh=f(()=>{"use strict"});var rh={};Zt(rh,{FtSearchResultTitle:()=>Wt,FtSearchResultTitleCssVariables:()=>rn,styles:()=>Xa});var th,gs=f(()=>{"use strict";th=b(N());ms();on();eh();ms();(0,th.customElement)("ft-search-result-title")(Wt)});var oh,cm,bs,xs=f(()=>{"use strict";oh=b(B()),cm={},bs=oh.css`
|
|
1304
1305
|
[part="no-results-message"] {
|
|
@@ -1504,7 +1505,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1504
1505
|
</div>
|
|
1505
1506
|
`}};Pe.elementDefinitions={"ft-ripple":X,"ft-typography":se};Pe.styles=Ws;$r([(0,ir.property)()],Pe.prototype,"title",void 0);$r([(0,ir.property)({type:Boolean})],Pe.prototype,"clickable",void 0);$r([(0,ir.property)({type:Boolean})],Pe.prototype,"selected",void 0);$r([(0,ir.property)({type:Boolean})],Pe.prototype,"noHeader",void 0);$r([(0,ir.property)({type:Boolean})],Pe.prototype,"noContent",void 0);$r([(0,ir.property)({type:Boolean})],Pe.prototype,"oneLineHeader",void 0);(0,pf.customElement)("ft-card")(Pe);Ki();var Gt=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Ie=class t extends ze(Bn){constructor(){super(),this.searchInDocumentQuery="",this.hideResultTitle=!1,this.hideResultBreadcrumb=!1,this.hideResultAbstract=!1,this.hideResultsNumber=!1,this.emptyResultOnClear=!1,this.userHasDoneManualAction=!1,this.uniqueId="search-in-document-"+(""+Math.round(Math.random()*999e3)).padStart(6,"0"),this.addI18nContext(Vi)}get filters(){return[{key:"ft:publicationId",valueFilter:{negative:!1,values:[this.map.id]}}]}renderResult(e,o){var n;return Ue.html`
|
|
1506
1507
|
<style> ${Hd}</style>
|
|
1507
|
-
<a href="${Wn(e)}" @click="${()=>this.onLinkClick(e,o)} }">
|
|
1508
|
+
<a href="${Wn(e)}" @click="${()=>this.onLinkClick(e,o)}" @auxclick="${a=>this.onAuxClick(a,e,o)}">
|
|
1508
1509
|
<ft-card clickable noheader>
|
|
1509
1510
|
<div class="result-container">
|
|
1510
1511
|
${this.hideResultTitle?Ue.nothing:Ue.html`
|
|
@@ -1518,7 +1519,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1518
1519
|
</div>
|
|
1519
1520
|
</ft-card>
|
|
1520
1521
|
</a>
|
|
1521
|
-
`}render(){return this.map?Ue.html`
|
|
1522
|
+
`}onAuxClick(e,o,n){e.button==1&&this.onLinkClick(o,n)}render(){return this.map?Ue.html`
|
|
1522
1523
|
<ft-search-context id="${this.uniqueId}"
|
|
1523
1524
|
contentLocale="${this.map.lang}"
|
|
1524
1525
|
query="${this.searchInDocumentQuery}"
|
|
@@ -1337,11 +1337,12 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ft-conte
|
|
|
1337
1337
|
`}selectAbstract(e){switch(e.type){case"MAP":return e.map.htmlExcerpt;case"DOCUMENT":return e.document.htmlExcerpt;case"TOPIC":return e.topic.htmlExcerpt}return""}contentAvailableCallback(e){super.contentAvailableCallback(e),this.shadowRoot.querySelectorAll(".kwicmatch").forEach(r=>r.setAttribute("part","kwicmatch"))}};vr.elementDefinitions={"ft-typography":ge};vr.styles=Bc});var Zh=f(()=>{"use strict"});var qh={};G(qh,{FtSearchResultAbstract:()=>vr,FtSearchResultAbstractCssVariables:()=>na,styles:()=>Bc});var wl=f(()=>{"use strict";k();El();aa();Zh();El();V("ft-search-result-abstract")(vr)});var Jg,Zt,Al=f(()=>{"use strict";z();ne();Ol();sa();Et();Ao();nl();il();Jg=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Zt=class extends fo{constructor(){super(...arguments),this.withoutLink=!1}render(){var e;return this.result?this.withoutLink?this.renderTitle():M`
|
|
1338
1338
|
<a href="${ba(this.result)}"
|
|
1339
1339
|
@click=${this.onResultClick}
|
|
1340
|
+
@auxclick=${r=>this.onAuxClick(r)}
|
|
1340
1341
|
target="${wh(this.result,(e=this.stateManager)===null||e===void 0?void 0:e.openExternalDocumentInNewTab)}"
|
|
1341
1342
|
part="link">
|
|
1342
1343
|
${this.renderTitle()}
|
|
1343
1344
|
</a>
|
|
1344
|
-
`:H}renderTitle(){return M`
|
|
1345
|
+
`:H}onAuxClick(e){e.button==1&&this.onResultClick()}renderTitle(){return M`
|
|
1345
1346
|
<ft-typography variant="title" part="text">${nr(this.selectTitle(this.result))}</ft-typography>
|
|
1346
1347
|
`}onResultClick(){this.dispatchEvent(new uo(this.result,this.rank))}selectTitle(e){switch(e.type){case"MAP":return e.map.htmlTitle;case"DOCUMENT":return e.document.htmlTitle;case"TOPIC":return e.topic.htmlTitle}return""}contentAvailableCallback(e){var r;super.contentAvailableCallback(e),this.shadowRoot.querySelectorAll(".kwicmatch").forEach(n=>n.setAttribute("part","kwicmatch")),!this.withoutLink&&e.has("rank")&&this.rank!=null&&(!((r=this.stateManager)===null||r===void 0)&&r.store.commands.consume(`focus-result-${this.rank}`))&&(this.elementToFocus={selector:"a"})}};Zt.elementDefinitions={"ft-typography":ge};Zt.styles=Fc;Jg([w({type:Boolean})],Zt.prototype,"withoutLink",void 0)});var Yh=f(()=>{"use strict"});var Qh={};G(Qh,{FtSearchResultTitle:()=>Zt,FtSearchResultTitleCssVariables:()=>ia,styles:()=>Fc});var Rl=f(()=>{"use strict";k();Al();sa();Yh();Al();V("ft-search-result-title")(Zt)});var eb,Nl,Tl=f(()=>{"use strict";z();eb={},Nl=L`
|
|
1347
1348
|
[part="no-results-message"] {
|
|
@@ -1547,7 +1548,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ft-conte
|
|
|
1547
1548
|
</div>
|
|
1548
1549
|
`}};Me.elementDefinitions={"ft-ripple":ce,"ft-typography":ge};Me.styles=yf;lo([w()],Me.prototype,"title",void 0);lo([w({type:Boolean})],Me.prototype,"clickable",void 0);lo([w({type:Boolean})],Me.prototype,"selected",void 0);lo([w({type:Boolean})],Me.prototype,"noHeader",void 0);lo([w({type:Boolean})],Me.prototype,"noContent",void 0);lo([w({type:Boolean})],Me.prototype,"oneLineHeader",void 0);V("ft-card")(Me);il();var Yt=function(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Be=class t extends Ge(ga){constructor(){super(),this.searchInDocumentQuery="",this.hideResultTitle=!1,this.hideResultBreadcrumb=!1,this.hideResultAbstract=!1,this.hideResultsNumber=!1,this.emptyResultOnClear=!1,this.userHasDoneManualAction=!1,this.uniqueId="search-in-document-"+(""+Math.round(Math.random()*999e3)).padStart(6,"0"),this.addI18nContext(al)}get filters(){return[{key:"ft:publicationId",valueFilter:{negative:!1,values:[this.map.id]}}]}renderResult(e,r){var n;return M`
|
|
1549
1550
|
<style> ${Qf}</style>
|
|
1550
|
-
<a href="${ba(e)}" @click="${()=>this.onLinkClick(e,r)} }">
|
|
1551
|
+
<a href="${ba(e)}" @click="${()=>this.onLinkClick(e,r)}" @auxclick="${a=>this.onAuxClick(a,e,r)}">
|
|
1551
1552
|
<ft-card clickable noheader>
|
|
1552
1553
|
<div class="result-container">
|
|
1553
1554
|
${this.hideResultTitle?H:M`
|
|
@@ -1561,7 +1562,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ft-conte
|
|
|
1561
1562
|
</div>
|
|
1562
1563
|
</ft-card>
|
|
1563
1564
|
</a>
|
|
1564
|
-
`}render(){return this.map?M`
|
|
1565
|
+
`}onAuxClick(e,r,n){e.button==1&&this.onLinkClick(r,n)}render(){return this.map?M`
|
|
1565
1566
|
<ft-search-context id="${this.uniqueId}"
|
|
1566
1567
|
contentLocale="${this.map.lang}"
|
|
1567
1568
|
query="${this.searchInDocumentQuery}"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-search-in-document",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.52",
|
|
4
4
|
"description": "A search component to retrieve occurrences in documents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-button": "1.2.
|
|
23
|
-
"@fluid-topics/ft-card": "1.2.
|
|
24
|
-
"@fluid-topics/ft-i18n": "1.2.
|
|
25
|
-
"@fluid-topics/ft-search-context": "1.2.
|
|
26
|
-
"@fluid-topics/ft-search-input": "1.2.
|
|
27
|
-
"@fluid-topics/ft-search-load-more-button": "1.2.
|
|
28
|
-
"@fluid-topics/ft-search-result-abstract": "1.2.
|
|
29
|
-
"@fluid-topics/ft-search-result-title": "1.2.
|
|
30
|
-
"@fluid-topics/ft-search-results": "1.2.
|
|
31
|
-
"@fluid-topics/ft-search-results-number": "1.2.
|
|
32
|
-
"@fluid-topics/ft-typography": "1.2.
|
|
33
|
-
"@fluid-topics/ft-wc-utils": "1.2.
|
|
22
|
+
"@fluid-topics/ft-button": "1.2.52",
|
|
23
|
+
"@fluid-topics/ft-card": "1.2.52",
|
|
24
|
+
"@fluid-topics/ft-i18n": "1.2.52",
|
|
25
|
+
"@fluid-topics/ft-search-context": "1.2.52",
|
|
26
|
+
"@fluid-topics/ft-search-input": "1.2.52",
|
|
27
|
+
"@fluid-topics/ft-search-load-more-button": "1.2.52",
|
|
28
|
+
"@fluid-topics/ft-search-result-abstract": "1.2.52",
|
|
29
|
+
"@fluid-topics/ft-search-result-title": "1.2.52",
|
|
30
|
+
"@fluid-topics/ft-search-results": "1.2.52",
|
|
31
|
+
"@fluid-topics/ft-search-results-number": "1.2.52",
|
|
32
|
+
"@fluid-topics/ft-typography": "1.2.52",
|
|
33
|
+
"@fluid-topics/ft-wc-utils": "1.2.52",
|
|
34
34
|
"@fluid-topics/public-api": "1.0.90",
|
|
35
35
|
"lit": "3.1.0"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "5bdea3806bc9a17448a0533c5c3ecfee0cfa8bac"
|
|
38
38
|
}
|