@fluid-topics/ft-search-results 1.1.29 → 1.1.30
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.
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
`;class M{constructor(t){this.registeredComponents=[],this.registeredMetadata=new Set,this.onResultSelected=t}registerComponent(t){t.setResultStateManager(this),this.registeredComponents.push(t),this.bindComponent(t)}unregisterComponent(t){this.registeredComponents.splice(this.registeredComponents.indexOf(t),1),t.cluster=void 0,t.result=void 0,t.rank=void 0}registerMetadata(t){this.registeredMetadata.add(t)}unregisterMetadata(t){this.registeredMetadata.delete(t)}updateCluster(t,o){this.cluster=t,this.rank=o,this.selectResult(this.cluster.entries[0])}selectResult(t){this.result=t,this.onResultSelected(t),this.registeredComponents.forEach((t=>this.bindComponent(t)))}clear(){this.registeredComponents=[]}bindComponent(t){t.cluster=this.cluster,t.result=this.result,t.rank=this.rank}}var _=function(t,o,e,r){for(var a,i=arguments.length,n=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(a=t[l])&&(n=(i<3?a(n):i>3?a(o,e,n):a(o,e))||n);return i>3&&n&&Object.defineProperty(o,e,n),n};class j extends CustomEvent{constructor(t){super("ft-search-result-cluster-change",{detail:t,bubbles:!0,composed:!0})}}class Y extends o.FtLitElement{constructor(){super(...arguments),this.index=0,this.stateManager=new M((t=>this.onResultSelected(t)))}render(){return e.html`
|
|
15
15
|
<slot @register-ft-search-result-component=${this.registerComponent}></slot>
|
|
16
|
-
`}onResultSelected(t){this.result=t,this.dispatchEvent(new j(this.result))}registerComponent(t){t.stopPropagation();const o=t.composedPath()[0];this.stateManager.registerComponent(
|
|
16
|
+
`}onResultSelected(t){this.result=t,this.dispatchEvent(new j(this.result))}registerComponent(t){t.stopPropagation();const o=t.composedPath()[0];this.register(o)}register(t){this.stateManager.registerComponent(t)}update(t){super.update(t),t.has("cluster")&&this.cluster&&this.stateManager.updateCluster(this.cluster,this.index+1)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.clear()}}Y.elementDefinitions={},Y.styles=G,_([a.property({attribute:!1})],Y.prototype,"cluster",void 0),_([a.state()],Y.prototype,"result",void 0),_([a.property()],Y.prototype,"index",void 0),o.customElement("ft-search-result-context")(Y);var V=function(t,o,e,r){for(var a,i=arguments.length,n=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(a=t[l])&&(n=(i<3?a(n):i>3?a(o,e,n):a(o,e))||n);return i>3&&n&&Object.defineProperty(o,e,n),n};class X extends Event{constructor(){super("register-ft-search-result-component",{bubbles:!0,composed:!0})}}const q=Symbol("registerInterval");class J extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setResultStateManager(t){this.resultStateManager=t}unregisterResultStateManager(){this.resultStateManager&&(this.resultStateManager.unregisterComponent(this),this.resultStateManager=void 0)}connectedCallback(){super.connectedCallback(),this[q]=window.setInterval((()=>this.tryToRegisterToResultContext()),50)}tryToRegisterToResultContext(){null!=this.result?window.clearInterval(this[q]):this.dispatchEvent(new X)}disconnectedCallback(){super.disconnectedCallback(),this.unregisterResultStateManager()}}return o=q,V([a.property({attribute:!1})],e.prototype,"cluster",void 0),V([a.property({attribute:!1})],e.prototype,"result",void 0),V([a.property({attribute:!1,type:Number})],e.prototype,"rank",void 0),e}(P)){}const Q=o.FtCssVariableFactory.create("--ft-srt-highlight-background-color","","COLOR","transparent"),tt=e.css`
|
|
17
17
|
.kwicmatch {
|
|
18
18
|
font-weight: 700;
|
|
19
19
|
background-color: ${Q};
|
|
@@ -133,7 +133,7 @@ const Mr=2,Zr=t=>(...e)=>({_$litDirective$:t,values:e});let Tr=class{constructor
|
|
|
133
133
|
}
|
|
134
134
|
`;class Dn{constructor(t){this.registeredComponents=[],this.registeredMetadata=new Set,this.onResultSelected=t}registerComponent(t){t.setResultStateManager(this),this.registeredComponents.push(t),this.bindComponent(t)}unregisterComponent(t){this.registeredComponents.splice(this.registeredComponents.indexOf(t),1),t.cluster=void 0,t.result=void 0,t.rank=void 0}registerMetadata(t){this.registeredMetadata.add(t)}unregisterMetadata(t){this.registeredMetadata.delete(t)}updateCluster(t,e){this.cluster=t,this.rank=e,this.selectResult(this.cluster.entries[0])}selectResult(t){this.result=t,this.onResultSelected(t),this.registeredComponents.forEach((t=>this.bindComponent(t)))}clear(){this.registeredComponents=[]}bindComponent(t){t.cluster=this.cluster,t.result=this.result,t.rank=this.rank}}var jn=function(t,e,o,r){for(var n,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(e,o,a):n(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a};class Fn extends CustomEvent{constructor(t){super("ft-search-result-cluster-change",{detail:t,bubbles:!0,composed:!0})}}class Mn extends Pe{constructor(){super(...arguments),this.index=0,this.stateManager=new Dn((t=>this.onResultSelected(t)))}render(){return ie`
|
|
135
135
|
<slot @register-ft-search-result-component=${this.registerComponent}></slot>
|
|
136
|
-
`}onResultSelected(t){this.result=t,this.dispatchEvent(new Fn(this.result))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.stateManager.registerComponent(
|
|
136
|
+
`}onResultSelected(t){this.result=t,this.dispatchEvent(new Fn(this.result))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.stateManager.registerComponent(t)}update(t){super.update(t),t.has("cluster")&&this.cluster&&this.stateManager.updateCluster(this.cluster,this.index+1)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.clear()}}Mn.elementDefinitions={},Mn.styles=Pn,jn([U({attribute:!1})],Mn.prototype,"cluster",void 0),jn([I()],Mn.prototype,"result",void 0),jn([U()],Mn.prototype,"index",void 0),W("ft-search-result-context")(Mn);var Zn=function(t,e,o,r){for(var n,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(e,o,a):n(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a};class Tn extends Event{constructor(){super("register-ft-search-result-component",{bubbles:!0,composed:!0})}}const zn=Symbol("registerInterval");class _n extends(function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setResultStateManager(t){this.resultStateManager=t}unregisterResultStateManager(){this.resultStateManager&&(this.resultStateManager.unregisterComponent(this),this.resultStateManager=void 0)}connectedCallback(){super.connectedCallback(),this[zn]=window.setInterval((()=>this.tryToRegisterToResultContext()),50)}tryToRegisterToResultContext(){null!=this.result?window.clearInterval(this[zn]):this.dispatchEvent(new Tn)}disconnectedCallback(){super.disconnectedCallback(),this.unregisterResultStateManager()}}return e=zn,Zn([U({attribute:!1})],o.prototype,"cluster",void 0),Zn([U({attribute:!1})],o.prototype,"result",void 0),Zn([U({attribute:!1,type:Number})],o.prototype,"rank",void 0),o}(Kn)){}const Bn=Ne.create("--ft-srt-highlight-background-color","","COLOR","transparent"),Hn=Nt`
|
|
137
137
|
.kwicmatch {
|
|
138
138
|
font-weight: 700;
|
|
139
139
|
background-color: ${Bn};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-results",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.30",
|
|
4
4
|
"description": "Search result list for integrated search component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
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.1.
|
|
23
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-search-result-context": "1.1.30",
|
|
23
|
+
"@fluid-topics/ft-wc-utils": "1.1.30",
|
|
24
24
|
"lit": "3.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@fluid-topics/public-api": "1.0.57"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "2eadc3ab5cdc677c1db2564a74d18440cd553d42"
|
|
30
30
|
}
|