@fluid-topics/ft-search-results-spellcheck 1.1.25 → 1.1.26
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.
|
@@ -140,7 +140,7 @@ const H=Symbol.for(""),P=t=>{if(t?.r===H)return t?._$litStatic$},G=t=>({_$litSta
|
|
|
140
140
|
`,wo=r.css`
|
|
141
141
|
`,Eo=o.FtReduxStore.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0}});class Io{static build(t){const{baseUrl:o,apiIntegrationIdentifier:r}=Eo.getState(),e=null!=t?t:r;if(o&&e&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,e,!0)}static get(t){var o;return null!=t?Io.build(t):null!==(o=Io.API)&&void 0!==o?o:Io.API=Io.build()}static await(t){return new Promise((o=>{let r=Io.get(t);if(r)o(r);else{const e=Eo.subscribe((()=>{r=Io.get(t),r&&(e(),o(r))}))}}))}}var Uo;const Ro=Symbol("clearAfterUnitTest");class xo{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new o.CacheRegistry,this.listeners={},this.currentUiLocale="",this[Uo]=()=>{this.defaultMessages={},this.cache=new o.CacheRegistry,this.listeners={}},this.currentUiLocale=Eo.getState().uiLocale,Eo.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Eo.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,r){var e;if(t=t.toLowerCase(),Object.keys(r).length>0){const a={...null!==(e=this.defaultMessages[t])&&void 0!==e?e:{},...r};o.deepEqual(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,r,...e){var a,n,i;t=t.toLowerCase(),this.fetchContext(t);const l=null!==(n=null===(a=this.cache.getNow(t))||void 0===a?void 0:a.messages)&&void 0!==n?n:{};return new o.ParametrizedLabelResolver(null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},l).resolve(r,...e)}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,o){var r;return t=t.toLowerCase(),this.listeners[t]=null!==(r=this.listeners[t])&&void 0!==r?r:new Set,this.listeners[t].add(o),()=>{var r;return null===(r=this.listeners[t])||void 0===r?void 0:r.delete(o)}}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=>o.delay(0).then((()=>t())).catch((()=>null)))))}}Uo=Ro,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new xo((async(t,o)=>(await Io.await()).getFluidTopicsMessageContext(t,o)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new xo((async(t,o)=>(await Io.await()).getCustomMessageContext(t,o))));const Lo=window.FluidTopicsI18nService,Wo=window.FluidTopicsCustomI18nService;var Ko=function(t,o,r,e){for(var a,n=arguments.length,i=n<3?o:null===e?e=Object.getOwnPropertyDescriptor(o,r):e,l=t.length-1;l>=0;l--)(a=t[l])&&(i=(n<3?a(i):n>3?a(o,r,i):a(o,r))||i);return n>3&&i&&Object.defineProperty(o,r,i),i};class ko extends o.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Io.get(),this.cache=new o.CacheRegistry,this.cleanSessionDebouncer=new o.Debouncer}render(){return r.html`
|
|
142
142
|
<slot></slot>
|
|
143
|
-
`}update(t){super.update(t),t.has("baseUrl")&&Eo.actions.baseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Eo.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Eo.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Eo.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Eo.actions.noCustom(this.noCustom),t.has("editorMode")&&Eo.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Eo.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Eo.actions.session(this.session),t.has("availableUiLocales")&&Eo.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Lo.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}ko.elementDefinitions={},ko.styles=wo,Ko([e.property()],ko.prototype,"baseUrl",void 0),Ko([e.property()],ko.prototype,"apiIntegrationIdentifier",void 0),Ko([e.property()],ko.prototype,"uiLocale",void 0),Ko([o.jsonProperty(null)],ko.prototype,"availableUiLocales",void 0),Ko([o.jsonProperty(null)],ko.prototype,"metadataConfiguration",void 0),Ko([e.property({type:Boolean})],ko.prototype,"editorMode",void 0),Ko([e.property({type:Boolean})],ko.prototype,"noCustom",void 0),Ko([e.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],ko.prototype,"noCustomComponent",void 0),Ko([e.property({type:Boolean})],ko.prototype,"withManualResources",void 0),Ko([o.jsonProperty([])],ko.prototype,"messageContexts",void 0),Ko([o.jsonProperty(void 0)],ko.prototype,"session",void 0),Ko([e.property({type:Object})],ko.prototype,"apiProvider",void 0);class Ao{async listMySearches(){var t;return(null===(t=Eo.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Io.await()).listMySearches(Eo.getState().session.profile.userId):[]}}const $o=new o.CacheRegistry;class Zo{async listMyBookmarks(){return $o.get("bookmarks",(async()=>(await Io.await()).listMyBookmarks(Eo.getState().session.profile.userId)))}clearCache(){$o.clear("bookmarks")}}const Do=o.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=Eo.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Zo,Eo.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:r}=Eo.getState();o.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==r?void 0:r.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){Do.actions.savedSearches(void 0)}clearMyBookmarks(){Do.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Ao,o=await t.listMySearches();Do.actions.savedSearches(o)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Do.actions.bookmarks(o)}}},o.customElement("ft-app-context")(ko);var zo=function(t,o,r,e){for(var a,n=arguments.length,i=n<3?o:null===e?e=Object.getOwnPropertyDescriptor(o,r):e,l=t.length-1;l>=0;l--)(a=t[l])&&(i=(n<3?a(i):n>3?a(o,r,i):a(o,r))||i);return n>3&&i&&Object.defineProperty(o,r,i),i};const Fo=Symbol("i18nProperties"),Bo=Symbol("i18nUnsubs");function To(t){var o;class r extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[o]=new Map}get i18nService(){return this.useCustomMessageContexts?Wo:Lo}i18n(t,o,...r){var e;if("string"==typeof t)return this.i18nService.resolveMessage(t,o,...r);const a=null!==(e=t.args)&&void 0!==e?e:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...a)}onI18nUpdate(t){var o;null===(o=this[Fo])||void 0===o||o.forEach(((o,r)=>{o.context.toLowerCase()===t.toLowerCase()&&(this[r]=this.i18n(o))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var o;super.update(t),null===(o=this[Fo])||void 0===o||o.forEach(((t,o)=>{null!=t.argsProvider&&(this[o]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Fo]&&new Set([...this[Fo].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,o){t=t.toLowerCase(),this[Bo].has(t)||this[Bo].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=o?o:{})}addI18nContext(t,o){this.addI18nMessages(t.name,o)}disconnectedCallback(){super.disconnectedCallback(),this[Bo].forEach((t=>t())),this[Bo].clear()}}return o=Bo,zo([e.property({type:Boolean})],r.prototype,"useCustomMessageContexts",void 0),r}class Ho extends(To(o.FtLitElement)){}class Po extends(To(o.FtLitElementRedux)){}var Go,_o,Mo,jo,Yo,qo,Vo,Xo,Jo,Qo,tr,or,rr,er,ar,nr,ir,lr,cr=function(t,o,r,e){for(var a,n=arguments.length,i=n<3?o:null===e?e=Object.getOwnPropertyDescriptor(o,r):e,l=t.length-1;l>=0;l--)(a=t[l])&&(i=(n<3?a(i):n>3?a(o,r,i):a(o,r))||i);return n>3&&i&&Object.defineProperty(o,r,i),i};class sr extends Po{constructor(){super(),this.editorMode=!1,this.addStore(Eo)}render(){return this.key&&this.context?r.html`
|
|
143
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(Eo.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Eo.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Eo.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Eo.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Eo.actions.noCustom(this.noCustom),t.has("editorMode")&&Eo.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Eo.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Eo.actions.session(this.session),t.has("availableUiLocales")&&Eo.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Lo.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}ko.elementDefinitions={},ko.styles=wo,Ko([e.property()],ko.prototype,"baseUrl",void 0),Ko([e.property()],ko.prototype,"apiIntegrationIdentifier",void 0),Ko([e.property()],ko.prototype,"uiLocale",void 0),Ko([o.jsonProperty(null)],ko.prototype,"availableUiLocales",void 0),Ko([o.jsonProperty(null)],ko.prototype,"metadataConfiguration",void 0),Ko([e.property({type:Boolean})],ko.prototype,"editorMode",void 0),Ko([e.property({type:Boolean})],ko.prototype,"noCustom",void 0),Ko([e.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],ko.prototype,"noCustomComponent",void 0),Ko([e.property({type:Boolean})],ko.prototype,"withManualResources",void 0),Ko([o.jsonProperty([])],ko.prototype,"messageContexts",void 0),Ko([o.jsonProperty(void 0)],ko.prototype,"session",void 0),Ko([e.property({type:Object})],ko.prototype,"apiProvider",void 0);class Ao{async listMySearches(){var t;return(null===(t=Eo.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Io.await()).listMySearches(Eo.getState().session.profile.userId):[]}}const $o=new o.CacheRegistry;class Zo{async listMyBookmarks(){return $o.get("bookmarks",(async()=>(await Io.await()).listMyBookmarks(Eo.getState().session.profile.userId)))}clearCache(){$o.clear("bookmarks")}}const Do=o.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=Eo.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Zo,Eo.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:r}=Eo.getState();o.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==r?void 0:r.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){Do.actions.savedSearches(void 0)}clearMyBookmarks(){Do.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Ao,o=await t.listMySearches();Do.actions.savedSearches(o)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Do.actions.bookmarks(o)}}},o.customElement("ft-app-context")(ko);var zo=function(t,o,r,e){for(var a,n=arguments.length,i=n<3?o:null===e?e=Object.getOwnPropertyDescriptor(o,r):e,l=t.length-1;l>=0;l--)(a=t[l])&&(i=(n<3?a(i):n>3?a(o,r,i):a(o,r))||i);return n>3&&i&&Object.defineProperty(o,r,i),i};const Fo=Symbol("i18nProperties"),Bo=Symbol("i18nUnsubs");function To(t){var o;class r extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[o]=new Map}get i18nService(){return this.useCustomMessageContexts?Wo:Lo}i18n(t,o,...r){var e;if("string"==typeof t)return this.i18nService.resolveMessage(t,o,...r);const a=null!==(e=t.args)&&void 0!==e?e:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...a)}onI18nUpdate(t){var o;null===(o=this[Fo])||void 0===o||o.forEach(((o,r)=>{o.context.toLowerCase()===t.toLowerCase()&&(this[r]=this.i18n(o))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var o;super.update(t),null===(o=this[Fo])||void 0===o||o.forEach(((t,o)=>{null!=t.argsProvider&&(this[o]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Fo]&&new Set([...this[Fo].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,o){t=t.toLowerCase(),this[Bo].has(t)||this[Bo].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=o?o:{})}addI18nContext(t,o){this.addI18nMessages(t.name,o)}disconnectedCallback(){super.disconnectedCallback(),this[Bo].forEach((t=>t())),this[Bo].clear()}}return o=Bo,zo([e.property({type:Boolean})],r.prototype,"useCustomMessageContexts",void 0),r}class Ho extends(To(o.FtLitElement)){}class Po extends(To(o.FtLitElementRedux)){}var Go,_o,Mo,jo,Yo,qo,Vo,Xo,Jo,Qo,tr,or,rr,er,ar,nr,ir,lr,cr=function(t,o,r,e){for(var a,n=arguments.length,i=n<3?o:null===e?e=Object.getOwnPropertyDescriptor(o,r):e,l=t.length-1;l>=0;l--)(a=t[l])&&(i=(n<3?a(i):n>3?a(o,r,i):a(o,r))||i);return n>3&&i&&Object.defineProperty(o,r,i),i};class sr extends Po{constructor(){super(),this.editorMode=!1,this.addStore(Eo)}render(){return this.key&&this.context?r.html`
|
|
144
144
|
<span class="ft-i18n">
|
|
145
145
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
146
146
|
</span>
|
|
@@ -238,7 +238,7 @@ let bo=class extends Kt{constructor(){super(...arguments),this.renderOptions={ho
|
|
|
238
238
|
`,yi=Ot`
|
|
239
239
|
`,gi=Kr.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0}});class bi{static build(t){const{baseUrl:o,apiIntegrationIdentifier:e}=gi.getState(),r=null!=t?t:e;if(o&&r&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,r,!0)}static get(t){var o;return null!=t?bi.build(t):null!==(o=bi.API)&&void 0!==o?o:bi.API=bi.build()}static await(t){return new Promise((o=>{let e=bi.get(t);if(e)o(e);else{const r=gi.subscribe((()=>{e=bi.get(t),e&&(r(),o(e))}))}}))}}var mi;const Oi=Symbol("clearAfterUnitTest");class vi{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new r,this.listeners={},this.currentUiLocale="",this[mi]=()=>{this.defaultMessages={},this.cache=new r,this.listeners={}},this.currentUiLocale=gi.getState().uiLocale,gi.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=gi.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var e;if(t=t.toLowerCase(),Object.keys(o).length>0){const r={...null!==(e=this.defaultMessages[t])&&void 0!==e?e:{},...o};L(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...e){var r,n,i;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new Ko(null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},a).resolve(o,...e)}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,o){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(o),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(o)}}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(o=0,new Promise((t=>setTimeout(t,o)))).then((()=>t())).catch((()=>null));var o})))}}mi=Oi,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new vi((async(t,o)=>(await bi.await()).getFluidTopicsMessageContext(t,o)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new vi((async(t,o)=>(await bi.await()).getCustomMessageContext(t,o))));const Si=window.FluidTopicsI18nService,wi=window.FluidTopicsCustomI18nService;var Ni=function(t,o,e,r){for(var n,i=arguments.length,a=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(o,e,a):n(o,e))||a);return i>3&&a&&Object.defineProperty(o,e,a),a};class xi extends ko{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>bi.get(),this.cache=new r,this.cleanSessionDebouncer=new n}render(){return oo`
|
|
240
240
|
<slot></slot>
|
|
241
|
-
`}update(t){super.update(t),t.has("baseUrl")&&gi.actions.baseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&gi.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&gi.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&gi.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&gi.actions.noCustom(this.noCustom),t.has("editorMode")&&gi.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&gi.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&gi.actions.session(this.session),t.has("availableUiLocales")&&gi.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Si.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}xi.elementDefinitions={},xi.styles=yi,Ni([U()],xi.prototype,"baseUrl",void 0),Ni([U()],xi.prototype,"apiIntegrationIdentifier",void 0),Ni([U()],xi.prototype,"uiLocale",void 0),Ni([W(null)],xi.prototype,"availableUiLocales",void 0),Ni([W(null)],xi.prototype,"metadataConfiguration",void 0),Ni([U({type:Boolean})],xi.prototype,"editorMode",void 0),Ni([U({type:Boolean})],xi.prototype,"noCustom",void 0),Ni([U({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],xi.prototype,"noCustomComponent",void 0),Ni([U({type:Boolean})],xi.prototype,"withManualResources",void 0),Ni([W([])],xi.prototype,"messageContexts",void 0),Ni([W(void 0)],xi.prototype,"session",void 0),Ni([U({type:Object})],xi.prototype,"apiProvider",void 0);class Ci{async listMySearches(){var t;return(null===(t=gi.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await bi.await()).listMySearches(gi.getState().session.profile.userId):[]}}const Ei=new r;class Ri{async listMyBookmarks(){return Ei.get("bookmarks",(async()=>(await bi.await()).listMyBookmarks(gi.getState().session.profile.userId)))}clearCache(){Ei.clear("bookmarks")}}const Ui=Kr.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=gi.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Ri,gi.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=gi.getState();L(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==o?void 0:o.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){Ui.actions.savedSearches(void 0)}clearMyBookmarks(){Ui.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Ci,o=await t.listMySearches();Ui.actions.savedSearches(o)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Ui.actions.bookmarks(o)}}},A("ft-app-context")(xi);var Ii=function(t,o,e,r){for(var n,i=arguments.length,a=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(o,e,a):n(o,e))||a);return i>3&&a&&Object.defineProperty(o,e,a),a};const Li=Symbol("i18nProperties"),Ai=Symbol("i18nUnsubs");function Wi(t){var o;class e extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[o]=new Map}get i18nService(){return this.useCustomMessageContexts?wi:Si}i18n(t,o,...e){var r;if("string"==typeof t)return this.i18nService.resolveMessage(t,o,...e);const n=null!==(r=t.args)&&void 0!==r?r:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...n)}onI18nUpdate(t){var o;null===(o=this[Li])||void 0===o||o.forEach(((o,e)=>{o.context.toLowerCase()===t.toLowerCase()&&(this[e]=this.i18n(o))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var o;super.update(t),null===(o=this[Li])||void 0===o||o.forEach(((t,o)=>{null!=t.argsProvider&&(this[o]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Li]&&new Set([...this[Li].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,o){t=t.toLowerCase(),this[Ai].has(t)||this[Ai].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=o?o:{})}addI18nContext(t,o){this.addI18nMessages(t.name,o)}disconnectedCallback(){super.disconnectedCallback(),this[Ai].forEach((t=>t())),this[Ai].clear()}}return o=Ai,Ii([U({type:Boolean})],e.prototype,"useCustomMessageContexts",void 0),e}class ki extends(Wi(ko)){}class $i extends(Wi(Bo)){}var Ki,Pi,ji,Fi,Di,Mi,Zi,Ti,_i,zi,Bi,Hi,Gi,qi,Vi,Yi,Xi,Ji,Qi=function(t,o,e,r){for(var n,i=arguments.length,a=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(o,e,a):n(o,e))||a);return i>3&&a&&Object.defineProperty(o,e,a),a};class ta extends $i{constructor(){super(),this.editorMode=!1,this.addStore(gi)}render(){return this.key&&this.context?oo`
|
|
241
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(gi.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&gi.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&gi.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&gi.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&gi.actions.noCustom(this.noCustom),t.has("editorMode")&&gi.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&gi.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&gi.actions.session(this.session),t.has("availableUiLocales")&&gi.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Si.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}xi.elementDefinitions={},xi.styles=yi,Ni([U()],xi.prototype,"baseUrl",void 0),Ni([U()],xi.prototype,"apiIntegrationIdentifier",void 0),Ni([U()],xi.prototype,"uiLocale",void 0),Ni([W(null)],xi.prototype,"availableUiLocales",void 0),Ni([W(null)],xi.prototype,"metadataConfiguration",void 0),Ni([U({type:Boolean})],xi.prototype,"editorMode",void 0),Ni([U({type:Boolean})],xi.prototype,"noCustom",void 0),Ni([U({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],xi.prototype,"noCustomComponent",void 0),Ni([U({type:Boolean})],xi.prototype,"withManualResources",void 0),Ni([W([])],xi.prototype,"messageContexts",void 0),Ni([W(void 0)],xi.prototype,"session",void 0),Ni([U({type:Object})],xi.prototype,"apiProvider",void 0);class Ci{async listMySearches(){var t;return(null===(t=gi.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await bi.await()).listMySearches(gi.getState().session.profile.userId):[]}}const Ei=new r;class Ri{async listMyBookmarks(){return Ei.get("bookmarks",(async()=>(await bi.await()).listMyBookmarks(gi.getState().session.profile.userId)))}clearCache(){Ei.clear("bookmarks")}}const Ui=Kr.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=gi.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Ri,gi.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=gi.getState();L(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==o?void 0:o.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){Ui.actions.savedSearches(void 0)}clearMyBookmarks(){Ui.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Ci,o=await t.listMySearches();Ui.actions.savedSearches(o)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Ui.actions.bookmarks(o)}}},A("ft-app-context")(xi);var Ii=function(t,o,e,r){for(var n,i=arguments.length,a=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(o,e,a):n(o,e))||a);return i>3&&a&&Object.defineProperty(o,e,a),a};const Li=Symbol("i18nProperties"),Ai=Symbol("i18nUnsubs");function Wi(t){var o;class e extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[o]=new Map}get i18nService(){return this.useCustomMessageContexts?wi:Si}i18n(t,o,...e){var r;if("string"==typeof t)return this.i18nService.resolveMessage(t,o,...e);const n=null!==(r=t.args)&&void 0!==r?r:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...n)}onI18nUpdate(t){var o;null===(o=this[Li])||void 0===o||o.forEach(((o,e)=>{o.context.toLowerCase()===t.toLowerCase()&&(this[e]=this.i18n(o))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var o;super.update(t),null===(o=this[Li])||void 0===o||o.forEach(((t,o)=>{null!=t.argsProvider&&(this[o]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Li]&&new Set([...this[Li].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,o){t=t.toLowerCase(),this[Ai].has(t)||this[Ai].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=o?o:{})}addI18nContext(t,o){this.addI18nMessages(t.name,o)}disconnectedCallback(){super.disconnectedCallback(),this[Ai].forEach((t=>t())),this[Ai].clear()}}return o=Ai,Ii([U({type:Boolean})],e.prototype,"useCustomMessageContexts",void 0),e}class ki extends(Wi(ko)){}class $i extends(Wi(Bo)){}var Ki,Pi,ji,Fi,Di,Mi,Zi,Ti,_i,zi,Bi,Hi,Gi,qi,Vi,Yi,Xi,Ji,Qi=function(t,o,e,r){for(var n,i=arguments.length,a=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(o,e,a):n(o,e))||a);return i>3&&a&&Object.defineProperty(o,e,a),a};class ta extends $i{constructor(){super(),this.editorMode=!1,this.addStore(gi)}render(){return this.key&&this.context?oo`
|
|
242
242
|
<span class="ft-i18n">
|
|
243
243
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
244
244
|
</span>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-results-spellcheck",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.26",
|
|
4
4
|
"description": "Spellcheck component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
23
|
-
"@fluid-topics/public-api": "1.0.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "1.1.26",
|
|
23
|
+
"@fluid-topics/public-api": "1.0.56",
|
|
24
24
|
"lit": "3.1.0"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "6734976f5a7f6b986917a085be0c38ca3ae562a0"
|
|
27
27
|
}
|