@nanoporetech-digital/components 5.5.1 → 5.5.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/nano-slides.cjs.entry.js +14 -12
  3. package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
  4. package/dist/cjs/{nano-table-884ce575.js → nano-table-265e86b3.js} +2 -2
  5. package/dist/cjs/{nano-table-884ce575.js.map → nano-table-265e86b3.js.map} +1 -1
  6. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  7. package/dist/cjs/{table.worker-670457aa.js → table.worker-4ba19693.js} +2 -2
  8. package/dist/cjs/table.worker-4ba19693.js.map +1 -0
  9. package/dist/collection/components/slides/slides.js +14 -12
  10. package/dist/collection/components/slides/slides.js.map +1 -1
  11. package/dist/components/nano-slides.js +14 -12
  12. package/dist/components/nano-slides.js.map +1 -1
  13. package/dist/esm/nano-slides.entry.js +14 -12
  14. package/dist/esm/nano-slides.entry.js.map +1 -1
  15. package/dist/esm/{nano-table-c6a4e1dc.js → nano-table-2ac76509.js} +2 -2
  16. package/dist/esm/{nano-table-c6a4e1dc.js.map → nano-table-2ac76509.js.map} +1 -1
  17. package/dist/esm/nano-table.entry.js +1 -1
  18. package/dist/esm/{table.worker-2568f20c.js → table.worker-28470fb1.js} +2 -2
  19. package/dist/esm/table.worker-28470fb1.js.map +1 -0
  20. package/dist/nano-components/nano-components.esm.js +1 -1
  21. package/dist/nano-components/{p-f5698b41.js → p-37cb3003.js} +2 -2
  22. package/dist/nano-components/{p-7c4ac519.entry.js → p-4e9125ec.entry.js} +5 -5
  23. package/dist/nano-components/p-4e9125ec.entry.js.map +1 -0
  24. package/dist/nano-components/{p-9a0191c7.entry.js → p-b7f2b048.entry.js} +2 -2
  25. package/dist/nano-components/{p-4ef3200a.js → p-e2e07791.js} +2 -2
  26. package/docs-json.json +1 -1
  27. package/hydrate/index.js +14 -12
  28. package/package.json +2 -2
  29. package/dist/cjs/table.worker-670457aa.js.map +0 -1
  30. package/dist/esm/table.worker-2568f20c.js.map +0 -1
  31. package/dist/nano-components/p-7c4ac519.entry.js.map +0 -1
  32. /package/dist/nano-components/{p-9a0191c7.entry.js.map → p-37cb3003.js.map} +0 -0
  33. /package/dist/nano-components/{p-f5698b41.js.map → p-b7f2b048.entry.js.map} +0 -0
  34. /package/dist/nano-components/{p-4ef3200a.js.map → p-e2e07791.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [5.5.2](https://git.oxfordnanolabs.local/Digital/nano-components/compare/v5.5.1...v5.5.2) (2023-10-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **slides:** SSR render error. Fix parallax scroll when wrapped for real. ([cb80089](https://git.oxfordnanolabs.local/Digital/nano-components/commits/cb80089af4ee12c470a035c4cc51d5d09dc5fc13))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [5.5.1](https://git.oxfordnanolabs.local/Digital/nano-components/compare/v5.5.0...v5.5.1) (2023-09-29)
7
18
 
8
19
 
@@ -3874,21 +3874,20 @@ const Slides = class {
3874
3874
  });
3875
3875
  this.parallax = async () => {
3876
3876
  const flkty = await this.flickity;
3877
- flkty.cells.forEach((el, i) => {
3878
- const cell = el;
3879
- let flkX = flkty.x;
3880
- const shiftedPos = cell.x + flkty.slideableWidth * cell.shift;
3877
+ const cells = flkty.cells;
3878
+ cells.forEach((cell, i) => {
3881
3879
  const ele = this.childrenEles[i];
3880
+ let flkX = flkty.x;
3882
3881
  if (flkty.options.wrapAround && flkty.cells.length > 1) {
3883
3882
  flkX = modulo(flkX, flkty.slideableWidth);
3884
3883
  flkX = flkX - flkty.slideableWidth;
3885
3884
  }
3886
3885
  let x = ((cell.target + flkX) * -1) / 3;
3887
3886
  if (cell.shift < 0) {
3888
- x = x + Math.abs(shiftedPos) * 1.3333;
3887
+ x = ((cell.target - flkty.slideableWidth + flkX) * -1) / 3;
3889
3888
  }
3890
3889
  else if (cell.shift > 0) {
3891
- x = ((cell.target + (flkX + shiftedPos)) * -1) / 3;
3890
+ x = ((cell.target + (flkX + flkty.slideableWidth)) * -1) / 3;
3892
3891
  }
3893
3892
  ele.style.transform = 'translate3d(' + x + 'px, 0, 0)';
3894
3893
  });
@@ -3964,7 +3963,7 @@ const Slides = class {
3964
3963
  this.options = { fade: true, percentPosition: true };
3965
3964
  break;
3966
3965
  case 'parallax':
3967
- this.options = { fade: false, percentPosition: false };
3966
+ this.options = { fade: false, percentPosition: true };
3968
3967
  flkty.on('scroll', this.parallax);
3969
3968
  break;
3970
3969
  default:
@@ -4131,14 +4130,16 @@ const Slides = class {
4131
4130
  const finalOptions = this.normalizeOptions();
4132
4131
  // init flickity core
4133
4132
  await waitForSlides(this.host);
4134
- this.flickityEl.style.height =
4135
- this.flickityEl.getBoundingClientRect().height + 'px';
4136
- this.slidesReady = true;
4137
4133
  this.flickityEl =
4138
4134
  this.flickityEl || this._getRoot().querySelector('.flickity-container');
4139
- if (this.flickityEl &&
4140
- this.flickityEl.classList.contains('flickity-enabled'))
4135
+ if (!this.flickityEl)
4136
+ return;
4137
+ this.slidesReady = true;
4138
+ if (this.flickityEl.classList.contains('flickity-enabled')) {
4141
4139
  this.destroyflickity();
4140
+ }
4141
+ this.flickityEl.style.height =
4142
+ this.flickityEl.getBoundingClientRect().height + 'px';
4142
4143
  setTimeout(() => {
4143
4144
  this.flickityEl.style.height = '';
4144
4145
  const flick = new flickity(this.flickityEl, finalOptions);
@@ -4276,6 +4277,7 @@ const waitForSlides = (host) => {
4276
4277
  if (!toLoadSlides.length) {
4277
4278
  resolve(allSlides);
4278
4279
  host.removeEventListener('nanoSlideReady', slideResolver);
4280
+ host.removeEventListener('nano-slide-ready', slideResolver);
4279
4281
  }
4280
4282
  };
4281
4283
  host.addEventListener('nanoSlideReady', slideResolver);