lido-player 0.0.2-beta-11 → 0.0.2-beta-13
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/{decode-COuOLWQt.js → decode-BunxKYHJ.js} +1 -1
- package/dist/cjs/{index-CPFtlL1n.js → index-1rmY-0pT.js} +15 -9
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lido-avatar_22.cjs.entry.js +17 -15
- package/dist/collection/components/calculator/lido-calculator.js +4 -4
- package/dist/collection/components/container/lido-container.js +6 -4
- package/dist/collection/components/home/lido-home.js +1 -1
- package/dist/collection/components/keyboard/lido-keyboard.js +3 -3
- package/dist/collection/components/trace/lido-trace.js +2 -2
- package/dist/collection/utils/customEvents.js +2 -0
- package/dist/collection/utils/utils.js +9 -5
- package/dist/collection/utils/utilsHandlers/animationHandler.js +3 -3
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +2 -2
- package/dist/collection/utils/utilsHandlers/floatHandler.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/lido-calculator.js +1 -1
- package/dist/components/lido-container.js +1 -1
- package/dist/components/lido-home.js +1 -1
- package/dist/components/lido-keyboard.js +1 -1
- package/dist/components/lido-root.js +1 -1
- package/dist/components/lido-trace.js +1 -1
- package/dist/components/p-B8USa8EO.js +1 -0
- package/dist/components/p-BP79Al--.js +1 -0
- package/dist/components/{p-qqHD4Pch.js → p-DH6lvh19.js} +1 -1
- package/dist/components/{p-VuF4lAdR.js → p-DYs8s-uh.js} +1 -1
- package/dist/components/{p-B712HxGz.js → p-D_Q6Oy7S.js} +2 -2
- package/dist/esm/{decode-Bs8H_aLp.js → decode-BbicjSTs.js} +1 -1
- package/dist/esm/{index-CS2I2YZa.js → index-CpcvWGPL.js} +15 -9
- package/dist/esm/index.js +1 -1
- package/dist/esm/lido-avatar_22.entry.js +17 -15
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-B1uwYUL1.js +1 -0
- package/dist/lido-player/{p-DvcZcwfC.js → p-CuR9-3Sm.js} +1 -1
- package/dist/lido-player/{p-973e6ce9.entry.js → p-db425c95.entry.js} +2 -2
- package/package.json +1 -1
- package/dist/components/p-Cj0WIIDb.js +0 -1
- package/dist/components/p-oO4WyqLq.js +0 -1
- package/dist/lido-player/p-DxLnBaAa.js +0 -1
|
@@ -140,6 +140,7 @@ function toSerializableDetail(detail) {
|
|
|
140
140
|
function dispatchActivityEndEvent(totalIndex, currentIndex, score, rightMoves, wrongMoves, timeSpentForActivity, lessonTrackingParams, gameCompleted) {
|
|
141
141
|
dispatchCustomEvent(ActivityEndKey, Object.assign(Object.assign({ currentIndex, totalIndex, score, rightMoves, wrongMoves, timeSpentForActivity }, lessonTrackingParams), { gameCompleted }));
|
|
142
142
|
dispatchCustomEvent(MicroProblemEndKey, Object.assign(Object.assign({ currentIndex, totalIndex, score, rightMoves, wrongMoves, timeSpentForActivity }, lessonTrackingParams), { gameCompleted }));
|
|
143
|
+
console.log(`[Activity End]Activity ${currentIndex + 1}/${totalIndex} - Time Spent: ${timeSpentForActivity}`);
|
|
143
144
|
}
|
|
144
145
|
function dispatchLessonEndEvent(totalIndex, rightMoves, wrongMoves, finalScore, timeSpendForLesson, lessonTrackingParams) {
|
|
145
146
|
dispatchCustomEvent(MicroLessonEndKey, Object.assign({ totalIndex, rightMoves, wrongMoves, finalScore, score: finalScore, timeSpendForLesson }, lessonTrackingParams));
|
|
@@ -147,6 +148,7 @@ function dispatchLessonEndEvent(totalIndex, rightMoves, wrongMoves, finalScore,
|
|
|
147
148
|
return;
|
|
148
149
|
}
|
|
149
150
|
dispatchCustomEvent(LessonEndKey, Object.assign({ totalIndex, rightMoves, wrongMoves, finalScore, score: finalScore, timeSpendForLesson }, lessonTrackingParams));
|
|
151
|
+
console.log(`[Lesson End] Lesson: ${lessonTrackingParams === null || lessonTrackingParams === void 0 ? void 0 : lessonTrackingParams.lessonName} (${lessonTrackingParams === null || lessonTrackingParams === void 0 ? void 0 : lessonTrackingParams.lessonId}) - Total Time Spent: ${timeSpendForLesson}`);
|
|
150
152
|
}
|
|
151
153
|
function dispatchNextContainerEvent() {
|
|
152
154
|
dispatchCustomEvent(NextContainerKey, {});
|
|
@@ -305,8 +307,8 @@ function dragDropAnimation(container, dragElement, dropElement) {
|
|
|
305
307
|
// isCorrect=true;
|
|
306
308
|
const onCorrect = (container === null || container === void 0 ? void 0 : container.getAttribute('onCorrect')) || '';
|
|
307
309
|
await executeActions(onCorrect, container);
|
|
308
|
-
window.dispatchEvent(new CustomEvent(NextContainerKey));
|
|
309
310
|
calculateScore();
|
|
311
|
+
triggerNextContainer();
|
|
310
312
|
tempVanishedValues.length = 0;
|
|
311
313
|
})();
|
|
312
314
|
}
|
|
@@ -1242,8 +1244,8 @@ const appendingDragElementsInDrop = () => {
|
|
|
1242
1244
|
if (isAllowOnlyCorrect === true) {
|
|
1243
1245
|
if (drop['value'] === drag['value']) {
|
|
1244
1246
|
drag.style.transform = 'translate(0,0)';
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
+
drag.style.width = "stretch";
|
|
1248
|
+
drag.style.padding = '0';
|
|
1247
1249
|
drop.appendChild(drag);
|
|
1248
1250
|
appendedDragIds.add(drag.id);
|
|
1249
1251
|
drag.style.pointerEvents = 'none';
|
|
@@ -71759,8 +71761,8 @@ async function handleElementClick(element) {
|
|
|
71759
71761
|
container.style.pointerEvents = 'none';
|
|
71760
71762
|
if (!container.getAttribute('game-completed') || container.getAttribute('game-completed') === 'false' || container.getAttribute('game-completed') === null || container.getAttribute('game-completed') === undefined || container.getAttribute('game-completed') === '') {
|
|
71761
71763
|
container.setAttribute('game-completed', 'true');
|
|
71762
|
-
triggerNextContainer();
|
|
71763
71764
|
calculateScore();
|
|
71765
|
+
triggerNextContainer();
|
|
71764
71766
|
}
|
|
71765
71767
|
}
|
|
71766
71768
|
else {
|
|
@@ -73055,11 +73057,12 @@ const storeActivityScore = (score) => {
|
|
|
73055
73057
|
const activityScoreKey = index.toString();
|
|
73056
73058
|
activityScore[activityScoreKey] = score;
|
|
73057
73059
|
//send Custom Event to parent
|
|
73058
|
-
// window.dispatchEvent(new CustomEvent(ActivityEndKey, { detail: { index: index, totalIndex: totalIndex, score: score } }));
|
|
73059
|
-
const
|
|
73060
|
-
ACTIVYTY_TIME_SPEND_ARRAY.push(
|
|
73060
|
+
// window.dispatchEvent(new CustomEvent(ActivityEndKey, { detail: { index: index, totalIndex: totalIndex, score: score } }));
|
|
73061
|
+
const actualActivitySeconds = Math.ceil(Timer.getI().getElapsed() / 1000);
|
|
73062
|
+
ACTIVYTY_TIME_SPEND_ARRAY.push(actualActivitySeconds);
|
|
73063
|
+
console.log(`[Utils][Activity Time] Activity ${index + 1}/${totalIndex} - Time spent: ${actualActivitySeconds}s`);
|
|
73061
73064
|
const lessonTrackingParams = getLessonTrackingParams();
|
|
73062
|
-
dispatchActivityEndEvent(totalIndex, index, score, gameScore.rightMoves, gameScore.wrongMoves,
|
|
73065
|
+
dispatchActivityEndEvent(totalIndex, index, score, gameScore.rightMoves, gameScore.wrongMoves, actualActivitySeconds, lessonTrackingParams, true);
|
|
73063
73066
|
localStorage.setItem(ActivityScoreKey, JSON.stringify(activityScore));
|
|
73064
73067
|
if (totalIndex - 1 == index) {
|
|
73065
73068
|
const scoresArray = Object.values(activityScore);
|
|
@@ -73068,11 +73071,13 @@ const storeActivityScore = (score) => {
|
|
|
73068
73071
|
console.log('Total Score : ', gameScore.finalScore);
|
|
73069
73072
|
// window.dispatchEvent(new CustomEvent(LessonEndKey, { detail: { score: finalScore } }));
|
|
73070
73073
|
const timeSpendForLesson = ACTIVYTY_TIME_SPEND_ARRAY.reduce((sum, current) => sum + current, 0);
|
|
73074
|
+
console.log(`[Utils][Lesson Time] Total lesson time spent: ${timeSpendForLesson}s`);
|
|
73071
73075
|
dispatchLessonEndEvent(totalIndex, gameScore.totalRightMovesCount, gameScore.totalWrongMovesCount, finalScore, timeSpendForLesson, lessonTrackingParams);
|
|
73072
73076
|
gameScore.totalRightMovesCount = 0;
|
|
73073
73077
|
gameScore.totalWrongMovesCount = 0;
|
|
73074
73078
|
dispatchGameCompletedEvent();
|
|
73075
73079
|
localStorage.removeItem(ActivityScoreKey);
|
|
73080
|
+
ACTIVYTY_TIME_SPEND_ARRAY.length = 0;
|
|
73076
73081
|
}
|
|
73077
73082
|
};
|
|
73078
73083
|
const handleShowCheck = () => {
|
|
@@ -73117,6 +73122,7 @@ const validateObjectiveStatus = async () => {
|
|
|
73117
73122
|
}
|
|
73118
73123
|
storingEachActivityScore(true);
|
|
73119
73124
|
storeActivityScore(100);
|
|
73125
|
+
gameScore.totalRightMovesCount++;
|
|
73120
73126
|
gameScore.rightMoves = 0;
|
|
73121
73127
|
gameScore.wrongMoves = 0;
|
|
73122
73128
|
triggerNextContainer();
|
|
@@ -73173,8 +73179,8 @@ const validateObjectiveStatus = async () => {
|
|
|
73173
73179
|
}
|
|
73174
73180
|
if (!isContinueOnCorrect) {
|
|
73175
73181
|
container.setAttribute("game-completed", "true");
|
|
73176
|
-
calculateScore();
|
|
73177
73182
|
await executeActions(onCorrect, container);
|
|
73183
|
+
calculateScore();
|
|
73178
73184
|
triggerNextContainer();
|
|
73179
73185
|
}
|
|
73180
73186
|
else {
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dy19zuTX.js');
|
|
4
|
-
var index$1 = require('./index-
|
|
4
|
+
var index$1 = require('./index-1rmY-0pT.js');
|
|
5
5
|
|
|
6
6
|
var rive$1 = {exports: {}};
|
|
7
7
|
|
|
@@ -8539,7 +8539,7 @@ const LidoCalculator = class {
|
|
|
8539
8539
|
if (!hasScrollAction) {
|
|
8540
8540
|
if (!isMultiObjective) {
|
|
8541
8541
|
index$1.calculateScore();
|
|
8542
|
-
|
|
8542
|
+
index$1.triggerNextContainer();
|
|
8543
8543
|
}
|
|
8544
8544
|
else {
|
|
8545
8545
|
const objectives = this.objective.split(',').map(obj => obj.trim());
|
|
@@ -8547,7 +8547,7 @@ const LidoCalculator = class {
|
|
|
8547
8547
|
if (allSolved) {
|
|
8548
8548
|
container.setAttribute("game-completed", "true");
|
|
8549
8549
|
index$1.calculateScore();
|
|
8550
|
-
|
|
8550
|
+
index$1.triggerNextContainer();
|
|
8551
8551
|
}
|
|
8552
8552
|
}
|
|
8553
8553
|
}
|
|
@@ -8575,7 +8575,7 @@ const LidoCalculator = class {
|
|
|
8575
8575
|
}
|
|
8576
8576
|
render() {
|
|
8577
8577
|
const numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '←', '0', 'OK'];
|
|
8578
|
-
return (index.h(index.Host, { key: '
|
|
8578
|
+
return (index.h(index.Host, { key: '63cfc3e353a89b76ad809a921cc7b51ce6d06e93', onEntry: this.onEntry, id: "lidoCalculator", style: { width: this.width, height: this.height, backgroundColor: this.bgColor, left: this.x, top: this.y } }, index.h("lido-cell", { key: '66cc572079209533f8fd4f6c4ca76fdb9435b3b8', visible: "true", height: "94px", width: "60px" }, index.h("lido-text", { key: 'aca3392da8c74ab136268296f2ff584bf5cacd61', visible: "true", id: "lido-calculator-penIcon", type: "click", height: "80px", x: "204%", width: "89px", onEntry: "this.position='relative';", class: "top-icon" }, index.h("img", { key: '46275d788f7bb3132e657d4902d4471cc7928b39', src: index$1.convertUrlToRelative(this.penIcon), alt: "pen", style: { width: '100%', height: '100%' } }))), index.h("div", { key: '5adb6fbdefa7d9d8c4bd2ada68f580c8c1af298e', class: "lido-calculator-displayParent" }, index.h("div", { key: 'cca5a9c232f9d4dfa31e193e8d9eaddcd83a5052', class: "lido-calculator-display" }, this.displayValue)), index.h("div", { key: '64b70b100e8165dfe6d0dd9522b0362f12856a9e', class: "lido-calculator-buttons" }, numbers.map((num, i) => (index.h("lido-text", { id: `btn-${i}`, string: num, visible: "true", type: "click", class: {
|
|
8579
8579
|
'lido-calculator-btn-special': num === '←' || num === 'OK',
|
|
8580
8580
|
'lido-calculator-btn-default': num !== '←' && num !== 'OK'
|
|
8581
8581
|
}, onClick: () => this.handleClick(num) }))))));
|
|
@@ -12301,10 +12301,12 @@ const LidoContainer = class {
|
|
|
12301
12301
|
componentDidLoad() {
|
|
12302
12302
|
this.scaleContainer(this.el);
|
|
12303
12303
|
const backGroundImage = this.bgImage ? index$1.convertUrlToRelative(this.bgImage) : '';
|
|
12304
|
+
const standalone = this.el.closest('lido-standalone');
|
|
12305
|
+
const backgroundTarget = (standalone === null || standalone === void 0 ? void 0 : standalone.getAttribute('bg-image')) === 'true' ? standalone : document.body;
|
|
12306
|
+
backgroundTarget.style.backgroundColor = this.bgColor;
|
|
12307
|
+
backgroundTarget.style.backgroundImage = backGroundImage ? `url(${backGroundImage})` : 'none';
|
|
12308
|
+
backgroundTarget.style.backgroundPosition = backGroundImage ? 'bottom' : 'none';
|
|
12304
12309
|
document.body.style.pointerEvents = 'auto';
|
|
12305
|
-
document.body.style.backgroundColor = this.bgColor;
|
|
12306
|
-
document.body.style.backgroundImage = backGroundImage ? `url(${backGroundImage})` : 'none';
|
|
12307
|
-
document.body.style.backgroundPosition = backGroundImage ? `bottom` : 'none';
|
|
12308
12310
|
// Re-scale the container on window resize or load events
|
|
12309
12311
|
window.addEventListener('resize', this.handleWindowResize);
|
|
12310
12312
|
window.addEventListener('load', this.handleWindowLoad);
|
|
@@ -12350,7 +12352,7 @@ const LidoContainer = class {
|
|
|
12350
12352
|
margin: this.margin,
|
|
12351
12353
|
userSelect: 'none', // Prevent any field selection
|
|
12352
12354
|
};
|
|
12353
|
-
return (index.h(index.Host, { key: '
|
|
12355
|
+
return (index.h(index.Host, { key: '104e6cc49ab78121a9b7e9939e5def1952567a53', id: "lido-container", Lang: this.Lang, "tab-index": 0, class: "lido-container", objective: this.objective, baseUrl: this.baseUrl, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, onTouch: this.onTouch, onInCorrect: this.onInCorrect, onCorrect: this.onCorrect, onEntry: this.onEntry, "show-check": `${this.showCheck}`, "is-continue-on-correct": `${this.isContinueOnCorrect}`, "is-allow-only-correct": `${this.isAllowOnlyCorrect}`, canplay: `${this.canplay}`, appendToDropOnCompletion: `${this.appendToDropOnCompletion}`, "show-prev-button": `${this.showPrevButton}`, "show-next-button": `${this.showNextButton}`, "show-drop-border": `${this.showDropBorder}`, "bg-image": this.bgImage, "exit-button-url": this.exitButtonUrl, "prev-button-url": this.prevButtonUrl, "next-button-url": this.nextButtonUrl, "speaker-button-url": this.speakerButtonUrl, "disable-speak": `${this.disableSpeak}`, "template-id": this.templateId, audio: this.audio, "highlight-word-by-word": `${this.highlightWordByWord}` }, index.h("lido-text", { key: 'ec5e3d78fbf2b8a0cf4b6f918b41c22dc18b2484', visible: "false", id: this.templateId, audio: "", string: this.instructName }), index.h("slot", { key: '384172d5224ae11a20983cda82a3761da456ba2a' })));
|
|
12354
12356
|
}
|
|
12355
12357
|
get el() { return index.getElement(this); }
|
|
12356
12358
|
static get watchers() { return {
|
|
@@ -12827,7 +12829,6 @@ const LidoHome = class {
|
|
|
12827
12829
|
this.exitFlag = false;
|
|
12828
12830
|
if (alertElement) {
|
|
12829
12831
|
if (comment === 'exit') {
|
|
12830
|
-
index$1.dispatchGameExitEvent();
|
|
12831
12832
|
index$1.AudioPlayer.getI().stop();
|
|
12832
12833
|
index$1.Timer.getI().stop();
|
|
12833
12834
|
gameScore.rightMoves = 0;
|
|
@@ -12838,6 +12839,7 @@ const LidoHome = class {
|
|
|
12838
12839
|
// clearmemoryStorage();
|
|
12839
12840
|
alertElement.remove();
|
|
12840
12841
|
this.currentContainerIndex = 0;
|
|
12842
|
+
index$1.dispatchGameExitEvent();
|
|
12841
12843
|
}
|
|
12842
12844
|
else {
|
|
12843
12845
|
alertElement.remove();
|
|
@@ -12950,7 +12952,7 @@ const LidoHome = class {
|
|
|
12950
12952
|
}
|
|
12951
12953
|
// Pure-JS fallback (no wasm asset required)
|
|
12952
12954
|
try {
|
|
12953
|
-
const brotliDecodeModule = await Promise.resolve().then(function () { return require('./decode-
|
|
12955
|
+
const brotliDecodeModule = await Promise.resolve().then(function () { return require('./decode-BunxKYHJ.js'); }).then(function (n) { return n.decode; });
|
|
12954
12956
|
const brotliDecompressBuffer = brotliDecodeModule.BrotliDecompressBuffer || ((_a = brotliDecodeModule.default) === null || _a === void 0 ? void 0 : _a.BrotliDecompressBuffer);
|
|
12955
12957
|
if (typeof brotliDecompressBuffer !== 'function') {
|
|
12956
12958
|
throw new Error('BrotliDecompressBuffer function not found in brotli/dec/decode');
|
|
@@ -16598,10 +16600,10 @@ const LidoKeyboard = class {
|
|
|
16598
16600
|
this.numberOfClick++;
|
|
16599
16601
|
localStorage.removeItem(index$1.SelectedValuesKey);
|
|
16600
16602
|
if (this.numberOfClick === this.letterLength) {
|
|
16601
|
-
index$1.calculateScore();
|
|
16602
16603
|
const onCorrrect = container.getAttribute('onCorrect');
|
|
16603
16604
|
container.style.pointerEvents = 'none';
|
|
16604
16605
|
await index$1.executeActions(onCorrrect, this.el);
|
|
16606
|
+
index$1.calculateScore();
|
|
16605
16607
|
index$1.triggerNextContainer();
|
|
16606
16608
|
}
|
|
16607
16609
|
else {
|
|
@@ -16666,10 +16668,10 @@ const LidoKeyboard = class {
|
|
|
16666
16668
|
const keysArray = this.keys.split(',').map(k => k.trim());
|
|
16667
16669
|
const container = document.getElementById(index$1.LidoContainer);
|
|
16668
16670
|
const showCheck = container.getAttribute('show-check') === 'true';
|
|
16669
|
-
return (index.h(index.Host, { key: '
|
|
16671
|
+
return (index.h(index.Host, { key: '4de3b75fa2905744ad610d147d9b4fe9912dd732', class: "lido-keyboard", style: { width: this.style.width, height: this.style.height, position: 'relative', margin: this.style.margin, zIndex: this.z } }, this.keyboardInput && (index.h("div", { key: '7b5d293c52747700cde9c1069cfbbdae065e64f9', class: "input-area" }, index.h("input", { key: '03a91cd87e6bb4f09bf698087258426dd9232f67', type: "text", value: this.inputString, class: "input-area", readonly: true }), index.h("lido-text", { key: 'd30e033a055df52b30b2f2775c2b3410ee37df63', visible: showCheck ? 'true' : 'false', string: "<<", "bg-color": "black", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "100px", height: "70px", type: "click", onClick: () => {
|
|
16670
16672
|
this.inputString = this.inputString.slice(0, -1);
|
|
16671
16673
|
this.inputValidation(event);
|
|
16672
|
-
} }), index.h("lido-text", { key: '
|
|
16674
|
+
} }), index.h("lido-text", { key: '70d78aed7dedbe7d03a05c13c4c320029280bb03', visible: showCheck ? 'true' : 'false', id: "lido-checkButton", string: "Enter", "bg-color": "green", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "150px", height: "70px", type: "click" }))), this.letterLength && (index.h("lido-text", { key: '19306cd12bd98dc8dc7b54b20bad3f2f0318116f', visible: "true", string: `${this.numberOfClick}/${this.letterLength}`, "font-size": "60px", "font-color": "white", onEntry: "this.position='absolute'; this.right='0'; this.fontWeight='800';", x: "unset" })), index.h("div", { key: '826900d6ba26175eb45d2e7e4c02fccce2004db3', class: "keyboard-wrapper", style: {
|
|
16673
16675
|
display: 'flex',
|
|
16674
16676
|
flexWrap: 'wrap',
|
|
16675
16677
|
justifyContent: 'center',
|
|
@@ -18796,13 +18798,13 @@ const LidoTrace = class {
|
|
|
18796
18798
|
}
|
|
18797
18799
|
return;
|
|
18798
18800
|
}
|
|
18799
|
-
index$1.calculateScore();
|
|
18800
18801
|
const container = document.querySelector(index$1.LidoContainer);
|
|
18801
18802
|
const containerOnCorrect = container.getAttribute("onCorrect");
|
|
18802
18803
|
if (container && containerOnCorrect) {
|
|
18803
18804
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
18804
18805
|
await index$1.executeActions(containerOnCorrect, this.el);
|
|
18805
18806
|
}
|
|
18807
|
+
index$1.calculateScore();
|
|
18806
18808
|
index$1.triggerNextContainer();
|
|
18807
18809
|
}
|
|
18808
18810
|
// Get the pointer position relative to the SVG
|
|
@@ -19074,7 +19076,7 @@ const LidoTrace = class {
|
|
|
19074
19076
|
};
|
|
19075
19077
|
}
|
|
19076
19078
|
render() {
|
|
19077
|
-
return (index.h(index.Host, { key: '
|
|
19079
|
+
return (index.h(index.Host, { key: '31f7f62d73ed98ce0a3b224435e7b64574cf506c', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, index.h("div", { key: '6cf11b7d5f9aeb3c58cbb462e63d3f340384a403', style: this.style, id: "lido-svgContainer" })));
|
|
19078
19080
|
}
|
|
19079
19081
|
static get assetsDirs() { return ["svg", "images"]; }
|
|
19080
19082
|
get el() { return index.getElement(this); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { executeActions, equationCheck, storingEachActivityScore, calculateScore, triggerNextContainer, convertUrlToRelative } from "../../utils/utils";
|
|
3
|
-
import {
|
|
3
|
+
import { SelectedValuesKey, CalculatorOk } from "../../utils/constants";
|
|
4
4
|
import { AudioPlayer } from "../../utils/audioPlayer";
|
|
5
5
|
export class LidoCalculator {
|
|
6
6
|
constructor() {
|
|
@@ -146,7 +146,7 @@ export class LidoCalculator {
|
|
|
146
146
|
if (!hasScrollAction) {
|
|
147
147
|
if (!isMultiObjective) {
|
|
148
148
|
calculateScore();
|
|
149
|
-
|
|
149
|
+
triggerNextContainer();
|
|
150
150
|
}
|
|
151
151
|
else {
|
|
152
152
|
const objectives = this.objective.split(',').map(obj => obj.trim());
|
|
@@ -154,7 +154,7 @@ export class LidoCalculator {
|
|
|
154
154
|
if (allSolved) {
|
|
155
155
|
container.setAttribute("game-completed", "true");
|
|
156
156
|
calculateScore();
|
|
157
|
-
|
|
157
|
+
triggerNextContainer();
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}
|
|
@@ -182,7 +182,7 @@ export class LidoCalculator {
|
|
|
182
182
|
}
|
|
183
183
|
render() {
|
|
184
184
|
const numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '←', '0', 'OK'];
|
|
185
|
-
return (h(Host, { key: '
|
|
185
|
+
return (h(Host, { key: '63cfc3e353a89b76ad809a921cc7b51ce6d06e93', onEntry: this.onEntry, id: "lidoCalculator", style: { width: this.width, height: this.height, backgroundColor: this.bgColor, left: this.x, top: this.y } }, h("lido-cell", { key: '66cc572079209533f8fd4f6c4ca76fdb9435b3b8', visible: "true", height: "94px", width: "60px" }, h("lido-text", { key: 'aca3392da8c74ab136268296f2ff584bf5cacd61', visible: "true", id: "lido-calculator-penIcon", type: "click", height: "80px", x: "204%", width: "89px", onEntry: "this.position='relative';", class: "top-icon" }, h("img", { key: '46275d788f7bb3132e657d4902d4471cc7928b39', src: convertUrlToRelative(this.penIcon), alt: "pen", style: { width: '100%', height: '100%' } }))), h("div", { key: '5adb6fbdefa7d9d8c4bd2ada68f580c8c1af298e', class: "lido-calculator-displayParent" }, h("div", { key: 'cca5a9c232f9d4dfa31e193e8d9eaddcd83a5052', class: "lido-calculator-display" }, this.displayValue)), h("div", { key: '64b70b100e8165dfe6d0dd9522b0362f12856a9e', class: "lido-calculator-buttons" }, numbers.map((num, i) => (h("lido-text", { id: `btn-${i}`, string: num, visible: "true", type: "click", class: {
|
|
186
186
|
'lido-calculator-btn-special': num === '←' || num === 'OK',
|
|
187
187
|
'lido-calculator-btn-default': num !== '←' && num !== 'OK'
|
|
188
188
|
}, onClick: () => this.handleClick(num) }))))));
|
|
@@ -401,10 +401,12 @@ export class LidoContainer {
|
|
|
401
401
|
componentDidLoad() {
|
|
402
402
|
this.scaleContainer(this.el);
|
|
403
403
|
const backGroundImage = this.bgImage ? convertUrlToRelative(this.bgImage) : '';
|
|
404
|
+
const standalone = this.el.closest('lido-standalone');
|
|
405
|
+
const backgroundTarget = (standalone === null || standalone === void 0 ? void 0 : standalone.getAttribute('bg-image')) === 'true' ? standalone : document.body;
|
|
406
|
+
backgroundTarget.style.backgroundColor = this.bgColor;
|
|
407
|
+
backgroundTarget.style.backgroundImage = backGroundImage ? `url(${backGroundImage})` : 'none';
|
|
408
|
+
backgroundTarget.style.backgroundPosition = backGroundImage ? 'bottom' : 'none';
|
|
404
409
|
document.body.style.pointerEvents = 'auto';
|
|
405
|
-
document.body.style.backgroundColor = this.bgColor;
|
|
406
|
-
document.body.style.backgroundImage = backGroundImage ? `url(${backGroundImage})` : 'none';
|
|
407
|
-
document.body.style.backgroundPosition = backGroundImage ? `bottom` : 'none';
|
|
408
410
|
// Re-scale the container on window resize or load events
|
|
409
411
|
window.addEventListener('resize', this.handleWindowResize);
|
|
410
412
|
window.addEventListener('load', this.handleWindowLoad);
|
|
@@ -450,7 +452,7 @@ export class LidoContainer {
|
|
|
450
452
|
margin: this.margin,
|
|
451
453
|
userSelect: 'none', // Prevent any field selection
|
|
452
454
|
};
|
|
453
|
-
return (h(Host, { key: '
|
|
455
|
+
return (h(Host, { key: '104e6cc49ab78121a9b7e9939e5def1952567a53', id: "lido-container", Lang: this.Lang, "tab-index": 0, class: "lido-container", objective: this.objective, baseUrl: this.baseUrl, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, onTouch: this.onTouch, onInCorrect: this.onInCorrect, onCorrect: this.onCorrect, onEntry: this.onEntry, "show-check": `${this.showCheck}`, "is-continue-on-correct": `${this.isContinueOnCorrect}`, "is-allow-only-correct": `${this.isAllowOnlyCorrect}`, canplay: `${this.canplay}`, appendToDropOnCompletion: `${this.appendToDropOnCompletion}`, "show-prev-button": `${this.showPrevButton}`, "show-next-button": `${this.showNextButton}`, "show-drop-border": `${this.showDropBorder}`, "bg-image": this.bgImage, "exit-button-url": this.exitButtonUrl, "prev-button-url": this.prevButtonUrl, "next-button-url": this.nextButtonUrl, "speaker-button-url": this.speakerButtonUrl, "disable-speak": `${this.disableSpeak}`, "template-id": this.templateId, audio: this.audio, "highlight-word-by-word": `${this.highlightWordByWord}` }, h("lido-text", { key: 'ec5e3d78fbf2b8a0cf4b6f918b41c22dc18b2484', visible: "false", id: this.templateId, audio: "", string: this.instructName }), h("slot", { key: '384172d5224ae11a20983cda82a3761da456ba2a' })));
|
|
454
456
|
}
|
|
455
457
|
static get is() { return "lido-container"; }
|
|
456
458
|
static get originalStyleUrls() {
|
|
@@ -192,7 +192,6 @@ export class LidoHome {
|
|
|
192
192
|
this.exitFlag = false;
|
|
193
193
|
if (alertElement) {
|
|
194
194
|
if (comment === 'exit') {
|
|
195
|
-
dispatchGameExitEvent();
|
|
196
195
|
AudioPlayer.getI().stop();
|
|
197
196
|
Timer.getI().stop();
|
|
198
197
|
gameScore.rightMoves = 0;
|
|
@@ -203,6 +202,7 @@ export class LidoHome {
|
|
|
203
202
|
// clearmemoryStorage();
|
|
204
203
|
alertElement.remove();
|
|
205
204
|
this.currentContainerIndex = 0;
|
|
205
|
+
dispatchGameExitEvent();
|
|
206
206
|
}
|
|
207
207
|
else {
|
|
208
208
|
alertElement.remove();
|
|
@@ -71,10 +71,10 @@ export class LidoKeyboard {
|
|
|
71
71
|
this.numberOfClick++;
|
|
72
72
|
localStorage.removeItem(SelectedValuesKey);
|
|
73
73
|
if (this.numberOfClick === this.letterLength) {
|
|
74
|
-
calculateScore();
|
|
75
74
|
const onCorrrect = container.getAttribute('onCorrect');
|
|
76
75
|
container.style.pointerEvents = 'none';
|
|
77
76
|
await executeActions(onCorrrect, this.el);
|
|
77
|
+
calculateScore();
|
|
78
78
|
triggerNextContainer();
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
@@ -139,10 +139,10 @@ export class LidoKeyboard {
|
|
|
139
139
|
const keysArray = this.keys.split(',').map(k => k.trim());
|
|
140
140
|
const container = document.getElementById(LidoContainer);
|
|
141
141
|
const showCheck = container.getAttribute('show-check') === 'true';
|
|
142
|
-
return (h(Host, { key: '
|
|
142
|
+
return (h(Host, { key: '4de3b75fa2905744ad610d147d9b4fe9912dd732', class: "lido-keyboard", style: { width: this.style.width, height: this.style.height, position: 'relative', margin: this.style.margin, zIndex: this.z } }, this.keyboardInput && (h("div", { key: '7b5d293c52747700cde9c1069cfbbdae065e64f9', class: "input-area" }, h("input", { key: '03a91cd87e6bb4f09bf698087258426dd9232f67', type: "text", value: this.inputString, class: "input-area", readonly: true }), h("lido-text", { key: 'd30e033a055df52b30b2f2775c2b3410ee37df63', visible: showCheck ? 'true' : 'false', string: "<<", "bg-color": "black", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "100px", height: "70px", type: "click", onClick: () => {
|
|
143
143
|
this.inputString = this.inputString.slice(0, -1);
|
|
144
144
|
this.inputValidation(event);
|
|
145
|
-
} }), h("lido-text", { key: '
|
|
145
|
+
} }), h("lido-text", { key: '70d78aed7dedbe7d03a05c13c4c320029280bb03', visible: showCheck ? 'true' : 'false', id: "lido-checkButton", string: "Enter", "bg-color": "green", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "150px", height: "70px", type: "click" }))), this.letterLength && (h("lido-text", { key: '19306cd12bd98dc8dc7b54b20bad3f2f0318116f', visible: "true", string: `${this.numberOfClick}/${this.letterLength}`, "font-size": "60px", "font-color": "white", onEntry: "this.position='absolute'; this.right='0'; this.fontWeight='800';", x: "unset" })), h("div", { key: '826900d6ba26175eb45d2e7e4c02fccce2004db3', class: "keyboard-wrapper", style: {
|
|
146
146
|
display: 'flex',
|
|
147
147
|
flexWrap: 'wrap',
|
|
148
148
|
justifyContent: 'center',
|
|
@@ -769,13 +769,13 @@ export class LidoTrace {
|
|
|
769
769
|
}
|
|
770
770
|
return;
|
|
771
771
|
}
|
|
772
|
-
calculateScore();
|
|
773
772
|
const container = document.querySelector(LidoContainer);
|
|
774
773
|
const containerOnCorrect = container.getAttribute("onCorrect");
|
|
775
774
|
if (container && containerOnCorrect) {
|
|
776
775
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
777
776
|
await executeActions(containerOnCorrect, this.el);
|
|
778
777
|
}
|
|
778
|
+
calculateScore();
|
|
779
779
|
triggerNextContainer();
|
|
780
780
|
}
|
|
781
781
|
// Get the pointer position relative to the SVG
|
|
@@ -1047,7 +1047,7 @@ export class LidoTrace {
|
|
|
1047
1047
|
};
|
|
1048
1048
|
}
|
|
1049
1049
|
render() {
|
|
1050
|
-
return (h(Host, { key: '
|
|
1050
|
+
return (h(Host, { key: '31f7f62d73ed98ce0a3b224435e7b64574cf506c', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, h("div", { key: '6cf11b7d5f9aeb3c58cbb462e63d3f340384a403', style: this.style, id: "lido-svgContainer" })));
|
|
1051
1051
|
}
|
|
1052
1052
|
static get is() { return "lido-trace"; }
|
|
1053
1053
|
static get originalStyleUrls() {
|
|
@@ -24,6 +24,7 @@ function toSerializableDetail(detail) {
|
|
|
24
24
|
export function dispatchActivityEndEvent(totalIndex, currentIndex, score, rightMoves, wrongMoves, timeSpentForActivity, lessonTrackingParams, gameCompleted) {
|
|
25
25
|
dispatchCustomEvent(ActivityEndKey, Object.assign(Object.assign({ currentIndex, totalIndex, score, rightMoves, wrongMoves, timeSpentForActivity }, lessonTrackingParams), { gameCompleted }));
|
|
26
26
|
dispatchCustomEvent(MicroProblemEndKey, Object.assign(Object.assign({ currentIndex, totalIndex, score, rightMoves, wrongMoves, timeSpentForActivity }, lessonTrackingParams), { gameCompleted }));
|
|
27
|
+
console.log(`[Activity End]Activity ${currentIndex + 1}/${totalIndex} - Time Spent: ${timeSpentForActivity}`);
|
|
27
28
|
}
|
|
28
29
|
export function dispatchLessonEndEvent(totalIndex, rightMoves, wrongMoves, finalScore, timeSpendForLesson, lessonTrackingParams) {
|
|
29
30
|
dispatchCustomEvent(MicroLessonEndKey, Object.assign({ totalIndex, rightMoves, wrongMoves, finalScore, score: finalScore, timeSpendForLesson }, lessonTrackingParams));
|
|
@@ -31,6 +32,7 @@ export function dispatchLessonEndEvent(totalIndex, rightMoves, wrongMoves, final
|
|
|
31
32
|
return;
|
|
32
33
|
}
|
|
33
34
|
dispatchCustomEvent(LessonEndKey, Object.assign({ totalIndex, rightMoves, wrongMoves, finalScore, score: finalScore, timeSpendForLesson }, lessonTrackingParams));
|
|
35
|
+
console.log(`[Lesson End] Lesson: ${lessonTrackingParams === null || lessonTrackingParams === void 0 ? void 0 : lessonTrackingParams.lessonName} (${lessonTrackingParams === null || lessonTrackingParams === void 0 ? void 0 : lessonTrackingParams.lessonId}) - Total Time Spent: ${timeSpendForLesson}`);
|
|
34
36
|
}
|
|
35
37
|
export function dispatchNextContainerEvent() {
|
|
36
38
|
dispatchCustomEvent(NextContainerKey, {});
|
|
@@ -702,11 +702,12 @@ const storeActivityScore = (score) => {
|
|
|
702
702
|
const activityScoreKey = index.toString();
|
|
703
703
|
activityScore[activityScoreKey] = score;
|
|
704
704
|
//send Custom Event to parent
|
|
705
|
-
// window.dispatchEvent(new CustomEvent(ActivityEndKey, { detail: { index: index, totalIndex: totalIndex, score: score } }));
|
|
706
|
-
const
|
|
707
|
-
ACTIVYTY_TIME_SPEND_ARRAY.push(
|
|
705
|
+
// window.dispatchEvent(new CustomEvent(ActivityEndKey, { detail: { index: index, totalIndex: totalIndex, score: score } }));
|
|
706
|
+
const actualActivitySeconds = Math.ceil(Timer.getI().getElapsed() / 1000);
|
|
707
|
+
ACTIVYTY_TIME_SPEND_ARRAY.push(actualActivitySeconds);
|
|
708
|
+
console.log(`[Utils][Activity Time] Activity ${index + 1}/${totalIndex} - Time spent: ${actualActivitySeconds}s`);
|
|
708
709
|
const lessonTrackingParams = getLessonTrackingParams();
|
|
709
|
-
dispatchActivityEndEvent(totalIndex, index, score, gameScore.rightMoves, gameScore.wrongMoves,
|
|
710
|
+
dispatchActivityEndEvent(totalIndex, index, score, gameScore.rightMoves, gameScore.wrongMoves, actualActivitySeconds, lessonTrackingParams, true);
|
|
710
711
|
localStorage.setItem(ActivityScoreKey, JSON.stringify(activityScore));
|
|
711
712
|
if (totalIndex - 1 == index) {
|
|
712
713
|
const scoresArray = Object.values(activityScore);
|
|
@@ -715,11 +716,13 @@ const storeActivityScore = (score) => {
|
|
|
715
716
|
console.log('Total Score : ', gameScore.finalScore);
|
|
716
717
|
// window.dispatchEvent(new CustomEvent(LessonEndKey, { detail: { score: finalScore } }));
|
|
717
718
|
const timeSpendForLesson = ACTIVYTY_TIME_SPEND_ARRAY.reduce((sum, current) => sum + current, 0);
|
|
719
|
+
console.log(`[Utils][Lesson Time] Total lesson time spent: ${timeSpendForLesson}s`);
|
|
718
720
|
dispatchLessonEndEvent(totalIndex, gameScore.totalRightMovesCount, gameScore.totalWrongMovesCount, finalScore, timeSpendForLesson, lessonTrackingParams);
|
|
719
721
|
gameScore.totalRightMovesCount = 0;
|
|
720
722
|
gameScore.totalWrongMovesCount = 0;
|
|
721
723
|
dispatchGameCompletedEvent();
|
|
722
724
|
localStorage.removeItem(ActivityScoreKey);
|
|
725
|
+
ACTIVYTY_TIME_SPEND_ARRAY.length = 0;
|
|
723
726
|
}
|
|
724
727
|
};
|
|
725
728
|
export const handleShowCheck = () => {
|
|
@@ -765,6 +768,7 @@ export const validateObjectiveStatus = async () => {
|
|
|
765
768
|
}
|
|
766
769
|
storingEachActivityScore(true);
|
|
767
770
|
storeActivityScore(100);
|
|
771
|
+
gameScore.totalRightMovesCount++;
|
|
768
772
|
gameScore.rightMoves = 0;
|
|
769
773
|
gameScore.wrongMoves = 0;
|
|
770
774
|
triggerNextContainer();
|
|
@@ -821,8 +825,8 @@ export const validateObjectiveStatus = async () => {
|
|
|
821
825
|
}
|
|
822
826
|
if (!isContinueOnCorrect) {
|
|
823
827
|
container.setAttribute("game-completed", "true");
|
|
824
|
-
calculateScore();
|
|
825
828
|
await executeActions(onCorrect, container);
|
|
829
|
+
calculateScore();
|
|
826
830
|
triggerNextContainer();
|
|
827
831
|
}
|
|
828
832
|
else {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { calculateScore, executeActions } from "../utils";
|
|
1
|
+
import { SelectedValuesKey } from "../constants";
|
|
2
|
+
import { calculateScore, executeActions, triggerNextContainer } from "../utils";
|
|
3
3
|
const tempVanishedValues = [];
|
|
4
4
|
export function dragDropAnimation(container, dragElement, dropElement) {
|
|
5
5
|
container.style.pointerEvents = "none";
|
|
@@ -47,8 +47,8 @@ export function dragDropAnimation(container, dragElement, dropElement) {
|
|
|
47
47
|
// isCorrect=true;
|
|
48
48
|
const onCorrect = (container === null || container === void 0 ? void 0 : container.getAttribute('onCorrect')) || '';
|
|
49
49
|
await executeActions(onCorrect, container);
|
|
50
|
-
window.dispatchEvent(new CustomEvent(NextContainerKey));
|
|
51
50
|
calculateScore();
|
|
51
|
+
triggerNextContainer();
|
|
52
52
|
tempVanishedValues.length = 0;
|
|
53
53
|
})();
|
|
54
54
|
}
|
|
@@ -943,8 +943,8 @@ export const appendingDragElementsInDrop = () => {
|
|
|
943
943
|
if (isAllowOnlyCorrect === true) {
|
|
944
944
|
if (drop['value'] === drag['value']) {
|
|
945
945
|
drag.style.transform = 'translate(0,0)';
|
|
946
|
-
|
|
947
|
-
|
|
946
|
+
drag.style.width = "stretch";
|
|
947
|
+
drag.style.padding = '0';
|
|
948
948
|
drop.appendChild(drag);
|
|
949
949
|
appendedDragIds.add(drag.id);
|
|
950
950
|
drag.style.pointerEvents = 'none';
|
|
@@ -29,8 +29,8 @@ export async function handleElementClick(element) {
|
|
|
29
29
|
container.style.pointerEvents = 'none';
|
|
30
30
|
if (!container.getAttribute('game-completed') || container.getAttribute('game-completed') === 'false' || container.getAttribute('game-completed') === null || container.getAttribute('game-completed') === undefined || container.getAttribute('game-completed') === '') {
|
|
31
31
|
container.setAttribute('game-completed', 'true');
|
|
32
|
-
triggerNextContainer();
|
|
33
32
|
calculateScore();
|
|
33
|
+
triggerNextContainer();
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
else {
|