@fluid-topics/ft-reader-feedback 1.0.58 → 1.0.59
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.
|
@@ -54,6 +54,7 @@ export declare class FtReaderFeedback extends FtReaderFeedback_base implements F
|
|
|
54
54
|
private renderRating;
|
|
55
55
|
private rate;
|
|
56
56
|
private renderFeedbackSection;
|
|
57
|
+
private onFormSubmitEvent;
|
|
57
58
|
private validFromEmail;
|
|
58
59
|
private sendFeedback;
|
|
59
60
|
private placeholderInEditor;
|
|
@@ -74,10 +74,10 @@ class FtReaderFeedback extends withI18n(FtReaderComponent) {
|
|
|
74
74
|
return html `
|
|
75
75
|
<div class="ft-reader-feedback">
|
|
76
76
|
${this.hideTitle ? nothing : html `
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
<ft-typography variant="title" part="main-title">
|
|
78
|
+
${this.i18n(this.i18nProperties.feedbackMainTitle)}
|
|
79
|
+
</ft-typography>
|
|
80
|
+
`}
|
|
81
81
|
${this.renderRatingSection()}
|
|
82
82
|
${this.renderFeedbackSection()}
|
|
83
83
|
</div>
|
|
@@ -127,17 +127,17 @@ class FtReaderFeedback extends withI18n(FtReaderComponent) {
|
|
|
127
127
|
let active = this.ratingType === "STARS" && this.ratingValue > index;
|
|
128
128
|
const ratingValue = index + 1;
|
|
129
129
|
return html `
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
<ft-button round part="rating-stars-${ratingValue}"
|
|
131
|
+
label="${feedback.messages.starsRating(ratingValue)}"
|
|
132
|
+
tooltipPosition="top"
|
|
133
|
+
.iconVariant=${this.iconVariant}
|
|
134
|
+
icon="${active ? this.filledStarIcon : this.emptyStarIcon}"
|
|
135
|
+
class="ft-reader-feedback--${active ? "active" : "inactive"}"
|
|
136
|
+
@click=${() => this.rate(this.ratingValue === ratingValue
|
|
137
137
|
? undefined
|
|
138
138
|
: ratingValue)}
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
></ft-button>
|
|
140
|
+
`;
|
|
141
141
|
})}
|
|
142
142
|
</div>
|
|
143
143
|
`;
|
|
@@ -193,9 +193,9 @@ class FtReaderFeedback extends withI18n(FtReaderComponent) {
|
|
|
193
193
|
const mailLink = this.feedbackMailLinkBuilder(this.feedbackMessage);
|
|
194
194
|
let button = html `
|
|
195
195
|
<ft-button primary
|
|
196
|
+
type="submit" name="submit"
|
|
196
197
|
class="ft-reader-feedback--send-feedback"
|
|
197
198
|
?disabled=${!this.feedbackMessage || !this.validFromEmail()}
|
|
198
|
-
@click=${() => mailLink ? this.onMailerFeedbackSent() : this.sendFeedback()}
|
|
199
199
|
part="send-feedback">
|
|
200
200
|
${feedback.messages.okButton()}
|
|
201
201
|
</ft-button>
|
|
@@ -208,15 +208,16 @@ class FtReaderFeedback extends withI18n(FtReaderComponent) {
|
|
|
208
208
|
`;
|
|
209
209
|
}
|
|
210
210
|
return html `
|
|
211
|
-
<
|
|
211
|
+
<form class="ft-reader-feedback--feedback" part="feedback-container" autocomplete="on"
|
|
212
|
+
@submit="${(e) => this.onFormSubmitEvent(e, !!mailLink)}">
|
|
212
213
|
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
213
214
|
${this.i18n(this.i18nProperties.feedbackSectionTitle)}
|
|
214
215
|
</ft-typography>
|
|
215
216
|
${((_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.profile) === null || _b === void 0 ? void 0 : _b.userId) == null && ((_c = this.configuration) === null || _c === void 0 ? void 0 : _c.mailsSentByFluidTopicsForUnauthenticatedUsers) ? html `
|
|
216
|
-
<ft-text-field outlined
|
|
217
|
+
<ft-text-field outlined name="email" type="email" autocomplete="email"
|
|
217
218
|
class="ft-reader-feedback--from-input"
|
|
218
219
|
label=${feedback.messages.feedbackfromEmail()}
|
|
219
|
-
@
|
|
220
|
+
@change=${(e) => this.from = e.detail.trim()}
|
|
220
221
|
?error=${this.from && !this.validFromEmail()}
|
|
221
222
|
helper=${this.from && !this.validFromEmail() ? feedback.messages.feedbackfromEmailInvalid() : ""}
|
|
222
223
|
/>
|
|
@@ -227,11 +228,15 @@ class FtReaderFeedback extends withI18n(FtReaderComponent) {
|
|
|
227
228
|
@live-change=${(e) => this.feedbackMessage = e.detail.trim()}
|
|
228
229
|
></ft-text-area>
|
|
229
230
|
${button}
|
|
230
|
-
</
|
|
231
|
+
</form>
|
|
231
232
|
`;
|
|
232
233
|
}
|
|
233
234
|
return this.placeholderInEditor(designer.messages.missingFeedbackRole());
|
|
234
235
|
}
|
|
236
|
+
onFormSubmitEvent(event, isUsingMailLink) {
|
|
237
|
+
event.preventDefault();
|
|
238
|
+
isUsingMailLink ? this.onMailerFeedbackSent() : this.sendFeedback();
|
|
239
|
+
}
|
|
235
240
|
validFromEmail() {
|
|
236
241
|
var _a, _b, _c;
|
|
237
242
|
const expression = /^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/;
|
|
@@ -550,7 +550,7 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
550
550
|
</${zi(this.element)}>
|
|
551
551
|
`:Bi`
|
|
552
552
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
553
|
-
`}}Zi.styles=[nt,rt,at,lt,ht,dt,ct,ft,pt,ut,vt],Hi([o.property()],Zi.prototype,"element",void 0),Hi([o.property()],Zi.prototype,"variant",void 0),i.customElement("ft-typography")(Zi),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.LIFE_RING="",t.GLOBE="",t.PIGGY_BANK="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_SIMPLE="",t.BARS_PROGRESS="",t.LINE_CHART="",t.STACKED_CHART="",t.BOOK_OPEN_GEAR="",t.BOOK_OPEN_GEAR_SLASH="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.EYE_SLASH="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT="",t.PIP="",t.PIP_WIDE="",t.EXPAND_WIDE="",t.X_MARK=""}(Li||(Li={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(Fi||(Fi={})),new Map([...["abw"].map((t=>[t,Fi.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Fi.AUDIO])),...["avi"].map((t=>[t,Fi.AVI])),...["chm","xhs"].map((t=>[t,Fi.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Fi.CODE])),...["csv"].map((t=>[t,Fi.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Fi.DITA])),...["epub"].map((t=>[t,Fi.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Fi.EXCEL])),...["flac"].map((t=>[t,Fi.FLAC])),...["gif"].map((t=>[t,Fi.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Fi.GZIP])),...["html","htm","xhtml"].map((t=>[t,Fi.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,Fi.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Fi.JPEG])),...["json"].map((t=>[t,Fi.JSON])),...["m4a","m4p"].map((t=>[t,Fi.M4A])),...["mov","qt"].map((t=>[t,Fi.MOV])),...["mp3"].map((t=>[t,Fi.MP3])),...["mp4","m4v"].map((t=>[t,Fi.MP4])),...["ogg","oga"].map((t=>[t,Fi.OGG])),...["pdf","ps"].map((t=>[t,Fi.PDF])),...["png"].map((t=>[t,Fi.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Fi.POWERPOINT])),...["rar"].map((t=>[t,Fi.RAR])),...["stp"].map((t=>[t,Fi.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Fi.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Fi.VIDEO])),...["wav"].map((t=>[t,Fi.WAV])),...["wma"].map((t=>[t,Fi.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Fi.WORD])),...["xml","xsl","rdf"].map((t=>[t,Fi.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Fi.YAML])),...["zip"].map((t=>[t,Fi.ZIP]))]),function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(ji||(ji={}));var Vi=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 Ki extends i.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=e.nothing}render(){const t=this.variant&&Object.values(ji).includes(this.variant)?this.variant:ji.fluid_topics,i=t!==ji.material||!!this.value;return e.html`
|
|
553
|
+
`}}Zi.styles=[nt,rt,at,lt,ht,dt,ct,ft,pt,ut,vt],Hi([o.property()],Zi.prototype,"element",void 0),Hi([o.property()],Zi.prototype,"variant",void 0),i.customElement("ft-typography")(Zi),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.LIFE_RING="",t.GLOBE="",t.PIGGY_BANK="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_SIMPLE="",t.BARS_PROGRESS="",t.LINE_CHART="",t.STACKED_CHART="",t.BOOK_OPEN_GEAR="",t.BOOK_OPEN_GEAR_SLASH="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.EXTLINK_LIGHT="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.EYE_SLASH="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT="",t.PIP="",t.PIP_WIDE="",t.EXPAND_WIDE="",t.X_MARK=""}(Li||(Li={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(Fi||(Fi={})),new Map([...["abw"].map((t=>[t,Fi.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Fi.AUDIO])),...["avi"].map((t=>[t,Fi.AVI])),...["chm","xhs"].map((t=>[t,Fi.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Fi.CODE])),...["csv"].map((t=>[t,Fi.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Fi.DITA])),...["epub"].map((t=>[t,Fi.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Fi.EXCEL])),...["flac"].map((t=>[t,Fi.FLAC])),...["gif"].map((t=>[t,Fi.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Fi.GZIP])),...["html","htm","xhtml"].map((t=>[t,Fi.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,Fi.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Fi.JPEG])),...["json"].map((t=>[t,Fi.JSON])),...["m4a","m4p"].map((t=>[t,Fi.M4A])),...["mov","qt"].map((t=>[t,Fi.MOV])),...["mp3"].map((t=>[t,Fi.MP3])),...["mp4","m4v"].map((t=>[t,Fi.MP4])),...["ogg","oga"].map((t=>[t,Fi.OGG])),...["pdf","ps"].map((t=>[t,Fi.PDF])),...["png"].map((t=>[t,Fi.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Fi.POWERPOINT])),...["rar"].map((t=>[t,Fi.RAR])),...["stp"].map((t=>[t,Fi.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Fi.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Fi.VIDEO])),...["wav"].map((t=>[t,Fi.WAV])),...["wma"].map((t=>[t,Fi.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Fi.WORD])),...["xml","xsl","rdf"].map((t=>[t,Fi.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Fi.YAML])),...["zip"].map((t=>[t,Fi.ZIP]))]),function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(ji||(ji={}));var Vi=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 Ki extends i.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=e.nothing}render(){const t=this.variant&&Object.values(ji).includes(this.variant)?this.variant:ji.fluid_topics,i=t!==ji.material||!!this.value;return e.html`
|
|
554
554
|
<i class="ft-icon ft-icon--${t}" part="icon icon-${t}">
|
|
555
555
|
${s.unsafeHTML(this.resolvedIcon)}
|
|
556
556
|
<slot ?hidden=${i}></slot>
|
|
@@ -602,7 +602,7 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
602
602
|
</div>
|
|
603
603
|
</div>
|
|
604
604
|
</div>
|
|
605
|
-
`}
|
|
605
|
+
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((i=>t.has(i)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=this.tooltip.offsetWidth,e=this.tooltip.offsetHeight,o=(t.offsetHeight-e)/2,s=(t.offsetWidth-i)/2;let n=0,r=0;switch(this.tooltip.style.top="0",this.tooltip.style.left="0",this.validPosition){case"top":r=t.offsetTop-e-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"bottom":r=t.offsetTop+t.offsetHeight-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"left":r=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft-i-this.tooltip.offsetLeft;break;case"right":r=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft+t.offsetWidth-this.tooltip.offsetLeft}const a=this.tooltip.style;a.left=n+"px",a.top=r+"px";const l=this.tooltip.getBoundingClientRect();let h=-l.x,d=l.x+l.width-window.innerWidth;a.left=n+Math.round(this.correctOutOfWindowPixels(h,d))+"px";let c=-l.y,f=l.y+l.height-window.innerHeight;a.top=r+Math.round(this.correctOutOfWindowPixels(c,f))+"px",a.maxWidth=`max(${t.offsetWidth}px, ${Ji})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,i){return Math.max(t,Math.min(0,-i))}}ie.elementDefinitions={"ft-typography":Zi},ie.styles=Qi,te([o.property()],ie.prototype,"text",void 0),te([o.property({type:Boolean})],ie.prototype,"manual",void 0),te([o.property({type:Boolean})],ie.prototype,"inline",void 0),te([o.property({type:Number})],ie.prototype,"delay",void 0),te([o.property()],ie.prototype,"position",void 0),te([o.queryAssignedNodes("",!0)],ie.prototype,"slotNodes",void 0),te([o.query(".ft-tooltip--container")],ie.prototype,"container",void 0),te([o.query(".ft-tooltip")],ie.prototype,"tooltip",void 0),te([o.query(".ft-tooltip--content")],ie.prototype,"tooltipContent",void 0),te([o.state()],ie.prototype,"visible",void 0),i.customElement("ft-tooltip")(ie);var ee=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 oe extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.originX=0,this.originY=0,this.debouncer=new i.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.setupDebouncer=new i.Debouncer(10),this.moveRipple=t=>{var i,e;let{x:o,y:s}=this.getCoordinates(t),n=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-n.x:n.width/2),this.originY=Math.round(null!=s?s-n.y:n.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=this.isFocusVisible(null==t?void 0:t.target)&&!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return e.html`
|
|
606
606
|
<style>
|
|
607
607
|
.ft-ripple .ft-ripple--effect {
|
|
608
608
|
left: ${this.originX}px;
|
|
@@ -1022,7 +1022,7 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
1022
1022
|
position: absolute;
|
|
1023
1023
|
bottom: 0;
|
|
1024
1024
|
}
|
|
1025
|
-
`;var _e=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 Te extends
|
|
1025
|
+
`;var _e=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 Te extends(i.toFtFormComponent(i.FtLitElement,"textbox")){constructor(){super(...arguments),this.label="",this.value="",this.helper="",this.outlined=!1,this.disabled=!1,this.error=!1,this.height=50,this.focused=!1}render(){const t={"ft-text-area":!0,"ft-text-area--filled":!this.outlined,"ft-text-area--outlined":this.outlined,"ft-text-area--disabled":this.disabled,"ft-text-area--has-value":!!this.value,"ft-text-area--no-label":!this.label,"ft-text-area--in-error":this.error};return e.html`
|
|
1026
1026
|
<style>
|
|
1027
1027
|
.ft-text-area--main-panel {
|
|
1028
1028
|
height: calc(4 * ${ke.verticalSpacing} + ${ke.labelSize} + ${ke.fontSize} + ${this.height}px);
|
|
@@ -1064,14 +1064,14 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
1064
1064
|
${this.helper}
|
|
1065
1065
|
</ft-typography>`:void 0}
|
|
1066
1066
|
</div>
|
|
1067
|
-
`}setValue(t,i=!1){this.value=t,i&&(this.dispatchEvent(new CustomEvent("live-change",{detail:this.value})),this.dispatchEvent(new CustomEvent("change",{detail:this.value})))}contentAvailableCallback(t){super.contentAvailableCallback(t),this.requestUpdate()}onKeyDown(t){"Enter"!==t.key&&" "!==t.key||t.stopPropagation()}updateValueFromInputField(){this.dispatchEvent(new CustomEvent("change",{detail:this.value}))}liveUpdateValueFromInputField(){var t;this.value=(null===(t=this.textarea)||void 0===t?void 0:t.value)||"",this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}Te.elementDefinitions={"ft-input-label":we,"ft-resizer":xe,"ft-ripple":oe,"ft-typography":Zi},Te.styles=[ht,Se],_e([o.property({type:String})],Te.prototype,"label",void 0),_e([o.property({reflect:!0})],Te.prototype,"value",void 0),_e([o.property({type:String})],Te.prototype,"helper",void 0),_e([o.property({type:Boolean})],Te.prototype,"outlined",void 0),_e([o.property({type:Boolean})],Te.prototype,"disabled",void 0),_e([o.property({type:Boolean})],Te.prototype,"error",void 0),_e([o.property({type:Number,reflect:!0})],Te.prototype,"height",void 0),_e([o.query("textarea")],Te.prototype,"textarea",void 0),_e([o.state()],Te.prototype,"focused",void 0),i.customElement("ft-text-area")(Te);class Ee extends i.FtLitElement{render(){return e.html`
|
|
1067
|
+
`}setValue(t,i=!1){this.value=t,this.setFormValue(t),i&&(this.dispatchEvent(new CustomEvent("live-change",{detail:this.value})),this.dispatchEvent(new CustomEvent("change",{detail:this.value})))}contentAvailableCallback(t){super.contentAvailableCallback(t),this.requestUpdate()}onKeyDown(t){"Enter"!==t.key&&" "!==t.key||t.stopPropagation()}updateValueFromInputField(){this.dispatchEvent(new CustomEvent("change",{detail:this.value}))}liveUpdateValueFromInputField(){var t;this.value=(null===(t=this.textarea)||void 0===t?void 0:t.value)||"",this.setFormValue(this.value),this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}Te.elementDefinitions={"ft-input-label":we,"ft-resizer":xe,"ft-ripple":oe,"ft-typography":Zi},Te.styles=[ht,Se],_e([o.property({type:String})],Te.prototype,"label",void 0),_e([o.property({reflect:!0})],Te.prototype,"value",void 0),_e([o.property({type:String})],Te.prototype,"helper",void 0),_e([o.property({type:Boolean})],Te.prototype,"outlined",void 0),_e([o.property({type:Boolean})],Te.prototype,"disabled",void 0),_e([o.property({type:Boolean})],Te.prototype,"error",void 0),_e([o.property({type:Number,reflect:!0})],Te.prototype,"height",void 0),_e([o.query("textarea")],Te.prototype,"textarea",void 0),_e([o.state()],Te.prototype,"focused",void 0),i.customElement("ft-text-area")(Te);class Ee extends i.FtLitElement{render(){return e.html`
|
|
1068
1068
|
<div class="ft-loader">
|
|
1069
1069
|
<div></div>
|
|
1070
1070
|
<div></div>
|
|
1071
1071
|
<div></div>
|
|
1072
1072
|
<div></div>
|
|
1073
1073
|
</div>
|
|
1074
|
-
`}}Ee.styles=bt,i.customElement("ft-loader")(Ee);var Ie=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 Re extends
|
|
1074
|
+
`}}Ee.styles=bt,i.customElement("ft-loader")(Ee);var Ie=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 Re extends(i.toFtFormComponent(i.FtLitElement,"button")){constructor(){super(...arguments),this.role="button",this.type="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{var i;this.isDisabled()?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()):"submit"==this.type&&(null===(i=this.form)||void 0===i||i.requestSubmit())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0};return this.addTooltipIfNeeded(e.html`
|
|
1075
1075
|
<button part="button"
|
|
1076
1076
|
class="${n.classMap(t)}"
|
|
1077
1077
|
aria-label="${this.getLabel()}"
|
|
@@ -1087,14 +1087,14 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
1087
1087
|
${this.resolveIcon()}
|
|
1088
1088
|
</button>
|
|
1089
1089
|
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?e.html`
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1090
|
+
<ft-tooltip part="tooltip"
|
|
1091
|
+
text="${this.getLabel()}"
|
|
1092
|
+
position="${this.tooltipPosition}">
|
|
1093
|
+
${t}
|
|
1094
|
+
</ft-tooltip>
|
|
1095
1095
|
`:t}resolveIcon(){return this.loading?e.html`
|
|
1096
1096
|
<ft-loader part="loader icon"></ft-loader> `:this.icon?e.html`
|
|
1097
|
-
|
|
1097
|
+
<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}}Re.elementDefinitions={"ft-ripple":oe,"ft-tooltip":ie,"ft-typography":Zi,"ft-icon":Ki,"ft-loader":Ee},Re.styles=[i.safariEllipsisFix,It],Ie([o.property({type:String,reflect:!0})],Re.prototype,"role",void 0),Ie([o.property()],Re.prototype,"type",void 0),Ie([o.property({type:Boolean})],Re.prototype,"primary",void 0),Ie([o.property({type:Boolean})],Re.prototype,"outlined",void 0),Ie([o.property({type:Boolean})],Re.prototype,"disabled",void 0),Ie([o.property({type:Boolean})],Re.prototype,"dense",void 0),Ie([o.property({type:Boolean})],Re.prototype,"round",void 0),Ie([o.property()],Re.prototype,"label",void 0),Ie([o.property()],Re.prototype,"icon",void 0),Ie([o.property()],Re.prototype,"iconVariant",void 0),Ie([o.property({type:Boolean})],Re.prototype,"trailingIcon",void 0),Ie([o.property({type:Boolean})],Re.prototype,"loading",void 0),Ie([o.property()],Re.prototype,"tooltipPosition",void 0),Ie([o.property({type:Boolean})],Re.prototype,"hideTooltip",void 0),Ie([o.property({type:Boolean})],Re.prototype,"forceTooltip",void 0),Ie([o.query(".ft-button")],Re.prototype,"button",void 0),Ie([o.query(".ft-button--label slot")],Re.prototype,"slottedContent",void 0),i.customElement("ft-button")(Re);const Ce=e.css`
|
|
1098
1098
|
`,Ae=e.css`
|
|
1099
1099
|
`,Oe=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 Ne{static build(t){const{baseUrl:i,apiIntegrationIdentifier:e}=Oe.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?Ne.build(t):null!==(i=Ne.API)&&void 0!==i?i:Ne.API=Ne.build()}static await(t){return new Promise((i=>{let e=Ne.get(t);if(e)i(e);else{const o=Oe.subscribe((()=>{e=Ne.get(t),e&&(o(),i(e))}))}}))}}var Ue;const De=Symbol("clearAfterUnitTest");class ze{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={},this.currentUiLocale="",this[Ue]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},this.currentUiLocale=Oe.getState().uiLocale,Oe.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Oe.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,(()=>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)))))}}Ue=De,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new ze((async(t,i)=>(await Ne.await()).getFluidTopicsMessageContext(t,i)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new ze((async(t,i)=>(await Ne.await()).getCustomMessageContext(t,i))));const Me=window.FluidTopicsI18nService,Be=window.FluidTopicsCustomI18nService;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 Le 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=()=>Ne.get(),this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return e.html`
|
|
1100
1100
|
<slot></slot>
|
|
@@ -1258,7 +1258,7 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
1258
1258
|
.ft-text-field--with-password ft-icon:hover {
|
|
1259
1259
|
cursor: pointer;
|
|
1260
1260
|
}
|
|
1261
|
-
`;var lo=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 ho extends
|
|
1261
|
+
`;var lo=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 ho extends(i.toFtFormComponent(i.FtLitElement,"textbox")){constructor(){super(...arguments),this._value="",this.dispatchedValue="",this.outlined=!1,this.disabled=!1,this.error=!1,this.prefix=null,this.passwordHiddenIcon=Li.EYE_SLASH,this.passwordRevealedIcon=Li.EYE,this.filterSuggestions=!1,this.password=!1,this.focused=!1,this.hidePassword=!0,this.suggestionsOnTop=!1,this.hideSuggestions=!1,this.visibleSuggestions=[]}get value(){return this._value||""}set value(t){this.setInternalValue(t||""),this.dispatchedValue=t||""}setInternalValue(t){const i=this._value;this._value=t||"",this.setFormValue(this._value),this.requestUpdate("value",i)}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}render(){const t={"ft-text-field":!0,"ft-text-field--filled":!this.outlined,"ft-text-field--outlined":this.outlined,"ft-text-field--disabled":this.disabled,"ft-text-field--has-value":!!this.value,"ft-text-field--with-label":!!this.label,"ft-text-field--in-error":this.error,"ft-text-field--with-prefix":!!this.prefix,"ft-text-field--hide-suggestions":0===this.visibleSuggestions.length||this.hideSuggestions,"ft-text-field--raised-label":this.focused||""!=this.value,"ft-text-field--with-icon":!!this.icon,"ft-text-field--with-password":this.password};return e.html`
|
|
1262
1262
|
<div class="${n.classMap(t)}">
|
|
1263
1263
|
<div class="ft-text-field--main-panel"
|
|
1264
1264
|
@keydown=${this.handleKeyboardNavigation}
|
|
@@ -1273,10 +1273,10 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
1273
1273
|
<ft-ripple ?disabled=${this.disabled} activated></ft-ripple>
|
|
1274
1274
|
`}
|
|
1275
1275
|
${this.prefix?e.html`
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1276
|
+
<ft-typography class="ft-text-field--prefix" vaiant="body1">
|
|
1277
|
+
${this.prefix}
|
|
1278
|
+
</ft-typography>
|
|
1279
|
+
`:e.nothing}
|
|
1280
1280
|
<input type=${this.password&&this.hidePassword?"password":"text"}
|
|
1281
1281
|
maxlength=${(t=>null!=t?t:yi)(this.maxLength||void 0)}
|
|
1282
1282
|
aria-label="${this.label}"
|
|
@@ -1357,10 +1357,10 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
1357
1357
|
`}get stateManager(){return null==this._stateManager&&(this._stateManager=yo.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0"),this.readerServiceProvider),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"reader")),this._stateManager}connectedCallback(){super.connectedCallback(),this.stateManager.setMapId(this.mapId),this.stateManager.awaitService().then((t=>{const i=t.fontsStylesheet();if(i&&!window.location.href.startsWith(this.baseUrl)&&!document.querySelector(`head link[href="${i}"]`)){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",i),document.head.append(t)}}))}update(t){super.update(t),t.has("readerServiceProvider")&&this.readerServiceProvider&&this.stateManager.initService(this.readerServiceProvider),t.has("mapId")&&this.mapId&&this.stateManager.setMapId(this.mapId),["tocId","section","page","mapId"].some((i=>t.has(i)))&&this.mapId&&this.navigateToTarget()}contentAvailableCallback(t){var i;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.map&&this.toc&&this.dispatchEvent(new $o(this.map,this.toc)),t.has("scrollTarget")&&null==(null===(i=this.scrollTarget)||void 0===i?void 0:i.tocId)){const i=t.get("scrollTarget");null!=(null==i?void 0:i.tocId)&&this.scrollToTargetDebouncer.run((()=>{var t;return this.stateManager.service.getAccurateNavigationData(i.tocId,null===(t=this.currentPage)||void 0===t?void 0:t.number,i.section).then((t=>this.dispatchEvent(new ko(t))))}))}t.has("visibleTopics")&&Promise.all(this.visibleTopics.map((t=>{var i;return this.stateManager.service.getAccurateNavigationData(t,null===(i=this.currentPage)||void 0===i?void 0:i.number)}))).then((t=>{let i=t.filter((t=>null!=t&&""!==t.topicTitle)).map((t=>{var i;return{tocId:t.tocId,title:t.topicTitle,page:t.page,prettyUrl:t.prettyUrl,prettyUrlDuplicated:t.prettyUrlDuplicated,breadcrumb:null===(i=this.stateManager.service)||void 0===i?void 0:i.buildBreadcrumb(t.tocId)}}));this.dispatchEvent(new wo(this.map,i))}))}async reload(){await this.stateManager.reload(),this.navigateToTarget()}navigateToTarget(){this.navigationDebouncer.run((()=>{null!=this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):null!=this.page&&this.stateManager.navigateToPage(this.page)}))}registerComponent(t){t.stopPropagation();const i=t.composedPath()[0];this.register(i)}register(t){t.setReaderStateManager(this.stateManager)}handleLoadError(t){const i=t;404===i.status?this.dispatchEvent(new _o):401===i.status?this.dispatchEvent(new To):this.dispatchEvent(new So(t))}reloadBookmarks(){Ve.reloadBookmarks()}}var Ro;Io.styles=mo,Eo([i.redux({store:Oe.name})],Io.prototype,"baseUrl",void 0),Eo([o.property()],Io.prototype,"mapId",void 0),Eo([o.property()],Io.prototype,"tocId",void 0),Eo([o.property()],Io.prototype,"section",void 0),Eo([o.property({type:Number,converter:{fromAttribute:t=>+(null!=t?t:"NaN")>0?+t:Ro}})],Io.prototype,"page",void 0),Eo([i.redux({store:"reader"})],Io.prototype,"map",void 0),Eo([i.redux({store:"reader"})],Io.prototype,"toc",void 0),Eo([i.redux({store:"reader"})],Io.prototype,"visibleTopics",void 0),Eo([i.redux({store:"reader"})],Io.prototype,"currentPage",void 0),Eo([i.redux({store:"reader"})],Io.prototype,"scrollTarget",void 0),Eo([o.property({attribute:!1})],Io.prototype,"readerServiceProvider",void 0),i.customElement("ft-reader-context")(Io);var Co=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 Ao extends(qe(c)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.ratingAllowed=!1,this.from="",this.feedbackMessage="",this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.addI18nContext(eo,oo),this.addI18nContext(so,no)}get canAccessFeedback(){var t;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(a.FEEDBACK,{session:this.session})}get canAccessRating(){var t,i;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(a.RATING,{session:this.session,ratingType:null===(i=this.ratingSummary)||void 0===i?void 0:i.type})}get userHasRatingRole(){return this.session&&Xt(this.session,"RATING_USER")}get configuredRatingType(){var t,i;return null!==(i=this.ratingAllowed?null===(t=this.ratingSummary)||void 0===t?void 0:t.type:"NO_RATING")&&void 0!==i?i:"NO_RATING"}get ratingType(){var t,i,e;return null!==(e=null===(i=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===i?void 0:i.type)&&void 0!==e?e:"NO_RATING"}get ratingValue(){var t,i,e;return null!==(e=null===(i=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===i?void 0:i.value)&&void 0!==e?e:-1}get ratingDate(){var t,e;const o=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.date;return"string"==typeof o?i.parseDate(o):o}render(){return this.editorMode||this.canAccessFeedback||this.canAccessRating?e.html`
|
|
1358
1358
|
<div class="ft-reader-feedback">
|
|
1359
1359
|
${this.hideTitle?e.nothing:e.html`
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1360
|
+
<ft-typography variant="title" part="main-title">
|
|
1361
|
+
${this.i18n(this.i18nProperties.feedbackMainTitle)}
|
|
1362
|
+
</ft-typography>
|
|
1363
|
+
`}
|
|
1364
1364
|
${this.renderRatingSection()}
|
|
1365
1365
|
${this.renderFeedbackSection()}
|
|
1366
1366
|
</div>
|
|
@@ -1377,15 +1377,15 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
1377
1377
|
`:this.placeholderInEditor(this.userHasRatingRole?so.messages.ratingNotConfigured():so.messages.missingRatingRole())}renderRatingDate(){const t=this.ratingDate;if(null==t)return eo.messages.notRated();if(t.getTime()>(new Date).getTime()-6e4)return eo.messages.ratedNow();return(new Date).toLocaleDateString()===t.toLocaleDateString()?eo.messages.ratedToday():eo.messages.ratedOn(t)}renderRating(){switch(this.configuredRatingType){case"STARS":return e.html`
|
|
1378
1378
|
<div class="ft-reader-feedback--stars" part="rating rating-stars">
|
|
1379
1379
|
${r.repeat(new Array(5),((t,i)=>i),((t,i)=>{let o="STARS"===this.ratingType&&this.ratingValue>i;const s=i+1;return e.html`
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1380
|
+
<ft-button round part="rating-stars-${s}"
|
|
1381
|
+
label="${eo.messages.starsRating(s)}"
|
|
1382
|
+
tooltipPosition="top"
|
|
1383
|
+
.iconVariant=${this.iconVariant}
|
|
1384
|
+
icon="${o?this.filledStarIcon:this.emptyStarIcon}"
|
|
1385
|
+
class="ft-reader-feedback--${o?"active":"inactive"}"
|
|
1386
|
+
@click=${()=>this.rate(this.ratingValue===s?void 0:s)}
|
|
1387
|
+
></ft-button>
|
|
1388
|
+
`}))}
|
|
1389
1389
|
</div>
|
|
1390
1390
|
`;case"LIKE":const t="LIKE"===this.ratingType&&0===this.ratingValue,i="LIKE"===this.ratingType&&1===this.ratingValue;return e.html`
|
|
1391
1391
|
<ft-switch unselectable
|
|
@@ -1419,9 +1419,9 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
1419
1419
|
</ft-switch>
|
|
1420
1420
|
`}return e.nothing}rate(t){(null!=t?t:-1)!==this.ratingValue&&this.dispatchEvent(new CustomEvent("rate",{detail:t}))}renderFeedbackSection(){var t,i,o;if(this.canAccessFeedback){const s=this.feedbackMailLinkBuilder(this.feedbackMessage);let n=e.html`
|
|
1421
1421
|
<ft-button primary
|
|
1422
|
+
type="submit" name="submit"
|
|
1422
1423
|
class="ft-reader-feedback--send-feedback"
|
|
1423
1424
|
?disabled=${!this.feedbackMessage||!this.validFromEmail()}
|
|
1424
|
-
@click=${()=>s?this.onMailerFeedbackSent():this.sendFeedback()}
|
|
1425
1425
|
part="send-feedback">
|
|
1426
1426
|
${eo.messages.okButton()}
|
|
1427
1427
|
</ft-button>
|
|
@@ -1430,15 +1430,16 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
1430
1430
|
${n}
|
|
1431
1431
|
</a>
|
|
1432
1432
|
`),e.html`
|
|
1433
|
-
<
|
|
1433
|
+
<form class="ft-reader-feedback--feedback" part="feedback-container" autocomplete="on"
|
|
1434
|
+
@submit="${t=>this.onFormSubmitEvent(t,!!s)}">
|
|
1434
1435
|
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
1435
1436
|
${this.i18n(this.i18nProperties.feedbackSectionTitle)}
|
|
1436
1437
|
</ft-typography>
|
|
1437
1438
|
${null==(null===(i=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===i?void 0:i.userId)&&(null===(o=this.configuration)||void 0===o?void 0:o.mailsSentByFluidTopicsForUnauthenticatedUsers)?e.html`
|
|
1438
|
-
<ft-text-field outlined
|
|
1439
|
+
<ft-text-field outlined name="email" type="email" autocomplete="email"
|
|
1439
1440
|
class="ft-reader-feedback--from-input"
|
|
1440
1441
|
label=${eo.messages.feedbackfromEmail()}
|
|
1441
|
-
@
|
|
1442
|
+
@change=${t=>this.from=t.detail.trim()}
|
|
1442
1443
|
?error=${this.from&&!this.validFromEmail()}
|
|
1443
1444
|
helper=${this.from&&!this.validFromEmail()?eo.messages.feedbackfromEmailInvalid():""}
|
|
1444
1445
|
/>
|
|
@@ -1449,8 +1450,8 @@ const Ui=Symbol.for(""),Di=t=>{if((null==t?void 0:t.r)===Ui)return null==t?void
|
|
|
1449
1450
|
@live-change=${t=>this.feedbackMessage=t.detail.trim()}
|
|
1450
1451
|
></ft-text-area>
|
|
1451
1452
|
${n}
|
|
1452
|
-
</
|
|
1453
|
-
`}return this.placeholderInEditor(so.messages.missingFeedbackRole())}validFromEmail(){var t,i,e;return!(null==(null===(i=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===i?void 0:i.userId)&&(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopicsForUnauthenticatedUsers))||/^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(this.from)}sendFeedback(){var t;this.dispatchEvent(new CustomEvent("send-feedback",{detail:{message:this.feedbackInput.value,...(null===(t=this.configuration)||void 0===t?void 0:t.mailsSentByFluidTopicsForUnauthenticatedUsers)&&{from:this.from}}}))}placeholderInEditor(t){return this.editorMode?e.html`
|
|
1453
|
+
</form>
|
|
1454
|
+
`}return this.placeholderInEditor(so.messages.missingFeedbackRole())}onFormSubmitEvent(t,i){t.preventDefault(),i?this.onMailerFeedbackSent():this.sendFeedback()}validFromEmail(){var t,i,e;return!(null==(null===(i=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===i?void 0:i.userId)&&(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopicsForUnauthenticatedUsers))||/^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(this.from)}sendFeedback(){var t;this.dispatchEvent(new CustomEvent("send-feedback",{detail:{message:this.feedbackInput.value,...(null===(t=this.configuration)||void 0===t?void 0:t.mailsSentByFluidTopicsForUnauthenticatedUsers)&&{from:this.from}}}))}placeholderInEditor(t){return this.editorMode?e.html`
|
|
1454
1455
|
<div class="ft-reader-feedback--placeholder">
|
|
1455
1456
|
<ft-typography variant="caption">${t}</ft-typography>
|
|
1456
1457
|
<ft-tooltip position="left"
|