@fluid-topics/ft-search-result-abstract 1.0.27 → 1.0.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.
@@ -2,4 +2,7 @@ import { css } from "lit";
2
2
  export const FtSearchResultAbstractCssVariables = {};
3
3
  // language=CSS
4
4
  export const styles = css `
5
+ .kwicmatch {
6
+ font-weight: 700;
7
+ }
5
8
  `;
@@ -2,6 +2,9 @@
2
2
  `,r=i.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,i)=>{t.baseUrl=i.payload},setApiIntegrationIdentifier:(t,i)=>{t.apiIntegrationIdentifier=i.payload},setUiLocale:(t,i)=>{t.uiLocale=i.payload},setAvailableUiLocales:(t,i)=>{t.availableUiLocales=i.payload},setEditorMode:(t,i)=>{t.editorMode=i.payload},setNoCustom:(t,i)=>{t.noCustom=i.payload},setNoCustomComponent:(t,i)=>{t.noCustomComponent=i.payload},setSession:(t,i)=>{t.session=i.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class h{static build(t){const{baseUrl:i,apiIntegrationIdentifier:e}=r.getState(),s=null!=t?t:e;if(i&&s&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,s,!0)}static get(t){var i;return null!=t?h.build(t):null!==(i=h.API)&&void 0!==i?i:h.API=h.build()}static await(t){return new Promise((i=>{let e=h.get(t);if(e)i(e);else{const s=r.subscribe((()=>{e=h.get(t),e&&(s(),i(e))}))}}))}}var a;const l=Symbol("clearAfterUnitTest");class p{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={},this.currentUiLocale="",this[a]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},this.currentUiLocale=r.getState().uiLocale,r.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=r.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const i=t.name.toLowerCase();this.cache.setFinal(i,t),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var s;if(t=t.toLowerCase(),Object.keys(e).length>0){const o={...null!==(s=this.defaultMessages[t])&&void 0!==s?s:{},...e};i.deepEqual(this.defaultMessages[t],o)||(this.defaultMessages[t]=o,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...s){var o,n,r;t=t.toLowerCase(),this.fetchContext(t);const h=null!==(n=null===(o=this.cache.getNow(t))||void 0===o?void 0:o.messages)&&void 0!==n?n:{};return new i.ParametrizedLabelResolver(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},h).resolve(e,...s)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,i){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(i),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(i)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>i.delay(0).then((()=>t())).catch((()=>null)))))}}a=l,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new p((async(t,i)=>(await h.await()).getFluidTopicsMessageContext(t,i)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new p((async(t,i)=>(await h.await()).getCustomMessageContext(t,i))));const f=window.FluidTopicsI18nService;var y=function(t,i,e,s){for(var o,n=arguments.length,r=n<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,h=t.length-1;h>=0;h--)(o=t[h])&&(r=(n<3?o(r):n>3?o(i,e,r):o(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class c extends i.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>h.get(),this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return e.html`
3
3
  <slot></slot>
4
4
  `}updated(t){super.updated(t),t.has("baseUrl")&&r.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&r.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&r.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&r.actions.setNoCustom(this.noCustom),t.has("editorMode")&&r.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&r.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&r.actions.setSession(this.session),t.has("availableUiLocales")&&r.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>f.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const i=await t.getCurrentSession();return i.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),i.idleTimeoutInMillis),i}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}c.elementDefinitions={},c.styles=n,y([s.property()],c.prototype,"baseUrl",void 0),y([s.property()],c.prototype,"apiIntegrationIdentifier",void 0),y([s.property()],c.prototype,"uiLocale",void 0),y([i.jsonProperty([])],c.prototype,"availableUiLocales",void 0),y([s.property({type:Boolean})],c.prototype,"editorMode",void 0),y([s.property({type:Boolean})],c.prototype,"noCustom",void 0),y([s.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],c.prototype,"noCustomComponent",void 0),y([s.property({type:Boolean})],c.prototype,"withManualResources",void 0),y([i.jsonProperty([])],c.prototype,"messageContexts",void 0),y([i.jsonProperty(void 0)],c.prototype,"session",void 0),y([s.property({type:Object})],c.prototype,"apiProvider",void 0),i.customElement("ft-app-context")(c);var u=function(t,i,e,s){for(var o,n=arguments.length,r=n<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,h=t.length-1;h>=0;h--)(o=t[h])&&(r=(n<3?o(r):n>3?o(i,e,r):o(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class g extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const d=Symbol("registerInterval");class v extends(function(t){var i;class e extends t{constructor(){super(...arguments),this[i]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[d]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[d]):this.dispatchEvent(new g)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return i=d,u([s.state()],e.prototype,"stateManager",void 0),e}(i.FtLitElementRedux)){}var b=function(t,i,e,s){for(var o,n=arguments.length,r=n<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,h=t.length-1;h>=0;h--)(o=t[h])&&(r=(n<3?o(r):n>3?o(i,e,r):o(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class m extends Event{constructor(){super("register-ft-search-result-component",{bubbles:!0,composed:!0})}}const $=Symbol("registerInterval");class w extends(function(t){var i;class e extends t{constructor(){super(...arguments),this[i]=0}connectedCallback(){super.connectedCallback(),this[$]=window.setInterval((()=>this.tryToRegisterToResultContext()),50)}tryToRegisterToResultContext(){null!=this.result?window.clearInterval(this[$]):this.dispatchEvent(new m)}disconnectedCallback(){super.disconnectedCallback(),this.result=void 0}}return i=$,b([s.property({attribute:!1})],e.prototype,"result",void 0),e}(v)){}const x=e.css`
5
+ .kwicmatch {
6
+ font-weight: 700;
7
+ }
5
8
  `
6
9
  /**
7
10
  * @license
@@ -87,6 +87,9 @@ var ft,ht;let dt=class extends R{constructor(){super(...arguments),this.renderOp
87
87
  `,Or=gr.get({name:"ft-app-info",reducers:{setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setUiLocale:(t,e)=>{t.uiLocale=e.payload},setAvailableUiLocales:(t,e)=>{t.availableUiLocales=e.payload},setEditorMode:(t,e)=>{t.editorMode=e.payload},setNoCustom:(t,e)=>{t.noCustom=e.payload},setNoCustomComponent:(t,e)=>{t.noCustomComponent=e.payload},setSession:(t,e)=>{t.session=e.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class Sr{static build(t){const{baseUrl:e,apiIntegrationIdentifier:r}=Or.getState(),n=null!=t?t:r;if(e&&n&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,n,!0)}static get(t){var e;return null!=t?Sr.build(t):null!==(e=Sr.API)&&void 0!==e?e:Sr.API=Sr.build()}static await(t){return new Promise((e=>{let r=Sr.get(t);if(r)e(r);else{const n=Or.subscribe((()=>{r=Sr.get(t),r&&(n(),e(r))}))}}))}}var Er;const jr=Symbol("clearAfterUnitTest");class $r{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new n,this.listeners={},this.currentUiLocale="",this[Er]=()=>{this.defaultMessages={},this.cache=new n,this.listeners={}},this.currentUiLocale=Or.getState().uiLocale,Or.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Or.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var r;if(t=t.toLowerCase(),Object.keys(e).length>0){const n={...null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},...e};c(this.defaultMessages[t],n)||(this.defaultMessages[t]=n,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...r){var n,i,o;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(i=null===(n=this.cache.getNow(t))||void 0===n?void 0:n.messages)&&void 0!==i?i:{};return new Et(null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},s).resolve(e,...r)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var r;return t=t.toLowerCase(),this.listeners[t]=null!==(r=this.listeners[t])&&void 0!==r?r:new Set,this.listeners[t].add(e),()=>{var r;return null===(r=this.listeners[t])||void 0===r?void 0:r.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>{return(e=0,new Promise((t=>setTimeout(t,e)))).then((()=>t())).catch((()=>null));var e})))}}Er=jr,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new $r((async(t,e)=>(await Sr.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new $r((async(t,e)=>(await Sr.await()).getCustomMessageContext(t,e))));const Cr=window.FluidTopicsI18nService;var Nr=function(t,e,r,n){for(var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};class Rr extends St{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Sr.get(),this.cache=new n,this.cleanSessionDebouncer=new i}render(){return X`
88
88
  <slot></slot>
89
89
  `}updated(t){super.updated(t),t.has("baseUrl")&&Or.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Or.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Or.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Or.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Or.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Or.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Or.actions.setSession(this.session),t.has("availableUiLocales")&&Or.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Cr.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const e=await t.getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),e.idleTimeoutInMillis),e}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}Rr.elementDefinitions={},Rr.styles=xr,Nr([s()],Rr.prototype,"baseUrl",void 0),Nr([s()],Rr.prototype,"apiIntegrationIdentifier",void 0),Nr([s()],Rr.prototype,"uiLocale",void 0),Nr([f([])],Rr.prototype,"availableUiLocales",void 0),Nr([s({type:Boolean})],Rr.prototype,"editorMode",void 0),Nr([s({type:Boolean})],Rr.prototype,"noCustom",void 0),Nr([s({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Rr.prototype,"noCustomComponent",void 0),Nr([s({type:Boolean})],Rr.prototype,"withManualResources",void 0),Nr([f([])],Rr.prototype,"messageContexts",void 0),Nr([f(void 0)],Rr.prototype,"session",void 0),Nr([s({type:Object})],Rr.prototype,"apiProvider",void 0),l("ft-app-context")(Rr);var Mr=function(t,e,r,n){for(var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};class Ar extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const Pr=Symbol("registerInterval");class Ur extends(function(t){var e;class r extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Pr]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Pr]):this.dispatchEvent(new Ar)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=Pr,Mr([a()],r.prototype,"stateManager",void 0),r}(yr)){}var kr=function(t,e,r,n){for(var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};class Fr extends Event{constructor(){super("register-ft-search-result-component",{bubbles:!0,composed:!0})}}const Lr=Symbol("registerInterval");class Tr extends(function(t){var e;class r extends t{constructor(){super(...arguments),this[e]=0}connectedCallback(){super.connectedCallback(),this[Lr]=window.setInterval((()=>this.tryToRegisterToResultContext()),50)}tryToRegisterToResultContext(){null!=this.result?window.clearInterval(this[Lr]):this.dispatchEvent(new Fr)}disconnectedCallback(){super.disconnectedCallback(),this.result=void 0}}return e=Lr,kr([s({attribute:!1})],r.prototype,"result",void 0),r}(Ur)){}const _r=g`
90
+ .kwicmatch {
91
+ font-weight: 700;
92
+ }
90
93
  `
91
94
  /**
92
95
  * @license
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-search-result-abstract",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "description": "Search result abstract for integrated search component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,16 +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.27",
23
- "@fluid-topics/ft-typography": "1.0.27",
24
- "@fluid-topics/ft-wc-utils": "1.0.27",
22
+ "@fluid-topics/ft-search-result-context": "1.0.29",
23
+ "@fluid-topics/ft-typography": "1.0.29",
24
+ "@fluid-topics/ft-wc-utils": "1.0.29",
25
25
  "lit": "2.7.2"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluid-topics/public-api": "1.0.38"
29
29
  },
30
- "peerDependencies": {
31
- "@fluid-topics/public-api": "1.0.38"
32
- },
33
- "gitHead": "6b4e3bcc50463a1e20749c148495bfe7bbc97e6d"
30
+ "gitHead": "42bc522b00a0462c9515187000553c7d120b22b5"
34
31
  }