lido-player 0.0.2-alpha-15 → 0.0.2-alpha-16
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_17.cjs.entry.js +61 -41
- package/dist/cjs/{utils-cd5d227c.js → utils-ce8aa817.js} +67 -24
- package/dist/collection/components/container/lido-container.js +7 -40
- package/dist/collection/components/home/lido-home.css +145 -22
- package/dist/collection/components/home/lido-home.js +56 -4
- package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +75 -50
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +66 -11
- package/dist/collection/stories/Templates/categorize2/categorize2.stories.js +53 -13
- package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +89 -29
- package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +22 -5
- package/dist/collection/stories/Templates/reorder/reorder.stories.js +21 -6
- package/dist/collection/utils/utils.js +42 -19
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +23 -4
- package/dist/components/index.js +1 -1
- package/dist/components/lido-avatar.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-pos.js +1 -1
- package/dist/components/lido-random.js +1 -1
- package/dist/components/lido-root.js +17 -17
- 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-67b3e70c.js → p-1a1ce031.js} +1 -1
- package/dist/components/{p-012b96db.js → p-1c6a1a1c.js} +1 -1
- package/dist/components/{p-c811c93d.js → p-4763ac96.js} +1 -1
- package/dist/components/{p-7e11b6d4.js → p-4c002940.js} +1 -1
- package/dist/components/{p-61b53309.js → p-7d9c91ac.js} +1 -1
- package/dist/components/{p-24f25f8b.js → p-873917fe.js} +1 -1
- package/dist/components/{p-9c863339.js → p-8d1f8dd4.js} +72 -19
- package/dist/components/{p-cd464196.js → p-9802fe83.js} +1 -1
- package/dist/components/{p-48c5d815.js → p-a286ca50.js} +1 -1
- package/dist/components/{p-2c7bc6d4.js → p-b709dc77.js} +65 -24
- package/dist/components/{p-2e94fbf7.js → p-c6137b71.js} +1 -1
- package/dist/components/{p-3acc9aba.js → p-c86c371c.js} +1 -1
- package/dist/components/{p-21de2b04.js → p-c8ebcd0d.js} +1 -1
- package/dist/components/{p-900b1941.js → p-c9fb0e19.js} +1 -1
- package/dist/components/{p-c3aa4e0c.js → p-da8ee1e7.js} +1 -1
- package/dist/components/{p-976693ee.js → p-f7b64c5f.js} +1 -1
- package/dist/components/{p-85f4ab08.js → p-fbb64ca6.js} +5 -38
- package/dist/esm/index.js +1 -1
- package/dist/esm/lido-avatar_17.entry.js +61 -41
- package/dist/esm/{utils-cf6f1c94.js → utils-00128cf3.js} +65 -24
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-09a0cf28.entry.js +1 -0
- package/dist/lido-player/p-4472c6eb.js +9 -0
- package/dist/types/components/container/lido-container.d.ts +2 -2
- package/dist/types/components/home/lido-home.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +4 -1
- package/dist/types/utils/utilsHandlers/dragDropHandler.d.ts +1 -0
- package/package.json +1 -1
- package/dist/lido-player/p-2728333c.js +0 -9
- package/dist/lido-player/p-46f22f88.entry.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-fe562525.js');
|
|
6
|
-
const utils = require('./utils-
|
|
6
|
+
const utils = require('./utils-ce8aa817.js');
|
|
7
7
|
|
|
8
8
|
var rive = {exports: {}};
|
|
9
9
|
|
|
@@ -6848,8 +6848,8 @@ const LidoContainer = class {
|
|
|
6848
6848
|
this.isAllowOnlyCorrect = false;
|
|
6849
6849
|
this.baseUrl = '';
|
|
6850
6850
|
this.margin = '';
|
|
6851
|
-
this.showPrevButton =
|
|
6852
|
-
this.showNextButton =
|
|
6851
|
+
this.showPrevButton = 'false';
|
|
6852
|
+
this.showNextButton = 'false';
|
|
6853
6853
|
this.delayVisible = '';
|
|
6854
6854
|
}
|
|
6855
6855
|
convertToPixels(height, parentElement = document.body) {
|
|
@@ -6876,43 +6876,11 @@ const LidoContainer = class {
|
|
|
6876
6876
|
* @param container The container element to be scaled.
|
|
6877
6877
|
*/
|
|
6878
6878
|
scaleContainer(container) {
|
|
6879
|
-
var _a;
|
|
6880
|
-
const widths = [window.innerWidth];
|
|
6881
|
-
const heights = [window.innerHeight];
|
|
6882
|
-
if ((_a = window.screen) === null || _a === void 0 ? void 0 : _a.width) {
|
|
6883
|
-
widths.push(window.screen.width);
|
|
6884
|
-
heights.push(window.screen.height);
|
|
6885
|
-
}
|
|
6886
|
-
const width = Math.min(...widths);
|
|
6887
|
-
const height = Math.min(...heights); // Get the smallest height
|
|
6888
|
-
const isPortrait = height > width; // Check if the device is in portrait mode
|
|
6889
|
-
let scaleX;
|
|
6890
|
-
let scaleY;
|
|
6891
|
-
if (isPortrait) {
|
|
6892
|
-
// Portrait Mode: Scale based on portrait reference size (e.g., 900x1600)
|
|
6893
|
-
scaleX = width / 900;
|
|
6894
|
-
scaleY = height / 1600;
|
|
6895
|
-
}
|
|
6896
|
-
else {
|
|
6897
|
-
// Landscape Mode: Scale based on landscape reference size (e.g., 1600x900)
|
|
6898
|
-
scaleX = width / 1600;
|
|
6899
|
-
scaleY = height / 900;
|
|
6900
|
-
}
|
|
6901
|
-
const scale = Math.min(scaleX, scaleY); // Ensure uniform scaling
|
|
6902
6879
|
// Center the container and apply scaling
|
|
6903
|
-
container.style.transform = `translate(-50%, -50%) scale(${
|
|
6880
|
+
container.style.transform = `translate(-50%, -50%) scale(${utils.calculateScale()})`;
|
|
6904
6881
|
container.style.left = '50%';
|
|
6905
6882
|
container.style.top = '50%';
|
|
6906
6883
|
container.style.position = 'absolute'; // Ensure proper positioning
|
|
6907
|
-
setTimeout(() => {
|
|
6908
|
-
const navBar = document.querySelector('.lido-dot-container');
|
|
6909
|
-
console.log('navBar', navBar);
|
|
6910
|
-
if (navBar) {
|
|
6911
|
-
navBar.style.width = `${container.offsetWidth - 25}px`;
|
|
6912
|
-
navBar.style.transform = `translate(-50%, -50%) scale(${scale})`; //ensure proper scaling
|
|
6913
|
-
navBar.style.visibility = 'visible';
|
|
6914
|
-
}
|
|
6915
|
-
}, 100);
|
|
6916
6884
|
this.screenOrientation();
|
|
6917
6885
|
}
|
|
6918
6886
|
screenOrientation() {
|
|
@@ -6932,7 +6900,6 @@ const LidoContainer = class {
|
|
|
6932
6900
|
* - Adds event listeners for `resize` and `load` to rescale the container on window size changes.
|
|
6933
6901
|
*/
|
|
6934
6902
|
componentDidLoad() {
|
|
6935
|
-
utils.setVisibilityWithDelay(this.el, this.delayVisible);
|
|
6936
6903
|
this.scaleContainer(this.el);
|
|
6937
6904
|
const backGroundImage = this.bgImage ? utils.convertUrlToRelative(this.bgImage) : '';
|
|
6938
6905
|
document.body.style.backgroundColor = this.bgColor;
|
|
@@ -6965,7 +6932,7 @@ const LidoContainer = class {
|
|
|
6965
6932
|
margin: this.margin,
|
|
6966
6933
|
};
|
|
6967
6934
|
console.log('🚀 ~ LidoContainer ~ canplay:', this.canplay);
|
|
6968
|
-
return (index.h(index.Host, { key: '
|
|
6935
|
+
return (index.h(index.Host, { key: '7973350ab1163200af05910818e03001cd8a5ff9', id: "lido-container", "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 }, index.h("slot", { key: '4167e635d955bdd3bc713cf3eac79c437918bb3c' })));
|
|
6969
6936
|
}
|
|
6970
6937
|
get el() { return index.getElement(this); }
|
|
6971
6938
|
};
|
|
@@ -7122,7 +7089,7 @@ const LidoHomeStyle0 = indexCss;
|
|
|
7122
7089
|
const animationCss = "@keyframes rightToPlace{from{transform:translateX(2000px)}to{transform:translateX(0)}}@keyframes topToPlace{from{transform:translateY(-1000px)}to{transform:translateY(0)}}@keyframes bottomToPlace{from{transform:translateY(1000px)}to{transform:translateY(0)}}@keyframes placeToLeft{from{}to{transform:translateX(-2000px)}}@keyframes leftToPlace{from{transform:translateX(-2000px)}to{transform:translateX(0)}}@keyframes shake{0%{transform:translateX(0)}10%{transform:translateX(-5px)}20%{transform:translateX(5px)}30%{transform:translateX(-5px)}40%{transform:translateX(5px)}50%{transform:translateX(-5px)}60%{transform:translateX(5px)}70%{transform:translateX(-5px)}80%{transform:translateX(5px)}90%{transform:translateX(-5px)}100%{transform:translateX(0)}}@keyframes fallAndBounce{0%{transform:translateY(-1000px)}25%{transform:translateY(0px)}50%{transform:translateY(-200px)}75%{transform:translateY(0)}90%{transform:translateY(-100px)}100%{transform:translateY(0)}}@keyframes placeToDown{0%{transform:translateY(0)}100%{transform:translateY(1000px)}}@keyframes strongShake{0%{transform:translateX(0)}20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-6px)}80%{transform:translateX(6px)}100%{transform:translateX(0)}}@keyframes scaledShake{0%{transform:scale(1) translateX(0);box-shadow:0 0 0 transparent}20%{transform:scale(1.10) translateX(-12px);box-shadow:0 0 10px red}40%{transform:scale(1.10) translateX(12px);box-shadow:0 0 12px red}60%{transform:scale(1.10) translateX(-8px);box-shadow:0 0 10px red}80%{transform:scale(1.10) translateX(8px);box-shadow:0 0 12px red}100%{transform:scale(1) translateX(0);box-shadow:none}}@keyframes horizontalShake{0%{transform:scale(1) translateX(0);background-color:transparent}20%{transform:translateX(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateX(20px);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateX(-10px);background-color:rgba(255, 0, 0, 0.3)}80%{transform:translateX(10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translateX(0);background-color:transparent}}@keyframes verticalShake{0%{transform:translateY(0);background-color:transparent}20%{transform:translateY(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateY(20px);background-color:rgba(255, 0, 0, 0.2)}80%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.1)}100%{transform:translateY(0);background-color:transparent}}@keyframes diagonalShake{0%{transform:translate(0, 0);background-color:transparent}25%{transform:translate(20px, -20px);background-color:rgba(255, 0, 0, 0.2)}50%{transform:translate(-20px, 20px);background-color:rgba(255, 0, 0, 0.3)}75%{transform:translate(10px, -10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translate(0, 0);background-color:transparent}}";
|
|
7123
7090
|
const LidoHomeStyle1 = animationCss;
|
|
7124
7091
|
|
|
7125
|
-
const lidoHomeCss = ".lido-snackbar{visibility:visible;min-width:250px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:16px;position:fixed;z-index:1;bottom:30px;left:50%;transform:translateX(-50%);font-size:17px}.lido-dot-container{display:flex;justify-content:space-between;align-items:center;
|
|
7092
|
+
const lidoHomeCss = ".lido-snackbar{visibility:visible;min-width:250px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:16px;position:fixed;z-index:1;bottom:30px;left:50%;transform:translateX(-50%);font-size:17px}.lido-dot-container{display:flex;justify-content:space-between;align-items:center;visibility:hidden;position:absolute;left:50%;padding:0 5px;z-index:1;width:100vw;max-width:100vw;box-sizing:border-box;height:0px}.lido-dot{height:18px;width:18px;margin:0 4px;background-color:#bbb;border-radius:50%;display:inline-block;transition:background-color 0.3s;cursor:pointer;z-index:1}.lido-btn-dot-container{flex-shrink:1;flex-grow:1;display:flex;justify-content:center;align-items:center;text-align:center;z-index:1;min-width:0;height:0px}.lido-dot.completed{background-color:grey}.lido-dot.current{background-color:green}.lido-dot:not(.completed):not(.current){background-color:#bbb}#lido-arrow-left,#lido-arrow-right{width:88px;height:88px;display:flex;align-items:center;justify-content:center;border-radius:12px;z-index:1000;box-shadow:0px 8px 0px 0px #8b310f;background-color:#f34d08;cursor:pointer;visibility:hidden;flex-shrink:0}#lido-arrow-left:active,#lido-arrow-right:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px}.navbar{display:flex;justify-content:center}.lido-exit-button,#main-audio{width:80px;height:80px;z-index:1000;cursor:pointer;background-color:white;display:flex;align-items:center;justify-content:center;border:4px solid #f34d08;border-radius:16px;box-shadow:0px 8px #f34d08;flex-shrink:0;}#main-audio:active,.lido-exit-button:active{margin-bottom:-8px;box-shadow:0px 0px 0px 0px !important}.lido-alert-popup{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1000}@media (max-width: 768px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0 8px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0 8px}.lido-dot{height:16px;width:16px;margin:0 2.5px}}@media (max-width: 480px){#lido-arrow-left,#lido-arrow-right{width:74px;height:74px;margin:0px 5px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0px 5px}.lido-dot{height:15px;width:15px;margin:0 1.5px}.lido-dot-container{padding:0 3px}}@media (max-width: 375px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 3px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 3px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 2px}}@media (max-width: 320px){#lido-arrow-left,#lido-arrow-right,.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 2px}.lido-dot{height:12px;width:12px;margin:0 0.5px}.lido-dot-container{padding:0 2px}}@media (max-width: 900px) and (orientation: landscape){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 5px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 5px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 5px}}";
|
|
7126
7093
|
const LidoHomeStyle2 = lidoHomeCss;
|
|
7127
7094
|
|
|
7128
7095
|
const LidoHome = class {
|
|
@@ -7257,6 +7224,10 @@ const LidoHome = class {
|
|
|
7257
7224
|
if (this.height != '') {
|
|
7258
7225
|
this.updateBackgroundImage();
|
|
7259
7226
|
}
|
|
7227
|
+
this.scaleNavbarContainer(); // new navbar scaling
|
|
7228
|
+
window.addEventListener('resize', () => {
|
|
7229
|
+
this.scaleNavbarContainer(); // re-scale navbar on resize
|
|
7230
|
+
});
|
|
7260
7231
|
}
|
|
7261
7232
|
updateBackgroundImage() {
|
|
7262
7233
|
const container = document.querySelector(utils.LidoContainer);
|
|
@@ -7278,6 +7249,9 @@ const LidoHome = class {
|
|
|
7278
7249
|
window.removeEventListener(utils.PrevContainerKey, () => {
|
|
7279
7250
|
this.PrevContainerKey();
|
|
7280
7251
|
});
|
|
7252
|
+
window.removeEventListener('resize', () => {
|
|
7253
|
+
this.scaleNavbarContainer(); // clean up
|
|
7254
|
+
});
|
|
7281
7255
|
}
|
|
7282
7256
|
/**
|
|
7283
7257
|
* Parses the provided XML string into an XML DOM object and extracts the containers from it.
|
|
@@ -7362,25 +7336,71 @@ const LidoHome = class {
|
|
|
7362
7336
|
this.containers = containers;
|
|
7363
7337
|
}
|
|
7364
7338
|
async btnpopup() {
|
|
7339
|
+
utils.setCancelBtnPopup(false);
|
|
7365
7340
|
await utils.AudioPlayer.getI().stop();
|
|
7366
7341
|
const container = document.getElementById(utils.LidoContainer);
|
|
7367
7342
|
const allele = container.querySelectorAll('*');
|
|
7368
7343
|
for (const el of Array.from(allele)) {
|
|
7344
|
+
if (utils.getCancelBtnPopup())
|
|
7345
|
+
break;
|
|
7369
7346
|
const tabIndex = el.getAttribute('tab-index');
|
|
7370
7347
|
const htmlel = el;
|
|
7371
|
-
if (tabIndex &&
|
|
7348
|
+
if (tabIndex && Number(tabIndex) > 0) {
|
|
7372
7349
|
await utils.AudioPlayer.getI().play(htmlel);
|
|
7350
|
+
if (utils.getCancelBtnPopup()) {
|
|
7351
|
+
await utils.AudioPlayer.getI().stop();
|
|
7352
|
+
break;
|
|
7353
|
+
}
|
|
7373
7354
|
await new Promise(resolve => setTimeout(resolve, 300));
|
|
7374
7355
|
}
|
|
7375
7356
|
}
|
|
7376
7357
|
}
|
|
7358
|
+
scaleNavbarContainer() {
|
|
7359
|
+
setTimeout(() => {
|
|
7360
|
+
const navBar = document.querySelector('.lido-dot-container');
|
|
7361
|
+
if (!navBar)
|
|
7362
|
+
return;
|
|
7363
|
+
if ((window.innerWidth === 1600 && window.innerHeight === 900) || (window.innerWidth === 900 && window.innerHeight === 1600)) {
|
|
7364
|
+
const exit_and_audio_margin = document.querySelectorAll('.lido-exit-button, #main-audio');
|
|
7365
|
+
exit_and_audio_margin.forEach(el => {
|
|
7366
|
+
el.style.marginLeft = '10px';
|
|
7367
|
+
el.style.marginRight = '10px';
|
|
7368
|
+
});
|
|
7369
|
+
}
|
|
7370
|
+
if (window.innerWidth > window.innerHeight) {
|
|
7371
|
+
navBar.style.top = '6%';
|
|
7372
|
+
}
|
|
7373
|
+
else {
|
|
7374
|
+
navBar.style.top = '3.5%';
|
|
7375
|
+
}
|
|
7376
|
+
// Apply the scale to the navbar
|
|
7377
|
+
navBar.style.transform = `translate(-50%, -50%)`;
|
|
7378
|
+
navBar.style.visibility = 'visible';
|
|
7379
|
+
console.log('navbar child : ', navBar.children);
|
|
7380
|
+
Array.from(navBar.children).forEach(el => {
|
|
7381
|
+
const item = el;
|
|
7382
|
+
item.style.transform = `scale(${utils.calculateScale()})`;
|
|
7383
|
+
});
|
|
7384
|
+
navBar.style.width = window.outerWidth + 'px';
|
|
7385
|
+
}, 100);
|
|
7386
|
+
}
|
|
7377
7387
|
/**
|
|
7378
7388
|
* Renders navigation dots for each container, indicating the progress of the user.
|
|
7379
7389
|
* Clicking on a dot allows the user to jump to a specific container.
|
|
7380
7390
|
*/
|
|
7381
7391
|
renderDots() {
|
|
7382
7392
|
const style = { pointerEvents: this.canplay ? 'none' : '' };
|
|
7383
|
-
return (index.h("div", { id: "lido-dot-indicator", class: "lido-dot-container" }, index.h("div", { class: "lido-exit-button", onClick: () => (this.exitFlag = true) }, index.h("lido-image", { src: "https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Close.svg" })), index.h("div", { class: "lido-btn-dot-container" }, index.h("div", { id: "lido-arrow-left"
|
|
7393
|
+
return (index.h("div", { id: "lido-dot-indicator", class: "lido-dot-container" }, index.h("div", { class: "lido-exit-button", onClick: () => (this.exitFlag = true) }, index.h("lido-image", { src: "https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Close.svg" })), index.h("div", { class: "lido-btn-dot-container" }, index.h("div", { id: "lido-arrow-left", onClick: event => {
|
|
7394
|
+
console.log('Target:', event.target); // What was clicked
|
|
7395
|
+
console.log('Current Target:', event.currentTarget); // Where the onClick is bound
|
|
7396
|
+
console.log('✅ Button clicked - prevBtn action triggered');
|
|
7397
|
+
utils.executeActions("this.nextBtn='true'", event.currentTarget);
|
|
7398
|
+
} }, index.h("lido-image", { src: "https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Previous.svg" })), this.containers.map((_, index$1) => (index.h("div", { class: "parent_dots" }, index.h("span", { class: `lido-dot ${index$1 < this.currentContainerIndex ? 'completed' : index$1 === this.currentContainerIndex ? 'current' : ''}`, onClick: () => this.jumpToContainer(index$1), style: style })))), index.h("div", { id: "lido-arrow-right", onClick: event => {
|
|
7399
|
+
console.log('Target:', event.target); // What was clicked
|
|
7400
|
+
console.log('Current Target:', event.currentTarget); // Where the onClick is bound
|
|
7401
|
+
console.log('✅ Button clicked - nextBtn action triggered');
|
|
7402
|
+
utils.executeActions("this.nextBtn='true'", event.currentTarget);
|
|
7403
|
+
} }, index.h("lido-image", { src: "https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Next.svg" }))), index.h("div", { id: "main-audio", onClick: () => this.btnpopup() }, index.h("lido-image", { visible: "true", src: "https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Audio%20icon.svg" }))));
|
|
7384
7404
|
}
|
|
7385
7405
|
/**
|
|
7386
7406
|
* Jumps to a specific container based on the index of the dot clicked.
|
|
@@ -778,10 +778,10 @@ function enableDraggingWithScaling(element) {
|
|
|
778
778
|
initialX = 0;
|
|
779
779
|
initialY = 0;
|
|
780
780
|
}
|
|
781
|
-
const rect1 = container.getBoundingClientRect();
|
|
782
|
-
const rect2 = element.getBoundingClientRect();
|
|
783
|
-
verticalDistance = rect1.top - rect2.top;
|
|
784
|
-
horizontalDistance = rect1.left - rect2.left;
|
|
781
|
+
// const rect1 = container.getBoundingClientRect();
|
|
782
|
+
// const rect2 = element.getBoundingClientRect();
|
|
783
|
+
// verticalDistance = rect1.top - rect2.top;
|
|
784
|
+
// horizontalDistance = rect1.left - rect2.left;
|
|
785
785
|
document.addEventListener('mousemove', onMove);
|
|
786
786
|
document.addEventListener('mouseup', onEnd);
|
|
787
787
|
document.addEventListener('touchmove', onMove);
|
|
@@ -1260,6 +1260,7 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
1260
1260
|
if (prevDropItem) {
|
|
1261
1261
|
prevDropItem.isFull = false;
|
|
1262
1262
|
localStorage.setItem(DropHasDrag, JSON.stringify(dropHasDrag));
|
|
1263
|
+
reduceSizeToOriginal();
|
|
1263
1264
|
}
|
|
1264
1265
|
}
|
|
1265
1266
|
//accepting identical
|
|
@@ -1456,6 +1457,24 @@ const appendingDragElementsInDrop = () => {
|
|
|
1456
1457
|
});
|
|
1457
1458
|
});
|
|
1458
1459
|
};
|
|
1460
|
+
const reduceSizeToOriginal = () => {
|
|
1461
|
+
const dropItems = document.querySelectorAll("[type='drop']");
|
|
1462
|
+
let dropHasDrag = JSON.parse(localStorage.getItem(DropHasDrag) || ' {}');
|
|
1463
|
+
if (!dropHasDrag || !dropItems)
|
|
1464
|
+
return;
|
|
1465
|
+
dropItems.forEach(dropElement => {
|
|
1466
|
+
var _a;
|
|
1467
|
+
const drop = dropElement;
|
|
1468
|
+
const tabIndex = drop.getAttribute('tab-index');
|
|
1469
|
+
if (((_a = drop === null || drop === void 0 ? void 0 : drop.getAttribute('drop-attr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Stretch && dropHasDrag[tabIndex].isFull === false) {
|
|
1470
|
+
const originalWidth = drop.getAttribute('data-original-width');
|
|
1471
|
+
if (originalWidth) {
|
|
1472
|
+
drop.style.width = originalWidth;
|
|
1473
|
+
drop.removeAttribute('data-original-width');
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
});
|
|
1477
|
+
};
|
|
1459
1478
|
|
|
1460
1479
|
const delay = (ms) => new Promise(res => setTimeout(res, ms));
|
|
1461
1480
|
const slideAnimation = async () => {
|
|
@@ -67985,6 +68004,10 @@ const matchStringPattern = (pattern, arr) => {
|
|
|
67985
68004
|
const patternGroups = pattern.split(',').map(group => group.trim());
|
|
67986
68005
|
let arrIndex = 0;
|
|
67987
68006
|
let options = new Set();
|
|
68007
|
+
if (patternGroups.length > 0) {
|
|
68008
|
+
if (arr.length === 0)
|
|
68009
|
+
return false; // If pattern is not empty but user provided array is empty, return false
|
|
68010
|
+
}
|
|
67988
68011
|
for (const group of patternGroups) {
|
|
67989
68012
|
if (group.startsWith('(') && group.endsWith(')')) {
|
|
67990
68013
|
// Inside parentheses: '|' acts like "OR" condition
|
|
@@ -68201,6 +68224,9 @@ const validateObjectiveStatus = async () => {
|
|
|
68201
68224
|
}
|
|
68202
68225
|
const onCorrect = container.getAttribute('onCorrect');
|
|
68203
68226
|
if (onCorrect) {
|
|
68227
|
+
if (attach === 'true') {
|
|
68228
|
+
appendingDragElementsInDrop();
|
|
68229
|
+
}
|
|
68204
68230
|
await executeActions(onCorrect, container);
|
|
68205
68231
|
}
|
|
68206
68232
|
triggerNextContainer();
|
|
@@ -68445,7 +68471,6 @@ const getElementsForQueries = (query) => {
|
|
|
68445
68471
|
const sortedDragSelectedElements = Array.from(dragSelectedElements).sort((a, b) => parseInt(a.getAttribute(DropTimeAttr)) - parseInt(b.getAttribute(DropTimeAttr)));
|
|
68446
68472
|
return sortedDragSelectedElements;
|
|
68447
68473
|
};
|
|
68448
|
-
let currentlySpeakingElement = null;
|
|
68449
68474
|
const speakIcon = (targetElement) => {
|
|
68450
68475
|
if (targetElement.className.includes('lido-speak-icon')) {
|
|
68451
68476
|
return null;
|
|
@@ -68464,39 +68489,31 @@ const speakIcon = (targetElement) => {
|
|
|
68464
68489
|
// targetElement.appendChild(speakIcon);
|
|
68465
68490
|
speakIcon.addEventListener('click', async (event) => {
|
|
68466
68491
|
event.stopPropagation();
|
|
68467
|
-
//
|
|
68468
|
-
//
|
|
68469
|
-
if (currentlySpeakingElement && currentlySpeakingElement !== targetElement) {
|
|
68470
|
-
try {
|
|
68471
|
-
await AudioPlayer.getI().stop();
|
|
68472
|
-
}
|
|
68473
|
-
catch (err) {
|
|
68474
|
-
console.warn('Failed to stop previous audio:', err);
|
|
68475
|
-
}
|
|
68476
|
-
}
|
|
68477
|
-
currentlySpeakingElement = targetElement;
|
|
68492
|
+
setCancelBtnPopup(true); // Cancel popup loop
|
|
68493
|
+
await AudioPlayer.getI().stop(); // Stop current playback immediately
|
|
68478
68494
|
try {
|
|
68479
|
-
await AudioPlayer.getI().play(targetElement);
|
|
68495
|
+
await AudioPlayer.getI().play(targetElement); // Play clicked element
|
|
68480
68496
|
}
|
|
68481
68497
|
catch (error) {
|
|
68482
68498
|
console.error('Error playing audio or TTS:', error);
|
|
68483
68499
|
}
|
|
68500
|
+
setCancelBtnPopup(false); // Reset cancel state
|
|
68484
68501
|
});
|
|
68485
68502
|
if (targetElement['type'] === 'option') {
|
|
68486
68503
|
speakIcon.style.position = 'unset';
|
|
68487
68504
|
return parentDiv;
|
|
68488
68505
|
}
|
|
68489
|
-
targetElement.style.position =
|
|
68506
|
+
targetElement.style.position = 'relative';
|
|
68490
68507
|
return speakIcon;
|
|
68491
68508
|
};
|
|
68492
|
-
const attachSpeakIcon = (element, x, y) => {
|
|
68509
|
+
const attachSpeakIcon = async (element, x, y) => {
|
|
68493
68510
|
const speakIconElement = speakIcon(element);
|
|
68494
68511
|
if (element['type'] === 'option') {
|
|
68495
68512
|
const icon = speakIconElement.firstChild;
|
|
68496
68513
|
icon.style.marginLeft = x;
|
|
68497
68514
|
icon.style.marginTop = y;
|
|
68498
68515
|
}
|
|
68499
|
-
element.
|
|
68516
|
+
element.append(speakIconElement);
|
|
68500
68517
|
};
|
|
68501
68518
|
const clearLocalStorage = () => {
|
|
68502
68519
|
localStorage.removeItem(DragSelectedMapKey);
|
|
@@ -68514,11 +68531,11 @@ const setVisibilityWithDelay = async (element, delayVisible) => {
|
|
|
68514
68531
|
return;
|
|
68515
68532
|
if (delayVisible) {
|
|
68516
68533
|
const delay = parseInt(delayVisible, 10);
|
|
68517
|
-
element.style.visibility =
|
|
68534
|
+
element.style.visibility = 'hidden';
|
|
68518
68535
|
if (!isNaN(delay)) {
|
|
68519
|
-
await new Promise(
|
|
68536
|
+
await new Promise(resolve => {
|
|
68520
68537
|
setTimeout(() => {
|
|
68521
|
-
element.style.visibility =
|
|
68538
|
+
element.style.visibility = 'visible';
|
|
68522
68539
|
resolve();
|
|
68523
68540
|
}, delay);
|
|
68524
68541
|
});
|
|
@@ -68559,6 +68576,30 @@ const vibrateCell = async (cell, value) => {
|
|
|
68559
68576
|
// Remove the class after the animation completes
|
|
68560
68577
|
cell.classList.remove(className);
|
|
68561
68578
|
};
|
|
68579
|
+
function calculateScale() {
|
|
68580
|
+
var _a;
|
|
68581
|
+
const widths = [window.innerWidth];
|
|
68582
|
+
const heights = [window.innerHeight];
|
|
68583
|
+
if ((_a = window.screen) === null || _a === void 0 ? void 0 : _a.width) {
|
|
68584
|
+
widths.push(window.screen.width);
|
|
68585
|
+
heights.push(window.screen.height);
|
|
68586
|
+
}
|
|
68587
|
+
const width = Math.min(...widths);
|
|
68588
|
+
const height = Math.min(...heights);
|
|
68589
|
+
const isPortrait = height > width;
|
|
68590
|
+
const scaleX = isPortrait ? width / 900 : width / 1600;
|
|
68591
|
+
const scaleY = isPortrait ? height / 1600 : height / 900;
|
|
68592
|
+
const scale = Math.min(scaleX, scaleY); // Ensure uniform scaling
|
|
68593
|
+
return scale;
|
|
68594
|
+
}
|
|
68595
|
+
// for handling multiple speak elements played once at a time
|
|
68596
|
+
let cancelBtnPopupState = false;
|
|
68597
|
+
function setCancelBtnPopup(value) {
|
|
68598
|
+
cancelBtnPopupState = value;
|
|
68599
|
+
}
|
|
68600
|
+
function getCancelBtnPopup() {
|
|
68601
|
+
return cancelBtnPopupState;
|
|
68602
|
+
}
|
|
68562
68603
|
|
|
68563
68604
|
exports.AudioPlayer = AudioPlayer;
|
|
68564
68605
|
exports.LidoContainer = LidoContainer;
|
|
@@ -68566,6 +68607,7 @@ exports.NextContainerKey = NextContainerKey;
|
|
|
68566
68607
|
exports.PrevContainerKey = PrevContainerKey;
|
|
68567
68608
|
exports.RiveService = RiveService;
|
|
68568
68609
|
exports.attachSpeakIcon = attachSpeakIcon;
|
|
68610
|
+
exports.calculateScale = calculateScale;
|
|
68569
68611
|
exports.clearLocalStorage = clearLocalStorage;
|
|
68570
68612
|
exports.commonjsGlobal = commonjsGlobal;
|
|
68571
68613
|
exports.convertUrlToRelative = convertUrlToRelative;
|
|
@@ -68575,13 +68617,14 @@ exports.dispatchGameExitEvent = dispatchGameExitEvent;
|
|
|
68575
68617
|
exports.executeActions = executeActions;
|
|
68576
68618
|
exports.format = format;
|
|
68577
68619
|
exports.fraction = fraction;
|
|
68620
|
+
exports.getCancelBtnPopup = getCancelBtnPopup;
|
|
68578
68621
|
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
|
68579
68622
|
exports.handleElementClick = handleElementClick;
|
|
68580
68623
|
exports.handleFloatElementPosition = handleFloatElementPosition;
|
|
68581
68624
|
exports.handlingChildElements = handlingChildElements;
|
|
68582
68625
|
exports.initEventsForElement = initEventsForElement;
|
|
68583
|
-
exports.number = number;
|
|
68584
68626
|
exports.parseProp = parseProp;
|
|
68627
|
+
exports.setCancelBtnPopup = setCancelBtnPopup;
|
|
68585
68628
|
exports.setVisibilityWithDelay = setVisibilityWithDelay;
|
|
68586
68629
|
exports.speakIcon = speakIcon;
|
|
68587
68630
|
exports.tinyColor = tinyColor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { convertUrlToRelative, initEventsForElement,
|
|
2
|
+
import { convertUrlToRelative, initEventsForElement, calculateScale } from "../../utils/utils";
|
|
3
3
|
/**
|
|
4
4
|
* @component LidoContainer
|
|
5
5
|
*
|
|
@@ -38,8 +38,8 @@ export class LidoContainer {
|
|
|
38
38
|
this.isAllowOnlyCorrect = false;
|
|
39
39
|
this.baseUrl = '';
|
|
40
40
|
this.margin = '';
|
|
41
|
-
this.showPrevButton =
|
|
42
|
-
this.showNextButton =
|
|
41
|
+
this.showPrevButton = 'false';
|
|
42
|
+
this.showNextButton = 'false';
|
|
43
43
|
this.delayVisible = '';
|
|
44
44
|
}
|
|
45
45
|
convertToPixels(height, parentElement = document.body) {
|
|
@@ -66,43 +66,11 @@ export class LidoContainer {
|
|
|
66
66
|
* @param container The container element to be scaled.
|
|
67
67
|
*/
|
|
68
68
|
scaleContainer(container) {
|
|
69
|
-
var _a;
|
|
70
|
-
const widths = [window.innerWidth];
|
|
71
|
-
const heights = [window.innerHeight];
|
|
72
|
-
if ((_a = window.screen) === null || _a === void 0 ? void 0 : _a.width) {
|
|
73
|
-
widths.push(window.screen.width);
|
|
74
|
-
heights.push(window.screen.height);
|
|
75
|
-
}
|
|
76
|
-
const width = Math.min(...widths);
|
|
77
|
-
const height = Math.min(...heights); // Get the smallest height
|
|
78
|
-
const isPortrait = height > width; // Check if the device is in portrait mode
|
|
79
|
-
let scaleX;
|
|
80
|
-
let scaleY;
|
|
81
|
-
if (isPortrait) {
|
|
82
|
-
// Portrait Mode: Scale based on portrait reference size (e.g., 900x1600)
|
|
83
|
-
scaleX = width / 900;
|
|
84
|
-
scaleY = height / 1600;
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
// Landscape Mode: Scale based on landscape reference size (e.g., 1600x900)
|
|
88
|
-
scaleX = width / 1600;
|
|
89
|
-
scaleY = height / 900;
|
|
90
|
-
}
|
|
91
|
-
const scale = Math.min(scaleX, scaleY); // Ensure uniform scaling
|
|
92
69
|
// Center the container and apply scaling
|
|
93
|
-
container.style.transform = `translate(-50%, -50%) scale(${
|
|
70
|
+
container.style.transform = `translate(-50%, -50%) scale(${calculateScale()})`;
|
|
94
71
|
container.style.left = '50%';
|
|
95
72
|
container.style.top = '50%';
|
|
96
73
|
container.style.position = 'absolute'; // Ensure proper positioning
|
|
97
|
-
setTimeout(() => {
|
|
98
|
-
const navBar = document.querySelector('.lido-dot-container');
|
|
99
|
-
console.log('navBar', navBar);
|
|
100
|
-
if (navBar) {
|
|
101
|
-
navBar.style.width = `${container.offsetWidth - 25}px`;
|
|
102
|
-
navBar.style.transform = `translate(-50%, -50%) scale(${scale})`; //ensure proper scaling
|
|
103
|
-
navBar.style.visibility = 'visible';
|
|
104
|
-
}
|
|
105
|
-
}, 100);
|
|
106
74
|
this.screenOrientation();
|
|
107
75
|
}
|
|
108
76
|
screenOrientation() {
|
|
@@ -122,7 +90,6 @@ export class LidoContainer {
|
|
|
122
90
|
* - Adds event listeners for `resize` and `load` to rescale the container on window size changes.
|
|
123
91
|
*/
|
|
124
92
|
componentDidLoad() {
|
|
125
|
-
setVisibilityWithDelay(this.el, this.delayVisible);
|
|
126
93
|
this.scaleContainer(this.el);
|
|
127
94
|
const backGroundImage = this.bgImage ? convertUrlToRelative(this.bgImage) : '';
|
|
128
95
|
document.body.style.backgroundColor = this.bgColor;
|
|
@@ -155,7 +122,7 @@ export class LidoContainer {
|
|
|
155
122
|
margin: this.margin,
|
|
156
123
|
};
|
|
157
124
|
console.log('🚀 ~ LidoContainer ~ canplay:', this.canplay);
|
|
158
|
-
return (h(Host, { key: '
|
|
125
|
+
return (h(Host, { key: '7973350ab1163200af05910818e03001cd8a5ff9', id: "lido-container", "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 }, h("slot", { key: '4167e635d955bdd3bc713cf3eac79c437918bb3c' })));
|
|
159
126
|
}
|
|
160
127
|
static get is() { return "lido-container"; }
|
|
161
128
|
static get originalStyleUrls() {
|
|
@@ -708,7 +675,7 @@ export class LidoContainer {
|
|
|
708
675
|
},
|
|
709
676
|
"attribute": "show-prev-button",
|
|
710
677
|
"reflect": false,
|
|
711
|
-
"defaultValue": "
|
|
678
|
+
"defaultValue": "'false'"
|
|
712
679
|
},
|
|
713
680
|
"showNextButton": {
|
|
714
681
|
"type": "string",
|
|
@@ -726,7 +693,7 @@ export class LidoContainer {
|
|
|
726
693
|
},
|
|
727
694
|
"attribute": "show-next-button",
|
|
728
695
|
"reflect": false,
|
|
729
|
-
"defaultValue": "
|
|
696
|
+
"defaultValue": "'false'"
|
|
730
697
|
},
|
|
731
698
|
"delayVisible": {
|
|
732
699
|
"type": "string",
|