lido-player 0.0.2-alpha-6 → 0.0.2-alpha-8

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 (86) hide show
  1. package/dist/cjs/index.cjs.js +1 -1
  2. package/dist/cjs/lido-avatar_13.cjs.entry.js +32 -6
  3. package/dist/cjs/lido-avatar_13.cjs.entry.js.map +1 -1
  4. package/dist/cjs/lido-player.cjs.js +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/{utils-4ace217f.js → utils-1697a6b5.js} +90 -24
  7. package/dist/cjs/utils-1697a6b5.js.map +1 -0
  8. package/dist/collection/components/container/lido-container.js +45 -5
  9. package/dist/collection/components/container/lido-container.js.map +1 -1
  10. package/dist/collection/components/home/lido-home.js +21 -2
  11. package/dist/collection/components/home/lido-home.js.map +1 -1
  12. package/dist/collection/components/root/assets/xmlData.xml +412 -370
  13. package/dist/collection/utils/css/animation.css +28 -1
  14. package/dist/collection/utils/utils.js +92 -26
  15. package/dist/collection/utils/utils.js.map +1 -1
  16. package/dist/components/index.js +1 -1
  17. package/dist/components/lido-avatar.js +1 -1
  18. package/dist/components/lido-col.js +1 -1
  19. package/dist/components/lido-container.js +1 -1
  20. package/dist/components/lido-home.js +1 -1
  21. package/dist/components/lido-image.js +1 -1
  22. package/dist/components/lido-pos.js +1 -1
  23. package/dist/components/lido-root.js +11 -11
  24. package/dist/components/lido-row.js +1 -1
  25. package/dist/components/lido-shape.js +1 -1
  26. package/dist/components/lido-text.js +1 -1
  27. package/dist/components/lido-trace.js +1 -1
  28. package/dist/components/lido-wrap.js +1 -1
  29. package/dist/components/{p-e358a2a0.js → p-3480a7c0.js} +2 -2
  30. package/dist/components/{p-e358a2a0.js.map → p-3480a7c0.js.map} +1 -1
  31. package/dist/components/{p-d35a77e7.js → p-39529ce4.js} +2 -2
  32. package/dist/components/{p-d35a77e7.js.map → p-39529ce4.js.map} +1 -1
  33. package/dist/components/{p-30f9bddd.js → p-3bc100c1.js} +90 -24
  34. package/dist/components/p-3bc100c1.js.map +1 -0
  35. package/dist/components/{p-582f47c6.js → p-478edfe0.js} +2 -2
  36. package/dist/components/{p-582f47c6.js.map → p-478edfe0.js.map} +1 -1
  37. package/dist/components/{p-a8b9f142.js → p-9770a2f4.js} +2 -2
  38. package/dist/components/{p-a8b9f142.js.map → p-9770a2f4.js.map} +1 -1
  39. package/dist/components/{p-946049d8.js → p-c6e1e344.js} +17 -15
  40. package/dist/components/p-c6e1e344.js.map +1 -0
  41. package/dist/components/{p-e994620a.js → p-ca70ca24.js} +2 -2
  42. package/dist/components/{p-e994620a.js.map → p-ca70ca24.js.map} +1 -1
  43. package/dist/components/{p-2bf37db5.js → p-ce503b4f.js} +2 -2
  44. package/dist/components/{p-2bf37db5.js.map → p-ce503b4f.js.map} +1 -1
  45. package/dist/components/{p-9d05debc.js → p-d00a96d0.js} +2 -2
  46. package/dist/components/{p-9d05debc.js.map → p-d00a96d0.js.map} +1 -1
  47. package/dist/components/{p-ed3f367a.js → p-e1f46793.js} +30 -4
  48. package/dist/components/p-e1f46793.js.map +1 -0
  49. package/dist/components/{p-e4eaf007.js → p-e60bca47.js} +2 -2
  50. package/dist/components/{p-e4eaf007.js.map → p-e60bca47.js.map} +1 -1
  51. package/dist/components/{p-d550370a.js → p-e6122599.js} +2 -2
  52. package/dist/components/{p-d550370a.js.map → p-e6122599.js.map} +1 -1
  53. package/dist/esm/index.js +1 -1
  54. package/dist/esm/lido-avatar_13.entry.js +32 -6
  55. package/dist/esm/lido-avatar_13.entry.js.map +1 -1
  56. package/dist/esm/lido-player.js +1 -1
  57. package/dist/esm/loader.js +1 -1
  58. package/dist/esm/{utils-64a312c4.js → utils-4f7c3168.js} +90 -24
  59. package/dist/esm/utils-4f7c3168.js.map +1 -0
  60. package/dist/lido-player/assets/xmlData.xml +412 -370
  61. package/dist/lido-player/index.esm.js +1 -1
  62. package/dist/lido-player/lido-player.esm.js +1 -1
  63. package/dist/lido-player/lido-player.esm.js.map +1 -1
  64. package/dist/lido-player/p-c35ed209.js +2 -0
  65. package/dist/lido-player/p-c35ed209.js.map +1 -0
  66. package/dist/lido-player/{p-8a6e5ca0.entry.js → p-fc5b9e28.entry.js} +2 -2
  67. package/dist/lido-player/p-fc5b9e28.entry.js.map +1 -0
  68. package/dist/types/components/container/lido-container.d.ts +6 -0
  69. package/dist/types/components/home/lido-home.d.ts +4 -0
  70. package/dist/types/components.d.ts +18 -2
  71. package/dist/types/utils/utils.d.ts +8 -0
  72. package/package.json +1 -1
  73. package/dist/cjs/utils-4ace217f.js.map +0 -1
  74. package/dist/collection/components/root/assets/Audio/goodJob.mp3 +0 -0
  75. package/dist/collection/components/root/assets/Audio/tryAgain.mp3 +0 -0
  76. package/dist/collection/components/root/assets/Audio/wellDone.mp3 +0 -0
  77. package/dist/components/p-30f9bddd.js.map +0 -1
  78. package/dist/components/p-946049d8.js.map +0 -1
  79. package/dist/components/p-ed3f367a.js.map +0 -1
  80. package/dist/esm/utils-64a312c4.js.map +0 -1
  81. package/dist/lido-player/assets/Audio/goodJob.mp3 +0 -0
  82. package/dist/lido-player/assets/Audio/tryAgain.mp3 +0 -0
  83. package/dist/lido-player/assets/Audio/wellDone.mp3 +0 -0
  84. package/dist/lido-player/p-37d3ffb2.js +0 -2
  85. package/dist/lido-player/p-37d3ffb2.js.map +0 -1
  86. package/dist/lido-player/p-8a6e5ca0.entry.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const utils = require('./utils-4ace217f.js');
5
+ const utils = require('./utils-1697a6b5.js');
6
6
  require('./index-0d28e716.js');
7
7
 
8
8
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0d28e716.js');
6
- const utils = require('./utils-4ace217f.js');
6
+ const utils = require('./utils-1697a6b5.js');
7
7
 
8
8
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
9
9
 
@@ -6652,6 +6652,7 @@ const LidoContainer = class {
6652
6652
  index.registerInstance(this, hostRef);
6653
6653
  this.id = undefined;
6654
6654
  this.objective = undefined;
6655
+ this.customStyle = undefined;
6655
6656
  this.value = undefined;
6656
6657
  this.height = undefined;
6657
6658
  this.width = undefined;
@@ -6675,6 +6676,23 @@ const LidoContainer = class {
6675
6676
  this.isAllowOnlyCorrect = false;
6676
6677
  this.baseUrl = '';
6677
6678
  }
6679
+ convertToPixels(height, parentElement = document.body) {
6680
+ if (!height)
6681
+ return 0; // Handle empty or invalid input
6682
+ // Directly return numbers if already in pixels
6683
+ if (height.endsWith('px')) {
6684
+ return parseFloat(height);
6685
+ }
6686
+ // Convert relative units
6687
+ const tempElement = document.createElement('div');
6688
+ tempElement.style.position = 'absolute';
6689
+ tempElement.style.visibility = 'hidden';
6690
+ tempElement.style.height = height;
6691
+ parentElement.appendChild(tempElement);
6692
+ const computedHeight = tempElement.offsetHeight;
6693
+ parentElement.removeChild(tempElement);
6694
+ return computedHeight;
6695
+ }
6678
6696
  /**
6679
6697
  * Scales the container based on the window or screen size, maintaining the aspect ratio.
6680
6698
  * The container scales according to the minimum dimension of the screen.
@@ -6684,11 +6702,13 @@ const LidoContainer = class {
6684
6702
  scaleContainer(container) {
6685
6703
  var _a;
6686
6704
  const widths = [window.innerWidth];
6705
+ // const heights = [window.innerHeight];
6687
6706
  if ((_a = window.screen) === null || _a === void 0 ? void 0 : _a.width) {
6688
6707
  widths.push(window.screen.width);
6708
+ // heights.push(window.screen.height);
6689
6709
  }
6690
6710
  const width = Math.min(...widths);
6691
- const height = document.documentElement.clientHeight;
6711
+ const height = this.height ? this.convertToPixels(this.height) : document.documentElement.clientHeight;
6692
6712
  const scaleX = width / 1600; // Scale based on a reference width of 1600px
6693
6713
  const scaleY = height / 900; // Scale based on a reference height of 900px
6694
6714
  const scale = Math.min(scaleX, scaleY);
@@ -6708,6 +6728,11 @@ const LidoContainer = class {
6708
6728
  window.addEventListener('resize', () => this.scaleContainer(this.el));
6709
6729
  window.addEventListener('load', () => this.scaleContainer(this.el));
6710
6730
  utils.initEventsForElement(this.el, this.type);
6731
+ if (this.customStyle) {
6732
+ const styleElement = document.createElement('style');
6733
+ styleElement.innerHTML = this.customStyle;
6734
+ document.head.appendChild(styleElement);
6735
+ }
6711
6736
  }
6712
6737
  render() {
6713
6738
  // Define the styles for the container element
@@ -6721,7 +6746,7 @@ const LidoContainer = class {
6721
6746
  transform: 'translate(-50%, -50%)', // Centering the container
6722
6747
  };
6723
6748
  console.log('🚀 ~ LidoContainer ~ canplay:', this.canplay);
6724
- return (index.h(index.Host, { key: 'b3c98ab2c03113fb47b72a03415b83aaf982bb99', id: "lido-container", tabindex: 0, class: "lido-container", objective: this.objective, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, onTouch: this.onTouch, onInCorrect: this.onInCorrect, onCorrect: this.onCorrect, onEntry: this.onEntry, showCheck: `${this.showCheck}`, isContinueOnCorrect: `${this.isContinueOnCorrect}`, isAllowOnlyCorrect: `${this.isAllowOnlyCorrect}`, canplay: `${this.canplay}` }, index.h("slot", { key: 'bdd2cd21f46007111cde0fef83adc5b4bbfa09f2' })));
6749
+ return (index.h(index.Host, { key: 'be7c50232bd0362f217b44d7f4d723f1ed5c40ec', id: "lido-container", tabindex: 0, class: "lido-container", objective: this.objective, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, onTouch: this.onTouch, onInCorrect: this.onInCorrect, onCorrect: this.onCorrect, onEntry: this.onEntry, showCheck: `${this.showCheck}`, isContinueOnCorrect: `${this.isContinueOnCorrect}`, isAllowOnlyCorrect: `${this.isAllowOnlyCorrect}`, canplay: `${this.canplay}` }, index.h("slot", { key: '8ce427c8388574aa7019b83cddae13a182db47ab' })));
6725
6750
  }
6726
6751
  get el() { return index.getElement(this); }
6727
6752
  };
@@ -6730,7 +6755,7 @@ LidoContainer.style = LidoContainerStyle0;
6730
6755
  const indexCss = "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap'); body{overflow:hidden}.lido-disable-check-button{pointer-events:none;background-color:#9393935c !important;color:white}.lido-element-selected{border:2px solid;background-color:#ffdf7d !important}";
6731
6756
  const LidoHomeStyle0 = indexCss;
6732
6757
 
6733
- const animationCss = "@keyframes rightToPlace{from{transform:translateX(2000px)}to{left:0}}@keyframes placeToLeft{from{}to{transform:translateX(-2000px)}}@keyframes shake{0%{transform:translateX(0)}10%{transform:translateX(-5px)}20%{transform:translateX(5px)}30%{transform:translateX(-5px)}40%{transform:translateX(5px)}50%{transform:translateX(-5px)}60%{transform:translateX(5px)}70%{transform:translateX(-5px)}80%{transform:translateX(5px)}90%{transform:translateX(-5px)}100%{transform:translateX(0)}}@keyframes fallAndBounce{0%{transform:translateY(-1000px)}25%{transform:translateY(0px)}50%{transform:translateY(-200px)}75%{transform:translateY(0)}90%{transform:translateY(-100px)}100%{transform:translateY(0)}}@keyframes placeToDown{0%{transform:translateY(0)}100%{transform:translateY(1000px)}}";
6758
+ const animationCss = "@keyframes rightToPlace{from{transform:translateX(2000px)}to{transform:translateX(0)}}@keyframes topToPlace{from{transform:translateY(-1000px)}to{transform:translateY(0)}}@keyframes bottomToPlace{from{transform:translateY(1000px)}to{transform:translateY(0)}}@keyframes placeToLeft{from{}to{transform:translateX(-2000px)}}@keyframes leftToPlace{from{transform:translateX(-2000px)}to{transform:translateX(0)}}@keyframes shake{0%{transform:translateX(0)}10%{transform:translateX(-5px)}20%{transform:translateX(5px)}30%{transform:translateX(-5px)}40%{transform:translateX(5px)}50%{transform:translateX(-5px)}60%{transform:translateX(5px)}70%{transform:translateX(-5px)}80%{transform:translateX(5px)}90%{transform:translateX(-5px)}100%{transform:translateX(0)}}@keyframes fallAndBounce{0%{transform:translateY(-1000px)}25%{transform:translateY(0px)}50%{transform:translateY(-200px)}75%{transform:translateY(0)}90%{transform:translateY(-100px)}100%{transform:translateY(0)}}@keyframes placeToDown{0%{transform:translateY(0)}100%{transform:translateY(1000px)}}";
6734
6759
  const LidoHomeStyle1 = animationCss;
6735
6760
 
6736
6761
  const lidoHomeCss = ".lido-snackbar{visibility:visible;min-width:250px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:16px;position:fixed;z-index:1;bottom:30px;left:50%;transform:translateX(-50%);font-size:17px}.lido-dot-container{text-align:center;position:fixed;z-index:1;width:fit-content;top:1%;left:50%;transform:translate(-50%)}.lido-dot{height:15px;width:15px;margin:0 4px;background-color:#bbb;border-radius:50%;display:inline-block;transition:background-color 0.3s;cursor:pointer}.lido-dot.completed{background-color:grey}.lido-dot.current{background-color:green}.lido-dot:not(.completed):not(.current){background-color:#bbb}";
@@ -6780,6 +6805,7 @@ const LidoHome = class {
6780
6805
  this.initialIndex = 0;
6781
6806
  this.canplay = true;
6782
6807
  this.baseUrl = '';
6808
+ this.height = '';
6783
6809
  this.currentContainerIndex = this.initialIndex;
6784
6810
  this.showCompletionMessage = false;
6785
6811
  this.containers = [];
@@ -6856,7 +6882,7 @@ const LidoHome = class {
6856
6882
  .filter(Boolean);
6857
6883
  // Map XML tags to Stencil components
6858
6884
  const componentMapping = {
6859
- 'lido-container': (index.h("lido-container", Object.assign({}, props, { canplay: this.canplay, baseUrl: this.baseUrl }), children)),
6885
+ 'lido-container': (index.h("lido-container", Object.assign({}, props, { canplay: this.canplay, baseUrl: this.baseUrl, height: this.height }), children)),
6860
6886
  'lido-col': index.h("lido-col", Object.assign({}, props), children),
6861
6887
  'lido-trace': index.h("lido-trace", Object.assign({}, props), children),
6862
6888
  'lido-image': index.h("lido-image", Object.assign({}, props), children),
@@ -6899,7 +6925,7 @@ const LidoHome = class {
6899
6925
  * Clicking on a dot allows the user to jump to a specific container.
6900
6926
  */
6901
6927
  renderDots() {
6902
- const style = { pointerEvents: this.canplay ? "none" : "" };
6928
+ const style = { pointerEvents: this.canplay ? 'none' : '' };
6903
6929
  return (index.h("div", { id: "lido-dot-indicator", class: "lido-dot-container", style: style }, this.containers.map((_, index$1) => (index.h("span", { class: `lido-dot ${index$1 < this.currentContainerIndex ? 'completed' : index$1 === this.currentContainerIndex ? 'current' : ''}`, onClick: () => this.jumpToContainer(index$1) })))));
6904
6930
  }
6905
6931
  /**