@getflip/swirl-components 0.174.0 → 0.174.2
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/components.json +1 -1
- package/dist/cjs/swirl-file-viewer_7.cjs.entry.js +7 -3
- package/dist/cjs/swirl-lightbox.cjs.entry.js +3 -6
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-pdf/swirl-file-viewer-pdf.js +7 -3
- package/dist/collection/components/swirl-lightbox/swirl-lightbox.js +3 -6
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-file-viewer-pdf2.js +7 -3
- package/dist/components/swirl-lightbox.js +3 -6
- package/dist/esm/swirl-file-viewer_7.entry.js +7 -3
- package/dist/esm/swirl-lightbox.entry.js +3 -6
- package/dist/swirl-components/p-443e8a4b.entry.js +1 -0
- package/dist/swirl-components/{p-47ff9c93.entry.js → p-775f5bab.entry.js} +3 -3
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-file-viewer/viewers/swirl-file-viewer-pdf/swirl-file-viewer-pdf.d.ts +1 -0
- package/dist/types/components/swirl-lightbox/swirl-lightbox.d.ts +1 -2
- package/package.json +1 -1
- package/dist/swirl-components/p-40a683a8.entry.js +0 -1
package/components.json
CHANGED
|
@@ -29886,11 +29886,14 @@ const SwirlFileViewerPdf = class {
|
|
|
29886
29886
|
}
|
|
29887
29887
|
async componentWillLoad() {
|
|
29888
29888
|
window.pdf.GlobalWorkerOptions.workerSrc = this.workerSrc;
|
|
29889
|
-
await this.getPages();
|
|
29890
29889
|
}
|
|
29891
29890
|
async componentDidLoad() {
|
|
29891
|
+
await this.getPages();
|
|
29892
29892
|
await this.updateVisiblePages();
|
|
29893
29893
|
this.activate.emit(this.el);
|
|
29894
|
+
}
|
|
29895
|
+
componentDidRender() {
|
|
29896
|
+
this.updateVisiblePages();
|
|
29894
29897
|
this.determineScrollStatus();
|
|
29895
29898
|
}
|
|
29896
29899
|
disconnectedCallback() {
|
|
@@ -29982,10 +29985,11 @@ const SwirlFileViewerPdf = class {
|
|
|
29982
29985
|
this.doc.destroy();
|
|
29983
29986
|
}
|
|
29984
29987
|
this.doc = await pdf.getDocument(this.file).promise;
|
|
29988
|
+
const pages = [];
|
|
29985
29989
|
for (let i = 1; i <= this.doc.numPages; i++) {
|
|
29986
|
-
|
|
29987
|
-
this.pages[i] = page;
|
|
29990
|
+
pages.push(this.doc.getPage(i));
|
|
29988
29991
|
}
|
|
29992
|
+
this.pages = await Promise.all(pages);
|
|
29989
29993
|
this.loading = false;
|
|
29990
29994
|
}
|
|
29991
29995
|
catch (e) {
|
|
@@ -14,7 +14,6 @@ const SwirlLightbox = class {
|
|
|
14
14
|
constructor(hostRef) {
|
|
15
15
|
index.registerInstance(this, hostRef);
|
|
16
16
|
this.dragging = false;
|
|
17
|
-
this.mediaPlayers = [];
|
|
18
17
|
this.onCloseButtonClick = () => {
|
|
19
18
|
this.close();
|
|
20
19
|
};
|
|
@@ -31,7 +30,6 @@ const SwirlLightbox = class {
|
|
|
31
30
|
this.registerSlides = () => {
|
|
32
31
|
this.slides = Array.from(this.el.children).filter((el) => el.tagName === "SWIRL-FILE-VIEWER");
|
|
33
32
|
this.setSlideAttributes();
|
|
34
|
-
this.updateMediaPlayers();
|
|
35
33
|
};
|
|
36
34
|
this.onPointerDown = (event) => {
|
|
37
35
|
this.dragging = true;
|
|
@@ -186,7 +184,6 @@ const SwirlLightbox = class {
|
|
|
186
184
|
});
|
|
187
185
|
}, 300);
|
|
188
186
|
this.stopAllMediaPlayers();
|
|
189
|
-
this.updateMediaPlayers();
|
|
190
187
|
this.resetImageZoom();
|
|
191
188
|
}
|
|
192
189
|
setSlideAttributes() {
|
|
@@ -217,12 +214,12 @@ const SwirlLightbox = class {
|
|
|
217
214
|
unlockBodyScroll() {
|
|
218
215
|
bodyScrollLock_esm.enableBodyScroll(this.el);
|
|
219
216
|
}
|
|
220
|
-
|
|
217
|
+
getMediaPlayers() {
|
|
221
218
|
const mediaPlayers = utils.querySelectorAllDeep(this.el, "video");
|
|
222
|
-
|
|
219
|
+
return mediaPlayers;
|
|
223
220
|
}
|
|
224
221
|
stopAllMediaPlayers() {
|
|
225
|
-
this.
|
|
222
|
+
this.getMediaPlayers().forEach((mediaPlayer) => mediaPlayer.pause());
|
|
226
223
|
}
|
|
227
224
|
resetImageZoom() {
|
|
228
225
|
this.slides.forEach((slide) => {
|