lido-player 0.0.2-beta-02 → 0.0.2-beta-03
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-BvT284iq.js → decode-CjtxAc2C.js} +1 -1
- package/dist/cjs/{index-BhikEYm-.js → index-Bt9s5WYs.js} +81 -12
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lido-avatar_22.cjs.entry.js +137 -35
- package/dist/cjs/lido-player.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/canvas/lido-canvas.js +1 -1
- 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 +1 -1
- package/dist/collection/components/flashCard/lido-flash-card.js +1 -1
- package/dist/collection/components/float/lido-float.js +1 -1
- package/dist/collection/components/home/lido-home.js +96 -5
- package/dist/collection/components/keyboard/lido-keyboard.js +2 -2
- package/dist/collection/components/mathMatrix/lido-math-matrix.js +1 -1
- package/dist/collection/components/position/lido-pos.js +1 -1
- package/dist/collection/components/random/lido-random.js +1 -1
- package/dist/collection/components/root/lido-root.js +30 -6
- package/dist/collection/components/row/lido-row.js +1 -1
- package/dist/collection/components/scale/lido-balance.js +1 -1
- package/dist/collection/components/shape/lido-shape.js +2 -2
- package/dist/collection/components/slideFill/lido-slide-fill.js +1 -1
- package/dist/collection/components/text/lido-text.js +1 -1
- package/dist/collection/components/trace/lido-trace.js +1 -1
- package/dist/collection/components/wrap/lido-wrap.js +1 -1
- package/dist/collection/utils/audioPlayer.js +0 -2
- package/dist/collection/utils/customEvents.js +29 -6
- package/dist/collection/utils/utils.js +48 -4
- package/dist/collection/utils/utilsHandlers/highlightHandler.js +2 -2
- package/dist/components/index.js +1 -1
- package/dist/components/lido-avatar.js +1 -1
- package/dist/components/lido-balance.js +1 -1
- package/dist/components/lido-calculator.js +1 -1
- package/dist/components/lido-canvas.js +1 -1
- package/dist/components/lido-cell.js +1 -1
- package/dist/components/lido-col.js +1 -1
- package/dist/components/lido-container.js +1 -1
- package/dist/components/lido-flash-card.js +1 -1
- package/dist/components/lido-float.js +1 -1
- package/dist/components/lido-home.js +1 -1
- package/dist/components/lido-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 +1 -1
- package/dist/components/lido-row.js +1 -1
- package/dist/components/lido-shape.js +1 -1
- package/dist/components/lido-slide-fill.js +1 -1
- package/dist/components/lido-text.js +1 -1
- package/dist/components/lido-trace.js +1 -1
- package/dist/components/lido-wrap.js +1 -1
- package/dist/components/{p-CusU-d3G.js → p-04xe3uUh.js} +1 -1
- package/dist/components/p-2ox8u4JO.js +1 -0
- package/dist/components/{p-WP-EeUIB.js → p-BHrmIag4.js} +1 -1
- package/dist/components/p-BHtfrGiU.js +12 -0
- package/dist/components/{p-1qOeKb23.js → p-BPsom7z0.js} +1 -1
- package/dist/components/{p-Cvme8ibO.js → p-B_jNkxEx.js} +1 -1
- package/dist/components/p-BfMfgi8h.js +1 -0
- package/dist/components/p-BsHyhW7k.js +1 -0
- package/dist/components/{p-Blfvc5ur.js → p-C5Gn0SKo.js} +1 -1
- package/dist/components/p-C7tEzlkQ.js +1 -0
- package/dist/components/p-C9eb2B-B.js +1 -0
- package/dist/components/{p-BY1E9s1O.js → p-COBnIJEZ.js} +1 -1
- package/dist/components/{p-q6x112RN.js → p-CwDTdXe5.js} +1 -1
- package/dist/components/{p-CfdL3fZ9.js → p-D-B1groh.js} +1 -1
- package/dist/components/{p-D4JZI_JB.js → p-D0bKCljc.js} +1 -1
- package/dist/components/{p-5cqqnSZl.js → p-D23sDjqf.js} +1 -1
- package/dist/components/{p-Czy5pBTg.js → p-D62lkidF.js} +1 -1
- package/dist/components/{p-1PmJa9_u.js → p-DPAlnts-.js} +1 -1
- package/dist/components/{p-De6WHLEQ.js → p-DU-N8vrM.js} +1 -1
- package/dist/components/{p-yHq43npj.js → p-D_BBs_vA.js} +1 -1
- package/dist/components/{p-DqskvXvD.js → p-JN426a_v.js} +1 -1
- package/dist/components/p-iNMFyxvU.js +1 -0
- package/dist/esm/{decode-B2R73LQH.js → decode-DN6duCrB.js} +1 -1
- package/dist/esm/{index-C1lqv26k.js → index-Bfvjs1z9.js} +79 -13
- package/dist/esm/index.js +1 -1
- package/dist/esm/lido-avatar_22.entry.js +137 -35
- package/dist/esm/lido-player.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-94ee3a4f.entry.js +12 -0
- package/dist/lido-player/p-DXsy15Ek.js +1 -0
- package/dist/lido-player/{p-C61UwQXx.js → p-DngrRzrw.js} +1 -1
- package/dist/types/components/home/lido-home.d.ts +9 -0
- package/dist/types/components/root/lido-root.d.ts +4 -0
- package/dist/types/components.d.ts +22 -0
- package/dist/types/utils/customEvents.d.ts +16 -2
- package/dist/types/utils/utils.d.ts +4 -0
- package/package.json +2 -1
- package/dist/components/p-B97yn0-n.js +0 -1
- package/dist/components/p-BLx2hZ8d.js +0 -1
- package/dist/components/p-BOTEFjDY.js +0 -1
- package/dist/components/p-CYA3cHAL.js +0 -1
- package/dist/components/p-DFnbzZUc.js +0 -1
- package/dist/components/p-DWnRy2OX.js +0 -1
- package/dist/components/p-XacgbiAe.js +0 -1
- package/dist/lido-player/p-DLiAHqUu.js +0 -1
- package/dist/lido-player/p-b98f209c.entry.js +0 -1
|
@@ -110,15 +110,36 @@ const LANGUAGE_PROFILES = {
|
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
function dispatchCustomEvent(eventName, detail) {
|
|
113
|
+
var _a;
|
|
113
114
|
console.log("👍Event Name : ", eventName, "Detail : ", detail.toString());
|
|
114
115
|
const event = new CustomEvent(eventName, { detail });
|
|
115
116
|
window.dispatchEvent(event);
|
|
117
|
+
if (eventName === ActivityEndKey || eventName === LessonEndKey || eventName === GameCompletedKey || eventName === GameExitKey) {
|
|
118
|
+
(_a = window.parent) === null || _a === void 0 ? void 0 : _a.postMessage({
|
|
119
|
+
eventName,
|
|
120
|
+
detail: toSerializableDetail(detail),
|
|
121
|
+
}, "*");
|
|
122
|
+
}
|
|
116
123
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
124
|
+
function toSerializableDetail(detail) {
|
|
125
|
+
if (!detail || typeof detail !== 'object')
|
|
126
|
+
return detail;
|
|
127
|
+
return Object.fromEntries(Object.entries(detail).filter(([, value]) => {
|
|
128
|
+
return (value === null ||
|
|
129
|
+
['string', 'number', 'boolean', 'undefined'].includes(typeof value) ||
|
|
130
|
+
Array.isArray(value) ||
|
|
131
|
+
(typeof value === 'object' && value.constructor === Object));
|
|
132
|
+
}));
|
|
119
133
|
}
|
|
120
|
-
function
|
|
121
|
-
dispatchCustomEvent(
|
|
134
|
+
function dispatchActivityEndEvent(totalIndex, currentIndex, score, rightMoves, wrongMoves, timeSpentForActivity, lessonTrackingParams, gameCompleted) {
|
|
135
|
+
dispatchCustomEvent(ActivityEndKey, Object.assign(Object.assign({ currentIndex, totalIndex, score, rightMoves, wrongMoves, timeSpentForActivity }, lessonTrackingParams), { gameCompleted }));
|
|
136
|
+
}
|
|
137
|
+
function dispatchLessonEndEvent(totalIndex, rightMoves, wrongMoves, finalScore, timeSpendForLesson, lessonTrackingParams) {
|
|
138
|
+
if (getLessonTrackingParams().end === "blank" || getLessonTrackingParams().end === "complete" || getLessonTrackingParams().end === "completed") {
|
|
139
|
+
console.log("Lesson end event skipped. Reason: Lesson end type is set to 'blank' in lesson tracking parameters.");
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
dispatchCustomEvent(LessonEndKey, Object.assign({ totalIndex, rightMoves, wrongMoves, finalScore, score: finalScore, timeSpendForLesson }, lessonTrackingParams));
|
|
122
143
|
}
|
|
123
144
|
function dispatchNextContainerEvent() {
|
|
124
145
|
dispatchCustomEvent(NextContainerKey, {});
|
|
@@ -141,6 +162,7 @@ function dispatchElementDropEvent(dragElement, dropElement, isCorrect) {
|
|
|
141
162
|
function dispatchClickEvent(element, isCorrect) {
|
|
142
163
|
dispatchCustomEvent(ElementClickKey, { element, isCorrect: isCorrect, createdAt: new Date().toISOString() });
|
|
143
164
|
}
|
|
165
|
+
// for nipun - to dispatch custom event
|
|
144
166
|
|
|
145
167
|
// rive-service.ts
|
|
146
168
|
class RiveService {
|
|
@@ -1267,8 +1289,8 @@ function highlightSpeakingElement(element) {
|
|
|
1267
1289
|
// Add a custom class for highlighting
|
|
1268
1290
|
element.classList.add('speaking-highlight');
|
|
1269
1291
|
// Inject keyframe animation and class styles into the document's head if it doesn't already exist
|
|
1270
|
-
const styleId = '
|
|
1271
|
-
if (!document.
|
|
1292
|
+
const styleId = 'speaking-highlight-style';
|
|
1293
|
+
if (!document.getElementById(styleId)) {
|
|
1272
1294
|
const style = document.createElement('style');
|
|
1273
1295
|
style.id = styleId;
|
|
1274
1296
|
style.innerHTML = `
|
|
@@ -1393,8 +1415,6 @@ class AudioPlayer {
|
|
|
1393
1415
|
await this.stop(true);
|
|
1394
1416
|
};
|
|
1395
1417
|
this.audioElement = document.createElement('audio');
|
|
1396
|
-
this.audioElement.id = 'audio';
|
|
1397
|
-
document.body.appendChild(this.audioElement);
|
|
1398
1418
|
this.registerGlobalStopEvents();
|
|
1399
1419
|
this.registerVisibilityEvents();
|
|
1400
1420
|
}
|
|
@@ -4617,6 +4637,8 @@ _extends(config$1, DEFAULT_CONFIG, {
|
|
|
4617
4637
|
NUMBER_OPTIONS
|
|
4618
4638
|
});
|
|
4619
4639
|
|
|
4640
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4641
|
+
|
|
4620
4642
|
function getDefaultExportFromCjs (x) {
|
|
4621
4643
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
4622
4644
|
}
|
|
@@ -72928,6 +72950,24 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
72928
72950
|
});
|
|
72929
72951
|
handleShowCheck();
|
|
72930
72952
|
}
|
|
72953
|
+
const getLessonTrackingParams = () => {
|
|
72954
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
72955
|
+
const getParam = (key) => { var _a, _b; return (_b = (_a = urlParams.get(key.toLowerCase())) !== null && _a !== void 0 ? _a : urlParams.get(key)) !== null && _b !== void 0 ? _b : ''; };
|
|
72956
|
+
return {
|
|
72957
|
+
studentId: getParam('studentId'),
|
|
72958
|
+
studentName: getParam('studentName'),
|
|
72959
|
+
classId: getParam('classId'),
|
|
72960
|
+
schoolId: getParam('schoolId'),
|
|
72961
|
+
courseId: getParam('courseId'),
|
|
72962
|
+
courseName: getParam('courseName'),
|
|
72963
|
+
chapterId: getParam('chapterId'),
|
|
72964
|
+
chapterName: getParam('chapterName'),
|
|
72965
|
+
lessonId: getParam('lessonId'),
|
|
72966
|
+
lessonName: getParam('lessonName'),
|
|
72967
|
+
lang: getParam('lang'),
|
|
72968
|
+
end: getParam('end'),
|
|
72969
|
+
};
|
|
72970
|
+
};
|
|
72931
72971
|
const storeActivityScore = (score) => {
|
|
72932
72972
|
var _a, _b, _c;
|
|
72933
72973
|
const appHome = document.querySelector('lido-home');
|
|
@@ -72942,7 +72982,9 @@ const storeActivityScore = (score) => {
|
|
|
72942
72982
|
// window.dispatchEvent(new CustomEvent(ActivityEndKey, { detail: { index: index, totalIndex: totalIndex, score: score } }));
|
|
72943
72983
|
const timeSpendForActivity = Math.floor(Timer.getI().getElapsed() / 1000);
|
|
72944
72984
|
ACTIVYTY_TIME_SPEND_ARRAY.push(timeSpendForActivity);
|
|
72945
|
-
|
|
72985
|
+
const lessonTrackingParams = getLessonTrackingParams();
|
|
72986
|
+
console.log("lessontracking params : ", lessonTrackingParams);
|
|
72987
|
+
dispatchActivityEndEvent(totalIndex, index, score, gameScore.rightMoves, gameScore.wrongMoves, timeSpendForActivity, lessonTrackingParams, true);
|
|
72946
72988
|
localStorage.setItem(ActivityScoreKey, JSON.stringify(activityScore));
|
|
72947
72989
|
if (totalIndex - 1 == index) {
|
|
72948
72990
|
const scoresArray = Object.values(activityScore);
|
|
@@ -72951,7 +72993,7 @@ const storeActivityScore = (score) => {
|
|
|
72951
72993
|
console.log('Total Score : ', gameScore.finalScore);
|
|
72952
72994
|
// window.dispatchEvent(new CustomEvent(LessonEndKey, { detail: { score: finalScore } }));
|
|
72953
72995
|
const timeSpendForLesson = ACTIVYTY_TIME_SPEND_ARRAY.reduce((sum, current) => sum + current, 0);
|
|
72954
|
-
dispatchLessonEndEvent(totalIndex, gameScore.rightMoves, gameScore.wrongMoves, finalScore, timeSpendForLesson);
|
|
72996
|
+
dispatchLessonEndEvent(totalIndex, gameScore.rightMoves, gameScore.wrongMoves, finalScore, timeSpendForLesson, lessonTrackingParams);
|
|
72955
72997
|
localStorage.removeItem(ActivityScoreKey);
|
|
72956
72998
|
}
|
|
72957
72999
|
};
|
|
@@ -73141,6 +73183,11 @@ const triggerNextContainer = () => {
|
|
|
73141
73183
|
// const event = new CustomEvent('nextContainer');
|
|
73142
73184
|
console.log('🚀 ~ triggerNextContainer ~ event:', event);
|
|
73143
73185
|
// window.dispatchEvent(event);
|
|
73186
|
+
const lidoHome = document.querySelector('.lido-home');
|
|
73187
|
+
if (lidoHome && (getLessonTrackingParams().end === "blank" || getLessonTrackingParams().end === "complete" || getLessonTrackingParams().end === "completed") && Number(lidoHome.getAttribute('index')) >= Number(lidoHome.getAttribute('totalIndex')) - 1) {
|
|
73188
|
+
console.log('🚀 ~ triggerNextContainer ~ lidoHome:', lidoHome);
|
|
73189
|
+
return;
|
|
73190
|
+
}
|
|
73144
73191
|
dispatchNextContainerEvent();
|
|
73145
73192
|
};
|
|
73146
73193
|
const triggerPrevcontainer = () => {
|
|
@@ -73148,16 +73195,35 @@ const triggerPrevcontainer = () => {
|
|
|
73148
73195
|
console.log('⬅️ ~ triggerPrevContainer triggered');
|
|
73149
73196
|
dispatchPrevContainerEvent();
|
|
73150
73197
|
};
|
|
73198
|
+
let activeZipAssets;
|
|
73199
|
+
function setActiveZipAssets(zipAssets) {
|
|
73200
|
+
activeZipAssets = zipAssets;
|
|
73201
|
+
}
|
|
73202
|
+
function clearActiveZipAssets() {
|
|
73203
|
+
activeZipAssets = undefined;
|
|
73204
|
+
}
|
|
73151
73205
|
function convertUrlToRelative(url) {
|
|
73152
73206
|
const container = document.getElementById(LidoContainer);
|
|
73153
|
-
const baseUrl = container.getAttribute('baseUrl');
|
|
73207
|
+
const baseUrl = container === null || container === void 0 ? void 0 : container.getAttribute('baseUrl');
|
|
73208
|
+
const zipAssets = activeZipAssets;
|
|
73154
73209
|
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'))) {
|
|
73155
73210
|
return url;
|
|
73156
73211
|
}
|
|
73157
73212
|
if (url.startsWith('/Lido-CommonAudios/')) {
|
|
73158
73213
|
return url;
|
|
73159
73214
|
}
|
|
73160
|
-
if (
|
|
73215
|
+
if (zipAssets) {
|
|
73216
|
+
const normalizedUrl = url.replace(/^\.\/?/, '');
|
|
73217
|
+
const directMatch = zipAssets[url] || zipAssets[normalizedUrl];
|
|
73218
|
+
if (directMatch) {
|
|
73219
|
+
return directMatch;
|
|
73220
|
+
}
|
|
73221
|
+
const suffixMatch = Object.keys(zipAssets).find(assetKey => assetKey === normalizedUrl || assetKey.endsWith(`/${normalizedUrl}`));
|
|
73222
|
+
if (suffixMatch) {
|
|
73223
|
+
return zipAssets[suffixMatch];
|
|
73224
|
+
}
|
|
73225
|
+
}
|
|
73226
|
+
if (!zipAssets && baseUrl) {
|
|
73161
73227
|
const newUrl = url.startsWith('/') ? url.slice(1) : url;
|
|
73162
73228
|
if (newUrl.startsWith(baseUrl.replace(/^\/+|\/+$/g, '')))
|
|
73163
73229
|
return newUrl;
|
|
@@ -73836,6 +73902,8 @@ exports.Timer = Timer;
|
|
|
73836
73902
|
exports.attachSpeakIcon = attachSpeakIcon;
|
|
73837
73903
|
exports.calculateScale = calculateScale;
|
|
73838
73904
|
exports.calculateScore = calculateScore;
|
|
73905
|
+
exports.clearActiveZipAssets = clearActiveZipAssets;
|
|
73906
|
+
exports.commonjsGlobal = commonjsGlobal;
|
|
73839
73907
|
exports.convertUrlToRelative = convertUrlToRelative;
|
|
73840
73908
|
exports.dispatchActivityChangeEvent = dispatchActivityChangeEvent;
|
|
73841
73909
|
exports.dispatchGameCompletedEvent = dispatchGameCompletedEvent;
|
|
@@ -73859,6 +73927,7 @@ exports.nextUrl = nextUrl;
|
|
|
73859
73927
|
exports.parseProp = parseProp;
|
|
73860
73928
|
exports.prevUrl = prevUrl;
|
|
73861
73929
|
exports.resetFloatState = resetFloatState;
|
|
73930
|
+
exports.setActiveZipAssets = setActiveZipAssets;
|
|
73862
73931
|
exports.setCancelBtnPopup = setCancelBtnPopup;
|
|
73863
73932
|
exports.setVisibilityWithDelay = setVisibilityWithDelay;
|
|
73864
73933
|
exports.speakIcon = speakIcon;
|