@nanoporetech-digital/components 5.5.2 → 5.6.0

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 (39) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/nano-slides.cjs.entry.js +14 -2
  3. package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
  4. package/dist/cjs/{nano-table-265e86b3.js → nano-table-4f7bee74.js} +2 -2
  5. package/dist/cjs/{nano-table-265e86b3.js.map → nano-table-4f7bee74.js.map} +1 -1
  6. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  7. package/dist/cjs/{table.worker-4ba19693.js → table.worker-40cb9711.js} +2 -2
  8. package/dist/cjs/table.worker-40cb9711.js.map +1 -0
  9. package/dist/collection/components/slides/slides-interface.js.map +1 -1
  10. package/dist/collection/components/slides/slides.js +16 -4
  11. package/dist/collection/components/slides/slides.js.map +1 -1
  12. package/dist/components/nano-slides.js +14 -2
  13. package/dist/components/nano-slides.js.map +1 -1
  14. package/dist/esm/nano-slides.entry.js +14 -2
  15. package/dist/esm/nano-slides.entry.js.map +1 -1
  16. package/dist/esm/{nano-table-2ac76509.js → nano-table-1a47793e.js} +2 -2
  17. package/dist/esm/{nano-table-2ac76509.js.map → nano-table-1a47793e.js.map} +1 -1
  18. package/dist/esm/nano-table.entry.js +1 -1
  19. package/dist/esm/{table.worker-28470fb1.js → table.worker-b4d2b9f2.js} +2 -2
  20. package/dist/esm/table.worker-b4d2b9f2.js.map +1 -0
  21. package/dist/nano-components/nano-components.esm.js +1 -1
  22. package/dist/nano-components/{p-37cb3003.js → p-4764da42.js} +2 -2
  23. package/dist/nano-components/{p-e2e07791.js → p-47e84d30.js} +2 -2
  24. package/dist/nano-components/{p-4e9125ec.entry.js → p-6106c383.entry.js} +3 -3
  25. package/dist/nano-components/p-6106c383.entry.js.map +1 -0
  26. package/dist/nano-components/{p-b7f2b048.entry.js → p-db9325e8.entry.js} +2 -2
  27. package/dist/types/components/slides/slides-interface.d.ts +1 -1
  28. package/dist/types/components/slides/slides.d.ts +1 -1
  29. package/dist/types/components.d.ts +2 -2
  30. package/docs-json.json +6 -3
  31. package/docs-vscode.json +1 -1
  32. package/hydrate/index.js +14 -2
  33. package/package.json +2 -2
  34. package/dist/cjs/table.worker-4ba19693.js.map +0 -1
  35. package/dist/esm/table.worker-28470fb1.js.map +0 -1
  36. package/dist/nano-components/p-4e9125ec.entry.js.map +0 -1
  37. /package/dist/nano-components/{p-37cb3003.js.map → p-4764da42.js.map} +0 -0
  38. /package/dist/nano-components/{p-e2e07791.js.map → p-47e84d30.js.map} +0 -0
  39. /package/dist/nano-components/{p-b7f2b048.entry.js.map → p-db9325e8.entry.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
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.6.0](https://git.oxfordnanolabs.local/Digital/nano-components/compare/v5.5.3...v5.6.0) (2023-10-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **slides:** only apply parallax animation to first slide child element ([54764a6](https://git.oxfordnanolabs.local/Digital/nano-components/commits/54764a62c658910164086c6a9ad34f594f8468bb))
12
+
13
+
14
+ ### Features
15
+
16
+ * **slides:** allow for custom animation function ([36d9932](https://git.oxfordnanolabs.local/Digital/nano-components/commits/36d993203e7fb4ff1524aa7ea6ccf176d27dd2c5))
17
+
18
+
19
+
20
+
21
+
22
+ ## [5.5.3](https://git.oxfordnanolabs.local/Digital/nano-components/compare/v5.5.2...v5.5.3) (2023-10-04)
23
+
24
+ **Note:** Version bump only for package @nanoporetech-digital/components
25
+
26
+
27
+
28
+
29
+
6
30
  ## [5.5.2](https://git.oxfordnanolabs.local/Digital/nano-components/compare/v5.5.1...v5.5.2) (2023-10-03)
7
31
 
8
32
 
@@ -3875,8 +3875,8 @@ const Slides = class {
3875
3875
  this.parallax = async () => {
3876
3876
  const flkty = await this.flickity;
3877
3877
  const cells = flkty.cells;
3878
- cells.forEach((cell, i) => {
3879
- const ele = this.childrenEles[i];
3878
+ cells.forEach((cell) => {
3879
+ const ele = cell.element.children[0];
3880
3880
  let flkX = flkty.x;
3881
3881
  if (flkty.options.wrapAround && flkty.cells.length > 1) {
3882
3882
  flkX = modulo(flkX, flkty.slideableWidth);
@@ -3890,6 +3890,8 @@ const Slides = class {
3890
3890
  x = ((cell.target + (flkX + flkty.slideableWidth)) * -1) / 3;
3891
3891
  }
3892
3892
  ele.style.transform = 'translate3d(' + x + 'px, 0, 0)';
3893
+ const animAmount = ((x * 3) / cell.size.width) * 100;
3894
+ cell.element.style.setProperty('--animation-amount', animAmount.toString());
3893
3895
  });
3894
3896
  };
3895
3897
  this.handleFullscreen = (isFullScreen) => {
@@ -3957,6 +3959,16 @@ const Slides = class {
3957
3959
  });
3958
3960
  this.update();
3959
3961
  }
3962
+ // was a custom animation
3963
+ if (typeof oldAnim === 'function') {
3964
+ flkty.off('scroll', oldAnim);
3965
+ }
3966
+ // is a custom animation
3967
+ if (typeof this.animation === 'function') {
3968
+ this.options = { fade: false, percentPosition: true };
3969
+ flkty.on('scroll', this.animation);
3970
+ return;
3971
+ }
3960
3972
  // setup new stuff
3961
3973
  switch (this.animation) {
3962
3974
  case 'fade':