lido-player 0.0.2-alpha-51-dev → 0.0.2-alpha-53-dev

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 (143) hide show
  1. package/dist/cjs/index.cjs.js +1 -1
  2. package/dist/cjs/lido-avatar_22.cjs.entry.js +199 -73
  3. package/dist/cjs/lido-player.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{utils-dc02d753.js → utils-3c1ce74e.js} +236 -101
  6. package/dist/collection/components/avatar/lido-avatar.js +1 -1
  7. package/dist/collection/components/canvas/lido-canvas.css +5 -8
  8. package/dist/collection/components/canvas/lido-canvas.js +2 -2
  9. package/dist/collection/components/cell/lido-cell.js +1 -1
  10. package/dist/collection/components/column/lido-col.js +1 -1
  11. package/dist/collection/components/container/lido-container.js +24 -2
  12. package/dist/collection/components/flashCard/lido-flash-card.js +1 -1
  13. package/dist/collection/components/home/lido-home.css +4 -0
  14. package/dist/collection/components/home/lido-home.js +27 -3
  15. package/dist/collection/components/mathMatrix/lido-math-matrix.js +14 -14
  16. package/dist/collection/components/position/lido-pos.js +1 -1
  17. package/dist/collection/components/random/lido-random.js +1 -1
  18. package/dist/collection/components/row/lido-row.js +1 -1
  19. package/dist/collection/components/shape/lido-shape.js +1 -1
  20. package/dist/collection/components/trace/lido-trace.js +122 -47
  21. package/dist/collection/components/wrap/lido-wrap.js +1 -1
  22. package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +26 -25
  23. package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +3 -1
  24. package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +1 -1
  25. package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +1 -1
  26. package/dist/collection/stories/Templates/balancing/balancing.stories.js +1 -1
  27. package/dist/collection/stories/Templates/blender/blender.stories.js +100 -0
  28. package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +1 -1
  29. package/dist/collection/stories/Templates/calculator/calculator.stories.js +6 -2
  30. package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +1 -1
  31. package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +1 -1
  32. package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +1 -1
  33. package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +3 -2
  34. package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +1 -1
  35. package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +3 -1
  36. package/dist/collection/stories/Templates/grid/grid.stories.js +5 -1
  37. package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +1 -1
  38. package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +4 -2
  39. package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +1 -1
  40. package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +3 -1
  41. package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +4 -2
  42. package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +1 -1
  43. package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +1 -1
  44. package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +1 -1
  45. package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +1 -1
  46. package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +6 -4
  47. package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +1 -1
  48. package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +2 -2
  49. package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +2 -2
  50. package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +14 -13
  51. package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +14 -13
  52. package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +1 -1
  53. package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +5 -1
  54. package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +1 -1
  55. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +1 -1
  56. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +1 -1
  57. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +1 -1
  58. package/dist/collection/stories/Templates/reorder/reorder.stories.js +3 -1
  59. package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +2 -2
  60. package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +6 -6
  61. package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +7 -6
  62. package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +1 -1
  63. package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +25 -21
  64. package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +1 -1
  65. package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +8 -6
  66. package/dist/collection/stories/Templates/total/total.stories.js +1 -1
  67. package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +1 -1
  68. package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +2 -2
  69. package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +6 -6
  70. package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +1 -1
  71. package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +7 -6
  72. package/dist/collection/utils/utils.js +155 -27
  73. package/dist/collection/utils/utilsHandlers/animationHandler.js +38 -0
  74. package/dist/collection/utils/utilsHandlers/clickHandler.js +5 -1
  75. package/dist/collection/utils/utilsHandlers/dragDropHandler.js +29 -64
  76. package/dist/collection/utils/utilsHandlers/slideHandler.js +7 -6
  77. package/dist/collection/utils/utilsHandlers/sortHandler.js +3 -5
  78. package/dist/components/index.js +1 -1
  79. package/dist/components/lido-avatar.js +1 -1
  80. package/dist/components/lido-balance.js +1 -1
  81. package/dist/components/lido-calculator.js +1 -1
  82. package/dist/components/lido-canvas.js +2 -2
  83. package/dist/components/lido-cell.js +1 -1
  84. package/dist/components/lido-col.js +1 -1
  85. package/dist/components/lido-container.js +1 -1
  86. package/dist/components/lido-flash-card.js +1 -1
  87. package/dist/components/lido-float.js +1 -1
  88. package/dist/components/lido-home.js +1 -1
  89. package/dist/components/lido-image.js +1 -1
  90. package/dist/components/lido-keyboard.js +1 -1
  91. package/dist/components/lido-math-matrix.js +1 -1
  92. package/dist/components/lido-pos.js +1 -1
  93. package/dist/components/lido-random.js +1 -1
  94. package/dist/components/lido-root.js +23 -23
  95. package/dist/components/lido-row.js +1 -1
  96. package/dist/components/lido-shape.js +1 -1
  97. package/dist/components/lido-slide-fill.js +1 -1
  98. package/dist/components/lido-text.js +1 -1
  99. package/dist/components/lido-trace.js +1 -1
  100. package/dist/components/lido-wrap.js +1 -1
  101. package/dist/components/{p-56c8f3da.js → p-004adc43.js} +3 -3
  102. package/dist/components/{p-c8815e84.js → p-057fb7b8.js} +48 -24
  103. package/dist/components/{p-bb907e43.js → p-0733b277.js} +2 -2
  104. package/dist/components/{p-6ba0f1af.js → p-09b3b152.js} +1 -1
  105. package/dist/components/{p-74b90a9c.js → p-23549651.js} +8 -8
  106. package/dist/components/{p-d7693f47.js → p-3e8ae1c5.js} +123 -48
  107. package/dist/components/{p-6be6c5eb.js → p-3f0e4436.js} +2 -2
  108. package/dist/components/{p-d0131159.js → p-511377d2.js} +236 -102
  109. package/dist/components/{p-a8724f06.js → p-561908ec.js} +2 -2
  110. package/dist/components/{p-1c84cf65.js → p-567983a9.js} +13 -7
  111. package/dist/components/{p-b89371ac.js → p-6beee44b.js} +1 -1
  112. package/dist/components/{p-1f3c2783.js → p-71ded596.js} +2 -2
  113. package/dist/components/{p-0fbeb3a1.js → p-73e3f0f4.js} +12 -6
  114. package/dist/components/{p-b7efadad.js → p-875c1411.js} +2 -2
  115. package/dist/components/{p-4fd6b588.js → p-8774f517.js} +2 -2
  116. package/dist/components/{p-04e904b5.js → p-90f7dd48.js} +1 -1
  117. package/dist/components/{p-caa05d1e.js → p-92b9ae9e.js} +2 -2
  118. package/dist/components/{p-e9548986.js → p-9ea1a67d.js} +26 -4
  119. package/dist/components/{p-bef96764.js → p-b3e67e7f.js} +2 -2
  120. package/dist/components/{p-988477ad.js → p-cca545f9.js} +2 -2
  121. package/dist/components/{p-d3f7d561.js → p-d2fe2bb6.js} +2 -2
  122. package/dist/components/{p-12432f23.js → p-d568d595.js} +1 -1
  123. package/dist/components/{p-62d2a5b3.js → p-df1af62c.js} +2 -2
  124. package/dist/esm/index.js +1 -1
  125. package/dist/esm/lido-avatar_22.entry.js +199 -73
  126. package/dist/esm/lido-player.js +1 -1
  127. package/dist/esm/loader.js +1 -1
  128. package/dist/esm/{utils-b5eb2360.js → utils-eefe4a1c.js} +236 -102
  129. package/dist/lido-player/index.esm.js +1 -1
  130. package/dist/lido-player/lido-player.esm.js +1 -1
  131. package/dist/lido-player/p-4d9ad047.entry.js +1 -0
  132. package/dist/lido-player/{p-9fd87d44.js → p-589fc3b8.js} +2 -2
  133. package/dist/types/components/canvas/lido-canvas.d.ts +1 -1
  134. package/dist/types/components/container/lido-container.d.ts +1 -0
  135. package/dist/types/components/home/lido-home.d.ts +1 -0
  136. package/dist/types/components/mathMatrix/lido-math-matrix.d.ts +0 -1
  137. package/dist/types/components/trace/lido-trace.d.ts +1 -0
  138. package/dist/types/components.d.ts +0 -6
  139. package/dist/types/stories/Templates/blender/blender.stories.d.ts +4 -0
  140. package/dist/types/utils/utils.d.ts +1 -1
  141. package/dist/types/utils/utilsHandlers/animationHandler.d.ts +1 -0
  142. package/package.json +1 -1
  143. package/dist/lido-player/p-e1a9c26f.entry.js +0 -1
@@ -224,6 +224,45 @@ function balanceResult(container, objectiveString) {
224
224
  return res;
225
225
  }
226
226
 
227
+ function dragDropAnimation(container, dragElement, dropElement) {
228
+ container.style.pointerEvents = 'none';
229
+ setTimeout(() => {
230
+ const div = document.createElement('div');
231
+ container.append(div);
232
+ div.classList.add('after-drop-popup-container');
233
+ dragElement.style.scale = `1`;
234
+ dropElement.style.scale = `1`;
235
+ const allDragElements = container.querySelectorAll('[type="drag"]');
236
+ const dragParents = Array.from(allDragElements).map(el => el.parentElement);
237
+ const allSameParent = dragParents.every(parent => parent === dragElement.parentElement);
238
+ // Remove from old parents
239
+ if (allSameParent) {
240
+ dragElement.remove();
241
+ dropElement.remove();
242
+ }
243
+ else {
244
+ dragElement.parentElement.parentElement.remove();
245
+ dropElement.parentElement.parentElement.remove();
246
+ }
247
+ // Add animation and popup classes
248
+ dragElement.classList.add('zoom-fade-in', 'after-drop-popup-drag-element');
249
+ dropElement.classList.add('zoom-fade-in', 'after-drop-popup-drop-element');
250
+ div.appendChild(dragElement);
251
+ div.appendChild(dropElement);
252
+ dropElement.classList.remove('empty');
253
+ setTimeout(() => {
254
+ dragElement.classList.remove('zoom-fade-in');
255
+ dropElement.classList.remove('zoom-fade-in');
256
+ dragElement.classList.add('zoom-fade-out');
257
+ dropElement.classList.add('zoom-fade-out');
258
+ setTimeout(() => {
259
+ div.remove();
260
+ container.style.pointerEvents = 'auto';
261
+ }, 800); // match animation duration
262
+ }, 2000); // stay for 2 seconds
263
+ }, 250);
264
+ }
265
+
227
266
  function buildDropHasDragFromDOM() {
228
267
  const dropHasDrag = {};
229
268
  const dropElements = document.querySelectorAll("[type='drop']");
@@ -290,7 +329,7 @@ function enableDraggingWithScaling(element) {
290
329
  isDragging = false;
291
330
  return;
292
331
  }
293
- // AudioPlayer.getI().stop();
332
+ AudioPlayer.getI().stop();
294
333
  removeHighlight(element);
295
334
  isDragging = true;
296
335
  isClicked = true;
@@ -394,6 +433,7 @@ function enableDraggingWithScaling(element) {
394
433
  // Start observing the element
395
434
  observer.observe(container, observerConfig);
396
435
  const onMove = (event) => {
436
+ console.log('moved');
397
437
  if (!isDragging)
398
438
  return;
399
439
  if (isDraggingDisabled) {
@@ -402,7 +442,7 @@ function enableDraggingWithScaling(element) {
402
442
  }
403
443
  isClicked = false;
404
444
  element.style.transition = 'none';
405
- const containerScale = getElementScale$1(container);
445
+ const containerScale = calculateScale();
406
446
  let dx = 0;
407
447
  let dy = 0;
408
448
  if (event instanceof MouseEvent) {
@@ -454,7 +494,9 @@ function enableDraggingWithScaling(element) {
454
494
  mostOverlappedElement.style.backgroundColor = 'rgba(255, 0, 0, 0.1)'; // Light red background
455
495
  }
456
496
  else {
457
- mostOverlappedElement.style.opacity = '0.3';
497
+ if (!document.getElementById('unitsDrop') || !document.getElementById('tensDrop') || !document.getElementById('hundredsDrop')) {
498
+ mostOverlappedElement.style.opacity = '0.3';
499
+ }
458
500
  }
459
501
  }
460
502
  };
@@ -509,6 +551,7 @@ function enableDraggingWithScaling(element) {
509
551
  // Check for overlaps and log the most overlapping element
510
552
  let mostOverlappedElement = findMostoverlappedElement$1(element, 'drop');
511
553
  onElementDropComplete(element, mostOverlappedElement);
554
+ executeActions("this.updateCountBlender='true'", container);
512
555
  if (((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) {
513
556
  if (mostOverlappedElement) {
514
557
  if (element) {
@@ -698,7 +741,6 @@ function handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedV
698
741
  });
699
742
  handleShowCheck();
700
743
  }
701
- const tempVanishedValues = [];
702
744
  async function onElementDropComplete(dragElement, dropElement) {
703
745
  var _a, _b, _c, _d, _e, _f, _g, _h;
704
746
  const container = document.getElementById(LidoContainer);
@@ -710,10 +752,10 @@ async function onElementDropComplete(dragElement, dropElement) {
710
752
  let dropHasDrag = buildDropHasDragFromDOM();
711
753
  if (!dropElement) {
712
754
  handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
713
- return;
714
755
  }
715
756
  const dropTabIndex = dropElement.getAttribute('tab-index');
716
- if ((_b = dropHasDrag[dropTabIndex]) === null || _b === void 0 ? void 0 : _b.isFull) {
757
+ const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'false';
758
+ if (((_b = dropHasDrag[dropTabIndex]) === null || _b === void 0 ? void 0 : _b.isFull) && !isAllowOnlyOneDrop) {
717
759
  handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
718
760
  return;
719
761
  }
@@ -725,7 +767,6 @@ async function onElementDropComplete(dragElement, dropElement) {
725
767
  handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
726
768
  return;
727
769
  }
728
- // let isCorrect = dropElement.getAttribute('value').toLowerCase().includes(dragElement.getAttribute('value').toLowerCase());
729
770
  let isCorrect;
730
771
  const dragValue = ((_c = dragElement.getAttribute('value')) === null || _c === void 0 ? void 0 : _c.trim()) || "";
731
772
  const dropValue = ((_d = dropElement.getAttribute('value')) === null || _d === void 0 ? void 0 : _d.trim()) || "";
@@ -742,7 +783,8 @@ async function onElementDropComplete(dragElement, dropElement) {
742
783
  }
743
784
  }
744
785
  else {
745
- isCorrect = dropElement.getAttribute('value').toLowerCase().includes(dragElement.getAttribute('value').toLowerCase());
786
+ //strings
787
+ isCorrect = dropValue.toLowerCase().includes(dragValue.toLowerCase());
746
788
  }
747
789
  if (!isCorrect) {
748
790
  dragElement.style.transition = 'transform 0.5s ease';
@@ -752,6 +794,7 @@ async function onElementDropComplete(dragElement, dropElement) {
752
794
  await executeActions(onInCorrect, dropElement, dragElement);
753
795
  setTimeout(() => {
754
796
  dragElement.style.transform = 'translate(0, 0)';
797
+ storingEachActivityScore(false);
755
798
  // const oldDropIndex = dragToDropMap[dragElement.getAttribute('data-id')];
756
799
  // if (oldDropIndex !== undefined && dropHasDrag[oldDropIndex]) {
757
800
  // dropHasDrag[oldDropIndex].isFull = false;
@@ -777,61 +820,18 @@ async function onElementDropComplete(dragElement, dropElement) {
777
820
  else {
778
821
  const checkdropAttr = container.getAttribute('dropAttr');
779
822
  if (checkdropAttr && checkdropAttr.toLowerCase() === DropMode.EnableAnimation.toLowerCase()) {
780
- container.style.pointerEvents = "none";
781
- setTimeout(() => {
782
- var _a, _b, _c;
783
- const div = document.createElement('div');
784
- container.append(div);
785
- div.classList.add('after-drop-popup-container');
786
- dragElement.style.scale = `1`;
787
- dropElement.style.scale = `1`;
788
- const allDragElements = container.querySelectorAll('[type="drag"]');
789
- const dragParents = Array.from(allDragElements).map(el => el.parentElement);
790
- const allSameParent = dragParents.every(parent => parent === dragElement.parentElement);
791
- JSON.parse((_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : '[]');
792
- const vanishedValue = (_b = dragElement.getAttribute('value')) !== null && _b !== void 0 ? _b : (_c = dragElement.textContent) === null || _c === void 0 ? void 0 : _c.trim();
793
- if (vanishedValue) {
794
- tempVanishedValues.push(vanishedValue);
795
- }
796
- // Remove from old parents
797
- if (allSameParent) {
798
- dragElement.remove();
799
- dropElement.remove();
800
- }
801
- else {
802
- dragElement.parentElement.parentElement.remove();
803
- dropElement.parentElement.parentElement.remove();
804
- }
805
- // Add animation and popup classes
806
- dragElement.classList.add('zoom-fade-in', 'after-drop-popup-drag-element');
807
- dropElement.classList.add('zoom-fade-in', 'after-drop-popup-drop-element');
808
- div.appendChild(dragElement);
809
- div.appendChild(dropElement);
810
- dropElement.classList.remove('empty');
811
- setTimeout(() => {
812
- dragElement.classList.remove('zoom-fade-in');
813
- dropElement.classList.remove('zoom-fade-in');
814
- dragElement.classList.add('zoom-fade-out');
815
- dropElement.classList.add('zoom-fade-out');
816
- setTimeout(() => {
817
- div.remove();
818
- container.style.pointerEvents = 'auto';
819
- const objective = container.getAttribute('objective');
820
- if (objective && tempVanishedValues.map(v => v.trim()).sort().join(',') === objective.split(',').map(v => v.trim()).sort().join(',')) {
821
- (async () => {
822
- isCorrect = true;
823
- const onCorrect = (container === null || container === void 0 ? void 0 : container.getAttribute('onCorrect')) || '';
824
- await executeActions(onCorrect, container);
825
- window.dispatchEvent(new CustomEvent(NextContainerKey));
826
- tempVanishedValues.length = 0;
827
- })();
828
- }
829
- }, 800); // match animation duration
830
- }, 2000); // stay for 2 seconds
831
- }, 250);
823
+ //This function coming from animationhandler.ts
824
+ dragDropAnimation(container, dragElement, dropElement);
832
825
  }
833
826
  }
834
827
  }
828
+ else {
829
+ const checkdropAttr = container.getAttribute('dropAttr');
830
+ if (checkdropAttr && checkdropAttr.toLowerCase() === DropMode.EnableAnimation.toLowerCase()) {
831
+ //This function coming from animationhandler.ts
832
+ dragDropAnimation(container, dragElement, dropElement);
833
+ }
834
+ }
835
835
  if (dropElement) {
836
836
  let selectedValues = JSON.parse((_e = container.getAttribute(SelectedValuesKey)) !== null && _e !== void 0 ? _e : "[]");
837
837
  const dragValue = dragElement.getAttribute('value');
@@ -849,7 +849,8 @@ async function onElementDropComplete(dragElement, dropElement) {
849
849
  }
850
850
  if (!(((_f = dropElement.getAttribute('dropAttr')) === null || _f === void 0 ? void 0 : _f.toLowerCase()) === DropMode.Diagonal) && (dropElement.getAttribute('minDrops') === '1' || !dropElement.getAttribute('minDrops'))) {
851
851
  const isisFull = Object.values(dropHasDrag).find(item => document.getElementById(item.drop) === dropElement);
852
- if (isisFull) {
852
+ const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
853
+ if (isAllowOnlyOneDrop && isisFull) {
853
854
  isisFull.isFull = true;
854
855
  dropElement.setAttribute('is-full', 'true');
855
856
  }
@@ -884,8 +885,8 @@ async function onElementDropComplete(dragElement, dropElement) {
884
885
  // Check for overlaps and highlight only the most overlapping element
885
886
  if (dropElement && !((_g = dropHasDrag[dropTabIndex]) === null || _g === void 0 ? void 0 : _g.isFull)) {
886
887
  let mostOverlappedElement = findMostoverlappedElement$1(dragElement, 'drag');
887
- const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true' || '';
888
- if (mostOverlappedElement && isAllowOnlyOneDrop) {
888
+ const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
889
+ if (isAllowOnlyOneDrop && mostOverlappedElement) {
889
890
  dragElement.style.transform = 'translate(0,0)';
890
891
  dragElement.style.transition = 'transform 0.5s ease';
891
892
  const allElements = document.querySelectorAll("[type='drop']");
@@ -963,11 +964,12 @@ async function onElementDropComplete(dragElement, dropElement) {
963
964
  // Add pulse and highlight effect for a successful match
964
965
  const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
965
966
  dispatchElementDropEvent(dragElement, dropElement, isCorrect);
966
- storingEachActivityScore(isCorrect);
967
+ // storingEachActivityScore(isCorrect);
967
968
  dragElement.style.opacity = '1';
968
969
  await onActivityComplete(dragElement, dropElement);
969
970
  const allDropElements = document.querySelectorAll('.drop-element');
970
971
  allDropElements.forEach(el => updateDropBorder(el));
972
+ await onActivityComplete(dragElement, dropElement);
971
973
  }
972
974
  function updateDropBorder(element) {
973
975
  if (!element || !element.classList.contains('drop-element'))
@@ -1359,7 +1361,7 @@ function enableReorderDrag(element) {
1359
1361
  isClicked = false;
1360
1362
  event.preventDefault();
1361
1363
  const containerRect = container.getBoundingClientRect();
1362
- const containerScale = getElementScale(container);
1364
+ const containerScale = calculateScale();
1363
1365
  const newLeft = (point.clientX - containerRect.left - offsetXInElement) / containerScale;
1364
1366
  const newTop = (point.clientY - containerRect.top - offsetYInElement) / containerScale;
1365
1367
  element.style.left = `${newLeft}px`;
@@ -1426,9 +1428,7 @@ function enableReorderDrag(element) {
1426
1428
  else {
1427
1429
  if (element.parentElement['type'] !== 'category') {
1428
1430
  executeActions('this.alignMatch=true', divEl, element);
1429
- setTimeout(() => {
1430
- divEl.replaceWith(element);
1431
- }, 500);
1431
+ divEl.replaceWith(element);
1432
1432
  }
1433
1433
  else {
1434
1434
  const categoryElement = element.parentElement;
@@ -1904,9 +1904,6 @@ function slidingWithScaling(element) {
1904
1904
  element.style.transform = 'translate(0, 0)'; // Initialize transform for consistent dragging
1905
1905
  element.addEventListener('mousedown', onStart);
1906
1906
  element.addEventListener('touchstart', onStart);
1907
- element.addEventListener('click', ev => {
1908
- onClickDropOrDragElement(element, 'drag');
1909
- });
1910
1907
  }
1911
1908
  const slideCompleted = (slideElement) => {
1912
1909
  var _a;
@@ -1922,8 +1919,13 @@ const slideCompleted = (slideElement) => {
1922
1919
  const objectiveArray = objectiveString.split(',');
1923
1920
  const elementIndex = slideArr.indexOf(slideElement['value']);
1924
1921
  const isCorrect = matchStringPattern(slideElement['value'], [objectiveArray[elementIndex].trim()]);
1925
- storingEachActivityScore(isCorrect);
1926
- handleShowCheck();
1922
+ if (container.getAttribute('is-continue-on-correct') === 'true') {
1923
+ storingEachActivityScore(true);
1924
+ handleShowCheck();
1925
+ }
1926
+ else {
1927
+ storingEachActivityScore(isCorrect);
1928
+ }
1927
1929
  };
1928
1930
 
1929
1931
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -3208,7 +3210,10 @@ function addClickListenerForClickType(element) {
3208
3210
  dispatchClickEvent(element, isCorrect);
3209
3211
  if (isCorrect) {
3210
3212
  const onCorrect = element.getAttribute('onCorrect');
3211
- // element.style.pointerEvents = 'none';
3213
+ if (!(element.id && element.id.startsWith('key-button'))) {
3214
+ element.style.pointerEvents = 'none';
3215
+ }
3216
+ document.body.style.pointerEvents = 'none';
3212
3217
  await executeActions(onCorrect, element);
3213
3218
  }
3214
3219
  else {
@@ -3265,6 +3270,7 @@ function addClickListenerForClickType(element) {
3265
3270
  container.setAttribute(SelectedValuesKey, JSON.stringify(sortedValues));
3266
3271
  const isCorrect = objective.includes(element['value']);
3267
3272
  dispatchClickEvent(element, isCorrect);
3273
+ AudioPlayer.getI().stop();
3268
3274
  if (isCorrect) {
3269
3275
  const onCorrect = element.getAttribute('onCorrect');
3270
3276
  await executeActions(onCorrect, element);
@@ -68578,6 +68584,7 @@ const initEventsForElement = async (element, type) => {
68578
68584
  const executeActions = async (actionsString, thisElement, element) => {
68579
68585
  var _a, _b, _c, _d, _e, _f, _g;
68580
68586
  const actions = parseActions(actionsString);
68587
+ body.style.pointerEvents = 'none';
68581
68588
  for (let i = 0; i < actions.length; i++) {
68582
68589
  const action = actions[i];
68583
68590
  const queriedElement = document.querySelector(action.actor);
@@ -68608,7 +68615,7 @@ const executeActions = async (actionsString, thisElement, element) => {
68608
68615
  const container = document.getElementById(LidoContainer);
68609
68616
  const containerScale = getElementScale$1(container);
68610
68617
  dragElement.style.transform = 'translate(0,0)';
68611
- console.log("logg alinmatch");
68618
+ console.log('logg alinmatch');
68612
68619
  const dropRect = dropElement.getBoundingClientRect();
68613
68620
  const dragRect = dragElement.getBoundingClientRect();
68614
68621
  const dropCenterX = dropRect.left + dropRect.width / 2;
@@ -68662,7 +68669,7 @@ const executeActions = async (actionsString, thisElement, element) => {
68662
68669
  if (container.getAttribute('is-continue-on-correct') !== 'true') {
68663
68670
  targetElement.style.pointerEvents = 'none';
68664
68671
  }
68665
- validateObjectiveStatus();
68672
+ await validateObjectiveStatus();
68666
68673
  break;
68667
68674
  }
68668
68675
  case 'prevBtn': {
@@ -68772,8 +68779,53 @@ const executeActions = async (actionsString, thisElement, element) => {
68772
68779
  }
68773
68780
  break;
68774
68781
  }
68775
- case 'updatedAnswer': {
68776
- updatedAnswer();
68782
+ case 'disableType': {
68783
+ const dragEle = document.querySelector('[type="drag"]');
68784
+ dragEle.removeAttribute('type');
68785
+ dragEle.style.pointerEvents = 'none';
68786
+ break;
68787
+ }
68788
+ case 'updateCountBlender': {
68789
+ const allDrags = document.querySelectorAll('[type="drag"]');
68790
+ let units = 0;
68791
+ let tens = 0;
68792
+ let hundreds = 0;
68793
+ allDrags.forEach(el => {
68794
+ const dropTo = el.getAttribute("drop-to");
68795
+ if (dropTo === "unitsDrop")
68796
+ units++;
68797
+ if (dropTo === "tensDrop")
68798
+ tens++;
68799
+ if (dropTo === "hundredsDrop")
68800
+ hundreds++;
68801
+ });
68802
+ const unitsValue = units * 1;
68803
+ const tensValue = tens * 10;
68804
+ const hundredsValue = hundreds * 100;
68805
+ const totalValue = unitsValue + tensValue + hundredsValue;
68806
+ // ✅ Update Lido Text Boxes
68807
+ const unitsBox = document.getElementById("units");
68808
+ const tensBox = document.getElementById("tens");
68809
+ const hundredsBox = document.getElementById("hundreds");
68810
+ if (unitsBox) {
68811
+ unitsBox.setAttribute("string", unitsValue.toString());
68812
+ }
68813
+ if (tensBox) {
68814
+ tensBox.setAttribute("string", tensValue.toString());
68815
+ }
68816
+ if (hundredsBox) {
68817
+ hundredsBox.setAttribute("string", hundredsValue.toString());
68818
+ }
68819
+ console.log(`Units = ${units} → ${unitsValue}`);
68820
+ console.log(`Tens = ${tens} → ${tensValue}`);
68821
+ console.log(`Hundreds = ${hundreds} → ${hundredsValue}`);
68822
+ console.log(`✅ Total Value = ${totalValue}`);
68823
+ break;
68824
+ }
68825
+ case 'updateCalculatorAnswer': {
68826
+ if (targetElement) {
68827
+ updateCalculatorAnswer(targetElement);
68828
+ }
68777
68829
  break;
68778
68830
  }
68779
68831
  default: {
@@ -68783,6 +68835,7 @@ const executeActions = async (actionsString, thisElement, element) => {
68783
68835
  }
68784
68836
  }
68785
68837
  }
68838
+ body.style.pointerEvents = 'auto';
68786
68839
  };
68787
68840
  const afterDropDragHandling = (dragElement, dropElement) => {
68788
68841
  const container = document.getElementById(LidoContainer);
@@ -68792,6 +68845,7 @@ const afterDropDragHandling = (dragElement, dropElement) => {
68792
68845
  const isInfinite = container.getAttribute('drop-action') === DropAction.InfiniteDrop;
68793
68846
  if (isAppend || isInfinite) {
68794
68847
  setTimeout(() => {
68848
+ var _a, _b;
68795
68849
  dragElement.style.transform = 'translate(0,0)';
68796
68850
  dragElement.style.transition = '';
68797
68851
  let dummyElement = document.createElement('div');
@@ -68825,6 +68879,14 @@ const afterDropDragHandling = (dragElement, dropElement) => {
68825
68879
  dummyElement.style.margin = '0px';
68826
68880
  });
68827
68881
  }
68882
+ const orientation = window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
68883
+ const rowAttr = dropElement.getAttribute('dropAttr');
68884
+ const dropAttr = parseProp(rowAttr, orientation); // will return stackcascade or verticalstack
68885
+ if (((_a = (dropAttr)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "stackcascade" || ((_b = (dropAttr)) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === "verticalstack") {
68886
+ dropElement.append(dragElement);
68887
+ placeElementInDropZone(dropElement, dragElement, orientation, dropAttr);
68888
+ return;
68889
+ }
68828
68890
  dropElement.parentElement.append(element);
68829
68891
  dragElement.style.position = 'absolute';
68830
68892
  dragElement.style.zIndex = '1';
@@ -68837,16 +68899,41 @@ const afterDropDragHandling = (dragElement, dropElement) => {
68837
68899
  const scaledLeft = (dropCenterX - dragCenterX) / containerScale;
68838
68900
  const scaledTop = (dropCenterY - dragCenterY) / containerScale;
68839
68901
  dragElement.style.transform = `translate(${scaledLeft}px, ${scaledTop}px)`;
68840
- }, 500);
68902
+ }, 100);
68841
68903
  }
68842
68904
  };
68905
+ // function cloneElementWithComputedStyles(originalEl: HTMLElement): HTMLElement {
68906
+ // let clone = document.createElement('div') as HTMLElement;
68907
+ // clone.innerHTML = originalEl.outerHTML;
68908
+ // clone = clone.firstChild as HTMLElement;
68909
+ // clone.setAttribute('height', originalEl.style.height);
68910
+ // clone.setAttribute('width', originalEl.style.width);
68911
+ // clone.setAttribute('visible', 'true');
68912
+ // return clone;
68913
+ // }
68843
68914
  function cloneElementWithComputedStyles(originalEl) {
68844
- let clone = document.createElement('div');
68845
- clone.innerHTML = originalEl.outerHTML;
68846
- clone = clone.firstChild;
68847
- clone.setAttribute('height', originalEl.style.height);
68848
- clone.setAttribute('width', originalEl.style.width);
68849
- clone.setAttribute('visible', 'true');
68915
+ const tag = originalEl.tagName.toLowerCase();
68916
+ if (tag === "lido-text") {
68917
+ let clone = document.createElement('div');
68918
+ clone.innerHTML = originalEl.outerHTML;
68919
+ clone = clone.firstChild;
68920
+ clone.setAttribute('height', originalEl.style.height);
68921
+ clone.setAttribute('width', originalEl.style.width);
68922
+ clone.setAttribute('visible', 'true');
68923
+ return clone;
68924
+ }
68925
+ // ✅ For ALL other types (INCLUDING lido-image & matrix) use your simple logic
68926
+ const clone = originalEl.cloneNode(false);
68927
+ clone.style.width = originalEl.style.width;
68928
+ clone.style.height = originalEl.style.height;
68929
+ clone.style.margin = originalEl.style.margin;
68930
+ clone.style.opacity = originalEl.style.opacity;
68931
+ clone.style.transform = originalEl.style.transform;
68932
+ clone.setAttribute("visible", "true");
68933
+ clone.setAttribute("data-dummy", "true");
68934
+ if (tag === "lido-math-matrix") {
68935
+ clone.setAttribute('clickable', "false");
68936
+ }
68850
68937
  return clone;
68851
68938
  }
68852
68939
  // Function to parse actions string
@@ -69065,6 +69152,7 @@ const handleShowCheck = () => {
69065
69152
  validateObjectiveStatus();
69066
69153
  }
69067
69154
  };
69155
+ const body = document.body;
69068
69156
  let res;
69069
69157
  const validateObjectiveStatus = async () => {
69070
69158
  var _a, _b;
@@ -69129,6 +69217,7 @@ const validateObjectiveStatus = async () => {
69129
69217
  if (!isContinueOnCorrect) {
69130
69218
  triggerNextContainer();
69131
69219
  await calculateScore();
69220
+ triggerNextContainer();
69132
69221
  }
69133
69222
  else {
69134
69223
  const onInCorrect = container.getAttribute('onInCorrect');
@@ -69151,16 +69240,16 @@ const triggerPrevcontainer = () => {
69151
69240
  function convertUrlToRelative(url) {
69152
69241
  const container = document.getElementById(LidoContainer);
69153
69242
  const baseUrl = container.getAttribute('baseUrl');
69154
- if ((url === null || url === void 0 ? void 0 : url.startsWith('http')) || (url === null || url === void 0 ? void 0 : url.startsWith('blob'))) {
69243
+ if ((url === null || url === void 0 ? void 0 : url.startsWith('http')) || (url === null || url === void 0 ? void 0 : url.startsWith('blob')) || (url === null || url === void 0 ? void 0 : url.startsWith('data'))) {
69155
69244
  return url;
69156
69245
  }
69157
- else if (baseUrl) {
69158
- const newUrl = !url.startsWith('/') ? url : url.substring(1);
69159
- return baseUrl + (baseUrl.endsWith('/') ? newUrl : '/' + newUrl);
69160
- }
69161
- else {
69162
- return getAssetPath(url);
69246
+ if (baseUrl) {
69247
+ const newUrl = url.startsWith('/') ? url.slice(1) : url;
69248
+ if (newUrl.startsWith(baseUrl.replace(/^\/+|\/+$/g, '')))
69249
+ return newUrl;
69250
+ return baseUrl.endsWith('/') ? baseUrl + newUrl : `${baseUrl}/${newUrl}`;
69163
69251
  }
69252
+ return getAssetPath(url);
69164
69253
  }
69165
69254
  /**
69166
69255
  * Asynchronously speaks the given text using the browser's text-to-speech API.
@@ -69632,9 +69721,6 @@ const SumTogetherAnimation = async (element, value) => {
69632
69721
  return;
69633
69722
  if (!value)
69634
69723
  return;
69635
- const container = document.getElementById(LidoContainer);
69636
- if (!container)
69637
- return;
69638
69724
  // Expecting structure: [_, TopRow, questionRow, optionRow, ...]
69639
69725
  const TopRow = Array.from(element.children)[1];
69640
69726
  const questionRow = Array.from(element.children)[2];
@@ -69729,16 +69815,64 @@ const SumTogetherAnimation = async (element, value) => {
69729
69815
  elementAppearance(false);
69730
69816
  }
69731
69817
  };
69732
- const updatedAnswer = () => {
69818
+ function placeElementInDropZone(dropElement, dragElement, orientation, dropAttr) {
69819
+ const dropRect = dropElement.getBoundingClientRect();
69820
+ const dragRect = dragElement.getBoundingClientRect();
69821
+ const scale = typeof calculateScale === "function" ? calculateScale() : 1;
69822
+ if (!dropElement.dataset.dropCount)
69823
+ dropElement.dataset.dropCount = "0";
69824
+ let dropCount = parseInt(dropElement.dataset.dropCount, 10);
69825
+ // === READ DROP ZONE SIZE ===
69826
+ const dropWidth = dropRect.width;
69827
+ const dropHeight = dropRect.height;
69828
+ let targetX, targetY;
69829
+ // ---------------- LANDSCAPE WATERFALL ----------------
69830
+ if (orientation === "landscape" && dropAttr.toLowerCase() === "stackcascade") {
69831
+ console.log("🌄 Landscape waterfall");
69832
+ const shiftX = dropWidth * 0.02; // proportional (5% of width)
69833
+ const shiftY = dropHeight * 0.02; // proportional (5% of height)
69834
+ const startX = dropRect.left + dropWidth * 0.36; // 10% inside
69835
+ const startY = dropRect.top + dropHeight * -0.09; // slightly above
69836
+ targetX = startX + (dropCount * shiftX);
69837
+ targetY = startY + (dropCount * shiftY);
69838
+ }
69839
+ // ---------------- PORTRAIT VERTICAL ----------------
69840
+ else {
69841
+ console.log("📱 Portrait vertical stack");
69842
+ let startX;
69843
+ const stepY = dropHeight * 0.05; // 8% vertical step
69844
+ if (dropElement.id === "unitsDrop") {
69845
+ startX = dropRect.left + dropWidth * 0.4; // special spacing
69846
+ }
69847
+ else if (dropElement.id === "tensDrop") {
69848
+ startX = dropRect.left + dropWidth * 0.25;
69849
+ }
69850
+ else {
69851
+ startX = dropRect.left + dropWidth * 0.16; // normal spacing
69852
+ }
69853
+ const startY = dropRect.top - dropHeight * 0.25; // above start
69854
+ targetX = startX;
69855
+ targetY = startY + (dropCount * stepY);
69856
+ }
69857
+ // ------------ APPLY TRANSFORM SMOOTHLY --------------
69858
+ const dx = (targetX - dragRect.left) / scale;
69859
+ const dy = (targetY - dragRect.top) / scale;
69860
+ dragElement.style.transition = "transform .2s ease-out";
69861
+ dragElement.style.transform = `translate(${dx}px, ${dy}px)`;
69862
+ dropElement.dataset.dropCount = String(dropCount + 1);
69863
+ // reset size
69864
+ dragElement.style.width = "auto";
69865
+ dragElement.style.height = "auto";
69866
+ }
69867
+ const updateCalculatorAnswer = (el) => {
69733
69868
  const container = document.getElementById(LidoContainer);
69734
69869
  if (!container)
69735
69870
  return;
69736
- const answerText = container.querySelector('#answer');
69737
- if (!answerText)
69871
+ const calci = document.querySelector('#lidoCalculator');
69872
+ if (!calci)
69738
69873
  return;
69739
- const equationAttr = container.getAttribute('equationCheck') || '';
69740
- const calculatedValue = equationCheck(equationAttr);
69741
- answerText.setAttribute('string', String(calculatedValue));
69874
+ const value = calci.getAttribute('value');
69875
+ el.setAttribute('string', value);
69742
69876
  };
69743
69877
 
69744
- export { ActivityScoreKey as A, getDefaultExportFromCjs as B, tinyColor as C, triggerNextContainer as D, DropAction as E, validateObjectiveStatus as F, fraction as G, speakIcon as H, fingerUrl as I, LidoContainer as L, NextContainerKey as N, PrevContainerKey as P, RiveService as R, SelectedValuesKey as S, TraceMode as T, convertUrlToRelative as a, storingEachActivityScore as b, commonjsGlobal as c, executeActions as d, equationCheck as e, format as f, attachSpeakIcon as g, handlingChildElements as h, initEventsForElement as i, calculateScale as j, handleFloatElementPosition as k, handleElementClick as l, dispatchActivityChangeEvent as m, dispatchGameCompletedEvent as n, dispatchGameExitEvent as o, parseProp as p, AudioPlayer as q, generateUUIDFallback as r, setVisibilityWithDelay as s, exitUrl as t, prevUrl as u, nextUrl as v, speakUrl as w, getCancelBtnPopup as x, triggerPrevcontainer as y, setCancelBtnPopup as z };
69878
+ export { ActivityScoreKey as A, triggerPrevcontainer as B, setCancelBtnPopup as C, getDefaultExportFromCjs as D, tinyColor as E, DropAction as F, validateObjectiveStatus as G, fraction as H, speakIcon as I, fingerUrl as J, LidoContainer as L, NextContainerKey as N, PrevContainerKey as P, RiveService as R, SelectedValuesKey as S, TraceMode as T, convertUrlToRelative as a, storingEachActivityScore as b, commonjsGlobal as c, executeActions as d, equationCheck as e, format as f, attachSpeakIcon as g, handlingChildElements as h, initEventsForElement as i, calculateScale as j, handleFloatElementPosition as k, handleElementClick as l, dispatchActivityChangeEvent as m, dispatchGameCompletedEvent as n, dispatchGameExitEvent as o, parseProp as p, AudioPlayer as q, generateUUIDFallback as r, setVisibilityWithDelay as s, exitUrl as t, prevUrl as u, nextUrl as v, speakUrl as w, getCancelBtnPopup as x, matchStringPattern as y, triggerNextContainer as z };
@@ -1 +1 @@
1
- export{f as format}from"./p-9fd87d44.js";import"./p-9a9d5339.js";
1
+ export{f as format}from"./p-589fc3b8.js";import"./p-9a9d5339.js";