${this.edit || this.isAttachment
? nothing
: html`
${this.componentFeatures?.allowsFeature(Feature.Comments)
? html`
`
: nothing}
${this.componentFeatures?.allowsFeature(Feature.Versions)
? html`
`
: nothing}
`}
{
if (refElement) {
this.swipeScrollElement = refElement;
}
})}
part="wy-preview-swiper ${partMap(previewSwiperParts)}"
>
${repeat(
previewFiles,
(previewFile) => "preview-area-" + previewFile?.id,
(previewFile) => {
const isCurrent = previewFile === this.currentVersionFile;
const currentPreviewFileCallback = (refElement: Element | undefined) => {
refElement?.scrollIntoView();
requestAnimationFrame(() => refElement?.scrollIntoView());
};
const previewFileRef = isCurrent
? currentPreviewFileCallback
: previewFile === this.nextFile
? this.nextRef
: previewFile === this.previousFile
? this.prevRef
: undefined;
const fileLoadingState = this.loadingQueue.find((fls) => fls.file === previewFile);
return previewFile
? html`
${!isPending &&
(fileLoadingState?.loading || fileLoadingState?.loaded || (isCurrent && editCurrent))
? html`
this.updateLoadingState(e.detail.file, { loaded: true })}
>
`
: html` `}
`
: nothing;
},
)}
${this.currentFile && !this.edit
? html`
${this.previousFile
? html`
`
: nothing}
${this.nextFile
? html`
`
: nothing}
`
: nothing}