@fluid-topics/ft-search-results 1.3.27 → 1.3.29
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.
|
@@ -169,11 +169,11 @@ Also for action icons.`,a.colorGray200),contentGlobalSubtle:e.extend("--ft-conte
|
|
|
169
169
|
}
|
|
170
170
|
</style>
|
|
171
171
|
`}selectAbstract(t){switch(t.type){case"MAP":return t.map.htmlExcerpt;case"DOCUMENT":return t.document.htmlExcerpt;case"TOPIC":return t.topic.htmlExcerpt}return""}contentAvailableCallback(t){super.contentAvailableCallback(t),this.shadowRoot.querySelectorAll(".kwicmatch").forEach(o=>o.setAttribute("part","kwicmatch"))}};dt.elementDefinitions={"ft-typography":oe};dt.styles=Gi;(0,$i.customElement)("ft-search-result-abstract")(dt);var Xi=C(T());var br=C(H()),xr=C(K()),vr=C(T());var Ki=C(H());var Vi=Ki.css`
|
|
172
|
-
`;var ut=C(T());var Yi=C(K());var Io=class{fromLocalizableLabel(t){return t.type=="PLAIN_TEXT"?{message:t.text}:{key:t.key,custom:t.type=="LOCALIZED_CUSTOM",context:t.context,message:t.key}}fromAttribute(t){if(t!=null)try{return JSON.parse(t)}catch{if(this.isI18nKey(t)){let[n,i]=t.split(".");return{context:n,key:i,message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},Zi=new Io;var hc=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},yc=Symbol("i18nAttributes"),gc=Symbol("i18nListAttributes"),Qi=Symbol("i18nProperties"),yr=Symbol("i18nContexts"),Et=Symbol("i18nUnsubs"),mr=(0,ut.applyMixinOnce)(Symbol("withI18n"),function(r){var t,o;class n extends r{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[o]=new Map}getI18nService(s){return s??this.useCustomMessageContexts?Pt:ze}i18n(s){let{context:c,key:d,message:u}=s,{custom:p,args:h,argsProvider:y}=s;if(c&&d){this.hasI18nContext(c)||this.addI18nContext(c,void 0,p);let g=h??(y?y(this):[]);return this.getI18nService(p).resolveMessage(c,d,...g)}return u}customI18n(s,c){if(Zi.isI18nKey(s)){let[d,u]=s.split(".");return this.i18n({custom:!0,context:d,key:u,...c})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((c,d,u)=>s.has(d)||typeof c.argsProvider=="function"),this.updateI18nProperties(c=>typeof c.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((c,d,u)=>{var p;return((p=u?.context)===null||p===void 0?void 0:p.toLowerCase())===s}),this.updateI18nProperties(c=>c.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var c,d;let u=this,p=(h,y,g)=>g?.context&&g.key&&s(h,y,g)?{...g,message:this.i18n({context:g.context,key:g.key,custom:g.custom,...h})}:g;(c=this[yc])===null||c===void 0||c.forEach((h,y)=>u[y]=p(h,y,u[y])),(d=this[gc])===null||d===void 0||d.forEach((h,y)=>{var g;return u[y]=(g=u[y])===null||g===void 0?void 0:g.map(v=>p(h,y,v))})}updateI18nProperties(s){var c;(c=this[Qi])===null||c===void 0||c.forEach((d,u)=>{s(d,u)&&(this[u]=this.i18n(d))})}addI18nMessages(s,c,d){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,c,d)}addI18nContext(s,c,d){let u=(typeof s=="string"?s:s.name).toLowerCase();d=typeof s=="string"?d:s.custom,this[yr].set(u,{isCustomContext:d}),this[Et].has(u)||this[Et].set(u,this.getI18nService(d).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(d).prepareContext(u,c)}hasI18nContext(s){return this[yr].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[yr].forEach((s,c)=>this.addI18nContext(c,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Et].forEach(s=>s()),this[Et].clear()}}return t=yr,o=Et,hc([(0,Yi.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),qi=class extends mr(ut.FtLitElement){},gr=class extends mr(ut.FtLitElementRedux){};var At=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},ne=class extends gr{constructor(){super(),this.editorMode=!1,this.addStore(O)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":br.nothing:br.html`
|
|
172
|
+
`;var ut=C(T());var Yi=C(K());var Io=class{fromLocalizableLabel(t){return t.type=="PLAIN_TEXT"?{message:t.text}:{key:t.key,custom:t.type=="LOCALIZED_CUSTOM",context:t.context,message:t.key}}fromAttribute(t){if(t!=null)try{return JSON.parse(t)}catch{if(this.isI18nKey(t)){let[n,i]=t.split(".");return{context:n,key:i,message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},Zi=new Io;var hc=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},yc=Symbol("i18nAttributes"),gc=Symbol("i18nListAttributes"),Qi=Symbol("i18nProperties"),yr=Symbol("i18nContexts"),Et=Symbol("i18nUnsubs"),mr=(0,ut.applyMixinOnce)(Symbol("withI18n"),function(r){var t,o;class n extends r{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[o]=new Map}getI18nService(s){return s??this.useCustomMessageContexts?Pt:ze}i18n(s){let{context:c,key:d,message:u}=s,{custom:p,args:h,argsProvider:y}=s;if(c&&d){this.hasI18nContext(c)||this.addI18nContext(c,void 0,p);let g=h??(y?y(this):[]);return this.getI18nService(p).resolveMessage(c,d,...g)}return u}async awaitI18n(s){let{context:c,custom:d}=s;return c&&await this.getI18nService(d).prepareContext(c),this.i18n(s)}customI18n(s,c){if(Zi.isI18nKey(s)){let[d,u]=s.split(".");return this.i18n({custom:!0,context:d,key:u,...c})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((c,d,u)=>s.has(d)||typeof c.argsProvider=="function"),this.updateI18nProperties(c=>typeof c.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((c,d,u)=>{var p;return((p=u?.context)===null||p===void 0?void 0:p.toLowerCase())===s}),this.updateI18nProperties(c=>c.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var c,d;let u=this,p=(h,y,g)=>g?.context&&g.key&&s(h,y,g)?{...g,message:this.i18n({context:g.context,key:g.key,custom:g.custom,...h})}:g;(c=this[yc])===null||c===void 0||c.forEach((h,y)=>u[y]=p(h,y,u[y])),(d=this[gc])===null||d===void 0||d.forEach((h,y)=>{var g;return u[y]=(g=u[y])===null||g===void 0?void 0:g.map(v=>p(h,y,v))})}updateI18nProperties(s){var c;(c=this[Qi])===null||c===void 0||c.forEach((d,u)=>{s(d,u)&&(this[u]=this.i18n(d))})}addI18nMessages(s,c,d){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,c,d)}addI18nContext(s,c,d){let u=(typeof s=="string"?s:s.name).toLowerCase();d=typeof s=="string"?d:s.custom,this[yr].set(u,{isCustomContext:d}),this[Et].has(u)||this[Et].set(u,this.getI18nService(d).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(d).prepareContext(u,c)}hasI18nContext(s){return this[yr].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[yr].forEach((s,c)=>this.addI18nContext(c,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Et].forEach(s=>s()),this[Et].clear()}}return t=yr,o=Et,hc([(0,Yi.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),qi=class extends mr(ut.FtLitElement){},gr=class extends mr(ut.FtLitElementRedux){};var At=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},ne=class extends gr{constructor(){super(),this.editorMode=!1,this.addStore(O)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":br.nothing:br.html`
|
|
173
173
|
<span class="ft-i18n">
|
|
174
174
|
${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
|
|
175
175
|
</span>
|
|
176
|
-
`}update(t){var o;super.update(t),["context","key","defaultMessage"].some(n=>t.has(n))&&this.context&&this.key&&this.addI18nContext(this.context,{[this.key]:(o=this.defaultMessage)!==null&&o!==void 0?o:""})}};ne.elementDefinitions={};ne.styles=Vi;At([(0,vr.redux)()],ne.prototype,"editorMode",void 0);At([(0,xr.property)()],ne.prototype,"context",void 0);At([(0,xr.property)()],ne.prototype,"key",void 0);At([(0,vr.jsonProperty)([])],ne.prototype,"args",void 0);At([(0,xr.property)()],ne.prototype,"defaultMessage",void 0);var Sr=class r{static build(t){return new r(t)}static buildCustom(t){return new r(t,!0)}static fromGwt(t){return new r(t)}get service(){return this.custom?Pt:ze}constructor(t,o=!1){this.name=t,this.custom=o,this.properties=new Proxy({},{get:(n,i)=>{let s=i;return c=>({context:this.name,key:s,custom:this.custom,args:typeof c=="function"?void 0:c,argsProvider:typeof c=="function"?c:void 0})}}),this.messages=new Proxy({},{get:(n,i)=>(...s)=>this.service.resolveMessage(this.name,i,...s)}),this.rawMessages=new Proxy({},{get:(n,i)=>this.service.resolveRawMessage(this.name,i)}),this.keys=new Proxy({},{get:(n,i)=>()=>i})}};(0,Xi.customElement)("ft-i18n")(ne);var Ro=Sr.build("searchResultsNumber");var Fe=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},J=class extends mr(Ze){constructor(){super(),this.clusterPolicy="display-first-result",this.displayNoResultsMessage=!1,this.renderResult=()=>Cr.html`
|
|
176
|
+
`}update(t){var o;super.update(t),["context","key","defaultMessage"].some(n=>t.has(n))&&this.context&&this.key&&this.addI18nContext(this.context,{[this.key]:(o=this.defaultMessage)!==null&&o!==void 0?o:""})}};ne.elementDefinitions={};ne.styles=Vi;At([(0,vr.redux)()],ne.prototype,"editorMode",void 0);At([(0,xr.property)()],ne.prototype,"context",void 0);At([(0,xr.property)()],ne.prototype,"key",void 0);At([(0,vr.jsonProperty)([])],ne.prototype,"args",void 0);At([(0,xr.property)()],ne.prototype,"defaultMessage",void 0);var Sr=class r{static build(t){return new r(t)}static buildCustom(t){return new r(t,!0)}static fromGwt(t){return new r(t)}get service(){return this.custom?Pt:ze}constructor(t,o=!1){this.name=t,this.custom=o,this.properties=new Proxy({},{get:(n,i)=>{let s=i;return c=>({context:this.name,key:s,custom:this.custom,args:typeof c=="function"?void 0:c,argsProvider:typeof c=="function"?c:void 0})}}),this.messages=new Proxy({},{get:(n,i)=>(...s)=>this.service.resolveMessage(this.name,i,...s)}),this.rawMessages=new Proxy({},{get:(n,i)=>this.service.resolveRawMessage(this.name,i)}),this.keys=new Proxy({},{get:(n,i)=>()=>i}),this.attributes=new Proxy({},{get:(n,i)=>()=>({context:this.name,key:i,message:this.service.resolveRawMessage(this.name,i)})})}};(0,Xi.customElement)("ft-i18n")(ne);var Ro=Sr.build("searchResultsNumber");var Fe=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(i<3?c(s):i>3?c(t,o,s):c(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},J=class extends mr(Ze){constructor(){super(),this.clusterPolicy="display-first-result",this.displayNoResultsMessage=!1,this.renderResult=()=>Cr.html`
|
|
177
177
|
<ft-search-result-title></ft-search-result-title>
|
|
178
178
|
<ft-search-result-abstract></ft-search-result-abstract>
|
|
179
179
|
`,this.clusterSortCriterion=[],this.selectedResultByCluster={},this.addI18nContext(Ro)}render(){if(this.displayNoResultsMessage&&this.results!=null&&this.results.length==0)return Cr.html`
|