@getflip/swirl-components 0.174.1 → 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 CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2024-03-22T09:16:02",
2
+ "timestamp": "2024-03-22T10:43:45",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "3.3.1",
@@ -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
- const page = await this.doc.getPage(i);
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) {
@@ -45,11 +45,14 @@ export class SwirlFileViewerPdf {
45
45
  }
46
46
  async componentWillLoad() {
47
47
  window.pdf.GlobalWorkerOptions.workerSrc = this.workerSrc;
48
- await this.getPages();
49
48
  }
50
49
  async componentDidLoad() {
50
+ await this.getPages();
51
51
  await this.updateVisiblePages();
52
52
  this.activate.emit(this.el);
53
+ }
54
+ componentDidRender() {
55
+ this.updateVisiblePages();
53
56
  this.determineScrollStatus();
54
57
  }
55
58
  disconnectedCallback() {
@@ -141,10 +144,11 @@ export class SwirlFileViewerPdf {
141
144
  this.doc.destroy();
142
145
  }
143
146
  this.doc = await getDocument(this.file).promise;
147
+ const pages = [];
144
148
  for (let i = 1; i <= this.doc.numPages; i++) {
145
- const page = await this.doc.getPage(i);
146
- this.pages[i] = page;
149
+ pages.push(this.doc.getPage(i));
147
150
  }
151
+ this.pages = await Promise.all(pages);
148
152
  this.loading = false;
149
153
  }
150
154
  catch (e) {