lido-player 0.0.2-alpha-51-dev → 0.0.2-alpha-53-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/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lido-avatar_22.cjs.entry.js +199 -73
- package/dist/cjs/lido-player.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-dc02d753.js → utils-3c1ce74e.js} +236 -101
- package/dist/collection/components/avatar/lido-avatar.js +1 -1
- package/dist/collection/components/canvas/lido-canvas.css +5 -8
- package/dist/collection/components/canvas/lido-canvas.js +2 -2
- package/dist/collection/components/cell/lido-cell.js +1 -1
- package/dist/collection/components/column/lido-col.js +1 -1
- package/dist/collection/components/container/lido-container.js +24 -2
- package/dist/collection/components/flashCard/lido-flash-card.js +1 -1
- package/dist/collection/components/home/lido-home.css +4 -0
- package/dist/collection/components/home/lido-home.js +27 -3
- package/dist/collection/components/mathMatrix/lido-math-matrix.js +14 -14
- package/dist/collection/components/position/lido-pos.js +1 -1
- package/dist/collection/components/random/lido-random.js +1 -1
- package/dist/collection/components/row/lido-row.js +1 -1
- package/dist/collection/components/shape/lido-shape.js +1 -1
- package/dist/collection/components/trace/lido-trace.js +122 -47
- package/dist/collection/components/wrap/lido-wrap.js +1 -1
- package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +26 -25
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +3 -1
- package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +1 -1
- package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +1 -1
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +1 -1
- package/dist/collection/stories/Templates/blender/blender.stories.js +100 -0
- package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +1 -1
- package/dist/collection/stories/Templates/calculator/calculator.stories.js +6 -2
- package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +1 -1
- package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +1 -1
- package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +1 -1
- package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +3 -2
- package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +1 -1
- package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +3 -1
- package/dist/collection/stories/Templates/grid/grid.stories.js +5 -1
- package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +1 -1
- package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +4 -2
- package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +1 -1
- package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +3 -1
- package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +4 -2
- package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +1 -1
- package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +1 -1
- package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +1 -1
- package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +1 -1
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +6 -4
- package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +1 -1
- package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +2 -2
- package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +2 -2
- package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +14 -13
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +14 -13
- package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +1 -1
- package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +5 -1
- package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +1 -1
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +1 -1
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +1 -1
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +1 -1
- package/dist/collection/stories/Templates/reorder/reorder.stories.js +3 -1
- package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +2 -2
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +6 -6
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +7 -6
- package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +1 -1
- package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +25 -21
- package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +1 -1
- package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +8 -6
- package/dist/collection/stories/Templates/total/total.stories.js +1 -1
- package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +1 -1
- package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +2 -2
- package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +6 -6
- package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +1 -1
- package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +7 -6
- package/dist/collection/utils/utils.js +155 -27
- package/dist/collection/utils/utilsHandlers/animationHandler.js +38 -0
- package/dist/collection/utils/utilsHandlers/clickHandler.js +5 -1
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +29 -64
- package/dist/collection/utils/utilsHandlers/slideHandler.js +7 -6
- package/dist/collection/utils/utilsHandlers/sortHandler.js +3 -5
- 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 +2 -2
- 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 +23 -23
- 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-56c8f3da.js → p-004adc43.js} +3 -3
- package/dist/components/{p-c8815e84.js → p-057fb7b8.js} +48 -24
- package/dist/components/{p-bb907e43.js → p-0733b277.js} +2 -2
- package/dist/components/{p-6ba0f1af.js → p-09b3b152.js} +1 -1
- package/dist/components/{p-74b90a9c.js → p-23549651.js} +8 -8
- package/dist/components/{p-d7693f47.js → p-3e8ae1c5.js} +123 -48
- package/dist/components/{p-6be6c5eb.js → p-3f0e4436.js} +2 -2
- package/dist/components/{p-d0131159.js → p-511377d2.js} +236 -102
- package/dist/components/{p-a8724f06.js → p-561908ec.js} +2 -2
- package/dist/components/{p-1c84cf65.js → p-567983a9.js} +13 -7
- package/dist/components/{p-b89371ac.js → p-6beee44b.js} +1 -1
- package/dist/components/{p-1f3c2783.js → p-71ded596.js} +2 -2
- package/dist/components/{p-0fbeb3a1.js → p-73e3f0f4.js} +12 -6
- package/dist/components/{p-b7efadad.js → p-875c1411.js} +2 -2
- package/dist/components/{p-4fd6b588.js → p-8774f517.js} +2 -2
- package/dist/components/{p-04e904b5.js → p-90f7dd48.js} +1 -1
- package/dist/components/{p-caa05d1e.js → p-92b9ae9e.js} +2 -2
- package/dist/components/{p-e9548986.js → p-9ea1a67d.js} +26 -4
- package/dist/components/{p-bef96764.js → p-b3e67e7f.js} +2 -2
- package/dist/components/{p-988477ad.js → p-cca545f9.js} +2 -2
- package/dist/components/{p-d3f7d561.js → p-d2fe2bb6.js} +2 -2
- package/dist/components/{p-12432f23.js → p-d568d595.js} +1 -1
- package/dist/components/{p-62d2a5b3.js → p-df1af62c.js} +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/lido-avatar_22.entry.js +199 -73
- package/dist/esm/lido-player.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-b5eb2360.js → utils-eefe4a1c.js} +236 -102
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-4d9ad047.entry.js +1 -0
- package/dist/lido-player/{p-9fd87d44.js → p-589fc3b8.js} +2 -2
- package/dist/types/components/canvas/lido-canvas.d.ts +1 -1
- package/dist/types/components/container/lido-container.d.ts +1 -0
- package/dist/types/components/home/lido-home.d.ts +1 -0
- package/dist/types/components/mathMatrix/lido-math-matrix.d.ts +0 -1
- package/dist/types/components/trace/lido-trace.d.ts +1 -0
- package/dist/types/components.d.ts +0 -6
- package/dist/types/stories/Templates/blender/blender.stories.d.ts +4 -0
- package/dist/types/utils/utils.d.ts +1 -1
- package/dist/types/utils/utilsHandlers/animationHandler.d.ts +1 -0
- package/package.json +1 -1
- package/dist/lido-player/p-e1a9c26f.entry.js +0 -1
|
@@ -1665,6 +1665,45 @@ function balanceResult(container, objectiveString) {
|
|
|
1665
1665
|
return res;
|
|
1666
1666
|
}
|
|
1667
1667
|
|
|
1668
|
+
function dragDropAnimation(container, dragElement, dropElement) {
|
|
1669
|
+
container.style.pointerEvents = 'none';
|
|
1670
|
+
setTimeout(() => {
|
|
1671
|
+
const div = document.createElement('div');
|
|
1672
|
+
container.append(div);
|
|
1673
|
+
div.classList.add('after-drop-popup-container');
|
|
1674
|
+
dragElement.style.scale = `1`;
|
|
1675
|
+
dropElement.style.scale = `1`;
|
|
1676
|
+
const allDragElements = container.querySelectorAll('[type="drag"]');
|
|
1677
|
+
const dragParents = Array.from(allDragElements).map(el => el.parentElement);
|
|
1678
|
+
const allSameParent = dragParents.every(parent => parent === dragElement.parentElement);
|
|
1679
|
+
// Remove from old parents
|
|
1680
|
+
if (allSameParent) {
|
|
1681
|
+
dragElement.remove();
|
|
1682
|
+
dropElement.remove();
|
|
1683
|
+
}
|
|
1684
|
+
else {
|
|
1685
|
+
dragElement.parentElement.parentElement.remove();
|
|
1686
|
+
dropElement.parentElement.parentElement.remove();
|
|
1687
|
+
}
|
|
1688
|
+
// Add animation and popup classes
|
|
1689
|
+
dragElement.classList.add('zoom-fade-in', 'after-drop-popup-drag-element');
|
|
1690
|
+
dropElement.classList.add('zoom-fade-in', 'after-drop-popup-drop-element');
|
|
1691
|
+
div.appendChild(dragElement);
|
|
1692
|
+
div.appendChild(dropElement);
|
|
1693
|
+
dropElement.classList.remove('empty');
|
|
1694
|
+
setTimeout(() => {
|
|
1695
|
+
dragElement.classList.remove('zoom-fade-in');
|
|
1696
|
+
dropElement.classList.remove('zoom-fade-in');
|
|
1697
|
+
dragElement.classList.add('zoom-fade-out');
|
|
1698
|
+
dropElement.classList.add('zoom-fade-out');
|
|
1699
|
+
setTimeout(() => {
|
|
1700
|
+
div.remove();
|
|
1701
|
+
container.style.pointerEvents = 'auto';
|
|
1702
|
+
}, 800); // match animation duration
|
|
1703
|
+
}, 2000); // stay for 2 seconds
|
|
1704
|
+
}, 250);
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1668
1707
|
function buildDropHasDragFromDOM() {
|
|
1669
1708
|
const dropHasDrag = {};
|
|
1670
1709
|
const dropElements = document.querySelectorAll("[type='drop']");
|
|
@@ -1731,7 +1770,7 @@ function enableDraggingWithScaling(element) {
|
|
|
1731
1770
|
isDragging = false;
|
|
1732
1771
|
return;
|
|
1733
1772
|
}
|
|
1734
|
-
|
|
1773
|
+
AudioPlayer.getI().stop();
|
|
1735
1774
|
removeHighlight(element);
|
|
1736
1775
|
isDragging = true;
|
|
1737
1776
|
isClicked = true;
|
|
@@ -1835,6 +1874,7 @@ function enableDraggingWithScaling(element) {
|
|
|
1835
1874
|
// Start observing the element
|
|
1836
1875
|
observer.observe(container, observerConfig);
|
|
1837
1876
|
const onMove = (event) => {
|
|
1877
|
+
console.log('moved');
|
|
1838
1878
|
if (!isDragging)
|
|
1839
1879
|
return;
|
|
1840
1880
|
if (isDraggingDisabled) {
|
|
@@ -1843,7 +1883,7 @@ function enableDraggingWithScaling(element) {
|
|
|
1843
1883
|
}
|
|
1844
1884
|
isClicked = false;
|
|
1845
1885
|
element.style.transition = 'none';
|
|
1846
|
-
const containerScale =
|
|
1886
|
+
const containerScale = calculateScale();
|
|
1847
1887
|
let dx = 0;
|
|
1848
1888
|
let dy = 0;
|
|
1849
1889
|
if (event instanceof MouseEvent) {
|
|
@@ -1895,7 +1935,9 @@ function enableDraggingWithScaling(element) {
|
|
|
1895
1935
|
mostOverlappedElement.style.backgroundColor = 'rgba(255, 0, 0, 0.1)'; // Light red background
|
|
1896
1936
|
}
|
|
1897
1937
|
else {
|
|
1898
|
-
|
|
1938
|
+
if (!document.getElementById('unitsDrop') || !document.getElementById('tensDrop') || !document.getElementById('hundredsDrop')) {
|
|
1939
|
+
mostOverlappedElement.style.opacity = '0.3';
|
|
1940
|
+
}
|
|
1899
1941
|
}
|
|
1900
1942
|
}
|
|
1901
1943
|
};
|
|
@@ -1950,6 +1992,7 @@ function enableDraggingWithScaling(element) {
|
|
|
1950
1992
|
// Check for overlaps and log the most overlapping element
|
|
1951
1993
|
let mostOverlappedElement = findMostoverlappedElement$1(element, 'drop');
|
|
1952
1994
|
onElementDropComplete(element, mostOverlappedElement);
|
|
1995
|
+
executeActions("this.updateCountBlender='true'", container);
|
|
1953
1996
|
if (((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) {
|
|
1954
1997
|
if (mostOverlappedElement) {
|
|
1955
1998
|
if (element) {
|
|
@@ -2139,7 +2182,6 @@ function handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedV
|
|
|
2139
2182
|
});
|
|
2140
2183
|
handleShowCheck();
|
|
2141
2184
|
}
|
|
2142
|
-
const tempVanishedValues = [];
|
|
2143
2185
|
async function onElementDropComplete(dragElement, dropElement) {
|
|
2144
2186
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2145
2187
|
const container = document.getElementById(LidoContainer);
|
|
@@ -2151,10 +2193,10 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2151
2193
|
let dropHasDrag = buildDropHasDragFromDOM();
|
|
2152
2194
|
if (!dropElement) {
|
|
2153
2195
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
2154
|
-
return;
|
|
2155
2196
|
}
|
|
2156
2197
|
const dropTabIndex = dropElement.getAttribute('tab-index');
|
|
2157
|
-
|
|
2198
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'false';
|
|
2199
|
+
if (((_b = dropHasDrag[dropTabIndex]) === null || _b === void 0 ? void 0 : _b.isFull) && !isAllowOnlyOneDrop) {
|
|
2158
2200
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
2159
2201
|
return;
|
|
2160
2202
|
}
|
|
@@ -2166,7 +2208,6 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2166
2208
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
2167
2209
|
return;
|
|
2168
2210
|
}
|
|
2169
|
-
// let isCorrect = dropElement.getAttribute('value').toLowerCase().includes(dragElement.getAttribute('value').toLowerCase());
|
|
2170
2211
|
let isCorrect;
|
|
2171
2212
|
const dragValue = ((_c = dragElement.getAttribute('value')) === null || _c === void 0 ? void 0 : _c.trim()) || "";
|
|
2172
2213
|
const dropValue = ((_d = dropElement.getAttribute('value')) === null || _d === void 0 ? void 0 : _d.trim()) || "";
|
|
@@ -2183,7 +2224,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2183
2224
|
}
|
|
2184
2225
|
}
|
|
2185
2226
|
else {
|
|
2186
|
-
|
|
2227
|
+
//strings
|
|
2228
|
+
isCorrect = dropValue.toLowerCase().includes(dragValue.toLowerCase());
|
|
2187
2229
|
}
|
|
2188
2230
|
if (!isCorrect) {
|
|
2189
2231
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
@@ -2193,6 +2235,7 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2193
2235
|
await executeActions(onInCorrect, dropElement, dragElement);
|
|
2194
2236
|
setTimeout(() => {
|
|
2195
2237
|
dragElement.style.transform = 'translate(0, 0)';
|
|
2238
|
+
storingEachActivityScore(false);
|
|
2196
2239
|
// const oldDropIndex = dragToDropMap[dragElement.getAttribute('data-id')];
|
|
2197
2240
|
// if (oldDropIndex !== undefined && dropHasDrag[oldDropIndex]) {
|
|
2198
2241
|
// dropHasDrag[oldDropIndex].isFull = false;
|
|
@@ -2218,61 +2261,18 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2218
2261
|
else {
|
|
2219
2262
|
const checkdropAttr = container.getAttribute('dropAttr');
|
|
2220
2263
|
if (checkdropAttr && checkdropAttr.toLowerCase() === DropMode.EnableAnimation.toLowerCase()) {
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
var _a, _b, _c;
|
|
2224
|
-
const div = document.createElement('div');
|
|
2225
|
-
container.append(div);
|
|
2226
|
-
div.classList.add('after-drop-popup-container');
|
|
2227
|
-
dragElement.style.scale = `1`;
|
|
2228
|
-
dropElement.style.scale = `1`;
|
|
2229
|
-
const allDragElements = container.querySelectorAll('[type="drag"]');
|
|
2230
|
-
const dragParents = Array.from(allDragElements).map(el => el.parentElement);
|
|
2231
|
-
const allSameParent = dragParents.every(parent => parent === dragElement.parentElement);
|
|
2232
|
-
JSON.parse((_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : '[]');
|
|
2233
|
-
const vanishedValue = (_b = dragElement.getAttribute('value')) !== null && _b !== void 0 ? _b : (_c = dragElement.textContent) === null || _c === void 0 ? void 0 : _c.trim();
|
|
2234
|
-
if (vanishedValue) {
|
|
2235
|
-
tempVanishedValues.push(vanishedValue);
|
|
2236
|
-
}
|
|
2237
|
-
// Remove from old parents
|
|
2238
|
-
if (allSameParent) {
|
|
2239
|
-
dragElement.remove();
|
|
2240
|
-
dropElement.remove();
|
|
2241
|
-
}
|
|
2242
|
-
else {
|
|
2243
|
-
dragElement.parentElement.parentElement.remove();
|
|
2244
|
-
dropElement.parentElement.parentElement.remove();
|
|
2245
|
-
}
|
|
2246
|
-
// Add animation and popup classes
|
|
2247
|
-
dragElement.classList.add('zoom-fade-in', 'after-drop-popup-drag-element');
|
|
2248
|
-
dropElement.classList.add('zoom-fade-in', 'after-drop-popup-drop-element');
|
|
2249
|
-
div.appendChild(dragElement);
|
|
2250
|
-
div.appendChild(dropElement);
|
|
2251
|
-
dropElement.classList.remove('empty');
|
|
2252
|
-
setTimeout(() => {
|
|
2253
|
-
dragElement.classList.remove('zoom-fade-in');
|
|
2254
|
-
dropElement.classList.remove('zoom-fade-in');
|
|
2255
|
-
dragElement.classList.add('zoom-fade-out');
|
|
2256
|
-
dropElement.classList.add('zoom-fade-out');
|
|
2257
|
-
setTimeout(() => {
|
|
2258
|
-
div.remove();
|
|
2259
|
-
container.style.pointerEvents = 'auto';
|
|
2260
|
-
const objective = container.getAttribute('objective');
|
|
2261
|
-
if (objective && tempVanishedValues.map(v => v.trim()).sort().join(',') === objective.split(',').map(v => v.trim()).sort().join(',')) {
|
|
2262
|
-
(async () => {
|
|
2263
|
-
isCorrect = true;
|
|
2264
|
-
const onCorrect = (container === null || container === void 0 ? void 0 : container.getAttribute('onCorrect')) || '';
|
|
2265
|
-
await executeActions(onCorrect, container);
|
|
2266
|
-
window.dispatchEvent(new CustomEvent(NextContainerKey));
|
|
2267
|
-
tempVanishedValues.length = 0;
|
|
2268
|
-
})();
|
|
2269
|
-
}
|
|
2270
|
-
}, 800); // match animation duration
|
|
2271
|
-
}, 2000); // stay for 2 seconds
|
|
2272
|
-
}, 250);
|
|
2264
|
+
//This function coming from animationhandler.ts
|
|
2265
|
+
dragDropAnimation(container, dragElement, dropElement);
|
|
2273
2266
|
}
|
|
2274
2267
|
}
|
|
2275
2268
|
}
|
|
2269
|
+
else {
|
|
2270
|
+
const checkdropAttr = container.getAttribute('dropAttr');
|
|
2271
|
+
if (checkdropAttr && checkdropAttr.toLowerCase() === DropMode.EnableAnimation.toLowerCase()) {
|
|
2272
|
+
//This function coming from animationhandler.ts
|
|
2273
|
+
dragDropAnimation(container, dragElement, dropElement);
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
2276
|
if (dropElement) {
|
|
2277
2277
|
let selectedValues = JSON.parse((_e = container.getAttribute(SelectedValuesKey)) !== null && _e !== void 0 ? _e : "[]");
|
|
2278
2278
|
const dragValue = dragElement.getAttribute('value');
|
|
@@ -2290,7 +2290,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2290
2290
|
}
|
|
2291
2291
|
if (!(((_f = dropElement.getAttribute('dropAttr')) === null || _f === void 0 ? void 0 : _f.toLowerCase()) === DropMode.Diagonal) && (dropElement.getAttribute('minDrops') === '1' || !dropElement.getAttribute('minDrops'))) {
|
|
2292
2292
|
const isisFull = Object.values(dropHasDrag).find(item => document.getElementById(item.drop) === dropElement);
|
|
2293
|
-
|
|
2293
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
|
|
2294
|
+
if (isAllowOnlyOneDrop && isisFull) {
|
|
2294
2295
|
isisFull.isFull = true;
|
|
2295
2296
|
dropElement.setAttribute('is-full', 'true');
|
|
2296
2297
|
}
|
|
@@ -2325,8 +2326,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2325
2326
|
// Check for overlaps and highlight only the most overlapping element
|
|
2326
2327
|
if (dropElement && !((_g = dropHasDrag[dropTabIndex]) === null || _g === void 0 ? void 0 : _g.isFull)) {
|
|
2327
2328
|
let mostOverlappedElement = findMostoverlappedElement$1(dragElement, 'drag');
|
|
2328
|
-
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true'
|
|
2329
|
-
if (
|
|
2329
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
|
|
2330
|
+
if (isAllowOnlyOneDrop && mostOverlappedElement) {
|
|
2330
2331
|
dragElement.style.transform = 'translate(0,0)';
|
|
2331
2332
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
2332
2333
|
const allElements = document.querySelectorAll("[type='drop']");
|
|
@@ -2404,11 +2405,12 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2404
2405
|
// Add pulse and highlight effect for a successful match
|
|
2405
2406
|
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
2406
2407
|
dispatchElementDropEvent(dragElement, dropElement, isCorrect);
|
|
2407
|
-
storingEachActivityScore(isCorrect);
|
|
2408
|
+
// storingEachActivityScore(isCorrect);
|
|
2408
2409
|
dragElement.style.opacity = '1';
|
|
2409
2410
|
await onActivityComplete(dragElement, dropElement);
|
|
2410
2411
|
const allDropElements = document.querySelectorAll('.drop-element');
|
|
2411
2412
|
allDropElements.forEach(el => updateDropBorder(el));
|
|
2413
|
+
await onActivityComplete(dragElement, dropElement);
|
|
2412
2414
|
}
|
|
2413
2415
|
function updateDropBorder(element) {
|
|
2414
2416
|
if (!element || !element.classList.contains('drop-element'))
|
|
@@ -2800,7 +2802,7 @@ function enableReorderDrag(element) {
|
|
|
2800
2802
|
isClicked = false;
|
|
2801
2803
|
event.preventDefault();
|
|
2802
2804
|
const containerRect = container.getBoundingClientRect();
|
|
2803
|
-
const containerScale =
|
|
2805
|
+
const containerScale = calculateScale();
|
|
2804
2806
|
const newLeft = (point.clientX - containerRect.left - offsetXInElement) / containerScale;
|
|
2805
2807
|
const newTop = (point.clientY - containerRect.top - offsetYInElement) / containerScale;
|
|
2806
2808
|
element.style.left = `${newLeft}px`;
|
|
@@ -2867,9 +2869,7 @@ function enableReorderDrag(element) {
|
|
|
2867
2869
|
else {
|
|
2868
2870
|
if (element.parentElement['type'] !== 'category') {
|
|
2869
2871
|
executeActions('this.alignMatch=true', divEl, element);
|
|
2870
|
-
|
|
2871
|
-
divEl.replaceWith(element);
|
|
2872
|
-
}, 500);
|
|
2872
|
+
divEl.replaceWith(element);
|
|
2873
2873
|
}
|
|
2874
2874
|
else {
|
|
2875
2875
|
const categoryElement = element.parentElement;
|
|
@@ -3345,9 +3345,6 @@ function slidingWithScaling(element) {
|
|
|
3345
3345
|
element.style.transform = 'translate(0, 0)'; // Initialize transform for consistent dragging
|
|
3346
3346
|
element.addEventListener('mousedown', onStart);
|
|
3347
3347
|
element.addEventListener('touchstart', onStart);
|
|
3348
|
-
element.addEventListener('click', ev => {
|
|
3349
|
-
onClickDropOrDragElement(element, 'drag');
|
|
3350
|
-
});
|
|
3351
3348
|
}
|
|
3352
3349
|
const slideCompleted = (slideElement) => {
|
|
3353
3350
|
var _a;
|
|
@@ -3363,8 +3360,13 @@ const slideCompleted = (slideElement) => {
|
|
|
3363
3360
|
const objectiveArray = objectiveString.split(',');
|
|
3364
3361
|
const elementIndex = slideArr.indexOf(slideElement['value']);
|
|
3365
3362
|
const isCorrect = matchStringPattern(slideElement['value'], [objectiveArray[elementIndex].trim()]);
|
|
3366
|
-
|
|
3367
|
-
|
|
3363
|
+
if (container.getAttribute('is-continue-on-correct') === 'true') {
|
|
3364
|
+
storingEachActivityScore(true);
|
|
3365
|
+
handleShowCheck();
|
|
3366
|
+
}
|
|
3367
|
+
else {
|
|
3368
|
+
storingEachActivityScore(isCorrect);
|
|
3369
|
+
}
|
|
3368
3370
|
};
|
|
3369
3371
|
|
|
3370
3372
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -4649,7 +4651,10 @@ function addClickListenerForClickType(element) {
|
|
|
4649
4651
|
dispatchClickEvent(element, isCorrect);
|
|
4650
4652
|
if (isCorrect) {
|
|
4651
4653
|
const onCorrect = element.getAttribute('onCorrect');
|
|
4652
|
-
|
|
4654
|
+
if (!(element.id && element.id.startsWith('key-button'))) {
|
|
4655
|
+
element.style.pointerEvents = 'none';
|
|
4656
|
+
}
|
|
4657
|
+
document.body.style.pointerEvents = 'none';
|
|
4653
4658
|
await executeActions(onCorrect, element);
|
|
4654
4659
|
}
|
|
4655
4660
|
else {
|
|
@@ -4706,6 +4711,7 @@ function addClickListenerForClickType(element) {
|
|
|
4706
4711
|
container.setAttribute(SelectedValuesKey, JSON.stringify(sortedValues));
|
|
4707
4712
|
const isCorrect = objective.includes(element['value']);
|
|
4708
4713
|
dispatchClickEvent(element, isCorrect);
|
|
4714
|
+
AudioPlayer.getI().stop();
|
|
4709
4715
|
if (isCorrect) {
|
|
4710
4716
|
const onCorrect = element.getAttribute('onCorrect');
|
|
4711
4717
|
await executeActions(onCorrect, element);
|
|
@@ -70019,6 +70025,7 @@ const initEventsForElement = async (element, type) => {
|
|
|
70019
70025
|
const executeActions = async (actionsString, thisElement, element) => {
|
|
70020
70026
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
70021
70027
|
const actions = parseActions(actionsString);
|
|
70028
|
+
body.style.pointerEvents = 'none';
|
|
70022
70029
|
for (let i = 0; i < actions.length; i++) {
|
|
70023
70030
|
const action = actions[i];
|
|
70024
70031
|
const queriedElement = document.querySelector(action.actor);
|
|
@@ -70049,7 +70056,7 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
70049
70056
|
const container = document.getElementById(LidoContainer);
|
|
70050
70057
|
const containerScale = getElementScale$1(container);
|
|
70051
70058
|
dragElement.style.transform = 'translate(0,0)';
|
|
70052
|
-
console.log(
|
|
70059
|
+
console.log('logg alinmatch');
|
|
70053
70060
|
const dropRect = dropElement.getBoundingClientRect();
|
|
70054
70061
|
const dragRect = dragElement.getBoundingClientRect();
|
|
70055
70062
|
const dropCenterX = dropRect.left + dropRect.width / 2;
|
|
@@ -70103,7 +70110,7 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
70103
70110
|
if (container.getAttribute('is-continue-on-correct') !== 'true') {
|
|
70104
70111
|
targetElement.style.pointerEvents = 'none';
|
|
70105
70112
|
}
|
|
70106
|
-
validateObjectiveStatus();
|
|
70113
|
+
await validateObjectiveStatus();
|
|
70107
70114
|
break;
|
|
70108
70115
|
}
|
|
70109
70116
|
case 'prevBtn': {
|
|
@@ -70213,8 +70220,53 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
70213
70220
|
}
|
|
70214
70221
|
break;
|
|
70215
70222
|
}
|
|
70216
|
-
case '
|
|
70217
|
-
|
|
70223
|
+
case 'disableType': {
|
|
70224
|
+
const dragEle = document.querySelector('[type="drag"]');
|
|
70225
|
+
dragEle.removeAttribute('type');
|
|
70226
|
+
dragEle.style.pointerEvents = 'none';
|
|
70227
|
+
break;
|
|
70228
|
+
}
|
|
70229
|
+
case 'updateCountBlender': {
|
|
70230
|
+
const allDrags = document.querySelectorAll('[type="drag"]');
|
|
70231
|
+
let units = 0;
|
|
70232
|
+
let tens = 0;
|
|
70233
|
+
let hundreds = 0;
|
|
70234
|
+
allDrags.forEach(el => {
|
|
70235
|
+
const dropTo = el.getAttribute("drop-to");
|
|
70236
|
+
if (dropTo === "unitsDrop")
|
|
70237
|
+
units++;
|
|
70238
|
+
if (dropTo === "tensDrop")
|
|
70239
|
+
tens++;
|
|
70240
|
+
if (dropTo === "hundredsDrop")
|
|
70241
|
+
hundreds++;
|
|
70242
|
+
});
|
|
70243
|
+
const unitsValue = units * 1;
|
|
70244
|
+
const tensValue = tens * 10;
|
|
70245
|
+
const hundredsValue = hundreds * 100;
|
|
70246
|
+
const totalValue = unitsValue + tensValue + hundredsValue;
|
|
70247
|
+
// ✅ Update Lido Text Boxes
|
|
70248
|
+
const unitsBox = document.getElementById("units");
|
|
70249
|
+
const tensBox = document.getElementById("tens");
|
|
70250
|
+
const hundredsBox = document.getElementById("hundreds");
|
|
70251
|
+
if (unitsBox) {
|
|
70252
|
+
unitsBox.setAttribute("string", unitsValue.toString());
|
|
70253
|
+
}
|
|
70254
|
+
if (tensBox) {
|
|
70255
|
+
tensBox.setAttribute("string", tensValue.toString());
|
|
70256
|
+
}
|
|
70257
|
+
if (hundredsBox) {
|
|
70258
|
+
hundredsBox.setAttribute("string", hundredsValue.toString());
|
|
70259
|
+
}
|
|
70260
|
+
console.log(`Units = ${units} → ${unitsValue}`);
|
|
70261
|
+
console.log(`Tens = ${tens} → ${tensValue}`);
|
|
70262
|
+
console.log(`Hundreds = ${hundreds} → ${hundredsValue}`);
|
|
70263
|
+
console.log(`✅ Total Value = ${totalValue}`);
|
|
70264
|
+
break;
|
|
70265
|
+
}
|
|
70266
|
+
case 'updateCalculatorAnswer': {
|
|
70267
|
+
if (targetElement) {
|
|
70268
|
+
updateCalculatorAnswer(targetElement);
|
|
70269
|
+
}
|
|
70218
70270
|
break;
|
|
70219
70271
|
}
|
|
70220
70272
|
default: {
|
|
@@ -70224,6 +70276,7 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
70224
70276
|
}
|
|
70225
70277
|
}
|
|
70226
70278
|
}
|
|
70279
|
+
body.style.pointerEvents = 'auto';
|
|
70227
70280
|
};
|
|
70228
70281
|
const afterDropDragHandling = (dragElement, dropElement) => {
|
|
70229
70282
|
const container = document.getElementById(LidoContainer);
|
|
@@ -70233,6 +70286,7 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
70233
70286
|
const isInfinite = container.getAttribute('drop-action') === DropAction.InfiniteDrop;
|
|
70234
70287
|
if (isAppend || isInfinite) {
|
|
70235
70288
|
setTimeout(() => {
|
|
70289
|
+
var _a, _b;
|
|
70236
70290
|
dragElement.style.transform = 'translate(0,0)';
|
|
70237
70291
|
dragElement.style.transition = '';
|
|
70238
70292
|
let dummyElement = document.createElement('div');
|
|
@@ -70266,6 +70320,14 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
70266
70320
|
dummyElement.style.margin = '0px';
|
|
70267
70321
|
});
|
|
70268
70322
|
}
|
|
70323
|
+
const orientation = window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
|
|
70324
|
+
const rowAttr = dropElement.getAttribute('dropAttr');
|
|
70325
|
+
const dropAttr = parseProp(rowAttr, orientation); // will return stackcascade or verticalstack
|
|
70326
|
+
if (((_a = (dropAttr)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "stackcascade" || ((_b = (dropAttr)) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === "verticalstack") {
|
|
70327
|
+
dropElement.append(dragElement);
|
|
70328
|
+
placeElementInDropZone(dropElement, dragElement, orientation, dropAttr);
|
|
70329
|
+
return;
|
|
70330
|
+
}
|
|
70269
70331
|
dropElement.parentElement.append(element);
|
|
70270
70332
|
dragElement.style.position = 'absolute';
|
|
70271
70333
|
dragElement.style.zIndex = '1';
|
|
@@ -70278,16 +70340,41 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
70278
70340
|
const scaledLeft = (dropCenterX - dragCenterX) / containerScale;
|
|
70279
70341
|
const scaledTop = (dropCenterY - dragCenterY) / containerScale;
|
|
70280
70342
|
dragElement.style.transform = `translate(${scaledLeft}px, ${scaledTop}px)`;
|
|
70281
|
-
},
|
|
70343
|
+
}, 100);
|
|
70282
70344
|
}
|
|
70283
70345
|
};
|
|
70346
|
+
// function cloneElementWithComputedStyles(originalEl: HTMLElement): HTMLElement {
|
|
70347
|
+
// let clone = document.createElement('div') as HTMLElement;
|
|
70348
|
+
// clone.innerHTML = originalEl.outerHTML;
|
|
70349
|
+
// clone = clone.firstChild as HTMLElement;
|
|
70350
|
+
// clone.setAttribute('height', originalEl.style.height);
|
|
70351
|
+
// clone.setAttribute('width', originalEl.style.width);
|
|
70352
|
+
// clone.setAttribute('visible', 'true');
|
|
70353
|
+
// return clone;
|
|
70354
|
+
// }
|
|
70284
70355
|
function cloneElementWithComputedStyles(originalEl) {
|
|
70285
|
-
|
|
70286
|
-
|
|
70287
|
-
|
|
70288
|
-
|
|
70289
|
-
|
|
70290
|
-
|
|
70356
|
+
const tag = originalEl.tagName.toLowerCase();
|
|
70357
|
+
if (tag === "lido-text") {
|
|
70358
|
+
let clone = document.createElement('div');
|
|
70359
|
+
clone.innerHTML = originalEl.outerHTML;
|
|
70360
|
+
clone = clone.firstChild;
|
|
70361
|
+
clone.setAttribute('height', originalEl.style.height);
|
|
70362
|
+
clone.setAttribute('width', originalEl.style.width);
|
|
70363
|
+
clone.setAttribute('visible', 'true');
|
|
70364
|
+
return clone;
|
|
70365
|
+
}
|
|
70366
|
+
// ✅ For ALL other types (INCLUDING lido-image & matrix) use your simple logic
|
|
70367
|
+
const clone = originalEl.cloneNode(false);
|
|
70368
|
+
clone.style.width = originalEl.style.width;
|
|
70369
|
+
clone.style.height = originalEl.style.height;
|
|
70370
|
+
clone.style.margin = originalEl.style.margin;
|
|
70371
|
+
clone.style.opacity = originalEl.style.opacity;
|
|
70372
|
+
clone.style.transform = originalEl.style.transform;
|
|
70373
|
+
clone.setAttribute("visible", "true");
|
|
70374
|
+
clone.setAttribute("data-dummy", "true");
|
|
70375
|
+
if (tag === "lido-math-matrix") {
|
|
70376
|
+
clone.setAttribute('clickable', "false");
|
|
70377
|
+
}
|
|
70291
70378
|
return clone;
|
|
70292
70379
|
}
|
|
70293
70380
|
// Function to parse actions string
|
|
@@ -70506,6 +70593,7 @@ const handleShowCheck = () => {
|
|
|
70506
70593
|
validateObjectiveStatus();
|
|
70507
70594
|
}
|
|
70508
70595
|
};
|
|
70596
|
+
const body = document.body;
|
|
70509
70597
|
let res;
|
|
70510
70598
|
const validateObjectiveStatus = async () => {
|
|
70511
70599
|
var _a, _b;
|
|
@@ -70570,6 +70658,7 @@ const validateObjectiveStatus = async () => {
|
|
|
70570
70658
|
if (!isContinueOnCorrect) {
|
|
70571
70659
|
triggerNextContainer();
|
|
70572
70660
|
await calculateScore();
|
|
70661
|
+
triggerNextContainer();
|
|
70573
70662
|
}
|
|
70574
70663
|
else {
|
|
70575
70664
|
const onInCorrect = container.getAttribute('onInCorrect');
|
|
@@ -70592,16 +70681,16 @@ const triggerPrevcontainer = () => {
|
|
|
70592
70681
|
function convertUrlToRelative(url) {
|
|
70593
70682
|
const container = document.getElementById(LidoContainer);
|
|
70594
70683
|
const baseUrl = container.getAttribute('baseUrl');
|
|
70595
|
-
if ((url === null || url === void 0 ? void 0 : url.startsWith('http')) || (url === null || url === void 0 ? void 0 : url.startsWith('blob'))) {
|
|
70684
|
+
if ((url === null || url === void 0 ? void 0 : url.startsWith('http')) || (url === null || url === void 0 ? void 0 : url.startsWith('blob')) || (url === null || url === void 0 ? void 0 : url.startsWith('data'))) {
|
|
70596
70685
|
return url;
|
|
70597
70686
|
}
|
|
70598
|
-
|
|
70599
|
-
const newUrl =
|
|
70600
|
-
|
|
70601
|
-
|
|
70602
|
-
|
|
70603
|
-
return getAssetPath(url);
|
|
70687
|
+
if (baseUrl) {
|
|
70688
|
+
const newUrl = url.startsWith('/') ? url.slice(1) : url;
|
|
70689
|
+
if (newUrl.startsWith(baseUrl.replace(/^\/+|\/+$/g, '')))
|
|
70690
|
+
return newUrl;
|
|
70691
|
+
return baseUrl.endsWith('/') ? baseUrl + newUrl : `${baseUrl}/${newUrl}`;
|
|
70604
70692
|
}
|
|
70693
|
+
return getAssetPath(url);
|
|
70605
70694
|
}
|
|
70606
70695
|
/**
|
|
70607
70696
|
* Asynchronously speaks the given text using the browser's text-to-speech API.
|
|
@@ -71073,9 +71162,6 @@ const SumTogetherAnimation = async (element, value) => {
|
|
|
71073
71162
|
return;
|
|
71074
71163
|
if (!value)
|
|
71075
71164
|
return;
|
|
71076
|
-
const container = document.getElementById(LidoContainer);
|
|
71077
|
-
if (!container)
|
|
71078
|
-
return;
|
|
71079
71165
|
// Expecting structure: [_, TopRow, questionRow, optionRow, ...]
|
|
71080
71166
|
const TopRow = Array.from(element.children)[1];
|
|
71081
71167
|
const questionRow = Array.from(element.children)[2];
|
|
@@ -71170,16 +71256,64 @@ const SumTogetherAnimation = async (element, value) => {
|
|
|
71170
71256
|
elementAppearance(false);
|
|
71171
71257
|
}
|
|
71172
71258
|
};
|
|
71173
|
-
|
|
71259
|
+
function placeElementInDropZone(dropElement, dragElement, orientation, dropAttr) {
|
|
71260
|
+
const dropRect = dropElement.getBoundingClientRect();
|
|
71261
|
+
const dragRect = dragElement.getBoundingClientRect();
|
|
71262
|
+
const scale = typeof calculateScale === "function" ? calculateScale() : 1;
|
|
71263
|
+
if (!dropElement.dataset.dropCount)
|
|
71264
|
+
dropElement.dataset.dropCount = "0";
|
|
71265
|
+
let dropCount = parseInt(dropElement.dataset.dropCount, 10);
|
|
71266
|
+
// === READ DROP ZONE SIZE ===
|
|
71267
|
+
const dropWidth = dropRect.width;
|
|
71268
|
+
const dropHeight = dropRect.height;
|
|
71269
|
+
let targetX, targetY;
|
|
71270
|
+
// ---------------- LANDSCAPE WATERFALL ----------------
|
|
71271
|
+
if (orientation === "landscape" && dropAttr.toLowerCase() === "stackcascade") {
|
|
71272
|
+
console.log("🌄 Landscape waterfall");
|
|
71273
|
+
const shiftX = dropWidth * 0.02; // proportional (5% of width)
|
|
71274
|
+
const shiftY = dropHeight * 0.02; // proportional (5% of height)
|
|
71275
|
+
const startX = dropRect.left + dropWidth * 0.36; // 10% inside
|
|
71276
|
+
const startY = dropRect.top + dropHeight * -0.09; // slightly above
|
|
71277
|
+
targetX = startX + (dropCount * shiftX);
|
|
71278
|
+
targetY = startY + (dropCount * shiftY);
|
|
71279
|
+
}
|
|
71280
|
+
// ---------------- PORTRAIT VERTICAL ----------------
|
|
71281
|
+
else {
|
|
71282
|
+
console.log("📱 Portrait vertical stack");
|
|
71283
|
+
let startX;
|
|
71284
|
+
const stepY = dropHeight * 0.05; // 8% vertical step
|
|
71285
|
+
if (dropElement.id === "unitsDrop") {
|
|
71286
|
+
startX = dropRect.left + dropWidth * 0.4; // special spacing
|
|
71287
|
+
}
|
|
71288
|
+
else if (dropElement.id === "tensDrop") {
|
|
71289
|
+
startX = dropRect.left + dropWidth * 0.25;
|
|
71290
|
+
}
|
|
71291
|
+
else {
|
|
71292
|
+
startX = dropRect.left + dropWidth * 0.16; // normal spacing
|
|
71293
|
+
}
|
|
71294
|
+
const startY = dropRect.top - dropHeight * 0.25; // above start
|
|
71295
|
+
targetX = startX;
|
|
71296
|
+
targetY = startY + (dropCount * stepY);
|
|
71297
|
+
}
|
|
71298
|
+
// ------------ APPLY TRANSFORM SMOOTHLY --------------
|
|
71299
|
+
const dx = (targetX - dragRect.left) / scale;
|
|
71300
|
+
const dy = (targetY - dragRect.top) / scale;
|
|
71301
|
+
dragElement.style.transition = "transform .2s ease-out";
|
|
71302
|
+
dragElement.style.transform = `translate(${dx}px, ${dy}px)`;
|
|
71303
|
+
dropElement.dataset.dropCount = String(dropCount + 1);
|
|
71304
|
+
// reset size
|
|
71305
|
+
dragElement.style.width = "auto";
|
|
71306
|
+
dragElement.style.height = "auto";
|
|
71307
|
+
}
|
|
71308
|
+
const updateCalculatorAnswer = (el) => {
|
|
71174
71309
|
const container = document.getElementById(LidoContainer);
|
|
71175
71310
|
if (!container)
|
|
71176
71311
|
return;
|
|
71177
|
-
const
|
|
71178
|
-
if (!
|
|
71312
|
+
const calci = document.querySelector('#lidoCalculator');
|
|
71313
|
+
if (!calci)
|
|
71179
71314
|
return;
|
|
71180
|
-
const
|
|
71181
|
-
|
|
71182
|
-
answerText.setAttribute('string', String(calculatedValue));
|
|
71315
|
+
const value = calci.getAttribute('value');
|
|
71316
|
+
el.setAttribute('string', value);
|
|
71183
71317
|
};
|
|
71184
71318
|
|
|
71185
|
-
export { ActivityScoreKey as A, generateUUIDFallback as B, exitUrl as C, prevUrl as D, nextUrl as E, speakUrl as F, getCancelBtnPopup as G, H,
|
|
71319
|
+
export { ActivityScoreKey as A, generateUUIDFallback as B, exitUrl as C, prevUrl as D, nextUrl as E, speakUrl as F, getCancelBtnPopup as G, H, matchStringPattern as I, triggerNextContainer as J, triggerPrevcontainer as K, LidoContainer as L, setCancelBtnPopup as M, NextContainerKey as N, getDefaultExportFromCjs as O, PrevContainerKey as P, tinyColor as Q, RiveService as R, SelectedValuesKey as S, DropAction as T, validateObjectiveStatus as U, fraction as V, TraceMode as W, speakIcon as X, fingerUrl as Y, setNonce as a, setPlatformOptions as b, commonjsGlobal as c, setVisibilityWithDelay as d, convertUrlToRelative as e, format as f, getAssetPath$1 as g, h, initEventsForElement as i, Host as j, parseProp as k, createEvent as l, equationCheck as m, storingEachActivityScore as n, executeActions as o, proxyCustomElement as p, handlingChildElements as q, attachSpeakIcon as r, setAssetPath as s, calculateScale as t, handleFloatElementPosition as u, handleElementClick as v, dispatchActivityChangeEvent as w, dispatchGameCompletedEvent as x, dispatchGameExitEvent as y, AudioPlayer as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, i as initEventsForElement, q as handlingChildElements, r as attachSpeakIcon, k as parseProp, h, j as Host } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, i as initEventsForElement, q as handlingChildElements, r as attachSpeakIcon, k as parseProp, h, j as Host } from './p-511377d2.js';
|
|
2
2
|
|
|
3
3
|
const lidoRowCss = ".lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}";
|
|
4
4
|
const LidoRowStyle0 = lidoRowCss;
|
|
@@ -77,7 +77,7 @@ const LidoRow = /*@__PURE__*/ proxyCustomElement(class LidoRow extends H {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
render() {
|
|
80
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: '2d2f701dda922276d2485e91f15c8912c90d7b8d', class: "lido-row", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }, h("slot", { key: 'b00002ecc9d5de422094beffc33ae5137b958fa3' })));
|
|
81
81
|
}
|
|
82
82
|
get el() { return this; }
|
|
83
83
|
static get style() { return LidoRowStyle0; }
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, k as parseProp, h, j as Host } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, k as parseProp, h, j as Host } from './p-511377d2.js';
|
|
2
|
+
import { d as defineCustomElement$1 } from './p-b3e67e7f.js';
|
|
2
3
|
|
|
3
|
-
const lidoCanvasCss = ":host{display:flex;justify-content:center;align-items:center}.lido-
|
|
4
|
+
const lidoCanvasCss = ":host{display:flex;justify-content:center;align-items:center}.lido-canvas{background:red;border:2px solid #ccc;border-radius:8px;display:flex;flex-direction:column;overflow:hidden;position:relative}#lido-exit-button{padding:6px 14px;border:none;background:transparent;color:#fff;border-radius:6px;cursor:pointer;font-size:14px;position:relative;top:-43%;left:18%;z-index:10}canvas{touch-action:none;display:block}";
|
|
4
5
|
const LidoCanvasStyle0 = lidoCanvasCss;
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
+
const LidoCanvas = /*@__PURE__*/ proxyCustomElement(class LidoCanvas extends H {
|
|
7
8
|
constructor() {
|
|
8
9
|
super();
|
|
9
10
|
this.__registerHost();
|
|
@@ -92,7 +93,7 @@ const WritingPad = /*@__PURE__*/ proxyCustomElement(class WritingPad extends H {
|
|
|
92
93
|
this.loadBackground();
|
|
93
94
|
}
|
|
94
95
|
render() {
|
|
95
|
-
return (h(Host, { key: '
|
|
96
|
+
return (h(Host, { key: '6768ff870d132528267f2e824fdc6edf5a5fa2be', id: "lido-canvas", class: "lido-canvas", style: this.style }, h("button", { key: 'ba3d5456edfa4618b6c3f57b97fa18cef45f7ae9', id: "lido-exit-button", onClick: () => this.clearCanvas() }, h("lido-text", { key: '3484c9005819e3d08adf8d36b247d3c45610d0b5', visible: "true", height: "92px", width: "43px", id: "lido-exit-icon", "font-color": "white", onEntry: "this.font-weight='900';", "font-size": "96px", string: 'X' })), h("canvas", { key: 'cd4167cefde8d4cf159779c46283cafbc3b0afcc', id: "lido-canvas", style: { width: this.style.width, height: this.style.height, } })));
|
|
96
97
|
}
|
|
97
98
|
get el() { return this; }
|
|
98
99
|
static get style() { return LidoCanvasStyle0; }
|
|
@@ -109,15 +110,20 @@ function defineCustomElement() {
|
|
|
109
110
|
if (typeof customElements === "undefined") {
|
|
110
111
|
return;
|
|
111
112
|
}
|
|
112
|
-
const components = ["lido-canvas"];
|
|
113
|
+
const components = ["lido-canvas", "lido-text"];
|
|
113
114
|
components.forEach(tagName => { switch (tagName) {
|
|
114
115
|
case "lido-canvas":
|
|
115
116
|
if (!customElements.get(tagName)) {
|
|
116
|
-
customElements.define(tagName,
|
|
117
|
+
customElements.define(tagName, LidoCanvas);
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
case "lido-text":
|
|
121
|
+
if (!customElements.get(tagName)) {
|
|
122
|
+
defineCustomElement$1();
|
|
117
123
|
}
|
|
118
124
|
break;
|
|
119
125
|
} });
|
|
120
126
|
}
|
|
121
127
|
defineCustomElement();
|
|
122
128
|
|
|
123
|
-
export {
|
|
129
|
+
export { LidoCanvas as L, defineCustomElement as d };
|