lido-player 0.0.2-beta-19-dev → 0.0.2-beta-22-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 (237) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/{decode-Bny56MQ9.js → decode-Cr5DANqc.js} +1 -1
  3. package/dist/cjs/{index-BY9fvbr8.js → index-0BvcfeCt.js} +144 -68
  4. package/dist/cjs/{index-DjsCseV8.js → index-DnaH8sO-.js} +20 -67
  5. package/dist/cjs/index.cjs.js +2 -2
  6. package/dist/cjs/lido-avatar_22.cjs.entry.js +279 -66
  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 +46 -28
  25. package/dist/collection/components/flashCard/lido-flash-card.js +131 -14
  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 +9 -6
  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 +174 -145
  45. package/dist/collection/components/scale/lido-balance.js +54 -14
  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 +5 -5
  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 +119 -23
  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 +323 -323
  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 +59 -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/audioPlayer.js +9 -12
  152. package/dist/collection/utils/utils.js +24 -8
  153. package/dist/collection/utils/utilsHandlers/dragDropHandler.js +16 -10
  154. package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
  155. package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +58 -1
  156. package/dist/collection/utils/utilsHandlers/sortHandler.js +10 -10
  157. package/dist/components/index.js +1 -1
  158. package/dist/components/lido-avatar.js +1 -1
  159. package/dist/components/lido-balance.js +1 -1
  160. package/dist/components/lido-calculator.js +1 -1
  161. package/dist/components/lido-canvas.js +1 -1
  162. package/dist/components/lido-cell.js +1 -1
  163. package/dist/components/lido-col.js +1 -1
  164. package/dist/components/lido-container.js +1 -1
  165. package/dist/components/lido-flash-card.js +1 -1
  166. package/dist/components/lido-float.js +1 -1
  167. package/dist/components/lido-home.js +1 -1
  168. package/dist/components/lido-keyboard.js +1 -1
  169. package/dist/components/lido-math-matrix.js +1 -1
  170. package/dist/components/lido-pos.js +1 -1
  171. package/dist/components/lido-random.js +1 -1
  172. package/dist/components/lido-root.js +1 -1
  173. package/dist/components/lido-row.js +1 -1
  174. package/dist/components/lido-shape.js +1 -1
  175. package/dist/components/lido-slide-fill.js +1 -1
  176. package/dist/components/lido-text.js +1 -1
  177. package/dist/components/lido-trace.js +1 -1
  178. package/dist/components/lido-wrap.js +1 -1
  179. package/dist/components/{p-BOQDbCrm.js → p-BJiyBHYT.js} +1 -1
  180. package/dist/components/p-BUfCIPRa.js +1 -0
  181. package/dist/components/{p-CTlcpv4a.js → p-BfwUqpXc.js} +1 -1
  182. package/dist/components/p-BiBt9LGP.js +1 -0
  183. package/dist/components/{p-CgsPIpg0.js → p-Bw-OC9iR.js} +1 -1
  184. package/dist/components/{p-B4YAipq-.js → p-CFzvgrMa.js} +1 -1
  185. package/dist/components/{p-C5WmmkI6.js → p-CPYnt0P-.js} +1 -1
  186. package/dist/components/{p-CCR42e0i.js → p-ChfVUoX4.js} +1 -1
  187. package/dist/components/{p-CWwymnbk.js → p-CkxAm8rY.js} +2 -2
  188. package/dist/components/{p-BeRr8u5m.js → p-CwDTdXe5.js} +1 -1
  189. package/dist/components/{p-CXHPZN3m.js → p-CyGxEcn7.js} +1 -1
  190. package/dist/components/{p-BJMjg5wu.js → p-D2GhaM-T.js} +1 -1
  191. package/dist/components/{p-BBHM059l.js → p-DDS30M3y.js} +1 -1
  192. package/dist/components/p-DP6jQ5ML.js +1 -0
  193. package/dist/components/{p-CljvnHkI.js → p-DZRNZCPt.js} +1 -1
  194. package/dist/components/p-DbR5sNOj.js +1 -0
  195. package/dist/components/{p-B8nzzM8c.js → p-DdQ1eqJr.js} +1 -1
  196. package/dist/components/p-leIEepjl.js +1 -0
  197. package/dist/components/p-u3czV7QM.js +1 -0
  198. package/dist/components/{p-C70ykycD.js → p-useuhkjH.js} +1 -1
  199. package/dist/esm/{decode-Buyq-Iy5.js → decode-DkSXjv7K.js} +1 -1
  200. package/dist/esm/{index-CQXciux9.js → index-D9-TTsdZ.js} +144 -68
  201. package/dist/esm/{index-DQZfuGjI.js → index-Dvjbti-h.js} +20 -67
  202. package/dist/esm/index.js +2 -2
  203. package/dist/esm/lido-avatar_22.entry.js +279 -66
  204. package/dist/esm/lido-player.js +4 -4
  205. package/dist/esm/loader.js +3 -3
  206. package/dist/lido-player/assets/Shadow.svg +9 -9
  207. package/dist/lido-player/assets/Tracing-hand.svg +8 -8
  208. package/dist/lido-player/index.esm.js +1 -1
  209. package/dist/lido-player/lido-avatar.css +4 -4
  210. package/dist/lido-player/lido-avatar.tsx +207 -207
  211. package/dist/lido-player/lido-player.css +7 -7
  212. package/dist/lido-player/lido-player.esm.js +1 -1
  213. package/dist/lido-player/p-35fa0b8b.entry.js +12 -0
  214. package/dist/lido-player/p-D2iINRNN.js +1 -0
  215. package/dist/lido-player/{p-CFtq4Thh.js → p-Dc8j8Hxw.js} +1 -1
  216. package/dist/lido-player/p-Dvjbti-h.js +2 -0
  217. package/dist/lido-player/readme.md +49 -49
  218. package/dist/types/components/flashCard/lido-flash-card.d.ts +10 -0
  219. package/dist/types/components/scale/lido-balance.d.ts +5 -0
  220. package/dist/types/components/trace/lido-trace.d.ts +9 -1
  221. package/dist/types/components.d.ts +10 -0
  222. package/dist/types/stencil-public-runtime.d.ts +55 -73
  223. package/dist/types/types/json.d.ts +3 -3
  224. package/dist/types/utils/audioPlayer.d.ts +1 -1
  225. package/dist/types/utils/utilsHandlers/lidoBalanceHandler.d.ts +10 -0
  226. package/loader/index.d.ts +1 -1
  227. package/package.json +74 -74
  228. package/readme.md +113 -113
  229. package/dist/components/p-BfqihbR6.js +0 -1
  230. package/dist/components/p-CwIlwnQk.js +0 -1
  231. package/dist/components/p-DLyacZap.js +0 -1
  232. package/dist/components/p-DONbWJGn.js +0 -1
  233. package/dist/components/p-DVTigdH_.js +0 -1
  234. package/dist/components/p-DYFVwyRr.js +0 -1
  235. package/dist/lido-player/p-37736e11.entry.js +0 -12
  236. package/dist/lido-player/p-3Ry570XH.js +0 -1
  237. package/dist/lido-player/p-DQZfuGjI.js +0 -3
@@ -1,53 +1,53 @@
1
- .lido-text {
2
- /* background-color: #fff; */
3
- /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
4
- transition: background-color 0.3s ease;
5
- user-select: none;
6
- align-items: center;
7
- justify-content: center;
8
- text-align: center;
9
- border-radius: 24px;
10
- color: #333;
11
- cursor: pointer;
12
- font-family: 'Baloo Bhai 2', serif;
13
- }
14
-
15
- .text-letters {
16
- transition: color 0.3s, text-shadow 0.3s;
17
- display: inline-block;
18
- padding: 0 2px;
19
- }
20
-
21
- .text-letters.letter-highlight {
22
- color: #8e24aa;
23
- background: none;
24
- border-radius: 0;
25
- text-shadow: 0 2px 8px #8e24aa88;
26
- animation: text-letter-bounce 0.4s;
27
- }
28
-
29
- .text-words {
30
- transition: color 0.3s, text-shadow 0.3s;
31
- display: inline-block;
32
- padding: 0 2px;
33
- }
34
-
35
- .text-words.word-highlight {
36
- color: #8e24aa;
37
- background: none;
38
- border-radius: 0;
39
- text-shadow: 0 2px 8px #8e24aa88;
40
- animation: text-word-bounce 0.4s;
41
- }
42
-
43
- @keyframes text-letter-bounce {
44
- 0% { transform: scale(1); }
45
- 60% { transform: scale(1.4); }
46
- 100% { transform: scale(1); }
47
- }
48
-
49
- @keyframes text-word-bounce {
50
- 0% { transform: scale(1); }
51
- 60% { transform: scale(1.3); }
52
- 100% { transform: scale(1); }
53
- }
1
+ .lido-text {
2
+ /* background-color: #fff; */
3
+ /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
4
+ transition: background-color 0.3s ease;
5
+ user-select: none;
6
+ align-items: center;
7
+ justify-content: center;
8
+ text-align: center;
9
+ border-radius: 24px;
10
+ color: #333;
11
+ cursor: pointer;
12
+ font-family: 'Baloo Bhai 2', serif;
13
+ }
14
+
15
+ .text-letters {
16
+ transition: color 0.3s, text-shadow 0.3s;
17
+ display: inline-block;
18
+ padding: 0 2px;
19
+ }
20
+
21
+ .text-letters.letter-highlight {
22
+ color: #8e24aa;
23
+ background: none;
24
+ border-radius: 0;
25
+ text-shadow: 0 2px 8px #8e24aa88;
26
+ animation: text-letter-bounce 0.4s;
27
+ }
28
+
29
+ .text-words {
30
+ transition: color 0.3s, text-shadow 0.3s;
31
+ display: inline-block;
32
+ padding: 0 2px;
33
+ }
34
+
35
+ .text-words.word-highlight {
36
+ color: #8e24aa;
37
+ background: none;
38
+ border-radius: 0;
39
+ text-shadow: 0 2px 8px #8e24aa88;
40
+ animation: text-word-bounce 0.4s;
41
+ }
42
+
43
+ @keyframes text-letter-bounce {
44
+ 0% { transform: scale(1); }
45
+ 60% { transform: scale(1.4); }
46
+ 100% { transform: scale(1); }
47
+ }
48
+
49
+ @keyframes text-word-bounce {
50
+ 0% { transform: scale(1); }
51
+ 60% { transform: scale(1.3); }
52
+ 100% { transform: scale(1); }
53
+ }
@@ -266,7 +266,7 @@ export class LidoText {
266
266
  }
267
267
  render() {
268
268
  const displayText = i18next.t(this.string).replace(/_phonics?/gi, '');
269
- return (h(Host, { key: '14a67034db7bf3d268e999404425879c95964b82', class: "lido-text", value: this.value, "required-drops": this.requiredDrops, type: this.type, "tab-index": this.tabIndex, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, minDrops: this.minDrops, maxDrops: this.maxDrops, id: this.id, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, move: this.move, "span-type": this.spanType, "disable-speak": `${this.disableSpeak}` }, this.spanType !== '' ? h("div", { class: "lido-text-content" }, " ", displayText) : displayText));
269
+ return (h(Host, { key: 'ecef6ae20a67e2296570fe3a65cc5c99f96a1f7c', class: "lido-text", value: this.value, "required-drops": this.requiredDrops, type: this.type, "tab-index": this.tabIndex, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, minDrops: this.minDrops, maxDrops: this.maxDrops, id: this.id, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, move: this.move, "span-type": this.spanType, "disable-speak": `${this.disableSpeak}` }, this.spanType !== '' ? h("div", { class: "lido-text-content" }, " ", displayText) : displayText));
270
270
  }
271
271
  static get is() { return "lido-text"; }
272
272
  static get originalStyleUrls() {
@@ -873,7 +873,7 @@ export class LidoText {
873
873
  "optional": false,
874
874
  "docs": {
875
875
  "tags": [],
876
- "text": "CSS margin value applied to each child element inside the container.\nAccepts standard CSS margin formats (e.g., '10px', '5px 10px', etc.)."
876
+ "text": "CSS margin value applied to each child element inside the container.\r\nAccepts standard CSS margin formats (e.g., '10px', '5px 10px', etc.)."
877
877
  },
878
878
  "getter": false,
879
879
  "setter": false,
@@ -893,7 +893,7 @@ export class LidoText {
893
893
  "optional": false,
894
894
  "docs": {
895
895
  "tags": [],
896
- "text": "CSS padding value applied to each child element inside the container.\nAccepts standard CSS padding formats (e.g., '10px', '5px 10px', etc.)."
896
+ "text": "CSS padding value applied to each child element inside the container.\r\nAccepts standard CSS padding formats (e.g., '10px', '5px 10px', etc.)."
897
897
  },
898
898
  "getter": false,
899
899
  "setter": false,
@@ -913,7 +913,7 @@ export class LidoText {
913
913
  "optional": false,
914
914
  "docs": {
915
915
  "tags": [],
916
- "text": "CSS filter to apply border radius to the image.\nExample: '10px' for images."
916
+ "text": "CSS filter to apply border radius to the image.\r\nExample: '10px' for images."
917
917
  },
918
918
  "getter": false,
919
919
  "setter": false,
@@ -933,7 +933,7 @@ export class LidoText {
933
933
  "optional": false,
934
934
  "docs": {
935
935
  "tags": [],
936
- "text": "Indicates whether to wrap each letter or each word of the text in a span element.\nThis can be useful for animations or styling individual letters."
936
+ "text": "Indicates whether to wrap each letter or each word of the text in a span element.\r\nThis can be useful for animations or styling individual letters."
937
937
  },
938
938
  "getter": false,
939
939
  "setter": false,
@@ -1,8 +1,8 @@
1
- <svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M39 16C42.314 16 45 18.686 45 22V44H48V14C48 10.686 50.686 8 54 8C57.314 8 60 10.686 60 14V44H63V20C63 16.686 65.686 14 69 14C72.314 14 75 16.686 75 20V50C75 62.703 64.703 73 52 73H40C31.163 73 24 65.837 24 57V40C24 36.686 26.686 34 30 34C33.314 34 36 36.686 36 40V22C36 18.686 38.686 16 42 16H39Z" fill="#F4C7A1"/>
3
- <path d="M27 57C27 69.703 37.297 80 50 80H59C69.493 80 78 71.493 78 61V50" stroke="#C77E55" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
4
- <path d="M30 43C30 39.686 32.686 37 36 37C39.314 37 42 39.686 42 43V55" stroke="#C77E55" stroke-width="4" stroke-linecap="round"/>
5
- <path d="M45 22C45 18.686 47.686 16 51 16C54.314 16 57 18.686 57 22V49" stroke="#C77E55" stroke-width="4" stroke-linecap="round"/>
6
- <path d="M60 14C60 10.686 62.686 8 66 8C69.314 8 72 10.686 72 14V48" stroke="#C77E55" stroke-width="4" stroke-linecap="round"/>
7
- <path d="M75 20C75 16.686 77.686 14 81 14C84.314 14 87 16.686 87 20V43" stroke="#C77E55" stroke-width="4" stroke-linecap="round"/>
8
- </svg>
1
+ <svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M39 16C42.314 16 45 18.686 45 22V44H48V14C48 10.686 50.686 8 54 8C57.314 8 60 10.686 60 14V44H63V20C63 16.686 65.686 14 69 14C72.314 14 75 16.686 75 20V50C75 62.703 64.703 73 52 73H40C31.163 73 24 65.837 24 57V40C24 36.686 26.686 34 30 34C33.314 34 36 36.686 36 40V22C36 18.686 38.686 16 42 16H39Z" fill="#F4C7A1"/>
3
+ <path d="M27 57C27 69.703 37.297 80 50 80H59C69.493 80 78 71.493 78 61V50" stroke="#C77E55" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M30 43C30 39.686 32.686 37 36 37C39.314 37 42 39.686 42 43V55" stroke="#C77E55" stroke-width="4" stroke-linecap="round"/>
5
+ <path d="M45 22C45 18.686 47.686 16 51 16C54.314 16 57 18.686 57 22V49" stroke="#C77E55" stroke-width="4" stroke-linecap="round"/>
6
+ <path d="M60 14C60 10.686 62.686 8 66 8C69.314 8 72 10.686 72 14V48" stroke="#C77E55" stroke-width="4" stroke-linecap="round"/>
7
+ <path d="M75 20C75 16.686 77.686 14 81 14C84.314 14 87 16.686 87 20V43" stroke="#C77E55" stroke-width="4" stroke-linecap="round"/>
8
+ </svg>
@@ -1,98 +1,98 @@
1
- :host {
2
- display: block;
3
- position: relative;
4
- }
5
-
6
- #lido-svgContainer {
7
- /* position: absolute; */
8
- /* top: 0; */
9
- /* left: 0; */
10
- /* right: 0; */
11
- /* bottom: 50px; */
12
- display: flex;
13
- justify-content: center;
14
- align-items: center;
15
- overflow: hidden;
16
- }
17
-
18
- .lido-trace-svg {
19
- width: 100%;
20
- height: 100%;
21
- /* max-height: calc(100vh - 50px); */
22
- /* border: 1px solid black; */
23
- touch-action: none;
24
- }
25
-
26
- #lido-draggableCircle {
27
- cursor: pointer;
28
- fill: #CF1565;
29
- transition: fill 0.2s, r 0.2s;
30
- }
31
-
32
- .lido-blindTracing {
33
- stroke: none !important;
34
- }
35
-
36
- .lido-blindFreeTrace {
37
- stroke: none !important;
38
- }
39
-
40
- .lido-hovered {
41
- cursor: grab;
42
- fill: darkred;
43
- }
44
-
45
- #lido-controls {
46
- position: fixed;
47
- bottom: 0;
48
- left: 0;
49
- right: 0;
50
- display: flex;
51
- justify-content: space-between;
52
- padding: 10px;
53
- background-color: #f0f0f0;
54
- border-top: 1px solid #ccc;
55
- }
56
-
57
- button {
58
- padding: 10px;
59
- font-size: 16px;
60
- }
61
-
62
- @media (max-width: 600px) {
63
- button {
64
- padding: 8px;
65
- font-size: 14px;
66
- }
67
- }
68
-
69
- .lido-trace-path-green {
70
- /* stroke: green !important; */
71
- }
72
-
73
- .lido-flow-indicator {
74
- stroke: blue;
75
- stroke-width: 2;
76
- stroke-dasharray: 6, 6; /* Uniform dotted line */
77
- fill: none;
78
- }
79
-
80
- .lido-trace {
81
- height: 700px;
82
- width: 700px;
83
- z-index: 1;
84
- /* position: absolute; */
85
- justify-items: center;
86
- /* align-items: center; */
87
- align-content: center;
88
- }
89
-
90
- .trace-animate {
91
- animation: trace-bounce 0.5s;
92
- }
93
- @keyframes trace-bounce {
94
- 0% { transform: scale(1); }
95
- 30% { transform: scale(1.05); }
96
- 60% { transform: scale(0.95); }
97
- 100% { transform: scale(1); }
1
+ :host {
2
+ display: block;
3
+ position: relative;
4
+ }
5
+
6
+ #lido-svgContainer {
7
+ /* position: absolute; */
8
+ /* top: 0; */
9
+ /* left: 0; */
10
+ /* right: 0; */
11
+ /* bottom: 50px; */
12
+ display: flex;
13
+ justify-content: center;
14
+ align-items: center;
15
+ overflow: hidden;
16
+ }
17
+
18
+ .lido-trace-svg {
19
+ width: 100%;
20
+ height: 100%;
21
+ /* max-height: calc(100vh - 50px); */
22
+ /* border: 1px solid black; */
23
+ touch-action: none;
24
+ }
25
+
26
+ #lido-draggableCircle {
27
+ cursor: pointer;
28
+ fill: #CF1565;
29
+ transition: fill 0.2s, r 0.2s;
30
+ }
31
+
32
+ .lido-blindTracing {
33
+ stroke: none !important;
34
+ }
35
+
36
+ .lido-blindFreeTrace {
37
+ stroke: none !important;
38
+ }
39
+
40
+ .lido-hovered {
41
+ cursor: grab;
42
+ fill: darkred;
43
+ }
44
+
45
+ #lido-controls {
46
+ position: fixed;
47
+ bottom: 0;
48
+ left: 0;
49
+ right: 0;
50
+ display: flex;
51
+ justify-content: space-between;
52
+ padding: 10px;
53
+ background-color: #f0f0f0;
54
+ border-top: 1px solid #ccc;
55
+ }
56
+
57
+ button {
58
+ padding: 10px;
59
+ font-size: 16px;
60
+ }
61
+
62
+ @media (max-width: 600px) {
63
+ button {
64
+ padding: 8px;
65
+ font-size: 14px;
66
+ }
67
+ }
68
+
69
+ .lido-trace-path-green {
70
+ /* stroke: green !important; */
71
+ }
72
+
73
+ .lido-flow-indicator {
74
+ stroke: blue;
75
+ stroke-width: 2;
76
+ stroke-dasharray: 6, 6; /* Uniform dotted line */
77
+ fill: none;
78
+ }
79
+
80
+ .lido-trace {
81
+ height: 700px;
82
+ width: 700px;
83
+ z-index: 1;
84
+ /* position: absolute; */
85
+ justify-items: center;
86
+ /* align-items: center; */
87
+ align-content: center;
88
+ }
89
+
90
+ .trace-animate {
91
+ animation: trace-bounce 0.5s;
92
+ }
93
+ @keyframes trace-bounce {
94
+ 0% { transform: scale(1); }
95
+ 30% { transform: scale(1.05); }
96
+ 60% { transform: scale(0.95); }
97
+ 100% { transform: scale(1); }
98
98
  }
@@ -111,6 +111,7 @@ export class LidoTrace {
111
111
  this.fileIndex = -1;
112
112
  this.isDragging = false;
113
113
  this.activePointerId = null;
114
+ this.activeTraceState = null;
114
115
  // Counter for throttling free trace updates
115
116
  // This is only an internal counter. Keeping it out of @State prevents a
116
117
  // Stencil component re-render while the user is dragging.
@@ -125,6 +126,7 @@ export class LidoTrace {
125
126
  // Handle the pointermove event with optimizations
126
127
  // Update the path trace as the red circle moves
127
128
  async initializeSVG() {
129
+ this.cleanupTraceState(this.activeTraceState);
128
130
  let state = {
129
131
  fileIndex: -1,
130
132
  currentPathIndex: 0,
@@ -147,7 +149,10 @@ export class LidoTrace {
147
149
  dragOffset: null,
148
150
  isCompletingPath: false,
149
151
  touchProximityThreshold: null,
152
+ pointerTransform: null,
153
+ pointerRect: null,
150
154
  };
155
+ this.activeTraceState = state;
151
156
  const url = this.svgUrls[this.currentSvgIndex];
152
157
  if (!url || url.trim() === '') {
153
158
  console.error('No SVG URL provided or index out of bounds.');
@@ -174,6 +179,27 @@ export class LidoTrace {
174
179
  disconnectedCallback() {
175
180
  window.removeEventListener('resize', this.handleWindowResize);
176
181
  window.removeEventListener('load', this.handleWindowLoad);
182
+ this.cleanupTraceState(this.activeTraceState);
183
+ this.activeTraceState = null;
184
+ }
185
+ /** Release listeners, pending frames, timers, and cached SVG geometry. */
186
+ cleanupTraceState(state) {
187
+ var _a;
188
+ if (!state)
189
+ return;
190
+ (_a = state.cleanup) === null || _a === void 0 ? void 0 : _a.call(state);
191
+ if (state.rafId)
192
+ cancelAnimationFrame(state.rafId);
193
+ state.rafId = null;
194
+ state.pointerMoveEvent = null;
195
+ state.pathSamples = [];
196
+ state.paths = [];
197
+ state.svg = null;
198
+ if (this.idleTimer !== null) {
199
+ clearTimeout(this.idleTimer);
200
+ this.idleTimer = null;
201
+ }
202
+ this.hideFingerHint();
177
203
  }
178
204
  /** ───────────────────────────────────────────────────────────
179
205
  * Idle‑timer helpers
@@ -372,6 +398,18 @@ export class LidoTrace {
372
398
  path._lidoTraceStart = path.getPointAtLength(0);
373
399
  path._lidoTraceEnd = path.getPointAtLength(pathLength);
374
400
  path._lidoTraceIsClosed = this.getDistanceSquared(path._lidoTraceStart, path._lidoTraceEnd) < 200;
401
+ // Index the path once. Repeated getPointAtLength calls are expensive on
402
+ // low-end SVG implementations and used to dominate every pointer frame.
403
+ const sampleCount = 192;
404
+ const sampleStep = pathLength / sampleCount || 1;
405
+ const samples = [];
406
+ for (let sampleIndex = 0; sampleIndex <= sampleCount; sampleIndex++) {
407
+ const length = Math.min(pathLength, sampleIndex * sampleStep);
408
+ const point = path.getPointAtLength(length);
409
+ samples.push({ x: point.x, y: point.y, length });
410
+ }
411
+ path._lidoTraceSamples = samples;
412
+ path._lidoTraceSampleStep = sampleStep;
375
413
  // /** give every path an id so <mpath> can follow it */
376
414
  path.setAttribute('id', 'lido-path-' + index); // ← NEW
377
415
  // Create green path for tracing effect
@@ -406,7 +444,7 @@ export class LidoTrace {
406
444
  state.flowMarkers = this.createFlowMarkersForPath(path);
407
445
  }
408
446
  });
409
- state.totalPathLength = state.paths[state.currentPathIndex].getTotalLength();
447
+ state.totalPathLength = state.paths[state.currentPathIndex]._lidoTraceLength;
410
448
  }
411
449
  // Set up the draggable circle at the start of the first path
412
450
  setupDraggableCircle(state) {
@@ -431,10 +469,14 @@ export class LidoTrace {
431
469
  return;
432
470
  state.svg.style.touchAction = 'none';
433
471
  state.circle.style.touchAction = 'none';
434
- // Handle pointerdown on the circle to start dragging
435
- state.circle.addEventListener('pointerdown', (evt) => {
472
+ // Keep named handlers so the detached SVG can be fully released when the
473
+ // next trace starts. Anonymous handlers here previously retained every
474
+ // completed trace for the lifetime of the page.
475
+ const onPointerDown = (evt) => {
436
476
  evt.preventDefault(); // Prevent default actions like text selection
437
- const pointerPos = this.getPointerPosition(evt, state.svg);
477
+ state.pointerRect = state.svg.getBoundingClientRect();
478
+ state.pointerTransform = this.getSvgViewBoxTransform(state.svg, state.pointerRect);
479
+ const pointerPos = this.getPointerPosition(evt, state.svg, state.pointerTransform, state.pointerRect);
438
480
  const circlePos = {
439
481
  x: parseFloat(state.circle.getAttribute('cx')),
440
482
  y: parseFloat(state.circle.getAttribute('cy')),
@@ -459,9 +501,9 @@ export class LidoTrace {
459
501
  }
460
502
  this.hideFingerHint(); // ← NEW
461
503
  this.resetIdleTimer(state); // ← NEW
462
- }, { passive: false });
504
+ };
463
505
  // Handle pointermove on the SVG to update the circle position
464
- (_a = state.svg) === null || _a === void 0 ? void 0 : _a.addEventListener('pointermove', (evt) => {
506
+ const onPointerMove = (evt) => {
465
507
  if (!state.isDragging || evt.pointerId !== state.activePointerId)
466
508
  return;
467
509
  evt.preventDefault();
@@ -472,7 +514,7 @@ export class LidoTrace {
472
514
  state.rafId = null;
473
515
  });
474
516
  }
475
- });
517
+ };
476
518
  // Handle pointerup and pointercancel on the SVG to stop dragging
477
519
  const endDrag = (evt) => {
478
520
  if (evt.pointerId === state.activePointerId) {
@@ -484,12 +526,25 @@ export class LidoTrace {
484
526
  this.resetIdleTimer(state); // ← NEW
485
527
  }
486
528
  };
487
- (_b = state.svg) === null || _b === void 0 ? void 0 : _b.addEventListener('pointerup', endDrag);
488
- (_c = state.svg) === null || _c === void 0 ? void 0 : _c.addEventListener('pointercancel', endDrag);
529
+ (_a = state.svg) === null || _a === void 0 ? void 0 : _a.addEventListener('pointerup', endDrag);
530
+ (_b = state.svg) === null || _b === void 0 ? void 0 : _b.addEventListener('pointercancel', endDrag);
489
531
  // Optional: Prevent context menu on long press
490
- (_d = state.svg) === null || _d === void 0 ? void 0 : _d.addEventListener('contextmenu', (evt) => {
532
+ const onContextMenu = (evt) => {
491
533
  evt.preventDefault();
492
- });
534
+ };
535
+ state.circle.addEventListener('pointerdown', onPointerDown, { passive: false });
536
+ (_c = state.svg) === null || _c === void 0 ? void 0 : _c.addEventListener('pointermove', onPointerMove);
537
+ (_d = state.svg) === null || _d === void 0 ? void 0 : _d.addEventListener('contextmenu', onContextMenu);
538
+ state.cleanup = () => {
539
+ var _a, _b, _c, _d, _e;
540
+ (_a = state.circle) === null || _a === void 0 ? void 0 : _a.removeEventListener('pointerdown', onPointerDown);
541
+ (_b = state.svg) === null || _b === void 0 ? void 0 : _b.removeEventListener('pointermove', onPointerMove);
542
+ (_c = state.svg) === null || _c === void 0 ? void 0 : _c.removeEventListener('pointerup', endDrag);
543
+ (_d = state.svg) === null || _d === void 0 ? void 0 : _d.removeEventListener('pointercancel', endDrag);
544
+ (_e = state.svg) === null || _e === void 0 ? void 0 : _e.removeEventListener('contextmenu', onContextMenu);
545
+ state.isDragging = false;
546
+ state.activePointerId = null;
547
+ };
493
548
  }
494
549
  // Modified handlePointerMove function
495
550
  async handlePointerMove(state) {
@@ -502,7 +557,7 @@ export class LidoTrace {
502
557
  return;
503
558
  this.hideFingerHint(); // user is active, remove hint
504
559
  const evt = state.pointerMoveEvent;
505
- const rawPointerPos = this.getPointerPosition(evt, state.svg);
560
+ const rawPointerPos = this.getPointerPosition(evt, state.svg, state.pointerTransform, state.pointerRect);
506
561
  const pointerPos = state.dragOffset
507
562
  ? {
508
563
  x: rawPointerPos.x - state.dragOffset.x,
@@ -534,9 +589,16 @@ export class LidoTrace {
534
589
  const proximitySquared = proximityThreshold * proximityThreshold;
535
590
  // Calculate the distance between the pointer and the draggable circle
536
591
  const distanceSquared = this.getDistanceSquared(pointerPos, circlePos);
537
- // If the pointer is outside the proximity threshold, do not proceed with drawing or moving
538
- if (distanceSquared > proximitySquared) {
539
- return; // Skip any further actions
592
+ // The red circle can lag behind a touch pointer when a lower-end device
593
+ // drops frames. Do not reject the touch solely because it has moved ahead
594
+ // of the circle: the path-distance check below still ensures the pointer
595
+ // remains on the trace. This prevents long, narrow curves from becoming
596
+ // stuck halfway through a stroke.
597
+ const pointerLeadThreshold = evt.pointerType === 'touch'
598
+ ? Math.max(proximityThreshold * 4, 180)
599
+ : Math.max(proximityThreshold * 2, 120);
600
+ if (distanceSquared > pointerLeadThreshold * pointerLeadThreshold) {
601
+ return;
540
602
  }
541
603
  const isFreeTraceMode = state.mode === TraceMode.FreeTrace || state.mode === TraceMode.BlindFreeTrace;
542
604
  const closestPoint = this.getClosestPointOnPath(currentPath, pointerPos, isFreeTraceMode ? undefined : state.lastLength);
@@ -612,7 +674,7 @@ export class LidoTrace {
612
674
  // In normal modes, allow movement and drawing only within the general proximity threshold
613
675
  const BACKWARD_TOLERANCE = 20; // allow slight backward movement
614
676
  const MAX_FORWARD_JUMP = 80; // prevent jumping to wrong segment
615
- const RECOVERY_FORWARD_JUMP = Math.min(320, Math.max(160, state.totalPathLength * 0.45)); // recover on long strokes without skipping short paths
677
+ const RECOVERY_FORWARD_JUMP = Math.min(evt.pointerType === 'touch' ? 480 : 320, Math.max(evt.pointerType === 'touch' ? 220 : 160, state.totalPathLength * 0.45)); // recover on long strokes without skipping short paths
616
678
  const RECOVERY_END_BUFFER = Math.min(60, Math.max(24, state.totalPathLength * 0.12)); // don't let recovery auto-finish the last part
617
679
  const RECOVERY_POINTER_MOVE_THRESHOLD = 8; // only recover after a meaningful drag, not during slow tracing
618
680
  let guidedClosestPoint = closestPoint;
@@ -766,9 +828,9 @@ export class LidoTrace {
766
828
  triggerNextContainer();
767
829
  }
768
830
  // Get the pointer position relative to the SVG
769
- getPointerPosition(evt, svg) {
831
+ getPointerPosition(evt, svg, cachedTransform, cachedRect) {
770
832
  var _a;
771
- const viewBoxPoint = this.getPointerPositionFromViewBox(evt, svg);
833
+ const viewBoxPoint = this.getPointerPositionFromViewBox(evt, svg, cachedTransform, cachedRect);
772
834
  if (viewBoxPoint)
773
835
  return viewBoxPoint;
774
836
  const svgPoint = svg.createSVGPoint();
@@ -777,13 +839,13 @@ export class LidoTrace {
777
839
  const ctm = (_a = svg.getScreenCTM()) === null || _a === void 0 ? void 0 : _a.inverse();
778
840
  return ctm ? svgPoint.matrixTransform(ctm) : { x: evt.clientX, y: evt.clientY };
779
841
  }
780
- getPointerPositionFromViewBox(evt, svg) {
781
- const rect = svg.getBoundingClientRect();
842
+ getPointerPositionFromViewBox(evt, svg, cachedTransform, cachedRect) {
843
+ const rect = cachedRect || svg.getBoundingClientRect();
782
844
  const viewBox = svg.viewBox.baseVal;
783
845
  if (!rect.width || !rect.height || !viewBox.width || !viewBox.height) {
784
846
  return null;
785
847
  }
786
- const { offsetX, offsetY, scaleX, scaleY } = this.getSvgViewBoxTransform(svg, rect);
848
+ const { offsetX, offsetY, scaleX, scaleY } = cachedTransform || this.getSvgViewBoxTransform(svg, rect);
787
849
  return {
788
850
  x: viewBox.x + (evt.clientX - rect.left - offsetX) / scaleX,
789
851
  y: viewBox.y + (evt.clientY - rect.top - offsetY) / scaleY,
@@ -843,6 +905,40 @@ export class LidoTrace {
843
905
  getClosestPointOnPath(pathNode, point, lastLength) {
844
906
  var _a;
845
907
  const pathLength = (_a = pathNode._lidoTraceLength) !== null && _a !== void 0 ? _a : pathNode.getTotalLength();
908
+ const samples = pathNode._lidoTraceSamples;
909
+ const sampleStep = pathNode._lidoTraceSampleStep;
910
+ if ((samples === null || samples === void 0 ? void 0 : samples.length) && sampleStep) {
911
+ const searchWindow = lastLength === undefined ? pathLength : 150;
912
+ const searchStart = lastLength === undefined ? 0 : Math.max(0, lastLength - searchWindow);
913
+ const searchEnd = lastLength === undefined ? pathLength : Math.min(pathLength, lastLength + searchWindow);
914
+ let nearest = samples[Math.max(0, Math.min(samples.length - 1, Math.round((lastLength || 0) / sampleStep)))];
915
+ let nearestDistance = Infinity;
916
+ for (const sample of samples) {
917
+ if (sample.length < searchStart || sample.length > searchEnd)
918
+ continue;
919
+ const distance = this.getDistanceSquared(point, sample);
920
+ if (distance < nearestDistance) {
921
+ nearestDistance = distance;
922
+ nearest = sample;
923
+ }
924
+ }
925
+ // Refine only around the cached winner. This keeps the path accurate
926
+ // while reducing hot-path geometry calls from roughly 50 to a handful.
927
+ const refinementStep = 6;
928
+ const refineStart = Math.max(searchStart, nearest.length - sampleStep);
929
+ const refineEnd = Math.min(searchEnd, nearest.length + sampleStep);
930
+ let closestPoint = Object.assign({}, nearest);
931
+ let minDistanceSquared = nearestDistance;
932
+ for (let length = refineStart; length <= refineEnd; length += refinementStep) {
933
+ const candidate = pathNode.getPointAtLength(length);
934
+ const distance = this.getDistanceSquared(point, candidate);
935
+ if (distance < minDistanceSquared) {
936
+ minDistanceSquared = distance;
937
+ closestPoint = { x: candidate.x, y: candidate.y, length };
938
+ }
939
+ }
940
+ return closestPoint;
941
+ }
846
942
  let closestPoint = { x: 0, y: 0, length: 0 };
847
943
  let minDistanceSquared = Infinity;
848
944
  const coarseStep = 40;
@@ -1035,7 +1131,7 @@ export class LidoTrace {
1035
1131
  };
1036
1132
  }
1037
1133
  render() {
1038
- return (h(Host, { key: '2f62ab117a595ba9af7f926ad7240902caf7fd99', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, h("div", { key: '5a14b9bc1ff4d71ffc740c8afaa1d07754044a9d', style: this.style, id: "lido-svgContainer" })));
1134
+ return (h(Host, { key: 'fecd265e2c8a5f7d391fe99e35739f76759da5b6', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, h("div", { key: '677681edfa9da3e7f8bea5f79d62900322262460', style: this.style, id: "lido-svgContainer" })));
1039
1135
  }
1040
1136
  static get is() { return "lido-trace"; }
1041
1137
  static get originalStyleUrls() {
@@ -1323,7 +1419,7 @@ export class LidoTrace {
1323
1419
  "optional": false,
1324
1420
  "docs": {
1325
1421
  "tags": [],
1326
- "text": "Mode for the tracing interaction, defining how users interact with the SVG paths.\nOptions may include `\"noFlow\"`, `\"showFlow\"`, `\"freeTrace\"`, `\"blindTracing\"`, and `\"blindFreeTrace\"`"
1422
+ "text": "Mode for the tracing interaction, defining how users interact with the SVG paths.\r\nOptions may include `\"noFlow\"`, `\"showFlow\"`, `\"freeTrace\"`, `\"blindTracing\"`, and `\"blindFreeTrace\"`"
1327
1423
  },
1328
1424
  "getter": false,
1329
1425
  "setter": false,