lido-player 0.0.2-beta-21-dev → 0.0.2-beta-23-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-Buln7Iaf.js → decode-BDs2S8om.js} +1 -1
  3. package/dist/cjs/{index-Bb_TFgTA.js → index-D5olYRJo.js} +274 -89
  4. package/dist/cjs/{index-DBCFoh1I.js → index-DnaH8sO-.js} +1 -1
  5. package/dist/cjs/index.cjs.js +2 -2
  6. package/dist/cjs/lido-avatar_22.cjs.entry.js +190 -46
  7. package/dist/cjs/lido-player.cjs.js +2 -2
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/collection/components/avatar/lido-avatar.css +4 -4
  10. package/dist/collection/components/avatar/lido-avatar.js +1 -1
  11. package/dist/collection/components/avatar/lido-avatar.tsx +207 -207
  12. package/dist/collection/components/avatar/readme.md +49 -49
  13. package/dist/collection/components/calculator/lido-calculator.css +89 -89
  14. package/dist/collection/components/calculator/lido-calculator.js +2 -2
  15. package/dist/collection/components/canvas/lido-canvas.css +33 -33
  16. package/dist/collection/components/canvas/lido-canvas.js +1 -1
  17. package/dist/collection/components/cell/lido-cell.css +100 -100
  18. package/dist/collection/components/cell/lido-cell.js +12 -12
  19. package/dist/collection/components/column/lido-col.css +19 -19
  20. package/dist/collection/components/column/lido-col.js +6 -6
  21. package/dist/collection/components/container/lido-container.css +10 -10
  22. package/dist/collection/components/container/lido-container.js +8 -8
  23. package/dist/collection/components/flashCard/lido-flash-card.css +46 -28
  24. package/dist/collection/components/flashCard/lido-flash-card.js +158 -14
  25. package/dist/collection/components/float/lido-float.css +30 -30
  26. package/dist/collection/components/float/lido-float.js +2 -2
  27. package/dist/collection/components/home/lido-home.css +309 -309
  28. package/dist/collection/components/home/lido-home.js +9 -6
  29. package/dist/collection/components/image/lido-image.css +17 -17
  30. package/dist/collection/components/image/lido-image.js +6 -6
  31. package/dist/collection/components/keyboard/lido-keyboard.css +38 -38
  32. package/dist/collection/components/keyboard/lido-keyboard.js +3 -3
  33. package/dist/collection/components/mathMatrix/lido-math-matrix.css +56 -56
  34. package/dist/collection/components/mathMatrix/lido-math-matrix.js +1 -1
  35. package/dist/collection/components/position/lido-pos.css +16 -16
  36. package/dist/collection/components/position/lido-pos.js +2 -2
  37. package/dist/collection/components/random/lido-random.css +8 -8
  38. package/dist/collection/components/random/lido-random.js +2 -2
  39. package/dist/collection/components/root/lido-root.js +5 -5
  40. package/dist/collection/components/row/lido-row.css +10 -10
  41. package/dist/collection/components/row/lido-row.js +6 -6
  42. package/dist/collection/components/scale/assets/Shadow.svg +9 -9
  43. package/dist/collection/components/scale/lido-balance.css +174 -145
  44. package/dist/collection/components/scale/lido-balance.js +54 -14
  45. package/dist/collection/components/shape/lido-shape.css +216 -216
  46. package/dist/collection/components/shape/lido-shape.js +6 -6
  47. package/dist/collection/components/slideFill/lido-slide-fill.css +3 -3
  48. package/dist/collection/components/slideFill/lido-slide-fill.js +13 -13
  49. package/dist/collection/components/text/lido-text.css +53 -53
  50. package/dist/collection/components/text/lido-text.js +5 -5
  51. package/dist/collection/components/trace/assets/Tracing-hand.svg +8 -8
  52. package/dist/collection/components/trace/lido-trace.css +97 -97
  53. package/dist/collection/components/trace/lido-trace.js +3 -3
  54. package/dist/collection/components/wrap/lido-wrap.css +18 -18
  55. package/dist/collection/components/wrap/lido-wrap.js +6 -6
  56. package/dist/collection/css/animation.css +211 -211
  57. package/dist/collection/css/index.css +323 -323
  58. package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +61 -61
  59. package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +123 -123
  60. package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +48 -48
  61. package/dist/collection/stories/Templates/Tag/tagGame.stories.js +39 -39
  62. package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +44 -44
  63. package/dist/collection/stories/Templates/balancing/balancing.stories.js +35 -35
  64. package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +38 -38
  65. package/dist/collection/stories/Templates/blender/blender.stories.js +59 -59
  66. package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
  67. package/dist/collection/stories/Templates/calculator/calculator.stories.js +28 -28
  68. package/dist/collection/stories/Templates/categorize/categorize.stories.js +37 -37
  69. package/dist/collection/stories/Templates/categorize2/categorize2.stories.js +67 -67
  70. package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +29 -29
  71. package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +13 -13
  72. package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +74 -74
  73. package/dist/collection/stories/Templates/dragAndDrop/drag-drop.stories.js +69 -69
  74. package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +43 -43
  75. package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +282 -282
  76. package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +35 -35
  77. package/dist/collection/stories/Templates/grid/grid.stories.js +118 -118
  78. package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +57 -57
  79. package/dist/collection/stories/Templates/imageMatch/imageMatch.stories.js +44 -44
  80. package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +41 -41
  81. package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +183 -183
  82. package/dist/collection/stories/Templates/makeSentence/make-sentence.stories.js +36 -36
  83. package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +69 -69
  84. package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +84 -84
  85. package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +31 -31
  86. package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +112 -112
  87. package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +47 -47
  88. package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +57 -57
  89. package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +53 -53
  90. package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +46 -46
  91. package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +45 -45
  92. package/dist/collection/stories/Templates/numberIdentification/numberIdentificationimageTotext.stories.js +56 -56
  93. package/dist/collection/stories/Templates/numberIdentification/numberIdentificationtextTotext.stories.js +53 -53
  94. package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +127 -127
  95. package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +47 -47
  96. package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +38 -38
  97. package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +97 -97
  98. package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +90 -90
  99. package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaMultiOption.stories.js +63 -63
  100. package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaSumTogether.stories.js +45 -45
  101. package/dist/collection/stories/Templates/palEgmaPatternMatching/palEgmaPatternMatching.stories.js +63 -63
  102. package/dist/collection/stories/Templates/palEgmaWordProblem/palEgmaWordProblem.stories.js +79 -79
  103. package/dist/collection/stories/Templates/palEgraInventedSpelling/pal_egra_invented_spelling_schema.stories.js +32 -32
  104. package/dist/collection/stories/Templates/palEgraMCQWithImage/palEgraMCQWithImage.stories.js +42 -42
  105. package/dist/collection/stories/Templates/palEgraOptionWithAudio/palEgraOptionWithAudio.stories.js +63 -63
  106. package/dist/collection/stories/Templates/palEgraStoryMaking/pal_egra_story_making.stories.js +44 -44
  107. package/dist/collection/stories/Templates/palEgraTemplate1/palEgraLetterIdentification.stories.js +34 -34
  108. package/dist/collection/stories/Templates/palEgraWordMatch/palEgraWordMatch.stories.js +52 -52
  109. package/dist/collection/stories/Templates/palEgra_OddOneOut/palEgra_oddOneOut.stories.js +33 -33
  110. package/dist/collection/stories/Templates/palEgra_arrange_pictures/palEgra_arrange_pictures.stories.js +40 -40
  111. package/dist/collection/stories/Templates/palEgra_build_word/palEgra_build_word.stories.js +48 -48
  112. package/dist/collection/stories/Templates/palEgra_word_formation/palEgra_WordFormation.stories.js +48 -48
  113. package/dist/collection/stories/Templates/palStorytale/palStorytale.stories.js +18 -18
  114. package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +44 -44
  115. package/dist/collection/stories/Templates/pictureClues/pictureClues.stories.js +34 -34
  116. package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch1.stories.js +36 -36
  117. package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch2.stories.js +30 -30
  118. package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +20 -20
  119. package/dist/collection/stories/Templates/puzzleGame/puzzleGame.stories.js +17 -17
  120. package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +58 -58
  121. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +50 -50
  122. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +36 -36
  123. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +43 -43
  124. package/dist/collection/stories/Templates/quizMaths/quizMaths.stories.js +631 -631
  125. package/dist/collection/stories/Templates/reorder/reorder.stories.js +63 -63
  126. package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +47 -47
  127. package/dist/collection/stories/Templates/sentenceMatch/sentenceMatch.stories.js +29 -29
  128. package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +64 -64
  129. package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +62 -62
  130. package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +106 -106
  131. package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +50 -50
  132. package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +41 -41
  133. package/dist/collection/stories/Templates/storyTale/storyTale.stories.js +39 -39
  134. package/dist/collection/stories/Templates/substraction/substractionWithimg.stories.js +62 -62
  135. package/dist/collection/stories/Templates/substraction/substractionWithoutImg.stories.js +42 -42
  136. package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +50 -50
  137. package/dist/collection/stories/Templates/tenBox/tenBox.stories.js +88 -88
  138. package/dist/collection/stories/Templates/total/total.stories.js +28 -28
  139. package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithimg.stories.js +35 -35
  140. package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithoutimg.stories.js +34 -34
  141. package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +31 -31
  142. package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +58 -58
  143. package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +44 -44
  144. package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +31 -31
  145. package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +34 -34
  146. package/dist/collection/stories/components/flash-card.stories.js +48 -48
  147. package/dist/collection/stories/components/keyboard.stories.js +10 -10
  148. package/dist/collection/stories/components/slider.stories.js +4 -4
  149. package/dist/collection/stories/components/trace.stories.js +5 -5
  150. package/dist/collection/utils/audioPlayer.js +9 -12
  151. package/dist/collection/utils/utils.js +24 -8
  152. package/dist/collection/utils/utilsHandlers/dragDropHandler.js +145 -30
  153. package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
  154. package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +58 -1
  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-BOQDbCrm.js → p-BJiyBHYT.js} +1 -1
  179. package/dist/components/{p-CTlcpv4a.js → p-BfwUqpXc.js} +1 -1
  180. package/dist/components/p-BiBt9LGP.js +1 -0
  181. package/dist/components/{p-CgsPIpg0.js → p-Bw-OC9iR.js} +1 -1
  182. package/dist/components/{p-B4YAipq-.js → p-CFzvgrMa.js} +1 -1
  183. package/dist/components/{p-C5WmmkI6.js → p-CPYnt0P-.js} +1 -1
  184. package/dist/components/{p-CCR42e0i.js → p-ChfVUoX4.js} +1 -1
  185. package/dist/components/{p-BeRr8u5m.js → p-CwDTdXe5.js} +1 -1
  186. package/dist/components/{p-CXHPZN3m.js → p-CyGxEcn7.js} +1 -1
  187. package/dist/components/p-D0cGjo5e.js +1 -0
  188. package/dist/components/{p-BJMjg5wu.js → p-D2GhaM-T.js} +1 -1
  189. package/dist/components/{p-BBHM059l.js → p-DDS30M3y.js} +1 -1
  190. package/dist/components/p-DP6jQ5ML.js +1 -0
  191. package/dist/components/{p-CljvnHkI.js → p-DZRNZCPt.js} +1 -1
  192. package/dist/components/p-DbR5sNOj.js +1 -0
  193. package/dist/components/{p-B8nzzM8c.js → p-DdQ1eqJr.js} +1 -1
  194. package/dist/components/{p-wF7SBGpr.js → p-Ds-d6wd0.js} +2 -2
  195. package/dist/components/p-Lg85waqZ.js +1 -0
  196. package/dist/components/p-leIEepjl.js +1 -0
  197. package/dist/components/{p-C70ykycD.js → p-useuhkjH.js} +1 -1
  198. package/dist/esm/{decode-B_VrYFdJ.js → decode-CAwfe7ub.js} +1 -1
  199. package/dist/esm/{index-mMpK8062.js → index-Dvjbti-h.js} +1 -1
  200. package/dist/esm/{index-B-VyHxJa.js → index-bo7729YG.js} +274 -89
  201. package/dist/esm/index.js +2 -2
  202. package/dist/esm/lido-avatar_22.entry.js +190 -46
  203. package/dist/esm/lido-player.js +3 -3
  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-461a3d23.entry.js +12 -0
  213. package/dist/lido-player/{p-Cw84dpIR.js → p-D4kAEWCU.js} +1 -1
  214. package/dist/lido-player/p-Dvjbti-h.js +2 -0
  215. package/dist/lido-player/p-VRJMO_sg.js +1 -0
  216. package/dist/lido-player/readme.md +49 -49
  217. package/dist/types/components/flashCard/lido-flash-card.d.ts +14 -0
  218. package/dist/types/components/scale/lido-balance.d.ts +5 -0
  219. package/dist/types/components.d.ts +10 -0
  220. package/dist/types/types/json.d.ts +3 -3
  221. package/dist/types/utils/audioPlayer.d.ts +1 -1
  222. package/dist/types/utils/utilsHandlers/lidoBalanceHandler.d.ts +10 -0
  223. package/package.json +74 -74
  224. package/readme.md +113 -113
  225. package/dist/components/p-BAfFgI9q.js +0 -1
  226. package/dist/components/p-BfqihbR6.js +0 -1
  227. package/dist/components/p-CwIlwnQk.js +0 -1
  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/lido-player/p-744dee1c.entry.js +0 -12
  232. package/dist/lido-player/p-BK926Rl3.js +0 -1
  233. package/dist/lido-player/p-mMpK8062.js +0 -2
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2018
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2018
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Bb_TFgTA.js');
3
+ var index = require('./index-D5olYRJo.js');
4
4
 
5
5
  function _mergeNamespaces(n, m) {
6
6
  m.forEach(function (e) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index$1 = require('./index-DBCFoh1I.js');
3
+ var index$1 = require('./index-DnaH8sO-.js');
4
4
 
5
5
  const DragMapKey = 'lidoDragMap';
6
6
  const SelectedValuesKey = 'lidoSelectedValues';
@@ -199,7 +199,51 @@ class RiveService {
199
199
  }
200
200
  }
201
201
 
202
+ /**
203
+ * Mount a drag item on a balance plate without using the generic
204
+ * `drop-action="move"` flow. The generic flow creates a new source placeholder
205
+ * for every move, which makes a previously used plate become the item's source.
206
+ *
207
+ * A balance item gets exactly one home placeholder: its original source. It can
208
+ * then move freely between plate parents while continuing to inherit the plate's
209
+ * tilt translation.
210
+ */
211
+ function placeDragOnBalancePlate(dragElement, dropElement) {
212
+ var _a;
213
+ const balanceEl = document.querySelector('lido-balance');
214
+ const plateParent = dropElement === null || dropElement === void 0 ? void 0 : dropElement.parentElement;
215
+ if (!balanceEl || !plateParent)
216
+ return;
217
+ const drag = dragElement;
218
+ if (!((_a = drag.__lidoBalanceHome) === null || _a === void 0 ? void 0 : _a.isConnected)) {
219
+ const home = document.createElement('div');
220
+ home.className = 'lido-balance-source-placeholder';
221
+ home.setAttribute('aria-hidden', 'true');
222
+ drag.replaceWith(home);
223
+ drag.__lidoBalanceHome = home;
224
+ }
225
+ // Appending an existing element moves it; it does not leave a second
226
+ // placeholder in the previous plate.
227
+ plateParent.append(drag);
228
+ drag.style.position = 'absolute';
229
+ drag.style.zIndex = '1';
230
+ // The generic drag handler also uses transform. Disable transitions while
231
+ // changing parents and calculating the new local offset so this is one
232
+ // placement, rather than a right/left correction animation.
233
+ drag.style.transition = 'none';
234
+ drag.style.transform = 'translate(0, 0)';
235
+ const dropRect = dropElement.getBoundingClientRect();
236
+ const dragRect = drag.getBoundingClientRect();
237
+ const scale = calculateScale() || 1;
238
+ const x = (dropRect.left + dropRect.width / 2 - (dragRect.left + dragRect.width / 2)) / scale;
239
+ const y = (dropRect.top + dropRect.height / 2 - (dragRect.top + dragRect.height / 2)) / scale;
240
+ drag.style.transform = `translate(${x}px, ${y}px)`;
241
+ requestAnimationFrame(() => {
242
+ drag.style.transition = '';
243
+ });
244
+ }
202
245
  function updateBalanceOnDrop(dragElement, dropElement) {
246
+ var _a, _b;
203
247
  const balanceEl = document.querySelector('lido-balance');
204
248
  if (!balanceEl)
205
249
  return;
@@ -207,7 +251,20 @@ function updateBalanceOnDrop(dragElement, dropElement) {
207
251
  const rightDrag = Array.from(document.querySelectorAll('[drop-to^="righthandle"]'));
208
252
  balanceEl.leftVal = calculateValue(leftDrag, balanceEl.operation);
209
253
  balanceEl.rightVal = calculateValue(rightDrag, balanceEl.operation);
254
+ const container = document.getElementById('lido-container');
255
+ const objectiveString = (_b = (_a = container === null || container === void 0 ? void 0 : container['objective']) !== null && _a !== void 0 ? _a : container === null || container === void 0 ? void 0 : container.getAttribute('objective')) !== null && _b !== void 0 ? _b : '';
256
+ const isCorrect = !!container && balanceResult(container, objectiveString);
257
+ const dropElements = container ? Array.from(container.querySelectorAll('[type="drop"]')) : [];
258
+ const filledDropCount = dropElements.filter(drop => !!(container === null || container === void 0 ? void 0 : container.querySelector(`[drop-to="${drop.id}"]`))).length;
259
+ const allDropsFilled = dropElements.length > 0 && filledDropCount === dropElements.length;
260
+ if (balanceEl.setFeedbackColor) {
261
+ balanceEl.setFeedbackColor(allDropsFilled && isCorrect ? '#81C127' : allDropsFilled ? '#FF0410' : '');
262
+ }
210
263
  if (balanceEl.updateTilt) {
264
+ if (!isCorrect) {
265
+ balanceEl.updateTilt(0, 0);
266
+ return;
267
+ }
211
268
  balanceEl.updateTilt(balanceEl.leftVal, balanceEl.rightVal);
212
269
  }
213
270
  }
@@ -396,6 +453,19 @@ function enableDraggingWithScaling(element) {
396
453
  let clone = null;
397
454
  let duplicateElement = null;
398
455
  let mutationFlag = false;
456
+ let pendingMoveFrame = null;
457
+ let latestClientX = 0;
458
+ let latestClientY = 0;
459
+ let hasPendingMove = false;
460
+ let touchTransformUpdated = false;
461
+ let touchDragScale = 1;
462
+ let touchDragScaleY = 1;
463
+ let touchOffsetX = 0;
464
+ let touchOffsetY = 0;
465
+ let touchStartElementLeft = 0;
466
+ let touchStartElementTop = 0;
467
+ let touchStartRect = null;
468
+ let isTouchDragging = false;
399
469
  // Fetch the container element
400
470
  const container = document.getElementById(LidoContainer);
401
471
  if (!container) {
@@ -406,6 +476,33 @@ function enableDraggingWithScaling(element) {
406
476
  return;
407
477
  handlingElementFlexibleWidth(element, 'drag');
408
478
  let dragingElementTransform;
479
+ const getContainerScale = () => {
480
+ const transform = window.getComputedStyle(container).transform;
481
+ const matrix3dMatch = transform.match(/matrix3d\(([^)]+)\)/);
482
+ const matrixMatch = transform.match(/matrix\(([^)]+)\)/);
483
+ if (matrix3dMatch) {
484
+ const values = matrix3dMatch[1].split(',').map(value => parseFloat(value.trim()));
485
+ return {
486
+ scaleX: Math.sqrt(values[0] ** 2 + values[1] ** 2) || 1,
487
+ scaleY: Math.sqrt(values[4] ** 2 + values[5] ** 2) || 1,
488
+ };
489
+ }
490
+ if (matrixMatch) {
491
+ const values = matrixMatch[1].split(',').map(value => parseFloat(value.trim()));
492
+ return {
493
+ scaleX: Math.sqrt(values[0] ** 2 + values[1] ** 2) || 1,
494
+ scaleY: Math.sqrt(values[2] ** 2 + values[3] ** 2) || 1,
495
+ };
496
+ }
497
+ return { scaleX: 1, scaleY: 1 };
498
+ };
499
+ const updateTouchDragScale = () => {
500
+ if (isTouchDragging) {
501
+ const { scaleX, scaleY } = getContainerScale();
502
+ touchDragScale = scaleX;
503
+ touchDragScaleY = scaleY;
504
+ }
505
+ };
409
506
  const onStart = (event) => {
410
507
  var _a, _b;
411
508
  if (container && container.getAttribute("game-completed") === "true")
@@ -422,17 +519,29 @@ function enableDraggingWithScaling(element) {
422
519
  if (event instanceof MouseEvent) {
423
520
  startX = event.clientX;
424
521
  startY = event.clientY;
522
+ touchStartRect = null;
425
523
  }
426
524
  else {
427
525
  startX = event.touches[0].clientX;
428
526
  startY = event.touches[0].clientY;
527
+ isTouchDragging = true;
528
+ touchStartRect = element.getBoundingClientRect();
529
+ touchOffsetX = startX - touchStartRect.left;
530
+ touchOffsetY = startY - touchStartRect.top;
531
+ touchStartElementLeft = touchStartRect.left;
532
+ touchStartElementTop = touchStartRect.top;
533
+ const { scaleX, scaleY } = getContainerScale();
534
+ touchDragScale = scaleX;
535
+ touchDragScaleY = scaleY;
536
+ element.style.willChange = 'transform';
537
+ window.addEventListener('resize', updateTouchDragScale);
429
538
  }
430
539
  // Apply dragging styles to the element
431
540
  element.style.opacity = '1';
432
541
  element.style.cursor = 'grabbing';
433
542
  if (((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) {
434
543
  const computedStyle = window.getComputedStyle(element);
435
- const rect = element.getBoundingClientRect();
544
+ const rect = touchStartRect || element.getBoundingClientRect();
436
545
  if (!clone) {
437
546
  clone = element.cloneNode(true);
438
547
  clone.style.left = `${rect.left}px`;
@@ -451,7 +560,7 @@ function enableDraggingWithScaling(element) {
451
560
  const imgElement = element.querySelector('img');
452
561
  const src = imgElement === null || imgElement === void 0 ? void 0 : imgElement.getAttribute('src');
453
562
  const computedStyle = window.getComputedStyle(element);
454
- const rect = element.getBoundingClientRect();
563
+ const rect = touchStartRect || element.getBoundingClientRect();
455
564
  if (!duplicateElement) {
456
565
  duplicateElement = element.cloneNode(false);
457
566
  duplicateElement.setAttribute('src', src);
@@ -524,31 +633,31 @@ function enableDraggingWithScaling(element) {
524
633
  target.style.opacity = value;
525
634
  }
526
635
  };
527
- const onMove = (event) => {
528
- if (!isDragging)
636
+ const processMove = () => {
637
+ pendingMoveFrame = null;
638
+ if (!isDragging || !hasPendingMove)
529
639
  return;
640
+ hasPendingMove = false;
641
+ const deferTouchDropValidation = touchTransformUpdated;
530
642
  if (isDraggingDisabled) {
531
643
  isDragging = false;
644
+ touchTransformUpdated = false;
532
645
  return;
533
646
  }
534
- isClicked = false;
535
647
  element.style.transition = 'none';
536
- const containerScale = calculateScale();
537
- let dx = 0;
538
- let dy = 0;
539
- if (event instanceof MouseEvent) {
540
- dx = (event.clientX - startX) / containerScale;
541
- dy = (event.clientY - startY) / containerScale;
542
- }
543
- else {
544
- dx = (event.touches[0].clientX - startX) / containerScale;
545
- dy = (event.touches[0].clientY - startY) / containerScale;
546
- }
547
- // Calculate the new position considering scaling
548
- const newLeft = initialX + dx;
549
- const newTop = initialY + dy;
550
- // Apply transform with translation without boundaries
551
- element.style.transform = `translate(${newLeft}px, ${newTop}px)`;
648
+ if (!touchTransformUpdated) {
649
+ const containerScale = calculateScale();
650
+ const dx = (latestClientX - startX) / containerScale;
651
+ const dy = (latestClientY - startY) / containerScale;
652
+ // Calculate the new position considering scaling
653
+ const newLeft = initialX + dx;
654
+ const newTop = initialY + dy;
655
+ // Apply transform with translation without boundaries
656
+ element.style.transform = `translate(${newLeft}px, ${newTop}px)`;
657
+ }
658
+ touchTransformUpdated = false;
659
+ if (deferTouchDropValidation)
660
+ return;
552
661
  // Check for overlaps and highlight only the most overlapping element
553
662
  let mostOverlappedElement = findMostoverlappedElement$1(element, 'drop');
554
663
  const allElements = document.querySelectorAll("[type='drop']");
@@ -587,6 +696,44 @@ function enableDraggingWithScaling(element) {
587
696
  }
588
697
  }
589
698
  };
699
+ const onMove = (event) => {
700
+ if (!isDragging)
701
+ return;
702
+ if (isDraggingDisabled) {
703
+ isDragging = false;
704
+ return;
705
+ }
706
+ if (event instanceof MouseEvent) {
707
+ touchTransformUpdated = false;
708
+ latestClientX = event.clientX;
709
+ latestClientY = event.clientY;
710
+ }
711
+ else {
712
+ const touch = event.touches[0];
713
+ if (!touch)
714
+ return;
715
+ latestClientX = touch.clientX;
716
+ latestClientY = touch.clientY;
717
+ }
718
+ if (!(event instanceof MouseEvent)) {
719
+ element.style.transition = 'none';
720
+ const desiredLeft = latestClientX - touchOffsetX;
721
+ const desiredTop = latestClientY - touchOffsetY;
722
+ const dx = (desiredLeft - touchStartElementLeft) / touchDragScale;
723
+ const dy = (desiredTop - touchStartElementTop) / touchDragScaleY;
724
+ const newLeft = initialX + dx;
725
+ const newTop = initialY + dy;
726
+ element.style.transform = `translate3d(${newLeft}px, ${newTop}px, 0)`;
727
+ touchTransformUpdated = true;
728
+ }
729
+ isClicked = false;
730
+ if (event instanceof MouseEvent) {
731
+ hasPendingMove = true;
732
+ if (pendingMoveFrame === null) {
733
+ pendingMoveFrame = requestAnimationFrame(processMove);
734
+ }
735
+ }
736
+ };
590
737
  let lastOverlappedElement = null;
591
738
  const removeDocumentDragListeners = () => {
592
739
  document.removeEventListener('mousemove', onMove);
@@ -594,9 +741,19 @@ function enableDraggingWithScaling(element) {
594
741
  document.removeEventListener('touchmove', onMove);
595
742
  document.removeEventListener('touchend', onEnd);
596
743
  };
744
+ const flushPendingMove = () => {
745
+ if (pendingMoveFrame === null)
746
+ return;
747
+ cancelAnimationFrame(pendingMoveFrame);
748
+ processMove();
749
+ };
597
750
  const onEnd = (endEv) => {
598
751
  var _a, _b, _c;
752
+ flushPendingMove();
599
753
  isDragging = false;
754
+ isTouchDragging = false;
755
+ element.style.willChange = '';
756
+ window.removeEventListener('resize', updateTouchDragScale);
600
757
  removeDocumentDragListeners();
601
758
  if (isClicked) {
602
759
  if (clone) {
@@ -702,6 +859,15 @@ function enableDraggingWithScaling(element) {
702
859
  };
703
860
  const cleanup = () => {
704
861
  isDragging = false;
862
+ isTouchDragging = false;
863
+ element.style.willChange = '';
864
+ window.removeEventListener('resize', updateTouchDragScale);
865
+ if (pendingMoveFrame !== null) {
866
+ cancelAnimationFrame(pendingMoveFrame);
867
+ pendingMoveFrame = null;
868
+ }
869
+ hasPendingMove = false;
870
+ touchTransformUpdated = false;
705
871
  observer.disconnect();
706
872
  removeDocumentDragListeners();
707
873
  element.removeEventListener('mousedown', onStart);
@@ -775,7 +941,8 @@ async function handleResetDragElement(dragElement, dropElement, dropHasDrag, sel
775
941
  dragElement.classList.remove('dropped');
776
942
  const container = document.getElementById(LidoContainer);
777
943
  const cloneArray = container.querySelectorAll(`#${dragElement.id}`);
778
- const cloneDragElement = Array.from(cloneArray).find(item => dragElement !== item && !item.classList.contains('dropped'));
944
+ const balanceHome = dragElement.__lidoBalanceHome;
945
+ const cloneDragElement = ((balanceHome === null || balanceHome === void 0 ? void 0 : balanceHome.isConnected) ? balanceHome : Array.from(cloneArray).find(item => dragElement !== item && !item.classList.contains('dropped')));
779
946
  dragElement.style.transition = 'transform 0.5s ease';
780
947
  if (cloneDragElement) {
781
948
  animateDragToTarget(dragElement, cloneDragElement, container);
@@ -792,6 +959,7 @@ async function handleResetDragElement(dragElement, dropElement, dropHasDrag, sel
792
959
  dragElement.style.transform = 'translate(0,0)';
793
960
  dragElement.style.position = 'unset';
794
961
  cloneDragElement.replaceWith(dragElement);
962
+ delete dragElement.__lidoBalanceHome;
795
963
  }, 500);
796
964
  }
797
965
  else {
@@ -1114,6 +1282,10 @@ async function onElementDropComplete(dragElement, dropElement) {
1114
1282
  }
1115
1283
  highlightElement();
1116
1284
  await onActivityComplete(dragElement, dropElement);
1285
+ const dropAction = container.getAttribute('drop-action');
1286
+ if (container.querySelector('lido-balance') && dropAction !== exports.DropAction.Move && dropAction !== exports.DropAction.InfiniteDrop) {
1287
+ placeDragOnBalancePlate(dragElement, dropElement);
1288
+ }
1117
1289
  }
1118
1290
  function updateDropBorder(element) {
1119
1291
  var _a;
@@ -1179,14 +1351,14 @@ async function onClickDropOrDragElement(element, type) {
1179
1351
  if (!document.querySelector('#dynamic-highlight-style')) {
1180
1352
  const style = document.createElement('style');
1181
1353
  style.id = 'dynamic-highlight-style';
1182
- style.innerHTML = `
1183
- .highlight {
1184
- // border: 4px solid #e74c3c; /* Thicker red border for more visibility */
1185
- // border-radius: 12px; /* Larger rounded corners */
1186
- // background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
1187
- // box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
1188
- // outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
1189
- }
1354
+ style.innerHTML = `
1355
+ .highlight {
1356
+ // border: 4px solid #e74c3c; /* Thicker red border for more visibility */
1357
+ // border-radius: 12px; /* Larger rounded corners */
1358
+ // background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
1359
+ // box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
1360
+ // outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
1361
+ }
1190
1362
  `;
1191
1363
  document.head.appendChild(style);
1192
1364
  }
@@ -1374,34 +1546,34 @@ function highlightSpeakingElement(element) {
1374
1546
  if (!document.getElementById(styleId)) {
1375
1547
  const style = document.createElement('style');
1376
1548
  style.id = styleId;
1377
- style.innerHTML = `
1378
- .speaking-highlight {
1379
- --base-transform: ${element.style.transform};
1380
- box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
1381
- // border: 3px solid green !important;
1382
- // transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
1383
- // transform: scale(1.05); /* Subtle scale effect to pop the element */
1384
- // animation: pulseEffect 1.5s infinite; /* Pulsing animation */
1385
-
1386
- }
1387
-
1388
- @keyframes pulseEffect {
1389
- 0% {
1390
- box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
1391
- // transform: var(--base-transform) scale(1.05);
1392
- // background-color: #FFFF0B;
1393
- }
1394
- 50% {
1395
- box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
1396
- // transform: var(--base-transform) scale(1.1);
1397
- // background-color: #FFFF0B;
1398
- }
1399
- 100% {
1400
- box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
1401
- // transform: var(--base-transform) scale(1.05);
1402
- // background-color: #FFFF0B;
1403
- }
1404
- }
1549
+ style.innerHTML = `
1550
+ .speaking-highlight {
1551
+ --base-transform: ${element.style.transform};
1552
+ box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
1553
+ // border: 3px solid green !important;
1554
+ // transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
1555
+ // transform: scale(1.05); /* Subtle scale effect to pop the element */
1556
+ // animation: pulseEffect 1.5s infinite; /* Pulsing animation */
1557
+
1558
+ }
1559
+
1560
+ @keyframes pulseEffect {
1561
+ 0% {
1562
+ box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
1563
+ // transform: var(--base-transform) scale(1.05);
1564
+ // background-color: #FFFF0B;
1565
+ }
1566
+ 50% {
1567
+ box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
1568
+ // transform: var(--base-transform) scale(1.1);
1569
+ // background-color: #FFFF0B;
1570
+ }
1571
+ 100% {
1572
+ box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
1573
+ // transform: var(--base-transform) scale(1.05);
1574
+ // background-color: #FFFF0B;
1575
+ }
1576
+ }
1405
1577
  `;
1406
1578
  document.head.appendChild(style);
1407
1579
  }
@@ -1576,7 +1748,7 @@ class AudioPlayer {
1576
1748
  return el;
1577
1749
  return el.closest('lido-text');
1578
1750
  }
1579
- async play(targetElement) {
1751
+ async play(targetElement, suppressHighlight = false) {
1580
1752
  this.registerVisibilityEvents();
1581
1753
  this.playbackHasStarted = false;
1582
1754
  if (!this.isWindowVisible()) {
@@ -1600,11 +1772,6 @@ class AudioPlayer {
1600
1772
  console.warn('[AudioPlayer] No lido-container found');
1601
1773
  return;
1602
1774
  }
1603
- // Check if speaking is disabled on the target element or its closest lido-text parent
1604
- targetElement.closest('lido-text');
1605
- // if(text && text.getAttribute('disable-speak')==='true'){
1606
- // return;
1607
- // }
1608
1775
  if (container.getAttribute('highlight-word-by-word') === 'true') {
1609
1776
  const textElement = this.getLidoTextElement(targetElement);
1610
1777
  if (!textElement) {
@@ -1616,6 +1783,7 @@ class AudioPlayer {
1616
1783
  targetElement = textElement;
1617
1784
  }
1618
1785
  this.currentTargetElement = targetElement;
1786
+ window.dispatchEvent(new CustomEvent('lidoAudioStarted', { detail: { target: targetElement } }));
1619
1787
  // then play the target element audio.
1620
1788
  let audioUrl = targetElement.getAttribute('audio') || '';
1621
1789
  // If no direct audio attribute, check childrens for audio
@@ -1665,7 +1833,8 @@ class AudioPlayer {
1665
1833
  this.wordRects = this.computeWordRects(targetElement);
1666
1834
  }
1667
1835
  else {
1668
- highlightSpeakingElement(targetElement);
1836
+ if (!suppressHighlight)
1837
+ highlightSpeakingElement(targetElement);
1669
1838
  }
1670
1839
  // PLAY ONCE
1671
1840
  await this.audioElement.play();
@@ -1689,18 +1858,17 @@ class AudioPlayer {
1689
1858
  this.audioElement.onended = null; // cleanup
1690
1859
  setDraggingDisabled(false);
1691
1860
  if (container.getAttribute('highlight-word-by-word') !== 'true') {
1692
- stopHighlightForSpeakingElement(targetElement);
1861
+ if (!suppressHighlight)
1862
+ stopHighlightForSpeakingElement(targetElement);
1693
1863
  }
1694
1864
  }
1695
1865
  }
1696
1866
  // If no audio, use text-to-speech
1697
1867
  else if (targetElement.textContent) {
1698
1868
  try {
1699
- highlightSpeakingElement(targetElement);
1700
- // window.addEventListener('click', this.handleUserClick, true);
1869
+ if (!suppressHighlight)
1870
+ highlightSpeakingElement(targetElement);
1701
1871
  await speakText(targetElement.textContent, targetElement);
1702
- document.querySelectorAll('.speaking-highlight');
1703
- // highlightedElements.forEach(element => stopHighlightForSpeakingElement(element as HTMLElement));
1704
1872
  }
1705
1873
  catch (error) { }
1706
1874
  finally {
@@ -1718,6 +1886,7 @@ class AudioPlayer {
1718
1886
  if (this.currentTargetElement === targetElement) {
1719
1887
  this.currentTargetElement = null;
1720
1888
  }
1889
+ window.dispatchEvent(new CustomEvent('lidoAudioEnded', { detail: { target: targetElement } }));
1721
1890
  }
1722
1891
  // GLOBAL STOP EVENTS (container change, activity change…)
1723
1892
  registerGlobalStopEvents() {
@@ -2110,11 +2279,11 @@ function enableReorderDrag(element) {
2110
2279
  onDropToCategory(element, category);
2111
2280
  }
2112
2281
  if (divEl) {
2113
- const keyframes = `
2114
- @keyframes widthDecrease {
2115
- 0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
2116
- 100% { width: 0px; height: 0px;}
2117
- }
2282
+ const keyframes = `
2283
+ @keyframes widthDecrease {
2284
+ 0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
2285
+ 100% { width: 0px; height: 0px;}
2286
+ }
2118
2287
  `;
2119
2288
  const styleSheet = document.styleSheets[0];
2120
2289
  styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
@@ -2337,11 +2506,11 @@ function moveWithAnimation(target, overlapped) {
2337
2506
  const dummy = createDummyElement(target);
2338
2507
  dummy.style.visibility = 'hidden';
2339
2508
  dummy.setAttribute('type', 'dummy');
2340
- const keyframes = `
2341
- @keyframes widthIncrease {
2342
- 0% { width: 0px; height: 0px; }
2343
- 100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
2344
- }
2509
+ const keyframes = `
2510
+ @keyframes widthIncrease {
2511
+ 0% { width: 0px; height: 0px; }
2512
+ 100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
2513
+ }
2345
2514
  `;
2346
2515
  if (!overlapped) {
2347
2516
  const overlapCategory = findMostoverlappedElement(target, 'category');
@@ -73039,11 +73208,11 @@ const afterDropDragHandling = (dragElement, dropElement) => {
73039
73208
  }
73040
73209
  dummyElement.setAttribute('id', dragElement.getAttribute('id'));
73041
73210
  dragElement.replaceWith(dummyElement);
73042
- const keyframes = `
73043
- @keyframes widthDecrease {
73044
- 0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
73045
- 100% { width: 0px; height: 0px; margin: 0px;}
73046
- }
73211
+ const keyframes = `
73212
+ @keyframes widthDecrease {
73213
+ 0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
73214
+ 100% { width: 0px; height: 0px; margin: 0px;}
73215
+ }
73047
73216
  `;
73048
73217
  if (!isInfinite) {
73049
73218
  dummyElement.style.width = element.style.width;
@@ -73253,7 +73422,16 @@ async function onActivityComplete(dragElement, dropElement) {
73253
73422
  if (!container)
73254
73423
  return;
73255
73424
  const isBlender = container.getAttribute('template-id') === 'blender';
73256
- await executeActions("this.alignMatch='true'", dropElement, dragElement);
73425
+ const isBalancing = !!container.querySelector('lido-balance');
73426
+ const usesBalancePlacement = isBalancing
73427
+ && container.getAttribute('drop-action') !== exports.DropAction.Move
73428
+ && container.getAttribute('drop-action') !== exports.DropAction.InfiniteDrop;
73429
+ // Balance plates perform their own single placement pass after this method.
73430
+ // Running alignMatch first makes two transforms compete and produces a visible
73431
+ // horizontal drift as the item is re-parented.
73432
+ if (!usesBalancePlacement) {
73433
+ await executeActions("this.alignMatch='true'", dropElement, dragElement);
73434
+ }
73257
73435
  if (dragElement && dropElement) {
73258
73436
  let isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
73259
73437
  if (isBlender) {
@@ -73276,7 +73454,7 @@ async function onActivityComplete(dragElement, dropElement) {
73276
73454
  const onCorrect = ((_b = container.getAttribute('dropAttr')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === DropMode.EnableAnimation.toLowerCase()
73277
73455
  ? ''
73278
73456
  : dropElement.getAttribute('onCorrect');
73279
- if (onCorrect && !isBlender) {
73457
+ if (onCorrect && !isBlender && !isBalancing) {
73280
73458
  await executeActions(onCorrect, dropElement, dragElement);
73281
73459
  }
73282
73460
  //for multiply beeds
@@ -73315,7 +73493,7 @@ async function onActivityComplete(dragElement, dropElement) {
73315
73493
  }, 2000);
73316
73494
  }
73317
73495
  const onInCorrect = dropElement.getAttribute('onInCorrect');
73318
- if (onInCorrect && !isBlender) {
73496
+ if (onInCorrect && !isBlender && !isBalancing) {
73319
73497
  await executeActions(onInCorrect, dropElement, dragElement);
73320
73498
  }
73321
73499
  }
@@ -73483,6 +73661,13 @@ const validateObjectiveStatus = async () => {
73483
73661
  else {
73484
73662
  res = matchStringPattern(objectiveString, objectiveArray);
73485
73663
  }
73664
+ const isBalancing = !!container.querySelector('lido-balance');
73665
+ if (isBalancing && !res) {
73666
+ const dropElements = Array.from(container.querySelectorAll('[type="drop"]'));
73667
+ const filledDropCount = dropElements.filter(drop => !!container.querySelector(`[drop-to="${drop.id}"]`)).length;
73668
+ if (filledDropCount < dropElements.length)
73669
+ return;
73670
+ }
73486
73671
  if (res) {
73487
73672
  container.setAttribute("game-completed", "true");
73488
73673
  const attach = container.getAttribute('appendToDropOnCompletion');
@@ -22,7 +22,7 @@ const NAMESPACE = 'lido-player';
22
22
  const BUILD = /* lido-player */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, slotRelocation: true, state: true, updatable: true};
23
23
 
24
24
  const globalScripts = () => {};
25
- const globalStyles = "@font-face{font-family:'Baloo Bhai 2';font-style:normal;font-weight:400 800;font-display:swap;src:url('../assets/offline-assets/fonts/Baloo-Bhai-2/Baloo-Bhai-2-Variable.woff2') format('woff2')}body{overflow:hidden;background-position:center;background-size:cover;background-repeat:no-repeat;height:100vh}*{user-select:none}.lido-disable-check-button{pointer-events:none;background-color:#9393935c !important;color:white}.lido-element-selected{border:2px solid;background-color:#ffdf7d !important}.diagonal-target,.diagonal-drop *{transform:scale(0.8) !important;opacity:1 !important}.cloned-element{display:flex !important;position:absolute !important;filter:grayscale(100%);pointer-events:none}.removeShadow{box-shadow:0px 0px 0px 0px #ff8900 !important}.highlight-element{border:2px solid white;box-shadow:rgb(243, 77, 8) 0px 0px 40px !important}.drop-element.empty{border:4px dashed #f34d08 !important}.drop-element.filled{border:'none' !important}.drag-element{box-shadow:0px 15px 11px rgba(43, 0, 0, 0.3) !important}.drag-element.dropped{box-shadow:none !important}.click-element{background-color:var(--btn-bg-color, rgba(255, 172, 76, 1)) !important;box-shadow:var(--btn-shadow-px) var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;cursor:pointer;transition:box-shadow 0.1s ease-out, transform 0.2s ease-out;}.click-element:active{box-shadow:0px 0px 0px var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;transform:translateY(var(--btn-active));}.click-element:focus{outline:2px solid dodgerblue;outline-offset:3px}.after-drop-popup-container{width:200%;height:200%;background-color:rgba(0, 0, 0, 0.8);position:absolute;display:flex;flex-direction:row-reverse;align-items:center;justify-content:center !important;gap:80px}.after-drop-popup-drag-element{scale:1.5;border-radius:8px;transform:none !important;position:unset !important}.after-drop-popup-drop-element{scale:1.5;border:unset;border-radius:8px;transform:none !important;position:unset !important}@keyframes zoomFadeIn{0%{transform:scale(0.6);opacity:0}100%{transform:scale(1);opacity:1}}.zoom-fade-in{animation:zoomFadeIn 0.8s ease-out forwards}@keyframes zoomFadeOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0.6);opacity:0}}.zoom-fade-out{animation:zoomFadeOut 0.8s ease-in forwards}.slide-numbers{width:70px;height:70px;border:1px solid #f57139;background-color:white;font-weight:500;color:#f57139;font-size:44px;border-radius:40px;display:flex;align-items:center;justify-content:center;font-family:'Baloo Bhai 2', serif}.slide-numbers-bottom{position:absolute;display:flex;justify-content:space-around;align-items:center;bottom:-25px;width:100%;height:50px}.slide-numbers-left{position:absolute;display:flex;flex-direction:column;justify-content:space-around;height:100%;width:50px;left:-25px;bottom:0px}.lido-speak-icon{width:56px;height:56px;position:absolute;top:-25px;right:-25px;z-index:10;background-color:white;border:4px solid #F34D08;border-radius:16px;box-shadow:0px 4px 0px 0px #F34D08;background-size:contain;background-repeat:no-repeat;cursor:pointer}.lido-speak-icon:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px !important}.lido-strong-shake{animation:strongShake 0.3s ease}.lido-scaled-shake{animation:scaledShake 0.6s ease-in-out}.lido-horizontal-shake{animation:horizontalShake 0.6s ease-in-out;border-radius:20px}.lido-vertical-shake{animation:verticalShake 0.6s ease-in-out;border-radius:20px}.lido-diagonal-shake{animation:diagonalShake 0.5s ease-in-out;border-radius:20px;will-change:transform}.lido-glow{animation:glowPulse 1s infinite alternate;transition:opacity 0.5s ease-in-out}.lido-box-highlight{animation:topToPlace 0.3s linear}.lido-display-hiddenvalue{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:80px;font-weight:1000;color:brown;-webkit-text-stroke:2px white;font-family:'Baloo Bhai 2', sans-serif;pointer-events:none}.lido-image-colorize{position:relative;display:inline-block}.lido-image-colorize::after{content:'';position:absolute;inset:0;background:var(--tint-color);mix-blend-mode:multiply;opacity:0.8;pointer-events:none;mask-image:var(--mask-url);mask-size:cover;mask-repeat:no-repeat;mask-position:center}.lido-tts-highlight-overlay{position:fixed;left:0;top:0;pointer-events:none;z-index:9999;background:linear-gradient(\n 180deg,\n rgba(255, 235, 59, 0.95),\n rgba(255, 214, 0, 0.95)\n );border-radius:6px;box-shadow:0 2px 6px rgba(0, 0, 0, 0.18),\n inset 0 -1px 0 rgba(255, 255, 255, 0.25);transition:width 25ms ease-out,\n height 25ms ease-out,\n opacity 80ms ease-out;opacity:0.95;will-change:transform, width, height;contain:layout paint style}.category-dropped-onCorrect{box-shadow:rgba(129, 193, 39, 1) 0px 8px 8px 0px !important}.category-dropped-onInCorrect{box-shadow:rgba(255, 4, 16, 1) 0px 8px 8px 0px !important}";
25
+ const globalStyles = "@font-face{font-family:'Baloo Bhai 2';font-style:normal;font-weight:400 800;font-display:swap;src:url('../assets/offline-assets/fonts/Baloo-Bhai-2/Baloo-Bhai-2-Variable.woff2') format('woff2')}body{overflow:hidden;background-position:center;background-size:cover;background-repeat:no-repeat;height:100vh}*{user-select:none}.lido-disable-check-button{pointer-events:none;background-color:#9393935c !important;color:white}.lido-element-selected{border:2px solid;background-color:#ffdf7d !important}.diagonal-target,.diagonal-drop *{transform:scale(0.8) !important;opacity:1 !important}.cloned-element{display:flex !important;position:absolute !important;filter:grayscale(100%);pointer-events:none}.removeShadow{box-shadow:0px 0px 0px 0px #ff8900 !important}.highlight-element{border:2px solid white;box-shadow:rgb(243, 77, 8) 0px 0px 40px !important}.drop-element.empty{border:4px dashed #f34d08 !important}.drop-element.filled{border:'none' !important}.drag-element{box-shadow:0px 15px 11px rgba(43, 0, 0, 0.3) !important}.drag-element.dropped{box-shadow:none !important}.click-element{background-color:var(--btn-bg-color, rgba(255, 172, 76, 1)) !important;box-shadow:var(--btn-shadow-px) var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;cursor:pointer;transition:box-shadow 0.1s ease-out, transform 0.2s ease-out;}.click-element:active{box-shadow:0px 0px 0px var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;transform:translateY(var(--btn-active));}.click-element:focus{outline:2px solid dodgerblue;outline-offset:3px}.after-drop-popup-container{width:200%;height:200%;background-color:rgba(0, 0, 0, 0.8);position:absolute;display:flex;flex-direction:row-reverse;align-items:center;justify-content:center !important;gap:80px}.after-drop-popup-drag-element{scale:1.5;border-radius:8px;transform:none !important;position:unset !important}.after-drop-popup-drop-element{scale:1.5;border:unset;border-radius:8px;transform:none !important;position:unset !important}@keyframes zoomFadeIn{0%{transform:scale(0.6);opacity:0}100%{transform:scale(1);opacity:1}}.zoom-fade-in{animation:zoomFadeIn 0.8s ease-out forwards}@keyframes zoomFadeOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0.6);opacity:0}}.zoom-fade-out{animation:zoomFadeOut 0.8s ease-in forwards}.slide-numbers{width:70px;height:70px;border:1px solid #f57139;background-color:white;font-weight:500;color:#f57139;font-size:44px;border-radius:40px;display:flex;align-items:center;justify-content:center;font-family:'Baloo Bhai 2', serif}.slide-numbers-bottom{position:absolute;display:flex;justify-content:space-around;align-items:center;bottom:-25px;width:100%;height:50px}.slide-numbers-left{position:absolute;display:flex;flex-direction:column;justify-content:space-around;height:100%;width:50px;left:-25px;bottom:0px}.lido-speak-icon{width:56px;height:56px;position:absolute;top:-25px;right:-25px;z-index:10;background-color:white;border:4px solid #F34D08;border-radius:16px;box-shadow:0px 4px 0px 0px #F34D08;background-size:contain;background-repeat:no-repeat;cursor:pointer}.lido-speak-icon:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px !important}.lido-strong-shake{animation:strongShake 0.3s ease}.lido-scaled-shake{animation:scaledShake 0.6s ease-in-out}.lido-horizontal-shake{animation:horizontalShake 0.6s ease-in-out;border-radius:20px}.lido-vertical-shake{animation:verticalShake 0.6s ease-in-out;border-radius:20px}.lido-diagonal-shake{animation:diagonalShake 0.5s ease-in-out;border-radius:20px;will-change:transform}.lido-glow{animation:glowPulse 1s infinite alternate;transition:opacity 0.5s ease-in-out}.lido-box-highlight{animation:topToPlace 0.3s linear}.lido-display-hiddenvalue{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:80px;font-weight:1000;color:brown;-webkit-text-stroke:2px white;font-family:'Baloo Bhai 2', sans-serif;pointer-events:none}.lido-image-colorize{position:relative;display:inline-block}.lido-image-colorize::after{content:'';position:absolute;inset:0;background:var(--tint-color);mix-blend-mode:multiply;opacity:0.8;pointer-events:none;mask-image:var(--mask-url);mask-size:cover;mask-repeat:no-repeat;mask-position:center}.lido-tts-highlight-overlay{position:fixed;left:0;top:0;pointer-events:none;z-index:9999;background:linear-gradient(\r\n 180deg,\r\n rgba(255, 235, 59, 0.95),\r\n rgba(255, 214, 0, 0.95)\r\n );border-radius:6px;box-shadow:0 2px 6px rgba(0, 0, 0, 0.18),\r\n inset 0 -1px 0 rgba(255, 255, 255, 0.25);transition:width 25ms ease-out,\r\n height 25ms ease-out,\r\n opacity 80ms ease-out;opacity:0.95;will-change:transform, width, height;contain:layout paint style}.category-dropped-onCorrect{box-shadow:rgba(129, 193, 39, 1) 0px 8px 8px 0px !important}.category-dropped-onInCorrect{box-shadow:rgba(255, 4, 16, 1) 0px 8px 8px 0px !important}";
26
26
 
27
27
  /*
28
28
  Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com