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.
- package/LICENSE +21 -21
- package/dist/cjs/{decode-Bny56MQ9.js → decode-Cr5DANqc.js} +1 -1
- package/dist/cjs/{index-BY9fvbr8.js → index-0BvcfeCt.js} +144 -68
- package/dist/cjs/{index-DjsCseV8.js → index-DnaH8sO-.js} +20 -67
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/lido-avatar_22.cjs.entry.js +279 -66
- package/dist/cjs/lido-player.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/avatar/lido-avatar.css +4 -4
- package/dist/collection/components/avatar/lido-avatar.js +1 -1
- package/dist/collection/components/avatar/lido-avatar.tsx +207 -207
- package/dist/collection/components/avatar/readme.md +49 -49
- package/dist/collection/components/calculator/lido-calculator.css +89 -89
- package/dist/collection/components/calculator/lido-calculator.js +2 -2
- package/dist/collection/components/canvas/lido-canvas.css +33 -33
- package/dist/collection/components/canvas/lido-canvas.js +1 -1
- package/dist/collection/components/cell/lido-cell.css +100 -100
- package/dist/collection/components/cell/lido-cell.js +12 -12
- package/dist/collection/components/column/lido-col.css +19 -19
- package/dist/collection/components/column/lido-col.js +6 -6
- package/dist/collection/components/container/lido-container.css +10 -10
- package/dist/collection/components/container/lido-container.js +8 -8
- package/dist/collection/components/flashCard/lido-flash-card.css +46 -28
- package/dist/collection/components/flashCard/lido-flash-card.js +131 -14
- package/dist/collection/components/float/lido-float.css +30 -30
- package/dist/collection/components/float/lido-float.js +2 -2
- package/dist/collection/components/home/lido-home.css +309 -309
- package/dist/collection/components/home/lido-home.js +9 -6
- package/dist/collection/components/image/lido-image.css +17 -17
- package/dist/collection/components/image/lido-image.js +6 -6
- package/dist/collection/components/keyboard/lido-keyboard.css +38 -38
- package/dist/collection/components/keyboard/lido-keyboard.js +3 -3
- package/dist/collection/components/mathMatrix/lido-math-matrix.css +56 -56
- package/dist/collection/components/mathMatrix/lido-math-matrix.js +1 -1
- package/dist/collection/components/position/lido-pos.css +16 -16
- package/dist/collection/components/position/lido-pos.js +2 -2
- package/dist/collection/components/random/lido-random.css +8 -8
- package/dist/collection/components/random/lido-random.js +2 -2
- package/dist/collection/components/root/lido-root.js +5 -5
- package/dist/collection/components/row/lido-row.css +10 -10
- package/dist/collection/components/row/lido-row.js +6 -6
- package/dist/collection/components/scale/assets/Shadow.svg +9 -9
- package/dist/collection/components/scale/lido-balance.css +174 -145
- package/dist/collection/components/scale/lido-balance.js +54 -14
- package/dist/collection/components/shape/lido-shape.css +216 -216
- package/dist/collection/components/shape/lido-shape.js +6 -6
- package/dist/collection/components/slideFill/lido-slide-fill.css +3 -3
- package/dist/collection/components/slideFill/lido-slide-fill.js +13 -13
- package/dist/collection/components/text/lido-text.css +53 -53
- package/dist/collection/components/text/lido-text.js +5 -5
- package/dist/collection/components/trace/assets/Tracing-hand.svg +8 -8
- package/dist/collection/components/trace/lido-trace.css +97 -97
- package/dist/collection/components/trace/lido-trace.js +119 -23
- package/dist/collection/components/wrap/lido-wrap.css +18 -18
- package/dist/collection/components/wrap/lido-wrap.js +6 -6
- package/dist/collection/css/animation.css +211 -211
- package/dist/collection/css/index.css +323 -323
- package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +61 -61
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +123 -123
- package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +48 -48
- package/dist/collection/stories/Templates/Tag/tagGame.stories.js +39 -39
- package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +44 -44
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +35 -35
- package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +38 -38
- package/dist/collection/stories/Templates/blender/blender.stories.js +59 -59
- package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
- package/dist/collection/stories/Templates/calculator/calculator.stories.js +28 -28
- package/dist/collection/stories/Templates/categorize/categorize.stories.js +37 -37
- package/dist/collection/stories/Templates/categorize2/categorize2.stories.js +67 -67
- package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +29 -29
- package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +13 -13
- package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +74 -74
- package/dist/collection/stories/Templates/dragAndDrop/drag-drop.stories.js +69 -69
- package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +43 -43
- package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +282 -282
- package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +35 -35
- package/dist/collection/stories/Templates/grid/grid.stories.js +118 -118
- package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +57 -57
- package/dist/collection/stories/Templates/imageMatch/imageMatch.stories.js +44 -44
- package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +41 -41
- package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +183 -183
- package/dist/collection/stories/Templates/makeSentence/make-sentence.stories.js +36 -36
- package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +69 -69
- package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +84 -84
- package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +31 -31
- package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +112 -112
- package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +47 -47
- package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +57 -57
- package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +53 -53
- package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +46 -46
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +45 -45
- package/dist/collection/stories/Templates/numberIdentification/numberIdentificationimageTotext.stories.js +56 -56
- package/dist/collection/stories/Templates/numberIdentification/numberIdentificationtextTotext.stories.js +53 -53
- package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +127 -127
- package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +47 -47
- package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +38 -38
- package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +97 -97
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +90 -90
- package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaMultiOption.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaSumTogether.stories.js +45 -45
- package/dist/collection/stories/Templates/palEgmaPatternMatching/palEgmaPatternMatching.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgmaWordProblem/palEgmaWordProblem.stories.js +79 -79
- package/dist/collection/stories/Templates/palEgraInventedSpelling/pal_egra_invented_spelling_schema.stories.js +32 -32
- package/dist/collection/stories/Templates/palEgraMCQWithImage/palEgraMCQWithImage.stories.js +42 -42
- package/dist/collection/stories/Templates/palEgraOptionWithAudio/palEgraOptionWithAudio.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgraStoryMaking/pal_egra_story_making.stories.js +44 -44
- package/dist/collection/stories/Templates/palEgraTemplate1/palEgraLetterIdentification.stories.js +34 -34
- package/dist/collection/stories/Templates/palEgraWordMatch/palEgraWordMatch.stories.js +52 -52
- package/dist/collection/stories/Templates/palEgra_OddOneOut/palEgra_oddOneOut.stories.js +33 -33
- package/dist/collection/stories/Templates/palEgra_arrange_pictures/palEgra_arrange_pictures.stories.js +40 -40
- package/dist/collection/stories/Templates/palEgra_build_word/palEgra_build_word.stories.js +48 -48
- package/dist/collection/stories/Templates/palEgra_word_formation/palEgra_WordFormation.stories.js +48 -48
- package/dist/collection/stories/Templates/palStorytale/palStorytale.stories.js +18 -18
- package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +44 -44
- package/dist/collection/stories/Templates/pictureClues/pictureClues.stories.js +34 -34
- package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch1.stories.js +36 -36
- package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch2.stories.js +30 -30
- package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +20 -20
- package/dist/collection/stories/Templates/puzzleGame/puzzleGame.stories.js +17 -17
- package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +58 -58
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +50 -50
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +36 -36
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +43 -43
- package/dist/collection/stories/Templates/quizMaths/quizMaths.stories.js +631 -631
- package/dist/collection/stories/Templates/reorder/reorder.stories.js +63 -63
- package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +47 -47
- package/dist/collection/stories/Templates/sentenceMatch/sentenceMatch.stories.js +29 -29
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +64 -64
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +62 -62
- package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +106 -106
- package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +50 -50
- package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +41 -41
- package/dist/collection/stories/Templates/storyTale/storyTale.stories.js +39 -39
- package/dist/collection/stories/Templates/substraction/substractionWithimg.stories.js +62 -62
- package/dist/collection/stories/Templates/substraction/substractionWithoutImg.stories.js +42 -42
- package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +50 -50
- package/dist/collection/stories/Templates/tenBox/tenBox.stories.js +88 -88
- package/dist/collection/stories/Templates/total/total.stories.js +28 -28
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithimg.stories.js +35 -35
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithoutimg.stories.js +34 -34
- package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +31 -31
- package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +58 -58
- package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +44 -44
- package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +31 -31
- package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +34 -34
- package/dist/collection/stories/components/flash-card.stories.js +48 -48
- package/dist/collection/stories/components/keyboard.stories.js +10 -10
- package/dist/collection/stories/components/slider.stories.js +4 -4
- package/dist/collection/stories/components/trace.stories.js +5 -5
- package/dist/collection/utils/audioPlayer.js +9 -12
- package/dist/collection/utils/utils.js +24 -8
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +16 -10
- package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
- package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +58 -1
- package/dist/collection/utils/utilsHandlers/sortHandler.js +10 -10
- package/dist/components/index.js +1 -1
- package/dist/components/lido-avatar.js +1 -1
- package/dist/components/lido-balance.js +1 -1
- package/dist/components/lido-calculator.js +1 -1
- package/dist/components/lido-canvas.js +1 -1
- package/dist/components/lido-cell.js +1 -1
- package/dist/components/lido-col.js +1 -1
- package/dist/components/lido-container.js +1 -1
- package/dist/components/lido-flash-card.js +1 -1
- package/dist/components/lido-float.js +1 -1
- package/dist/components/lido-home.js +1 -1
- package/dist/components/lido-keyboard.js +1 -1
- package/dist/components/lido-math-matrix.js +1 -1
- package/dist/components/lido-pos.js +1 -1
- package/dist/components/lido-random.js +1 -1
- package/dist/components/lido-root.js +1 -1
- package/dist/components/lido-row.js +1 -1
- package/dist/components/lido-shape.js +1 -1
- package/dist/components/lido-slide-fill.js +1 -1
- package/dist/components/lido-text.js +1 -1
- package/dist/components/lido-trace.js +1 -1
- package/dist/components/lido-wrap.js +1 -1
- package/dist/components/{p-BOQDbCrm.js → p-BJiyBHYT.js} +1 -1
- package/dist/components/p-BUfCIPRa.js +1 -0
- package/dist/components/{p-CTlcpv4a.js → p-BfwUqpXc.js} +1 -1
- package/dist/components/p-BiBt9LGP.js +1 -0
- package/dist/components/{p-CgsPIpg0.js → p-Bw-OC9iR.js} +1 -1
- package/dist/components/{p-B4YAipq-.js → p-CFzvgrMa.js} +1 -1
- package/dist/components/{p-C5WmmkI6.js → p-CPYnt0P-.js} +1 -1
- package/dist/components/{p-CCR42e0i.js → p-ChfVUoX4.js} +1 -1
- package/dist/components/{p-CWwymnbk.js → p-CkxAm8rY.js} +2 -2
- package/dist/components/{p-BeRr8u5m.js → p-CwDTdXe5.js} +1 -1
- package/dist/components/{p-CXHPZN3m.js → p-CyGxEcn7.js} +1 -1
- package/dist/components/{p-BJMjg5wu.js → p-D2GhaM-T.js} +1 -1
- package/dist/components/{p-BBHM059l.js → p-DDS30M3y.js} +1 -1
- package/dist/components/p-DP6jQ5ML.js +1 -0
- package/dist/components/{p-CljvnHkI.js → p-DZRNZCPt.js} +1 -1
- package/dist/components/p-DbR5sNOj.js +1 -0
- package/dist/components/{p-B8nzzM8c.js → p-DdQ1eqJr.js} +1 -1
- package/dist/components/p-leIEepjl.js +1 -0
- package/dist/components/p-u3czV7QM.js +1 -0
- package/dist/components/{p-C70ykycD.js → p-useuhkjH.js} +1 -1
- package/dist/esm/{decode-Buyq-Iy5.js → decode-DkSXjv7K.js} +1 -1
- package/dist/esm/{index-CQXciux9.js → index-D9-TTsdZ.js} +144 -68
- package/dist/esm/{index-DQZfuGjI.js → index-Dvjbti-h.js} +20 -67
- package/dist/esm/index.js +2 -2
- package/dist/esm/lido-avatar_22.entry.js +279 -66
- package/dist/esm/lido-player.js +4 -4
- package/dist/esm/loader.js +3 -3
- package/dist/lido-player/assets/Shadow.svg +9 -9
- package/dist/lido-player/assets/Tracing-hand.svg +8 -8
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-avatar.css +4 -4
- package/dist/lido-player/lido-avatar.tsx +207 -207
- package/dist/lido-player/lido-player.css +7 -7
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-35fa0b8b.entry.js +12 -0
- package/dist/lido-player/p-D2iINRNN.js +1 -0
- package/dist/lido-player/{p-CFtq4Thh.js → p-Dc8j8Hxw.js} +1 -1
- package/dist/lido-player/p-Dvjbti-h.js +2 -0
- package/dist/lido-player/readme.md +49 -49
- package/dist/types/components/flashCard/lido-flash-card.d.ts +10 -0
- package/dist/types/components/scale/lido-balance.d.ts +5 -0
- package/dist/types/components/trace/lido-trace.d.ts +9 -1
- package/dist/types/components.d.ts +10 -0
- package/dist/types/stencil-public-runtime.d.ts +55 -73
- package/dist/types/types/json.d.ts +3 -3
- package/dist/types/utils/audioPlayer.d.ts +1 -1
- package/dist/types/utils/utilsHandlers/lidoBalanceHandler.d.ts +10 -0
- package/loader/index.d.ts +1 -1
- package/package.json +74 -74
- package/readme.md +113 -113
- package/dist/components/p-BfqihbR6.js +0 -1
- package/dist/components/p-CwIlwnQk.js +0 -1
- package/dist/components/p-DLyacZap.js +0 -1
- package/dist/components/p-DONbWJGn.js +0 -1
- package/dist/components/p-DVTigdH_.js +0 -1
- package/dist/components/p-DYFVwyRr.js +0 -1
- package/dist/lido-player/p-37736e11.entry.js +0 -12
- package/dist/lido-player/p-3Ry570XH.js +0 -1
- package/dist/lido-player/p-DQZfuGjI.js +0 -3
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$1 = require('./index-
|
|
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
|
}
|
|
@@ -775,7 +832,8 @@ async function handleResetDragElement(dragElement, dropElement, dropHasDrag, sel
|
|
|
775
832
|
dragElement.classList.remove('dropped');
|
|
776
833
|
const container = document.getElementById(LidoContainer);
|
|
777
834
|
const cloneArray = container.querySelectorAll(`#${dragElement.id}`);
|
|
778
|
-
const
|
|
835
|
+
const balanceHome = dragElement.__lidoBalanceHome;
|
|
836
|
+
const cloneDragElement = ((balanceHome === null || balanceHome === void 0 ? void 0 : balanceHome.isConnected) ? balanceHome : Array.from(cloneArray).find(item => dragElement !== item && !item.classList.contains('dropped')));
|
|
779
837
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
780
838
|
if (cloneDragElement) {
|
|
781
839
|
animateDragToTarget(dragElement, cloneDragElement, container);
|
|
@@ -792,6 +850,7 @@ async function handleResetDragElement(dragElement, dropElement, dropHasDrag, sel
|
|
|
792
850
|
dragElement.style.transform = 'translate(0,0)';
|
|
793
851
|
dragElement.style.position = 'unset';
|
|
794
852
|
cloneDragElement.replaceWith(dragElement);
|
|
853
|
+
delete dragElement.__lidoBalanceHome;
|
|
795
854
|
}, 500);
|
|
796
855
|
}
|
|
797
856
|
else {
|
|
@@ -1114,6 +1173,10 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
1114
1173
|
}
|
|
1115
1174
|
highlightElement();
|
|
1116
1175
|
await onActivityComplete(dragElement, dropElement);
|
|
1176
|
+
const dropAction = container.getAttribute('drop-action');
|
|
1177
|
+
if (container.querySelector('lido-balance') && dropAction !== exports.DropAction.Move && dropAction !== exports.DropAction.InfiniteDrop) {
|
|
1178
|
+
placeDragOnBalancePlate(dragElement, dropElement);
|
|
1179
|
+
}
|
|
1117
1180
|
}
|
|
1118
1181
|
function updateDropBorder(element) {
|
|
1119
1182
|
var _a;
|
|
@@ -1179,14 +1242,14 @@ async function onClickDropOrDragElement(element, type) {
|
|
|
1179
1242
|
if (!document.querySelector('#dynamic-highlight-style')) {
|
|
1180
1243
|
const style = document.createElement('style');
|
|
1181
1244
|
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
|
-
}
|
|
1245
|
+
style.innerHTML = `
|
|
1246
|
+
.highlight {
|
|
1247
|
+
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
1248
|
+
// border-radius: 12px; /* Larger rounded corners */
|
|
1249
|
+
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
1250
|
+
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
1251
|
+
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
1252
|
+
}
|
|
1190
1253
|
`;
|
|
1191
1254
|
document.head.appendChild(style);
|
|
1192
1255
|
}
|
|
@@ -1374,34 +1437,34 @@ function highlightSpeakingElement(element) {
|
|
|
1374
1437
|
if (!document.getElementById(styleId)) {
|
|
1375
1438
|
const style = document.createElement('style');
|
|
1376
1439
|
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
|
-
}
|
|
1440
|
+
style.innerHTML = `
|
|
1441
|
+
.speaking-highlight {
|
|
1442
|
+
--base-transform: ${element.style.transform};
|
|
1443
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
1444
|
+
// border: 3px solid green !important;
|
|
1445
|
+
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
1446
|
+
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
1447
|
+
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
1448
|
+
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
@keyframes pulseEffect {
|
|
1452
|
+
0% {
|
|
1453
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1454
|
+
// transform: var(--base-transform) scale(1.05);
|
|
1455
|
+
// background-color: #FFFF0B;
|
|
1456
|
+
}
|
|
1457
|
+
50% {
|
|
1458
|
+
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
1459
|
+
// transform: var(--base-transform) scale(1.1);
|
|
1460
|
+
// background-color: #FFFF0B;
|
|
1461
|
+
}
|
|
1462
|
+
100% {
|
|
1463
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1464
|
+
// transform: var(--base-transform) scale(1.05);
|
|
1465
|
+
// background-color: #FFFF0B;
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1405
1468
|
`;
|
|
1406
1469
|
document.head.appendChild(style);
|
|
1407
1470
|
}
|
|
@@ -1576,7 +1639,7 @@ class AudioPlayer {
|
|
|
1576
1639
|
return el;
|
|
1577
1640
|
return el.closest('lido-text');
|
|
1578
1641
|
}
|
|
1579
|
-
async play(targetElement) {
|
|
1642
|
+
async play(targetElement, suppressHighlight = false) {
|
|
1580
1643
|
this.registerVisibilityEvents();
|
|
1581
1644
|
this.playbackHasStarted = false;
|
|
1582
1645
|
if (!this.isWindowVisible()) {
|
|
@@ -1600,11 +1663,6 @@ class AudioPlayer {
|
|
|
1600
1663
|
console.warn('[AudioPlayer] No lido-container found');
|
|
1601
1664
|
return;
|
|
1602
1665
|
}
|
|
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
1666
|
if (container.getAttribute('highlight-word-by-word') === 'true') {
|
|
1609
1667
|
const textElement = this.getLidoTextElement(targetElement);
|
|
1610
1668
|
if (!textElement) {
|
|
@@ -1616,6 +1674,7 @@ class AudioPlayer {
|
|
|
1616
1674
|
targetElement = textElement;
|
|
1617
1675
|
}
|
|
1618
1676
|
this.currentTargetElement = targetElement;
|
|
1677
|
+
window.dispatchEvent(new CustomEvent('lidoAudioStarted', { detail: { target: targetElement } }));
|
|
1619
1678
|
// then play the target element audio.
|
|
1620
1679
|
let audioUrl = targetElement.getAttribute('audio') || '';
|
|
1621
1680
|
// If no direct audio attribute, check childrens for audio
|
|
@@ -1665,7 +1724,8 @@ class AudioPlayer {
|
|
|
1665
1724
|
this.wordRects = this.computeWordRects(targetElement);
|
|
1666
1725
|
}
|
|
1667
1726
|
else {
|
|
1668
|
-
|
|
1727
|
+
if (!suppressHighlight)
|
|
1728
|
+
highlightSpeakingElement(targetElement);
|
|
1669
1729
|
}
|
|
1670
1730
|
// PLAY ONCE
|
|
1671
1731
|
await this.audioElement.play();
|
|
@@ -1689,18 +1749,17 @@ class AudioPlayer {
|
|
|
1689
1749
|
this.audioElement.onended = null; // cleanup
|
|
1690
1750
|
setDraggingDisabled(false);
|
|
1691
1751
|
if (container.getAttribute('highlight-word-by-word') !== 'true') {
|
|
1692
|
-
|
|
1752
|
+
if (!suppressHighlight)
|
|
1753
|
+
stopHighlightForSpeakingElement(targetElement);
|
|
1693
1754
|
}
|
|
1694
1755
|
}
|
|
1695
1756
|
}
|
|
1696
1757
|
// If no audio, use text-to-speech
|
|
1697
1758
|
else if (targetElement.textContent) {
|
|
1698
1759
|
try {
|
|
1699
|
-
|
|
1700
|
-
|
|
1760
|
+
if (!suppressHighlight)
|
|
1761
|
+
highlightSpeakingElement(targetElement);
|
|
1701
1762
|
await speakText(targetElement.textContent, targetElement);
|
|
1702
|
-
document.querySelectorAll('.speaking-highlight');
|
|
1703
|
-
// highlightedElements.forEach(element => stopHighlightForSpeakingElement(element as HTMLElement));
|
|
1704
1763
|
}
|
|
1705
1764
|
catch (error) { }
|
|
1706
1765
|
finally {
|
|
@@ -1718,6 +1777,7 @@ class AudioPlayer {
|
|
|
1718
1777
|
if (this.currentTargetElement === targetElement) {
|
|
1719
1778
|
this.currentTargetElement = null;
|
|
1720
1779
|
}
|
|
1780
|
+
window.dispatchEvent(new CustomEvent('lidoAudioEnded', { detail: { target: targetElement } }));
|
|
1721
1781
|
}
|
|
1722
1782
|
// GLOBAL STOP EVENTS (container change, activity change…)
|
|
1723
1783
|
registerGlobalStopEvents() {
|
|
@@ -2110,11 +2170,11 @@ function enableReorderDrag(element) {
|
|
|
2110
2170
|
onDropToCategory(element, category);
|
|
2111
2171
|
}
|
|
2112
2172
|
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
|
-
}
|
|
2173
|
+
const keyframes = `
|
|
2174
|
+
@keyframes widthDecrease {
|
|
2175
|
+
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
2176
|
+
100% { width: 0px; height: 0px;}
|
|
2177
|
+
}
|
|
2118
2178
|
`;
|
|
2119
2179
|
const styleSheet = document.styleSheets[0];
|
|
2120
2180
|
styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
|
|
@@ -2337,11 +2397,11 @@ function moveWithAnimation(target, overlapped) {
|
|
|
2337
2397
|
const dummy = createDummyElement(target);
|
|
2338
2398
|
dummy.style.visibility = 'hidden';
|
|
2339
2399
|
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
|
-
}
|
|
2400
|
+
const keyframes = `
|
|
2401
|
+
@keyframes widthIncrease {
|
|
2402
|
+
0% { width: 0px; height: 0px; }
|
|
2403
|
+
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
2404
|
+
}
|
|
2345
2405
|
`;
|
|
2346
2406
|
if (!overlapped) {
|
|
2347
2407
|
const overlapCategory = findMostoverlappedElement(target, 'category');
|
|
@@ -73039,11 +73099,11 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
73039
73099
|
}
|
|
73040
73100
|
dummyElement.setAttribute('id', dragElement.getAttribute('id'));
|
|
73041
73101
|
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
|
-
}
|
|
73102
|
+
const keyframes = `
|
|
73103
|
+
@keyframes widthDecrease {
|
|
73104
|
+
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
73105
|
+
100% { width: 0px; height: 0px; margin: 0px;}
|
|
73106
|
+
}
|
|
73047
73107
|
`;
|
|
73048
73108
|
if (!isInfinite) {
|
|
73049
73109
|
dummyElement.style.width = element.style.width;
|
|
@@ -73253,7 +73313,16 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
73253
73313
|
if (!container)
|
|
73254
73314
|
return;
|
|
73255
73315
|
const isBlender = container.getAttribute('template-id') === 'blender';
|
|
73256
|
-
|
|
73316
|
+
const isBalancing = !!container.querySelector('lido-balance');
|
|
73317
|
+
const usesBalancePlacement = isBalancing
|
|
73318
|
+
&& container.getAttribute('drop-action') !== exports.DropAction.Move
|
|
73319
|
+
&& container.getAttribute('drop-action') !== exports.DropAction.InfiniteDrop;
|
|
73320
|
+
// Balance plates perform their own single placement pass after this method.
|
|
73321
|
+
// Running alignMatch first makes two transforms compete and produces a visible
|
|
73322
|
+
// horizontal drift as the item is re-parented.
|
|
73323
|
+
if (!usesBalancePlacement) {
|
|
73324
|
+
await executeActions("this.alignMatch='true'", dropElement, dragElement);
|
|
73325
|
+
}
|
|
73257
73326
|
if (dragElement && dropElement) {
|
|
73258
73327
|
let isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
73259
73328
|
if (isBlender) {
|
|
@@ -73276,7 +73345,7 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
73276
73345
|
const onCorrect = ((_b = container.getAttribute('dropAttr')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === DropMode.EnableAnimation.toLowerCase()
|
|
73277
73346
|
? ''
|
|
73278
73347
|
: dropElement.getAttribute('onCorrect');
|
|
73279
|
-
if (onCorrect && !isBlender) {
|
|
73348
|
+
if (onCorrect && !isBlender && !isBalancing) {
|
|
73280
73349
|
await executeActions(onCorrect, dropElement, dragElement);
|
|
73281
73350
|
}
|
|
73282
73351
|
//for multiply beeds
|
|
@@ -73315,7 +73384,7 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
73315
73384
|
}, 2000);
|
|
73316
73385
|
}
|
|
73317
73386
|
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
73318
|
-
if (onInCorrect && !isBlender) {
|
|
73387
|
+
if (onInCorrect && !isBlender && !isBalancing) {
|
|
73319
73388
|
await executeActions(onInCorrect, dropElement, dragElement);
|
|
73320
73389
|
}
|
|
73321
73390
|
}
|
|
@@ -73483,6 +73552,13 @@ const validateObjectiveStatus = async () => {
|
|
|
73483
73552
|
else {
|
|
73484
73553
|
res = matchStringPattern(objectiveString, objectiveArray);
|
|
73485
73554
|
}
|
|
73555
|
+
const isBalancing = !!container.querySelector('lido-balance');
|
|
73556
|
+
if (isBalancing && !res) {
|
|
73557
|
+
const dropElements = Array.from(container.querySelectorAll('[type="drop"]'));
|
|
73558
|
+
const filledDropCount = dropElements.filter(drop => !!container.querySelector(`[drop-to="${drop.id}"]`)).length;
|
|
73559
|
+
if (filledDropCount < dropElements.length)
|
|
73560
|
+
return;
|
|
73561
|
+
}
|
|
73486
73562
|
if (res) {
|
|
73487
73563
|
container.setAttribute("game-completed", "true");
|
|
73488
73564
|
const attach = container.getAttribute('appendToDropOnCompletion');
|