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
|
@@ -226,6 +226,45 @@ function balanceResult(container, objectiveString) {
|
|
|
226
226
|
return res;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
+
function dragDropAnimation(container, dragElement, dropElement) {
|
|
230
|
+
container.style.pointerEvents = 'none';
|
|
231
|
+
setTimeout(() => {
|
|
232
|
+
const div = document.createElement('div');
|
|
233
|
+
container.append(div);
|
|
234
|
+
div.classList.add('after-drop-popup-container');
|
|
235
|
+
dragElement.style.scale = `1`;
|
|
236
|
+
dropElement.style.scale = `1`;
|
|
237
|
+
const allDragElements = container.querySelectorAll('[type="drag"]');
|
|
238
|
+
const dragParents = Array.from(allDragElements).map(el => el.parentElement);
|
|
239
|
+
const allSameParent = dragParents.every(parent => parent === dragElement.parentElement);
|
|
240
|
+
// Remove from old parents
|
|
241
|
+
if (allSameParent) {
|
|
242
|
+
dragElement.remove();
|
|
243
|
+
dropElement.remove();
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
dragElement.parentElement.parentElement.remove();
|
|
247
|
+
dropElement.parentElement.parentElement.remove();
|
|
248
|
+
}
|
|
249
|
+
// Add animation and popup classes
|
|
250
|
+
dragElement.classList.add('zoom-fade-in', 'after-drop-popup-drag-element');
|
|
251
|
+
dropElement.classList.add('zoom-fade-in', 'after-drop-popup-drop-element');
|
|
252
|
+
div.appendChild(dragElement);
|
|
253
|
+
div.appendChild(dropElement);
|
|
254
|
+
dropElement.classList.remove('empty');
|
|
255
|
+
setTimeout(() => {
|
|
256
|
+
dragElement.classList.remove('zoom-fade-in');
|
|
257
|
+
dropElement.classList.remove('zoom-fade-in');
|
|
258
|
+
dragElement.classList.add('zoom-fade-out');
|
|
259
|
+
dropElement.classList.add('zoom-fade-out');
|
|
260
|
+
setTimeout(() => {
|
|
261
|
+
div.remove();
|
|
262
|
+
container.style.pointerEvents = 'auto';
|
|
263
|
+
}, 800); // match animation duration
|
|
264
|
+
}, 2000); // stay for 2 seconds
|
|
265
|
+
}, 250);
|
|
266
|
+
}
|
|
267
|
+
|
|
229
268
|
function buildDropHasDragFromDOM() {
|
|
230
269
|
const dropHasDrag = {};
|
|
231
270
|
const dropElements = document.querySelectorAll("[type='drop']");
|
|
@@ -292,7 +331,7 @@ function enableDraggingWithScaling(element) {
|
|
|
292
331
|
isDragging = false;
|
|
293
332
|
return;
|
|
294
333
|
}
|
|
295
|
-
|
|
334
|
+
AudioPlayer.getI().stop();
|
|
296
335
|
removeHighlight(element);
|
|
297
336
|
isDragging = true;
|
|
298
337
|
isClicked = true;
|
|
@@ -396,6 +435,7 @@ function enableDraggingWithScaling(element) {
|
|
|
396
435
|
// Start observing the element
|
|
397
436
|
observer.observe(container, observerConfig);
|
|
398
437
|
const onMove = (event) => {
|
|
438
|
+
console.log('moved');
|
|
399
439
|
if (!isDragging)
|
|
400
440
|
return;
|
|
401
441
|
if (isDraggingDisabled) {
|
|
@@ -404,7 +444,7 @@ function enableDraggingWithScaling(element) {
|
|
|
404
444
|
}
|
|
405
445
|
isClicked = false;
|
|
406
446
|
element.style.transition = 'none';
|
|
407
|
-
const containerScale =
|
|
447
|
+
const containerScale = calculateScale();
|
|
408
448
|
let dx = 0;
|
|
409
449
|
let dy = 0;
|
|
410
450
|
if (event instanceof MouseEvent) {
|
|
@@ -456,7 +496,9 @@ function enableDraggingWithScaling(element) {
|
|
|
456
496
|
mostOverlappedElement.style.backgroundColor = 'rgba(255, 0, 0, 0.1)'; // Light red background
|
|
457
497
|
}
|
|
458
498
|
else {
|
|
459
|
-
|
|
499
|
+
if (!document.getElementById('unitsDrop') || !document.getElementById('tensDrop') || !document.getElementById('hundredsDrop')) {
|
|
500
|
+
mostOverlappedElement.style.opacity = '0.3';
|
|
501
|
+
}
|
|
460
502
|
}
|
|
461
503
|
}
|
|
462
504
|
};
|
|
@@ -511,6 +553,7 @@ function enableDraggingWithScaling(element) {
|
|
|
511
553
|
// Check for overlaps and log the most overlapping element
|
|
512
554
|
let mostOverlappedElement = findMostoverlappedElement$1(element, 'drop');
|
|
513
555
|
onElementDropComplete(element, mostOverlappedElement);
|
|
556
|
+
executeActions("this.updateCountBlender='true'", container);
|
|
514
557
|
if (((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) {
|
|
515
558
|
if (mostOverlappedElement) {
|
|
516
559
|
if (element) {
|
|
@@ -700,7 +743,6 @@ function handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedV
|
|
|
700
743
|
});
|
|
701
744
|
handleShowCheck();
|
|
702
745
|
}
|
|
703
|
-
const tempVanishedValues = [];
|
|
704
746
|
async function onElementDropComplete(dragElement, dropElement) {
|
|
705
747
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
706
748
|
const container = document.getElementById(LidoContainer);
|
|
@@ -712,10 +754,10 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
712
754
|
let dropHasDrag = buildDropHasDragFromDOM();
|
|
713
755
|
if (!dropElement) {
|
|
714
756
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
715
|
-
return;
|
|
716
757
|
}
|
|
717
758
|
const dropTabIndex = dropElement.getAttribute('tab-index');
|
|
718
|
-
|
|
759
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'false';
|
|
760
|
+
if (((_b = dropHasDrag[dropTabIndex]) === null || _b === void 0 ? void 0 : _b.isFull) && !isAllowOnlyOneDrop) {
|
|
719
761
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
720
762
|
return;
|
|
721
763
|
}
|
|
@@ -727,7 +769,6 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
727
769
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
728
770
|
return;
|
|
729
771
|
}
|
|
730
|
-
// let isCorrect = dropElement.getAttribute('value').toLowerCase().includes(dragElement.getAttribute('value').toLowerCase());
|
|
731
772
|
let isCorrect;
|
|
732
773
|
const dragValue = ((_c = dragElement.getAttribute('value')) === null || _c === void 0 ? void 0 : _c.trim()) || "";
|
|
733
774
|
const dropValue = ((_d = dropElement.getAttribute('value')) === null || _d === void 0 ? void 0 : _d.trim()) || "";
|
|
@@ -744,7 +785,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
744
785
|
}
|
|
745
786
|
}
|
|
746
787
|
else {
|
|
747
|
-
|
|
788
|
+
//strings
|
|
789
|
+
isCorrect = dropValue.toLowerCase().includes(dragValue.toLowerCase());
|
|
748
790
|
}
|
|
749
791
|
if (!isCorrect) {
|
|
750
792
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
@@ -754,6 +796,7 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
754
796
|
await executeActions(onInCorrect, dropElement, dragElement);
|
|
755
797
|
setTimeout(() => {
|
|
756
798
|
dragElement.style.transform = 'translate(0, 0)';
|
|
799
|
+
storingEachActivityScore(false);
|
|
757
800
|
// const oldDropIndex = dragToDropMap[dragElement.getAttribute('data-id')];
|
|
758
801
|
// if (oldDropIndex !== undefined && dropHasDrag[oldDropIndex]) {
|
|
759
802
|
// dropHasDrag[oldDropIndex].isFull = false;
|
|
@@ -779,61 +822,18 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
779
822
|
else {
|
|
780
823
|
const checkdropAttr = container.getAttribute('dropAttr');
|
|
781
824
|
if (checkdropAttr && checkdropAttr.toLowerCase() === DropMode.EnableAnimation.toLowerCase()) {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
var _a, _b, _c;
|
|
785
|
-
const div = document.createElement('div');
|
|
786
|
-
container.append(div);
|
|
787
|
-
div.classList.add('after-drop-popup-container');
|
|
788
|
-
dragElement.style.scale = `1`;
|
|
789
|
-
dropElement.style.scale = `1`;
|
|
790
|
-
const allDragElements = container.querySelectorAll('[type="drag"]');
|
|
791
|
-
const dragParents = Array.from(allDragElements).map(el => el.parentElement);
|
|
792
|
-
const allSameParent = dragParents.every(parent => parent === dragElement.parentElement);
|
|
793
|
-
JSON.parse((_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : '[]');
|
|
794
|
-
const vanishedValue = (_b = dragElement.getAttribute('value')) !== null && _b !== void 0 ? _b : (_c = dragElement.textContent) === null || _c === void 0 ? void 0 : _c.trim();
|
|
795
|
-
if (vanishedValue) {
|
|
796
|
-
tempVanishedValues.push(vanishedValue);
|
|
797
|
-
}
|
|
798
|
-
// Remove from old parents
|
|
799
|
-
if (allSameParent) {
|
|
800
|
-
dragElement.remove();
|
|
801
|
-
dropElement.remove();
|
|
802
|
-
}
|
|
803
|
-
else {
|
|
804
|
-
dragElement.parentElement.parentElement.remove();
|
|
805
|
-
dropElement.parentElement.parentElement.remove();
|
|
806
|
-
}
|
|
807
|
-
// Add animation and popup classes
|
|
808
|
-
dragElement.classList.add('zoom-fade-in', 'after-drop-popup-drag-element');
|
|
809
|
-
dropElement.classList.add('zoom-fade-in', 'after-drop-popup-drop-element');
|
|
810
|
-
div.appendChild(dragElement);
|
|
811
|
-
div.appendChild(dropElement);
|
|
812
|
-
dropElement.classList.remove('empty');
|
|
813
|
-
setTimeout(() => {
|
|
814
|
-
dragElement.classList.remove('zoom-fade-in');
|
|
815
|
-
dropElement.classList.remove('zoom-fade-in');
|
|
816
|
-
dragElement.classList.add('zoom-fade-out');
|
|
817
|
-
dropElement.classList.add('zoom-fade-out');
|
|
818
|
-
setTimeout(() => {
|
|
819
|
-
div.remove();
|
|
820
|
-
container.style.pointerEvents = 'auto';
|
|
821
|
-
const objective = container.getAttribute('objective');
|
|
822
|
-
if (objective && tempVanishedValues.map(v => v.trim()).sort().join(',') === objective.split(',').map(v => v.trim()).sort().join(',')) {
|
|
823
|
-
(async () => {
|
|
824
|
-
isCorrect = true;
|
|
825
|
-
const onCorrect = (container === null || container === void 0 ? void 0 : container.getAttribute('onCorrect')) || '';
|
|
826
|
-
await executeActions(onCorrect, container);
|
|
827
|
-
window.dispatchEvent(new CustomEvent(NextContainerKey));
|
|
828
|
-
tempVanishedValues.length = 0;
|
|
829
|
-
})();
|
|
830
|
-
}
|
|
831
|
-
}, 800); // match animation duration
|
|
832
|
-
}, 2000); // stay for 2 seconds
|
|
833
|
-
}, 250);
|
|
825
|
+
//This function coming from animationhandler.ts
|
|
826
|
+
dragDropAnimation(container, dragElement, dropElement);
|
|
834
827
|
}
|
|
835
828
|
}
|
|
836
829
|
}
|
|
830
|
+
else {
|
|
831
|
+
const checkdropAttr = container.getAttribute('dropAttr');
|
|
832
|
+
if (checkdropAttr && checkdropAttr.toLowerCase() === DropMode.EnableAnimation.toLowerCase()) {
|
|
833
|
+
//This function coming from animationhandler.ts
|
|
834
|
+
dragDropAnimation(container, dragElement, dropElement);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
837
|
if (dropElement) {
|
|
838
838
|
let selectedValues = JSON.parse((_e = container.getAttribute(SelectedValuesKey)) !== null && _e !== void 0 ? _e : "[]");
|
|
839
839
|
const dragValue = dragElement.getAttribute('value');
|
|
@@ -851,7 +851,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
851
851
|
}
|
|
852
852
|
if (!(((_f = dropElement.getAttribute('dropAttr')) === null || _f === void 0 ? void 0 : _f.toLowerCase()) === DropMode.Diagonal) && (dropElement.getAttribute('minDrops') === '1' || !dropElement.getAttribute('minDrops'))) {
|
|
853
853
|
const isisFull = Object.values(dropHasDrag).find(item => document.getElementById(item.drop) === dropElement);
|
|
854
|
-
|
|
854
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
|
|
855
|
+
if (isAllowOnlyOneDrop && isisFull) {
|
|
855
856
|
isisFull.isFull = true;
|
|
856
857
|
dropElement.setAttribute('is-full', 'true');
|
|
857
858
|
}
|
|
@@ -886,8 +887,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
886
887
|
// Check for overlaps and highlight only the most overlapping element
|
|
887
888
|
if (dropElement && !((_g = dropHasDrag[dropTabIndex]) === null || _g === void 0 ? void 0 : _g.isFull)) {
|
|
888
889
|
let mostOverlappedElement = findMostoverlappedElement$1(dragElement, 'drag');
|
|
889
|
-
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true'
|
|
890
|
-
if (
|
|
890
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
|
|
891
|
+
if (isAllowOnlyOneDrop && mostOverlappedElement) {
|
|
891
892
|
dragElement.style.transform = 'translate(0,0)';
|
|
892
893
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
893
894
|
const allElements = document.querySelectorAll("[type='drop']");
|
|
@@ -965,11 +966,12 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
965
966
|
// Add pulse and highlight effect for a successful match
|
|
966
967
|
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
967
968
|
dispatchElementDropEvent(dragElement, dropElement, isCorrect);
|
|
968
|
-
storingEachActivityScore(isCorrect);
|
|
969
|
+
// storingEachActivityScore(isCorrect);
|
|
969
970
|
dragElement.style.opacity = '1';
|
|
970
971
|
await onActivityComplete(dragElement, dropElement);
|
|
971
972
|
const allDropElements = document.querySelectorAll('.drop-element');
|
|
972
973
|
allDropElements.forEach(el => updateDropBorder(el));
|
|
974
|
+
await onActivityComplete(dragElement, dropElement);
|
|
973
975
|
}
|
|
974
976
|
function updateDropBorder(element) {
|
|
975
977
|
if (!element || !element.classList.contains('drop-element'))
|
|
@@ -1361,7 +1363,7 @@ function enableReorderDrag(element) {
|
|
|
1361
1363
|
isClicked = false;
|
|
1362
1364
|
event.preventDefault();
|
|
1363
1365
|
const containerRect = container.getBoundingClientRect();
|
|
1364
|
-
const containerScale =
|
|
1366
|
+
const containerScale = calculateScale();
|
|
1365
1367
|
const newLeft = (point.clientX - containerRect.left - offsetXInElement) / containerScale;
|
|
1366
1368
|
const newTop = (point.clientY - containerRect.top - offsetYInElement) / containerScale;
|
|
1367
1369
|
element.style.left = `${newLeft}px`;
|
|
@@ -1428,9 +1430,7 @@ function enableReorderDrag(element) {
|
|
|
1428
1430
|
else {
|
|
1429
1431
|
if (element.parentElement['type'] !== 'category') {
|
|
1430
1432
|
executeActions('this.alignMatch=true', divEl, element);
|
|
1431
|
-
|
|
1432
|
-
divEl.replaceWith(element);
|
|
1433
|
-
}, 500);
|
|
1433
|
+
divEl.replaceWith(element);
|
|
1434
1434
|
}
|
|
1435
1435
|
else {
|
|
1436
1436
|
const categoryElement = element.parentElement;
|
|
@@ -1906,9 +1906,6 @@ function slidingWithScaling(element) {
|
|
|
1906
1906
|
element.style.transform = 'translate(0, 0)'; // Initialize transform for consistent dragging
|
|
1907
1907
|
element.addEventListener('mousedown', onStart);
|
|
1908
1908
|
element.addEventListener('touchstart', onStart);
|
|
1909
|
-
element.addEventListener('click', ev => {
|
|
1910
|
-
onClickDropOrDragElement(element, 'drag');
|
|
1911
|
-
});
|
|
1912
1909
|
}
|
|
1913
1910
|
const slideCompleted = (slideElement) => {
|
|
1914
1911
|
var _a;
|
|
@@ -1924,8 +1921,13 @@ const slideCompleted = (slideElement) => {
|
|
|
1924
1921
|
const objectiveArray = objectiveString.split(',');
|
|
1925
1922
|
const elementIndex = slideArr.indexOf(slideElement['value']);
|
|
1926
1923
|
const isCorrect = matchStringPattern(slideElement['value'], [objectiveArray[elementIndex].trim()]);
|
|
1927
|
-
|
|
1928
|
-
|
|
1924
|
+
if (container.getAttribute('is-continue-on-correct') === 'true') {
|
|
1925
|
+
storingEachActivityScore(true);
|
|
1926
|
+
handleShowCheck();
|
|
1927
|
+
}
|
|
1928
|
+
else {
|
|
1929
|
+
storingEachActivityScore(isCorrect);
|
|
1930
|
+
}
|
|
1929
1931
|
};
|
|
1930
1932
|
|
|
1931
1933
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -3210,7 +3212,10 @@ function addClickListenerForClickType(element) {
|
|
|
3210
3212
|
dispatchClickEvent(element, isCorrect);
|
|
3211
3213
|
if (isCorrect) {
|
|
3212
3214
|
const onCorrect = element.getAttribute('onCorrect');
|
|
3213
|
-
|
|
3215
|
+
if (!(element.id && element.id.startsWith('key-button'))) {
|
|
3216
|
+
element.style.pointerEvents = 'none';
|
|
3217
|
+
}
|
|
3218
|
+
document.body.style.pointerEvents = 'none';
|
|
3214
3219
|
await executeActions(onCorrect, element);
|
|
3215
3220
|
}
|
|
3216
3221
|
else {
|
|
@@ -3267,6 +3272,7 @@ function addClickListenerForClickType(element) {
|
|
|
3267
3272
|
container.setAttribute(SelectedValuesKey, JSON.stringify(sortedValues));
|
|
3268
3273
|
const isCorrect = objective.includes(element['value']);
|
|
3269
3274
|
dispatchClickEvent(element, isCorrect);
|
|
3275
|
+
AudioPlayer.getI().stop();
|
|
3270
3276
|
if (isCorrect) {
|
|
3271
3277
|
const onCorrect = element.getAttribute('onCorrect');
|
|
3272
3278
|
await executeActions(onCorrect, element);
|
|
@@ -68580,6 +68586,7 @@ const initEventsForElement = async (element, type) => {
|
|
|
68580
68586
|
const executeActions = async (actionsString, thisElement, element) => {
|
|
68581
68587
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
68582
68588
|
const actions = parseActions(actionsString);
|
|
68589
|
+
body.style.pointerEvents = 'none';
|
|
68583
68590
|
for (let i = 0; i < actions.length; i++) {
|
|
68584
68591
|
const action = actions[i];
|
|
68585
68592
|
const queriedElement = document.querySelector(action.actor);
|
|
@@ -68610,7 +68617,7 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
68610
68617
|
const container = document.getElementById(LidoContainer);
|
|
68611
68618
|
const containerScale = getElementScale$1(container);
|
|
68612
68619
|
dragElement.style.transform = 'translate(0,0)';
|
|
68613
|
-
console.log(
|
|
68620
|
+
console.log('logg alinmatch');
|
|
68614
68621
|
const dropRect = dropElement.getBoundingClientRect();
|
|
68615
68622
|
const dragRect = dragElement.getBoundingClientRect();
|
|
68616
68623
|
const dropCenterX = dropRect.left + dropRect.width / 2;
|
|
@@ -68664,7 +68671,7 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
68664
68671
|
if (container.getAttribute('is-continue-on-correct') !== 'true') {
|
|
68665
68672
|
targetElement.style.pointerEvents = 'none';
|
|
68666
68673
|
}
|
|
68667
|
-
validateObjectiveStatus();
|
|
68674
|
+
await validateObjectiveStatus();
|
|
68668
68675
|
break;
|
|
68669
68676
|
}
|
|
68670
68677
|
case 'prevBtn': {
|
|
@@ -68774,8 +68781,53 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
68774
68781
|
}
|
|
68775
68782
|
break;
|
|
68776
68783
|
}
|
|
68777
|
-
case '
|
|
68778
|
-
|
|
68784
|
+
case 'disableType': {
|
|
68785
|
+
const dragEle = document.querySelector('[type="drag"]');
|
|
68786
|
+
dragEle.removeAttribute('type');
|
|
68787
|
+
dragEle.style.pointerEvents = 'none';
|
|
68788
|
+
break;
|
|
68789
|
+
}
|
|
68790
|
+
case 'updateCountBlender': {
|
|
68791
|
+
const allDrags = document.querySelectorAll('[type="drag"]');
|
|
68792
|
+
let units = 0;
|
|
68793
|
+
let tens = 0;
|
|
68794
|
+
let hundreds = 0;
|
|
68795
|
+
allDrags.forEach(el => {
|
|
68796
|
+
const dropTo = el.getAttribute("drop-to");
|
|
68797
|
+
if (dropTo === "unitsDrop")
|
|
68798
|
+
units++;
|
|
68799
|
+
if (dropTo === "tensDrop")
|
|
68800
|
+
tens++;
|
|
68801
|
+
if (dropTo === "hundredsDrop")
|
|
68802
|
+
hundreds++;
|
|
68803
|
+
});
|
|
68804
|
+
const unitsValue = units * 1;
|
|
68805
|
+
const tensValue = tens * 10;
|
|
68806
|
+
const hundredsValue = hundreds * 100;
|
|
68807
|
+
const totalValue = unitsValue + tensValue + hundredsValue;
|
|
68808
|
+
// ✅ Update Lido Text Boxes
|
|
68809
|
+
const unitsBox = document.getElementById("units");
|
|
68810
|
+
const tensBox = document.getElementById("tens");
|
|
68811
|
+
const hundredsBox = document.getElementById("hundreds");
|
|
68812
|
+
if (unitsBox) {
|
|
68813
|
+
unitsBox.setAttribute("string", unitsValue.toString());
|
|
68814
|
+
}
|
|
68815
|
+
if (tensBox) {
|
|
68816
|
+
tensBox.setAttribute("string", tensValue.toString());
|
|
68817
|
+
}
|
|
68818
|
+
if (hundredsBox) {
|
|
68819
|
+
hundredsBox.setAttribute("string", hundredsValue.toString());
|
|
68820
|
+
}
|
|
68821
|
+
console.log(`Units = ${units} → ${unitsValue}`);
|
|
68822
|
+
console.log(`Tens = ${tens} → ${tensValue}`);
|
|
68823
|
+
console.log(`Hundreds = ${hundreds} → ${hundredsValue}`);
|
|
68824
|
+
console.log(`✅ Total Value = ${totalValue}`);
|
|
68825
|
+
break;
|
|
68826
|
+
}
|
|
68827
|
+
case 'updateCalculatorAnswer': {
|
|
68828
|
+
if (targetElement) {
|
|
68829
|
+
updateCalculatorAnswer(targetElement);
|
|
68830
|
+
}
|
|
68779
68831
|
break;
|
|
68780
68832
|
}
|
|
68781
68833
|
default: {
|
|
@@ -68785,6 +68837,7 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
68785
68837
|
}
|
|
68786
68838
|
}
|
|
68787
68839
|
}
|
|
68840
|
+
body.style.pointerEvents = 'auto';
|
|
68788
68841
|
};
|
|
68789
68842
|
const afterDropDragHandling = (dragElement, dropElement) => {
|
|
68790
68843
|
const container = document.getElementById(LidoContainer);
|
|
@@ -68794,6 +68847,7 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
68794
68847
|
const isInfinite = container.getAttribute('drop-action') === exports.DropAction.InfiniteDrop;
|
|
68795
68848
|
if (isAppend || isInfinite) {
|
|
68796
68849
|
setTimeout(() => {
|
|
68850
|
+
var _a, _b;
|
|
68797
68851
|
dragElement.style.transform = 'translate(0,0)';
|
|
68798
68852
|
dragElement.style.transition = '';
|
|
68799
68853
|
let dummyElement = document.createElement('div');
|
|
@@ -68827,6 +68881,14 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
68827
68881
|
dummyElement.style.margin = '0px';
|
|
68828
68882
|
});
|
|
68829
68883
|
}
|
|
68884
|
+
const orientation = window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
|
|
68885
|
+
const rowAttr = dropElement.getAttribute('dropAttr');
|
|
68886
|
+
const dropAttr = parseProp(rowAttr, orientation); // will return stackcascade or verticalstack
|
|
68887
|
+
if (((_a = (dropAttr)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "stackcascade" || ((_b = (dropAttr)) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === "verticalstack") {
|
|
68888
|
+
dropElement.append(dragElement);
|
|
68889
|
+
placeElementInDropZone(dropElement, dragElement, orientation, dropAttr);
|
|
68890
|
+
return;
|
|
68891
|
+
}
|
|
68830
68892
|
dropElement.parentElement.append(element);
|
|
68831
68893
|
dragElement.style.position = 'absolute';
|
|
68832
68894
|
dragElement.style.zIndex = '1';
|
|
@@ -68839,16 +68901,41 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
68839
68901
|
const scaledLeft = (dropCenterX - dragCenterX) / containerScale;
|
|
68840
68902
|
const scaledTop = (dropCenterY - dragCenterY) / containerScale;
|
|
68841
68903
|
dragElement.style.transform = `translate(${scaledLeft}px, ${scaledTop}px)`;
|
|
68842
|
-
},
|
|
68904
|
+
}, 100);
|
|
68843
68905
|
}
|
|
68844
68906
|
};
|
|
68907
|
+
// function cloneElementWithComputedStyles(originalEl: HTMLElement): HTMLElement {
|
|
68908
|
+
// let clone = document.createElement('div') as HTMLElement;
|
|
68909
|
+
// clone.innerHTML = originalEl.outerHTML;
|
|
68910
|
+
// clone = clone.firstChild as HTMLElement;
|
|
68911
|
+
// clone.setAttribute('height', originalEl.style.height);
|
|
68912
|
+
// clone.setAttribute('width', originalEl.style.width);
|
|
68913
|
+
// clone.setAttribute('visible', 'true');
|
|
68914
|
+
// return clone;
|
|
68915
|
+
// }
|
|
68845
68916
|
function cloneElementWithComputedStyles(originalEl) {
|
|
68846
|
-
|
|
68847
|
-
|
|
68848
|
-
|
|
68849
|
-
|
|
68850
|
-
|
|
68851
|
-
|
|
68917
|
+
const tag = originalEl.tagName.toLowerCase();
|
|
68918
|
+
if (tag === "lido-text") {
|
|
68919
|
+
let clone = document.createElement('div');
|
|
68920
|
+
clone.innerHTML = originalEl.outerHTML;
|
|
68921
|
+
clone = clone.firstChild;
|
|
68922
|
+
clone.setAttribute('height', originalEl.style.height);
|
|
68923
|
+
clone.setAttribute('width', originalEl.style.width);
|
|
68924
|
+
clone.setAttribute('visible', 'true');
|
|
68925
|
+
return clone;
|
|
68926
|
+
}
|
|
68927
|
+
// ✅ For ALL other types (INCLUDING lido-image & matrix) use your simple logic
|
|
68928
|
+
const clone = originalEl.cloneNode(false);
|
|
68929
|
+
clone.style.width = originalEl.style.width;
|
|
68930
|
+
clone.style.height = originalEl.style.height;
|
|
68931
|
+
clone.style.margin = originalEl.style.margin;
|
|
68932
|
+
clone.style.opacity = originalEl.style.opacity;
|
|
68933
|
+
clone.style.transform = originalEl.style.transform;
|
|
68934
|
+
clone.setAttribute("visible", "true");
|
|
68935
|
+
clone.setAttribute("data-dummy", "true");
|
|
68936
|
+
if (tag === "lido-math-matrix") {
|
|
68937
|
+
clone.setAttribute('clickable', "false");
|
|
68938
|
+
}
|
|
68852
68939
|
return clone;
|
|
68853
68940
|
}
|
|
68854
68941
|
// Function to parse actions string
|
|
@@ -69067,6 +69154,7 @@ const handleShowCheck = () => {
|
|
|
69067
69154
|
validateObjectiveStatus();
|
|
69068
69155
|
}
|
|
69069
69156
|
};
|
|
69157
|
+
const body = document.body;
|
|
69070
69158
|
let res;
|
|
69071
69159
|
const validateObjectiveStatus = async () => {
|
|
69072
69160
|
var _a, _b;
|
|
@@ -69131,6 +69219,7 @@ const validateObjectiveStatus = async () => {
|
|
|
69131
69219
|
if (!isContinueOnCorrect) {
|
|
69132
69220
|
triggerNextContainer();
|
|
69133
69221
|
await calculateScore();
|
|
69222
|
+
triggerNextContainer();
|
|
69134
69223
|
}
|
|
69135
69224
|
else {
|
|
69136
69225
|
const onInCorrect = container.getAttribute('onInCorrect');
|
|
@@ -69153,16 +69242,16 @@ const triggerPrevcontainer = () => {
|
|
|
69153
69242
|
function convertUrlToRelative(url) {
|
|
69154
69243
|
const container = document.getElementById(LidoContainer);
|
|
69155
69244
|
const baseUrl = container.getAttribute('baseUrl');
|
|
69156
|
-
if ((url === null || url === void 0 ? void 0 : url.startsWith('http')) || (url === null || url === void 0 ? void 0 : url.startsWith('blob'))) {
|
|
69245
|
+
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'))) {
|
|
69157
69246
|
return url;
|
|
69158
69247
|
}
|
|
69159
|
-
|
|
69160
|
-
const newUrl =
|
|
69161
|
-
|
|
69162
|
-
|
|
69163
|
-
|
|
69164
|
-
return index$1.getAssetPath(url);
|
|
69248
|
+
if (baseUrl) {
|
|
69249
|
+
const newUrl = url.startsWith('/') ? url.slice(1) : url;
|
|
69250
|
+
if (newUrl.startsWith(baseUrl.replace(/^\/+|\/+$/g, '')))
|
|
69251
|
+
return newUrl;
|
|
69252
|
+
return baseUrl.endsWith('/') ? baseUrl + newUrl : `${baseUrl}/${newUrl}`;
|
|
69165
69253
|
}
|
|
69254
|
+
return index$1.getAssetPath(url);
|
|
69166
69255
|
}
|
|
69167
69256
|
/**
|
|
69168
69257
|
* Asynchronously speaks the given text using the browser's text-to-speech API.
|
|
@@ -69634,9 +69723,6 @@ const SumTogetherAnimation = async (element, value) => {
|
|
|
69634
69723
|
return;
|
|
69635
69724
|
if (!value)
|
|
69636
69725
|
return;
|
|
69637
|
-
const container = document.getElementById(LidoContainer);
|
|
69638
|
-
if (!container)
|
|
69639
|
-
return;
|
|
69640
69726
|
// Expecting structure: [_, TopRow, questionRow, optionRow, ...]
|
|
69641
69727
|
const TopRow = Array.from(element.children)[1];
|
|
69642
69728
|
const questionRow = Array.from(element.children)[2];
|
|
@@ -69731,16 +69817,64 @@ const SumTogetherAnimation = async (element, value) => {
|
|
|
69731
69817
|
elementAppearance(false);
|
|
69732
69818
|
}
|
|
69733
69819
|
};
|
|
69734
|
-
|
|
69820
|
+
function placeElementInDropZone(dropElement, dragElement, orientation, dropAttr) {
|
|
69821
|
+
const dropRect = dropElement.getBoundingClientRect();
|
|
69822
|
+
const dragRect = dragElement.getBoundingClientRect();
|
|
69823
|
+
const scale = typeof calculateScale === "function" ? calculateScale() : 1;
|
|
69824
|
+
if (!dropElement.dataset.dropCount)
|
|
69825
|
+
dropElement.dataset.dropCount = "0";
|
|
69826
|
+
let dropCount = parseInt(dropElement.dataset.dropCount, 10);
|
|
69827
|
+
// === READ DROP ZONE SIZE ===
|
|
69828
|
+
const dropWidth = dropRect.width;
|
|
69829
|
+
const dropHeight = dropRect.height;
|
|
69830
|
+
let targetX, targetY;
|
|
69831
|
+
// ---------------- LANDSCAPE WATERFALL ----------------
|
|
69832
|
+
if (orientation === "landscape" && dropAttr.toLowerCase() === "stackcascade") {
|
|
69833
|
+
console.log("🌄 Landscape waterfall");
|
|
69834
|
+
const shiftX = dropWidth * 0.02; // proportional (5% of width)
|
|
69835
|
+
const shiftY = dropHeight * 0.02; // proportional (5% of height)
|
|
69836
|
+
const startX = dropRect.left + dropWidth * 0.36; // 10% inside
|
|
69837
|
+
const startY = dropRect.top + dropHeight * -0.09; // slightly above
|
|
69838
|
+
targetX = startX + (dropCount * shiftX);
|
|
69839
|
+
targetY = startY + (dropCount * shiftY);
|
|
69840
|
+
}
|
|
69841
|
+
// ---------------- PORTRAIT VERTICAL ----------------
|
|
69842
|
+
else {
|
|
69843
|
+
console.log("📱 Portrait vertical stack");
|
|
69844
|
+
let startX;
|
|
69845
|
+
const stepY = dropHeight * 0.05; // 8% vertical step
|
|
69846
|
+
if (dropElement.id === "unitsDrop") {
|
|
69847
|
+
startX = dropRect.left + dropWidth * 0.4; // special spacing
|
|
69848
|
+
}
|
|
69849
|
+
else if (dropElement.id === "tensDrop") {
|
|
69850
|
+
startX = dropRect.left + dropWidth * 0.25;
|
|
69851
|
+
}
|
|
69852
|
+
else {
|
|
69853
|
+
startX = dropRect.left + dropWidth * 0.16; // normal spacing
|
|
69854
|
+
}
|
|
69855
|
+
const startY = dropRect.top - dropHeight * 0.25; // above start
|
|
69856
|
+
targetX = startX;
|
|
69857
|
+
targetY = startY + (dropCount * stepY);
|
|
69858
|
+
}
|
|
69859
|
+
// ------------ APPLY TRANSFORM SMOOTHLY --------------
|
|
69860
|
+
const dx = (targetX - dragRect.left) / scale;
|
|
69861
|
+
const dy = (targetY - dragRect.top) / scale;
|
|
69862
|
+
dragElement.style.transition = "transform .2s ease-out";
|
|
69863
|
+
dragElement.style.transform = `translate(${dx}px, ${dy}px)`;
|
|
69864
|
+
dropElement.dataset.dropCount = String(dropCount + 1);
|
|
69865
|
+
// reset size
|
|
69866
|
+
dragElement.style.width = "auto";
|
|
69867
|
+
dragElement.style.height = "auto";
|
|
69868
|
+
}
|
|
69869
|
+
const updateCalculatorAnswer = (el) => {
|
|
69735
69870
|
const container = document.getElementById(LidoContainer);
|
|
69736
69871
|
if (!container)
|
|
69737
69872
|
return;
|
|
69738
|
-
const
|
|
69739
|
-
if (!
|
|
69873
|
+
const calci = document.querySelector('#lidoCalculator');
|
|
69874
|
+
if (!calci)
|
|
69740
69875
|
return;
|
|
69741
|
-
const
|
|
69742
|
-
|
|
69743
|
-
answerText.setAttribute('string', String(calculatedValue));
|
|
69876
|
+
const value = calci.getAttribute('value');
|
|
69877
|
+
el.setAttribute('string', value);
|
|
69744
69878
|
};
|
|
69745
69879
|
|
|
69746
69880
|
exports.ActivityScoreKey = ActivityScoreKey;
|
|
@@ -69770,6 +69904,7 @@ exports.handleElementClick = handleElementClick;
|
|
|
69770
69904
|
exports.handleFloatElementPosition = handleFloatElementPosition;
|
|
69771
69905
|
exports.handlingChildElements = handlingChildElements;
|
|
69772
69906
|
exports.initEventsForElement = initEventsForElement;
|
|
69907
|
+
exports.matchStringPattern = matchStringPattern;
|
|
69773
69908
|
exports.nextUrl = nextUrl;
|
|
69774
69909
|
exports.parseProp = parseProp;
|
|
69775
69910
|
exports.prevUrl = prevUrl;
|
|
@@ -78,7 +78,7 @@ export class LidoAvatar {
|
|
|
78
78
|
display: this.visible ? 'flex' : 'none',
|
|
79
79
|
zIndex: this.z,
|
|
80
80
|
};
|
|
81
|
-
return (h(Host, { key: '
|
|
81
|
+
return (h(Host, { key: '8a31ce98213ff51bf7cfc776690b6770bbeae604', id: this.id, type: this.type, "tab-index": this.tabIndex, value: this.value, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, h("canvas", { key: '922568310a3be177e3185f86c54df95d16a0e42b', class: "lido-canvas" })));
|
|
82
82
|
}
|
|
83
83
|
static get is() { return "lido-avatar"; }
|
|
84
84
|
static get originalStyleUrls() {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
align-items: center;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.lido-
|
|
7
|
+
.lido-canvas {
|
|
8
8
|
|
|
9
9
|
background:red;
|
|
10
10
|
border: 2px solid #ccc;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
position: relative;
|
|
16
16
|
}
|
|
17
|
-
button {
|
|
17
|
+
#lido-exit-button {
|
|
18
18
|
padding: 6px 14px;
|
|
19
19
|
border: none;
|
|
20
20
|
background:transparent;
|
|
@@ -23,14 +23,11 @@ button {
|
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
font-size: 14px;
|
|
25
25
|
position: relative;
|
|
26
|
-
top: -
|
|
27
|
-
left:
|
|
26
|
+
top: -43%;
|
|
27
|
+
left: 18%;
|
|
28
28
|
z-index: 10;
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
height:50px;
|
|
32
|
-
width: 60px;
|
|
33
|
-
}
|
|
30
|
+
|
|
34
31
|
canvas {
|
|
35
32
|
/* flex: 1; */
|
|
36
33
|
touch-action: none;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { parseProp } from "../../utils/utils";
|
|
3
|
-
export class
|
|
3
|
+
export class LidoCanvas {
|
|
4
4
|
constructor() {
|
|
5
5
|
// Flag to track drawing state
|
|
6
6
|
this.drawing = false;
|
|
@@ -86,7 +86,7 @@ export class WritingPad {
|
|
|
86
86
|
this.loadBackground();
|
|
87
87
|
}
|
|
88
88
|
render() {
|
|
89
|
-
return (h(Host, { key: '
|
|
89
|
+
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, } })));
|
|
90
90
|
}
|
|
91
91
|
static get is() { return "lido-canvas"; }
|
|
92
92
|
static get encapsulation() { return "shadow"; }
|