lido-player 0.0.2-alpha-50-dev → 0.0.2-alpha-52-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/{index-6a69c33a.js → index-baff5c15.js} +48 -14
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{lido-avatar_21.cjs.entry.js → lido-avatar_22.cjs.entry.js} +3043 -162
- package/dist/cjs/lido-player.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{utils-079a5e7d.js → utils-ce99b0d0.js} +294 -108
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/avatar/lido-avatar.css +4 -4
- package/dist/collection/components/avatar/lido-avatar.js +1 -1
- package/dist/collection/components/calculator/lido-calculator.css +87 -87
- package/dist/collection/components/calculator/lido-calculator.js +14 -8
- package/dist/collection/components/canvas/lido-canvas.css +35 -0
- package/dist/collection/components/canvas/lido-canvas.js +220 -0
- 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 +70 -8
- package/dist/collection/components/flashCard/lido-flash-card.css +28 -28
- package/dist/collection/components/flashCard/lido-flash-card.js +4 -4
- 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 +278 -278
- package/dist/collection/components/home/lido-home.js +92 -12
- 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 +69 -15
- 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 +42 -6
- 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/lido-balance.css +145 -114
- package/dist/collection/components/scale/lido-balance.js +17 -17
- package/dist/collection/components/shape/lido-shape.css +96 -96
- package/dist/collection/components/shape/lido-shape.js +5 -5
- 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 +6 -5
- package/dist/collection/components/trace/lido-trace.css +97 -97
- package/dist/collection/components/trace/lido-trace.js +2 -2
- 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 +194 -194
- package/dist/collection/css/index.css +277 -277
- package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +60 -60
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +123 -123
- package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +55 -48
- package/dist/collection/stories/Templates/Tag/tagGame.stories.js +29 -29
- package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +42 -42
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +37 -31
- package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +38 -38
- package/dist/collection/stories/Templates/blender/blender.stories.js +100 -0
- package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
- package/dist/collection/stories/Templates/calculator/calculator.stories.js +52 -0
- 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 +28 -22
- 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 +39 -38
- package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +282 -282
- package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +37 -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/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 +54 -54
- package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +25 -23
- 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 +32 -28
- package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +56 -54
- package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +56 -45
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +41 -39
- package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +131 -127
- package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +53 -49
- package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +44 -40
- package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +98 -97
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +92 -91
- package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +47 -45
- 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 +62 -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/reorder/reorder.stories.js +63 -63
- package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +52 -48
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +65 -61
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +62 -58
- package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +111 -107
- package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +46 -46
- 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/sumTogether/sumTogether.stories.js +51 -47
- package/dist/collection/stories/Templates/total/total.stories.js +27 -27
- package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +35 -31
- package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +62 -58
- package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +44 -40
- package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +36 -32
- package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +37 -33
- 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 +43 -6
- package/dist/collection/utils/constants.js +1 -0
- package/dist/collection/utils/i18n.js +36 -0
- package/dist/collection/utils/utils.js +170 -36
- package/dist/collection/utils/utilsHandlers/clickHandler.js +5 -1
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +27 -15
- package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
- package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +2 -2
- package/dist/collection/utils/utilsHandlers/lidoCalculatorHandler.js +9 -9
- 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.d.ts +11 -0
- package/dist/components/lido-canvas.js +6 -0
- 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-image.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 +49 -25
- 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-9be56729.js → p-00777872.js} +46 -2
- package/dist/components/{p-3f406017.js → p-06171259.js} +2 -2
- package/dist/components/{p-08d0deab.js → p-09f1e2d2.js} +15 -9
- package/dist/components/{p-e4e42677.js → p-0c2aebfb.js} +2 -2
- package/dist/components/p-0fbeb3a1.js +2700 -0
- package/dist/components/{p-cbac3cbc.js → p-11bf64aa.js} +2 -2
- package/dist/components/{p-44808985.js → p-26df0769.js} +7 -7
- package/dist/components/{p-1fbdb431.js → p-2d53e1a5.js} +2 -2
- package/dist/components/{p-afbc196f.js → p-39a2e638.js} +3 -2
- package/dist/components/{p-e36ddcc1.js → p-3ce3744c.js} +14 -11
- package/dist/components/{p-7f7e5672.js → p-3f4d4c0a.js} +2 -2
- package/dist/components/{p-d37ab4dc.js → p-52e77394.js} +2 -2
- package/dist/components/{p-bed94c37.js → p-58c67252.js} +331 -118
- package/dist/components/p-5b5f59a8.js +129 -0
- package/dist/components/{p-52844fa4.js → p-68112f8c.js} +2 -2
- package/dist/components/{p-15971ede.js → p-8a34b98b.js} +1 -1
- package/dist/components/{p-904711c8.js → p-8f2ed62f.js} +2 -2
- package/dist/components/{p-74849cdd.js → p-9d34d59d.js} +4 -4
- package/dist/components/{p-73e31a86.js → p-a2f96840.js} +8 -8
- package/dist/components/{p-90465904.js → p-a516a324.js} +2 -2
- package/dist/components/{p-322acda6.js → p-b2125fc9.js} +67 -31
- package/dist/components/{p-835b973d.js → p-c4abfd0f.js} +2 -2
- package/dist/components/{p-29bdd953.js → p-cb56a853.js} +2 -2
- package/dist/esm/{index-170e58c7.js → index-37c2ad2d.js} +48 -14
- package/dist/esm/index.js +2 -2
- package/dist/esm/{lido-avatar_21.entry.js → lido-avatar_22.entry.js} +3043 -163
- package/dist/esm/lido-player.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-5df09162.js → utils-107b15a7.js} +294 -108
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-606ea279.entry.js +1 -0
- package/dist/lido-player/p-9a9d5339.js +2 -0
- package/dist/lido-player/{p-7556e652.js → p-d1251482.js} +2 -2
- package/dist/types/components/canvas/lido-canvas.d.ts +27 -0
- package/dist/types/components/container/lido-container.d.ts +6 -0
- package/dist/types/components/home/lido-home.d.ts +8 -0
- package/dist/types/components/mathMatrix/lido-math-matrix.d.ts +3 -1
- package/dist/types/components/root/lido-root.d.ts +5 -0
- package/dist/types/components.d.ts +71 -6
- package/dist/types/stories/Templates/RocketGame/rocketGame.stories.d.ts +1 -0
- package/dist/types/stories/Templates/blender/blender.stories.d.ts +4 -0
- package/dist/types/stories/Templates/calculator/calculator.stories.d.ts +4 -0
- package/dist/types/stories/Templates/multiplyBeeds/multiplyBeeds.stories.d.ts +1 -0
- package/dist/types/stories/Templates/openwindow/openwindow.stories.d.ts +1 -0
- package/dist/types/stories/Templates/openwindow/openwindow2.stories.d.ts +1 -0
- package/dist/types/stories/Templates/questionBoard/questionBoard.stories.d.ts +1 -0
- package/dist/types/stories/Templates/sequenceBox/sequenceBox1.stories.d.ts +1 -0
- package/dist/types/stories/Templates/sequenceBox/sequenceBox2.stories.d.ts +1 -0
- package/dist/types/stories/Templates/shapePair/shape-pair.stories.d.ts +1 -1
- package/dist/types/stories/Templates/sumTogether/sumTogether.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeCard/writeCard.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeLetter/writeLetter.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeNumber/writeNumber.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeWord/writeWord.stories.d.ts +1 -0
- package/dist/types/types/json.d.ts +4 -0
- package/dist/types/utils/audioPlayer.d.ts +2 -0
- package/dist/types/utils/constants.d.ts +1 -0
- package/dist/types/utils/i18n.d.ts +5 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +71 -69
- package/readme.md +113 -113
- package/dist/lido-player/p-137c99ce.js +0 -2
- package/dist/lido-player/p-eb956325.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getAssetPath } from './index-
|
|
1
|
+
import { g as getAssetPath } from './index-37c2ad2d.js';
|
|
2
2
|
|
|
3
3
|
const DragMapKey = 'lidoDragMap';
|
|
4
4
|
const SelectedValuesKey = 'lidoSelectedValues';
|
|
@@ -114,34 +114,34 @@ function highlightSpeakingElement(element) {
|
|
|
114
114
|
if (!document.querySelector(styleId)) {
|
|
115
115
|
const style = document.createElement('style');
|
|
116
116
|
style.id = styleId;
|
|
117
|
-
style.innerHTML = `
|
|
118
|
-
.speaking-highlight {
|
|
119
|
-
--base-transform: ${element.style.transform};
|
|
120
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
121
|
-
// border: 3px solid green !important;
|
|
122
|
-
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
123
|
-
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
124
|
-
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
@keyframes pulseEffect {
|
|
129
|
-
0% {
|
|
130
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
131
|
-
// transform: var(--base-transform) scale(1.05);
|
|
132
|
-
// background-color: #FFFF0B;
|
|
133
|
-
}
|
|
134
|
-
50% {
|
|
135
|
-
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
136
|
-
// transform: var(--base-transform) scale(1.1);
|
|
137
|
-
// background-color: #FFFF0B;
|
|
138
|
-
}
|
|
139
|
-
100% {
|
|
140
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
141
|
-
// transform: var(--base-transform) scale(1.05);
|
|
142
|
-
// background-color: #FFFF0B;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
117
|
+
style.innerHTML = `
|
|
118
|
+
.speaking-highlight {
|
|
119
|
+
--base-transform: ${element.style.transform};
|
|
120
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
121
|
+
// border: 3px solid green !important;
|
|
122
|
+
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
123
|
+
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
124
|
+
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@keyframes pulseEffect {
|
|
129
|
+
0% {
|
|
130
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
131
|
+
// transform: var(--base-transform) scale(1.05);
|
|
132
|
+
// background-color: #FFFF0B;
|
|
133
|
+
}
|
|
134
|
+
50% {
|
|
135
|
+
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
136
|
+
// transform: var(--base-transform) scale(1.1);
|
|
137
|
+
// background-color: #FFFF0B;
|
|
138
|
+
}
|
|
139
|
+
100% {
|
|
140
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
141
|
+
// transform: var(--base-transform) scale(1.05);
|
|
142
|
+
// background-color: #FFFF0B;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
145
|
`;
|
|
146
146
|
document.head.appendChild(style);
|
|
147
147
|
}
|
|
@@ -213,8 +213,8 @@ function balanceResult(container, objectiveString) {
|
|
|
213
213
|
return false;
|
|
214
214
|
const leftVal = Number((_c = (_a = balanceEl.leftVal) !== null && _a !== void 0 ? _a : (_b = balanceEl.dataset) === null || _b === void 0 ? void 0 : _b.leftVal) !== null && _c !== void 0 ? _c : 0);
|
|
215
215
|
const rightVal = Number((_f = (_d = balanceEl.rightVal) !== null && _d !== void 0 ? _d : (_e = balanceEl.dataset) === null || _e === void 0 ? void 0 : _e.rightVal) !== null && _f !== void 0 ? _f : 0);
|
|
216
|
-
const hasLeft = !isNaN(leftVal)
|
|
217
|
-
const hasRight = !isNaN(rightVal)
|
|
216
|
+
const hasLeft = !isNaN(leftVal);
|
|
217
|
+
const hasRight = !isNaN(rightVal);
|
|
218
218
|
if (!hasLeft || !hasRight) {
|
|
219
219
|
return false;
|
|
220
220
|
}
|
|
@@ -264,6 +264,7 @@ function enableOptionArea(element) {
|
|
|
264
264
|
}
|
|
265
265
|
let isDraggingDisabled = false;
|
|
266
266
|
const setDraggingDisabled = (disabled) => {
|
|
267
|
+
console.log("Setting dragging disabled to:", disabled);
|
|
267
268
|
isDraggingDisabled = disabled;
|
|
268
269
|
};
|
|
269
270
|
function enableDraggingWithScaling(element) {
|
|
@@ -453,7 +454,9 @@ function enableDraggingWithScaling(element) {
|
|
|
453
454
|
mostOverlappedElement.style.backgroundColor = 'rgba(255, 0, 0, 0.1)'; // Light red background
|
|
454
455
|
}
|
|
455
456
|
else {
|
|
456
|
-
|
|
457
|
+
if (!document.getElementById('unitsDrop') || !document.getElementById('tensDrop') || !document.getElementById('hundredsDrop')) {
|
|
458
|
+
mostOverlappedElement.style.opacity = '0.3';
|
|
459
|
+
}
|
|
457
460
|
}
|
|
458
461
|
}
|
|
459
462
|
};
|
|
@@ -508,6 +511,7 @@ function enableDraggingWithScaling(element) {
|
|
|
508
511
|
// Check for overlaps and log the most overlapping element
|
|
509
512
|
let mostOverlappedElement = findMostoverlappedElement$1(element, 'drop');
|
|
510
513
|
onElementDropComplete(element, mostOverlappedElement);
|
|
514
|
+
executeActions("this.updateCountBlender='true'", container);
|
|
511
515
|
if (((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) {
|
|
512
516
|
if (mostOverlappedElement) {
|
|
513
517
|
if (element) {
|
|
@@ -709,10 +713,10 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
709
713
|
let dropHasDrag = buildDropHasDragFromDOM();
|
|
710
714
|
if (!dropElement) {
|
|
711
715
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
712
|
-
return;
|
|
713
716
|
}
|
|
714
717
|
const dropTabIndex = dropElement.getAttribute('tab-index');
|
|
715
|
-
|
|
718
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'false';
|
|
719
|
+
if (((_b = dropHasDrag[dropTabIndex]) === null || _b === void 0 ? void 0 : _b.isFull) && !isAllowOnlyOneDrop) {
|
|
716
720
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
717
721
|
return;
|
|
718
722
|
}
|
|
@@ -746,6 +750,9 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
746
750
|
if (!isCorrect) {
|
|
747
751
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
748
752
|
animateDragToTarget(dragElement, dropElement, container);
|
|
753
|
+
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
754
|
+
console.log("onincorrectttt", onInCorrect);
|
|
755
|
+
await executeActions(onInCorrect, dropElement, dragElement);
|
|
749
756
|
setTimeout(() => {
|
|
750
757
|
dragElement.style.transform = 'translate(0, 0)';
|
|
751
758
|
// const oldDropIndex = dragToDropMap[dragElement.getAttribute('data-id')];
|
|
@@ -845,7 +852,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
845
852
|
}
|
|
846
853
|
if (!(((_f = dropElement.getAttribute('dropAttr')) === null || _f === void 0 ? void 0 : _f.toLowerCase()) === DropMode.Diagonal) && (dropElement.getAttribute('minDrops') === '1' || !dropElement.getAttribute('minDrops'))) {
|
|
847
854
|
const isisFull = Object.values(dropHasDrag).find(item => document.getElementById(item.drop) === dropElement);
|
|
848
|
-
|
|
855
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
|
|
856
|
+
if (isAllowOnlyOneDrop && isisFull) {
|
|
849
857
|
isisFull.isFull = true;
|
|
850
858
|
dropElement.setAttribute('is-full', 'true');
|
|
851
859
|
}
|
|
@@ -880,8 +888,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
880
888
|
// Check for overlaps and highlight only the most overlapping element
|
|
881
889
|
if (dropElement && !((_g = dropHasDrag[dropTabIndex]) === null || _g === void 0 ? void 0 : _g.isFull)) {
|
|
882
890
|
let mostOverlappedElement = findMostoverlappedElement$1(dragElement, 'drag');
|
|
883
|
-
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true'
|
|
884
|
-
if (
|
|
891
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
|
|
892
|
+
if (isAllowOnlyOneDrop && mostOverlappedElement) {
|
|
885
893
|
dragElement.style.transform = 'translate(0,0)';
|
|
886
894
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
887
895
|
const allElements = document.querySelectorAll("[type='drop']");
|
|
@@ -1014,14 +1022,14 @@ async function onClickDropOrDragElement(element, type) {
|
|
|
1014
1022
|
if (!document.querySelector('#dynamic-highlight-style')) {
|
|
1015
1023
|
const style = document.createElement('style');
|
|
1016
1024
|
style.id = 'dynamic-highlight-style';
|
|
1017
|
-
style.innerHTML = `
|
|
1018
|
-
.highlight {
|
|
1019
|
-
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
1020
|
-
// border-radius: 12px; /* Larger rounded corners */
|
|
1021
|
-
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
1022
|
-
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
1023
|
-
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
1024
|
-
}
|
|
1025
|
+
style.innerHTML = `
|
|
1026
|
+
.highlight {
|
|
1027
|
+
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
1028
|
+
// border-radius: 12px; /* Larger rounded corners */
|
|
1029
|
+
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
1030
|
+
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
1031
|
+
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
1032
|
+
}
|
|
1025
1033
|
`;
|
|
1026
1034
|
document.head.appendChild(style);
|
|
1027
1035
|
}
|
|
@@ -1063,7 +1071,11 @@ async function onClickDropOrDragElement(element, type) {
|
|
|
1063
1071
|
}
|
|
1064
1072
|
const dragToDropMap = new Map();
|
|
1065
1073
|
async function onClickDragElement(element) {
|
|
1066
|
-
|
|
1074
|
+
const audioAttr = element.getAttribute('audio');
|
|
1075
|
+
const hasValidAudio = audioAttr && audioAttr.trim().length > 0;
|
|
1076
|
+
if (hasValidAudio) {
|
|
1077
|
+
AudioPlayer.getI().stop();
|
|
1078
|
+
}
|
|
1067
1079
|
const dropElements = buildDropHasDragFromDOM();
|
|
1068
1080
|
const dragEl = element;
|
|
1069
1081
|
if (!dragEl) {
|
|
@@ -1138,6 +1150,7 @@ class AudioPlayer {
|
|
|
1138
1150
|
this.audioElement = document.createElement('audio');
|
|
1139
1151
|
this.audioElement.id = 'audio';
|
|
1140
1152
|
document.body.appendChild(this.audioElement);
|
|
1153
|
+
this.registerGlobalStopEvents();
|
|
1141
1154
|
}
|
|
1142
1155
|
static getI() {
|
|
1143
1156
|
if (!AudioPlayer.instance) {
|
|
@@ -1163,13 +1176,23 @@ class AudioPlayer {
|
|
|
1163
1176
|
}
|
|
1164
1177
|
}
|
|
1165
1178
|
async play(targetElement) {
|
|
1179
|
+
// Stop any currently playing audio first if target element has audio given
|
|
1180
|
+
try {
|
|
1181
|
+
await AudioPlayer.getI().stop();
|
|
1182
|
+
}
|
|
1183
|
+
catch (e) {
|
|
1184
|
+
console.error('Error stopping audio before speak action:', e);
|
|
1185
|
+
}
|
|
1186
|
+
// then play the target element audio.
|
|
1166
1187
|
let audioUrl = targetElement.getAttribute('audio') || '';
|
|
1188
|
+
// If no direct audio attribute, check childrens for audio
|
|
1167
1189
|
if (!audioUrl) {
|
|
1168
1190
|
const childElements = targetElement.children;
|
|
1169
1191
|
for (let i = 0; i < childElements.length; i++) {
|
|
1170
1192
|
const childAudioUrl = childElements[i].getAttribute('audio');
|
|
1171
1193
|
if (childAudioUrl) {
|
|
1172
1194
|
audioUrl = childAudioUrl;
|
|
1195
|
+
break;
|
|
1173
1196
|
}
|
|
1174
1197
|
}
|
|
1175
1198
|
}
|
|
@@ -1179,18 +1202,21 @@ class AudioPlayer {
|
|
|
1179
1202
|
console.log('🚀 Playing audio:', this.audioElement.src);
|
|
1180
1203
|
try {
|
|
1181
1204
|
setDraggingDisabled(true);
|
|
1182
|
-
await this.audioElement.play();
|
|
1183
1205
|
highlightSpeakingElement(targetElement);
|
|
1206
|
+
await this.audioElement.play();
|
|
1184
1207
|
await new Promise(resolve => {
|
|
1185
1208
|
this.audioElement.onended = () => {
|
|
1186
|
-
stopHighlightForSpeakingElement(targetElement);
|
|
1187
1209
|
resolve();
|
|
1188
|
-
setDraggingDisabled(false);
|
|
1189
1210
|
};
|
|
1190
1211
|
});
|
|
1191
1212
|
}
|
|
1192
1213
|
catch (error) {
|
|
1193
|
-
console.log('
|
|
1214
|
+
console.log('🎧 Audio play error:', error);
|
|
1215
|
+
}
|
|
1216
|
+
finally {
|
|
1217
|
+
this.audioElement.onended = null; // cleanup
|
|
1218
|
+
setDraggingDisabled(false);
|
|
1219
|
+
stopHighlightForSpeakingElement(targetElement);
|
|
1194
1220
|
}
|
|
1195
1221
|
}
|
|
1196
1222
|
// If no audio, use text-to-speech
|
|
@@ -1200,13 +1226,35 @@ class AudioPlayer {
|
|
|
1200
1226
|
await speakText(targetElement.textContent, targetElement);
|
|
1201
1227
|
const highlightedElements = document.querySelectorAll('.speaking-highlight');
|
|
1202
1228
|
highlightedElements.forEach(element => stopHighlightForSpeakingElement(element));
|
|
1203
|
-
setDraggingDisabled(false);
|
|
1204
1229
|
}
|
|
1205
1230
|
catch (error) {
|
|
1206
|
-
console.log('
|
|
1231
|
+
console.log('🎧 TTS Error:', error);
|
|
1232
|
+
}
|
|
1233
|
+
finally {
|
|
1234
|
+
setDraggingDisabled(false);
|
|
1207
1235
|
}
|
|
1208
1236
|
}
|
|
1209
1237
|
}
|
|
1238
|
+
// GLOBAL STOP EVENTS (container change, activity change…)
|
|
1239
|
+
registerGlobalStopEvents() {
|
|
1240
|
+
const stopEvents = [
|
|
1241
|
+
NextContainerKey, PrevContainerKey, LessonEndKey, ActivityChangeKey,
|
|
1242
|
+
ActivityEndKey, GameCompletedKey, GameExitKey
|
|
1243
|
+
];
|
|
1244
|
+
stopEvents.forEach(key => {
|
|
1245
|
+
window.addEventListener(key, () => this.stop());
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
// DESTROY (for hot-reload)
|
|
1249
|
+
destroy() {
|
|
1250
|
+
console.log("AudioPlayer destroyed (hot-reload safe)");
|
|
1251
|
+
this.stop();
|
|
1252
|
+
// Remove DOM element
|
|
1253
|
+
if (this.audioElement.parentNode) {
|
|
1254
|
+
this.audioElement.parentNode.removeChild(this.audioElement);
|
|
1255
|
+
}
|
|
1256
|
+
AudioPlayer.instance = undefined;
|
|
1257
|
+
}
|
|
1210
1258
|
}
|
|
1211
1259
|
|
|
1212
1260
|
let preOverlap;
|
|
@@ -1365,11 +1413,11 @@ function enableReorderDrag(element) {
|
|
|
1365
1413
|
onDropToCategory(element, category);
|
|
1366
1414
|
}
|
|
1367
1415
|
if (divEl) {
|
|
1368
|
-
const keyframes = `
|
|
1369
|
-
@keyframes widthDecrease {
|
|
1370
|
-
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
1371
|
-
100% { width: 0px; height: 0px;}
|
|
1372
|
-
}
|
|
1416
|
+
const keyframes = `
|
|
1417
|
+
@keyframes widthDecrease {
|
|
1418
|
+
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
1419
|
+
100% { width: 0px; height: 0px;}
|
|
1420
|
+
}
|
|
1373
1421
|
`;
|
|
1374
1422
|
const styleSheet = document.styleSheets[0];
|
|
1375
1423
|
styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
|
|
@@ -1579,11 +1627,11 @@ function moveWithAnimation(target, overlapped) {
|
|
|
1579
1627
|
const dummy = createDummyElement(target);
|
|
1580
1628
|
dummy.style.visibility = 'hidden';
|
|
1581
1629
|
dummy.setAttribute('type', 'dummy');
|
|
1582
|
-
const keyframes = `
|
|
1583
|
-
@keyframes widthIncrease {
|
|
1584
|
-
0% { width: 0px; height: 0px; }
|
|
1585
|
-
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
1586
|
-
}
|
|
1630
|
+
const keyframes = `
|
|
1631
|
+
@keyframes widthIncrease {
|
|
1632
|
+
0% { width: 0px; height: 0px; }
|
|
1633
|
+
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
1634
|
+
}
|
|
1587
1635
|
`;
|
|
1588
1636
|
if (!overlapped) {
|
|
1589
1637
|
const overlapCategory = findMostoverlappedElement(target, 'category');
|
|
@@ -3140,7 +3188,11 @@ function addClickListenerForClickType(element) {
|
|
|
3140
3188
|
if (lido_buttons === 'lido-arrow-left' || lido_buttons === 'lido-arrow-right') {
|
|
3141
3189
|
return;
|
|
3142
3190
|
}
|
|
3143
|
-
|
|
3191
|
+
const audioAttr = element.getAttribute('audio');
|
|
3192
|
+
const hasValidAudio = audioAttr && audioAttr.trim().length > 0;
|
|
3193
|
+
if (hasValidAudio) {
|
|
3194
|
+
AudioPlayer.getI().stop();
|
|
3195
|
+
}
|
|
3144
3196
|
const container = document.getElementById(LidoContainer);
|
|
3145
3197
|
const objective = container['objective'].split(',');
|
|
3146
3198
|
const checkButton = document.querySelector('#lido-checkButton');
|
|
@@ -68053,15 +68105,15 @@ function calculateFill(input, currentFill = 0) {
|
|
|
68053
68105
|
// Helper to animate and remove the active equation cell
|
|
68054
68106
|
const animationToRemoveEquationSolvedCellForNimbleTable = (activeCell, allCalculateTypes) => {
|
|
68055
68107
|
return new Promise((resolve) => {
|
|
68056
|
-
const keyframes = `
|
|
68057
|
-
@keyframes widthDecrease {
|
|
68058
|
-
0% {
|
|
68059
|
-
background-color: ${activeCell.style.backgroundColor};
|
|
68060
|
-
height: ${activeCell.style.height};
|
|
68061
|
-
margin: ${activeCell.style.margin};
|
|
68062
|
-
${activeCell.innerHTML = ""}
|
|
68063
|
-
}
|
|
68064
|
-
100% { background-color: transparent; height: 0px; margin: 0px; }
|
|
68108
|
+
const keyframes = `
|
|
68109
|
+
@keyframes widthDecrease {
|
|
68110
|
+
0% {
|
|
68111
|
+
background-color: ${activeCell.style.backgroundColor};
|
|
68112
|
+
height: ${activeCell.style.height};
|
|
68113
|
+
margin: ${activeCell.style.margin};
|
|
68114
|
+
${activeCell.innerHTML = ""}
|
|
68115
|
+
}
|
|
68116
|
+
100% { background-color: transparent; height: 0px; margin: 0px; }
|
|
68065
68117
|
}`;
|
|
68066
68118
|
const styleSheet = document.styleSheets[0];
|
|
68067
68119
|
styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
|
|
@@ -68594,7 +68646,15 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
68594
68646
|
break;
|
|
68595
68647
|
}
|
|
68596
68648
|
case 'speak': {
|
|
68597
|
-
|
|
68649
|
+
const val = (action.value || '').toString().trim().toLowerCase();
|
|
68650
|
+
if (val === 'true' || val === '1' || val === 'yes') {
|
|
68651
|
+
try {
|
|
68652
|
+
await AudioPlayer.getI().play(targetElement);
|
|
68653
|
+
}
|
|
68654
|
+
catch (err) {
|
|
68655
|
+
console.error('Error playing audio for speak action:', err);
|
|
68656
|
+
}
|
|
68657
|
+
}
|
|
68598
68658
|
break;
|
|
68599
68659
|
}
|
|
68600
68660
|
case 'fill-slide': {
|
|
@@ -68716,6 +68776,53 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
68716
68776
|
}
|
|
68717
68777
|
break;
|
|
68718
68778
|
}
|
|
68779
|
+
case 'disableType': {
|
|
68780
|
+
const dragEle = document.querySelector('[type="drag"]');
|
|
68781
|
+
dragEle.removeAttribute('type');
|
|
68782
|
+
dragEle.style.pointerEvents = 'none';
|
|
68783
|
+
break;
|
|
68784
|
+
}
|
|
68785
|
+
case 'updateCountBlender': {
|
|
68786
|
+
const allDrags = document.querySelectorAll('[type="drag"]');
|
|
68787
|
+
let units = 0;
|
|
68788
|
+
let tens = 0;
|
|
68789
|
+
let hundreds = 0;
|
|
68790
|
+
allDrags.forEach(el => {
|
|
68791
|
+
const dropTo = el.getAttribute("drop-to");
|
|
68792
|
+
if (dropTo === "unitsDrop")
|
|
68793
|
+
units++;
|
|
68794
|
+
if (dropTo === "tensDrop")
|
|
68795
|
+
tens++;
|
|
68796
|
+
if (dropTo === "hundredsDrop")
|
|
68797
|
+
hundreds++;
|
|
68798
|
+
});
|
|
68799
|
+
const unitsValue = units * 1;
|
|
68800
|
+
const tensValue = tens * 10;
|
|
68801
|
+
const hundredsValue = hundreds * 100;
|
|
68802
|
+
const totalValue = unitsValue + tensValue + hundredsValue;
|
|
68803
|
+
// ✅ Update Lido Text Boxes
|
|
68804
|
+
const unitsBox = document.getElementById("units");
|
|
68805
|
+
const tensBox = document.getElementById("tens");
|
|
68806
|
+
const hundredsBox = document.getElementById("hundreds");
|
|
68807
|
+
if (unitsBox) {
|
|
68808
|
+
unitsBox.setAttribute("string", unitsValue.toString());
|
|
68809
|
+
}
|
|
68810
|
+
if (tensBox) {
|
|
68811
|
+
tensBox.setAttribute("string", tensValue.toString());
|
|
68812
|
+
}
|
|
68813
|
+
if (hundredsBox) {
|
|
68814
|
+
hundredsBox.setAttribute("string", hundredsValue.toString());
|
|
68815
|
+
}
|
|
68816
|
+
console.log(`Units = ${units} → ${unitsValue}`);
|
|
68817
|
+
console.log(`Tens = ${tens} → ${tensValue}`);
|
|
68818
|
+
console.log(`Hundreds = ${hundreds} → ${hundredsValue}`);
|
|
68819
|
+
console.log(`✅ Total Value = ${totalValue}`);
|
|
68820
|
+
break;
|
|
68821
|
+
}
|
|
68822
|
+
case 'updateCalculatorAnswer': {
|
|
68823
|
+
updateCalculatorAnswer();
|
|
68824
|
+
break;
|
|
68825
|
+
}
|
|
68719
68826
|
default: {
|
|
68720
68827
|
targetElement.style[action.action] = action.value;
|
|
68721
68828
|
break;
|
|
@@ -68732,6 +68839,7 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
68732
68839
|
const isInfinite = container.getAttribute('drop-action') === DropAction.InfiniteDrop;
|
|
68733
68840
|
if (isAppend || isInfinite) {
|
|
68734
68841
|
setTimeout(() => {
|
|
68842
|
+
var _a, _b;
|
|
68735
68843
|
dragElement.style.transform = 'translate(0,0)';
|
|
68736
68844
|
dragElement.style.transition = '';
|
|
68737
68845
|
let dummyElement = document.createElement('div');
|
|
@@ -68746,11 +68854,11 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
68746
68854
|
}
|
|
68747
68855
|
dummyElement.setAttribute('id', dragElement.getAttribute('id'));
|
|
68748
68856
|
dragElement.replaceWith(dummyElement);
|
|
68749
|
-
const keyframes = `
|
|
68750
|
-
@keyframes widthDecrease {
|
|
68751
|
-
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
68752
|
-
100% { width: 0px; height: 0px; margin: 0px;}
|
|
68753
|
-
}
|
|
68857
|
+
const keyframes = `
|
|
68858
|
+
@keyframes widthDecrease {
|
|
68859
|
+
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
68860
|
+
100% { width: 0px; height: 0px; margin: 0px;}
|
|
68861
|
+
}
|
|
68754
68862
|
`;
|
|
68755
68863
|
if (!isInfinite) {
|
|
68756
68864
|
dummyElement.style.width = element.style.width;
|
|
@@ -68765,6 +68873,14 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
68765
68873
|
dummyElement.style.margin = '0px';
|
|
68766
68874
|
});
|
|
68767
68875
|
}
|
|
68876
|
+
const orientation = window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
|
|
68877
|
+
const rowAttr = dropElement.getAttribute('dropAttr');
|
|
68878
|
+
const dropAttr = parseProp(rowAttr, orientation); // will return stackcascade or verticalstack
|
|
68879
|
+
if (((_a = (dropAttr)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "stackcascade" || ((_b = (dropAttr)) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === "verticalstack") {
|
|
68880
|
+
dropElement.append(dragElement);
|
|
68881
|
+
placeElementInDropZone(dropElement, dragElement, orientation, dropAttr);
|
|
68882
|
+
return;
|
|
68883
|
+
}
|
|
68768
68884
|
dropElement.parentElement.append(element);
|
|
68769
68885
|
dragElement.style.position = 'absolute';
|
|
68770
68886
|
dragElement.style.zIndex = '1';
|
|
@@ -68777,16 +68893,41 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
68777
68893
|
const scaledLeft = (dropCenterX - dragCenterX) / containerScale;
|
|
68778
68894
|
const scaledTop = (dropCenterY - dragCenterY) / containerScale;
|
|
68779
68895
|
dragElement.style.transform = `translate(${scaledLeft}px, ${scaledTop}px)`;
|
|
68780
|
-
},
|
|
68896
|
+
}, 100);
|
|
68781
68897
|
}
|
|
68782
68898
|
};
|
|
68899
|
+
// function cloneElementWithComputedStyles(originalEl: HTMLElement): HTMLElement {
|
|
68900
|
+
// let clone = document.createElement('div') as HTMLElement;
|
|
68901
|
+
// clone.innerHTML = originalEl.outerHTML;
|
|
68902
|
+
// clone = clone.firstChild as HTMLElement;
|
|
68903
|
+
// clone.setAttribute('height', originalEl.style.height);
|
|
68904
|
+
// clone.setAttribute('width', originalEl.style.width);
|
|
68905
|
+
// clone.setAttribute('visible', 'true');
|
|
68906
|
+
// return clone;
|
|
68907
|
+
// }
|
|
68783
68908
|
function cloneElementWithComputedStyles(originalEl) {
|
|
68784
|
-
|
|
68785
|
-
|
|
68786
|
-
|
|
68787
|
-
|
|
68788
|
-
|
|
68789
|
-
|
|
68909
|
+
const tag = originalEl.tagName.toLowerCase();
|
|
68910
|
+
if (tag === "lido-text") {
|
|
68911
|
+
let clone = document.createElement('div');
|
|
68912
|
+
clone.innerHTML = originalEl.outerHTML;
|
|
68913
|
+
clone = clone.firstChild;
|
|
68914
|
+
clone.setAttribute('height', originalEl.style.height);
|
|
68915
|
+
clone.setAttribute('width', originalEl.style.width);
|
|
68916
|
+
clone.setAttribute('visible', 'true');
|
|
68917
|
+
return clone;
|
|
68918
|
+
}
|
|
68919
|
+
// ✅ For ALL other types (INCLUDING lido-image & matrix) use your simple logic
|
|
68920
|
+
const clone = originalEl.cloneNode(false);
|
|
68921
|
+
clone.style.width = originalEl.style.width;
|
|
68922
|
+
clone.style.height = originalEl.style.height;
|
|
68923
|
+
clone.style.margin = originalEl.style.margin;
|
|
68924
|
+
clone.style.opacity = originalEl.style.opacity;
|
|
68925
|
+
clone.style.transform = originalEl.style.transform;
|
|
68926
|
+
clone.setAttribute("visible", "true");
|
|
68927
|
+
clone.setAttribute("data-dummy", "true");
|
|
68928
|
+
if (tag === "lido-math-matrix") {
|
|
68929
|
+
clone.setAttribute('clickable', "false");
|
|
68930
|
+
}
|
|
68790
68931
|
return clone;
|
|
68791
68932
|
}
|
|
68792
68933
|
// Function to parse actions string
|
|
@@ -68913,10 +69054,6 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
68913
69054
|
await executeActions(onCorrect, dropElement, dragElement);
|
|
68914
69055
|
}
|
|
68915
69056
|
}
|
|
68916
|
-
else {
|
|
68917
|
-
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
68918
|
-
await executeActions(onInCorrect, dropElement, dragElement);
|
|
68919
|
-
}
|
|
68920
69057
|
}
|
|
68921
69058
|
let dragScore = buildDragSelectedMapFromDOM();
|
|
68922
69059
|
const sortedValues = getSortedValuesArrayFromMap(dragScore);
|
|
@@ -68928,21 +69065,6 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
68928
69065
|
drag[index] = [];
|
|
68929
69066
|
}
|
|
68930
69067
|
drag[index].push(dragElement.id);
|
|
68931
|
-
// localStorage.setItem(DragMapKey, JSON.stringify(drag));
|
|
68932
|
-
Object.keys(dragScore).sort((a, b) => parseInt(a) - parseInt(b));
|
|
68933
|
-
if (dragElement && dropElement) {
|
|
68934
|
-
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
68935
|
-
if (isCorrect) {
|
|
68936
|
-
const onCorrect = dropElement.getAttribute('onCorrect');
|
|
68937
|
-
if (onCorrect) {
|
|
68938
|
-
await executeActions(onCorrect, dropElement, dragElement);
|
|
68939
|
-
}
|
|
68940
|
-
}
|
|
68941
|
-
else {
|
|
68942
|
-
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
68943
|
-
await executeActions(onInCorrect, dropElement, dragElement);
|
|
68944
|
-
}
|
|
68945
|
-
}
|
|
68946
69068
|
const allElements = document.querySelectorAll("[type='drop']");
|
|
68947
69069
|
allElements.forEach(otherElement => {
|
|
68948
69070
|
var _a;
|
|
@@ -69032,6 +69154,7 @@ const validateObjectiveStatus = async () => {
|
|
|
69032
69154
|
return;
|
|
69033
69155
|
const objectiveString = container['objective'];
|
|
69034
69156
|
const additionalCheck = container.getAttribute('equationCheck');
|
|
69157
|
+
container.getAttribute('isAllowOnlyCorrect') === 'true' || '';
|
|
69035
69158
|
console.log('🚀 ~ validateObjectiveStatus ~ additionalCheck:', additionalCheck);
|
|
69036
69159
|
let equationGiven = false;
|
|
69037
69160
|
if (objectiveString == null || objectiveString.length === 0) {
|
|
@@ -69083,13 +69206,15 @@ const validateObjectiveStatus = async () => {
|
|
|
69083
69206
|
await calculateScore();
|
|
69084
69207
|
}
|
|
69085
69208
|
else {
|
|
69086
|
-
const onInCorrect = container.getAttribute('onInCorrect');
|
|
69087
|
-
await executeActions(onInCorrect, container);
|
|
69088
69209
|
const isContinueOnCorrect = container.getAttribute('is-continue-on-correct') === 'true';
|
|
69089
69210
|
if (!isContinueOnCorrect) {
|
|
69090
69211
|
triggerNextContainer();
|
|
69091
69212
|
await calculateScore();
|
|
69092
69213
|
}
|
|
69214
|
+
else {
|
|
69215
|
+
const onInCorrect = container.getAttribute('onInCorrect');
|
|
69216
|
+
await executeActions(onInCorrect, container);
|
|
69217
|
+
}
|
|
69093
69218
|
}
|
|
69094
69219
|
};
|
|
69095
69220
|
const triggerNextContainer = () => {
|
|
@@ -69653,14 +69778,14 @@ const SumTogetherAnimation = async (element, value) => {
|
|
|
69653
69778
|
const sign = ((signElement && ((signElement.getAttribute('string') || signElement.textContent) || '')).toString().trim() === '+') ? '+' : '-';
|
|
69654
69779
|
if (sign === '-') {
|
|
69655
69780
|
// '-' flow: reveal one by one then change bgColor of last B to red
|
|
69656
|
-
for (let i = 0; i < topRowChildren.length; i++) {
|
|
69781
|
+
for (let i = 0; i < Math.min(number1, topRowChildren.length); i++) {
|
|
69657
69782
|
await new Promise(resolve => setTimeout(resolve, 75));
|
|
69658
69783
|
showElement(topRowChildren[i]);
|
|
69659
69784
|
}
|
|
69660
69785
|
elementAppearance(true);
|
|
69661
69786
|
await new Promise(r => setTimeout(r, 500));
|
|
69662
69787
|
for (let k = 0; k < Math.min(number2, topRowChildren.length); k++) {
|
|
69663
|
-
const idx = topRowChildren.length - 1 - k;
|
|
69788
|
+
const idx = Math.min(number1, topRowChildren.length) - 1 - k;
|
|
69664
69789
|
setImageBackground(topRowChildren[idx], 'red');
|
|
69665
69790
|
await new Promise(r => setTimeout(r, 200));
|
|
69666
69791
|
}
|
|
@@ -69685,5 +69810,66 @@ const SumTogetherAnimation = async (element, value) => {
|
|
|
69685
69810
|
elementAppearance(false);
|
|
69686
69811
|
}
|
|
69687
69812
|
};
|
|
69813
|
+
function placeElementInDropZone(dropElement, dragElement, orientation, dropAttr) {
|
|
69814
|
+
const dropRect = dropElement.getBoundingClientRect();
|
|
69815
|
+
const dragRect = dragElement.getBoundingClientRect();
|
|
69816
|
+
const scale = typeof calculateScale === "function" ? calculateScale() : 1;
|
|
69817
|
+
if (!dropElement.dataset.dropCount)
|
|
69818
|
+
dropElement.dataset.dropCount = "0";
|
|
69819
|
+
let dropCount = parseInt(dropElement.dataset.dropCount, 10);
|
|
69820
|
+
// === READ DROP ZONE SIZE ===
|
|
69821
|
+
const dropWidth = dropRect.width;
|
|
69822
|
+
const dropHeight = dropRect.height;
|
|
69823
|
+
let targetX, targetY;
|
|
69824
|
+
// ---------------- LANDSCAPE WATERFALL ----------------
|
|
69825
|
+
if (orientation === "landscape" && dropAttr.toLowerCase() === "stackcascade") {
|
|
69826
|
+
console.log("🌄 Landscape waterfall");
|
|
69827
|
+
const shiftX = dropWidth * 0.02; // proportional (5% of width)
|
|
69828
|
+
const shiftY = dropHeight * 0.02; // proportional (5% of height)
|
|
69829
|
+
const startX = dropRect.left + dropWidth * 0.36; // 10% inside
|
|
69830
|
+
const startY = dropRect.top + dropHeight * -0.09; // slightly above
|
|
69831
|
+
targetX = startX + (dropCount * shiftX);
|
|
69832
|
+
targetY = startY + (dropCount * shiftY);
|
|
69833
|
+
}
|
|
69834
|
+
// ---------------- PORTRAIT VERTICAL ----------------
|
|
69835
|
+
else {
|
|
69836
|
+
console.log("📱 Portrait vertical stack");
|
|
69837
|
+
let startX;
|
|
69838
|
+
const stepY = dropHeight * 0.05; // 8% vertical step
|
|
69839
|
+
if (dropElement.id === "unitsDrop") {
|
|
69840
|
+
startX = dropRect.left + dropWidth * 0.4; // special spacing
|
|
69841
|
+
}
|
|
69842
|
+
else if (dropElement.id === "tensDrop") {
|
|
69843
|
+
startX = dropRect.left + dropWidth * 0.25;
|
|
69844
|
+
}
|
|
69845
|
+
else {
|
|
69846
|
+
startX = dropRect.left + dropWidth * 0.16; // normal spacing
|
|
69847
|
+
}
|
|
69848
|
+
const startY = dropRect.top - dropHeight * 0.25; // above start
|
|
69849
|
+
targetX = startX;
|
|
69850
|
+
targetY = startY + (dropCount * stepY);
|
|
69851
|
+
}
|
|
69852
|
+
// ------------ APPLY TRANSFORM SMOOTHLY --------------
|
|
69853
|
+
const dx = (targetX - dragRect.left) / scale;
|
|
69854
|
+
const dy = (targetY - dragRect.top) / scale;
|
|
69855
|
+
dragElement.style.transition = "transform .2s ease-out";
|
|
69856
|
+
dragElement.style.transform = `translate(${dx}px, ${dy}px)`;
|
|
69857
|
+
dropElement.dataset.dropCount = String(dropCount + 1);
|
|
69858
|
+
// reset size
|
|
69859
|
+
dragElement.style.width = "auto";
|
|
69860
|
+
dragElement.style.height = "auto";
|
|
69861
|
+
}
|
|
69862
|
+
const updateCalculatorAnswer = () => {
|
|
69863
|
+
const container = document.getElementById(LidoContainer);
|
|
69864
|
+
if (!container)
|
|
69865
|
+
return;
|
|
69866
|
+
const calci = document.querySelector('#lidoCalculator');
|
|
69867
|
+
if (!calci)
|
|
69868
|
+
return;
|
|
69869
|
+
const answerText = container.querySelector('#answer');
|
|
69870
|
+
const value = calci.getAttribute('value');
|
|
69871
|
+
console.log("😀😀😀😀😀😀😀", value);
|
|
69872
|
+
answerText.setAttribute('string', value);
|
|
69873
|
+
};
|
|
69688
69874
|
|
|
69689
69875
|
export { ActivityScoreKey as A, getDefaultExportFromCjs as B, tinyColor as C, triggerNextContainer as D, DropAction as E, validateObjectiveStatus as F, fraction as G, speakIcon as H, fingerUrl as I, LidoContainer as L, NextContainerKey as N, PrevContainerKey as P, RiveService as R, SelectedValuesKey as S, TraceMode as T, convertUrlToRelative as a, storingEachActivityScore as b, commonjsGlobal as c, executeActions as d, equationCheck as e, format as f, attachSpeakIcon as g, handlingChildElements as h, initEventsForElement as i, calculateScale as j, handleFloatElementPosition as k, handleElementClick as l, dispatchActivityChangeEvent as m, dispatchGameCompletedEvent as n, dispatchGameExitEvent as o, parseProp as p, AudioPlayer as q, generateUUIDFallback as r, setVisibilityWithDelay as s, exitUrl as t, prevUrl as u, nextUrl as v, speakUrl as w, getCancelBtnPopup as x, triggerPrevcontainer as y, setCancelBtnPopup as z };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{f as format}from"./p-
|
|
1
|
+
export{f as format}from"./p-d1251482.js";import"./p-9a9d5339.js";
|