@fluid-topics/ft-reader-content 0.3.20 → 0.3.22
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.
- package/build/ft-reader-content.light.js +86 -274
- package/build/ft-reader-content.min.js +102 -297
- package/package.json +6 -6
|
@@ -1,16 +1,55 @@
|
|
|
1
|
-
!function(t,e,i,o,
|
|
1
|
+
!function(t,e,i,s,o,n){var r=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class l extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const a=function(t){class e extends t{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 l)),10)}disconnectedCallback(){super.disconnectedCallback(),this.store=void 0,this.stateManager=void 0}}return r([s.state()],e.prototype,"stateManager",void 0),e}(e.FtLitElementRedux),c=i.css` `,d=e.FtCssVariableFactory.create("--ft-reader-topic-context-text-color","COLOR","#000000"),h=e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),x=i.css`
|
|
2
|
+
.ft-reader-topic-context {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
color: ${d};
|
|
5
|
+
background-color: ${h};
|
|
6
|
+
}
|
|
7
|
+
`;var v=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class p extends a{constructor(){super(...arguments),this.registeredComponents=[]}render(){return i.html`
|
|
8
|
+
<article id=${this.tocId}>
|
|
9
|
+
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
|
10
|
+
</article>
|
|
11
|
+
`}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode}updated(t){super.updated(t),["tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}p.styles=x,v([s.property()],p.prototype,"tocId",void 0),v([s.state()],p.prototype,"tocNode",void 0),e.customElement("ft-reader-topic-context")(p);const f=e.FtCssVariableFactory.external(e.designSystemVariables.titleFont,"Design system"),u=i.css`
|
|
12
|
+
.title {
|
|
13
|
+
font-family: ${f};
|
|
14
|
+
}
|
|
15
|
+
`;var m=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class b extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}const g=function(t){class e extends t{connectedCallback(){super.connectedCallback(),setTimeout((()=>this.dispatchEvent(new b)),10)}}return m([s.state()],e.prototype,"tocNode",void 0),e}(a);var $=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class y extends g{render(){var t,e,s,n,r,l;if(!this.map||!this.tocNode)return i.nothing;const a=Math.min((null===(t=this.tocNode)||void 0===t?void 0:t.depth)||1,6),c=null!==(s=null===(e=this.map)||void 0===e?void 0:e.contentStyles.customCssClasses.join(" "))&&void 0!==s?s:"",d=null===(n=this.map)||void 0===n?void 0:n.lang;return i.html`
|
|
16
|
+
<style>
|
|
17
|
+
@import "${null===(r=this.map)||void 0===r?void 0:r.contentStyles.titleStylesheetUrl}";
|
|
18
|
+
</style>
|
|
19
|
+
<section class="title" lang="${d}">
|
|
20
|
+
<div class="depth-${null===(l=this.tocNode)||void 0===l?void 0:l.depth} content-locale-${d} ${c}">
|
|
21
|
+
${o.unsafeHTML(`<h${a}>${this.tocNode.title}</h${a}>`)}
|
|
22
|
+
</div>
|
|
23
|
+
</section>
|
|
24
|
+
`}}y.styles=u,$([e.redux()],y.prototype,"map",void 0),e.customElement("ft-reader-topic-title")(y);const w=e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system"),O=e.FtCssVariableFactory.external(e.designSystemVariables.contentFont,"Design system"),j=i.css`
|
|
25
|
+
.topic {
|
|
26
|
+
font-family: ${O};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.topic-on-error {
|
|
30
|
+
display: flex;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.topic-on-error ft-icon {
|
|
34
|
+
color: ${w}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.topic-loading {
|
|
38
|
+
height: 100vh;
|
|
39
|
+
}
|
|
40
|
+
`;var I,T;!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=""}(I||(I={})),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=""}(T||(T={})),new Map([...["abw"].map((t=>[t,T.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,T.AUDIO])),...["avi"].map((t=>[t,T.AVI])),...["chm","xhs"].map((t=>[t,T.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,T.CODE])),...["csv"].map((t=>[t,T.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,T.DITA])),...["epub"].map((t=>[t,T.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,T.EXCEL])),...["flac"].map((t=>[t,T.FLAC])),...["gif"].map((t=>[t,T.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,T.GZIP])),...["html","htm","xhtml"].map((t=>[t,T.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,T.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,T.JPEG])),...["json"].map((t=>[t,T.JSON])),...["m4a","m4p"].map((t=>[t,T.M4A])),...["mov","qt"].map((t=>[t,T.MOV])),...["mp3"].map((t=>[t,T.MP3])),...["mp4","m4v"].map((t=>[t,T.MP4])),...["ogg","oga"].map((t=>[t,T.OGG])),...["pdf","ps"].map((t=>[t,T.PDF])),...["png"].map((t=>[t,T.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,T.POWERPOINT])),...["rar"].map((t=>[t,T.RAR])),...["stp"].map((t=>[t,T.STP])),...["txt","rtf","md","mdown"].map((t=>[t,T.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,T.VIDEO])),...["wav"].map((t=>[t,T.WAV])),...["wma"].map((t=>[t,T.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,T.WORD])),...["xml","xsl","rdf"].map((t=>[t,T.XML])),...["yaml","yml","x-yaml"].map((t=>[t,T.YAML])),...["zip"].map((t=>[t,T.ZIP]))]);const k=e.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),N=e.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),C=e.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),z=e.FtCssVariableFactory.extend("--ft-icon-material-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),S=e.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset"),M=i.css`
|
|
2
41
|
:host {
|
|
3
42
|
display: inline-block;
|
|
4
43
|
}
|
|
5
44
|
|
|
6
45
|
:host, i.ft-icon {
|
|
7
|
-
width: ${
|
|
8
|
-
height: ${
|
|
46
|
+
width: ${k};
|
|
47
|
+
height: ${k};
|
|
9
48
|
text-align: center;
|
|
10
49
|
}
|
|
11
50
|
|
|
12
51
|
i.ft-icon {
|
|
13
|
-
font-size: ${
|
|
52
|
+
font-size: ${k};
|
|
14
53
|
line-height: 1;
|
|
15
54
|
font-weight: normal;
|
|
16
55
|
text-transform: none;
|
|
@@ -21,285 +60,52 @@
|
|
|
21
60
|
text-rendering: auto;
|
|
22
61
|
-webkit-font-smoothing: antialiased;
|
|
23
62
|
-moz-osx-font-smoothing: grayscale;
|
|
24
|
-
vertical-align: ${
|
|
63
|
+
vertical-align: ${S};
|
|
25
64
|
}
|
|
26
65
|
|
|
27
66
|
.ft-icon--fluid-topics {
|
|
28
|
-
font-family: ${
|
|
67
|
+
font-family: ${N}, ft-icons, fticons, sans-serif;
|
|
29
68
|
}
|
|
30
69
|
|
|
31
70
|
.ft-icon--file-format {
|
|
32
|
-
font-family: ${
|
|
71
|
+
font-family: ${C}, ft-mime, sans-serif;
|
|
33
72
|
}
|
|
34
73
|
|
|
35
74
|
.ft-icon--material {
|
|
36
|
-
font-family: ${
|
|
75
|
+
font-family: ${z}, "Material Icons", sans-serif;
|
|
37
76
|
}
|
|
38
|
-
`;var
|
|
77
|
+
`;var A;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(A||(A={}));var W=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class E extends e.FtLitElement{constructor(){super(...arguments),this.variant=A.fluid_topics,this.resolvedIcon=i.nothing}render(){const t="material"!==this.variant||this.value;return i.html`
|
|
39
78
|
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
40
|
-
${
|
|
79
|
+
${o.unsafeHTML(this.resolvedIcon)}
|
|
41
80
|
<slot ?hidden=${t}></slot>
|
|
42
81
|
</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:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
text-transform: ${ct};
|
|
57
|
-
}
|
|
58
|
-
`,xe=i.css`
|
|
59
|
-
.ft-typography--title-dense {
|
|
60
|
-
font-family: ${dt};
|
|
61
|
-
font-size: ${xt};
|
|
62
|
-
font-weight: ${gt};
|
|
63
|
-
letter-spacing: ${vt};
|
|
64
|
-
line-height: ${yt};
|
|
65
|
-
text-transform: ${ut};
|
|
66
|
-
}
|
|
67
|
-
`,ge=i.css`
|
|
68
|
-
.ft-typography--subtitle1 {
|
|
69
|
-
font-family: ${mt};
|
|
70
|
-
font-size: ${bt};
|
|
71
|
-
font-weight: ${$t};
|
|
72
|
-
letter-spacing: ${wt};
|
|
73
|
-
line-height: ${kt};
|
|
74
|
-
text-transform: ${zt};
|
|
75
|
-
}
|
|
76
|
-
`,ve=i.css`
|
|
77
|
-
.ft-typography--subtitle2 {
|
|
78
|
-
font-family: ${It};
|
|
79
|
-
font-size: ${Nt};
|
|
80
|
-
font-weight: ${Ot};
|
|
81
|
-
letter-spacing: ${jt};
|
|
82
|
-
line-height: ${St};
|
|
83
|
-
text-transform: ${Tt};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
`,ye=i.css`
|
|
87
|
-
.ft-typography--body1 {
|
|
88
|
-
font-family: ${At};
|
|
89
|
-
font-size: ${Ct};
|
|
90
|
-
font-weight: ${Et};
|
|
91
|
-
letter-spacing: ${_t};
|
|
92
|
-
line-height: ${Mt};
|
|
93
|
-
text-transform: ${Ut};
|
|
94
|
-
}
|
|
95
|
-
`,ue=i.css`
|
|
96
|
-
.ft-typography--body2 {
|
|
97
|
-
font-family: ${Ft};
|
|
98
|
-
font-size: ${Wt};
|
|
99
|
-
font-weight: ${Lt};
|
|
100
|
-
letter-spacing: ${Zt};
|
|
101
|
-
line-height: ${Rt};
|
|
102
|
-
text-transform: ${Bt};
|
|
103
|
-
}
|
|
104
|
-
`,me=i.css`
|
|
105
|
-
.ft-typography--caption {
|
|
106
|
-
font-family: ${Kt};
|
|
107
|
-
font-size: ${Gt};
|
|
108
|
-
font-weight: ${Pt};
|
|
109
|
-
letter-spacing: ${Dt};
|
|
110
|
-
line-height: ${qt};
|
|
111
|
-
text-transform: ${Ht};
|
|
112
|
-
}
|
|
113
|
-
`,be=i.css`
|
|
114
|
-
.ft-typography--breadcrumb {
|
|
115
|
-
font-family: ${Yt};
|
|
116
|
-
font-size: ${Jt};
|
|
117
|
-
font-weight: ${Qt};
|
|
118
|
-
letter-spacing: ${Vt};
|
|
119
|
-
line-height: ${Xt};
|
|
120
|
-
text-transform: ${te};
|
|
121
|
-
}
|
|
122
|
-
`,$e=i.css`
|
|
123
|
-
.ft-typography--overline {
|
|
124
|
-
font-family: ${ee};
|
|
125
|
-
font-size: ${ie};
|
|
126
|
-
font-weight: ${oe};
|
|
127
|
-
letter-spacing: ${se};
|
|
128
|
-
line-height: ${ne};
|
|
129
|
-
text-transform: ${re};
|
|
130
|
-
}
|
|
131
|
-
`,we=i.css`
|
|
132
|
-
.ft-typography--button {
|
|
133
|
-
font-family: ${le};
|
|
134
|
-
font-size: ${ae};
|
|
135
|
-
font-weight: ${he};
|
|
136
|
-
letter-spacing: ${fe};
|
|
137
|
-
line-height: ${pe};
|
|
138
|
-
text-transform: ${ce};
|
|
139
|
-
}
|
|
140
|
-
`,ke=i.css`
|
|
141
|
-
.ft-typography {
|
|
142
|
-
vertical-align: inherit;
|
|
143
|
-
}
|
|
144
|
-
`;var ze=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 Ie extends e.FtLitElement{constructor(){super(...arguments),this.variant=ot.body1}render(){return this.element?it`
|
|
145
|
-
<${tt(this.element)}
|
|
146
|
-
class="ft-typography ft-typography--${this.variant}">
|
|
147
|
-
<slot></slot>
|
|
148
|
-
</${tt(this.element)}>
|
|
149
|
-
`:it`
|
|
150
|
-
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
151
|
-
`}}Ie.styles=[de,xe,ge,ve,ye,ue,me,be,$e,we,ke],ze([o.property()],Ie.prototype,"element",void 0),ze([o.property()],Ie.prototype,"variant",void 0),e.customElement("ft-typography")(Ie);const Ne=e.FtCssVariableFactory.extend("--ft-notice-color",e.designSystemVariables.colorPrimary),Oe=e.FtCssVariableFactory.extend("--ft-notice-icon-color",e.designSystemVariables.colorOnPrimary),je=e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design System"),Se=i.css`
|
|
152
|
-
.ft-notice {
|
|
153
|
-
display: inline-flex;
|
|
154
|
-
align-items: stretch;
|
|
155
|
-
box-sizing: border-box;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
ft-icon {
|
|
159
|
-
${e.setVariable(c.size,"20px")};
|
|
160
|
-
padding: 0 8px;
|
|
161
|
-
display: flex;
|
|
162
|
-
align-self: center;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.ft-icon {
|
|
166
|
-
color: ${Oe};
|
|
167
|
-
background-color: ${Ne};
|
|
168
|
-
display: flex;
|
|
169
|
-
align-items: center;
|
|
170
|
-
border-top-left-radius: ${je};
|
|
171
|
-
border-bottom-left-radius: ${je};
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.ft-notice-label {
|
|
175
|
-
padding: 8px;
|
|
176
|
-
border-top-right-radius: ${je};
|
|
177
|
-
border-bottom-right-radius: ${je};
|
|
178
|
-
border: 1px solid ${Ne};
|
|
179
|
-
}
|
|
180
|
-
`;var Te=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 Ae extends e.FtLitElement{constructor(){super(...arguments),this.icon="info"}render(){return i.html`
|
|
181
|
-
<div class="ft-notice">
|
|
182
|
-
<div class="ft-icon">
|
|
183
|
-
<ft-icon>${this.icon}</ft-icon>
|
|
82
|
+
`}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 s=this.value||this.textContent;switch(this.variant){case A.file_format:this.resolvedIcon=null!==(t=T[s.toUpperCase()])&&void 0!==t?t:s;break;case A.fluid_topics:this.resolvedIcon=null!==(e=I[s.toUpperCase()])&&void 0!==e?e:s;break;default:this.resolvedIcon=this.value||i.nothing}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>{this.resolveIcon()}))}}E.elementDefinitions={},E.styles=M,W([s.property()],E.prototype,"variant",void 0),W([s.property()],E.prototype,"value",void 0),W([s.state()],E.prototype,"resolvedIcon",void 0),W([s.query("slot")],E.prototype,"slottedContent",void 0),e.customElement("ft-icon")(E);var G=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class L extends g{render(){var t;return this.map&&(this.error||this.content)?i.html`
|
|
83
|
+
<style>
|
|
84
|
+
@import "${null===(t=this.map)||void 0===t?void 0:t.contentStyles.topicStylesheetUrl}";
|
|
85
|
+
</style>
|
|
86
|
+
<section class="topic" lang="${this.contentLocale}">
|
|
87
|
+
${this.renderTopicContent()}
|
|
88
|
+
</section>
|
|
89
|
+
`:i.html`
|
|
90
|
+
<section class="topic-loading"></section>
|
|
91
|
+
`}updated(t){super.updated(t),t.has("tocNode")&&this.updateContent()}updateContent(){var t;this.error=void 0,this.content=void 0,this.tocNode&&(null===(t=this.service)||void 0===t||t.getTopicContent(this.tocNode.contentId).then((t=>this.content=t||'<div class="empty-topic"></div>')).catch((t=>this.error=t)))}contentAvailableCallback(t){var e,i,s,o,n,r;if(super.contentAvailableCallback(t),(null===(e=this.scrollTarget)||void 0===e?void 0:e.section)&&(null===(i=this.tocNode)||void 0===i?void 0:i.tocId)&&(null===(s=this.tocNode)||void 0===s?void 0:s.tocId)===this.scrollTarget.tocId&&this.content){(null!==(n=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`))&&void 0!==n?n:this).scrollIntoView({block:"start"}),null===(r=this.stateManager)||void 0===r||r.scrollDone()}}onStoreAvailable(){super.onStoreAvailable(),this.updateContent()}renderTopicContent(){var t,e,s,n;if(this.error){let e=this.is404Error()?"topicMissingAdvice":"somethingWentWrong";return i.html`
|
|
92
|
+
<div class="topic-on-error">
|
|
93
|
+
<ft-icon>WARNING</ft-icon>
|
|
94
|
+
<div>${null===(t=this.service)||void 0===t?void 0:t.resolveLabel(e)}</div>
|
|
184
95
|
</div>
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
96
|
+
`}const r=null!==(s=null===(e=this.map)||void 0===e?void 0:e.contentStyles.customCssClasses.join(" "))&&void 0!==s?s:"";return i.html`
|
|
97
|
+
<div class="depth-${null===(n=this.tocNode)||void 0===n?void 0:n.depth} content-locale-${this.contentLocale} ${r}">
|
|
98
|
+
${o.unsafeHTML(`${this.content}`)}
|
|
188
99
|
</div>
|
|
189
|
-
`}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
border-radius: ${Le};
|
|
196
|
-
background: linear-gradient(
|
|
197
|
-
90deg,
|
|
198
|
-
transparent,
|
|
199
|
-
${Fe} calc(0.45 * ${Ue}),
|
|
200
|
-
${Fe} calc(0.55 * ${Ue}),
|
|
201
|
-
transparent ${Ue}
|
|
202
|
-
), ${Me};
|
|
203
|
-
background-repeat: repeat-y;
|
|
204
|
-
background-size: 100vw 100vh;
|
|
205
|
-
background-attachment: fixed;
|
|
206
|
-
background-position: calc(${Ue} * -1) 0;
|
|
207
|
-
animation: shine ${We} infinite;
|
|
208
|
-
animation-timing-function: linear;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
@keyframes shine {
|
|
212
|
-
to {
|
|
213
|
-
background-position: calc(100vw + ${Ue}) 0, calc(${Ue} * -1) 0;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
`;class Re extends e.FtLitElement{render(){return i.html`
|
|
217
|
-
`}}Re.elementDefinitions={},Re.styles=Ze,e.customElement("ft-skeleton")(Re);const Be=e.FtCssVariableFactory.extend("--ft-reader-internal-link-outline-color",e.designSystemVariables.colorPrimary),Ke=i.css`
|
|
218
|
-
a:focus {
|
|
219
|
-
outline-color: ${Be};
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.ft-reader-link--remove-style {
|
|
223
|
-
text-decoration: none;
|
|
224
|
-
color: inherit;
|
|
225
|
-
}
|
|
226
|
-
`;var Ge=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 Pe 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`
|
|
227
|
-
<a class=${e}
|
|
228
|
-
href="${null===(t=this.service)||void 0===t?void 0:t.getLink(this.tocId,this.pageNumber,this.section)}"
|
|
229
|
-
@click=${t=>this.onClick(t)}>
|
|
230
|
-
<slot></slot>
|
|
231
|
-
</a>
|
|
232
|
-
`}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)))}}Pe.styles=Ke,Ge([o.property()],Pe.prototype,"tocId",void 0),Ge([o.property()],Pe.prototype,"section",void 0),Ge([o.property({type:Number})],Pe.prototype,"pageNumber",void 0),Ge([o.property({type:Boolean})],Pe.prototype,"removeStyle",void 0),e.customElement("ft-reader-internal-link")(Pe);const De=i.css`
|
|
233
|
-
.ft-reader-topic {
|
|
234
|
-
box-sizing: border-box;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.loading-topic {
|
|
238
|
-
height: 100vh;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
ft-skeleton {
|
|
242
|
-
margin: 8px 0;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.ft-reader-topic--content {
|
|
246
|
-
max-width: 100%;
|
|
247
|
-
overflow-x: auto;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
img {
|
|
251
|
-
max-width: 100%;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.ft-expanding-block-content,
|
|
255
|
-
.ft-expanding-block-inline-content {
|
|
256
|
-
display: none;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.ft-expanding-block-content.ft-expanding-block-expanded {
|
|
260
|
-
display: block;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.ft-expanding-block-inline-content.ft-expanding-block-expanded {
|
|
264
|
-
display: inline;
|
|
265
|
-
}
|
|
266
|
-
`;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.tocId="",this.error=!1,this.displayLoading=!1,this.loadingDebouncer=new e.Debouncer(300)}render(){var t,e;if(this.error)return i.html`
|
|
267
|
-
<div class="loading-topic" part="error">
|
|
268
|
-
${this.renderTitle()}
|
|
269
|
-
<ft-notice part="error-notice" icon="warning" part="error-notice">
|
|
270
|
-
An error occured.
|
|
271
|
-
</ft-notice>
|
|
272
|
-
</div>
|
|
273
|
-
`;if(null==this.tocNode||null==this.content)return i.html`
|
|
274
|
-
<div class="loading-topic" part="loader">
|
|
275
|
-
${this.renderTitle()}
|
|
276
|
-
${this.displayLoading?i.html`
|
|
277
|
-
<ft-skeleton style="--ft-skeleton--width: 80%"></ft-skeleton>
|
|
278
|
-
<ft-skeleton style="--ft-skeleton--width: 40%;--ft-skeleton--height: 200px"></ft-skeleton>
|
|
279
|
-
<ft-skeleton style="--ft-skeleton--width: 50%"></ft-skeleton>
|
|
280
|
-
<ft-skeleton style="--ft-skeleton--width: 70%"></ft-skeleton>
|
|
281
|
-
<ft-skeleton style="--ft-skeleton--width: 30%"></ft-skeleton>
|
|
282
|
-
`:i.nothing}
|
|
283
|
-
</div>
|
|
284
|
-
`;const o=null!==(e=null===(t=this.tocNode)||void 0===t?void 0:t.depth)&&void 0!==e?e:1;return i.html`
|
|
285
|
-
<section class="ft-reader-topic readercontent-topic-depth-${o} depth-${o}" id="${this.tocId}"
|
|
286
|
-
part="container">
|
|
287
|
-
${this.renderTitle()}
|
|
288
|
-
<div class="ft-reader-topic--content topic" part="content">
|
|
289
|
-
${s.unsafeHTML(this.content)}
|
|
290
|
-
</div>
|
|
291
|
-
</section>
|
|
292
|
-
`}renderTitle(){var t;return this.tocNode?i.html`
|
|
293
|
-
<ft-typography variant="title" element="h${Math.min(this.tocNode.depth+1,6)}" part="title">
|
|
294
|
-
${null===(t=this.tocNode)||void 0===t?void 0:t.title}
|
|
295
|
-
</ft-typography>
|
|
296
|
-
`:!this.displayLoading||this.error?i.nothing:i.html`
|
|
297
|
-
<ft-skeleton style="--ft-skeleton--width: 50%;--ft-skeleton--height: 24px; margin-bottom: 24px">
|
|
298
|
-
</ft-skeleton>
|
|
299
|
-
`}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))}}He.styles=De,qe([o.property()],He.prototype,"tocId",void 0),qe([o.state()],He.prototype,"tocNode",void 0),qe([o.state()],He.prototype,"content",void 0),qe([o.query(".ft-reader-topic")],He.prototype,"container",void 0),qe([e.redux()],He.prototype,"scrollTarget",void 0),qe([o.state()],He.prototype,"error",void 0),qe([o.state()],He.prototype,"displayLoading",void 0),e.customElement("ft-reader-topic")(He);const Ye=e.FtCssVariableFactory.create("--ft-infinite-scroll-padding","SIZE","0"),Je=i.css`
|
|
100
|
+
`}is404Error(){return 404===this.error.status}}L.styles=j,G([e.redux((t=>{var e;return null===(e=t.map)||void 0===e?void 0:e.lang}))],L.prototype,"contentLocale",void 0),G([e.redux()],L.prototype,"map",void 0),G([e.redux()],L.prototype,"scrollTarget",void 0),G([s.state()],L.prototype,"content",void 0),G([s.state()],L.prototype,"error",void 0),e.customElement("ft-reader-topic-content")(L);var U=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class B extends e.FtLitElement{constructor(){super(...arguments),this.tocId=""}render(){return i.html`
|
|
101
|
+
<ft-reader-topic-context tocId="${this.tocId}">
|
|
102
|
+
<ft-reader-topic-title></ft-reader-topic-title>
|
|
103
|
+
<ft-reader-topic-content></ft-reader-topic-content>
|
|
104
|
+
</ft-reader-topic-context>
|
|
105
|
+
`}}B.elementDefinitions={"ft-reader-topic-context":p,"ft-reader-topic-title":y,"ft-reader-topic-content":L},B.styles=c,U([s.property()],B.prototype,"tocId",void 0),e.customElement("ft-reader-topic")(B);const D=e.FtCssVariableFactory.create("--ft-infinite-scroll-padding","SIZE","0"),P=i.css`
|
|
300
106
|
.items-container {
|
|
301
107
|
position: relative;
|
|
302
|
-
padding: ${
|
|
108
|
+
padding: ${D};
|
|
303
109
|
outline: none;
|
|
304
110
|
}
|
|
305
111
|
|
|
@@ -310,6 +116,12 @@ const V=Symbol.for(""),X=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
310
116
|
|
|
311
117
|
.item-container {
|
|
312
118
|
height: 100vh;
|
|
119
|
+
|
|
120
|
+
/*
|
|
121
|
+
Text elements can have collapsing margins that expand outside of the item
|
|
122
|
+
Adding margin and/or padding to the containing box prevents that
|
|
123
|
+
*/
|
|
124
|
+
padding: .1px;
|
|
313
125
|
}
|
|
314
126
|
|
|
315
127
|
.item-container + .item-container {
|
|
@@ -329,22 +141,22 @@ const V=Symbol.for(""),X=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
329
141
|
.resizable:not(.rendered) {
|
|
330
142
|
width: 0;
|
|
331
143
|
}
|
|
332
|
-
`;var
|
|
144
|
+
`;var F=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class K extends CustomEvent{constructor(t,e){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:e}})}}class R extends Event{constructor(){super("scrolled-to-target")}}class q 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))),s=[...this.visibleItems].filter((t=>!i.includes(t)));this.visibleItems=[...e,...s].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"),s=e.target.parentElement.clientHeight,o=e.contentRect.height;this.alreadyRenderedIndexes.has(t)&&(e.target.parentElement.style.height=o+"px",i+=this.scrollable&&this.getOffset(e.target.parentElement)<this.scrollable.scrollTop+i?o-s: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`
|
|
333
145
|
<div class="items-container ${this.internalScroll?"scrollable":""}"
|
|
334
146
|
tabindex="-1"
|
|
335
147
|
@find-scrollable-parent=${this.findScrollableParent}>
|
|
336
|
-
${
|
|
148
|
+
${n.repeat(this.items,((t,e)=>this.renderItemContainer(t,e)))}
|
|
337
149
|
</div>
|
|
338
|
-
`}renderItemContainer(t,e){const
|
|
150
|
+
`}renderItemContainer(t,e){const s=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`
|
|
339
151
|
<div id="item-${e}"
|
|
340
152
|
class="item-container"
|
|
341
153
|
data-item-index="${e}">
|
|
342
|
-
<div class="resizable ${
|
|
343
|
-
${n?(()=>{const
|
|
154
|
+
<div class="resizable ${s?"visible":""} ${n?"rendered":""}">
|
|
155
|
+
${n?(()=>{const s=this.renderItem(t,e);return"string"==typeof s?i.html`${o.unsafeHTML(s)}`:s})():null}
|
|
344
156
|
</div>
|
|
345
157
|
</div>
|
|
346
|
-
`}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
|
|
347
|
-
`;var
|
|
158
|
+
`}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 s=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${i}`);this.scrollToTarget(s),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,s=t;for(;s&&s.offsetParent!==this.scrollable.offsetParent;)i+=s.offsetTop,s=s.offsetParent;return i+(null!==(e=null==s?void 0:s.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 K(this.visibleItems,this.visibleItems.map((t=>this.items[t])))),t.has("scrolledToTarget")&&this.scrolledToTarget&&this.dispatchEvent(new R)}}q.styles=P,F([s.property({type:Array})],q.prototype,"items",void 0),F([s.property({attribute:!1})],q.prototype,"renderItem",void 0),F([s.property({type:Object})],q.prototype,"scrollToItem",void 0),F([s.property({type:Number})],q.prototype,"scrollToIndex",void 0),F([s.property({type:Boolean})],q.prototype,"internalScroll",void 0),F([s.property({type:Number})],q.prototype,"renderBeforeFirst",void 0),F([s.property({type:Number})],q.prototype,"renderAfterLast",void 0),F([s.state({hasChanged:(t,e)=>null!=t&&null==e||t.length!==e.length||t[0]!==e[0]})],q.prototype,"visibleItems",void 0),F([s.query(".scrollable")],q.prototype,"internalScrollable",void 0),F([s.query(".items-container")],q.prototype,"itemsContainer",void 0),F([s.state()],q.prototype,"scrolledToTarget",void 0),e.customElement("ft-infinite-scroll")(q);const Z=i.css`
|
|
159
|
+
`;var _=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class H extends a{constructor(){super(...arguments),this.renderTopic=t=>i.html`
|
|
348
160
|
<ft-reader-topic tocId="${t}" .exportpartsPrefix=${"topic"}></ft-reader-topic>
|
|
349
161
|
`,this.renderBeforeFirst=5,this.renderAfterLast=10,this.visibleTopicsDebouncer=new e.Debouncer(100)}render(){var t;return i.html`
|
|
350
162
|
<ft-infinite-scroll class="ft-reader-content"
|
|
@@ -359,4 +171,4 @@ const V=Symbol.for(""),X=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
359
171
|
>
|
|
360
172
|
|
|
361
173
|
</ft-infinite-scroll>
|
|
362
|
-
`}getScrollTarget(){var t,e,i,o
|
|
174
|
+
`}getScrollTarget(){var t,e,i,s,o;const n=null!==(s=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!==s&&s;return!(null===(o=this.scrollTarget)||void 0===o?void 0:o.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())}}H.elementDefinitions={"ft-infinite-scroll":q},H.styles=Z,_([s.property()],H.prototype,"renderTopic",void 0),_([e.redux()],H.prototype,"currentPage",void 0),_([e.redux()],H.prototype,"scrollTarget",void 0),_([e.redux()],H.prototype,"visibleTopics",void 0),_([e.redux()],H.prototype,"renderBeforeFirst",void 0),_([e.redux()],H.prototype,"renderAfterLast",void 0),_([s.query(".ft-reader-content")],H.prototype,"container",void 0),e.customElement("ft-reader-content")(H),t.FtReaderContent=H,t.FtReaderContentCssVariables={},t.styles=Z,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML,ftGlobals.litRepeat);
|