@fluid-topics/ft-reader-feedback 0.3.64 → 0.3.65

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.
@@ -35,8 +35,8 @@ export declare class FtReaderFeedback extends FtLitElementWithI18n implements Ft
35
35
  get canAccessFeedback(): boolean | undefined;
36
36
  get canAccessRating(): boolean | undefined;
37
37
  get userHasRatingRole(): boolean | undefined;
38
- get configuredRatingType(): import("@fluid-topics/public-api").FtRatingType | "NO_RATING";
39
- get ratingType(): import("@fluid-topics/public-api").FtRatingType | "NO_RATING";
38
+ get configuredRatingType(): import("@fluid-topics/public-api").FtRatingType | "STARS" | "LIKE" | "DICHOTOMOUS" | "NO_RATING";
39
+ get ratingType(): import("@fluid-topics/public-api").FtRatingType | "STARS" | "LIKE" | "DICHOTOMOUS" | "NO_RATING";
40
40
  get ratingValue(): number;
41
41
  get ratingDate(): Date | undefined;
42
42
  protected render(): typeof nothing | import("lit-html").TemplateResult<1>;
@@ -1059,8 +1059,8 @@ const li=Symbol.for(""),hi=t=>{if((null==t?void 0:t.r)===li)return null==t?void
1059
1059
  ${t}
1060
1060
  </ft-tooltip>
1061
1061
  `:t}resolveIcon(){return this.loading?e.html`
1062
- <ft-loader></ft-loader> `:this.icon?e.html`
1063
- <ft-icon variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:e.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}ee.elementDefinitions={"ft-ripple":Ri,"ft-tooltip":Ti,"ft-typography":xi,"ft-icon":mi,"ft-loader":te},ee.styles=[i.safariEllipsisFix,kt],ie([o.property({type:String,reflect:!0})],ee.prototype,"role",void 0),ie([o.property({type:Boolean})],ee.prototype,"primary",void 0),ie([o.property({type:Boolean})],ee.prototype,"outlined",void 0),ie([o.property({type:Boolean})],ee.prototype,"disabled",void 0),ie([o.property({type:Boolean})],ee.prototype,"dense",void 0),ie([o.property({type:Boolean})],ee.prototype,"round",void 0),ie([o.property({type:String})],ee.prototype,"label",void 0),ie([o.property({type:String})],ee.prototype,"icon",void 0),ie([o.property({type:String})],ee.prototype,"iconVariant",void 0),ie([o.property({type:Boolean})],ee.prototype,"trailingIcon",void 0),ie([o.property({type:Boolean})],ee.prototype,"loading",void 0),ie([o.property({type:String})],ee.prototype,"tooltipPosition",void 0),ie([o.property({type:Boolean})],ee.prototype,"hideTooltip",void 0),ie([o.property({type:Boolean})],ee.prototype,"forceTooltip",void 0),ie([o.query(".ft-button")],ee.prototype,"button",void 0),ie([o.query(".ft-button--label slot")],ee.prototype,"slottedContent",void 0),i.customElement("ft-button")(ee);const oe=e.css`
1062
+ <ft-loader part="loader icon"></ft-loader> `:this.icon?e.html`
1063
+ <ft-icon part="icon" variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:e.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}ee.elementDefinitions={"ft-ripple":Ri,"ft-tooltip":Ti,"ft-typography":xi,"ft-icon":mi,"ft-loader":te},ee.styles=[i.safariEllipsisFix,kt],ie([o.property({type:String,reflect:!0})],ee.prototype,"role",void 0),ie([o.property({type:Boolean})],ee.prototype,"primary",void 0),ie([o.property({type:Boolean})],ee.prototype,"outlined",void 0),ie([o.property({type:Boolean})],ee.prototype,"disabled",void 0),ie([o.property({type:Boolean})],ee.prototype,"dense",void 0),ie([o.property({type:Boolean})],ee.prototype,"round",void 0),ie([o.property({type:String})],ee.prototype,"label",void 0),ie([o.property({type:String})],ee.prototype,"icon",void 0),ie([o.property({type:String})],ee.prototype,"iconVariant",void 0),ie([o.property({type:Boolean})],ee.prototype,"trailingIcon",void 0),ie([o.property({type:Boolean})],ee.prototype,"loading",void 0),ie([o.property({type:String})],ee.prototype,"tooltipPosition",void 0),ie([o.property({type:Boolean})],ee.prototype,"hideTooltip",void 0),ie([o.property({type:Boolean})],ee.prototype,"forceTooltip",void 0),ie([o.query(".ft-button")],ee.prototype,"button",void 0),ie([o.query(".ft-button--label slot")],ee.prototype,"slottedContent",void 0),i.customElement("ft-button")(ee);const oe=e.css`
1064
1064
  `,se=e.css`
1065
1065
  `,ne=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 re{static build(t){const{baseUrl:i,apiIntegrationIdentifier:e}=ne.getState(),o=null!=t?t:e;if(i&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,o,!0)}static get(t){var i;return null!=t?re.build(t):null!==(i=re.API)&&void 0!==i?i:re.API=re.build()}static await(t){return new Promise((i=>{let e=re.get(t);if(e)i(e);else{const o=ne.subscribe((()=>{e=re.get(t),e&&(o(),i(e))}))}}))}}var ae;const le=Symbol("clearAfterUnitTest");class he{constructor(t){this.apiProvider=t,this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={},this.currentUiLocale="",this[ae]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},this.currentUiLocale=ne.getState().uiLocale,ne.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=ne.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 o;if(t=t.toLowerCase(),Object.keys(e).length>0){const s={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};i.deepEqual(this.defaultMessages[t],s)||(this.defaultMessages[t]=s,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var s,n,r;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(n=null===(s=this.cache.getNow(t))||void 0===s?void 0:s.messages)&&void 0!==n?n:{};return new i.ParametrizedLabelResolver(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},a).resolve(e,...o)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(async()=>{var i;return await(null===(i=this.apiProvider())||void 0===i?void 0:i.getFluidTopicsMessageContext(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)))))}}ae=le,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new he(re.get));const de=window.FluidTopicsI18nService;var pe=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ce 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=()=>re.get(),this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return e.html`
1066
1066
  <slot></slot>
@@ -1192,8 +1192,8 @@ const{I:An}=ut,Un=()=>document.createComment(""),zn=(t,e,i)=>{var o;const n=t._$
1192
1192
  ${t}
1193
1193
  </ft-tooltip>
1194
1194
  `:t}resolveIcon(){return this.loading?X`
1195
- <ft-loader></ft-loader> `:this.icon?X`
1196
- <ft-icon variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:Q}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Kn.elementDefinitions={"ft-ripple":fn,"ft-tooltip":cn,"ft-typography":Lo,"ft-icon":Qo,"ft-loader":Wn},Kn.styles=[_t,No],Hn([r({type:String,reflect:!0})],Kn.prototype,"role",void 0),Hn([r({type:Boolean})],Kn.prototype,"primary",void 0),Hn([r({type:Boolean})],Kn.prototype,"outlined",void 0),Hn([r({type:Boolean})],Kn.prototype,"disabled",void 0),Hn([r({type:Boolean})],Kn.prototype,"dense",void 0),Hn([r({type:Boolean})],Kn.prototype,"round",void 0),Hn([r({type:String})],Kn.prototype,"label",void 0),Hn([r({type:String})],Kn.prototype,"icon",void 0),Hn([r({type:String})],Kn.prototype,"iconVariant",void 0),Hn([r({type:Boolean})],Kn.prototype,"trailingIcon",void 0),Hn([r({type:Boolean})],Kn.prototype,"loading",void 0),Hn([r({type:String})],Kn.prototype,"tooltipPosition",void 0),Hn([r({type:Boolean})],Kn.prototype,"hideTooltip",void 0),Hn([r({type:Boolean})],Kn.prototype,"forceTooltip",void 0),Hn([l(".ft-button")],Kn.prototype,"button",void 0),Hn([l(".ft-button--label slot")],Kn.prototype,"slottedContent",void 0),f("ft-button")(Kn);const Zn=m`
1195
+ <ft-loader part="loader icon"></ft-loader> `:this.icon?X`
1196
+ <ft-icon part="icon" variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:Q}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Kn.elementDefinitions={"ft-ripple":fn,"ft-tooltip":cn,"ft-typography":Lo,"ft-icon":Qo,"ft-loader":Wn},Kn.styles=[_t,No],Hn([r({type:String,reflect:!0})],Kn.prototype,"role",void 0),Hn([r({type:Boolean})],Kn.prototype,"primary",void 0),Hn([r({type:Boolean})],Kn.prototype,"outlined",void 0),Hn([r({type:Boolean})],Kn.prototype,"disabled",void 0),Hn([r({type:Boolean})],Kn.prototype,"dense",void 0),Hn([r({type:Boolean})],Kn.prototype,"round",void 0),Hn([r({type:String})],Kn.prototype,"label",void 0),Hn([r({type:String})],Kn.prototype,"icon",void 0),Hn([r({type:String})],Kn.prototype,"iconVariant",void 0),Hn([r({type:Boolean})],Kn.prototype,"trailingIcon",void 0),Hn([r({type:Boolean})],Kn.prototype,"loading",void 0),Hn([r({type:String})],Kn.prototype,"tooltipPosition",void 0),Hn([r({type:Boolean})],Kn.prototype,"hideTooltip",void 0),Hn([r({type:Boolean})],Kn.prototype,"forceTooltip",void 0),Hn([l(".ft-button")],Kn.prototype,"button",void 0),Hn([l(".ft-button--label slot")],Kn.prototype,"slottedContent",void 0),f("ft-button")(Kn);const Zn=m`
1197
1197
  `,Vn=m`
1198
1198
  `,Gn=ci.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 Jn{static build(t){const{baseUrl:e,apiIntegrationIdentifier:i}=Gn.getState(),o=null!=t?t:i;if(e&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,o,!0)}static get(t){var e;return null!=t?Jn.build(t):null!==(e=Jn.API)&&void 0!==e?e:Jn.API=Jn.build()}static await(t){return new Promise((e=>{let i=Jn.get(t);if(i)e(i);else{const o=Gn.subscribe((()=>{i=Jn.get(t),i&&(o(),e(i))}))}}))}}var qn;const Xn=Symbol("clearAfterUnitTest");class Yn{constructor(t){this.apiProvider=t,this.defaultMessages={},this.cache=new i,this.listeners={},this.currentUiLocale="",this[qn]=()=>{this.defaultMessages={},this.cache=new i,this.listeners={}},this.currentUiLocale=Gn.getState().uiLocale,Gn.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Gn.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 i;if(t=t.toLowerCase(),Object.keys(e).length>0){const o={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...e};d(this.defaultMessages[t],o)||(this.defaultMessages[t]=o,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...i){var o,n,r;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(n=null===(o=this.cache.getNow(t))||void 0===o?void 0:o.messages)&&void 0!==n?n:{};return new Ct(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},s).resolve(e,...i)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(async()=>{var e;return await(null===(e=this.apiProvider())||void 0===e?void 0:e.getFluidTopicsMessageContext(this.currentUiLocale,t))})),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var i;return t=t.toLowerCase(),this.listeners[t]=null!==(i=this.listeners[t])&&void 0!==i?i:new Set,this.listeners[t].add(e),()=>{var i;return null===(i=this.listeners[t])||void 0===i?void 0:i.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})))}}qn=Xn,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new Yn(Jn.get));const Qn=window.FluidTopicsI18nService;var tr=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class er 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=()=>Jn.get(),this.cache=new i,this.cleanSessionDebouncer=new o}render(){return X`
1199
1199
  <slot></slot>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-feedback",
3
- "version": "0.3.64",
3
+ "version": "0.3.65",
4
4
  "description": "Feedback forms for a map and its topics in an integrated reader",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,10 +19,10 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-app-context": "0.3.64",
23
- "@fluid-topics/ft-reader-context": "0.3.64",
24
- "@fluid-topics/ft-wc-utils": "0.3.64",
22
+ "@fluid-topics/ft-app-context": "0.3.65",
23
+ "@fluid-topics/ft-reader-context": "0.3.65",
24
+ "@fluid-topics/ft-wc-utils": "0.3.65",
25
25
  "lit": "2.2.8"
26
26
  },
27
- "gitHead": "4f42c34c49255250cddf729582cc01c17b334857"
27
+ "gitHead": "e19de923a28e68d55617219545fb7398511e8a77"
28
28
  }