@nanoporetech-digital/components 5.5.3 → 5.7.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-382f010e.js → nano-table-e0a0c40f.js} +2 -2
  5. package/dist/cjs/{nano-table-382f010e.js.map → nano-table-e0a0c40f.js.map} +1 -1
  6. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  7. package/dist/cjs/{table.worker-b62ccd2d.js → table.worker-249333f1.js} +2 -2
  8. package/dist/cjs/table.worker-249333f1.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-b1bc144b.js → nano-table-d769b1dd.js} +2 -2
  17. package/dist/esm/{nano-table-b1bc144b.js.map → nano-table-d769b1dd.js.map} +1 -1
  18. package/dist/esm/nano-table.entry.js +1 -1
  19. package/dist/esm/{table.worker-3df85088.js → table.worker-cb6af8ab.js} +2 -2
  20. package/dist/esm/table.worker-cb6af8ab.js.map +1 -0
  21. package/dist/nano-components/nano-components.esm.js +1 -1
  22. package/dist/nano-components/{p-043e539a.js → p-3018d4df.js} +2 -2
  23. package/dist/nano-components/{p-4e9125ec.entry.js → p-6106c383.entry.js} +3 -3
  24. package/dist/nano-components/p-6106c383.entry.js.map +1 -0
  25. package/dist/nano-components/{p-2a12fde7.entry.js → p-6ae6d4a6.entry.js} +2 -2
  26. package/dist/nano-components/{p-4c183b4b.js → p-94b4479b.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-b62ccd2d.js.map +0 -1
  35. package/dist/esm/table.worker-3df85088.js.map +0 -1
  36. package/dist/nano-components/p-4e9125ec.entry.js.map +0 -1
  37. /package/dist/nano-components/{p-043e539a.js.map → p-3018d4df.js.map} +0 -0
  38. /package/dist/nano-components/{p-2a12fde7.entry.js.map → p-6ae6d4a6.entry.js.map} +0 -0
  39. /package/dist/nano-components/{p-4c183b4b.js.map → p-94b4479b.js.map} +0 -0
package/docs-json.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-10-04T15:37:36",
2
+ "timestamp": "2023-10-09T22:13:52",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "2.23.1",
@@ -13692,11 +13692,11 @@
13692
13692
  "props": [
13693
13693
  {
13694
13694
  "name": "animation",
13695
- "type": "\"fade\" | \"parallax\" | \"scroll\"",
13695
+ "type": "\"fade\" | \"parallax\" | \"scroll\" | (() => void)",
13696
13696
  "mutable": false,
13697
13697
  "attr": "animation",
13698
13698
  "reflectToAttr": true,
13699
- "docs": "Animation presets.",
13699
+ "docs": "Animation presets or your own custom animation function; called every frame during scroll",
13700
13700
  "docsTags": [],
13701
13701
  "default": "'scroll'",
13702
13702
  "values": [
@@ -13711,6 +13711,9 @@
13711
13711
  {
13712
13712
  "value": "scroll",
13713
13713
  "type": "string"
13714
+ },
13715
+ {
13716
+ "type": "(() => void)"
13714
13717
  }
13715
13718
  ],
13716
13719
  "optional": false,
package/docs-vscode.json CHANGED
@@ -2463,7 +2463,7 @@
2463
2463
  "attributes": [
2464
2464
  {
2465
2465
  "name": "animation",
2466
- "description": "Animation presets.",
2466
+ "description": "Animation presets or your own custom animation function; called every frame during scroll",
2467
2467
  "values": [
2468
2468
  {
2469
2469
  "name": "fade"
package/hydrate/index.js CHANGED
@@ -26169,8 +26169,8 @@ class Slides {
26169
26169
  this.parallax = async () => {
26170
26170
  const flkty = await this.flickity;
26171
26171
  const cells = flkty.cells;
26172
- cells.forEach((cell, i) => {
26173
- const ele = this.childrenEles[i];
26172
+ cells.forEach((cell) => {
26173
+ const ele = cell.element.children[0];
26174
26174
  let flkX = flkty.x;
26175
26175
  if (flkty.options.wrapAround && flkty.cells.length > 1) {
26176
26176
  flkX = modulo(flkX, flkty.slideableWidth);
@@ -26184,6 +26184,8 @@ class Slides {
26184
26184
  x = ((cell.target + (flkX + flkty.slideableWidth)) * -1) / 3;
26185
26185
  }
26186
26186
  ele.style.transform = 'translate3d(' + x + 'px, 0, 0)';
26187
+ const animAmount = ((x * 3) / cell.size.width) * 100;
26188
+ cell.element.style.setProperty('--animation-amount', animAmount.toString());
26187
26189
  });
26188
26190
  };
26189
26191
  this.handleFullscreen = (isFullScreen) => {
@@ -26251,6 +26253,16 @@ class Slides {
26251
26253
  });
26252
26254
  this.update();
26253
26255
  }
26256
+ // was a custom animation
26257
+ if (typeof oldAnim === 'function') {
26258
+ flkty.off('scroll', oldAnim);
26259
+ }
26260
+ // is a custom animation
26261
+ if (typeof this.animation === 'function') {
26262
+ this.options = { fade: false, percentPosition: true };
26263
+ flkty.on('scroll', this.animation);
26264
+ return;
26265
+ }
26254
26266
  // setup new stuff
26255
26267
  switch (this.animation) {
26256
26268
  case 'fade':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanoporetech-digital/components",
3
- "version": "5.5.3",
3
+ "version": "5.7.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://git.oxfordnanolabs.local/Digital/nano-components"
@@ -131,7 +131,7 @@
131
131
  "nanopore",
132
132
  "digital"
133
133
  ],
134
- "gitHead": "ea9b056e2ff6933d4da8b1785d0027c4c9f06853",
134
+ "gitHead": "1a54e7d34a188d439757541b7c190b1fd51c62b7",
135
135
  "volta": {
136
136
  "node": "14.18.1",
137
137
  "npm": "8.6.0"
@@ -1 +0,0 @@
1
- {"file":"table.worker-b62ccd2d.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1 +0,0 @@
1
- {"file":"table.worker-3df85088.js","mappings":";;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}