@fluid-topics/ft-search-type 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.
|
@@ -1484,7 +1484,7 @@ const j=Symbol.for(""),M=t=>{if(t?.r===j)return t?._$litStatic$},_=t=>({_$litSta
|
|
|
1484
1484
|
`,tr=o.css`
|
|
1485
1485
|
`,er=e.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 or{static build(t){const{baseUrl:e,apiIntegrationIdentifier:o}=er.getState(),i=null!=t?t:o;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static get(t){var e;return null!=t?or.build(t):null!==(e=or.API)&&void 0!==e?e:or.API=or.build()}static await(t){return new Promise((e=>{let o=or.get(t);if(o)e(o);else{const i=er.subscribe((()=>{o=or.get(t),o&&(i(),e(o))}))}}))}}var ir;const rr=Symbol("clearAfterUnitTest");class nr{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={},this.currentUiLocale="",this[ir]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=er.getState().uiLocale,er.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=er.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,o){var i;if(t=t.toLowerCase(),Object.keys(o).length>0){const r={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...o};e.deepEqual(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...i){var r,n,a;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new e.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},s).resolve(o,...i)}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 o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.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=>e.delay(0).then((()=>t())).catch((()=>null)))))}}ir=rr,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new nr((async(t,e)=>(await or.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new nr((async(t,e)=>(await or.await()).getCustomMessageContext(t,e))));const ar=window.FluidTopicsI18nService,sr=window.FluidTopicsCustomI18nService;var lr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class cr extends e.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=()=>or.get(),this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return o.html`
|
|
1486
1486
|
<slot></slot>
|
|
1487
|
-
`}update(t){super.update(t),t.has("baseUrl")&&er.actions.baseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&er.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&er.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&er.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&er.actions.noCustom(this.noCustom),t.has("editorMode")&&er.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&er.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&er.actions.session(this.session),t.has("availableUiLocales")&&er.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>ar.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()))}}cr.elementDefinitions={},cr.styles=tr,lr([i.property()],cr.prototype,"baseUrl",void 0),lr([i.property()],cr.prototype,"apiIntegrationIdentifier",void 0),lr([i.property()],cr.prototype,"uiLocale",void 0),lr([e.jsonProperty(null)],cr.prototype,"availableUiLocales",void 0),lr([e.jsonProperty(null)],cr.prototype,"metadataConfiguration",void 0),lr([i.property({type:Boolean})],cr.prototype,"editorMode",void 0),lr([i.property({type:Boolean})],cr.prototype,"noCustom",void 0),lr([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],cr.prototype,"noCustomComponent",void 0),lr([i.property({type:Boolean})],cr.prototype,"withManualResources",void 0),lr([e.jsonProperty([])],cr.prototype,"messageContexts",void 0),lr([e.jsonProperty(void 0)],cr.prototype,"session",void 0),lr([i.property({type:Object})],cr.prototype,"apiProvider",void 0);class fr{async listMySearches(){var t;return(null===(t=er.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await or.await()).listMySearches(er.getState().session.profile.userId):[]}}const hr=new e.CacheRegistry;class pr{async listMyBookmarks(){return hr.get("bookmarks",(async()=>(await or.await()).listMyBookmarks(er.getState().session.profile.userId)))}clearCache(){hr.clear("bookmarks")}}const dr=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const ur=new class{constructor(){this.currentSession=er.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new pr,er.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=er.getState();e.deepEqual(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(){dr.actions.savedSearches(void 0)}clearMyBookmarks(){dr.actions.bookmarks(void 0)}async reloadMySearches(){const t=new fr,e=await t.listMySearches();dr.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;dr.actions.bookmarks(e)}}};e.customElement("ft-app-context")(cr);var yr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const gr=Symbol("i18nProperties"),br=Symbol("i18nUnsubs");function mr(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?sr:ar}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e;null===(e=this[gr])||void 0===e||e.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var e;super.update(t),null===(e=this[gr])||void 0===e||e.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[gr]&&new Set([...this[gr].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[br].has(t)||this[br].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages(t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[br].forEach((t=>t())),this[br].clear()}}return e=br,yr([i.property({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class vr extends(mr(e.FtLitElement)){}class xr extends(mr(e.FtLitElementRedux)){}var Or=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class wr extends xr{constructor(){super(),this.editorMode=!1,this.addStore(er)}render(){return this.key&&this.context?o.html`
|
|
1487
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(er.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&er.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&er.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&er.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&er.actions.noCustom(this.noCustom),t.has("editorMode")&&er.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&er.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&er.actions.session(this.session),t.has("availableUiLocales")&&er.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>ar.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()))}}cr.elementDefinitions={},cr.styles=tr,lr([i.property()],cr.prototype,"baseUrl",void 0),lr([i.property()],cr.prototype,"apiIntegrationIdentifier",void 0),lr([i.property()],cr.prototype,"uiLocale",void 0),lr([e.jsonProperty(null)],cr.prototype,"availableUiLocales",void 0),lr([e.jsonProperty(null)],cr.prototype,"metadataConfiguration",void 0),lr([i.property({type:Boolean})],cr.prototype,"editorMode",void 0),lr([i.property({type:Boolean})],cr.prototype,"noCustom",void 0),lr([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],cr.prototype,"noCustomComponent",void 0),lr([i.property({type:Boolean})],cr.prototype,"withManualResources",void 0),lr([e.jsonProperty([])],cr.prototype,"messageContexts",void 0),lr([e.jsonProperty(void 0)],cr.prototype,"session",void 0),lr([i.property({type:Object})],cr.prototype,"apiProvider",void 0);class fr{async listMySearches(){var t;return(null===(t=er.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await or.await()).listMySearches(er.getState().session.profile.userId):[]}}const hr=new e.CacheRegistry;class pr{async listMyBookmarks(){return hr.get("bookmarks",(async()=>(await or.await()).listMyBookmarks(er.getState().session.profile.userId)))}clearCache(){hr.clear("bookmarks")}}const dr=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const ur=new class{constructor(){this.currentSession=er.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new pr,er.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=er.getState();e.deepEqual(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(){dr.actions.savedSearches(void 0)}clearMyBookmarks(){dr.actions.bookmarks(void 0)}async reloadMySearches(){const t=new fr,e=await t.listMySearches();dr.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;dr.actions.bookmarks(e)}}};e.customElement("ft-app-context")(cr);var yr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const gr=Symbol("i18nProperties"),br=Symbol("i18nUnsubs");function mr(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?sr:ar}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e;null===(e=this[gr])||void 0===e||e.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var e;super.update(t),null===(e=this[gr])||void 0===e||e.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[gr]&&new Set([...this[gr].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[br].has(t)||this[br].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages(t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[br].forEach((t=>t())),this[br].clear()}}return e=br,yr([i.property({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class vr extends(mr(e.FtLitElement)){}class xr extends(mr(e.FtLitElementRedux)){}var Or=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class wr extends xr{constructor(){super(),this.editorMode=!1,this.addStore(er)}render(){return this.key&&this.context?o.html`
|
|
1488
1488
|
<span class="ft-i18n">
|
|
1489
1489
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1490
1490
|
</span>
|
|
@@ -1637,7 +1637,7 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1637
1637
|
`,Ol=Ut`
|
|
1638
1638
|
`,wl=Yr.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 Sl{static build(t){const{baseUrl:e,apiIntegrationIdentifier:o}=wl.getState(),i=null!=t?t:o;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static get(t){var e;return null!=t?Sl.build(t):null!==(e=Sl.API)&&void 0!==e?e:Sl.API=Sl.build()}static await(t){return new Promise((e=>{let o=Sl.get(t);if(o)e(o);else{const i=wl.subscribe((()=>{o=Sl.get(t),o&&(i(),e(o))}))}}))}}var Nl;const Cl=Symbol("clearAfterUnitTest");class $l{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new r,this.listeners={},this.currentUiLocale="",this[Nl]=()=>{this.defaultMessages={},this.cache=new r,this.listeners={}},this.currentUiLocale=wl.getState().uiLocale,wl.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=wl.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 o;if(t=t.toLowerCase(),Object.keys(e).length>0){const i={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};P(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var i,r,n;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(r=null===(i=this.cache.getNow(t))||void 0===i?void 0:i.messages)&&void 0!==r?r:{};return new Jo(null!==(n=this.defaultMessages[t])&&void 0!==n?n:{},s).resolve(e,...o)}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 o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.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=>j(0).then((()=>t())).catch((()=>null)))))}}Nl=Cl,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new $l((async(t,e)=>(await Sl.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new $l((async(t,e)=>(await Sl.await()).getCustomMessageContext(t,e))));const El=window.FluidTopicsI18nService,kl=window.FluidTopicsCustomI18nService;var Rl=function(t,e,o,i){for(var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,o,s):r(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s};class Il extends Vo{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=()=>Sl.get(),this.cache=new r,this.cleanSessionDebouncer=new n}render(){return pe`
|
|
1639
1639
|
<slot></slot>
|
|
1640
|
-
`}update(t){super.update(t),t.has("baseUrl")&&wl.actions.baseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&wl.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&wl.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&wl.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&wl.actions.noCustom(this.noCustom),t.has("editorMode")&&wl.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&wl.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&wl.actions.session(this.session),t.has("availableUiLocales")&&wl.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>El.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()))}}Il.elementDefinitions={},Il.styles=Ol,Rl([R()],Il.prototype,"baseUrl",void 0),Rl([R()],Il.prototype,"apiIntegrationIdentifier",void 0),Rl([R()],Il.prototype,"uiLocale",void 0),Rl([B(null)],Il.prototype,"availableUiLocales",void 0),Rl([B(null)],Il.prototype,"metadataConfiguration",void 0),Rl([R({type:Boolean})],Il.prototype,"editorMode",void 0),Rl([R({type:Boolean})],Il.prototype,"noCustom",void 0),Rl([R({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Il.prototype,"noCustomComponent",void 0),Rl([R({type:Boolean})],Il.prototype,"withManualResources",void 0),Rl([B([])],Il.prototype,"messageContexts",void 0),Rl([B(void 0)],Il.prototype,"session",void 0),Rl([R({type:Object})],Il.prototype,"apiProvider",void 0);class Ul{async listMySearches(){var t;return(null===(t=wl.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Sl.await()).listMySearches(wl.getState().session.profile.userId):[]}}const Ll=new r;class Al{async listMyBookmarks(){return Ll.get("bookmarks",(async()=>(await Sl.await()).listMyBookmarks(wl.getState().session.profile.userId)))}clearCache(){Ll.clear("bookmarks")}}const Wl=Yr.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const jl=new class{constructor(){this.currentSession=wl.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Al,wl.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=wl.getState();P(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){Wl.actions.savedSearches(void 0)}clearMyBookmarks(){Wl.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Ul,e=await t.listMySearches();Wl.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Wl.actions.bookmarks(e)}}};z("ft-app-context")(Il);var Fl=function(t,e,o,i){for(var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,o,s):r(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s};const Dl=Symbol("i18nProperties"),Pl=Symbol("i18nUnsubs");function zl(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?kl:El}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e;null===(e=this[Dl])||void 0===e||e.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var e;super.update(t),null===(e=this[Dl])||void 0===e||e.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Dl]&&new Set([...this[Dl].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Pl].has(t)||this[Pl].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages(t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[Pl].forEach((t=>t())),this[Pl].clear()}}return e=Pl,Fl([R({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class Bl extends(zl(Vo)){}class Ml extends(zl(li)){}var Tl=function(t,e,o,i){for(var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,o,s):r(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s};class Kl extends Ml{constructor(){super(),this.editorMode=!1,this.addStore(wl)}render(){return this.key&&this.context?pe`
|
|
1640
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(wl.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&wl.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&wl.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&wl.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&wl.actions.noCustom(this.noCustom),t.has("editorMode")&&wl.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&wl.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&wl.actions.session(this.session),t.has("availableUiLocales")&&wl.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>El.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()))}}Il.elementDefinitions={},Il.styles=Ol,Rl([R()],Il.prototype,"baseUrl",void 0),Rl([R()],Il.prototype,"apiIntegrationIdentifier",void 0),Rl([R()],Il.prototype,"uiLocale",void 0),Rl([B(null)],Il.prototype,"availableUiLocales",void 0),Rl([B(null)],Il.prototype,"metadataConfiguration",void 0),Rl([R({type:Boolean})],Il.prototype,"editorMode",void 0),Rl([R({type:Boolean})],Il.prototype,"noCustom",void 0),Rl([R({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Il.prototype,"noCustomComponent",void 0),Rl([R({type:Boolean})],Il.prototype,"withManualResources",void 0),Rl([B([])],Il.prototype,"messageContexts",void 0),Rl([B(void 0)],Il.prototype,"session",void 0),Rl([R({type:Object})],Il.prototype,"apiProvider",void 0);class Ul{async listMySearches(){var t;return(null===(t=wl.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Sl.await()).listMySearches(wl.getState().session.profile.userId):[]}}const Ll=new r;class Al{async listMyBookmarks(){return Ll.get("bookmarks",(async()=>(await Sl.await()).listMyBookmarks(wl.getState().session.profile.userId)))}clearCache(){Ll.clear("bookmarks")}}const Wl=Yr.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const jl=new class{constructor(){this.currentSession=wl.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Al,wl.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=wl.getState();P(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){Wl.actions.savedSearches(void 0)}clearMyBookmarks(){Wl.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Ul,e=await t.listMySearches();Wl.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Wl.actions.bookmarks(e)}}};z("ft-app-context")(Il);var Fl=function(t,e,o,i){for(var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,o,s):r(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s};const Dl=Symbol("i18nProperties"),Pl=Symbol("i18nUnsubs");function zl(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?kl:El}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e;null===(e=this[Dl])||void 0===e||e.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var e;super.update(t),null===(e=this[Dl])||void 0===e||e.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Dl]&&new Set([...this[Dl].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Pl].has(t)||this[Pl].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages(t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[Pl].forEach((t=>t())),this[Pl].clear()}}return e=Pl,Fl([R({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class Bl extends(zl(Vo)){}class Ml extends(zl(li)){}var Tl=function(t,e,o,i){for(var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,o,s):r(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s};class Kl extends Ml{constructor(){super(),this.editorMode=!1,this.addStore(wl)}render(){return this.key&&this.context?pe`
|
|
1641
1641
|
<span class="ft-i18n">
|
|
1642
1642
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1643
1643
|
</span>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-type",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.26",
|
|
4
4
|
"description": "Search",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,8 +19,8 @@
|
|
|
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.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "1.1.26",
|
|
23
23
|
"lit": "3.1.0"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "6734976f5a7f6b986917a085be0c38ca3ae562a0"
|
|
26
26
|
}
|