@nanoporetech-digital/components 5.5.0 → 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 (38) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/nano-slides.cjs.entry.js +19 -15
  3. package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
  4. package/dist/cjs/{nano-table-6abb323d.js → nano-table-265e86b3.js} +2 -2
  5. package/dist/cjs/{nano-table-6abb323d.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-20dc920c.js → table.worker-4ba19693.js} +2 -2
  8. package/dist/cjs/table.worker-4ba19693.js.map +1 -0
  9. package/dist/collection/components/slides/lib/js/prev-next-button.js +5 -0
  10. package/dist/collection/components/slides/slides.js +14 -15
  11. package/dist/collection/components/slides/slides.js.map +1 -1
  12. package/dist/components/nano-slides.js +19 -15
  13. package/dist/components/nano-slides.js.map +1 -1
  14. package/dist/esm/nano-slides.entry.js +19 -15
  15. package/dist/esm/nano-slides.entry.js.map +1 -1
  16. package/dist/esm/{nano-table-f234ca94.js → nano-table-2ac76509.js} +2 -2
  17. package/dist/esm/{nano-table-f234ca94.js.map → nano-table-2ac76509.js.map} +1 -1
  18. package/dist/esm/nano-table.entry.js +1 -1
  19. package/dist/esm/{table.worker-cb4d4ab8.js → table.worker-28470fb1.js} +2 -2
  20. package/dist/esm/table.worker-28470fb1.js.map +1 -0
  21. package/dist/nano-components/nano-components.esm.js +1 -1
  22. package/dist/nano-components/p-37cb3003.js +5 -0
  23. package/dist/nano-components/p-4e9125ec.entry.js +23 -0
  24. package/dist/nano-components/p-4e9125ec.entry.js.map +1 -0
  25. package/dist/nano-components/{p-47b7a81d.entry.js → p-b7f2b048.entry.js} +2 -2
  26. package/dist/nano-components/{p-c6ee778e.js → p-e2e07791.js} +2 -2
  27. package/dist/types/components/slides/slides.d.ts +1 -3
  28. package/docs-json.json +1 -1
  29. package/hydrate/index.js +19 -15
  30. package/package.json +2 -2
  31. package/dist/cjs/table.worker-20dc920c.js.map +0 -1
  32. package/dist/esm/table.worker-cb4d4ab8.js.map +0 -1
  33. package/dist/nano-components/p-0b03cb52.entry.js +0 -23
  34. package/dist/nano-components/p-0b03cb52.entry.js.map +0 -1
  35. package/dist/nano-components/p-5c493505.js +0 -5
  36. /package/dist/nano-components/{p-47b7a81d.entry.js.map → p-37cb3003.js.map} +0 -0
  37. /package/dist/nano-components/{p-5c493505.js.map → p-b7f2b048.entry.js.map} +0 -0
  38. /package/dist/nano-components/{p-c6ee778e.js.map → p-e2e07791.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
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
+
17
+ ## [5.5.1](https://git.oxfordnanolabs.local/Digital/nano-components/compare/v5.5.0...v5.5.1) (2023-09-29)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **slides:** remove stencil applied hidden attribute to slotted next/prev buttons ([9a9ff09](https://git.oxfordnanolabs.local/Digital/nano-components/commits/9a9ff0925d4b47cdd6c5a5367f273e1466d2478f))
23
+ * **slides:** wrap around slides not being adjusted during parallax animation ([feadf52](https://git.oxfordnanolabs.local/Digital/nano-components/commits/feadf52a14802b98ca1e4df6d2aae8670e6b927d))
24
+
25
+
26
+
27
+
28
+
6
29
  # [5.5.0](https://git.oxfordnanolabs.local/Digital/nano-components/compare/v5.4.2...v5.5.0) (2023-09-28)
7
30
 
8
31
 
@@ -2762,6 +2762,11 @@ PrevNextButton.prototype._create = function () {
2762
2762
  const slot = document.createElement('slot');
2763
2763
  slot.name = this.isPrevious ? 'previous-icon' : 'next-icon';
2764
2764
  button.appendChild(slot);
2765
+ slot.addEventListener('slotchange', () => {
2766
+ slot.assignedElements({ flatten: true }).forEach((ele) => {
2767
+ ele.removeAttribute('hidden');
2768
+ });
2769
+ });
2765
2770
 
2766
2771
  // create arrow
2767
2772
  var svg = this.createSVG();
@@ -3869,9 +3874,8 @@ const Slides = class {
3869
3874
  });
3870
3875
  this.parallax = async () => {
3871
3876
  const flkty = await this.flickity;
3872
- flkty.cells.forEach((el, i) => {
3873
- const cell = el;
3874
- const shiftedPos = cell.x + flkty.slideableWidth * cell.shift;
3877
+ const cells = flkty.cells;
3878
+ cells.forEach((cell, i) => {
3875
3879
  const ele = this.childrenEles[i];
3876
3880
  let flkX = flkty.x;
3877
3881
  if (flkty.options.wrapAround && flkty.cells.length > 1) {
@@ -3880,13 +3884,12 @@ const Slides = class {
3880
3884
  }
3881
3885
  let x = ((cell.target + flkX) * -1) / 3;
3882
3886
  if (cell.shift < 0) {
3883
- x = x + Math.abs(shiftedPos);
3887
+ x = ((cell.target - flkty.slideableWidth + flkX) * -1) / 3;
3884
3888
  }
3885
3889
  else if (cell.shift > 0) {
3886
- x = ((cell.target + (flkX + shiftedPos)) * -1) / 3;
3890
+ x = ((cell.target + (flkX + flkty.slideableWidth)) * -1) / 3;
3887
3891
  }
3888
3892
  ele.style.transform = 'translate3d(' + x + 'px, 0, 0)';
3889
- // 'translateX(' + x + 'px)';
3890
3893
  });
3891
3894
  };
3892
3895
  this.handleFullscreen = (isFullScreen) => {
@@ -3960,7 +3963,7 @@ const Slides = class {
3960
3963
  this.options = { fade: true, percentPosition: true };
3961
3964
  break;
3962
3965
  case 'parallax':
3963
- this.options = { fade: false, percentPosition: false };
3966
+ this.options = { fade: false, percentPosition: true };
3964
3967
  flkty.on('scroll', this.parallax);
3965
3968
  break;
3966
3969
  default:
@@ -4069,9 +4072,7 @@ const Slides = class {
4069
4072
  this.options = { autoPlay: time };
4070
4073
  setTimeout(() => flickity.playPlayer());
4071
4074
  }
4072
- /**
4073
- * Stop auto play.
4074
- */
4075
+ /** Stop auto play. */
4075
4076
  async stopAutoplay() {
4076
4077
  const flickity = await this.getflickity();
4077
4078
  flickity.stopPlayer();
@@ -4129,14 +4130,16 @@ const Slides = class {
4129
4130
  const finalOptions = this.normalizeOptions();
4130
4131
  // init flickity core
4131
4132
  await waitForSlides(this.host);
4132
- this.flickityEl.style.height =
4133
- this.flickityEl.getBoundingClientRect().height + 'px';
4134
- this.slidesReady = true;
4135
4133
  this.flickityEl =
4136
4134
  this.flickityEl || this._getRoot().querySelector('.flickity-container');
4137
- if (this.flickityEl &&
4138
- this.flickityEl.classList.contains('flickity-enabled'))
4135
+ if (!this.flickityEl)
4136
+ return;
4137
+ this.slidesReady = true;
4138
+ if (this.flickityEl.classList.contains('flickity-enabled')) {
4139
4139
  this.destroyflickity();
4140
+ }
4141
+ this.flickityEl.style.height =
4142
+ this.flickityEl.getBoundingClientRect().height + 'px';
4140
4143
  setTimeout(() => {
4141
4144
  this.flickityEl.style.height = '';
4142
4145
  const flick = new flickity(this.flickityEl, finalOptions);
@@ -4274,6 +4277,7 @@ const waitForSlides = (host) => {
4274
4277
  if (!toLoadSlides.length) {
4275
4278
  resolve(allSlides);
4276
4279
  host.removeEventListener('nanoSlideReady', slideResolver);
4280
+ host.removeEventListener('nano-slide-ready', slideResolver);
4277
4281
  }
4278
4282
  };
4279
4283
  host.addEventListener('nanoSlideReady', slideResolver);