lido-player 0.0.2-alpha-50-dev → 0.0.2-alpha-52-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/dist/cjs/{index-6a69c33a.js → index-baff5c15.js} +48 -14
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{lido-avatar_21.cjs.entry.js → lido-avatar_22.cjs.entry.js} +3043 -162
- package/dist/cjs/lido-player.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{utils-079a5e7d.js → utils-ce99b0d0.js} +294 -108
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/avatar/lido-avatar.css +4 -4
- package/dist/collection/components/avatar/lido-avatar.js +1 -1
- package/dist/collection/components/calculator/lido-calculator.css +87 -87
- package/dist/collection/components/calculator/lido-calculator.js +14 -8
- package/dist/collection/components/canvas/lido-canvas.css +35 -0
- package/dist/collection/components/canvas/lido-canvas.js +220 -0
- package/dist/collection/components/cell/lido-cell.css +100 -100
- package/dist/collection/components/cell/lido-cell.js +12 -12
- package/dist/collection/components/column/lido-col.css +19 -19
- package/dist/collection/components/column/lido-col.js +6 -6
- package/dist/collection/components/container/lido-container.css +10 -10
- package/dist/collection/components/container/lido-container.js +70 -8
- package/dist/collection/components/flashCard/lido-flash-card.css +28 -28
- package/dist/collection/components/flashCard/lido-flash-card.js +4 -4
- package/dist/collection/components/float/lido-float.css +30 -30
- package/dist/collection/components/float/lido-float.js +2 -2
- package/dist/collection/components/home/lido-home.css +278 -278
- package/dist/collection/components/home/lido-home.js +92 -12
- package/dist/collection/components/image/lido-image.css +17 -17
- package/dist/collection/components/image/lido-image.js +6 -6
- package/dist/collection/components/keyboard/lido-keyboard.css +38 -38
- package/dist/collection/components/keyboard/lido-keyboard.js +3 -3
- package/dist/collection/components/mathMatrix/lido-math-matrix.css +56 -56
- package/dist/collection/components/mathMatrix/lido-math-matrix.js +69 -15
- package/dist/collection/components/position/lido-pos.css +16 -16
- package/dist/collection/components/position/lido-pos.js +2 -2
- package/dist/collection/components/random/lido-random.css +8 -8
- package/dist/collection/components/random/lido-random.js +2 -2
- package/dist/collection/components/root/lido-root.js +42 -6
- package/dist/collection/components/row/lido-row.css +10 -10
- package/dist/collection/components/row/lido-row.js +6 -6
- package/dist/collection/components/scale/lido-balance.css +145 -114
- package/dist/collection/components/scale/lido-balance.js +17 -17
- package/dist/collection/components/shape/lido-shape.css +96 -96
- package/dist/collection/components/shape/lido-shape.js +5 -5
- package/dist/collection/components/slideFill/lido-slide-fill.css +3 -3
- package/dist/collection/components/slideFill/lido-slide-fill.js +13 -13
- package/dist/collection/components/text/lido-text.css +53 -53
- package/dist/collection/components/text/lido-text.js +6 -5
- package/dist/collection/components/trace/lido-trace.css +97 -97
- package/dist/collection/components/trace/lido-trace.js +2 -2
- package/dist/collection/components/wrap/lido-wrap.css +18 -18
- package/dist/collection/components/wrap/lido-wrap.js +6 -6
- package/dist/collection/css/animation.css +194 -194
- package/dist/collection/css/index.css +277 -277
- package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +60 -60
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +123 -123
- package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +55 -48
- package/dist/collection/stories/Templates/Tag/tagGame.stories.js +29 -29
- package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +42 -42
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +37 -31
- package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +38 -38
- package/dist/collection/stories/Templates/blender/blender.stories.js +100 -0
- package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
- package/dist/collection/stories/Templates/calculator/calculator.stories.js +52 -0
- package/dist/collection/stories/Templates/categorize/categorize.stories.js +37 -37
- package/dist/collection/stories/Templates/categorize2/categorize2.stories.js +67 -67
- package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +28 -22
- package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +13 -13
- package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +74 -74
- package/dist/collection/stories/Templates/dragAndDrop/drag-drop.stories.js +69 -69
- package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +39 -38
- package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +282 -282
- package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +37 -35
- package/dist/collection/stories/Templates/grid/grid.stories.js +118 -118
- package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +57 -57
- package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +41 -41
- package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +183 -183
- package/dist/collection/stories/Templates/makeSentence/make-sentence.stories.js +36 -36
- package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +69 -69
- package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +54 -54
- package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +25 -23
- package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +112 -112
- package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +47 -47
- package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +32 -28
- package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +56 -54
- package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +56 -45
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +41 -39
- package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +131 -127
- package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +53 -49
- package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +44 -40
- package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +98 -97
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +92 -91
- package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +47 -45
- package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +20 -20
- package/dist/collection/stories/Templates/puzzleGame/puzzleGame.stories.js +17 -17
- package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +62 -58
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +50 -50
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +36 -36
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +43 -43
- package/dist/collection/stories/Templates/reorder/reorder.stories.js +63 -63
- package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +52 -48
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +65 -61
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +62 -58
- package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +111 -107
- package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +46 -46
- package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +41 -41
- package/dist/collection/stories/Templates/storyTale/storyTale.stories.js +39 -39
- package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +51 -47
- package/dist/collection/stories/Templates/total/total.stories.js +27 -27
- package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +35 -31
- package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +62 -58
- package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +44 -40
- package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +36 -32
- package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +37 -33
- package/dist/collection/stories/components/flash-card.stories.js +48 -48
- package/dist/collection/stories/components/keyboard.stories.js +10 -10
- package/dist/collection/stories/components/slider.stories.js +4 -4
- package/dist/collection/stories/components/trace.stories.js +5 -5
- package/dist/collection/utils/audioPlayer.js +43 -6
- package/dist/collection/utils/constants.js +1 -0
- package/dist/collection/utils/i18n.js +36 -0
- package/dist/collection/utils/utils.js +170 -36
- package/dist/collection/utils/utilsHandlers/clickHandler.js +5 -1
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +27 -15
- package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
- package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +2 -2
- package/dist/collection/utils/utilsHandlers/lidoCalculatorHandler.js +9 -9
- package/dist/collection/utils/utilsHandlers/sortHandler.js +10 -10
- 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.d.ts +11 -0
- package/dist/components/lido-canvas.js +6 -0
- 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 +49 -25
- 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-9be56729.js → p-00777872.js} +46 -2
- package/dist/components/{p-3f406017.js → p-06171259.js} +2 -2
- package/dist/components/{p-08d0deab.js → p-09f1e2d2.js} +15 -9
- package/dist/components/{p-e4e42677.js → p-0c2aebfb.js} +2 -2
- package/dist/components/p-0fbeb3a1.js +2700 -0
- package/dist/components/{p-cbac3cbc.js → p-11bf64aa.js} +2 -2
- package/dist/components/{p-44808985.js → p-26df0769.js} +7 -7
- package/dist/components/{p-1fbdb431.js → p-2d53e1a5.js} +2 -2
- package/dist/components/{p-afbc196f.js → p-39a2e638.js} +3 -2
- package/dist/components/{p-e36ddcc1.js → p-3ce3744c.js} +14 -11
- package/dist/components/{p-7f7e5672.js → p-3f4d4c0a.js} +2 -2
- package/dist/components/{p-d37ab4dc.js → p-52e77394.js} +2 -2
- package/dist/components/{p-bed94c37.js → p-58c67252.js} +331 -118
- package/dist/components/p-5b5f59a8.js +129 -0
- package/dist/components/{p-52844fa4.js → p-68112f8c.js} +2 -2
- package/dist/components/{p-15971ede.js → p-8a34b98b.js} +1 -1
- package/dist/components/{p-904711c8.js → p-8f2ed62f.js} +2 -2
- package/dist/components/{p-74849cdd.js → p-9d34d59d.js} +4 -4
- package/dist/components/{p-73e31a86.js → p-a2f96840.js} +8 -8
- package/dist/components/{p-90465904.js → p-a516a324.js} +2 -2
- package/dist/components/{p-322acda6.js → p-b2125fc9.js} +67 -31
- package/dist/components/{p-835b973d.js → p-c4abfd0f.js} +2 -2
- package/dist/components/{p-29bdd953.js → p-cb56a853.js} +2 -2
- package/dist/esm/{index-170e58c7.js → index-37c2ad2d.js} +48 -14
- package/dist/esm/index.js +2 -2
- package/dist/esm/{lido-avatar_21.entry.js → lido-avatar_22.entry.js} +3043 -163
- package/dist/esm/lido-player.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-5df09162.js → utils-107b15a7.js} +294 -108
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-606ea279.entry.js +1 -0
- package/dist/lido-player/p-9a9d5339.js +2 -0
- package/dist/lido-player/{p-7556e652.js → p-d1251482.js} +2 -2
- package/dist/types/components/canvas/lido-canvas.d.ts +27 -0
- package/dist/types/components/container/lido-container.d.ts +6 -0
- package/dist/types/components/home/lido-home.d.ts +8 -0
- package/dist/types/components/mathMatrix/lido-math-matrix.d.ts +3 -1
- package/dist/types/components/root/lido-root.d.ts +5 -0
- package/dist/types/components.d.ts +71 -6
- package/dist/types/stories/Templates/RocketGame/rocketGame.stories.d.ts +1 -0
- package/dist/types/stories/Templates/blender/blender.stories.d.ts +4 -0
- package/dist/types/stories/Templates/calculator/calculator.stories.d.ts +4 -0
- package/dist/types/stories/Templates/multiplyBeeds/multiplyBeeds.stories.d.ts +1 -0
- package/dist/types/stories/Templates/openwindow/openwindow.stories.d.ts +1 -0
- package/dist/types/stories/Templates/openwindow/openwindow2.stories.d.ts +1 -0
- package/dist/types/stories/Templates/questionBoard/questionBoard.stories.d.ts +1 -0
- package/dist/types/stories/Templates/sequenceBox/sequenceBox1.stories.d.ts +1 -0
- package/dist/types/stories/Templates/sequenceBox/sequenceBox2.stories.d.ts +1 -0
- package/dist/types/stories/Templates/shapePair/shape-pair.stories.d.ts +1 -1
- package/dist/types/stories/Templates/sumTogether/sumTogether.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeCard/writeCard.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeLetter/writeLetter.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeNumber/writeNumber.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeWord/writeWord.stories.d.ts +1 -0
- package/dist/types/types/json.d.ts +4 -0
- package/dist/types/utils/audioPlayer.d.ts +2 -0
- package/dist/types/utils/constants.d.ts +1 -0
- package/dist/types/utils/i18n.d.ts +5 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +71 -69
- package/readme.md +113 -113
- package/dist/lido-player/p-137c99ce.js +0 -2
- package/dist/lido-player/p-eb956325.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'lido-player';
|
|
2
|
-
const BUILD = /* lido-player */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback:
|
|
2
|
+
const BUILD = /* lido-player */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: false, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: false, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Platform v4.20.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -45,7 +45,6 @@ var plt$1 = {
|
|
|
45
45
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
46
46
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
47
47
|
};
|
|
48
|
-
var supportsShadow = BUILD.shadowDom;
|
|
49
48
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
50
49
|
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
51
50
|
try {
|
|
@@ -344,10 +343,15 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
344
343
|
var attachStyles = (hostRef) => {
|
|
345
344
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
346
345
|
const elm = hostRef.$hostElement$;
|
|
346
|
+
const flags = cmpMeta.$flags$;
|
|
347
347
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
348
|
-
addStyle(
|
|
349
|
-
elm.getRootNode(),
|
|
348
|
+
const scopeId2 = addStyle(
|
|
349
|
+
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
350
350
|
cmpMeta);
|
|
351
|
+
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
352
|
+
elm["s-sc"] = scopeId2;
|
|
353
|
+
elm.classList.add(scopeId2 + "-h");
|
|
354
|
+
}
|
|
351
355
|
endAttachStyles();
|
|
352
356
|
};
|
|
353
357
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
@@ -496,6 +500,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
496
500
|
if (!useNativeShadowDom) {
|
|
497
501
|
checkSlotRelocate = true;
|
|
498
502
|
if (newVNode2.$tag$ === "slot") {
|
|
503
|
+
if (scopeId) {
|
|
504
|
+
parentElm.classList.add(scopeId + "-s");
|
|
505
|
+
}
|
|
499
506
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
500
507
|
// slot element has fallback content
|
|
501
508
|
// still create an element that "mocks" the slot element
|
|
@@ -526,7 +533,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
526
533
|
}
|
|
527
534
|
if (newVNode2.$children$) {
|
|
528
535
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
529
|
-
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
536
|
+
childNode = createElm(oldParentVNode, newVNode2, i2, elm);
|
|
530
537
|
if (childNode) {
|
|
531
538
|
elm.appendChild(childNode);
|
|
532
539
|
}
|
|
@@ -579,9 +586,12 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
579
586
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
580
587
|
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
581
588
|
let childNode;
|
|
589
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
590
|
+
containerElm = containerElm.shadowRoot;
|
|
591
|
+
}
|
|
582
592
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
583
593
|
if (vnodes[startIdx]) {
|
|
584
|
-
childNode = createElm(null, parentVNode, startIdx);
|
|
594
|
+
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
585
595
|
if (childNode) {
|
|
586
596
|
vnodes[startIdx].$elm$ = childNode;
|
|
587
597
|
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
@@ -668,7 +678,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
668
678
|
if (idxInOld >= 0) {
|
|
669
679
|
elmToMove = oldCh[idxInOld];
|
|
670
680
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
671
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
681
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
|
|
672
682
|
} else {
|
|
673
683
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
674
684
|
oldCh[idxInOld] = void 0;
|
|
@@ -676,7 +686,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
676
686
|
}
|
|
677
687
|
newStartVnode = newCh[++newStartIdx];
|
|
678
688
|
} else {
|
|
679
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
689
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx, parentElm);
|
|
680
690
|
newStartVnode = newCh[++newStartIdx];
|
|
681
691
|
}
|
|
682
692
|
if (node) {
|
|
@@ -880,8 +890,11 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
880
890
|
rootVnode.$tag$ = null;
|
|
881
891
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
882
892
|
hostRef.$vnode$ = rootVnode;
|
|
883
|
-
rootVnode.$elm$ = oldVNode.$elm$ = hostElm;
|
|
884
|
-
|
|
893
|
+
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
894
|
+
{
|
|
895
|
+
scopeId = hostElm["s-sc"];
|
|
896
|
+
}
|
|
897
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
885
898
|
{
|
|
886
899
|
contentRef = hostElm["s-cr"];
|
|
887
900
|
checkSlotFallbackVisibility = false;
|
|
@@ -1309,6 +1322,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1309
1322
|
{
|
|
1310
1323
|
cmpMeta.$attrsToReflect$ = [];
|
|
1311
1324
|
}
|
|
1325
|
+
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
1312
1326
|
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
1313
1327
|
Object.assign(Cstr.prototype, {
|
|
1314
1328
|
__registerHost() {
|
|
@@ -1317,6 +1331,9 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1317
1331
|
connectedCallback() {
|
|
1318
1332
|
getHostRef(this);
|
|
1319
1333
|
connectedCallback(this);
|
|
1334
|
+
if (originalConnectedCallback) {
|
|
1335
|
+
originalConnectedCallback.call(this);
|
|
1336
|
+
}
|
|
1320
1337
|
},
|
|
1321
1338
|
disconnectedCallback() {
|
|
1322
1339
|
disconnectedCallback(this);
|
|
@@ -1326,7 +1343,17 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1326
1343
|
},
|
|
1327
1344
|
__attachShadow() {
|
|
1328
1345
|
{
|
|
1329
|
-
this.shadowRoot
|
|
1346
|
+
if (!this.shadowRoot) {
|
|
1347
|
+
{
|
|
1348
|
+
this.attachShadow({ mode: "open" });
|
|
1349
|
+
}
|
|
1350
|
+
} else {
|
|
1351
|
+
if (this.shadowRoot.mode !== "open") {
|
|
1352
|
+
throw new Error(
|
|
1353
|
+
`Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
|
|
1354
|
+
);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1330
1357
|
}
|
|
1331
1358
|
}
|
|
1332
1359
|
});
|
|
@@ -1528,34 +1555,34 @@ function highlightSpeakingElement(element) {
|
|
|
1528
1555
|
if (!document.querySelector(styleId)) {
|
|
1529
1556
|
const style = document.createElement('style');
|
|
1530
1557
|
style.id = styleId;
|
|
1531
|
-
style.innerHTML = `
|
|
1532
|
-
.speaking-highlight {
|
|
1533
|
-
--base-transform: ${element.style.transform};
|
|
1534
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
1535
|
-
// border: 3px solid green !important;
|
|
1536
|
-
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
1537
|
-
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
1538
|
-
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
1539
|
-
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1542
|
-
@keyframes pulseEffect {
|
|
1543
|
-
0% {
|
|
1544
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1545
|
-
// transform: var(--base-transform) scale(1.05);
|
|
1546
|
-
// background-color: #FFFF0B;
|
|
1547
|
-
}
|
|
1548
|
-
50% {
|
|
1549
|
-
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
1550
|
-
// transform: var(--base-transform) scale(1.1);
|
|
1551
|
-
// background-color: #FFFF0B;
|
|
1552
|
-
}
|
|
1553
|
-
100% {
|
|
1554
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1555
|
-
// transform: var(--base-transform) scale(1.05);
|
|
1556
|
-
// background-color: #FFFF0B;
|
|
1557
|
-
}
|
|
1558
|
-
}
|
|
1558
|
+
style.innerHTML = `
|
|
1559
|
+
.speaking-highlight {
|
|
1560
|
+
--base-transform: ${element.style.transform};
|
|
1561
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
1562
|
+
// border: 3px solid green !important;
|
|
1563
|
+
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
1564
|
+
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
1565
|
+
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
1566
|
+
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
@keyframes pulseEffect {
|
|
1570
|
+
0% {
|
|
1571
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1572
|
+
// transform: var(--base-transform) scale(1.05);
|
|
1573
|
+
// background-color: #FFFF0B;
|
|
1574
|
+
}
|
|
1575
|
+
50% {
|
|
1576
|
+
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
1577
|
+
// transform: var(--base-transform) scale(1.1);
|
|
1578
|
+
// background-color: #FFFF0B;
|
|
1579
|
+
}
|
|
1580
|
+
100% {
|
|
1581
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1582
|
+
// transform: var(--base-transform) scale(1.05);
|
|
1583
|
+
// background-color: #FFFF0B;
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1559
1586
|
`;
|
|
1560
1587
|
document.head.appendChild(style);
|
|
1561
1588
|
}
|
|
@@ -1627,8 +1654,8 @@ function balanceResult(container, objectiveString) {
|
|
|
1627
1654
|
return false;
|
|
1628
1655
|
const leftVal = Number((_c = (_a = balanceEl.leftVal) !== null && _a !== void 0 ? _a : (_b = balanceEl.dataset) === null || _b === void 0 ? void 0 : _b.leftVal) !== null && _c !== void 0 ? _c : 0);
|
|
1629
1656
|
const rightVal = Number((_f = (_d = balanceEl.rightVal) !== null && _d !== void 0 ? _d : (_e = balanceEl.dataset) === null || _e === void 0 ? void 0 : _e.rightVal) !== null && _f !== void 0 ? _f : 0);
|
|
1630
|
-
const hasLeft = !isNaN(leftVal)
|
|
1631
|
-
const hasRight = !isNaN(rightVal)
|
|
1657
|
+
const hasLeft = !isNaN(leftVal);
|
|
1658
|
+
const hasRight = !isNaN(rightVal);
|
|
1632
1659
|
if (!hasLeft || !hasRight) {
|
|
1633
1660
|
return false;
|
|
1634
1661
|
}
|
|
@@ -1678,6 +1705,7 @@ function enableOptionArea(element) {
|
|
|
1678
1705
|
}
|
|
1679
1706
|
let isDraggingDisabled = false;
|
|
1680
1707
|
const setDraggingDisabled = (disabled) => {
|
|
1708
|
+
console.log("Setting dragging disabled to:", disabled);
|
|
1681
1709
|
isDraggingDisabled = disabled;
|
|
1682
1710
|
};
|
|
1683
1711
|
function enableDraggingWithScaling(element) {
|
|
@@ -1867,7 +1895,9 @@ function enableDraggingWithScaling(element) {
|
|
|
1867
1895
|
mostOverlappedElement.style.backgroundColor = 'rgba(255, 0, 0, 0.1)'; // Light red background
|
|
1868
1896
|
}
|
|
1869
1897
|
else {
|
|
1870
|
-
|
|
1898
|
+
if (!document.getElementById('unitsDrop') || !document.getElementById('tensDrop') || !document.getElementById('hundredsDrop')) {
|
|
1899
|
+
mostOverlappedElement.style.opacity = '0.3';
|
|
1900
|
+
}
|
|
1871
1901
|
}
|
|
1872
1902
|
}
|
|
1873
1903
|
};
|
|
@@ -1922,6 +1952,7 @@ function enableDraggingWithScaling(element) {
|
|
|
1922
1952
|
// Check for overlaps and log the most overlapping element
|
|
1923
1953
|
let mostOverlappedElement = findMostoverlappedElement$1(element, 'drop');
|
|
1924
1954
|
onElementDropComplete(element, mostOverlappedElement);
|
|
1955
|
+
executeActions("this.updateCountBlender='true'", container);
|
|
1925
1956
|
if (((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) {
|
|
1926
1957
|
if (mostOverlappedElement) {
|
|
1927
1958
|
if (element) {
|
|
@@ -2123,10 +2154,10 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2123
2154
|
let dropHasDrag = buildDropHasDragFromDOM();
|
|
2124
2155
|
if (!dropElement) {
|
|
2125
2156
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
2126
|
-
return;
|
|
2127
2157
|
}
|
|
2128
2158
|
const dropTabIndex = dropElement.getAttribute('tab-index');
|
|
2129
|
-
|
|
2159
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'false';
|
|
2160
|
+
if (((_b = dropHasDrag[dropTabIndex]) === null || _b === void 0 ? void 0 : _b.isFull) && !isAllowOnlyOneDrop) {
|
|
2130
2161
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
2131
2162
|
return;
|
|
2132
2163
|
}
|
|
@@ -2160,6 +2191,9 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2160
2191
|
if (!isCorrect) {
|
|
2161
2192
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
2162
2193
|
animateDragToTarget(dragElement, dropElement, container);
|
|
2194
|
+
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
2195
|
+
console.log("onincorrectttt", onInCorrect);
|
|
2196
|
+
await executeActions(onInCorrect, dropElement, dragElement);
|
|
2163
2197
|
setTimeout(() => {
|
|
2164
2198
|
dragElement.style.transform = 'translate(0, 0)';
|
|
2165
2199
|
// const oldDropIndex = dragToDropMap[dragElement.getAttribute('data-id')];
|
|
@@ -2259,7 +2293,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2259
2293
|
}
|
|
2260
2294
|
if (!(((_f = dropElement.getAttribute('dropAttr')) === null || _f === void 0 ? void 0 : _f.toLowerCase()) === DropMode.Diagonal) && (dropElement.getAttribute('minDrops') === '1' || !dropElement.getAttribute('minDrops'))) {
|
|
2261
2295
|
const isisFull = Object.values(dropHasDrag).find(item => document.getElementById(item.drop) === dropElement);
|
|
2262
|
-
|
|
2296
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
|
|
2297
|
+
if (isAllowOnlyOneDrop && isisFull) {
|
|
2263
2298
|
isisFull.isFull = true;
|
|
2264
2299
|
dropElement.setAttribute('is-full', 'true');
|
|
2265
2300
|
}
|
|
@@ -2294,8 +2329,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
2294
2329
|
// Check for overlaps and highlight only the most overlapping element
|
|
2295
2330
|
if (dropElement && !((_g = dropHasDrag[dropTabIndex]) === null || _g === void 0 ? void 0 : _g.isFull)) {
|
|
2296
2331
|
let mostOverlappedElement = findMostoverlappedElement$1(dragElement, 'drag');
|
|
2297
|
-
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true'
|
|
2298
|
-
if (
|
|
2332
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
|
|
2333
|
+
if (isAllowOnlyOneDrop && mostOverlappedElement) {
|
|
2299
2334
|
dragElement.style.transform = 'translate(0,0)';
|
|
2300
2335
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
2301
2336
|
const allElements = document.querySelectorAll("[type='drop']");
|
|
@@ -2428,14 +2463,14 @@ async function onClickDropOrDragElement(element, type) {
|
|
|
2428
2463
|
if (!document.querySelector('#dynamic-highlight-style')) {
|
|
2429
2464
|
const style = document.createElement('style');
|
|
2430
2465
|
style.id = 'dynamic-highlight-style';
|
|
2431
|
-
style.innerHTML = `
|
|
2432
|
-
.highlight {
|
|
2433
|
-
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
2434
|
-
// border-radius: 12px; /* Larger rounded corners */
|
|
2435
|
-
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
2436
|
-
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
2437
|
-
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
2438
|
-
}
|
|
2466
|
+
style.innerHTML = `
|
|
2467
|
+
.highlight {
|
|
2468
|
+
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
2469
|
+
// border-radius: 12px; /* Larger rounded corners */
|
|
2470
|
+
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
2471
|
+
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
2472
|
+
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
2473
|
+
}
|
|
2439
2474
|
`;
|
|
2440
2475
|
document.head.appendChild(style);
|
|
2441
2476
|
}
|
|
@@ -2477,7 +2512,11 @@ async function onClickDropOrDragElement(element, type) {
|
|
|
2477
2512
|
}
|
|
2478
2513
|
const dragToDropMap = new Map();
|
|
2479
2514
|
async function onClickDragElement(element) {
|
|
2480
|
-
|
|
2515
|
+
const audioAttr = element.getAttribute('audio');
|
|
2516
|
+
const hasValidAudio = audioAttr && audioAttr.trim().length > 0;
|
|
2517
|
+
if (hasValidAudio) {
|
|
2518
|
+
AudioPlayer.getI().stop();
|
|
2519
|
+
}
|
|
2481
2520
|
const dropElements = buildDropHasDragFromDOM();
|
|
2482
2521
|
const dragEl = element;
|
|
2483
2522
|
if (!dragEl) {
|
|
@@ -2552,6 +2591,7 @@ class AudioPlayer {
|
|
|
2552
2591
|
this.audioElement = document.createElement('audio');
|
|
2553
2592
|
this.audioElement.id = 'audio';
|
|
2554
2593
|
document.body.appendChild(this.audioElement);
|
|
2594
|
+
this.registerGlobalStopEvents();
|
|
2555
2595
|
}
|
|
2556
2596
|
static getI() {
|
|
2557
2597
|
if (!AudioPlayer.instance) {
|
|
@@ -2577,13 +2617,23 @@ class AudioPlayer {
|
|
|
2577
2617
|
}
|
|
2578
2618
|
}
|
|
2579
2619
|
async play(targetElement) {
|
|
2620
|
+
// Stop any currently playing audio first if target element has audio given
|
|
2621
|
+
try {
|
|
2622
|
+
await AudioPlayer.getI().stop();
|
|
2623
|
+
}
|
|
2624
|
+
catch (e) {
|
|
2625
|
+
console.error('Error stopping audio before speak action:', e);
|
|
2626
|
+
}
|
|
2627
|
+
// then play the target element audio.
|
|
2580
2628
|
let audioUrl = targetElement.getAttribute('audio') || '';
|
|
2629
|
+
// If no direct audio attribute, check childrens for audio
|
|
2581
2630
|
if (!audioUrl) {
|
|
2582
2631
|
const childElements = targetElement.children;
|
|
2583
2632
|
for (let i = 0; i < childElements.length; i++) {
|
|
2584
2633
|
const childAudioUrl = childElements[i].getAttribute('audio');
|
|
2585
2634
|
if (childAudioUrl) {
|
|
2586
2635
|
audioUrl = childAudioUrl;
|
|
2636
|
+
break;
|
|
2587
2637
|
}
|
|
2588
2638
|
}
|
|
2589
2639
|
}
|
|
@@ -2593,18 +2643,21 @@ class AudioPlayer {
|
|
|
2593
2643
|
console.log('🚀 Playing audio:', this.audioElement.src);
|
|
2594
2644
|
try {
|
|
2595
2645
|
setDraggingDisabled(true);
|
|
2596
|
-
await this.audioElement.play();
|
|
2597
2646
|
highlightSpeakingElement(targetElement);
|
|
2647
|
+
await this.audioElement.play();
|
|
2598
2648
|
await new Promise(resolve => {
|
|
2599
2649
|
this.audioElement.onended = () => {
|
|
2600
|
-
stopHighlightForSpeakingElement(targetElement);
|
|
2601
2650
|
resolve();
|
|
2602
|
-
setDraggingDisabled(false);
|
|
2603
2651
|
};
|
|
2604
2652
|
});
|
|
2605
2653
|
}
|
|
2606
2654
|
catch (error) {
|
|
2607
|
-
console.log('
|
|
2655
|
+
console.log('🎧 Audio play error:', error);
|
|
2656
|
+
}
|
|
2657
|
+
finally {
|
|
2658
|
+
this.audioElement.onended = null; // cleanup
|
|
2659
|
+
setDraggingDisabled(false);
|
|
2660
|
+
stopHighlightForSpeakingElement(targetElement);
|
|
2608
2661
|
}
|
|
2609
2662
|
}
|
|
2610
2663
|
// If no audio, use text-to-speech
|
|
@@ -2614,13 +2667,35 @@ class AudioPlayer {
|
|
|
2614
2667
|
await speakText(targetElement.textContent, targetElement);
|
|
2615
2668
|
const highlightedElements = document.querySelectorAll('.speaking-highlight');
|
|
2616
2669
|
highlightedElements.forEach(element => stopHighlightForSpeakingElement(element));
|
|
2617
|
-
setDraggingDisabled(false);
|
|
2618
2670
|
}
|
|
2619
2671
|
catch (error) {
|
|
2620
|
-
console.log('
|
|
2672
|
+
console.log('🎧 TTS Error:', error);
|
|
2673
|
+
}
|
|
2674
|
+
finally {
|
|
2675
|
+
setDraggingDisabled(false);
|
|
2621
2676
|
}
|
|
2622
2677
|
}
|
|
2623
2678
|
}
|
|
2679
|
+
// GLOBAL STOP EVENTS (container change, activity change…)
|
|
2680
|
+
registerGlobalStopEvents() {
|
|
2681
|
+
const stopEvents = [
|
|
2682
|
+
NextContainerKey, PrevContainerKey, LessonEndKey, ActivityChangeKey,
|
|
2683
|
+
ActivityEndKey, GameCompletedKey, GameExitKey
|
|
2684
|
+
];
|
|
2685
|
+
stopEvents.forEach(key => {
|
|
2686
|
+
window.addEventListener(key, () => this.stop());
|
|
2687
|
+
});
|
|
2688
|
+
}
|
|
2689
|
+
// DESTROY (for hot-reload)
|
|
2690
|
+
destroy() {
|
|
2691
|
+
console.log("AudioPlayer destroyed (hot-reload safe)");
|
|
2692
|
+
this.stop();
|
|
2693
|
+
// Remove DOM element
|
|
2694
|
+
if (this.audioElement.parentNode) {
|
|
2695
|
+
this.audioElement.parentNode.removeChild(this.audioElement);
|
|
2696
|
+
}
|
|
2697
|
+
AudioPlayer.instance = undefined;
|
|
2698
|
+
}
|
|
2624
2699
|
}
|
|
2625
2700
|
|
|
2626
2701
|
let preOverlap;
|
|
@@ -2779,11 +2854,11 @@ function enableReorderDrag(element) {
|
|
|
2779
2854
|
onDropToCategory(element, category);
|
|
2780
2855
|
}
|
|
2781
2856
|
if (divEl) {
|
|
2782
|
-
const keyframes = `
|
|
2783
|
-
@keyframes widthDecrease {
|
|
2784
|
-
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
2785
|
-
100% { width: 0px; height: 0px;}
|
|
2786
|
-
}
|
|
2857
|
+
const keyframes = `
|
|
2858
|
+
@keyframes widthDecrease {
|
|
2859
|
+
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
2860
|
+
100% { width: 0px; height: 0px;}
|
|
2861
|
+
}
|
|
2787
2862
|
`;
|
|
2788
2863
|
const styleSheet = document.styleSheets[0];
|
|
2789
2864
|
styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
|
|
@@ -2993,11 +3068,11 @@ function moveWithAnimation(target, overlapped) {
|
|
|
2993
3068
|
const dummy = createDummyElement(target);
|
|
2994
3069
|
dummy.style.visibility = 'hidden';
|
|
2995
3070
|
dummy.setAttribute('type', 'dummy');
|
|
2996
|
-
const keyframes = `
|
|
2997
|
-
@keyframes widthIncrease {
|
|
2998
|
-
0% { width: 0px; height: 0px; }
|
|
2999
|
-
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
3000
|
-
}
|
|
3071
|
+
const keyframes = `
|
|
3072
|
+
@keyframes widthIncrease {
|
|
3073
|
+
0% { width: 0px; height: 0px; }
|
|
3074
|
+
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
3075
|
+
}
|
|
3001
3076
|
`;
|
|
3002
3077
|
if (!overlapped) {
|
|
3003
3078
|
const overlapCategory = findMostoverlappedElement(target, 'category');
|
|
@@ -4554,7 +4629,11 @@ function addClickListenerForClickType(element) {
|
|
|
4554
4629
|
if (lido_buttons === 'lido-arrow-left' || lido_buttons === 'lido-arrow-right') {
|
|
4555
4630
|
return;
|
|
4556
4631
|
}
|
|
4557
|
-
|
|
4632
|
+
const audioAttr = element.getAttribute('audio');
|
|
4633
|
+
const hasValidAudio = audioAttr && audioAttr.trim().length > 0;
|
|
4634
|
+
if (hasValidAudio) {
|
|
4635
|
+
AudioPlayer.getI().stop();
|
|
4636
|
+
}
|
|
4558
4637
|
const container = document.getElementById(LidoContainer);
|
|
4559
4638
|
const objective = container['objective'].split(',');
|
|
4560
4639
|
const checkButton = document.querySelector('#lido-checkButton');
|
|
@@ -69467,15 +69546,15 @@ function calculateFill(input, currentFill = 0) {
|
|
|
69467
69546
|
// Helper to animate and remove the active equation cell
|
|
69468
69547
|
const animationToRemoveEquationSolvedCellForNimbleTable = (activeCell, allCalculateTypes) => {
|
|
69469
69548
|
return new Promise((resolve) => {
|
|
69470
|
-
const keyframes = `
|
|
69471
|
-
@keyframes widthDecrease {
|
|
69472
|
-
0% {
|
|
69473
|
-
background-color: ${activeCell.style.backgroundColor};
|
|
69474
|
-
height: ${activeCell.style.height};
|
|
69475
|
-
margin: ${activeCell.style.margin};
|
|
69476
|
-
${activeCell.innerHTML = ""}
|
|
69477
|
-
}
|
|
69478
|
-
100% { background-color: transparent; height: 0px; margin: 0px; }
|
|
69549
|
+
const keyframes = `
|
|
69550
|
+
@keyframes widthDecrease {
|
|
69551
|
+
0% {
|
|
69552
|
+
background-color: ${activeCell.style.backgroundColor};
|
|
69553
|
+
height: ${activeCell.style.height};
|
|
69554
|
+
margin: ${activeCell.style.margin};
|
|
69555
|
+
${activeCell.innerHTML = ""}
|
|
69556
|
+
}
|
|
69557
|
+
100% { background-color: transparent; height: 0px; margin: 0px; }
|
|
69479
69558
|
}`;
|
|
69480
69559
|
const styleSheet = document.styleSheets[0];
|
|
69481
69560
|
styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
|
|
@@ -70008,7 +70087,15 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
70008
70087
|
break;
|
|
70009
70088
|
}
|
|
70010
70089
|
case 'speak': {
|
|
70011
|
-
|
|
70090
|
+
const val = (action.value || '').toString().trim().toLowerCase();
|
|
70091
|
+
if (val === 'true' || val === '1' || val === 'yes') {
|
|
70092
|
+
try {
|
|
70093
|
+
await AudioPlayer.getI().play(targetElement);
|
|
70094
|
+
}
|
|
70095
|
+
catch (err) {
|
|
70096
|
+
console.error('Error playing audio for speak action:', err);
|
|
70097
|
+
}
|
|
70098
|
+
}
|
|
70012
70099
|
break;
|
|
70013
70100
|
}
|
|
70014
70101
|
case 'fill-slide': {
|
|
@@ -70130,6 +70217,53 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
70130
70217
|
}
|
|
70131
70218
|
break;
|
|
70132
70219
|
}
|
|
70220
|
+
case 'disableType': {
|
|
70221
|
+
const dragEle = document.querySelector('[type="drag"]');
|
|
70222
|
+
dragEle.removeAttribute('type');
|
|
70223
|
+
dragEle.style.pointerEvents = 'none';
|
|
70224
|
+
break;
|
|
70225
|
+
}
|
|
70226
|
+
case 'updateCountBlender': {
|
|
70227
|
+
const allDrags = document.querySelectorAll('[type="drag"]');
|
|
70228
|
+
let units = 0;
|
|
70229
|
+
let tens = 0;
|
|
70230
|
+
let hundreds = 0;
|
|
70231
|
+
allDrags.forEach(el => {
|
|
70232
|
+
const dropTo = el.getAttribute("drop-to");
|
|
70233
|
+
if (dropTo === "unitsDrop")
|
|
70234
|
+
units++;
|
|
70235
|
+
if (dropTo === "tensDrop")
|
|
70236
|
+
tens++;
|
|
70237
|
+
if (dropTo === "hundredsDrop")
|
|
70238
|
+
hundreds++;
|
|
70239
|
+
});
|
|
70240
|
+
const unitsValue = units * 1;
|
|
70241
|
+
const tensValue = tens * 10;
|
|
70242
|
+
const hundredsValue = hundreds * 100;
|
|
70243
|
+
const totalValue = unitsValue + tensValue + hundredsValue;
|
|
70244
|
+
// ✅ Update Lido Text Boxes
|
|
70245
|
+
const unitsBox = document.getElementById("units");
|
|
70246
|
+
const tensBox = document.getElementById("tens");
|
|
70247
|
+
const hundredsBox = document.getElementById("hundreds");
|
|
70248
|
+
if (unitsBox) {
|
|
70249
|
+
unitsBox.setAttribute("string", unitsValue.toString());
|
|
70250
|
+
}
|
|
70251
|
+
if (tensBox) {
|
|
70252
|
+
tensBox.setAttribute("string", tensValue.toString());
|
|
70253
|
+
}
|
|
70254
|
+
if (hundredsBox) {
|
|
70255
|
+
hundredsBox.setAttribute("string", hundredsValue.toString());
|
|
70256
|
+
}
|
|
70257
|
+
console.log(`Units = ${units} → ${unitsValue}`);
|
|
70258
|
+
console.log(`Tens = ${tens} → ${tensValue}`);
|
|
70259
|
+
console.log(`Hundreds = ${hundreds} → ${hundredsValue}`);
|
|
70260
|
+
console.log(`✅ Total Value = ${totalValue}`);
|
|
70261
|
+
break;
|
|
70262
|
+
}
|
|
70263
|
+
case 'updateCalculatorAnswer': {
|
|
70264
|
+
updateCalculatorAnswer();
|
|
70265
|
+
break;
|
|
70266
|
+
}
|
|
70133
70267
|
default: {
|
|
70134
70268
|
targetElement.style[action.action] = action.value;
|
|
70135
70269
|
break;
|
|
@@ -70146,6 +70280,7 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
70146
70280
|
const isInfinite = container.getAttribute('drop-action') === DropAction.InfiniteDrop;
|
|
70147
70281
|
if (isAppend || isInfinite) {
|
|
70148
70282
|
setTimeout(() => {
|
|
70283
|
+
var _a, _b;
|
|
70149
70284
|
dragElement.style.transform = 'translate(0,0)';
|
|
70150
70285
|
dragElement.style.transition = '';
|
|
70151
70286
|
let dummyElement = document.createElement('div');
|
|
@@ -70160,11 +70295,11 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
70160
70295
|
}
|
|
70161
70296
|
dummyElement.setAttribute('id', dragElement.getAttribute('id'));
|
|
70162
70297
|
dragElement.replaceWith(dummyElement);
|
|
70163
|
-
const keyframes = `
|
|
70164
|
-
@keyframes widthDecrease {
|
|
70165
|
-
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
70166
|
-
100% { width: 0px; height: 0px; margin: 0px;}
|
|
70167
|
-
}
|
|
70298
|
+
const keyframes = `
|
|
70299
|
+
@keyframes widthDecrease {
|
|
70300
|
+
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
70301
|
+
100% { width: 0px; height: 0px; margin: 0px;}
|
|
70302
|
+
}
|
|
70168
70303
|
`;
|
|
70169
70304
|
if (!isInfinite) {
|
|
70170
70305
|
dummyElement.style.width = element.style.width;
|
|
@@ -70179,6 +70314,14 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
70179
70314
|
dummyElement.style.margin = '0px';
|
|
70180
70315
|
});
|
|
70181
70316
|
}
|
|
70317
|
+
const orientation = window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
|
|
70318
|
+
const rowAttr = dropElement.getAttribute('dropAttr');
|
|
70319
|
+
const dropAttr = parseProp(rowAttr, orientation); // will return stackcascade or verticalstack
|
|
70320
|
+
if (((_a = (dropAttr)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "stackcascade" || ((_b = (dropAttr)) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === "verticalstack") {
|
|
70321
|
+
dropElement.append(dragElement);
|
|
70322
|
+
placeElementInDropZone(dropElement, dragElement, orientation, dropAttr);
|
|
70323
|
+
return;
|
|
70324
|
+
}
|
|
70182
70325
|
dropElement.parentElement.append(element);
|
|
70183
70326
|
dragElement.style.position = 'absolute';
|
|
70184
70327
|
dragElement.style.zIndex = '1';
|
|
@@ -70191,16 +70334,41 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
70191
70334
|
const scaledLeft = (dropCenterX - dragCenterX) / containerScale;
|
|
70192
70335
|
const scaledTop = (dropCenterY - dragCenterY) / containerScale;
|
|
70193
70336
|
dragElement.style.transform = `translate(${scaledLeft}px, ${scaledTop}px)`;
|
|
70194
|
-
},
|
|
70337
|
+
}, 100);
|
|
70195
70338
|
}
|
|
70196
70339
|
};
|
|
70340
|
+
// function cloneElementWithComputedStyles(originalEl: HTMLElement): HTMLElement {
|
|
70341
|
+
// let clone = document.createElement('div') as HTMLElement;
|
|
70342
|
+
// clone.innerHTML = originalEl.outerHTML;
|
|
70343
|
+
// clone = clone.firstChild as HTMLElement;
|
|
70344
|
+
// clone.setAttribute('height', originalEl.style.height);
|
|
70345
|
+
// clone.setAttribute('width', originalEl.style.width);
|
|
70346
|
+
// clone.setAttribute('visible', 'true');
|
|
70347
|
+
// return clone;
|
|
70348
|
+
// }
|
|
70197
70349
|
function cloneElementWithComputedStyles(originalEl) {
|
|
70198
|
-
|
|
70199
|
-
|
|
70200
|
-
|
|
70201
|
-
|
|
70202
|
-
|
|
70203
|
-
|
|
70350
|
+
const tag = originalEl.tagName.toLowerCase();
|
|
70351
|
+
if (tag === "lido-text") {
|
|
70352
|
+
let clone = document.createElement('div');
|
|
70353
|
+
clone.innerHTML = originalEl.outerHTML;
|
|
70354
|
+
clone = clone.firstChild;
|
|
70355
|
+
clone.setAttribute('height', originalEl.style.height);
|
|
70356
|
+
clone.setAttribute('width', originalEl.style.width);
|
|
70357
|
+
clone.setAttribute('visible', 'true');
|
|
70358
|
+
return clone;
|
|
70359
|
+
}
|
|
70360
|
+
// ✅ For ALL other types (INCLUDING lido-image & matrix) use your simple logic
|
|
70361
|
+
const clone = originalEl.cloneNode(false);
|
|
70362
|
+
clone.style.width = originalEl.style.width;
|
|
70363
|
+
clone.style.height = originalEl.style.height;
|
|
70364
|
+
clone.style.margin = originalEl.style.margin;
|
|
70365
|
+
clone.style.opacity = originalEl.style.opacity;
|
|
70366
|
+
clone.style.transform = originalEl.style.transform;
|
|
70367
|
+
clone.setAttribute("visible", "true");
|
|
70368
|
+
clone.setAttribute("data-dummy", "true");
|
|
70369
|
+
if (tag === "lido-math-matrix") {
|
|
70370
|
+
clone.setAttribute('clickable', "false");
|
|
70371
|
+
}
|
|
70204
70372
|
return clone;
|
|
70205
70373
|
}
|
|
70206
70374
|
// Function to parse actions string
|
|
@@ -70327,10 +70495,6 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
70327
70495
|
await executeActions(onCorrect, dropElement, dragElement);
|
|
70328
70496
|
}
|
|
70329
70497
|
}
|
|
70330
|
-
else {
|
|
70331
|
-
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
70332
|
-
await executeActions(onInCorrect, dropElement, dragElement);
|
|
70333
|
-
}
|
|
70334
70498
|
}
|
|
70335
70499
|
let dragScore = buildDragSelectedMapFromDOM();
|
|
70336
70500
|
const sortedValues = getSortedValuesArrayFromMap(dragScore);
|
|
@@ -70342,21 +70506,6 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
70342
70506
|
drag[index] = [];
|
|
70343
70507
|
}
|
|
70344
70508
|
drag[index].push(dragElement.id);
|
|
70345
|
-
// localStorage.setItem(DragMapKey, JSON.stringify(drag));
|
|
70346
|
-
Object.keys(dragScore).sort((a, b) => parseInt(a) - parseInt(b));
|
|
70347
|
-
if (dragElement && dropElement) {
|
|
70348
|
-
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
70349
|
-
if (isCorrect) {
|
|
70350
|
-
const onCorrect = dropElement.getAttribute('onCorrect');
|
|
70351
|
-
if (onCorrect) {
|
|
70352
|
-
await executeActions(onCorrect, dropElement, dragElement);
|
|
70353
|
-
}
|
|
70354
|
-
}
|
|
70355
|
-
else {
|
|
70356
|
-
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
70357
|
-
await executeActions(onInCorrect, dropElement, dragElement);
|
|
70358
|
-
}
|
|
70359
|
-
}
|
|
70360
70509
|
const allElements = document.querySelectorAll("[type='drop']");
|
|
70361
70510
|
allElements.forEach(otherElement => {
|
|
70362
70511
|
var _a;
|
|
@@ -70446,6 +70595,7 @@ const validateObjectiveStatus = async () => {
|
|
|
70446
70595
|
return;
|
|
70447
70596
|
const objectiveString = container['objective'];
|
|
70448
70597
|
const additionalCheck = container.getAttribute('equationCheck');
|
|
70598
|
+
container.getAttribute('isAllowOnlyCorrect') === 'true' || '';
|
|
70449
70599
|
console.log('🚀 ~ validateObjectiveStatus ~ additionalCheck:', additionalCheck);
|
|
70450
70600
|
let equationGiven = false;
|
|
70451
70601
|
if (objectiveString == null || objectiveString.length === 0) {
|
|
@@ -70497,13 +70647,15 @@ const validateObjectiveStatus = async () => {
|
|
|
70497
70647
|
await calculateScore();
|
|
70498
70648
|
}
|
|
70499
70649
|
else {
|
|
70500
|
-
const onInCorrect = container.getAttribute('onInCorrect');
|
|
70501
|
-
await executeActions(onInCorrect, container);
|
|
70502
70650
|
const isContinueOnCorrect = container.getAttribute('is-continue-on-correct') === 'true';
|
|
70503
70651
|
if (!isContinueOnCorrect) {
|
|
70504
70652
|
triggerNextContainer();
|
|
70505
70653
|
await calculateScore();
|
|
70506
70654
|
}
|
|
70655
|
+
else {
|
|
70656
|
+
const onInCorrect = container.getAttribute('onInCorrect');
|
|
70657
|
+
await executeActions(onInCorrect, container);
|
|
70658
|
+
}
|
|
70507
70659
|
}
|
|
70508
70660
|
};
|
|
70509
70661
|
const triggerNextContainer = () => {
|
|
@@ -71067,14 +71219,14 @@ const SumTogetherAnimation = async (element, value) => {
|
|
|
71067
71219
|
const sign = ((signElement && ((signElement.getAttribute('string') || signElement.textContent) || '')).toString().trim() === '+') ? '+' : '-';
|
|
71068
71220
|
if (sign === '-') {
|
|
71069
71221
|
// '-' flow: reveal one by one then change bgColor of last B to red
|
|
71070
|
-
for (let i = 0; i < topRowChildren.length; i++) {
|
|
71222
|
+
for (let i = 0; i < Math.min(number1, topRowChildren.length); i++) {
|
|
71071
71223
|
await new Promise(resolve => setTimeout(resolve, 75));
|
|
71072
71224
|
showElement(topRowChildren[i]);
|
|
71073
71225
|
}
|
|
71074
71226
|
elementAppearance(true);
|
|
71075
71227
|
await new Promise(r => setTimeout(r, 500));
|
|
71076
71228
|
for (let k = 0; k < Math.min(number2, topRowChildren.length); k++) {
|
|
71077
|
-
const idx = topRowChildren.length - 1 - k;
|
|
71229
|
+
const idx = Math.min(number1, topRowChildren.length) - 1 - k;
|
|
71078
71230
|
setImageBackground(topRowChildren[idx], 'red');
|
|
71079
71231
|
await new Promise(r => setTimeout(r, 200));
|
|
71080
71232
|
}
|
|
@@ -71099,5 +71251,66 @@ const SumTogetherAnimation = async (element, value) => {
|
|
|
71099
71251
|
elementAppearance(false);
|
|
71100
71252
|
}
|
|
71101
71253
|
};
|
|
71254
|
+
function placeElementInDropZone(dropElement, dragElement, orientation, dropAttr) {
|
|
71255
|
+
const dropRect = dropElement.getBoundingClientRect();
|
|
71256
|
+
const dragRect = dragElement.getBoundingClientRect();
|
|
71257
|
+
const scale = typeof calculateScale === "function" ? calculateScale() : 1;
|
|
71258
|
+
if (!dropElement.dataset.dropCount)
|
|
71259
|
+
dropElement.dataset.dropCount = "0";
|
|
71260
|
+
let dropCount = parseInt(dropElement.dataset.dropCount, 10);
|
|
71261
|
+
// === READ DROP ZONE SIZE ===
|
|
71262
|
+
const dropWidth = dropRect.width;
|
|
71263
|
+
const dropHeight = dropRect.height;
|
|
71264
|
+
let targetX, targetY;
|
|
71265
|
+
// ---------------- LANDSCAPE WATERFALL ----------------
|
|
71266
|
+
if (orientation === "landscape" && dropAttr.toLowerCase() === "stackcascade") {
|
|
71267
|
+
console.log("🌄 Landscape waterfall");
|
|
71268
|
+
const shiftX = dropWidth * 0.02; // proportional (5% of width)
|
|
71269
|
+
const shiftY = dropHeight * 0.02; // proportional (5% of height)
|
|
71270
|
+
const startX = dropRect.left + dropWidth * 0.36; // 10% inside
|
|
71271
|
+
const startY = dropRect.top + dropHeight * -0.09; // slightly above
|
|
71272
|
+
targetX = startX + (dropCount * shiftX);
|
|
71273
|
+
targetY = startY + (dropCount * shiftY);
|
|
71274
|
+
}
|
|
71275
|
+
// ---------------- PORTRAIT VERTICAL ----------------
|
|
71276
|
+
else {
|
|
71277
|
+
console.log("📱 Portrait vertical stack");
|
|
71278
|
+
let startX;
|
|
71279
|
+
const stepY = dropHeight * 0.05; // 8% vertical step
|
|
71280
|
+
if (dropElement.id === "unitsDrop") {
|
|
71281
|
+
startX = dropRect.left + dropWidth * 0.4; // special spacing
|
|
71282
|
+
}
|
|
71283
|
+
else if (dropElement.id === "tensDrop") {
|
|
71284
|
+
startX = dropRect.left + dropWidth * 0.25;
|
|
71285
|
+
}
|
|
71286
|
+
else {
|
|
71287
|
+
startX = dropRect.left + dropWidth * 0.16; // normal spacing
|
|
71288
|
+
}
|
|
71289
|
+
const startY = dropRect.top - dropHeight * 0.25; // above start
|
|
71290
|
+
targetX = startX;
|
|
71291
|
+
targetY = startY + (dropCount * stepY);
|
|
71292
|
+
}
|
|
71293
|
+
// ------------ APPLY TRANSFORM SMOOTHLY --------------
|
|
71294
|
+
const dx = (targetX - dragRect.left) / scale;
|
|
71295
|
+
const dy = (targetY - dragRect.top) / scale;
|
|
71296
|
+
dragElement.style.transition = "transform .2s ease-out";
|
|
71297
|
+
dragElement.style.transform = `translate(${dx}px, ${dy}px)`;
|
|
71298
|
+
dropElement.dataset.dropCount = String(dropCount + 1);
|
|
71299
|
+
// reset size
|
|
71300
|
+
dragElement.style.width = "auto";
|
|
71301
|
+
dragElement.style.height = "auto";
|
|
71302
|
+
}
|
|
71303
|
+
const updateCalculatorAnswer = () => {
|
|
71304
|
+
const container = document.getElementById(LidoContainer);
|
|
71305
|
+
if (!container)
|
|
71306
|
+
return;
|
|
71307
|
+
const calci = document.querySelector('#lidoCalculator');
|
|
71308
|
+
if (!calci)
|
|
71309
|
+
return;
|
|
71310
|
+
const answerText = container.querySelector('#answer');
|
|
71311
|
+
const value = calci.getAttribute('value');
|
|
71312
|
+
console.log("😀😀😀😀😀😀😀", value);
|
|
71313
|
+
answerText.setAttribute('string', value);
|
|
71314
|
+
};
|
|
71102
71315
|
|
|
71103
71316
|
export { ActivityScoreKey as A, generateUUIDFallback as B, exitUrl as C, prevUrl as D, nextUrl as E, speakUrl as F, getCancelBtnPopup as G, H, triggerPrevcontainer as I, setCancelBtnPopup as J, getDefaultExportFromCjs as K, LidoContainer as L, tinyColor as M, NextContainerKey as N, triggerNextContainer as O, PrevContainerKey as P, DropAction as Q, RiveService as R, SelectedValuesKey as S, validateObjectiveStatus as T, fraction as U, TraceMode as V, speakIcon as W, fingerUrl as X, setNonce as a, setPlatformOptions as b, commonjsGlobal as c, setVisibilityWithDelay as d, convertUrlToRelative as e, format as f, getAssetPath$1 as g, h, initEventsForElement as i, Host as j, parseProp as k, createEvent as l, equationCheck as m, storingEachActivityScore as n, executeActions as o, proxyCustomElement as p, handlingChildElements as q, attachSpeakIcon as r, setAssetPath as s, calculateScale as t, handleFloatElementPosition as u, handleElementClick as v, dispatchActivityChangeEvent as w, dispatchGameCompletedEvent as x, dispatchGameExitEvent as y, AudioPlayer as z };
|