@fluid-topics/ft-reader-content 0.3.9 → 0.3.11
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.
|
@@ -12,6 +12,8 @@ export declare class FtReaderContent extends FtReaderComponent implements FtRead
|
|
|
12
12
|
private currentPage?;
|
|
13
13
|
private scrollTarget?;
|
|
14
14
|
private visibleTopics?;
|
|
15
|
+
private renderBeforeFirst;
|
|
16
|
+
private renderAfterLast;
|
|
15
17
|
private container;
|
|
16
18
|
protected render(): TemplateResult<1>;
|
|
17
19
|
private getScrollTarget;
|
|
@@ -17,6 +17,8 @@ export class FtReaderContent extends FtReaderComponent {
|
|
|
17
17
|
this.renderTopic = (tocId) => html `
|
|
18
18
|
<ft-reader-topic tocId="${tocId}" .exportpartsPrefix=${"topic"}></ft-reader-topic>
|
|
19
19
|
`;
|
|
20
|
+
this.renderBeforeFirst = 5;
|
|
21
|
+
this.renderAfterLast = 10;
|
|
20
22
|
this.visibleTopicsDebouncer = new Debouncer(100);
|
|
21
23
|
}
|
|
22
24
|
render() {
|
|
@@ -26,6 +28,8 @@ export class FtReaderContent extends FtReaderComponent {
|
|
|
26
28
|
.items=${((_a = this.currentPage) === null || _a === void 0 ? void 0 : _a.topics) || []}
|
|
27
29
|
.renderItem=${this.renderTopic}
|
|
28
30
|
.scrollToItem=${this.getScrollTarget()}
|
|
31
|
+
.renderBeforeFirst=${this.renderBeforeFirst}
|
|
32
|
+
.renderAfterLast=${this.renderAfterLast}
|
|
29
33
|
exportpartsPrefix="scroller"
|
|
30
34
|
@visible-items-change=${this.visibleTopicChange}
|
|
31
35
|
@scrolled-to-target=${this.onScrollDone}
|
|
@@ -71,6 +75,12 @@ __decorate([
|
|
|
71
75
|
__decorate([
|
|
72
76
|
redux()
|
|
73
77
|
], FtReaderContent.prototype, "visibleTopics", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
redux()
|
|
80
|
+
], FtReaderContent.prototype, "renderBeforeFirst", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
redux()
|
|
83
|
+
], FtReaderContent.prototype, "renderAfterLast", void 0);
|
|
74
84
|
__decorate([
|
|
75
85
|
query(".ft-reader-content")
|
|
76
86
|
], FtReaderContent.prototype, "container", void 0);
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
!function(t,e,i,o,s,n,r){var l,a,h=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class f extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class p extends e.FtLitElementRedux{setReaderStateManager(t){this.stateManager=t,this.store=t.store}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),setTimeout((()=>this.dispatchEvent(new f)),10)}disconnectedCallback(){super.disconnectedCallback(),this.store=void 0,this.stateManager=void 0}}h([o.state()],p.prototype,"stateManager",void 0),function(t){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.STAR_PLAIN="",t.STAR="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_DOWN="",t.THUMBS_UP_PLAIN="",t.THUMBS_UP="",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="\f06e",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=""}(l||(l={})),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=""}(a||(a={})),new Map([...["abw"].map((t=>[t,a.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,a.AUDIO])),...["avi"].map((t=>[t,a.AVI])),...["chm","xhs"].map((t=>[t,a.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,a.CODE])),...["csv"].map((t=>[t,a.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,a.DITA])),...["epub"].map((t=>[t,a.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,a.EXCEL])),...["flac"].map((t=>[t,a.FLAC])),...["gif"].map((t=>[t,a.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,a.GZIP])),...["html","htm","xhtml"].map((t=>[t,a.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,a.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,a.JPEG])),...["json"].map((t=>[t,a.JSON])),...["m4a","m4p"].map((t=>[t,a.M4A])),...["mov","qt"].map((t=>[t,a.MOV])),...["mp3"].map((t=>[t,a.MP3])),...["mp4","m4v"].map((t=>[t,a.MP4])),...["ogg","oga"].map((t=>[t,a.OGG])),...["pdf","ps"].map((t=>[t,a.PDF])),...["png"].map((t=>[t,a.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,a.POWERPOINT])),...["rar"].map((t=>[t,a.RAR])),...["stp"].map((t=>[t,a.STP])),...["txt","rtf","md","mdown"].map((t=>[t,a.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,a.VIDEO])),...["wav"].map((t=>[t,a.WAV])),...["wma"].map((t=>[t,a.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,a.WORD])),...["xml","xsl","rdf"].map((t=>[t,a.XML])),...["yaml","yml","x-yaml"].map((t=>[t,a.YAML])),...["zip"].map((t=>[t,a.ZIP]))]);var c,d=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(c||(c={}));const
|
|
2
|
-
:host {
|
|
3
|
-
display: inline-block;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
:host, i.ft-icon {
|
|
7
|
-
width: ${g.size};
|
|
8
|
-
height: ${g.size};
|
|
9
|
-
text-align: center;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
i.ft-icon {
|
|
13
|
-
font-size: ${g.size};
|
|
14
|
-
line-height: 1;
|
|
15
|
-
font-weight: normal;
|
|
16
|
-
text-transform: none;
|
|
17
|
-
font-style: normal;
|
|
18
|
-
font-variant: normal;
|
|
19
|
-
speak: none;
|
|
20
|
-
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
21
|
-
text-rendering: auto;
|
|
22
|
-
-webkit-font-smoothing: antialiased;
|
|
23
|
-
-moz-osx-font-smoothing: grayscale;
|
|
24
|
-
vertical-align: ${g.verticalAlign};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.ft-icon--fluid-topics {
|
|
28
|
-
font-family: ${g.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.ft-icon--file-format {
|
|
32
|
-
font-family: ${g.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.ft-icon--material {
|
|
36
|
-
font-family: ${g.materialFontFamily}, "Material Icons", sans-serif;
|
|
37
|
-
}
|
|
38
|
-
`}getTemplate(){return i.html`
|
|
1
|
+
!function(t,e,i,o,s,n,r){var l,a,h=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class f extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class p extends e.FtLitElementRedux{setReaderStateManager(t){this.stateManager=t,this.store=t.store}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),setTimeout((()=>this.dispatchEvent(new f)),10)}disconnectedCallback(){super.disconnectedCallback(),this.store=void 0,this.stateManager=void 0}}h([o.state()],p.prototype,"stateManager",void 0),function(t){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.STAR_PLAIN="",t.STAR="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_DOWN="",t.THUMBS_UP_PLAIN="",t.THUMBS_UP="",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="\f06e",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=""}(l||(l={})),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=""}(a||(a={})),new Map([...["abw"].map((t=>[t,a.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,a.AUDIO])),...["avi"].map((t=>[t,a.AVI])),...["chm","xhs"].map((t=>[t,a.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,a.CODE])),...["csv"].map((t=>[t,a.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,a.DITA])),...["epub"].map((t=>[t,a.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,a.EXCEL])),...["flac"].map((t=>[t,a.FLAC])),...["gif"].map((t=>[t,a.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,a.GZIP])),...["html","htm","xhtml"].map((t=>[t,a.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,a.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,a.JPEG])),...["json"].map((t=>[t,a.JSON])),...["m4a","m4p"].map((t=>[t,a.M4A])),...["mov","qt"].map((t=>[t,a.MOV])),...["mp3"].map((t=>[t,a.MP3])),...["mp4","m4v"].map((t=>[t,a.MP4])),...["ogg","oga"].map((t=>[t,a.OGG])),...["pdf","ps"].map((t=>[t,a.PDF])),...["png"].map((t=>[t,a.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,a.POWERPOINT])),...["rar"].map((t=>[t,a.RAR])),...["stp"].map((t=>[t,a.STP])),...["txt","rtf","md","mdown"].map((t=>[t,a.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,a.VIDEO])),...["wav"].map((t=>[t,a.WAV])),...["wma"].map((t=>[t,a.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,a.WORD])),...["xml","xsl","rdf"].map((t=>[t,a.XML])),...["yaml","yml","x-yaml"].map((t=>[t,a.YAML])),...["zip"].map((t=>[t,a.ZIP]))]);var c,d=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(c||(c={}));const x={size:e.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:e.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:e.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:e.FtCssVariableFactory.extend("--ft-icon-material-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:e.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")};class g extends e.FtLitElement{constructor(){super(...arguments),this.variant=c.fluid_topics,this.resolvedIcon=i.nothing}render(){return i.html`
|
|
39
2
|
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
40
|
-
${s.unsafeHTML(this.
|
|
41
|
-
<slot
|
|
3
|
+
${s.unsafeHTML(this.resolvedIcon)}
|
|
4
|
+
<slot ?hidden=${"material"!==this.variant}></slot>
|
|
42
5
|
</i>
|
|
43
|
-
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}
|
|
6
|
+
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let o=this.value||this.textContent;switch(this.variant){case c.file_format:this.resolvedIcon=null!==(t=a[o.toUpperCase()])&&void 0!==t?t:o;break;case c.fluid_topics:this.resolvedIcon=null!==(e=l[o.toUpperCase()])&&void 0!==e?e:o;break;default:this.resolvedIcon=i.nothing}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>{this.resolveIcon()}))}}
|
|
44
7
|
/**
|
|
45
8
|
* @license
|
|
46
9
|
* Copyright 2017 Google LLC
|
|
47
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
11
|
*/
|
|
49
|
-
var
|
|
12
|
+
var v;g.elementDefinitions={},g.styles=i.css`
|
|
13
|
+
:host {
|
|
14
|
+
display: inline-block;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host, i.ft-icon {
|
|
18
|
+
width: ${x.size};
|
|
19
|
+
height: ${x.size};
|
|
20
|
+
text-align: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
i.ft-icon {
|
|
24
|
+
font-size: ${x.size};
|
|
25
|
+
line-height: 1;
|
|
26
|
+
font-weight: normal;
|
|
27
|
+
text-transform: none;
|
|
28
|
+
font-style: normal;
|
|
29
|
+
font-variant: normal;
|
|
30
|
+
speak: none;
|
|
31
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
32
|
+
text-rendering: auto;
|
|
33
|
+
-webkit-font-smoothing: antialiased;
|
|
34
|
+
-moz-osx-font-smoothing: grayscale;
|
|
35
|
+
vertical-align: ${x.verticalAlign};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ft-icon--fluid-topics {
|
|
39
|
+
font-family: ${x.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ft-icon--file-format {
|
|
43
|
+
font-family: ${x.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ft-icon--material {
|
|
47
|
+
font-family: ${x.materialFontFamily}, "Material Icons", sans-serif;
|
|
48
|
+
}
|
|
49
|
+
`,d([o.property()],g.prototype,"variant",void 0),d([o.property()],g.prototype,"value",void 0),d([o.state()],g.prototype,"resolvedIcon",void 0),d([o.query("slot")],g.prototype,"slottedContent",void 0),e.customElement("ft-icon")(g);const y=globalThis.trustedTypes,u=y?y.createPolicy("lit-html",{createHTML:t=>t}):void 0,m=`lit$${(Math.random()+"").slice(9)}$`,b="?"+m,$=`<${b}>`,w=document,k=(t="")=>w.createComment(t),z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,I=Array.isArray,N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,T=/>/g,S=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),j=/'/g,A=/"/g,C=/^(?:script|style|textarea|title)$/i,E=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),_=Symbol.for("lit-noChange"),M=Symbol.for("lit-nothing"),U=new WeakMap,F=w.createTreeWalker(w,129,null,!1),W=(t,e)=>{const i=t.length-1,o=[];let s,n=2===e?"<svg>":"",r=N;for(let e=0;e<i;e++){const i=t[e];let l,a,h=-1,f=0;for(;f<i.length&&(r.lastIndex=f,a=r.exec(i),null!==a);)f=r.lastIndex,r===N?"!--"===a[1]?r=O:void 0!==a[1]?r=T:void 0!==a[2]?(C.test(a[2])&&(s=RegExp("</"+a[2],"g")),r=S):void 0!==a[3]&&(r=S):r===S?">"===a[0]?(r=null!=s?s:N,h=-1):void 0===a[1]?h=-2:(h=r.lastIndex-a[2].length,l=a[1],r=void 0===a[3]?S:'"'===a[3]?A:j):r===A||r===j?r=S:r===O||r===T?r=N:(r=S,s=void 0);const p=r===S&&t[e+1].startsWith("/>")?" ":"";n+=r===N?i+$:h>=0?(o.push(l),i.slice(0,h)+"$lit$"+i.slice(h)+m+p):i+m+(-2===h?(o.push(void 0),e):p)}const l=n+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==u?u.createHTML(l):l,o]};class L{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,n=0;const r=t.length-1,l=this.parts,[a,h]=W(t,e);if(this.el=L.createElement(a,i),F.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=F.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(m)){const i=h[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(m),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?K:"?"===e[1]?D:"@"===e[1]?q:B})}else l.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(C.test(o.tagName)){const t=o.textContent.split(m),e=t.length-1;if(e>0){o.textContent=y?y.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],k()),F.nextNode(),l.push({type:2,index:++s});o.append(t[e],k())}}}else if(8===o.nodeType)if(o.data===b)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(m,t+1));)l.push({type:7,index:s}),t+=m.length-1}s++}}static createElement(t,e){const i=w.createElement("template");return i.innerHTML=t,i}}function P(t,e,i=t,o){var s,n,r,l;if(e===_)return e;let a=void 0!==o?null===(s=i._$Cl)||void 0===s?void 0:s[o]:i._$Cu;const h=z(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,i,o)),void 0!==o?(null!==(r=(l=i)._$Cl)&&void 0!==r?r:l._$Cl=[])[o]=a:i._$Cu=a),void 0!==a&&(e=P(t,a._$AS(t,e.values),a,o)),e}class Z{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:o}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:w).importNode(i,!0);F.currentNode=s;let n=F.nextNode(),r=0,l=0,a=o[0];for(;void 0!==a;){if(r===a.index){let e;2===a.type?e=new R(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new H(n,this,t)),this.v.push(e),a=o[++l]}r!==(null==a?void 0:a.index)&&(n=F.nextNode(),r++)}return s}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class R{constructor(t,e,i,o){var s;this.type=2,this._$AH=M,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$C_=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$C_}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=P(this,t,e),z(t)?t===M||null==t||""===t?(this._$AH!==M&&this._$AR(),this._$AH=M):t!==this._$AH&&t!==_&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>I(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==M&&z(this._$AH)?this._$AA.nextSibling.data=t:this.k(w.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=L.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.m(i);else{const t=new Z(s,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=U.get(t.strings);return void 0===e&&U.set(t.strings,e=new L(t)),e}S(t){I(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new R(this.j(k()),this.j(k()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$C_=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class B{constructor(t,e,i,o,s){this.type=1,this._$AH=M,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=M}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let n=!1;if(void 0===s)t=P(this,t,e,0),n=!z(t)||t!==this._$AH&&t!==_,n&&(this._$AH=t);else{const o=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=P(this,o[i+r],e,r),l===_&&(l=this._$AH[r]),n||(n=!z(l)||l!==this._$AH[r]),l===M?t=M:t!==M&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}n&&!o&&this.P(t)}P(t){t===M?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class K extends B{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===M?void 0:t}}const G=y?y.emptyScript:"";class D extends B{constructor(){super(...arguments),this.type=4}P(t){t&&t!==M?this.element.setAttribute(this.name,G):this.element.removeAttribute(this.name)}}class q extends B{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=P(this,t,e,0))&&void 0!==i?i:M)===_)return;const o=this._$AH,s=t===M&&o!==M||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==M&&(o===M||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class H{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t)}}const Y=window.litHtmlPolyfillSupport;null==Y||Y(L,R),(null!==(v=globalThis.litHtmlVersions)&&void 0!==v?v:globalThis.litHtmlVersions=[]).push("2.2.7");
|
|
50
50
|
/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2020 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
54
|
*/
|
|
55
|
-
const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t._$litStatic$},V=t=>({_$litStatic$:t,r:J}),X=new Map,tt=(t=>(e,...i)=>{const o=i.length;let s,n;const r=[],l=[];let a,h=0,f=!1;for(;h<o;){for(a=e[h];h<o&&void 0!==(n=i[h],s=Q(n));)a+=s+e[++h],f=!0;l.push(n),r.push(a),h++}if(h===o&&r.push(e[o]),f){const t=r.join("$$lit$$");void 0===(e=X.get(t))&&(r.raw=r,X.set(t,e=r)),i=l}return t(e,...i)})(E);var et,it=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(et||(et={}));const ot=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.titleFont),st=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.contentFont),nt={fontFamily:st,fontSize:e.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:e.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:e.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:e.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:e.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},rt=e.FtCssVariableFactory.extend("--ft-typography-title-font-family",ot),lt=e.FtCssVariableFactory.extend("--ft-typography-title-font-size",nt.fontSize,"20px"),at=e.FtCssVariableFactory.extend("--ft-typography-title-font-weight",nt.fontWeight,"normal"),ht=e.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",nt.letterSpacing,"0.15px"),ft=e.FtCssVariableFactory.extend("--ft-typography-title-line-height",nt.lineHeight,"1.2"),pt=e.FtCssVariableFactory.extend("--ft-typography-title-text-transform",nt.textTransform,"inherit"),ct=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",ot),dt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",nt.fontSize,"14px"),
|
|
55
|
+
const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t._$litStatic$},V=t=>({_$litStatic$:t,r:J}),X=new Map,tt=(t=>(e,...i)=>{const o=i.length;let s,n;const r=[],l=[];let a,h=0,f=!1;for(;h<o;){for(a=e[h];h<o&&void 0!==(n=i[h],s=Q(n));)a+=s+e[++h],f=!0;l.push(n),r.push(a),h++}if(h===o&&r.push(e[o]),f){const t=r.join("$$lit$$");void 0===(e=X.get(t))&&(r.raw=r,X.set(t,e=r)),i=l}return t(e,...i)})(E);var et,it=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(et||(et={}));const ot=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.titleFont),st=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.contentFont),nt={fontFamily:st,fontSize:e.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:e.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:e.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:e.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:e.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},rt=e.FtCssVariableFactory.extend("--ft-typography-title-font-family",ot),lt=e.FtCssVariableFactory.extend("--ft-typography-title-font-size",nt.fontSize,"20px"),at=e.FtCssVariableFactory.extend("--ft-typography-title-font-weight",nt.fontWeight,"normal"),ht=e.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",nt.letterSpacing,"0.15px"),ft=e.FtCssVariableFactory.extend("--ft-typography-title-line-height",nt.lineHeight,"1.2"),pt=e.FtCssVariableFactory.extend("--ft-typography-title-text-transform",nt.textTransform,"inherit"),ct=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",ot),dt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",nt.fontSize,"14px"),xt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",nt.fontWeight,"normal"),gt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",nt.letterSpacing,"0.105px"),vt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",nt.lineHeight,"1.7"),yt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",nt.textTransform,"inherit"),ut=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",st),mt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",nt.fontSize,"16px"),bt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",nt.fontWeight,"600"),$t=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",nt.letterSpacing,"0.144px"),wt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",nt.lineHeight,"1.5"),kt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",nt.textTransform,"inherit"),zt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",st),It=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",nt.fontSize,"14px"),Nt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",nt.fontWeight,"normal"),Ot=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",nt.letterSpacing,"0.098px"),Tt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",nt.lineHeight,"1.7"),St=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",nt.textTransform,"inherit"),jt=e.FtCssVariableFactory.extend("--ft-typography-body1-font-family",st),At=e.FtCssVariableFactory.extend("--ft-typography-body1-font-size",nt.fontSize,"16px"),Ct=e.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",nt.fontWeight,"normal"),Et=e.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",nt.letterSpacing,"0.496px"),_t=e.FtCssVariableFactory.extend("--ft-typography-body1-line-height",nt.lineHeight,"1.5"),Mt=e.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",nt.textTransform,"inherit"),Ut=e.FtCssVariableFactory.extend("--ft-typography-body2-font-family",st),Ft=e.FtCssVariableFactory.extend("--ft-typography-body2-font-size",nt.fontSize,"14px"),Wt=e.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",nt.fontWeight,"normal"),Lt=e.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",nt.letterSpacing,"0.252px"),Pt=e.FtCssVariableFactory.extend("--ft-typography-body2-line-height",nt.lineHeight,"1.4"),Zt=e.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",nt.textTransform,"inherit"),Rt=e.FtCssVariableFactory.extend("--ft-typography-caption-font-family",st),Bt=e.FtCssVariableFactory.extend("--ft-typography-caption-font-size",nt.fontSize,"12px"),Kt=e.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",nt.fontWeight,"normal"),Gt=e.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",nt.letterSpacing,"0.396px"),Dt=e.FtCssVariableFactory.extend("--ft-typography-caption-line-height",nt.lineHeight,"1.33"),qt=e.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",nt.textTransform,"inherit"),Ht=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",st),Yt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",nt.fontSize,"10px"),Jt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",nt.fontWeight,"normal"),Qt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",nt.letterSpacing,"0.33px"),Vt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",nt.lineHeight,"1.6"),Xt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",nt.textTransform,"inherit"),te=e.FtCssVariableFactory.extend("--ft-typography-overline-font-family",st),ee=e.FtCssVariableFactory.extend("--ft-typography-overline-font-size",nt.fontSize,"10px"),ie=e.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",nt.fontWeight,"normal"),oe=e.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",nt.letterSpacing,"1.5px"),se=e.FtCssVariableFactory.extend("--ft-typography-overline-line-height",nt.lineHeight,"1.6"),ne=e.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",nt.textTransform,"uppercase"),re=e.FtCssVariableFactory.extend("--ft-typography-button-font-family",st),le=e.FtCssVariableFactory.extend("--ft-typography-button-font-size",nt.fontSize,"14px"),ae=e.FtCssVariableFactory.extend("--ft-typography-button-font-weight",nt.fontWeight,"600"),he=e.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",nt.letterSpacing,"1.246px"),fe=e.FtCssVariableFactory.extend("--ft-typography-button-line-height",nt.lineHeight,"1.15"),pe=e.FtCssVariableFactory.extend("--ft-typography-button-text-transform",nt.textTransform,"uppercase"),ce=i.css`
|
|
56
56
|
.ft-typography--title {
|
|
57
57
|
font-family: ${rt};
|
|
58
58
|
font-size: ${lt};
|
|
@@ -65,12 +65,12 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
65
65
|
.ft-typography--title-dense {
|
|
66
66
|
font-family: ${ct};
|
|
67
67
|
font-size: ${dt};
|
|
68
|
-
font-weight: ${
|
|
69
|
-
letter-spacing: ${
|
|
70
|
-
line-height: ${
|
|
71
|
-
text-transform: ${
|
|
68
|
+
font-weight: ${xt};
|
|
69
|
+
letter-spacing: ${gt};
|
|
70
|
+
line-height: ${vt};
|
|
71
|
+
text-transform: ${yt};
|
|
72
72
|
}
|
|
73
|
-
`,
|
|
73
|
+
`,xe=i.css`
|
|
74
74
|
.ft-typography--subtitle1 {
|
|
75
75
|
font-family: ${ut};
|
|
76
76
|
font-size: ${mt};
|
|
@@ -79,17 +79,17 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
79
79
|
line-height: ${wt};
|
|
80
80
|
text-transform: ${kt};
|
|
81
81
|
}
|
|
82
|
-
`,
|
|
82
|
+
`,ge=i.css`
|
|
83
83
|
.ft-typography--subtitle2 {
|
|
84
84
|
font-family: ${zt};
|
|
85
85
|
font-size: ${It};
|
|
86
|
-
font-weight: ${
|
|
87
|
-
letter-spacing: ${
|
|
86
|
+
font-weight: ${Nt};
|
|
87
|
+
letter-spacing: ${Ot};
|
|
88
88
|
line-height: ${Tt};
|
|
89
|
-
text-transform: ${
|
|
89
|
+
text-transform: ${St};
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
`,
|
|
92
|
+
`,ve=i.css`
|
|
93
93
|
.ft-typography--body1 {
|
|
94
94
|
font-family: ${jt};
|
|
95
95
|
font-size: ${At};
|
|
@@ -98,21 +98,21 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
98
98
|
line-height: ${_t};
|
|
99
99
|
text-transform: ${Mt};
|
|
100
100
|
}
|
|
101
|
-
`,
|
|
101
|
+
`,ye=i.css`
|
|
102
102
|
.ft-typography--body2 {
|
|
103
103
|
font-family: ${Ut};
|
|
104
|
-
font-size: ${
|
|
105
|
-
font-weight: ${
|
|
106
|
-
letter-spacing: ${
|
|
107
|
-
line-height: ${
|
|
108
|
-
text-transform: ${
|
|
104
|
+
font-size: ${Ft};
|
|
105
|
+
font-weight: ${Wt};
|
|
106
|
+
letter-spacing: ${Lt};
|
|
107
|
+
line-height: ${Pt};
|
|
108
|
+
text-transform: ${Zt};
|
|
109
109
|
}
|
|
110
110
|
`,ue=i.css`
|
|
111
111
|
.ft-typography--caption {
|
|
112
|
-
font-family: ${
|
|
113
|
-
font-size: ${
|
|
114
|
-
font-weight: ${
|
|
115
|
-
letter-spacing: ${
|
|
112
|
+
font-family: ${Rt};
|
|
113
|
+
font-size: ${Bt};
|
|
114
|
+
font-weight: ${Kt};
|
|
115
|
+
letter-spacing: ${Gt};
|
|
116
116
|
line-height: ${Dt};
|
|
117
117
|
text-transform: ${qt};
|
|
118
118
|
}
|
|
@@ -150,11 +150,11 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
150
150
|
</${V(this.element)}>
|
|
151
151
|
`:tt`
|
|
152
152
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
153
|
-
`}}we.styles=[ce,de,ge,
|
|
153
|
+
`}}we.styles=[ce,de,xe,ge,ve,ye,ue,me,be,$e,i.css`
|
|
154
154
|
.ft-typography {
|
|
155
155
|
vertical-align: inherit;
|
|
156
156
|
}
|
|
157
|
-
`],it([o.property()],we.prototype,"element",void 0),it([o.property()],we.prototype,"variant",void 0),e.customElement("ft-typography")(we);var ke=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const ze=e.FtCssVariableFactory.extend("--ft-notice-color",e.designSystemVariables.colorPrimary),Ie=e.FtCssVariableFactory.extend("--ft-notice-icon-color",e.designSystemVariables.colorOnPrimary),
|
|
157
|
+
`],it([o.property()],we.prototype,"element",void 0),it([o.property()],we.prototype,"variant",void 0),e.customElement("ft-typography")(we);var ke=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const ze=e.FtCssVariableFactory.extend("--ft-notice-color",e.designSystemVariables.colorPrimary),Ie=e.FtCssVariableFactory.extend("--ft-notice-icon-color",e.designSystemVariables.colorOnPrimary),Ne=e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design System");class Oe extends e.FtLitElement{constructor(){super(...arguments),this.icon="info"}static get styles(){return i.css`
|
|
158
158
|
.ft-notice {
|
|
159
159
|
display: inline-flex;
|
|
160
160
|
align-items: stretch;
|
|
@@ -162,7 +162,7 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
ft-icon {
|
|
165
|
-
${e.setVariable(
|
|
165
|
+
${e.setVariable(x.size,"20px")};
|
|
166
166
|
padding: 0 8px;
|
|
167
167
|
display: flex;
|
|
168
168
|
align-self: center;
|
|
@@ -173,14 +173,14 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
173
173
|
background-color: ${ze};
|
|
174
174
|
display: flex;
|
|
175
175
|
align-items: center;
|
|
176
|
-
border-top-left-radius: ${
|
|
177
|
-
border-bottom-left-radius: ${
|
|
176
|
+
border-top-left-radius: ${Ne};
|
|
177
|
+
border-bottom-left-radius: ${Ne};
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
.ft-notice-label {
|
|
181
181
|
padding: 8px;
|
|
182
|
-
border-top-right-radius: ${
|
|
183
|
-
border-bottom-right-radius: ${
|
|
182
|
+
border-top-right-radius: ${Ne};
|
|
183
|
+
border-bottom-right-radius: ${Ne};
|
|
184
184
|
border: 1px solid ${ze};
|
|
185
185
|
}
|
|
186
186
|
`}render(){return i.html`
|
|
@@ -192,10 +192,10 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
192
192
|
<slot></slot>
|
|
193
193
|
</ft-typography>
|
|
194
194
|
</div>
|
|
195
|
-
`}}
|
|
195
|
+
`}}Oe.elementDefinitions={"ft-icon":g,"ft-typography":we},ke([o.property({type:String})],Oe.prototype,"icon",void 0),e.customElement("ft-notice")(Oe);const Te=e.FtCssVariableFactory.create("--ft-skeleton--display","DISPLAY","block"),Se=e.FtCssVariableFactory.create("--ft-skeleton--width","SIZE","100%"),je=e.FtCssVariableFactory.create("--ft-skeleton--height","SIZE","20px"),Ae=e.FtCssVariableFactory.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),Ce=e.FtCssVariableFactory.create("--ft-skeleton--glare-width","SIZE","200px"),Ee=e.FtCssVariableFactory.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),_e=e.FtCssVariableFactory.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),Me=e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system");class Ue extends e.FtLitElement{render(){return i.html`
|
|
196
196
|
`}}Ue.elementDefinitions={},Ue.styles=i.css`
|
|
197
197
|
:host {
|
|
198
|
-
width: ${
|
|
198
|
+
width: ${Se};
|
|
199
199
|
height: ${je};
|
|
200
200
|
display: ${Te};
|
|
201
201
|
overflow: hidden;
|
|
@@ -220,18 +220,22 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
220
220
|
background-position: calc(100vw + ${Ce}) 0, calc(${Ce} * -1) 0;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
`,e.customElement("ft-skeleton")(Ue);var
|
|
223
|
+
`,e.customElement("ft-skeleton")(Ue);var Fe=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const We=e.FtCssVariableFactory.extend("--ft-reader-internal-link-outline-color",e.designSystemVariables.colorPrimary);class Le extends p{constructor(){super(...arguments),this.removeStyle=!1}render(){var t;let e=n.classMap({"ft-reader-link":!0,"ft-reader-link--remove-style":this.removeStyle});return i.html`
|
|
224
224
|
<a class=${e}
|
|
225
225
|
href="${null===(t=this.service)||void 0===t?void 0:t.getLink(this.tocId,this.pageNumber,this.section)}"
|
|
226
226
|
@click=${t=>this.onClick(t)}>
|
|
227
227
|
<slot></slot>
|
|
228
228
|
</a>
|
|
229
|
-
`}onClick(t){var e;t.ctrlKey||t.metaKey||(t.stopPropagation(),t.preventDefault(),this.tocId&&(null===(e=this.stateManager)||void 0===e||e.navigateToTopic(this.tocId,this.section)))}}
|
|
229
|
+
`}onClick(t){var e;t.ctrlKey||t.metaKey||(t.stopPropagation(),t.preventDefault(),this.tocId&&(null===(e=this.stateManager)||void 0===e||e.navigateToTopic(this.tocId,this.section,this.pageNumber)))}}Le.styles=i.css`
|
|
230
|
+
a:focus {
|
|
231
|
+
outline-color: ${We};
|
|
232
|
+
}
|
|
233
|
+
|
|
230
234
|
.ft-reader-link--remove-style {
|
|
231
235
|
text-decoration: none;
|
|
232
236
|
color: inherit;
|
|
233
237
|
}
|
|
234
|
-
`,
|
|
238
|
+
`,Fe([o.property()],Le.prototype,"tocId",void 0),Fe([o.property()],Le.prototype,"section",void 0),Fe([o.property({type:Number})],Le.prototype,"pageNumber",void 0),Fe([o.property({type:Boolean})],Le.prototype,"removeStyle",void 0),e.customElement("ft-reader-internal-link")(Le);var Pe=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ze extends p{constructor(){super(...arguments),this.tocId="",this.error=!1,this.displayLoading=!1,this.loadingDebouncer=new e.Debouncer(300)}render(){var t,e;if(this.error)return i.html`
|
|
235
239
|
<div class="loading-topic" part="error">
|
|
236
240
|
${this.renderTitle()}
|
|
237
241
|
<ft-notice part="error-notice" icon="warning" part="error-notice">
|
|
@@ -241,11 +245,13 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
241
245
|
`;if(null==this.tocNode||null==this.content)return i.html`
|
|
242
246
|
<div class="loading-topic" part="loader">
|
|
243
247
|
${this.renderTitle()}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
248
|
+
${this.displayLoading?i.html`
|
|
249
|
+
<ft-skeleton style="--ft-skeleton--width: 80%"></ft-skeleton>
|
|
250
|
+
<ft-skeleton style="--ft-skeleton--width: 40%;--ft-skeleton--height: 200px"></ft-skeleton>
|
|
251
|
+
<ft-skeleton style="--ft-skeleton--width: 50%"></ft-skeleton>
|
|
252
|
+
<ft-skeleton style="--ft-skeleton--width: 70%"></ft-skeleton>
|
|
253
|
+
<ft-skeleton style="--ft-skeleton--width: 30%"></ft-skeleton>
|
|
254
|
+
`:i.nothing}
|
|
249
255
|
</div>
|
|
250
256
|
`;const o=null!==(e=null===(t=this.tocNode)||void 0===t?void 0:t.depth)&&void 0!==e?e:1;return i.html`
|
|
251
257
|
<section class="ft-reader-topic readercontent-topic-depth-${o} depth-${o}" id="${this.tocId}"
|
|
@@ -259,10 +265,10 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
259
265
|
<ft-typography variant="title" element="h${Math.min(this.tocNode.depth+1,6)}" part="title">
|
|
260
266
|
${null===(t=this.tocNode)||void 0===t?void 0:t.title}
|
|
261
267
|
</ft-typography>
|
|
262
|
-
|
|
268
|
+
`:!this.displayLoading||this.error?i.nothing:i.html`
|
|
263
269
|
<ft-skeleton style="--ft-skeleton--width: 50%;--ft-skeleton--height: 24px; margin-bottom: 24px">
|
|
264
270
|
</ft-skeleton>
|
|
265
|
-
`}updated(t){var e;super.updated(t),t.has("tocId")&&this.tocId&&this.getTocNode(),t.has("tocNode")&&this.tocNode&&(null===(e=this.service)||void 0===e||e.getTopicContent(this.tocNode.contentId).then((t=>this.content=t)))}contentAvailableCallback(t){var e,i,o,s;if(super.contentAvailableCallback(t),(null===(e=this.scrollTarget)||void 0===e?void 0:e.section)&&this.tocId&&this.tocId===this.scrollTarget.tocId&&this.content){(null!==(o=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`))&&void 0!==o?o:this).scrollIntoView({block:"start"
|
|
271
|
+
`}updated(t){var e;super.updated(t),t.has("tocId")&&this.tocId&&this.getTocNode(),t.has("tocNode")&&this.tocNode&&(null===(e=this.service)||void 0===e||e.getTopicContent(this.tocNode.contentId).then((t=>this.content=t)))}contentAvailableCallback(t){var e,i,o,s;if(super.contentAvailableCallback(t),(null===(e=this.scrollTarget)||void 0===e?void 0:e.section)&&this.tocId&&this.tocId===this.scrollTarget.tocId&&this.content){(null!==(o=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`))&&void 0!==o?o:this).scrollIntoView({block:"start"}),null===(s=this.stateManager)||void 0===s||s.scrollDone()}}onStoreAvailable(){super.onStoreAvailable(),this.getTocNode()}async getTocNode(){var t;this.content=void 0,this.tocNode=void 0,this.error=!1,this.displayLoading=!1,this.loadingDebouncer.run((()=>this.displayLoading=!0)),null===(t=this.service)||void 0===t||t.getTocNode(this.tocId).then((t=>this.tocNode=t)).catch((t=>this.error=!0))}}Ze.styles=i.css`
|
|
266
272
|
.ft-reader-topic {
|
|
267
273
|
box-sizing: border-box;
|
|
268
274
|
}
|
|
@@ -283,13 +289,27 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
283
289
|
img {
|
|
284
290
|
max-width: 100%;
|
|
285
291
|
}
|
|
286
|
-
|
|
292
|
+
|
|
293
|
+
.ft-expanding-block-content,
|
|
294
|
+
.ft-expanding-block-inline-content {
|
|
295
|
+
display: none;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.ft-expanding-block-content.ft-expanding-block-expanded {
|
|
299
|
+
display: block;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.ft-expanding-block-inline-content.ft-expanding-block-expanded {
|
|
303
|
+
display: inline;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
`,Pe([o.property()],Ze.prototype,"tocId",void 0),Pe([o.state()],Ze.prototype,"tocNode",void 0),Pe([o.state()],Ze.prototype,"content",void 0),Pe([o.query(".ft-reader-topic")],Ze.prototype,"container",void 0),Pe([e.redux()],Ze.prototype,"scrollTarget",void 0),Pe([o.state()],Ze.prototype,"error",void 0),Pe([o.state()],Ze.prototype,"displayLoading",void 0),e.customElement("ft-reader-topic")(Ze);var Re=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Be=e.FtCssVariableFactory.create("--ft-infinite-scroll-padding","SIZE","0");class Ke extends CustomEvent{constructor(t,e){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:e}})}}class Ge extends Event{constructor(){super("scrolled-to-target")}}class De extends e.FtLitElement{constructor(){super(...arguments),this.items=[],this.renderItem=()=>i.html``,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new e.Debouncer(5),this.onVisibilityChange=t=>{const e=t.filter((t=>t.intersectionRect.height>1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>!this.visibleItems.includes(t))),i=t.filter((t=>t.intersectionRect.height<=1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>this.visibleItems.includes(t))),o=[...this.visibleItems].filter((t=>!i.includes(t)));this.visibleItems=[...e,...o].sort(((t,e)=>t-e))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{this.triggerFindScrollableParent();let i=0;t=t.sort(((t,e)=>t.contentRect.top-e.contentRect.top));for(const e of t){const t=+e.target.parentElement.getAttribute("data-item-index"),o=e.target.parentElement.clientHeight,s=e.contentRect.height;this.alreadyRenderedIndexes.has(t)&&(e.target.parentElement.style.height=s+"px",i+=this.scrollable&&this.getOffset(e.target.parentElement)<this.scrollable.scrollTop+i?s-o:0)}this.scrollable&&e.isSafari&&(this.scrollable.scrollTop+=i)},this.resizeObserver=new ResizeObserver(this.onResize),this.onMutation=()=>{[...this.itemsContainer.children].forEach((t=>{this.intersectionObserver.observe(t),this.resizeObserver.observe(t.children.item(0))}))},this.mutationObserver=new MutationObserver(this.onMutation)}get scrollable(){return this.internalScroll?this.internalScrollable:this.firstScrollableParent}render(){return i.html`
|
|
287
307
|
<div class="items-container ${this.internalScroll?"scrollable":""}"
|
|
288
308
|
tabindex="-1"
|
|
289
309
|
@find-scrollable-parent=${this.findScrollableParent}>
|
|
290
310
|
${r.repeat(this.items,((t,e)=>this.renderItemContainer(t,e)))}
|
|
291
311
|
</div>
|
|
292
|
-
`}renderItemContainer(t,e){const o=this.scrolledToTarget&&this.visibleItems.includes(e),n=this.alreadyRenderedIndexes.has(e)||this.scrolledToTarget&&e>=this.visibleItems[0]-
|
|
312
|
+
`}renderItemContainer(t,e){const o=this.scrolledToTarget&&this.visibleItems.includes(e),n=this.alreadyRenderedIndexes.has(e)||this.scrolledToTarget&&e>=this.visibleItems[0]-this.renderBeforeFirst&&e<=(null!=(r=this.visibleItems)?r:[])[(null!=r?r:[]).length-1]+this.renderAfterLast;var r;n&&this.alreadyRenderedIndexes.add(e);return i.html`
|
|
293
313
|
<div id="item-${e}"
|
|
294
314
|
class="item-container"
|
|
295
315
|
data-item-index="${e}">
|
|
@@ -297,10 +317,10 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
297
317
|
${n?(()=>{const o=this.renderItem(t,e);return"string"==typeof o?i.html`${s.unsafeHTML(o)}`:o})():null}
|
|
298
318
|
</div>
|
|
299
319
|
</div>
|
|
300
|
-
`}resetScroll(){this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t,e;let i=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;i>=this.items.length&&(i=-1);let o=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${i}`);this.scrollToTarget(o),this.onMutation(),setTimeout((()=>{this.scrolledToTarget=!0}),10)}))}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable?this.scrollable.scrollTop=i>0?this.getOffset(t)+1:0:t.scrollIntoView({block:"start"})}}getOffset(t){var e;let i=0,o=t;for(;o&&o.offsetParent!==this.scrollable.offsetParent;)i+=o.offsetTop,o=o.offsetParent;return i+(null!==(e=null==o?void 0:o.offsetTop)&&void 0!==e?e:0)-this.scrollable.offsetTop}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{rootMargin:"-2px",threshold:[0,.01,.1]}),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}triggerFindScrollableParent(){this.itemsContainer.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){t.stopPropagation();for(let e of t.composedPath()){const t=e;if(t.clientHeight&&t.clientHeight<t.scrollHeight&&["auto","scroll"].includes(getComputedStyle(t).overflowY)){this.firstScrollableParent=t;break}}}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),(t.has("scrollToItem")||t.has("scrollToIndex"))&&this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.dispatchEvent(new
|
|
320
|
+
`}resetScroll(){this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t,e;let i=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;i>=this.items.length&&(i=-1);let o=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${i}`);this.scrollToTarget(o),this.onMutation(),setTimeout((()=>{this.scrolledToTarget=!0}),10)}))}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable?this.scrollable.scrollTop=i>0?this.getOffset(t)+1:0:t.scrollIntoView({block:"start"})}}getOffset(t){var e;let i=0,o=t;for(;o&&o.offsetParent!==this.scrollable.offsetParent;)i+=o.offsetTop,o=o.offsetParent;return i+(null!==(e=null==o?void 0:o.offsetTop)&&void 0!==e?e:0)-this.scrollable.offsetTop}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{rootMargin:"-2px",threshold:[0,.01,.1]}),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}triggerFindScrollableParent(){this.itemsContainer.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){t.stopPropagation();for(let e of t.composedPath()){const t=e;if(t.clientHeight&&t.clientHeight<t.scrollHeight&&["auto","scroll"].includes(getComputedStyle(t).overflowY)){this.firstScrollableParent=t;break}}}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),(t.has("scrollToItem")||t.has("scrollToIndex"))&&this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.dispatchEvent(new Ke(this.visibleItems,this.visibleItems.map((t=>this.items[t])))),t.has("scrolledToTarget")&&this.scrolledToTarget&&this.dispatchEvent(new Ge)}}De.styles=i.css`
|
|
301
321
|
.items-container {
|
|
302
322
|
position: relative;
|
|
303
|
-
padding: ${
|
|
323
|
+
padding: ${Be};
|
|
304
324
|
outline: none;
|
|
305
325
|
}
|
|
306
326
|
|
|
@@ -330,18 +350,20 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
330
350
|
.resizable:not(.rendered) {
|
|
331
351
|
width: 0;
|
|
332
352
|
}
|
|
333
|
-
`,Re([o.property({type:Array})],
|
|
353
|
+
`,Re([o.property({type:Array})],De.prototype,"items",void 0),Re([o.property({attribute:!1})],De.prototype,"renderItem",void 0),Re([o.property({type:Object})],De.prototype,"scrollToItem",void 0),Re([o.property({type:Number})],De.prototype,"scrollToIndex",void 0),Re([o.property({type:Boolean})],De.prototype,"internalScroll",void 0),Re([o.property({type:Number})],De.prototype,"renderBeforeFirst",void 0),Re([o.property({type:Number})],De.prototype,"renderAfterLast",void 0),Re([o.state({hasChanged:(t,e)=>null!=t&&null==e||t.length!==e.length||t[0]!==e[0]})],De.prototype,"visibleItems",void 0),Re([o.query(".scrollable")],De.prototype,"internalScrollable",void 0),Re([o.query(".items-container")],De.prototype,"itemsContainer",void 0),Re([o.state()],De.prototype,"scrolledToTarget",void 0),e.customElement("ft-infinite-scroll")(De);var qe=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class He extends p{constructor(){super(...arguments),this.renderTopic=t=>i.html`
|
|
334
354
|
<ft-reader-topic tocId="${t}" .exportpartsPrefix=${"topic"}></ft-reader-topic>
|
|
335
|
-
`,this.visibleTopicsDebouncer=new e.Debouncer(100)}render(){var t;return i.html`
|
|
355
|
+
`,this.renderBeforeFirst=5,this.renderAfterLast=10,this.visibleTopicsDebouncer=new e.Debouncer(100)}render(){var t;return i.html`
|
|
336
356
|
<ft-infinite-scroll class="ft-reader-content"
|
|
337
357
|
.items=${(null===(t=this.currentPage)||void 0===t?void 0:t.topics)||[]}
|
|
338
358
|
.renderItem=${this.renderTopic}
|
|
339
359
|
.scrollToItem=${this.getScrollTarget()}
|
|
360
|
+
.renderBeforeFirst=${this.renderBeforeFirst}
|
|
361
|
+
.renderAfterLast=${this.renderAfterLast}
|
|
340
362
|
exportpartsPrefix="scroller"
|
|
341
363
|
@visible-items-change=${this.visibleTopicChange}
|
|
342
364
|
@scrolled-to-target=${this.onScrollDone}
|
|
343
365
|
>
|
|
344
366
|
|
|
345
367
|
</ft-infinite-scroll>
|
|
346
|
-
`}getScrollTarget(){var t,e,i,o,s;const n=null!==(o=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(i=null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)&&void 0!==i?i:""))&&void 0!==o&&o;return!(null===(s=this.scrollTarget)||void 0===s?void 0:s.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;null==(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)&&(null===(e=this.stateManager)||void 0===e||e.scrollDone())}}
|
|
347
|
-
`,
|
|
368
|
+
`}getScrollTarget(){var t,e,i,o,s;const n=null!==(o=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(i=null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)&&void 0!==i?i:""))&&void 0!==o&&o;return!(null===(s=this.scrollTarget)||void 0===s?void 0:s.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;null==(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)&&(null===(e=this.stateManager)||void 0===e||e.scrollDone())}}He.elementDefinitions={"ft-infinite-scroll":De},He.styles=i.css`
|
|
369
|
+
`,qe([o.property()],He.prototype,"renderTopic",void 0),qe([e.redux()],He.prototype,"currentPage",void 0),qe([e.redux()],He.prototype,"scrollTarget",void 0),qe([e.redux()],He.prototype,"visibleTopics",void 0),qe([e.redux()],He.prototype,"renderBeforeFirst",void 0),qe([e.redux()],He.prototype,"renderAfterLast",void 0),qe([o.query(".ft-reader-content")],He.prototype,"container",void 0),e.customElement("ft-reader-content")(He),t.FtReaderContent=He,t.FtReaderContentCssVariables={},Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap,ftGlobals.litRepeat);
|