lido-player 0.0.2-alpha-91 → 0.0.2-alpha-92
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-Cxruqwoh.js → decode-C3sBXlW1.js} +1 -1
- package/dist/cjs/{index-CQUhGhpN.js → index-rb5JkNCU.js} +24 -4
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lido-avatar_22.cjs.entry.js +1279 -1407
- package/dist/collection/components/avatar/lido-avatar.js +4 -3
- package/dist/collection/components/avatar/lido-avatar.tsx +4 -2
- package/dist/collection/components/home/lido-home.js +27 -14
- package/dist/collection/utils/audioPlayer.js +14 -1
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +7 -2
- package/dist/collection/utils/utilsHandlers/sortHandler.js +3 -1
- package/dist/components/index.js +1 -1
- package/dist/components/lido-avatar.js +1 -1
- package/dist/components/lido-calculator.js +1 -1
- package/dist/components/lido-canvas.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-text.js +1 -1
- package/dist/components/{p-CjVAmIbr.js → p-5cqqnSZl.js} +1 -1
- package/dist/components/{p-sQ9Xymmk.js → p-BVaiv1nz.js} +1 -1
- package/dist/components/{p-B4DP0itc.js → p-Cyn3wr_R.js} +1 -1
- package/dist/components/{p-CEApiv2D.js → p-DWnRy2OX.js} +1 -1
- package/dist/components/p-DwSVm3Nk.js +1 -0
- package/dist/components/{p-D4ANz_-F.js → p-XacgbiAe.js} +1 -1
- package/dist/components/p-q6x112RN.js +1 -0
- package/dist/esm/{decode-B3ARTCXB.js → decode-UDsWuJaQ.js} +1 -1
- package/dist/esm/{index-DwCQErNN.js → index-C7XdSFIP.js} +1 -1
- package/dist/esm/{index-DWzraGKf.js → index-hIkolRLh.js} +25 -5
- package/dist/esm/index.js +2 -2
- package/dist/esm/lido-avatar_22.entry.js +1280 -1408
- package/dist/esm/lido-player.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-avatar.tsx +4 -2
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/{p-DwCQErNN.js → p-C7XdSFIP.js} +1 -1
- package/dist/lido-player/{p-BJJjJImf.js → p-Py_0Op01.js} +1 -1
- package/dist/lido-player/p-ff9d2637.entry.js +1 -0
- package/dist/lido-player/p-mO7V0zx8.js +1 -0
- package/dist/types/components/avatar/lido-avatar.d.ts +1 -0
- package/dist/types/components.d.ts +2 -2
- package/dist/types/utils/audioPlayer.d.ts +1 -0
- package/package.json +2 -2
- package/dist/collection/components/avatar/rive.wasm +0 -0
- package/dist/components/p-BLegTCI6.js +0 -1
- package/dist/components/p-Dbt0Faps.js +0 -1
- package/dist/lido-player/p-947c0aaf.entry.js +0 -1
- package/dist/lido-player/p-DvgXp0H2.js +0 -1
- package/dist/lido-player/rive.wasm +0 -0
|
@@ -556,11 +556,11 @@ function enableDraggingWithScaling(element) {
|
|
|
556
556
|
if (!mostOverlappedElement) {
|
|
557
557
|
// build current selection/drop maps so reset logic can update counts correctly
|
|
558
558
|
(_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : "[]";
|
|
559
|
-
JSON.stringify(buildDragSelectedMapFromDOM());
|
|
559
|
+
const dragSelectedData = JSON.stringify(buildDragSelectedMapFromDOM());
|
|
560
560
|
const dropSelectedDataObject = buildDragSelectedMapFromDOM();
|
|
561
561
|
JSON.stringify(dropSelectedDataObject);
|
|
562
562
|
const dropHasDrag = buildDropHasDragFromDOM();
|
|
563
|
-
handleResetDragElement(element,
|
|
563
|
+
handleResetDragElement(element, mostOverlappedElement, dropHasDrag, null, dragSelectedData);
|
|
564
564
|
return;
|
|
565
565
|
}
|
|
566
566
|
onElementDropComplete(element, mostOverlappedElement);
|
|
@@ -732,7 +732,12 @@ async function handleResetDragElement(dragElement, dropElement, dropHasDrag, sel
|
|
|
732
732
|
// rebuild counts & balance after removing mapping
|
|
733
733
|
const rebuiltMap2 = buildDragSelectedMapFromDOM();
|
|
734
734
|
const sortedValues2 = getSortedValuesArrayFromMap(rebuiltMap2);
|
|
735
|
-
|
|
735
|
+
if (sortedValues2 && sortedValues2.length > 0) {
|
|
736
|
+
container.setAttribute(SelectedValuesKey, JSON.stringify(sortedValues2));
|
|
737
|
+
}
|
|
738
|
+
else {
|
|
739
|
+
container.removeAttribute(SelectedValuesKey);
|
|
740
|
+
}
|
|
736
741
|
updateBalanceOnDrop();
|
|
737
742
|
}
|
|
738
743
|
const allElements = document.querySelectorAll("[type='drop']");
|
|
@@ -1319,6 +1324,7 @@ class AudioPlayer {
|
|
|
1319
1324
|
this.wordRects = [];
|
|
1320
1325
|
this.activeWordIndex = -1;
|
|
1321
1326
|
this.highlightRAF = null;
|
|
1327
|
+
this.endPromiseResolve = null;
|
|
1322
1328
|
this.handleUserClick = () => {
|
|
1323
1329
|
const container = document.getElementById(LidoContainer);
|
|
1324
1330
|
if ((container === null || container === void 0 ? void 0 : container.getAttribute('game-completed')) === 'true')
|
|
@@ -1346,6 +1352,12 @@ class AudioPlayer {
|
|
|
1346
1352
|
if (window === null || window === void 0 ? void 0 : window.speechSynthesis) {
|
|
1347
1353
|
window.speechSynthesis.cancel();
|
|
1348
1354
|
}
|
|
1355
|
+
// Resolve any pending "ended" wait so callers can continue.
|
|
1356
|
+
if (this.endPromiseResolve) {
|
|
1357
|
+
const resolve = this.endPromiseResolve;
|
|
1358
|
+
this.endPromiseResolve = null;
|
|
1359
|
+
resolve();
|
|
1360
|
+
}
|
|
1349
1361
|
this.audioElement.pause();
|
|
1350
1362
|
this.audioElement.currentTime = 0;
|
|
1351
1363
|
this.audioElement.src = '';
|
|
@@ -1445,7 +1457,13 @@ class AudioPlayer {
|
|
|
1445
1457
|
}
|
|
1446
1458
|
// unified end
|
|
1447
1459
|
await new Promise(resolve => {
|
|
1448
|
-
this.
|
|
1460
|
+
this.endPromiseResolve = resolve;
|
|
1461
|
+
this.audioElement.onended = () => {
|
|
1462
|
+
if (this.endPromiseResolve === resolve) {
|
|
1463
|
+
this.endPromiseResolve = null;
|
|
1464
|
+
}
|
|
1465
|
+
resolve();
|
|
1466
|
+
};
|
|
1449
1467
|
});
|
|
1450
1468
|
}
|
|
1451
1469
|
catch (error) {
|
|
@@ -1853,6 +1871,8 @@ function enableReorderDrag(element) {
|
|
|
1853
1871
|
const targetValue = element['value'];
|
|
1854
1872
|
if (dragValues[tabKey]) {
|
|
1855
1873
|
dragValues[tabKey] = dragValues[tabKey].filter((el) => el !== targetValue);
|
|
1874
|
+
const sortedValues = getSortedValuesArrayFromMap(dragValues);
|
|
1875
|
+
container.setAttribute(SelectedValuesKey, JSON.stringify(sortedValues));
|
|
1856
1876
|
// localStorage.setItem(DragSelectedMapKey, JSON.stringify(dragValues));
|
|
1857
1877
|
}
|
|
1858
1878
|
optionArea.scrollTo({
|