lido-player 0.0.2-alpha-57-dev → 0.0.2-alpha-59-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/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lido-avatar_22.cjs.entry.js +94 -34
- package/dist/cjs/lido-player.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-a61cfc6b.js → utils-03573882.js} +160 -124
- package/dist/collection/components/container/lido-container.js +60 -3
- package/dist/collection/components/flashCard/lido-flash-card.js +10 -1
- package/dist/collection/components/float/lido-float.js +1 -1
- package/dist/collection/components/home/lido-home.js +22 -12
- package/dist/collection/components/keyboard/lido-keyboard.js +2 -2
- package/dist/collection/components/mathMatrix/lido-math-matrix.js +1 -1
- package/dist/collection/components/position/lido-pos.js +1 -1
- package/dist/collection/components/random/lido-random.js +1 -1
- package/dist/collection/components/row/lido-row.js +1 -1
- package/dist/collection/components/scale/lido-balance.js +1 -1
- package/dist/collection/components/shape/lido-shape.js +2 -2
- package/dist/collection/components/slideFill/lido-slide-fill.js +1 -1
- package/dist/collection/components/text/lido-text.js +1 -1
- package/dist/collection/components/trace/lido-trace.js +18 -7
- package/dist/collection/components/wrap/lido-wrap.js +1 -1
- package/dist/collection/css/animation.css +17 -0
- package/dist/collection/css/index.css +1 -1
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +3 -3
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +1 -1
- package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +74 -44
- package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +4 -4
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +2 -2
- package/dist/collection/stories/Templates/numberIdentification/numberIdentificationimageTotext.stories.js +91 -0
- package/dist/collection/stories/Templates/numberIdentification/numberIdentificationtextTotext.stories.js +84 -0
- package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +0 -2
- package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +0 -2
- package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +6 -5
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +6 -6
- package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaMultiOption.stories.js +106 -0
- package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaSumTogether.stories.js +91 -0
- package/dist/collection/stories/Templates/palEgmaPatternMatching/palEgmaPatternMatching.stories.js +86 -0
- package/dist/collection/stories/Templates/palEgmaWordProblem/palEgmaWordProblem.stories.js +131 -0
- package/dist/collection/stories/Templates/palEgraInventedSpelling/pal_egra_invented_spelling_schema.stories.js +61 -0
- package/dist/collection/stories/Templates/palEgraMCQWithImage/palEgraMCQWithImage.stories.js +87 -0
- package/dist/collection/stories/Templates/palEgraStoryMaking/pal_egra_story_making.stories.js +72 -0
- package/dist/collection/stories/Templates/palEgraTemplate1/palEgraLetterIdentification.stories.js +61 -0
- package/dist/collection/stories/Templates/palEgra_OddOneOut/palEgra_oddOneOut.stories.js +60 -0
- package/dist/collection/stories/Templates/palEgra_word_formation/palEgra_WordFormation.stories.js +73 -0
- package/dist/collection/stories/Templates/pictureClues/pictureClues.stories.js +88 -0
- package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch1.stories.js +88 -0
- package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch2.stories.js +66 -0
- package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +1 -1
- package/dist/collection/stories/Templates/quizMaths/quizMaths.stories.js +7 -7
- package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +1 -1
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +16 -13
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +17 -14
- package/dist/collection/stories/Templates/substraction/substractionWithimg.stories.js +111 -0
- package/dist/collection/stories/Templates/substraction/substractionWithoutImg.stories.js +70 -0
- package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +11 -10
- package/dist/collection/stories/Templates/total/total.stories.js +2 -0
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithimg.stories.js +76 -0
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithoutimg.stories.js +74 -0
- package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +1 -1
- package/dist/collection/utils/constants.js +2 -1
- package/dist/collection/utils/utils.js +29 -20
- package/dist/collection/utils/utilsHandlers/clickHandler.js +2 -0
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +24 -20
- package/dist/collection/utils/utilsHandlers/highlightHandler.js +50 -2
- package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +5 -4
- package/dist/components/index.js +1 -1
- package/dist/components/lido-avatar.js +1 -1
- package/dist/components/lido-balance.js +1 -1
- package/dist/components/lido-calculator.js +1 -1
- package/dist/components/lido-canvas.js +1 -1
- package/dist/components/lido-cell.js +1 -1
- package/dist/components/lido-col.js +1 -1
- package/dist/components/lido-container.js +1 -1
- package/dist/components/lido-flash-card.js +1 -1
- package/dist/components/lido-float.js +1 -1
- package/dist/components/lido-home.js +1 -1
- package/dist/components/lido-image.js +1 -1
- package/dist/components/lido-keyboard.js +1 -1
- package/dist/components/lido-math-matrix.js +1 -1
- package/dist/components/lido-pos.js +1 -1
- package/dist/components/lido-random.js +1 -1
- package/dist/components/lido-root.js +22 -23
- 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-73e3f0f4.js → p-2bb1f74d.js} +203 -1
- package/dist/components/{p-f3bc4577.js → p-33b83222.js} +1 -1
- package/dist/components/{p-0712a27e.js → p-3513b1f3.js} +159 -125
- package/dist/components/{p-f2b53e8e.js → p-356e56bd.js} +2 -2
- package/dist/components/{p-b9875116.js → p-49ccf573.js} +18 -7
- package/dist/components/{p-330caab8.js → p-4d9462ab.js} +4 -4
- package/dist/components/{p-4d332eab.js → p-5aa24314.js} +2 -2
- package/dist/components/{p-d1b5079b.js → p-5c990168.js} +45 -6
- package/dist/components/{p-21852d55.js → p-5eeaccab.js} +2 -2
- package/dist/components/{p-480f708a.js → p-6819005f.js} +11 -2
- package/dist/components/{p-ffc40642.js → p-6bbad90f.js} +2 -2
- package/dist/components/{p-e1ba0c44.js → p-73e4bb01.js} +41 -33
- package/dist/components/{p-ff801ba1.js → p-84302365.js} +1 -1
- package/dist/components/{p-0a41b2f8.js → p-99fcbae4.js} +1 -1
- package/dist/components/{p-9104d427.js → p-9b35082a.js} +2 -2
- package/dist/components/{p-882b291d.js → p-ad0f335e.js} +2 -2
- package/dist/components/{p-c4739621.js → p-aff68c41.js} +3 -3
- package/dist/components/{p-2829c82c.js → p-d9b17242.js} +2 -2
- package/dist/components/{p-cca36777.js → p-de62d08e.js} +3 -3
- package/dist/components/{p-4e041807.js → p-e8e9250e.js} +2 -2
- package/dist/components/{p-17f84b2f.js → p-f238004e.js} +2 -2
- package/dist/components/{p-eab0ebb7.js → p-f9426cbe.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lido-avatar_22.entry.js +94 -34
- package/dist/esm/lido-player.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-7ed76799.js → utils-3995d2d5.js} +159 -125
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.css +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-75daccb0.entry.js +1 -0
- package/dist/lido-player/{p-17d93181.js → p-aee89fba.js} +2 -2
- package/dist/types/components/container/lido-container.d.ts +15 -2
- package/dist/types/components/trace/lido-trace.d.ts +3 -3
- package/dist/types/components.d.ts +10 -2
- package/dist/types/stories/Templates/numberIdentification/numberIdentificationimageTotext.stories.d.ts +4 -0
- package/dist/types/stories/Templates/numberIdentification/numberIdentificationtextTotext.stories.d.ts +4 -0
- package/dist/types/stories/Templates/palEgmaCalculateSum/palEgmaMultiOption.stories.d.ts +11 -0
- package/dist/types/stories/Templates/palEgmaCalculateSum/palEgmaSumTogether.stories.d.ts +12 -0
- package/dist/types/stories/Templates/palEgmaPatternMatching/palEgmaPatternMatching.stories.d.ts +4 -0
- package/dist/types/stories/Templates/palEgmaWordProblem/palEgmaWordProblem.stories.d.ts +5 -0
- package/dist/types/stories/Templates/palEgraInventedSpelling/pal_egra_invented_spelling_schema.stories.d.ts +4 -0
- package/dist/types/stories/Templates/palEgraMCQWithImage/palEgraMCQWithImage.stories.d.ts +4 -0
- package/dist/types/stories/Templates/palEgraStoryMaking/pal_egra_story_making.stories.d.ts +4 -0
- package/dist/types/stories/Templates/palEgraTemplate1/palEgraLetterIdentification.stories.d.ts +4 -0
- package/dist/types/stories/Templates/palEgra_OddOneOut/palEgra_oddOneOut.stories.d.ts +4 -0
- package/dist/types/stories/Templates/palEgra_word_formation/palEgra_WordFormation.stories.d.ts +4 -0
- package/dist/types/stories/Templates/pictureClues/pictureClues.stories.d.ts +4 -0
- package/dist/types/stories/Templates/pictureWordMatch/pictureWordMatch1.stories.d.ts +4 -0
- package/dist/types/stories/Templates/pictureWordMatch/pictureWordMatch2.stories.d.ts +4 -0
- package/dist/types/stories/Templates/substraction/substractionWithimg.stories.d.ts +4 -0
- package/dist/types/stories/Templates/substraction/substractionWithoutImg.stories.d.ts +4 -0
- package/dist/types/stories/Templates/wordBuilding/wordBuildingwithimg.stories.d.ts +4 -0
- package/dist/types/stories/Templates/wordBuilding/wordBuildingwithoutimg.stories.d.ts +4 -0
- package/dist/types/utils/constants.d.ts +9 -1
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/types/utils/utilsHandlers/highlightHandler.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/p-7ab0a273.js +0 -204
- package/dist/lido-player/p-fa9dfdf8.entry.js +0 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Templates/wordBuildingwithimg',
|
|
4
|
+
argTypes: {
|
|
5
|
+
option1: { control: 'text' },
|
|
6
|
+
option2: { control: 'text' },
|
|
7
|
+
option3: { control: 'text' },
|
|
8
|
+
option4: { control: 'text' },
|
|
9
|
+
option5: { control: 'text' },
|
|
10
|
+
letter1: { control: 'text' },
|
|
11
|
+
letter2: { control: 'text' },
|
|
12
|
+
img: { control: 'file' },
|
|
13
|
+
word: { control: 'text' },
|
|
14
|
+
answer: { control: 'text' },
|
|
15
|
+
isAllowOnlyCorrect: { control: 'boolean' },
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
export const wordBuildingwithimg = {
|
|
20
|
+
args: {
|
|
21
|
+
option1: "C",
|
|
22
|
+
option2: "W",
|
|
23
|
+
option3: "S",
|
|
24
|
+
option4: "P",
|
|
25
|
+
option5: "M",
|
|
26
|
+
img: "https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/WordBuilding/image.png",
|
|
27
|
+
isAllowOnlyCorrect: true,
|
|
28
|
+
word: "CAT",
|
|
29
|
+
letter1: "A",
|
|
30
|
+
letter2: "T",
|
|
31
|
+
answer: "C",
|
|
32
|
+
},
|
|
33
|
+
render: args => {
|
|
34
|
+
const xml = getContainerXml(args);
|
|
35
|
+
return html `<lido-home .xmlData="${xml}"></lido-home>`;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
function getContainerXml(args) {
|
|
39
|
+
const { isAllowOnlyCorrect = true } = args;
|
|
40
|
+
return `<main>
|
|
41
|
+
<lido-container visible="true" id="lido-container" template-id="mcq" objective="${args.answer}" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/WordBuilding/bgImage.png" onInCorrect="lido-avatar.avatarAnimate='Fail';this.sleep='2000';" onCorrect="lido-avatar.avatarAnimate='Success';this.sleep='1200';data.z-index='100'; data.boxShadow='0 0 40px #FFC107';this.sleep='300'; this.sleep='400'; data.boxShadow='none';this.sleep='2000';" is-continue-on-correct="true" is-allow-only-correct="${isAllowOnlyCorrect}" onEntry="blank.z-index='12';">
|
|
42
|
+
<!-- Chimple Avatar -->
|
|
43
|
+
<lido-cell layout="pos" id="pos1" disable-edit="true" value="pos2" height="landscape. 373px,portrait.402px" width="landscape.304px,portrait.398px" x="landscape.0%, portrait.28%" y="landscape.51%, portrait.77%" aria-hidden="true" z="1" bg-color="transparent" visible="true" >
|
|
44
|
+
<lido-avatar id="lido-avatar" disable-edit="true" visible="true" height="100%" width="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/temp2/chimplecharacter.riv" alt-text="{chimpleCharacterRive}">
|
|
45
|
+
</lido-avatar>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</lido-cell>
|
|
49
|
+
<lido-text visible="false" z-index="0" tab-index="19" audio="" id="inst" string="Choose the correct letter to form a word" ></lido-text>
|
|
50
|
+
<!-- <lido-text visible="true" z-index="1" height="114px" id="data" string="${args.word}" font-family="'Baloo Bhai 2'" font-color="black" font-size="144px" bg-color="transparent" y="23%" x="-203px" onEntry="this.fontWeight='700';this.position='relative';" ></lido-text>-->
|
|
51
|
+
<lido-cell visible="true" layout="col" height="84%" width="95%" bg-color="transparent" margin="5px -126px -107px 0px">
|
|
52
|
+
<lido-cell visible="true" id="xx" layout="row" height="auto" width="907px" bg-color="#FFF5BB" onEntry="this.align-items='center';this.justify-content='space-evenly';this.border='2px solid #FFB612';this.border-radius='16px';">
|
|
53
|
+
<lido-cell layout="row" id="blank" visible="true" z-index="2" height="200px" width="200px" onEntry="this.align-items='center';this.justify-content='center';">
|
|
54
|
+
|
|
55
|
+
<lido-text visible="true" string="_" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" bg-color="transparent" onEntry="this.fontWeight='700';" ></lido-text>
|
|
56
|
+
<lido-text visible="true" string="${args.letter1}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" bg-color="transparent" onEntry="this.fontWeight='700';" ></lido-text>
|
|
57
|
+
<lido-text visible="true" string="${args.letter2}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" bg-color="transparent" onEntry="this.fontWeight='700';" ></lido-text>
|
|
58
|
+
</lido-cell>
|
|
59
|
+
<lido-cell visible="true" height="330px" width="330px">
|
|
60
|
+
<lido-image visible="true" heigth="auto" width="auto" src="${args.img}"></lido-image>
|
|
61
|
+
</lido-cell>
|
|
62
|
+
</lido-cell>
|
|
63
|
+
<lido-cell visible="true" height="40%" width="79%" layout="row" >
|
|
64
|
+
<lido-text visible="true" type="click" value="${args.option1}" id="option1" tab-index="8" bg-color="#FFAC4C" height="212.4px" width="210px" string="${args.option1}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" onEntry="this.fontWeight='700';this.border-radius='16px';"></lido-text>
|
|
65
|
+
<lido-text visible="true" value="${args.option2}" type="click" id="option2" tab-index="9" bg-color="#FFAC4C" height="212.4px" width="210px" string="${args.option2}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" onEntry="this.fontWeight='700';this.border-radius='16px';"></lido-text>
|
|
66
|
+
<lido-text visible="true" value="${args.option3}" type="click" id="option3" tab-index="10" bg-color="#FFAC4C" height="212.4px" width="210px" string="${args.option3}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" onEntry="this.fontWeight='700';this.border-radius='16px';"></lido-text>
|
|
67
|
+
<lido-text visible="true" value="${args.option4}" type="click" id="option3" tab-index="10" bg-color="#FFAC4C" height="212.4px" width="210px" string="${args.option4}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" onEntry="this.fontWeight='700';this.border-radius='16px';"></lido-text>
|
|
68
|
+
<lido-text visible="true" value="${args.option5}" type="click" id="option3" tab-index="10" bg-color="#FFAC4C" height="212.4px" width="210px" string="${args.option5}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" onEntry="this.fontWeight='700';this.border-radius='16px';"></lido-text>
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
</lido-cell>
|
|
72
|
+
|
|
73
|
+
</lido-cell>
|
|
74
|
+
</lido-container>
|
|
75
|
+
</main>`;
|
|
76
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Templates/wordBuildingwithoutimg',
|
|
4
|
+
argTypes: {
|
|
5
|
+
option1: { control: 'text' },
|
|
6
|
+
option2: { control: 'text' },
|
|
7
|
+
option3: { control: 'text' },
|
|
8
|
+
option4: { control: 'text' },
|
|
9
|
+
option5: { control: 'text' },
|
|
10
|
+
isAllowOnlyCorrect: { control: 'boolean' },
|
|
11
|
+
letter1: { control: 'text' },
|
|
12
|
+
letter2: { control: 'text' },
|
|
13
|
+
img: { control: 'file' },
|
|
14
|
+
word: { control: 'text' },
|
|
15
|
+
answer: { control: 'text' },
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
export const wordBuildingwithoutimg = {
|
|
20
|
+
args: {
|
|
21
|
+
option1: "C",
|
|
22
|
+
option2: "W",
|
|
23
|
+
option3: "S",
|
|
24
|
+
option4: "P",
|
|
25
|
+
option5: "M",
|
|
26
|
+
isAllowOnlyCorrect: true,
|
|
27
|
+
word: "CAT",
|
|
28
|
+
letter1: "A",
|
|
29
|
+
letter2: "T",
|
|
30
|
+
answer: "C",
|
|
31
|
+
},
|
|
32
|
+
render: args => {
|
|
33
|
+
const xml = getContainerXml(args);
|
|
34
|
+
return html `<lido-home .xmlData="${xml}"></lido-home>`;
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
function getContainerXml(args) {
|
|
38
|
+
const { isAllowOnlyCorrect = true } = args;
|
|
39
|
+
return `<main>
|
|
40
|
+
<lido-container visible="true" id="lido-container" template-id="mcq" objective="${args.answer}" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/WordBuilding/bgImage.png" onInCorrect="lido-avatar.avatarAnimate='Fail';this.sleep='2000';" onCorrect="lido-avatar.avatarAnimate='Success';data.speak='true';this.sleep='1200';data.z-index='100'; data.boxShadow='0 0 40px #FFC107';this.sleep='300'; this.sleep='400'; data.boxShadow='none';this.sleep='2000';" is-continue-on-correct="${isAllowOnlyCorrect}" is-allow-only-correct="true" onEntry="inst.speak='true';blank.z-index='12';">
|
|
41
|
+
<!-- Chimple Avatar -->
|
|
42
|
+
<lido-cell layout="pos" id="pos1" disable-edit="true" value="pos2" height="landscape. 373px,portrait.402px" width="landscape.304px,portrait.398px" x="landscape.0%, portrait.28%" y="landscape.51%, portrait.77%" aria-hidden="true" z="1" bg-color="transparent" visible="true" >
|
|
43
|
+
<lido-avatar id="lido-avatar" disable-edit="true" visible="true" height="100%" width="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/temp2/chimplecharacter.riv" alt-text="{chimpleCharacterRive}">
|
|
44
|
+
</lido-avatar>
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
</lido-cell>
|
|
48
|
+
<lido-text visible="false" z-index="0" tab-index="19" audio="" id="inst" string="Choose the correct letter to form a word" ></lido-text>
|
|
49
|
+
<lido-text visible="false" z-index="1" height="114px" id="data" string="${args.word}" font-family="'Baloo Bhai 2'" font-color="black" font-size="146px" bg-color="transparent" y="179px" x="55px" onEntry="this.fontWeight='700';this.position='relative';" ></lido-text>
|
|
50
|
+
<!-- <lido-text visible="true" z-index="1" height="114px" id="data" string="${args.word}" font-family="'Baloo Bhai 2'" font-color="black" font-size="146px" bg-color="transparent" y="179px" x="55px" onEntry="this.fontWeight='700';this.position='relative';" ></lido-text>-->
|
|
51
|
+
<lido-cell visible="true" layout="col" height="84%" width="95%" bg-color="transparent" margin="5px -126px -107px 0px">
|
|
52
|
+
<lido-cell visible="true" id="xx" layout="row" height="300px" width="635px" bg-color="#FFF5BB" onEntry="this.align-items='center';this.justify-content='space-evenly';this.border='2px solid #FFB612';this.border-radius='16px';">
|
|
53
|
+
<lido-cell layout="row" id="blank" visible="true" z-index="2" height="200px" width="200px" onEntry="this.align-items='center';this.justify-content='center';">
|
|
54
|
+
|
|
55
|
+
<lido-text visible="true" string="_" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" bg-color="transparent" onEntry="this.fontWeight='700';" ></lido-text>
|
|
56
|
+
<lido-text visible="true" string="${args.letter1}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" bg-color="transparent" onEntry="this.fontWeight='700';" ></lido-text>
|
|
57
|
+
<lido-text visible="true" string="${args.letter2}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" bg-color="transparent" onEntry="this.fontWeight='700';" ></lido-text>
|
|
58
|
+
</lido-cell>
|
|
59
|
+
|
|
60
|
+
</lido-cell>
|
|
61
|
+
<lido-cell visible="true" height="40%" width="79%" layout="row" >
|
|
62
|
+
<lido-text visible="true" type="click" value="${args.option1}" id="option1" tab-index="8" bg-color="#FFAC4C" height="212.4px" width="210px" string="${args.option1}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" onEntry="this.fontWeight='700';this.border-radius='16px';"></lido-text>
|
|
63
|
+
<lido-text visible="true" value="${args.option2}" type="click" id="option2" tab-index="9" bg-color="#FFAC4C" height="212.4px" width="210px" string="${args.option2}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" onEntry="this.fontWeight='700';this.border-radius='16px';"></lido-text>
|
|
64
|
+
<lido-text visible="true" value="${args.option3}" type="click" id="option3" tab-index="10" bg-color="#FFAC4C" height="212.4px" width="210px" string="${args.option3}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" onEntry="this.fontWeight='700';this.border-radius='16px';"></lido-text>
|
|
65
|
+
<lido-text visible="true" value="${args.option4}" type="click" id="option3" tab-index="10" bg-color="#FFAC4C" height="212.4px" width="210px" string="${args.option4}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" onEntry="this.fontWeight='700';this.border-radius='16px';"></lido-text>
|
|
66
|
+
<lido-text visible="true" value="${args.option5}" type="click" id="option3" tab-index="10" bg-color="#FFAC4C" height="212.4px" width="210px" string="${args.option5}" font-family="'Baloo Bhai 2'" font-color="black" font-size="140px" onEntry="this.fontWeight='700';this.border-radius='16px';"></lido-text>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
</lido-cell>
|
|
70
|
+
|
|
71
|
+
</lido-cell>
|
|
72
|
+
</lido-container>
|
|
73
|
+
</main>`;
|
|
74
|
+
}
|
|
@@ -32,7 +32,7 @@ function getContainerXml(args) {
|
|
|
32
32
|
`;
|
|
33
33
|
}).join('');
|
|
34
34
|
return `<main>
|
|
35
|
-
<lido-container visible="true" show-next-button="
|
|
35
|
+
<lido-container visible="true" show-next-button="false" dropAttr="math-matrix" appendToDropOnCompletion="true" equationCheck="$#mat1,==,$#number" objective="" is-allow-only-correct="${isAllowOnlyCorrect}" bg-color="transparent" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Write%20Set.png" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" onCorrect="lido-avatar.avatarAnimate='Success'; number.speak='true'; this.sleep='2000';" is-continue-on-correct="${isContinueOnCorrect}">
|
|
36
36
|
|
|
37
37
|
<!-- Audio -->
|
|
38
38
|
<lido-text visible="false" id="audio123" onEntry="this.display='none'; this.speak='true';" string="Fill the matrix according to the number given in the box."></lido-text>
|
|
@@ -19,6 +19,7 @@ export const LidoContainer = 'lido-container';
|
|
|
19
19
|
export const LangChangeEvent = 'languageChanged';
|
|
20
20
|
export const LIDO_COMMON_AUDIO_PATH = '__LIDO_COMMON_AUDIO_PATH__';
|
|
21
21
|
export const LIDO_COMMON_AUDIO_READY_EVENT = 'lidoCommonAudioPathReady';
|
|
22
|
+
export const TemplateID = 'template-id';
|
|
22
23
|
export var TraceMode;
|
|
23
24
|
(function (TraceMode) {
|
|
24
25
|
TraceMode["NoFlow"] = "noFlow";
|
|
@@ -50,5 +51,5 @@ export var DropAction;
|
|
|
50
51
|
export const exitUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Close.svg';
|
|
51
52
|
export const prevUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Previous.svg';
|
|
52
53
|
export const nextUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Next.svg';
|
|
53
|
-
export const speakUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/
|
|
54
|
+
export const speakUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/audio.png';
|
|
54
55
|
export const fingerUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/Tracing-hand.svg';
|
|
@@ -10,7 +10,7 @@ import { enableDraggingWithScaling, enableOptionArea, getElementScale, handleDro
|
|
|
10
10
|
import { addClickListenerForClickType, onTouchListenerForOnTouch } from "./utilsHandlers/clickHandler";
|
|
11
11
|
import { evaluate, isArray } from "mathjs";
|
|
12
12
|
import { fillSlideHandle } from "./utilsHandlers/floatHandler";
|
|
13
|
-
import { stopHighlightForSpeakingElement } from "./utilsHandlers/highlightHandler";
|
|
13
|
+
import { highlightElement, stopHighlightForSpeakingElement } from "./utilsHandlers/highlightHandler";
|
|
14
14
|
import { handleSolvedEquationSubmissionAndScoreUpdate } from "./utilsHandlers/lidoCalculatorHandler";
|
|
15
15
|
import { handlingMatrix } from "./utilsHandlers/matrixHandler";
|
|
16
16
|
import { balanceResult } from "./utilsHandlers/lidoBalanceHandler";
|
|
@@ -105,7 +105,7 @@ export const initEventsForElement = async (element, type) => {
|
|
|
105
105
|
export const executeActions = async (actionsString, thisElement, element) => {
|
|
106
106
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
107
107
|
const actions = parseActions(actionsString);
|
|
108
|
-
body.style.pointerEvents = 'none';
|
|
108
|
+
// body.style.pointerEvents = 'none';
|
|
109
109
|
for (let i = 0; i < actions.length; i++) {
|
|
110
110
|
const action = actions[i];
|
|
111
111
|
const queriedElement = document.querySelector(action.actor);
|
|
@@ -549,12 +549,16 @@ export const countPatternWords = (pattern) => {
|
|
|
549
549
|
}
|
|
550
550
|
return wordCount;
|
|
551
551
|
};
|
|
552
|
+
export let countOfMistakes = 0;
|
|
552
553
|
export const storingEachActivityScore = (flag) => {
|
|
553
554
|
if (flag) {
|
|
554
555
|
gameScore.rightMoves += 1;
|
|
556
|
+
countOfMistakes = 0;
|
|
557
|
+
highlightElement();
|
|
555
558
|
}
|
|
556
559
|
else {
|
|
557
560
|
gameScore.wrongMoves += 1;
|
|
561
|
+
countOfMistakes += 1;
|
|
558
562
|
}
|
|
559
563
|
console.log('Right Moves : ', gameScore.rightMoves);
|
|
560
564
|
console.log('Wrong Moves : ', gameScore.wrongMoves);
|
|
@@ -601,7 +605,7 @@ export async function onActivityComplete(dragElement, dropElement) {
|
|
|
601
605
|
if (storedTabIndexes.includes(JSON.parse(otherElement.getAttribute('tab-index')))) {
|
|
602
606
|
if (!(((_a = otherElement.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal)) {
|
|
603
607
|
if (otherElement.tagName.toLowerCase() === 'lido-text') {
|
|
604
|
-
otherElement.style.backgroundColor = 'transparent'; // Reset background color**
|
|
608
|
+
// otherElement.style.backgroundColor = 'transparent'; // Reset background color**
|
|
605
609
|
}
|
|
606
610
|
if (otherElement.tagName.toLowerCase() === 'lido-image') {
|
|
607
611
|
otherElement.style.opacity = '0';
|
|
@@ -611,7 +615,7 @@ export async function onActivityComplete(dragElement, dropElement) {
|
|
|
611
615
|
}
|
|
612
616
|
else {
|
|
613
617
|
if (otherElement.tagName.toLowerCase() === 'lido-text') {
|
|
614
|
-
otherElement.style.backgroundColor = 'transparent'; // Reset background color**********
|
|
618
|
+
// otherElement.style.backgroundColor = 'transparent'; // Reset background color**********
|
|
615
619
|
}
|
|
616
620
|
if (otherElement.tagName.toLowerCase() === 'lido-image') {
|
|
617
621
|
otherElement.style.opacity = '1';
|
|
@@ -738,8 +742,10 @@ export const validateObjectiveStatus = async () => {
|
|
|
738
742
|
}
|
|
739
743
|
else {
|
|
740
744
|
const isContinueOnCorrect = container.getAttribute('is-continue-on-correct') === 'true';
|
|
745
|
+
const onCorrect = container.getAttribute('onCorrect');
|
|
741
746
|
if (!isContinueOnCorrect) {
|
|
742
747
|
await calculateScore();
|
|
748
|
+
await executeActions(onCorrect, container);
|
|
743
749
|
triggerNextContainer();
|
|
744
750
|
}
|
|
745
751
|
else {
|
|
@@ -1202,10 +1208,22 @@ export const animateBoxCells = async (element, value) => {
|
|
|
1202
1208
|
await new Promise(resolve => setTimeout(resolve, 600)); // Adjust delay as needed
|
|
1203
1209
|
cell.classList.remove('lido-box-highlight');
|
|
1204
1210
|
}
|
|
1205
|
-
//
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1211
|
+
// checkout parent cell first then pick the first text child inside cell
|
|
1212
|
+
const parentCell = document.getElementById(LidoContainer);
|
|
1213
|
+
if (!parentCell)
|
|
1214
|
+
return;
|
|
1215
|
+
const firstTextChild = parentCell.querySelector('lido-text');
|
|
1216
|
+
if (firstTextChild) {
|
|
1217
|
+
// play the text child inside parent cell
|
|
1218
|
+
await AudioPlayer.getI().play(firstTextChild);
|
|
1219
|
+
}
|
|
1220
|
+
// Now select each box cell's text child and play them one by one
|
|
1221
|
+
for (const box of boxCells) {
|
|
1222
|
+
const text = box.querySelector('lido-text');
|
|
1223
|
+
console.log('box text', text);
|
|
1224
|
+
if (!text)
|
|
1225
|
+
continue;
|
|
1226
|
+
await AudioPlayer.getI().play(text);
|
|
1209
1227
|
}
|
|
1210
1228
|
};
|
|
1211
1229
|
export const questionBoxAnimation = async (element, value) => {
|
|
@@ -1232,15 +1250,6 @@ export const questionBoxAnimation = async (element, value) => {
|
|
|
1232
1250
|
const dropVal = dropEl.getAttribute("value");
|
|
1233
1251
|
if (dropVal && dropEl.innerText.trim() === "?") {
|
|
1234
1252
|
dropEl.innerText = dropVal;
|
|
1235
|
-
if (dropElements.length > 1 && check == false) {
|
|
1236
|
-
if (window.innerWidth > window.innerHeight) {
|
|
1237
|
-
dropEl.style.marginRight = "-45px";
|
|
1238
|
-
}
|
|
1239
|
-
else {
|
|
1240
|
-
dropEl.style.marginRight = "-65px";
|
|
1241
|
-
}
|
|
1242
|
-
check = true;
|
|
1243
|
-
}
|
|
1244
1253
|
}
|
|
1245
1254
|
});
|
|
1246
1255
|
};
|
|
@@ -1250,9 +1259,9 @@ export const SumTogetherAnimation = async (element, value) => {
|
|
|
1250
1259
|
if (!value)
|
|
1251
1260
|
return;
|
|
1252
1261
|
// Expecting structure: [_, TopRow, questionRow, optionRow, ...]
|
|
1253
|
-
const TopRow = Array.from(element.children)[
|
|
1254
|
-
const questionRow = Array.from(element.children)[
|
|
1255
|
-
const optionRow = Array.from(element.children)[
|
|
1262
|
+
const TopRow = Array.from(element.children)[2];
|
|
1263
|
+
const questionRow = Array.from(element.children)[3];
|
|
1264
|
+
const optionRow = Array.from(element.children)[4];
|
|
1256
1265
|
if (!TopRow || !questionRow || !optionRow)
|
|
1257
1266
|
return;
|
|
1258
1267
|
const topRowChildren = Array.from(TopRow.children);
|
|
@@ -4,6 +4,7 @@ import { LidoContainer, SelectedValuesKey } from "../constants";
|
|
|
4
4
|
import { dispatchClickEvent } from "../customEvents";
|
|
5
5
|
import tinycolor from "tinycolor2";
|
|
6
6
|
import { setDraggingDisabled } from "./dragDropHandler";
|
|
7
|
+
import { highlightElement } from "./highlightHandler";
|
|
7
8
|
export function onTouchListenerForOnTouch(element) {
|
|
8
9
|
if (!element)
|
|
9
10
|
return;
|
|
@@ -104,6 +105,7 @@ export function addClickListenerForClickType(element) {
|
|
|
104
105
|
if (!isInsideCalculator) {
|
|
105
106
|
storingEachActivityScore(isCorrect);
|
|
106
107
|
}
|
|
108
|
+
highlightElement();
|
|
107
109
|
handleShowCheck();
|
|
108
110
|
return;
|
|
109
111
|
}
|
|
@@ -3,7 +3,7 @@ import { updateBalanceOnDrop } from "./lidoBalanceHandler";
|
|
|
3
3
|
import { AudioPlayer } from "../audioPlayer";
|
|
4
4
|
import { DropLength, SelectedValuesKey, DropMode, DropToAttr, DropTimeAttr, LidoContainer, DropAction, } from "../constants";
|
|
5
5
|
import { dispatchElementDropEvent } from "../customEvents";
|
|
6
|
-
import { removeHighlight } from "./highlightHandler";
|
|
6
|
+
import { highlightElement, removeHighlight } from "./highlightHandler";
|
|
7
7
|
import { dragDropAnimation } from "./animationHandler";
|
|
8
8
|
export function buildDropHasDragFromDOM() {
|
|
9
9
|
const dropHasDrag = {};
|
|
@@ -218,8 +218,8 @@ export function enableDraggingWithScaling(element) {
|
|
|
218
218
|
if (storedTabIndexes.includes(JSON.parse(otherElement.getAttribute('tab-index')))) {
|
|
219
219
|
if (!(((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal)) {
|
|
220
220
|
if (otherElement.tagName.toLowerCase() === 'lido-text') {
|
|
221
|
-
otherElement.style.border = ''; // Reset border
|
|
222
|
-
otherElement.style.backgroundColor = 'transparent'; // Reset background color
|
|
221
|
+
// otherElement.style.border = ''; // Reset border
|
|
222
|
+
// otherElement.style.backgroundColor = 'transparent'; // Reset background color
|
|
223
223
|
}
|
|
224
224
|
if (otherElement.tagName.toLowerCase() === 'lido-image') {
|
|
225
225
|
otherElement.style.opacity = '0';
|
|
@@ -228,8 +228,8 @@ export function enableDraggingWithScaling(element) {
|
|
|
228
228
|
}
|
|
229
229
|
else {
|
|
230
230
|
if (otherElement.tagName.toLowerCase() === 'lido-text') {
|
|
231
|
-
otherElement.style.border = ''; // Reset border
|
|
232
|
-
otherElement.style.backgroundColor = ''; // Reset background color
|
|
231
|
+
// otherElement.style.border = ''; // Reset border
|
|
232
|
+
// otherElement.style.backgroundColor = ''; // Reset background color
|
|
233
233
|
}
|
|
234
234
|
if (otherElement.tagName.toLowerCase() === 'lido-image' || 'lido-cell') {
|
|
235
235
|
otherElement.style.opacity = '1';
|
|
@@ -239,8 +239,8 @@ export function enableDraggingWithScaling(element) {
|
|
|
239
239
|
// Apply styles only to the most overlapped element
|
|
240
240
|
if (mostOverlappedElement) {
|
|
241
241
|
if (mostOverlappedElement.tagName.toLowerCase() === 'lido-text') {
|
|
242
|
-
mostOverlappedElement.style.border = '2px dashed #ff0000'; // Red dashed border
|
|
243
|
-
mostOverlappedElement.style.backgroundColor = 'rgba(255, 0, 0, 0.1)'; // Light red background
|
|
242
|
+
// mostOverlappedElement.style.border = '2px dashed #ff0000'; // Red dashed border
|
|
243
|
+
// mostOverlappedElement.style.backgroundColor = 'rgba(255, 0, 0, 0.1)'; // Light red background
|
|
244
244
|
}
|
|
245
245
|
else {
|
|
246
246
|
if (!document.getElementById('unitsDrop') || !document.getElementById('tensDrop') || !document.getElementById('hundredsDrop')) {
|
|
@@ -278,8 +278,8 @@ export function enableDraggingWithScaling(element) {
|
|
|
278
278
|
if (storedTabIndexes.includes(JSON.parse(otherElement.getAttribute('tab-index')))) {
|
|
279
279
|
if (!(((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal)) {
|
|
280
280
|
if (otherElement.tagName.toLowerCase() === 'lido-text') {
|
|
281
|
-
otherElement.style.border = ''; // Reset border
|
|
282
|
-
otherElement.style.backgroundColor = 'transparent'; // Reset background color
|
|
281
|
+
// otherElement.style.border = ''; // Reset border
|
|
282
|
+
// otherElement.style.backgroundColor = 'transparent'; // Reset background color
|
|
283
283
|
}
|
|
284
284
|
else if (otherElement.tagName.toLowerCase() === 'lido-image') {
|
|
285
285
|
otherElement.style.opacity = '0';
|
|
@@ -291,8 +291,8 @@ export function enableDraggingWithScaling(element) {
|
|
|
291
291
|
}
|
|
292
292
|
else {
|
|
293
293
|
if (otherElement.tagName.toLowerCase() === 'lido-text') {
|
|
294
|
-
otherElement.style.border = ''; // Reset border
|
|
295
|
-
otherElement.style.backgroundColor = ''; // Reset background color
|
|
294
|
+
// otherElement.style.border = ''; // Reset border
|
|
295
|
+
// otherElement.style.backgroundColor = ''; // Reset background color
|
|
296
296
|
}
|
|
297
297
|
if (otherElement.tagName.toLowerCase() === 'lido-image' || 'lido-cell') {
|
|
298
298
|
otherElement.style.opacity = '1';
|
|
@@ -441,6 +441,7 @@ export function handleResetDragElement(dragElement, dropElement, dropHasDrag, se
|
|
|
441
441
|
let prevDropItem = Object.values(dropHasDrag).find(item => document.getElementById(item.drop) === currentDrop);
|
|
442
442
|
if (prevDropItem) {
|
|
443
443
|
prevDropItem.isFull = false;
|
|
444
|
+
highlightElement();
|
|
444
445
|
// container.setAttribute(DropHasDrag, JSON.stringify(dropHasDrag));
|
|
445
446
|
const dropEl = document.getElementById(prevDropItem.drop);
|
|
446
447
|
if (dropEl) {
|
|
@@ -473,7 +474,7 @@ export function handleResetDragElement(dragElement, dropElement, dropHasDrag, se
|
|
|
473
474
|
if (storedTabIndexes.includes(JSON.parse(otherElement.getAttribute('tab-index')))) {
|
|
474
475
|
if (!(((_a = otherElement.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal)) {
|
|
475
476
|
if (otherElement.tagName.toLowerCase() === 'lido-text') {
|
|
476
|
-
otherElement.style.backgroundColor = 'transparent'; // Reset background color
|
|
477
|
+
// otherElement.style.backgroundColor = 'transparent'; // Reset background color
|
|
477
478
|
}
|
|
478
479
|
if (otherElement.tagName.toLowerCase() === 'lido-image') {
|
|
479
480
|
otherElement.style.opacity = '0';
|
|
@@ -483,7 +484,7 @@ export function handleResetDragElement(dragElement, dropElement, dropHasDrag, se
|
|
|
483
484
|
}
|
|
484
485
|
else {
|
|
485
486
|
if (otherElement.tagName.toLowerCase() === 'lido-text') {
|
|
486
|
-
otherElement.style.backgroundColor = 'transparent'; // Reset background color
|
|
487
|
+
// otherElement.style.backgroundColor = 'transparent'; // Reset background color
|
|
487
488
|
}
|
|
488
489
|
if (otherElement.tagName.toLowerCase() === 'lido-image') {
|
|
489
490
|
otherElement.style.opacity = '1';
|
|
@@ -492,6 +493,7 @@ export function handleResetDragElement(dragElement, dropElement, dropHasDrag, se
|
|
|
492
493
|
}
|
|
493
494
|
});
|
|
494
495
|
handleShowCheck();
|
|
496
|
+
highlightElement();
|
|
495
497
|
}
|
|
496
498
|
export async function onElementDropComplete(dragElement, dropElement) {
|
|
497
499
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -606,6 +608,7 @@ export async function onElementDropComplete(dragElement, dropElement) {
|
|
|
606
608
|
if (isAllowOnlyOneDrop && isisFull) {
|
|
607
609
|
isisFull.isFull = true;
|
|
608
610
|
dropElement.setAttribute('is-full', 'true');
|
|
611
|
+
highlightElement();
|
|
609
612
|
}
|
|
610
613
|
else {
|
|
611
614
|
console.warn('No matching drop item found for', dropElement);
|
|
@@ -650,8 +653,8 @@ export async function onElementDropComplete(dragElement, dropElement) {
|
|
|
650
653
|
if (storedTabIndexes.includes(JSON.parse(otherElement.getAttribute('tab-index')))) {
|
|
651
654
|
if (!(((_a = otherElement.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal)) {
|
|
652
655
|
if (otherElement.tagName.toLowerCase() === 'lido-text') {
|
|
653
|
-
otherElement.style.border = ''; // Reset border
|
|
654
|
-
otherElement.style.backgroundColor = 'transparent'; // Reset background color
|
|
656
|
+
// otherElement.style.border = ''; // Reset border
|
|
657
|
+
// otherElement.style.backgroundColor = 'transparent'; // Reset background color
|
|
655
658
|
}
|
|
656
659
|
if (otherElement.tagName.toLowerCase() === 'lido-image') {
|
|
657
660
|
otherElement.style.opacity = '0';
|
|
@@ -660,8 +663,8 @@ export async function onElementDropComplete(dragElement, dropElement) {
|
|
|
660
663
|
}
|
|
661
664
|
else {
|
|
662
665
|
if (otherElement.tagName.toLowerCase() === 'lido-text') {
|
|
663
|
-
otherElement.style.border = ''; // Reset border
|
|
664
|
-
otherElement.style.backgroundColor = ''; // Reset background color
|
|
666
|
+
// otherElement.style.border = ''; // Reset border
|
|
667
|
+
// otherElement.style.backgroundColor = ''; // Reset background color
|
|
665
668
|
}
|
|
666
669
|
if (otherElement.tagName.toLowerCase() === 'lido-image' || 'lido-cell') {
|
|
667
670
|
otherElement.style.opacity = '1';
|
|
@@ -721,6 +724,7 @@ export async function onElementDropComplete(dragElement, dropElement) {
|
|
|
721
724
|
dragElement.style.opacity = '1';
|
|
722
725
|
const allDropElements = document.querySelectorAll('.drop-element');
|
|
723
726
|
allDropElements.forEach(el => updateDropBorder(el));
|
|
727
|
+
highlightElement();
|
|
724
728
|
await onActivityComplete(dragElement, dropElement);
|
|
725
729
|
}
|
|
726
730
|
export function updateDropBorder(element) {
|
|
@@ -786,10 +790,10 @@ export async function onClickDropOrDragElement(element, type) {
|
|
|
786
790
|
`;
|
|
787
791
|
document.head.appendChild(style);
|
|
788
792
|
}
|
|
789
|
-
element === null || element === void 0 ? void 0 : element.classList.add('highlight');
|
|
793
|
+
element === null || element === void 0 ? void 0 : element.classList.add('highlight-element');
|
|
790
794
|
element.ariaPressed = 'true';
|
|
791
|
-
const selectedDropElement = type === 'drop' ? element : document.querySelector("[type='drop'].highlight");
|
|
792
|
-
const selectedDragElement = type === 'drag' ? element : document.querySelector("[type='drag'].highlight");
|
|
795
|
+
const selectedDropElement = type === 'drop' ? element : document.querySelector("[type='drop'].highlight-element");
|
|
796
|
+
const selectedDragElement = type === 'drag' ? element : document.querySelector("[type='drag'].highlight-element");
|
|
793
797
|
if (!selectedDropElement) {
|
|
794
798
|
onClickDragElement(element);
|
|
795
799
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LidoContainer } from "../constants";
|
|
2
|
+
import { countOfMistakes, executeActions } from "../utils";
|
|
3
|
+
import { buildDropHasDragFromDOM } from "./dragDropHandler";
|
|
2
4
|
export function showWrongAnswerAnimation(elements) {
|
|
3
5
|
const styleId = '#wrong-answer-animation-style';
|
|
4
6
|
executeActions("tryAgain.speak='true'", document.querySelector('#tryAgain'));
|
|
@@ -45,7 +47,7 @@ export function showWrongAnswerAnimation(elements) {
|
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
49
|
export function removeHighlight(element) {
|
|
48
|
-
element.classList.remove('highlight');
|
|
50
|
+
element.classList.remove('highlight-element');
|
|
49
51
|
element.ariaPressed = 'false';
|
|
50
52
|
}
|
|
51
53
|
// Function to highlight the speaking element
|
|
@@ -101,3 +103,49 @@ export function stopHighlightForSpeakingElement(element) {
|
|
|
101
103
|
// element.style.boxShadow = '';
|
|
102
104
|
// element.style.border = '';
|
|
103
105
|
}
|
|
106
|
+
export function highlightElement() {
|
|
107
|
+
const container = document.querySelector(LidoContainer);
|
|
108
|
+
if (!container)
|
|
109
|
+
return;
|
|
110
|
+
const dropElements = buildDropHasDragFromDOM();
|
|
111
|
+
let firstFalse = Object.values(dropElements).find(item => !item.isFull);
|
|
112
|
+
if (firstFalse) {
|
|
113
|
+
const dropEls = container.querySelectorAll(`[type="drop"]`);
|
|
114
|
+
dropEls.forEach(dropEl => {
|
|
115
|
+
dropEl.classList.remove('highlight-element');
|
|
116
|
+
});
|
|
117
|
+
const dropEle = container.querySelector(`#${firstFalse.drop}`);
|
|
118
|
+
if (dropEle) {
|
|
119
|
+
dropEle.classList.add('highlight-element');
|
|
120
|
+
}
|
|
121
|
+
// Highlight corresponding drag elements if mistakes are more than 2
|
|
122
|
+
const dragElements = container.querySelectorAll(`[type="drag"]`);
|
|
123
|
+
if (countOfMistakes > 2) {
|
|
124
|
+
dragElements.forEach(dragEl => {
|
|
125
|
+
dragEl.classList.remove('highlight-element');
|
|
126
|
+
if (dragEl.getAttribute('value') === dropEle.getAttribute('value')) {
|
|
127
|
+
dragEl.classList.add('highlight-element');
|
|
128
|
+
dragEl.classList.remove('drag-element');
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
dragElements.forEach(dragEl => {
|
|
134
|
+
dragEl.classList.remove('highlight-element');
|
|
135
|
+
dragEl.classList.add('drag-element');
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
if (countOfMistakes <= 2)
|
|
141
|
+
return;
|
|
142
|
+
const clickTemplate = container.querySelectorAll("[type='click']");
|
|
143
|
+
clickTemplate.forEach(clickEl => {
|
|
144
|
+
if (clickEl.getAttribute('value') === container.getAttribute('objective')) {
|
|
145
|
+
if (!clickEl.classList.contains('highlight-element')) {
|
|
146
|
+
clickEl.classList.add('highlight-element');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -14,7 +14,7 @@ export function updateBalanceOnDrop(dragElement, dropElement) {
|
|
|
14
14
|
}
|
|
15
15
|
function calculateValue(elements, operation) {
|
|
16
16
|
if (elements.length === 0)
|
|
17
|
-
return
|
|
17
|
+
return 0;
|
|
18
18
|
if (operation === "count") {
|
|
19
19
|
return elements.length;
|
|
20
20
|
}
|
|
@@ -46,17 +46,18 @@ function calculateValue(elements, operation) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
export function balanceResult(container, objectiveString) {
|
|
49
|
+
var _a, _b, _c, _d, _e, _f;
|
|
49
50
|
const additionalCheck = container.getAttribute('equationCheck');
|
|
50
51
|
if (!additionalCheck)
|
|
51
52
|
return false;
|
|
52
53
|
const balanceEl = document.querySelector('lido-balance');
|
|
53
54
|
if (!balanceEl)
|
|
54
55
|
return false;
|
|
55
|
-
const leftVal = balanceEl.leftVal;
|
|
56
|
-
const rightVal = balanceEl.rightVal;
|
|
56
|
+
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);
|
|
57
|
+
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);
|
|
57
58
|
const hasLeft = !isNaN(leftVal);
|
|
58
59
|
const hasRight = !isNaN(rightVal);
|
|
59
|
-
if (
|
|
60
|
+
if (!hasLeft || !hasRight) {
|
|
60
61
|
return false;
|
|
61
62
|
}
|
|
62
63
|
const symbol = leftVal > rightVal ? '>' : leftVal < rightVal ? '<' : '=';
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { f as format, g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-
|
|
1
|
+
export { f as format, g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-3513b1f3.js';
|