@eric-emg/symphiq-components 1.2.108 → 1.2.110
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/fesm2022/symphiq-components.mjs +50 -36
- package/fesm2022/symphiq-components.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -24147,62 +24147,76 @@ class FloatingTocComponent {
|
|
|
24147
24147
|
return this.expandedSections().has(sectionId);
|
|
24148
24148
|
}
|
|
24149
24149
|
scrollToSection(sectionId) {
|
|
24150
|
+
console.log('[FloatingTOC] scrollToSection called', {
|
|
24151
|
+
sectionId,
|
|
24152
|
+
embedded: this.embedded,
|
|
24153
|
+
hasScrollElement: !!this.scrollElement,
|
|
24154
|
+
scrollElementTag: this.scrollElement?.tagName,
|
|
24155
|
+
hasContainerElement: !!this.containerElement,
|
|
24156
|
+
containerElementTag: this.containerElement?.tagName,
|
|
24157
|
+
parentHeaderOffset: this.parentHeaderOffset
|
|
24158
|
+
});
|
|
24150
24159
|
const element = document.getElementById(`section-${sectionId}`);
|
|
24160
|
+
console.log('[FloatingTOC] Target element', {
|
|
24161
|
+
elementId: `section-${sectionId}`,
|
|
24162
|
+
found: !!element,
|
|
24163
|
+
elementRect: element?.getBoundingClientRect(),
|
|
24164
|
+
elementOffsetTop: element?.offsetTop,
|
|
24165
|
+
elementOffsetParent: element?.offsetParent?.tagName
|
|
24166
|
+
});
|
|
24151
24167
|
if (element) {
|
|
24152
|
-
|
|
24153
|
-
|
|
24154
|
-
|
|
24155
|
-
|
|
24156
|
-
|
|
24157
|
-
this.scrollElement.scrollTo({
|
|
24158
|
-
top: offsetPosition,
|
|
24159
|
-
behavior: 'smooth'
|
|
24160
|
-
});
|
|
24161
|
-
}
|
|
24162
|
-
else {
|
|
24163
|
-
const elementPosition = element.getBoundingClientRect().top + window.scrollY;
|
|
24164
|
-
const offsetPosition = elementPosition - this.HEADER_OFFSET;
|
|
24165
|
-
window.scrollTo({
|
|
24166
|
-
top: offsetPosition,
|
|
24167
|
-
behavior: 'smooth'
|
|
24168
|
-
});
|
|
24169
|
-
}
|
|
24168
|
+
console.log('[FloatingTOC] Calling scrollIntoView on element');
|
|
24169
|
+
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
24170
|
+
}
|
|
24171
|
+
else {
|
|
24172
|
+
console.warn('[FloatingTOC] Element not found for section:', sectionId);
|
|
24170
24173
|
}
|
|
24171
24174
|
if (!this.isPinned()) {
|
|
24172
24175
|
this.isHovered.set(false);
|
|
24173
24176
|
}
|
|
24174
24177
|
}
|
|
24175
24178
|
scrollToSubsection(subsectionId) {
|
|
24179
|
+
console.log('[FloatingTOC] scrollToSubsection called', {
|
|
24180
|
+
subsectionId,
|
|
24181
|
+
embedded: this.embedded,
|
|
24182
|
+
hasScrollElement: !!this.scrollElement,
|
|
24183
|
+
scrollElementTag: this.scrollElement?.tagName,
|
|
24184
|
+
hasContainerElement: !!this.containerElement,
|
|
24185
|
+
containerElementTag: this.containerElement?.tagName,
|
|
24186
|
+
parentHeaderOffset: this.parentHeaderOffset
|
|
24187
|
+
});
|
|
24176
24188
|
const element = document.getElementById(`subsection-${subsectionId}`);
|
|
24189
|
+
console.log('[FloatingTOC] Target element', {
|
|
24190
|
+
elementId: `subsection-${subsectionId}`,
|
|
24191
|
+
found: !!element,
|
|
24192
|
+
elementRect: element?.getBoundingClientRect(),
|
|
24193
|
+
elementOffsetTop: element?.offsetTop,
|
|
24194
|
+
elementOffsetParent: element?.offsetParent?.tagName
|
|
24195
|
+
});
|
|
24177
24196
|
if (element) {
|
|
24178
|
-
|
|
24179
|
-
|
|
24180
|
-
|
|
24181
|
-
|
|
24182
|
-
|
|
24183
|
-
this.scrollElement.scrollTo({
|
|
24184
|
-
top: offsetPosition,
|
|
24185
|
-
behavior: 'smooth'
|
|
24186
|
-
});
|
|
24187
|
-
}
|
|
24188
|
-
else {
|
|
24189
|
-
const elementPosition = element.getBoundingClientRect().top + window.scrollY;
|
|
24190
|
-
const offsetPosition = elementPosition - this.HEADER_OFFSET;
|
|
24191
|
-
window.scrollTo({
|
|
24192
|
-
top: offsetPosition,
|
|
24193
|
-
behavior: 'smooth'
|
|
24194
|
-
});
|
|
24195
|
-
}
|
|
24197
|
+
console.log('[FloatingTOC] Calling scrollIntoView on element');
|
|
24198
|
+
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
24199
|
+
}
|
|
24200
|
+
else {
|
|
24201
|
+
console.warn('[FloatingTOC] Element not found for subsection:', subsectionId);
|
|
24196
24202
|
}
|
|
24197
24203
|
if (!this.isPinned()) {
|
|
24198
24204
|
this.isHovered.set(false);
|
|
24199
24205
|
}
|
|
24200
24206
|
}
|
|
24201
24207
|
scrollToTop() {
|
|
24208
|
+
console.log('[FloatingTOC] scrollToTop called', {
|
|
24209
|
+
embedded: this.embedded,
|
|
24210
|
+
hasScrollElement: !!this.scrollElement,
|
|
24211
|
+
scrollElementTag: this.scrollElement?.tagName,
|
|
24212
|
+
scrollElementScrollTop: this.scrollElement?.scrollTop
|
|
24213
|
+
});
|
|
24202
24214
|
if (this.embedded && this.scrollElement) {
|
|
24215
|
+
console.log('[FloatingTOC] Scrolling scrollElement to top');
|
|
24203
24216
|
this.scrollElement.scrollTo({ top: 0, behavior: 'smooth' });
|
|
24204
24217
|
}
|
|
24205
24218
|
else {
|
|
24219
|
+
console.log('[FloatingTOC] Scrolling window to top');
|
|
24206
24220
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
24207
24221
|
}
|
|
24208
24222
|
if (!this.isPinned()) {
|