lido-player 0.0.2-beta-17 → 0.0.2-beta-18-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 (233) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/{decode-BPWgujpW.js → decode-DUZYNXIv.js} +1 -1
  3. package/dist/cjs/{index-BnfJD-Dp.js → index-BEjUmVtH.js} +185 -86
  4. package/dist/cjs/{index-CACb9dlg.js → index-DnqQXD5x.js} +53 -12
  5. package/dist/cjs/index.cjs.js +2 -2
  6. package/dist/cjs/lido-avatar_22.cjs.entry.js +61 -68
  7. package/dist/cjs/lido-player.cjs.js +3 -3
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/collection/collection-manifest.json +1 -1
  10. package/dist/collection/components/avatar/lido-avatar.css +4 -4
  11. package/dist/collection/components/avatar/lido-avatar.js +1 -1
  12. package/dist/collection/components/avatar/lido-avatar.tsx +207 -207
  13. package/dist/collection/components/avatar/readme.md +49 -49
  14. package/dist/collection/components/calculator/lido-calculator.css +89 -89
  15. package/dist/collection/components/calculator/lido-calculator.js +2 -2
  16. package/dist/collection/components/canvas/lido-canvas.css +33 -33
  17. package/dist/collection/components/canvas/lido-canvas.js +1 -1
  18. package/dist/collection/components/cell/lido-cell.css +100 -100
  19. package/dist/collection/components/cell/lido-cell.js +12 -12
  20. package/dist/collection/components/column/lido-col.css +19 -19
  21. package/dist/collection/components/column/lido-col.js +6 -6
  22. package/dist/collection/components/container/lido-container.css +10 -10
  23. package/dist/collection/components/container/lido-container.js +8 -8
  24. package/dist/collection/components/flashCard/lido-flash-card.css +28 -28
  25. package/dist/collection/components/flashCard/lido-flash-card.js +4 -4
  26. package/dist/collection/components/float/lido-float.css +30 -30
  27. package/dist/collection/components/float/lido-float.js +2 -2
  28. package/dist/collection/components/home/lido-home.css +309 -309
  29. package/dist/collection/components/home/lido-home.js +5 -5
  30. package/dist/collection/components/image/lido-image.css +17 -17
  31. package/dist/collection/components/image/lido-image.js +6 -6
  32. package/dist/collection/components/keyboard/lido-keyboard.css +38 -38
  33. package/dist/collection/components/keyboard/lido-keyboard.js +3 -3
  34. package/dist/collection/components/mathMatrix/lido-math-matrix.css +56 -56
  35. package/dist/collection/components/mathMatrix/lido-math-matrix.js +1 -1
  36. package/dist/collection/components/position/lido-pos.css +16 -16
  37. package/dist/collection/components/position/lido-pos.js +2 -2
  38. package/dist/collection/components/random/lido-random.css +8 -8
  39. package/dist/collection/components/random/lido-random.js +2 -2
  40. package/dist/collection/components/root/lido-root.js +5 -5
  41. package/dist/collection/components/row/lido-row.css +10 -10
  42. package/dist/collection/components/row/lido-row.js +6 -6
  43. package/dist/collection/components/scale/assets/Shadow.svg +9 -9
  44. package/dist/collection/components/scale/lido-balance.css +145 -145
  45. package/dist/collection/components/scale/lido-balance.js +13 -13
  46. package/dist/collection/components/shape/lido-shape.css +216 -216
  47. package/dist/collection/components/shape/lido-shape.js +6 -6
  48. package/dist/collection/components/slideFill/lido-slide-fill.css +3 -3
  49. package/dist/collection/components/slideFill/lido-slide-fill.js +13 -13
  50. package/dist/collection/components/text/lido-text.css +53 -53
  51. package/dist/collection/components/text/lido-text.js +31 -6
  52. package/dist/collection/components/trace/assets/Tracing-hand.svg +8 -8
  53. package/dist/collection/components/trace/lido-trace.css +97 -97
  54. package/dist/collection/components/trace/lido-trace.js +22 -35
  55. package/dist/collection/components/wrap/lido-wrap.css +18 -18
  56. package/dist/collection/components/wrap/lido-wrap.js +6 -6
  57. package/dist/collection/css/animation.css +211 -211
  58. package/dist/collection/css/index.css +315 -315
  59. package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +61 -61
  60. package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +123 -123
  61. package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +48 -48
  62. package/dist/collection/stories/Templates/Tag/tagGame.stories.js +39 -39
  63. package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +44 -44
  64. package/dist/collection/stories/Templates/balancing/balancing.stories.js +35 -35
  65. package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +38 -38
  66. package/dist/collection/stories/Templates/blender/blender.stories.js +63 -59
  67. package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
  68. package/dist/collection/stories/Templates/calculator/calculator.stories.js +28 -28
  69. package/dist/collection/stories/Templates/categorize/categorize.stories.js +37 -37
  70. package/dist/collection/stories/Templates/categorize2/categorize2.stories.js +67 -67
  71. package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +29 -29
  72. package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +13 -13
  73. package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +74 -74
  74. package/dist/collection/stories/Templates/dragAndDrop/drag-drop.stories.js +69 -69
  75. package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +43 -43
  76. package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +282 -282
  77. package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +35 -35
  78. package/dist/collection/stories/Templates/grid/grid.stories.js +118 -118
  79. package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +57 -57
  80. package/dist/collection/stories/Templates/imageMatch/imageMatch.stories.js +44 -44
  81. package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +41 -41
  82. package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +183 -183
  83. package/dist/collection/stories/Templates/makeSentence/make-sentence.stories.js +36 -36
  84. package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +69 -69
  85. package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +84 -84
  86. package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +31 -31
  87. package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +112 -112
  88. package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +47 -47
  89. package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +57 -57
  90. package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +53 -53
  91. package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +46 -46
  92. package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +45 -45
  93. package/dist/collection/stories/Templates/numberIdentification/numberIdentificationimageTotext.stories.js +56 -56
  94. package/dist/collection/stories/Templates/numberIdentification/numberIdentificationtextTotext.stories.js +53 -53
  95. package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +127 -127
  96. package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +47 -47
  97. package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +38 -38
  98. package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +97 -97
  99. package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +90 -90
  100. package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaMultiOption.stories.js +63 -63
  101. package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaSumTogether.stories.js +45 -45
  102. package/dist/collection/stories/Templates/palEgmaPatternMatching/palEgmaPatternMatching.stories.js +63 -63
  103. package/dist/collection/stories/Templates/palEgmaWordProblem/palEgmaWordProblem.stories.js +79 -79
  104. package/dist/collection/stories/Templates/palEgraInventedSpelling/pal_egra_invented_spelling_schema.stories.js +32 -32
  105. package/dist/collection/stories/Templates/palEgraMCQWithImage/palEgraMCQWithImage.stories.js +42 -42
  106. package/dist/collection/stories/Templates/palEgraOptionWithAudio/palEgraOptionWithAudio.stories.js +63 -63
  107. package/dist/collection/stories/Templates/palEgraStoryMaking/pal_egra_story_making.stories.js +44 -44
  108. package/dist/collection/stories/Templates/palEgraTemplate1/palEgraLetterIdentification.stories.js +34 -34
  109. package/dist/collection/stories/Templates/palEgraWordMatch/palEgraWordMatch.stories.js +52 -52
  110. package/dist/collection/stories/Templates/palEgra_OddOneOut/palEgra_oddOneOut.stories.js +33 -33
  111. package/dist/collection/stories/Templates/palEgra_arrange_pictures/palEgra_arrange_pictures.stories.js +40 -40
  112. package/dist/collection/stories/Templates/palEgra_build_word/palEgra_build_word.stories.js +48 -48
  113. package/dist/collection/stories/Templates/palEgra_word_formation/palEgra_WordFormation.stories.js +48 -48
  114. package/dist/collection/stories/Templates/palStorytale/palStorytale.stories.js +18 -18
  115. package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +44 -44
  116. package/dist/collection/stories/Templates/pictureClues/pictureClues.stories.js +34 -34
  117. package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch1.stories.js +36 -36
  118. package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch2.stories.js +30 -30
  119. package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +20 -20
  120. package/dist/collection/stories/Templates/puzzleGame/puzzleGame.stories.js +17 -17
  121. package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +58 -58
  122. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +50 -50
  123. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +36 -36
  124. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +43 -43
  125. package/dist/collection/stories/Templates/quizMaths/quizMaths.stories.js +631 -631
  126. package/dist/collection/stories/Templates/reorder/reorder.stories.js +63 -63
  127. package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +47 -47
  128. package/dist/collection/stories/Templates/sentenceMatch/sentenceMatch.stories.js +29 -29
  129. package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +64 -64
  130. package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +62 -62
  131. package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +106 -106
  132. package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +50 -50
  133. package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +41 -41
  134. package/dist/collection/stories/Templates/storyTale/storyTale.stories.js +39 -39
  135. package/dist/collection/stories/Templates/substraction/substractionWithimg.stories.js +62 -62
  136. package/dist/collection/stories/Templates/substraction/substractionWithoutImg.stories.js +42 -42
  137. package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +50 -50
  138. package/dist/collection/stories/Templates/tenBox/tenBox.stories.js +88 -88
  139. package/dist/collection/stories/Templates/total/total.stories.js +28 -28
  140. package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithimg.stories.js +35 -35
  141. package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithoutimg.stories.js +34 -34
  142. package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +31 -31
  143. package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +58 -58
  144. package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +44 -44
  145. package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +31 -31
  146. package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +34 -34
  147. package/dist/collection/stories/components/flash-card.stories.js +48 -48
  148. package/dist/collection/stories/components/keyboard.stories.js +10 -10
  149. package/dist/collection/stories/components/slider.stories.js +4 -4
  150. package/dist/collection/stories/components/trace.stories.js +5 -5
  151. package/dist/collection/utils/utils.js +26 -17
  152. package/dist/collection/utils/utilsHandlers/dragDropHandler.js +36 -16
  153. package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
  154. package/dist/collection/utils/utilsHandlers/slideHandler.js +80 -23
  155. package/dist/collection/utils/utilsHandlers/sortHandler.js +10 -10
  156. package/dist/components/index.js +1 -1
  157. package/dist/components/lido-avatar.js +1 -1
  158. package/dist/components/lido-balance.js +1 -1
  159. package/dist/components/lido-calculator.js +1 -1
  160. package/dist/components/lido-canvas.js +1 -1
  161. package/dist/components/lido-cell.js +1 -1
  162. package/dist/components/lido-col.js +1 -1
  163. package/dist/components/lido-container.js +1 -1
  164. package/dist/components/lido-flash-card.js +1 -1
  165. package/dist/components/lido-float.js +1 -1
  166. package/dist/components/lido-home.js +1 -1
  167. package/dist/components/lido-keyboard.js +1 -1
  168. package/dist/components/lido-math-matrix.js +1 -1
  169. package/dist/components/lido-pos.js +1 -1
  170. package/dist/components/lido-random.js +1 -1
  171. package/dist/components/lido-root.js +1 -1
  172. package/dist/components/lido-row.js +1 -1
  173. package/dist/components/lido-shape.js +1 -1
  174. package/dist/components/lido-slide-fill.js +1 -1
  175. package/dist/components/lido-text.js +1 -1
  176. package/dist/components/lido-trace.js +1 -1
  177. package/dist/components/lido-wrap.js +1 -1
  178. package/dist/components/{p-CCR42e0i.js → p-BE25wHoo.js} +1 -1
  179. package/dist/components/p-BNNX1Pew.js +12 -0
  180. package/dist/components/p-BSV5U72F.js +1 -0
  181. package/dist/components/{p-CTlcpv4a.js → p-BfwUqpXc.js} +1 -1
  182. package/dist/components/{p-CgsPIpg0.js → p-Bw-OC9iR.js} +1 -1
  183. package/dist/components/{p-C5WmmkI6.js → p-CPYnt0P-.js} +1 -1
  184. package/dist/components/p-CTlwn9r7.js +1 -0
  185. package/dist/components/{p-CIbBOu51.js → p-Cj-6tqzU.js} +1 -1
  186. package/dist/components/{p-BfqihbR6.js → p-CjdDpXfk.js} +1 -1
  187. package/dist/components/{p-BeRr8u5m.js → p-CwDTdXe5.js} +1 -1
  188. package/dist/components/{p-CXHPZN3m.js → p-CyGxEcn7.js} +1 -1
  189. package/dist/components/p-D-B1groh.js +1 -0
  190. package/dist/components/{p-DuvxecDX.js → p-D54c-ybm.js} +1 -1
  191. package/dist/components/p-DbR5sNOj.js +1 -0
  192. package/dist/components/{p-B8nzzM8c.js → p-DdQ1eqJr.js} +1 -1
  193. package/dist/components/{p-CxkH5UIf.js → p-SPZTb5fI.js} +1 -1
  194. package/dist/components/{p-BBHM059l.js → p-Sl9R-E6h.js} +1 -1
  195. package/dist/components/p-leIEepjl.js +1 -0
  196. package/dist/components/{p-C70ykycD.js → p-useuhkjH.js} +1 -1
  197. package/dist/components/{p-BXvoOUIv.js → p-yT7udDfd.js} +1 -1
  198. package/dist/esm/{decode-To5V_Qqp.js → decode-BgBfbPZu.js} +1 -1
  199. package/dist/esm/{index-Dnvog_Mm.js → index-BeHFCsWf.js} +53 -12
  200. package/dist/esm/{index-CEJsA_x_.js → index-D-29PaRa.js} +185 -86
  201. package/dist/esm/index.js +2 -2
  202. package/dist/esm/lido-avatar_22.entry.js +61 -68
  203. package/dist/esm/lido-player.js +4 -4
  204. package/dist/esm/loader.js +3 -3
  205. package/dist/lido-player/assets/Shadow.svg +9 -9
  206. package/dist/lido-player/assets/Tracing-hand.svg +8 -8
  207. package/dist/lido-player/index.esm.js +1 -1
  208. package/dist/lido-player/lido-avatar.css +4 -4
  209. package/dist/lido-player/lido-avatar.tsx +207 -207
  210. package/dist/lido-player/lido-player.css +7 -7
  211. package/dist/lido-player/lido-player.esm.js +1 -1
  212. package/dist/lido-player/{p-3b6e3b51.entry.js → p-856e1956.entry.js} +3 -3
  213. package/dist/lido-player/{p-DUx4nii8.js → p-BA2X6O7O.js} +1 -1
  214. package/dist/lido-player/p-BeHFCsWf.js +3 -0
  215. package/dist/lido-player/p-TuBmCgtK.js +1 -0
  216. package/dist/lido-player/readme.md +49 -49
  217. package/dist/types/components/text/lido-text.d.ts +6 -1
  218. package/dist/types/components/trace/lido-trace.d.ts +1 -1
  219. package/dist/types/components.d.ts +11 -0
  220. package/dist/types/stencil-public-runtime.d.ts +12 -0
  221. package/dist/types/types/json.d.ts +3 -3
  222. package/dist/types/utils/utilsHandlers/slideHandler.d.ts +5 -0
  223. package/loader/index.d.ts +1 -1
  224. package/package.json +74 -73
  225. package/readme.md +113 -113
  226. package/dist/components/p-CwIlwnQk.js +0 -1
  227. package/dist/components/p-DBbLGy4y.js +0 -12
  228. package/dist/components/p-DLyacZap.js +0 -1
  229. package/dist/components/p-DONbWJGn.js +0 -1
  230. package/dist/components/p-DVTigdH_.js +0 -1
  231. package/dist/components/p-Dv1cIsyS.js +0 -1
  232. package/dist/lido-player/p-Dnvog_Mm.js +0 -2
  233. package/dist/lido-player/p-gkKsw3a6.js +0 -1
@@ -1,4 +1,4 @@
1
- import { c as getAssetPath } from './index-Dnvog_Mm.js';
1
+ import { c as getAssetPath } from './index-BeHFCsWf.js';
2
2
 
3
3
  const DragMapKey = 'lidoDragMap';
4
4
  const SelectedValuesKey = 'lidoSelectedValues';
@@ -338,6 +338,7 @@ function dragDropAnimation(container, dragElement, dropElement) {
338
338
  }, 250);
339
339
  }
340
340
 
341
+ const isBlenderTemplate = (container) => (container === null || container === void 0 ? void 0 : container.getAttribute('template-id')) === 'blender';
341
342
  function buildDropHasDragFromDOM() {
342
343
  const dropHasDrag = {};
343
344
  const dropElements = document.querySelectorAll("[type='drop']");
@@ -395,7 +396,6 @@ function enableDraggingWithScaling(element) {
395
396
  let mutationFlag = false;
396
397
  // Fetch the container element
397
398
  const container = document.getElementById(LidoContainer);
398
- const templateId = container.getAttribute("template-id");
399
399
  if (!container) {
400
400
  console.error(`Container with ID "container" not found.`);
401
401
  return;
@@ -556,7 +556,7 @@ function enableDraggingWithScaling(element) {
556
556
  allElements.forEach(otherElement => {
557
557
  var _a;
558
558
  if (storedTabIndexes.includes(JSON.parse(otherElement.getAttribute('tab-index')))) {
559
- if (!(((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) && container.getAttribute("template-id") !== "blender") {
559
+ if (!(((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) && !isBlenderTemplate(container)) {
560
560
  if (otherElement) {
561
561
  setOpacityIfChanged(otherElement, "0.3");
562
562
  }
@@ -644,7 +644,7 @@ function enableDraggingWithScaling(element) {
644
644
  else {
645
645
  onElementDropComplete(element, mostOverlappedElement);
646
646
  }
647
- if (templateId === "blender" && element && mostOverlappedElement) {
647
+ if (isBlenderTemplate(container) && element && mostOverlappedElement) {
648
648
  const allElements = document.querySelectorAll(`*`);
649
649
  allElements.forEach(el => {
650
650
  removeHighlight(el);
@@ -872,7 +872,7 @@ async function handleResetDragElement(dragElement, dropElement, dropHasDrag, sel
872
872
  highlightElement();
873
873
  }
874
874
  async function onElementDropComplete(dragElement, dropElement) {
875
- var _a, _b, _c, _d, _e, _f, _g, _h;
875
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
876
876
  const container = document.getElementById(LidoContainer);
877
877
  const selectedValueData = (_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : "[]";
878
878
  const dragSelectedData = JSON.stringify(buildDragSelectedMapFromDOM());
@@ -1094,28 +1094,48 @@ async function onElementDropComplete(dragElement, dropElement) {
1094
1094
  // Add pulse and highlight effect for a successful match
1095
1095
  const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
1096
1096
  dispatchElementDropEvent(dragElement, dropElement, isCorrect);
1097
- if (container.getAttribute("template-id") !== "blender") {
1097
+ if (!isBlenderTemplate(container)) {
1098
1098
  storingEachActivityScore(isCorrect);
1099
1099
  }
1100
1100
  dragElement.style.opacity = '1';
1101
1101
  const allDropElements = document.querySelectorAll('.drop-element');
1102
1102
  allDropElements.forEach(el => updateDropBorder(el));
1103
+ if (isBlenderTemplate(container)) {
1104
+ const requiredDrops = Number((_j = dropElement.getAttribute('required-drops')) !== null && _j !== void 0 ? _j : 0);
1105
+ const placedDrops = document.querySelectorAll(`[${DropToAttr}="${dropElement.id}"]`).length;
1106
+ const action = placedDrops > 0 && placedDrops <= requiredDrops
1107
+ ? dropElement.getAttribute('onCorrect')
1108
+ : dropElement.getAttribute('onInCorrect');
1109
+ if (action) {
1110
+ await executeActions(action, dropElement, dragElement);
1111
+ }
1112
+ }
1103
1113
  highlightElement();
1104
1114
  await onActivityComplete(dragElement, dropElement);
1105
1115
  }
1106
1116
  function updateDropBorder(element) {
1117
+ var _a;
1107
1118
  if (!element || !element.classList.contains('drop-element'))
1108
1119
  return;
1109
1120
  const container = document.getElementById(LidoContainer);
1110
1121
  if (!container)
1111
1122
  return;
1112
1123
  const showBorder = container.getAttribute('show-drop-border');
1113
- if (showBorder !== 'true') {
1124
+ if (showBorder !== 'true' && !isBlenderTemplate(container)) {
1114
1125
  return;
1115
1126
  }
1116
1127
  const dropId = element.id;
1117
1128
  const dragSelectedElements = document.querySelectorAll(`[${DropToAttr}="${dropId}"]`);
1118
- if (dragSelectedElements.length > 0 && container.getAttribute("template-id") !== "blender") {
1129
+ if (isBlenderTemplate(container)) {
1130
+ const requiredDrops = Number((_a = element.getAttribute('required-drops')) !== null && _a !== void 0 ? _a : 0);
1131
+ const placedDrops = dragSelectedElements.length;
1132
+ const showCorrectBorder = placedDrops > 0 && placedDrops <= requiredDrops;
1133
+ element.classList.toggle('empty', !showCorrectBorder);
1134
+ element.classList.remove('filled');
1135
+ element.style.setProperty('border', showCorrectBorder ? '5px dashed green' : '5px dashed #f34d08', 'important');
1136
+ return;
1137
+ }
1138
+ if (dragSelectedElements.length > 0 && !isBlenderTemplate(container)) {
1119
1139
  element.classList.add('filled');
1120
1140
  element.classList.remove('empty');
1121
1141
  element.classList.remove('highlight-element');
@@ -1157,14 +1177,14 @@ async function onClickDropOrDragElement(element, type) {
1157
1177
  if (!document.querySelector('#dynamic-highlight-style')) {
1158
1178
  const style = document.createElement('style');
1159
1179
  style.id = 'dynamic-highlight-style';
1160
- style.innerHTML = `
1161
- .highlight {
1162
- // border: 4px solid #e74c3c; /* Thicker red border for more visibility */
1163
- // border-radius: 12px; /* Larger rounded corners */
1164
- // background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
1165
- // box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
1166
- // outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
1167
- }
1180
+ style.innerHTML = `
1181
+ .highlight {
1182
+ // border: 4px solid #e74c3c; /* Thicker red border for more visibility */
1183
+ // border-radius: 12px; /* Larger rounded corners */
1184
+ // background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
1185
+ // box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
1186
+ // outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
1187
+ }
1168
1188
  `;
1169
1189
  document.head.appendChild(style);
1170
1190
  }
@@ -1202,7 +1222,7 @@ async function onClickDropOrDragElement(element, type) {
1202
1222
  // Move the drag element to the drop position
1203
1223
  selectedDragElement.style.transform = `translate(${translateX}px, ${translateY}px)`;
1204
1224
  // Remove highlights after moving the element
1205
- if (container.getAttribute("template-id") !== "blender") {
1225
+ if (!isBlenderTemplate(container)) {
1206
1226
  const allElements = document.querySelectorAll(`*`);
1207
1227
  allElements.forEach(el => {
1208
1228
  removeHighlight(el);
@@ -1352,34 +1372,34 @@ function highlightSpeakingElement(element) {
1352
1372
  if (!document.getElementById(styleId)) {
1353
1373
  const style = document.createElement('style');
1354
1374
  style.id = styleId;
1355
- style.innerHTML = `
1356
- .speaking-highlight {
1357
- --base-transform: ${element.style.transform};
1358
- box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
1359
- // border: 3px solid green !important;
1360
- // transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
1361
- // transform: scale(1.05); /* Subtle scale effect to pop the element */
1362
- // animation: pulseEffect 1.5s infinite; /* Pulsing animation */
1363
-
1364
- }
1365
-
1366
- @keyframes pulseEffect {
1367
- 0% {
1368
- box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
1369
- // transform: var(--base-transform) scale(1.05);
1370
- // background-color: #FFFF0B;
1371
- }
1372
- 50% {
1373
- box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
1374
- // transform: var(--base-transform) scale(1.1);
1375
- // background-color: #FFFF0B;
1376
- }
1377
- 100% {
1378
- box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
1379
- // transform: var(--base-transform) scale(1.05);
1380
- // background-color: #FFFF0B;
1381
- }
1382
- }
1375
+ style.innerHTML = `
1376
+ .speaking-highlight {
1377
+ --base-transform: ${element.style.transform};
1378
+ box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
1379
+ // border: 3px solid green !important;
1380
+ // transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
1381
+ // transform: scale(1.05); /* Subtle scale effect to pop the element */
1382
+ // animation: pulseEffect 1.5s infinite; /* Pulsing animation */
1383
+
1384
+ }
1385
+
1386
+ @keyframes pulseEffect {
1387
+ 0% {
1388
+ box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
1389
+ // transform: var(--base-transform) scale(1.05);
1390
+ // background-color: #FFFF0B;
1391
+ }
1392
+ 50% {
1393
+ box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
1394
+ // transform: var(--base-transform) scale(1.1);
1395
+ // background-color: #FFFF0B;
1396
+ }
1397
+ 100% {
1398
+ box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
1399
+ // transform: var(--base-transform) scale(1.05);
1400
+ // background-color: #FFFF0B;
1401
+ }
1402
+ }
1383
1403
  `;
1384
1404
  document.head.appendChild(style);
1385
1405
  }
@@ -2091,11 +2111,11 @@ function enableReorderDrag(element) {
2091
2111
  onDropToCategory(element, category);
2092
2112
  }
2093
2113
  if (divEl) {
2094
- const keyframes = `
2095
- @keyframes widthDecrease {
2096
- 0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
2097
- 100% { width: 0px; height: 0px;}
2098
- }
2114
+ const keyframes = `
2115
+ @keyframes widthDecrease {
2116
+ 0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
2117
+ 100% { width: 0px; height: 0px;}
2118
+ }
2099
2119
  `;
2100
2120
  const styleSheet = document.styleSheets[0];
2101
2121
  styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
@@ -2308,11 +2328,11 @@ function moveWithAnimation(target, overlapped) {
2308
2328
  const dummy = createDummyElement(target);
2309
2329
  dummy.style.visibility = 'hidden';
2310
2330
  dummy.setAttribute('type', 'dummy');
2311
- const keyframes = `
2312
- @keyframes widthIncrease {
2313
- 0% { width: 0px; height: 0px; }
2314
- 100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
2315
- }
2331
+ const keyframes = `
2332
+ @keyframes widthIncrease {
2333
+ 0% { width: 0px; height: 0px; }
2334
+ 100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
2335
+ }
2316
2336
  `;
2317
2337
  if (!overlapped) {
2318
2338
  const overlapCategory = findMostoverlappedElement(target, 'category');
@@ -2379,12 +2399,6 @@ async function onDropToCategory(dragElement, categoryElement) {
2379
2399
  }
2380
2400
 
2381
2401
  const delay = (ms) => new Promise(res => setTimeout(res, ms));
2382
- const syncSlideOrder = (container) => {
2383
- const slideOrder = Array.from(container.querySelectorAll("[type='slide']"))
2384
- .map(item => item['value']);
2385
- container.setAttribute(SelectedValuesKey, JSON.stringify(slideOrder));
2386
- return slideOrder;
2387
- };
2388
2402
  const slideAnimation = async () => {
2389
2403
  const container = document.getElementById(LidoContainer);
2390
2404
  if (!container)
@@ -2445,10 +2459,10 @@ function slidingWithScaling(element) {
2445
2459
  const container = document.getElementById(LidoContainer);
2446
2460
  if (container.getAttribute('canplay') === 'false')
2447
2461
  return;
2448
- // Slide activities can start in the correct order. Keep their initial DOM
2449
- // order available to the Next/check validation before the first swap occurs.
2450
- syncSlideOrder(container);
2451
2462
  const onStart = (event) => {
2463
+ const templateId = container.getAttribute('template-id');
2464
+ if ((templateId === 'arrangeLetters' || templateId === 'reorder') && container.getAttribute('game-completed') === 'true')
2465
+ return;
2452
2466
  removeHighlight(element);
2453
2467
  isDragging = true;
2454
2468
  elementRect = element.getBoundingClientRect();
@@ -2596,7 +2610,7 @@ function slidingWithScaling(element) {
2596
2610
  element.style.transform = 'translate(0, 0)';
2597
2611
  setTimeout(() => {
2598
2612
  if (overlapElement) {
2599
- slideCompleted(element);
2613
+ void slideCompleted(element);
2600
2614
  overlapElement = false;
2601
2615
  }
2602
2616
  }, 300);
@@ -2620,20 +2634,95 @@ function slidingWithScaling(element) {
2620
2634
  element.addEventListener('touchstart', onStart);
2621
2635
  element.addEventListener(LIDO_INTERACTION_CLEANUP_EVENT, cleanup);
2622
2636
  }
2623
- const slideCompleted = (slideElement) => {
2637
+ const isArrangeLettersContainer = (container) => container.getAttribute('template-id') === 'arrangeLetters';
2638
+ const isReorderContainer = (container) => container.getAttribute('template-id') === 'reorder';
2639
+ const getSlideValuesForValidation = (container, slideElements) => {
2640
+ if (isReorderContainer(container)) {
2641
+ return slideElements.map(element => element.id);
2642
+ }
2643
+ return slideElements.map(element => element['value']);
2644
+ };
2645
+ const updateArrangeLettersCorrectness = (container, slideValues, objectiveValues) => {
2646
+ const slideElements = Array.from(container.querySelectorAll('[type="slide"]'));
2647
+ slideElements.forEach((element, index) => {
2648
+ const isCorrect = index < objectiveValues.length && slideValues[index] === objectiveValues[index].trim();
2649
+ if (isCorrect) {
2650
+ applyBorderToClickableCell(element, '#65BC46');
2651
+ }
2652
+ else {
2653
+ element.style.removeProperty('box-shadow');
2654
+ }
2655
+ });
2656
+ };
2657
+ const isArrangeLettersComplete = (slideValues, objectiveString) => {
2658
+ if (!objectiveString)
2659
+ return false;
2660
+ const objectiveValues = objectiveString.split(',').map(value => value.trim());
2661
+ return slideValues.length === objectiveValues.length
2662
+ && slideValues.every((value, index) => value === objectiveValues[index]);
2663
+ };
2664
+ const updateReorderCorrectness = (container, slideValues, objectiveValues) => {
2665
+ const slideElements = Array.from(container.querySelectorAll('[type="slide"]'));
2666
+ slideElements.forEach((element, index) => {
2667
+ const isCorrect = index < objectiveValues.length && slideValues[index] === objectiveValues[index].trim();
2668
+ if (isCorrect) {
2669
+ applyBorderToClickableCell(element, '#65BC46');
2670
+ }
2671
+ else {
2672
+ element.style.removeProperty('box-shadow');
2673
+ }
2674
+ });
2675
+ };
2676
+ const isReorderComplete = (slideValues, objectiveString) => {
2677
+ if (!objectiveString)
2678
+ return false;
2679
+ const objectiveValues = objectiveString.split(',').map(value => value.trim());
2680
+ return slideValues.length === objectiveValues.length
2681
+ && slideValues.every((value, index) => value === objectiveValues[index]);
2682
+ };
2683
+ const slideCompleted = async (slideElement) => {
2684
+ var _a;
2624
2685
  const container = document.getElementById(LidoContainer);
2625
- const slideArr = syncSlideOrder(container);
2686
+ const slideArr = JSON.parse((_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : '[]');
2687
+ const allSlideElements = Array.from(document.querySelectorAll("[type='slide']"));
2688
+ const slideValues = getSlideValuesForValidation(container, allSlideElements);
2689
+ slideValues.forEach((value, index) => {
2690
+ slideArr[index] = value;
2691
+ });
2692
+ container.setAttribute(SelectedValuesKey, JSON.stringify(slideArr));
2626
2693
  const objectiveString = document.getElementById(LidoContainer)['objective'];
2627
2694
  const objectiveArray = objectiveString.split(',');
2628
- const elementIndex = slideArr.indexOf(slideElement['value']);
2629
- const isCorrect = matchStringPattern(slideElement['value'], [objectiveArray[elementIndex].trim()]);
2695
+ const elementIndex = allSlideElements.indexOf(slideElement);
2696
+ const isCorrect = elementIndex >= 0 && elementIndex < objectiveArray.length
2697
+ ? matchStringPattern(slideValues[elementIndex], [objectiveArray[elementIndex].trim()])
2698
+ : false;
2699
+ if (isArrangeLettersContainer(container)) {
2700
+ updateArrangeLettersCorrectness(container, slideValues, objectiveArray);
2701
+ }
2702
+ else if (isReorderContainer(container)) {
2703
+ updateReorderCorrectness(container, slideValues, objectiveArray);
2704
+ }
2630
2705
  if (container.getAttribute('is-continue-on-correct') === 'true') {
2631
2706
  storingEachActivityScore(true);
2632
- // validationForSlideHandler();
2633
2707
  }
2634
2708
  else {
2635
2709
  storingEachActivityScore(isCorrect);
2636
2710
  }
2711
+ if (isArrangeLettersContainer(container) || isReorderContainer(container)) {
2712
+ await validationForSlideHandler(slideValues);
2713
+ }
2714
+ };
2715
+ const validationForSlideHandler = async (slideValues) => {
2716
+ const container = document.getElementById(LidoContainer);
2717
+ if (!container || (!isArrangeLettersContainer(container) && !isReorderContainer(container)) || container.getAttribute('game-completed') === 'true')
2718
+ return;
2719
+ const objectiveString = document.getElementById(LidoContainer)['objective'];
2720
+ const isComplete = isArrangeLettersContainer(container)
2721
+ ? isArrangeLettersComplete(slideValues, objectiveString)
2722
+ : isReorderComplete(slideValues, objectiveString);
2723
+ if (isComplete) {
2724
+ await validateObjectiveStatus();
2725
+ }
2637
2726
  };
2638
2727
 
2639
2728
  const getContainerScale = (container) => {
@@ -72853,9 +72942,11 @@ const executeActions = async (actionsString, thisElement, element) => {
72853
72942
  if (dropTo === "hundredsDrop")
72854
72943
  hundreds++;
72855
72944
  });
72856
- const unitsValue = units * 1;
72857
- const tensValue = tens * 10;
72858
- const hundredsValue = hundreds * 100;
72945
+ // Blender displays the number of blocks placed in each column.
72946
+ // Blender's drag/drop values are also the required block counts.
72947
+ const unitsValue = units;
72948
+ const tensValue = tens;
72949
+ const hundredsValue = hundreds;
72859
72950
  // ✅ Update Lido Text Boxes
72860
72951
  const unitsBox = document.getElementById("units");
72861
72952
  const tensBox = document.getElementById("tens");
@@ -72913,11 +73004,11 @@ const afterDropDragHandling = (dragElement, dropElement) => {
72913
73004
  }
72914
73005
  dummyElement.setAttribute('id', dragElement.getAttribute('id'));
72915
73006
  dragElement.replaceWith(dummyElement);
72916
- const keyframes = `
72917
- @keyframes widthDecrease {
72918
- 0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
72919
- 100% { width: 0px; height: 0px; margin: 0px;}
72920
- }
73007
+ const keyframes = `
73008
+ @keyframes widthDecrease {
73009
+ 0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
73010
+ 100% { width: 0px; height: 0px; margin: 0px;}
73011
+ }
72921
73012
  `;
72922
73013
  if (!isInfinite) {
72923
73014
  dummyElement.style.width = element.style.width;
@@ -73122,13 +73213,21 @@ const calculateScore = () => {
73122
73213
  gameScore.wrongMoves = 0;
73123
73214
  };
73124
73215
  async function onActivityComplete(dragElement, dropElement) {
73125
- var _a, _b;
73216
+ var _a, _b, _c;
73126
73217
  const container = document.getElementById(LidoContainer);
73127
73218
  if (!container)
73128
73219
  return;
73220
+ const isBlender = container.getAttribute('template-id') === 'blender';
73129
73221
  await executeActions("this.alignMatch='true'", dropElement, dragElement);
73130
73222
  if (dragElement && dropElement) {
73131
- const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
73223
+ let isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
73224
+ if (isBlender) {
73225
+ const requiredDrops = Number((_a = dropElement.getAttribute('required-drops')) !== null && _a !== void 0 ? _a : 0);
73226
+ const placedDrops = document.querySelectorAll(`[drop-to="${dropElement.id}"]`).length;
73227
+ // Blender accepts every count from 1 through the required count.
73228
+ // Zero or an overfilled drop zone uses the incorrect action.
73229
+ isCorrect = placedDrops > 0 && placedDrops <= requiredDrops;
73230
+ }
73132
73231
  // storing each activity score based on isCorrect for (all drag-drop events)
73133
73232
  // storingEachActivityScore(isCorrect);
73134
73233
  if (isCorrect) {
@@ -73137,10 +73236,10 @@ async function onActivityComplete(dragElement, dropElement) {
73137
73236
  console.log("Right Moves : ", gameScore.rightMoves);
73138
73237
  console.log("Wrong Moves : ", gameScore.wrongMoves);
73139
73238
  }
73140
- const onCorrect = ((_a = container.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.EnableAnimation.toLowerCase()
73239
+ const onCorrect = ((_b = container.getAttribute('dropAttr')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === DropMode.EnableAnimation.toLowerCase()
73141
73240
  ? ''
73142
73241
  : dropElement.getAttribute('onCorrect');
73143
- if (onCorrect) {
73242
+ if (onCorrect && !isBlender) {
73144
73243
  await executeActions(onCorrect, dropElement, dragElement);
73145
73244
  }
73146
73245
  //for multiply beeds
@@ -73155,7 +73254,7 @@ async function onActivityComplete(dragElement, dropElement) {
73155
73254
  console.log("Wrong Moves : ", gameScore.wrongMoves);
73156
73255
  }
73157
73256
  const onInCorrect = dropElement.getAttribute('onInCorrect');
73158
- if (onInCorrect) {
73257
+ if (onInCorrect && !isBlender) {
73159
73258
  await executeActions(onInCorrect, dropElement, dragElement);
73160
73259
  }
73161
73260
  }
@@ -73164,7 +73263,7 @@ async function onActivityComplete(dragElement, dropElement) {
73164
73263
  const sortedValues = getSortedValuesArrayFromMap(dragScore);
73165
73264
  container.setAttribute(SelectedValuesKey, JSON.stringify(sortedValues));
73166
73265
  //localStorage
73167
- let drag = JSON.parse((_b = localStorage.getItem(DragMapKey)) !== null && _b !== void 0 ? _b : '{}');
73266
+ let drag = JSON.parse((_c = localStorage.getItem(DragMapKey)) !== null && _c !== void 0 ? _c : '{}');
73168
73267
  const index = dropElement.getAttribute('tab-index');
73169
73268
  if (!drag[index]) {
73170
73269
  drag[index] = [];
@@ -73225,7 +73324,7 @@ const storeActivityScore = (score) => {
73225
73324
  activityScore[activityScoreKey] = score;
73226
73325
  //send Custom Event to parent
73227
73326
  // window.dispatchEvent(new CustomEvent(ActivityEndKey, { detail: { index: index, totalIndex: totalIndex, score: score } }));
73228
- const actualActivitySeconds = Number((Timer.getI().getElapsed() / 1000).toFixed(1));
73327
+ const actualActivitySeconds = Math.ceil(Timer.getI().getElapsed() / 1000);
73229
73328
  ACTIVYTY_TIME_SPEND_ARRAY.push(actualActivitySeconds);
73230
73329
  console.log(`[Utils][Activity Time] Activity ${index + 1}/${totalIndex} - Time spent: ${actualActivitySeconds}s`);
73231
73330
  const lessonTrackingParams = getLessonTrackingParams();
@@ -73237,7 +73336,7 @@ const storeActivityScore = (score) => {
73237
73336
  gameScore.finalScore = Math.floor(finalScore);
73238
73337
  console.log('Total Score : ', gameScore.finalScore);
73239
73338
  // window.dispatchEvent(new CustomEvent(LessonEndKey, { detail: { score: finalScore } }));
73240
- const timeSpendForLesson = Number(ACTIVYTY_TIME_SPEND_ARRAY.reduce((sum, current) => sum + current, 0).toFixed(1));
73339
+ const timeSpendForLesson = ACTIVYTY_TIME_SPEND_ARRAY.reduce((sum, current) => sum + current, 0);
73241
73340
  console.log(`[Utils][Lesson Time] Total lesson time spent: ${timeSpendForLesson}s`);
73242
73341
  dispatchLessonEndEvent(totalIndex, gameScore.totalRightMovesCount, gameScore.totalWrongMovesCount, finalScore, timeSpendForLesson, lessonTrackingParams);
73243
73342
  gameScore.totalRightMovesCount = 0;
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { $ as format } from './index-CEJsA_x_.js';
2
- import './index-Dnvog_Mm.js';
1
+ export { $ as format } from './index-D-29PaRa.js';
2
+ import './index-BeHFCsWf.js';