lido-player 0.0.2-alpha-53-dev → 0.0.2-alpha-56-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 +141 -23
- package/dist/cjs/lido-player.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-3c1ce74e.js → utils-a61cfc6b.js} +41 -12
- package/dist/collection/components/calculator/lido-calculator.js +4 -2
- package/dist/collection/components/home/lido-home.js +35 -6
- package/dist/collection/components/mathMatrix/lido-math-matrix.js +8 -6
- package/dist/collection/components/shape/lido-shape.css +90 -0
- package/dist/collection/components/shape/lido-shape.js +41 -6
- package/dist/collection/components/slideFill/lido-slide-fill.js +1 -1
- package/dist/collection/components/text/lido-text.js +26 -1
- package/dist/collection/components/trace/lido-trace.js +57 -4
- package/dist/collection/components/wrap/lido-wrap.js +1 -1
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +1 -1
- package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +2 -2
- package/dist/collection/stories/Templates/blender/blender.stories.js +3 -3
- package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +6 -4
- package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +38 -32
- package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +2 -2
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +68 -60
- package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +6 -5
- package/dist/collection/stories/Templates/quizMaths/quizMaths.stories.js +991 -0
- package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +8 -8
- package/dist/collection/stories/Templates/tenBox/tenBox.stories.js +144 -0
- package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +8 -4
- package/dist/collection/utils/constants.js +2 -0
- package/dist/collection/utils/customEvents.js +1 -0
- package/dist/collection/utils/utils.js +7 -1
- package/dist/collection/utils/utilsHandlers/animationHandler.js +21 -1
- package/dist/collection/utils/utilsHandlers/clickHandler.js +1 -1
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +4 -3
- package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +4 -5
- 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 -22
- 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-511377d2.js → p-0712a27e.js} +39 -13
- package/dist/components/{p-df1af62c.js → p-0a41b2f8.js} +1 -1
- package/dist/components/{p-d568d595.js → p-17f84b2f.js} +1 -1
- package/dist/components/{p-09b3b152.js → p-21852d55.js} +1 -1
- package/dist/components/{p-561908ec.js → p-2829c82c.js} +1 -1
- package/dist/components/{p-71ded596.js → p-330caab8.js} +2 -2
- package/dist/components/{p-8774f517.js → p-480f708a.js} +1 -1
- package/dist/components/{p-cca545f9.js → p-4d332eab.js} +1 -1
- package/dist/components/{p-92b9ae9e.js → p-4e041807.js} +2 -2
- package/dist/components/{p-b3e67e7f.js → p-7ab0a273.js} +26 -2
- package/dist/components/{p-567983a9.js → p-882b291d.js} +2 -2
- package/dist/components/{p-875c1411.js → p-9104d427.js} +1 -1
- package/dist/components/{p-3e8ae1c5.js → p-b9875116.js} +57 -4
- package/dist/components/{p-004adc43.js → p-c4739621.js} +6 -4
- package/dist/components/p-cca36777.js +128 -0
- package/dist/components/{p-9ea1a67d.js → p-d1b5079b.js} +1 -1
- package/dist/components/{p-057fb7b8.js → p-e1ba0c44.js} +38 -26
- package/dist/components/{p-3f0e4436.js → p-eab0ebb7.js} +1 -1
- package/dist/components/{p-90f7dd48.js → p-f2b53e8e.js} +2 -2
- package/dist/components/{p-d2fe2bb6.js → p-f3bc4577.js} +1 -1
- package/dist/components/{p-6beee44b.js → p-ff801ba1.js} +1 -1
- package/dist/components/{p-23549651.js → p-ffc40642.js} +7 -5
- package/dist/esm/index.js +1 -1
- package/dist/esm/lido-avatar_22.entry.js +141 -23
- package/dist/esm/lido-player.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-eefe4a1c.js → utils-7ed76799.js} +39 -13
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/{p-589fc3b8.js → p-17d93181.js} +2 -2
- package/dist/lido-player/p-fa9dfdf8.entry.js +1 -0
- package/dist/types/components/home/lido-home.d.ts +3 -0
- package/dist/types/components/shape/lido-shape.d.ts +8 -2
- package/dist/types/components/text/lido-text.d.ts +1 -0
- package/dist/types/components/trace/lido-trace.d.ts +2 -1
- package/dist/types/components.d.ts +2 -0
- package/dist/types/stories/Templates/fillAnswer/fill-answer.stories.d.ts +1 -1
- package/dist/types/stories/Templates/quizMaths/quizMaths.stories.d.ts +16 -0
- package/dist/types/stories/Templates/tenBox/tenBox.stories.d.ts +4 -0
- package/dist/types/utils/constants.d.ts +2 -0
- package/package.json +1 -1
- package/dist/components/p-0733b277.js +0 -100
- package/dist/lido-player/p-4d9ad047.entry.js +0 -1
|
@@ -40,7 +40,6 @@ function getContainerXml(args) {
|
|
|
40
40
|
const options = args.options;
|
|
41
41
|
const objective = answer;
|
|
42
42
|
const isAllowOnlyCorrect = (_a = args.isAllowOnlyCorrect) !== null && _a !== void 0 ? _a : true;
|
|
43
|
-
let tabCounter = 2;
|
|
44
43
|
const numberMap = {
|
|
45
44
|
1: "one",
|
|
46
45
|
2: "two",
|
|
@@ -61,6 +60,7 @@ function getContainerXml(args) {
|
|
|
61
60
|
</lido-image>
|
|
62
61
|
`;
|
|
63
62
|
}).join('\n');
|
|
63
|
+
let tabCounter = 8;
|
|
64
64
|
const dragCells = options
|
|
65
65
|
.map((digit, i) => {
|
|
66
66
|
return `
|
|
@@ -86,16 +86,16 @@ function getContainerXml(args) {
|
|
|
86
86
|
|
|
87
87
|
<!-- question row-->
|
|
88
88
|
<lido-cell layout="row" id="question-row" aria-hidden="true" visible="true" height="landscape.15%,portrait.15%" width="landscape.65%, portrait.90%" bg-Color="transparent" margin="landscape.185px 0px 30px 0px,portrait.25px 0px -120px 0px" onEntry="this.z-index='1'; this.justify-content='center';" gap="landscape.90px,portrait.40px">
|
|
89
|
-
<lido-text id="
|
|
89
|
+
<lido-text id="num-${number1}" tab-index="2" height="215px" width="120px" visible="true" value="${number1}" string="${number1}" font-family="'Baloo Bhai 2'" font-color="black" font-size="150px" bg-color="transparent" onInCorrect="" onEntry="this.font-weight='800'; this.borderRadius='10px'; this.flex-flow='column-reverse'; this.opacity='0';" border-image="">
|
|
90
90
|
</lido-text>
|
|
91
|
-
<lido-text id="operator-${sign}" tab-index="
|
|
91
|
+
<lido-text id="operator-${sign}" tab-index="3" height="295px" width="120px" visible="true" value="${sign}" string="${sign}" font-family="'Baloo Bhai 2'" font-color="black" font-size="195px" bg-color="transparent" onInCorrect="" onEntry="this.font-weight='800'; this.borderRadius='10px'; this.flex-flow='column-reverse'; this.opacity='0';" border-image="">
|
|
92
92
|
</lido-text>
|
|
93
|
-
<lido-text id="
|
|
93
|
+
<lido-text id="num-${number2}" tab-index="4" height="215px" width="120px" visible="true" value="${number2}" string="${number2}" font-family="'Baloo Bhai 2'" font-color="black" font-size="150px" bg-color="transparent" onInCorrect="" onEntry="this.font-weight='800'; this.borderRadius='10px'; this.flex-flow='column-reverse'; this.opacity='0';" border-image="">
|
|
94
94
|
</lido-text>
|
|
95
|
-
<lido-text id="equal" tab-index="
|
|
95
|
+
<lido-text id="equal" tab-index="5" height="215px" width="120px" visible="true" value="=" string="=" font-family="'Baloo Bhai 2'" font-color="black" font-size="150px" bg-color="transparent" onInCorrect="" onEntry="this.font-weight='800'; this.borderRadius='10px'; this.flex-flow='column-reverse'; this.opacity='0';" border-image="">
|
|
96
96
|
</lido-text>
|
|
97
|
-
<lido-image
|
|
98
|
-
<lido-text height="
|
|
97
|
+
<lido-image is-slice="true" height="225px" width="175px" visible="true" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/sequence-box/card-slot_empty.png" onEntry="this.opacity='0';" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='1000';" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='1000';">
|
|
98
|
+
<lido-text id="number-${answer}" height="225px" width="175px" visible="true" tab-index="6" value="${answer}" string="?" font-family="'Baloo Bhai 2'" font-color="black" font-size="150px" type="drop" bg-color="transparent" onEntry="this.font-weight='800'; this.borderRadius='10px'; this.flex-flow='column-reverse'; this.opacity='1';">
|
|
99
99
|
</lido-text>
|
|
100
100
|
</lido-image>
|
|
101
101
|
</lido-cell>
|
|
@@ -107,7 +107,7 @@ function getContainerXml(args) {
|
|
|
107
107
|
</lido-cell>
|
|
108
108
|
|
|
109
109
|
<!-- speaking element-->
|
|
110
|
-
<lido-text id="speak-text" tab-index="
|
|
110
|
+
<lido-text id="speak-text" tab-index="20" height="100%" width="100%" visible="false" string="solve the problem by counting the teddys above and drag the correct answer" font-family="'Baloo Bhai 2'" font-color="red" font-size="75px" bg-color="transparent" onInCorrect="" onEntry="this.opacity='0'; this.speak='true';" border-image="">
|
|
111
111
|
</lido-text>
|
|
112
112
|
</lido-container>
|
|
113
113
|
</main>
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Templates/TenBox',
|
|
4
|
+
argTypes: {
|
|
5
|
+
num1: { control: 'number' },
|
|
6
|
+
num2: { control: 'number' },
|
|
7
|
+
num3: { control: 'number' },
|
|
8
|
+
operator: { control: 'select', options: ['+', '-'] },
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const TenBoxTemplate = {
|
|
13
|
+
args: {
|
|
14
|
+
num1: 13,
|
|
15
|
+
num2: 15,
|
|
16
|
+
// num3: 2,
|
|
17
|
+
operator: '+',
|
|
18
|
+
},
|
|
19
|
+
render: (args) => {
|
|
20
|
+
const xml = getContainerXml(args);
|
|
21
|
+
return html `<lido-home .xmlData="${xml}"></lido-home>`;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const answerNumbers = (num1, num2, operator, num3) => {
|
|
25
|
+
let answer = 0;
|
|
26
|
+
if (operator === '+') {
|
|
27
|
+
answer = num1 + num2;
|
|
28
|
+
if (num3 !== undefined) {
|
|
29
|
+
answer += num3;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else if (operator === '-') {
|
|
33
|
+
answer = num1 - num2;
|
|
34
|
+
if (num3 !== undefined) {
|
|
35
|
+
answer -= num3;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return answer;
|
|
39
|
+
};
|
|
40
|
+
const renderDropBoxes = (numOfDrops) => {
|
|
41
|
+
const digits = numOfDrops.toString().split('');
|
|
42
|
+
return digits.map((digit, index) => {
|
|
43
|
+
return `<lido-text visible="true" id="drop${index}" string="?" tab-index="${index}" font-size="150px" font-color="#facf50" bg-color="#000000a5" type="drop" height="165px" width="115px" border-radius="15px" value="${digit}" onEntry="this.fontWeight='bold';"></lido-text>`;
|
|
44
|
+
}).join('');
|
|
45
|
+
};
|
|
46
|
+
const renderDragCells = () => {
|
|
47
|
+
let html = "";
|
|
48
|
+
for (let i = 0; i < 10; i++) {
|
|
49
|
+
html += `
|
|
50
|
+
<lido-text
|
|
51
|
+
visible="true"
|
|
52
|
+
id="drag${i}"
|
|
53
|
+
type="drag"
|
|
54
|
+
string="${i}"
|
|
55
|
+
value="${i}"
|
|
56
|
+
font-size="150px"
|
|
57
|
+
font-color="#3d1d0c"
|
|
58
|
+
height="165px"
|
|
59
|
+
width="115px"
|
|
60
|
+
bg-color="#f5f098"
|
|
61
|
+
border-radius="15px"
|
|
62
|
+
onEntry="this.fontWeight='bold';">
|
|
63
|
+
</lido-text>
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
return html;
|
|
67
|
+
};
|
|
68
|
+
const getContainerXml = (args) => {
|
|
69
|
+
const answer = answerNumbers(args.num1, args.num2, args.operator, args.num3);
|
|
70
|
+
return `
|
|
71
|
+
<main>
|
|
72
|
+
<lido-container visible="true" objective="${answer.toString().split("").join(",")}" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Tenbox/tenbox.png" is-continue-on-correct="true" onCorrect="this.sleep='1500';" drop-action="infinite-drop" id="lido-container" >
|
|
73
|
+
<lido-cell visible="true" layout="col" height="100%" width="100%" bg-color="transparent">
|
|
74
|
+
<lido-cell visible="true" layout="landscape.row, portrait.col" height="53%" width="auto" gap="20px" bg-color="transparent">
|
|
75
|
+
<lido-cell visible="true" layout="col" height="100%" width="500px" bg-color="transparent">
|
|
76
|
+
${!args.num3 && args.num1 >= 10 ? `
|
|
77
|
+
<lido-cell visible="true" height="50%" width="100%" layout="row">
|
|
78
|
+
<lido-text id="tenBox" visible="false" font-size="150px" bg-color="#fbd061" width="100%" height="70%" onEntry="this.border='4px solid #c86d29';" border-radius="20px">
|
|
79
|
+
<lido-image visible="true" is-slice="true" width="35%" height="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Tenbox/sunflower.png">
|
|
80
|
+
<lido-text visible="true" string="10" font-size="145px" bg-color="transparent" onEntry="this.fontWeight='700';"></lido-text>
|
|
81
|
+
</lido-image>
|
|
82
|
+
</lido-text>
|
|
83
|
+
<lido-math-matrix visible="true" height="100%" width="100%" rows="5" cols="2" border="2px solid orange" border-radius="7px" active-bg-color="white" deactive-bg-color="white" onEntry="this.sleep='1000'; this.display='none'; tenBox.display='flex';" defualt-fill="10" clickable="false" matrix-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/FoodJar/apple.png"></lido-math-matrix>
|
|
84
|
+
</lido-cell>
|
|
85
|
+
` : ``}
|
|
86
|
+
|
|
87
|
+
${!args.num3 && args.num1 === 20 ? `
|
|
88
|
+
<lido-cell visible="true" height="50%" width="100%" layout="row">
|
|
89
|
+
<lido-text id="tenBox1" visible="false" font-size="150px" bg-color="#fbd061" width="100%" height="70%" onEntry="this.border='4px solid #c86d29';" border-radius="20px">
|
|
90
|
+
<lido-image visible="true" is-slice="true" width="35%" height="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Tenbox/sunflower.png">
|
|
91
|
+
<lido-text visible="true" string="10" font-size="145px" bg-color="transparent" onEntry="this.fontWeight='700';"></lido-text>
|
|
92
|
+
</lido-image>
|
|
93
|
+
</lido-text>
|
|
94
|
+
<lido-math-matrix visible="true" height="100%" width="100%" rows="5" cols="2" border="2px solid orange" border-radius="7px" active-bg-color="white" deactive-bg-color="white" onEntry="this.sleep='1000'; this.display='none'; tenBox1.display='flex';" defualt-fill="10" clickable="false" matrix-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/FoodJar/apple.png"></lido-math-matrix>
|
|
95
|
+
</lido-cell>
|
|
96
|
+
` : `<lido-math-matrix visible="${args.num1 !== 10 ? true : false}" height="50%" width="100%" rows="5" cols="2" border="2px solid orange" border-radius="7px" active-bg-color="white" deactive-bg-color="white" defualt-fill="${args.num1 > 10 ? args.num1 - 10 : args.num1}" clickable="false" matrix-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/FoodJar/apple.png"></lido-math-matrix>`}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
</lido-cell>
|
|
102
|
+
|
|
103
|
+
<lido-cell visible="true" layout="col" height="100%" width="500px" bg-color="transparent">
|
|
104
|
+
${!args.num3 && args.num2 >= 10 ? `
|
|
105
|
+
<lido-cell visible="true" height="50%" width="100%" layout="row">
|
|
106
|
+
<lido-text id="tenBox2" visible="false" font-size="150px" bg-color="#fbd061" width="100%" height="70%" onEntry="this.border='4px solid #c86d29';" border-radius="20px">
|
|
107
|
+
<lido-image visible="true" is-slice="true" width="35%" height="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Tenbox/sunflower.png">
|
|
108
|
+
<lido-text visible="true" string="10" font-size="145px" bg-color="transparent" onEntry="this.fontWeight='700';"></lido-text>
|
|
109
|
+
</lido-image>
|
|
110
|
+
</lido-text>
|
|
111
|
+
<lido-math-matrix visible="true" height="100%" width="100%" rows="5" cols="2" border="2px solid orange" border-radius="7px" active-bg-color="white" deactive-bg-color="white" onEntry="this.sleep='1000'; this.display='none'; tenBox2.display='flex';" defualt-fill="10" clickable="false" matrix-image="${args.operator === "+" ? `https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/FoodJar/apple.png` : 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Tenbox/apple%20outline.png'}"></lido-math-matrix>
|
|
112
|
+
</lido-cell>
|
|
113
|
+
` : ``}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
${!args.num3 && args.num2 === 20 ? `
|
|
117
|
+
<lido-cell visible="true" height="50%" width="100%" layout="row">
|
|
118
|
+
<lido-text id="tenBox3" visible="false" font-size="150px" bg-color="#fbd061" width="100%" height="70%" onEntry="this.border='4px solid #c86d29';" border-radius="20px">
|
|
119
|
+
<lido-image visible="true" is-slice="true" width="35%" height="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Tenbox/sunflower.png">
|
|
120
|
+
<lido-text visible="true" string="10" font-size="145px" bg-color="transparent" onEntry="this.fontWeight='700';"></lido-text>
|
|
121
|
+
</lido-image>
|
|
122
|
+
</lido-text>
|
|
123
|
+
<lido-math-matrix visible="true" height="100%" width="100%" rows="5" cols="2" border="2px solid orange" border-radius="7px" active-bg-color="white" deactive-bg-color="white" onEntry="this.sleep='1000'; this.display='none'; tenBox3.display='flex';" defualt-fill="10" clickable="false" matrix-image="${args.operator === "+" ? `https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/FoodJar/apple.png` : 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Tenbox/apple%20outline.png'}"></lido-math-matrix>
|
|
124
|
+
</lido-cell>
|
|
125
|
+
` : `<lido-math-matrix visible="${args.num2 !== 10 ? true : false}" height="50%" width="100%" rows="5" cols="2" border="2px solid orange" border-radius="7px" active-bg-color="white" deactive-bg-color="white" defualt-fill="${args.num2 > 10 ? args.num2 - 10 : args.num2}" clickable="false" matrix-image="${args.operator === "+" ? `https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/FoodJar/apple.png` : 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Tenbox/apple%20outline.png'}"></lido-math-matrix>`}
|
|
126
|
+
</lido-cell>
|
|
127
|
+
${args.num3 ? `
|
|
128
|
+
<lido-cell visible="true" layout="col" height="100%" width="500px" bg-color="transparent">
|
|
129
|
+
<lido-math-matrix visible="true" height="50%" width="100%" rows="5" cols="2" border="2px solid orange" border-radius="7px" active-bg-color="white" deactive-bg-color="white" defualt-fill="${args.num3}" clickable="false" matrix-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/FoodJar/apple.png"></lido-math-matrix>
|
|
130
|
+
</lido-cell>` : ``}
|
|
131
|
+
</lido-cell>
|
|
132
|
+
<lido-cell visible="true" layout="row" height="20%" width="auto" gap="20px" bg-color="transparent">
|
|
133
|
+
<lido-text visible="true" string="${args.num1}${args.operator}${args.num2}${args.num3 ? args.operator + args.num3 : ""} = " font-size="150px" font-color="white" onEntry="this.fontWeight='bold';" onTouch="this.fontSize='20px'; this.visibility='hidden';"></lido-text>
|
|
134
|
+
${renderDropBoxes(answer)}
|
|
135
|
+
</lido-cell>
|
|
136
|
+
<lido-cell visible="true" layout="landscape.row, portrait.flex" height="landscpae.20%, portrait.30%" gap="landscape.0, portrait.80px" width="100%" bg-color="transparent">
|
|
137
|
+
|
|
138
|
+
${renderDragCells()}
|
|
139
|
+
|
|
140
|
+
</lido-cell>
|
|
141
|
+
</lido-cell>
|
|
142
|
+
</lido-container>
|
|
143
|
+
</main>`;
|
|
144
|
+
};
|
|
@@ -48,7 +48,7 @@ function getContainerXml(args) {
|
|
|
48
48
|
console.error('Trace image is missing');
|
|
49
49
|
return '';
|
|
50
50
|
}
|
|
51
|
-
let tabCounter =
|
|
51
|
+
let tabCounter = 7;
|
|
52
52
|
// Make a list [1,2,3,...,stars]
|
|
53
53
|
const starList = Array.from({ length: stars }, (_, i) => i + 1);
|
|
54
54
|
const starCells = starList
|
|
@@ -61,7 +61,7 @@ function getContainerXml(args) {
|
|
|
61
61
|
.join('');
|
|
62
62
|
return `
|
|
63
63
|
<main>
|
|
64
|
-
<lido-container id="lido-container" objective="writeNumber" tab-index="1" value="mainContainer1" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Write%20number.
|
|
64
|
+
<lido-container id="lido-container" objective="writeNumber" tab-index="1" value="mainContainer1" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Write%20number.svg" height="100%" width="100%" bg-color="transparent" visible="true" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';" onEntry="this.justifyContent='space-around';" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" is-continue-on-correct="true" is-allow-only-correct="${isAllowOnlyCorrect}">
|
|
65
65
|
|
|
66
66
|
<!-- Chimple Avatar -->
|
|
67
67
|
<lido-cell layout="pos" id="pos1" disable-edit="true" height="landscape.600px, portrait.700px" width="landscape.393px, portrait.485px" x="landscape.1279px, portrait.230px" y="landscape.375px, portrait.1035px" ariaHidden="true" z="1" bg-color="transparent" visible="true" onEntry="this.flex-shrink='0';">
|
|
@@ -71,9 +71,13 @@ function getContainerXml(args) {
|
|
|
71
71
|
</lido-image>
|
|
72
72
|
</lido-cell>
|
|
73
73
|
|
|
74
|
+
|
|
75
|
+
<lido-text id="invisible-text" tab-index="2" audio="" width="297px" height="80px" display="flex" onEntry="this.speak='true';" font-size="12px" z="1" font-color="black" value="trace the number as shown by pointing the figure and count the rockets." string="trace the number as shown by pointing the figure and count the rockets." visible="false" bg-color="transparent">
|
|
76
|
+
</lido-text>
|
|
77
|
+
|
|
74
78
|
<!-- text-element -->
|
|
75
79
|
<lido-cell layout="pos" id="pos2" disable-edit="true" height="landscape.80px, portrait.80px" width="landscape.297px, portrait.297px" x="landscape.645px, portrait.300px" y="landscape.90px, portrait.105px" aria-hidden="true" z="1" bg-color="transparent" visible="true" onEntry="this.font-weight='600';">
|
|
76
|
-
<lido-text id="txt1" tab-index="
|
|
80
|
+
<lido-text id="txt1" tab-index="3" span-type="${spanType}" audio="" width="297px" height="80px" display="flex" onEntry="this.text-align='center'; this.justify-content='center'; this.flex-shrink='0';" font="'Baloo Bhai 2'" font-size="96px" z="1" font-color="black" font-weight="600" color=" #000000" string="${text}" visible="true" y="landscape., portrait." bg-color="transparent">
|
|
77
81
|
</lido-text>
|
|
78
82
|
</lido-cell>
|
|
79
83
|
|
|
@@ -85,7 +89,7 @@ function getContainerXml(args) {
|
|
|
85
89
|
|
|
86
90
|
<!-- trace cell -->
|
|
87
91
|
<lido-cell layout="pos" id="pos3" visible="true" width="landscape.740px, portrait.740px" height="landscape.477px, portrait.477px" bg-color="transparent" onEntry="this.border-radius='6px'; this.flex-shrink='0';" x="landscape.430px, portrait.75px" y="landscape.205px, portrait.275px">
|
|
88
|
-
<lido-trace id="image2" tab-index="
|
|
92
|
+
<lido-trace id="image2" tab-index="4" value="10" audio="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Audios/1.wav; https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Audios/2.wav" visible="true" highlightTextId="txt1" svgSource="${traceImage1}; ${traceImage2}" onCorrect="star-row.highlightStarsAndDisapper='true'; lido-avatar.avatarAnimate='Success'; this.sleep='2000';" mode="${traceMode}" z="1" x="" y="" width="740px" height="477px" alt-text="{backgroundImage}">
|
|
89
93
|
</lido-trace>
|
|
90
94
|
</lido-cell>
|
|
91
95
|
|
|
@@ -17,6 +17,8 @@ export const DropToAttr = 'drop-to';
|
|
|
17
17
|
export const DropTimeAttr = 'drop-time';
|
|
18
18
|
export const LidoContainer = 'lido-container';
|
|
19
19
|
export const LangChangeEvent = 'languageChanged';
|
|
20
|
+
export const LIDO_COMMON_AUDIO_PATH = '__LIDO_COMMON_AUDIO_PATH__';
|
|
21
|
+
export const LIDO_COMMON_AUDIO_READY_EVENT = 'lidoCommonAudioPathReady';
|
|
20
22
|
export var TraceMode;
|
|
21
23
|
(function (TraceMode) {
|
|
22
24
|
TraceMode["NoFlow"] = "noFlow";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ActivityChangeKey, ActivityEndKey, ElementClickKey, ElementDropKey, GameCompletedKey, GameExitKey, LessonEndKey, NextContainerKey, PrevContainerKey } from "./constants";
|
|
2
2
|
function dispatchCustomEvent(eventName, detail) {
|
|
3
|
+
console.log("👍Event Name : ", eventName, "Detail : ", detail.toString());
|
|
3
4
|
const event = new CustomEvent(eventName, { detail });
|
|
4
5
|
window.dispatchEvent(event);
|
|
5
6
|
}
|
|
@@ -575,6 +575,8 @@ export async function onActivityComplete(dragElement, dropElement) {
|
|
|
575
575
|
await executeActions("this.alignMatch='true'", dropElement, dragElement);
|
|
576
576
|
if (dragElement && dropElement) {
|
|
577
577
|
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
578
|
+
// storing each activity score based on isCorrect for (all drag-drop events)
|
|
579
|
+
storingEachActivityScore(isCorrect);
|
|
578
580
|
if (isCorrect) {
|
|
579
581
|
const onCorrect = dropElement.getAttribute('onCorrect');
|
|
580
582
|
if (onCorrect) {
|
|
@@ -721,6 +723,7 @@ export const validateObjectiveStatus = async () => {
|
|
|
721
723
|
if (attach === 'true') {
|
|
722
724
|
appendingDragElementsInDrop();
|
|
723
725
|
}
|
|
726
|
+
storingEachActivityScore(true);
|
|
724
727
|
await executeActions(onCorrect, container);
|
|
725
728
|
}
|
|
726
729
|
if (container.getAttribute('dropAttr') === 'EnableAnimation') {
|
|
@@ -736,12 +739,12 @@ export const validateObjectiveStatus = async () => {
|
|
|
736
739
|
else {
|
|
737
740
|
const isContinueOnCorrect = container.getAttribute('is-continue-on-correct') === 'true';
|
|
738
741
|
if (!isContinueOnCorrect) {
|
|
739
|
-
triggerNextContainer();
|
|
740
742
|
await calculateScore();
|
|
741
743
|
triggerNextContainer();
|
|
742
744
|
}
|
|
743
745
|
else {
|
|
744
746
|
const onInCorrect = container.getAttribute('onInCorrect');
|
|
747
|
+
storingEachActivityScore(false);
|
|
745
748
|
await executeActions(onInCorrect, container);
|
|
746
749
|
}
|
|
747
750
|
}
|
|
@@ -764,6 +767,9 @@ export function convertUrlToRelative(url) {
|
|
|
764
767
|
if ((url === null || url === void 0 ? void 0 : url.startsWith('http')) || (url === null || url === void 0 ? void 0 : url.startsWith('blob')) || (url === null || url === void 0 ? void 0 : url.startsWith('data'))) {
|
|
765
768
|
return url;
|
|
766
769
|
}
|
|
770
|
+
if (url.startsWith('/Lido-CommonAudios/')) {
|
|
771
|
+
return url;
|
|
772
|
+
}
|
|
767
773
|
if (baseUrl) {
|
|
768
774
|
const newUrl = url.startsWith('/') ? url.slice(1) : url;
|
|
769
775
|
if (newUrl.startsWith(baseUrl.replace(/^\/+|\/+$/g, '')))
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { NextContainerKey, SelectedValuesKey } from "../constants";
|
|
2
|
+
import { calculateScore, executeActions } from "../utils";
|
|
3
|
+
const tempVanishedValues = [];
|
|
1
4
|
export function dragDropAnimation(container, dragElement, dropElement) {
|
|
2
|
-
container.style.pointerEvents =
|
|
5
|
+
container.style.pointerEvents = "none";
|
|
3
6
|
setTimeout(() => {
|
|
7
|
+
var _a, _b, _c;
|
|
4
8
|
const div = document.createElement('div');
|
|
5
9
|
container.append(div);
|
|
6
10
|
div.classList.add('after-drop-popup-container');
|
|
@@ -9,6 +13,11 @@ export function dragDropAnimation(container, dragElement, dropElement) {
|
|
|
9
13
|
const allDragElements = container.querySelectorAll('[type="drag"]');
|
|
10
14
|
const dragParents = Array.from(allDragElements).map(el => el.parentElement);
|
|
11
15
|
const allSameParent = dragParents.every(parent => parent === dragElement.parentElement);
|
|
16
|
+
const selectedValues = JSON.parse((_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : '[]');
|
|
17
|
+
const vanishedValue = (_b = dragElement.getAttribute('value')) !== null && _b !== void 0 ? _b : (_c = dragElement.textContent) === null || _c === void 0 ? void 0 : _c.trim();
|
|
18
|
+
if (vanishedValue) {
|
|
19
|
+
tempVanishedValues.push(vanishedValue);
|
|
20
|
+
}
|
|
12
21
|
// Remove from old parents
|
|
13
22
|
if (allSameParent) {
|
|
14
23
|
dragElement.remove();
|
|
@@ -32,6 +41,17 @@ export function dragDropAnimation(container, dragElement, dropElement) {
|
|
|
32
41
|
setTimeout(() => {
|
|
33
42
|
div.remove();
|
|
34
43
|
container.style.pointerEvents = 'auto';
|
|
44
|
+
const objective = container.getAttribute('objective');
|
|
45
|
+
if (objective && tempVanishedValues.map(v => v.trim()).sort().join(',') === objective.split(',').map(v => v.trim()).sort().join(',')) {
|
|
46
|
+
(async () => {
|
|
47
|
+
// isCorrect=true;
|
|
48
|
+
const onCorrect = (container === null || container === void 0 ? void 0 : container.getAttribute('onCorrect')) || '';
|
|
49
|
+
await executeActions(onCorrect, container);
|
|
50
|
+
window.dispatchEvent(new CustomEvent(NextContainerKey));
|
|
51
|
+
calculateScore();
|
|
52
|
+
tempVanishedValues.length = 0;
|
|
53
|
+
})();
|
|
54
|
+
}
|
|
35
55
|
}, 800); // match animation duration
|
|
36
56
|
}, 2000); // stay for 2 seconds
|
|
37
57
|
}, 250);
|
|
@@ -9,7 +9,7 @@ export function onTouchListenerForOnTouch(element) {
|
|
|
9
9
|
return;
|
|
10
10
|
const container = document.getElementById('lido-container');
|
|
11
11
|
// const container = element.closest('lido-container') as HTMLElement;
|
|
12
|
-
if (container && container.getAttribute('
|
|
12
|
+
if (container && container.getAttribute('disable-speak') === 'true') {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
// if (element.closest('[disableSpeak="true"]')) {
|
|
@@ -281,9 +281,12 @@ export function enableDraggingWithScaling(element) {
|
|
|
281
281
|
otherElement.style.border = ''; // Reset border
|
|
282
282
|
otherElement.style.backgroundColor = 'transparent'; // Reset background color
|
|
283
283
|
}
|
|
284
|
-
if (otherElement.tagName.toLowerCase() === 'lido-image') {
|
|
284
|
+
else if (otherElement.tagName.toLowerCase() === 'lido-image') {
|
|
285
285
|
otherElement.style.opacity = '0';
|
|
286
286
|
}
|
|
287
|
+
else {
|
|
288
|
+
otherElement.style.opacity = '1';
|
|
289
|
+
}
|
|
287
290
|
}
|
|
288
291
|
}
|
|
289
292
|
else {
|
|
@@ -490,7 +493,6 @@ export function handleResetDragElement(dragElement, dropElement, dropHasDrag, se
|
|
|
490
493
|
});
|
|
491
494
|
handleShowCheck();
|
|
492
495
|
}
|
|
493
|
-
const tempVanishedValues = [];
|
|
494
496
|
export async function onElementDropComplete(dragElement, dropElement) {
|
|
495
497
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
496
498
|
const container = document.getElementById(LidoContainer);
|
|
@@ -717,7 +719,6 @@ export async function onElementDropComplete(dragElement, dropElement) {
|
|
|
717
719
|
dispatchElementDropEvent(dragElement, dropElement, isCorrect);
|
|
718
720
|
// storingEachActivityScore(isCorrect);
|
|
719
721
|
dragElement.style.opacity = '1';
|
|
720
|
-
await onActivityComplete(dragElement, dropElement);
|
|
721
722
|
const allDropElements = document.querySelectorAll('.drop-element');
|
|
722
723
|
allDropElements.forEach(el => updateDropBorder(el));
|
|
723
724
|
await onActivityComplete(dragElement, dropElement);
|
|
@@ -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 null;
|
|
18
18
|
if (operation === "count") {
|
|
19
19
|
return elements.length;
|
|
20
20
|
}
|
|
@@ -46,18 +46,17 @@ function calculateValue(elements, operation) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
export function balanceResult(container, objectiveString) {
|
|
49
|
-
var _a, _b, _c, _d, _e, _f;
|
|
50
49
|
const additionalCheck = container.getAttribute('equationCheck');
|
|
51
50
|
if (!additionalCheck)
|
|
52
51
|
return false;
|
|
53
52
|
const balanceEl = document.querySelector('lido-balance');
|
|
54
53
|
if (!balanceEl)
|
|
55
54
|
return false;
|
|
56
|
-
const leftVal =
|
|
57
|
-
const rightVal =
|
|
55
|
+
const leftVal = balanceEl.leftVal;
|
|
56
|
+
const rightVal = balanceEl.rightVal;
|
|
58
57
|
const hasLeft = !isNaN(leftVal);
|
|
59
58
|
const hasRight = !isNaN(rightVal);
|
|
60
|
-
if (
|
|
59
|
+
if (leftVal == null || rightVal == null) {
|
|
61
60
|
return false;
|
|
62
61
|
}
|
|
63
62
|
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-0712a27e.js';
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, g as getAssetPath, h } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, g as getAssetPath, h } from './p-0712a27e.js';
|
|
2
2
|
import { i as instance } from './p-73e3f0f4.js';
|
|
3
|
-
import { d as defineCustomElement$m } from './p-
|
|
4
|
-
import { d as defineCustomElement$l } from './p-
|
|
5
|
-
import { d as defineCustomElement$k } from './p-
|
|
6
|
-
import { d as defineCustomElement$j } from './p-
|
|
7
|
-
import { d as defineCustomElement$i } from './p-
|
|
8
|
-
import { d as defineCustomElement$h } from './p-
|
|
9
|
-
import { d as defineCustomElement$g } from './p-
|
|
10
|
-
import { d as defineCustomElement$f } from './p-
|
|
11
|
-
import { d as defineCustomElement$e } from './p-
|
|
12
|
-
import { d as defineCustomElement$d } from './p-
|
|
13
|
-
import { d as defineCustomElement$c } from './p-
|
|
14
|
-
import { d as defineCustomElement$b } from './p-
|
|
15
|
-
import { d as defineCustomElement$a } from './p-
|
|
16
|
-
import { d as defineCustomElement$9 } from './p-
|
|
17
|
-
import { d as defineCustomElement$8 } from './p-
|
|
18
|
-
import { d as defineCustomElement$7 } from './p-
|
|
19
|
-
import { d as defineCustomElement$6 } from './p-
|
|
20
|
-
import { d as defineCustomElement$5 } from './p-
|
|
21
|
-
import { d as defineCustomElement$4 } from './p-
|
|
22
|
-
import { d as defineCustomElement$3 } from './p-
|
|
23
|
-
import { d as defineCustomElement$2 } from './p-
|
|
3
|
+
import { d as defineCustomElement$m } from './p-0a41b2f8.js';
|
|
4
|
+
import { d as defineCustomElement$l } from './p-21852d55.js';
|
|
5
|
+
import { d as defineCustomElement$k } from './p-c4739621.js';
|
|
6
|
+
import { d as defineCustomElement$j } from './p-882b291d.js';
|
|
7
|
+
import { d as defineCustomElement$i } from './p-f3bc4577.js';
|
|
8
|
+
import { d as defineCustomElement$h } from './p-eab0ebb7.js';
|
|
9
|
+
import { d as defineCustomElement$g } from './p-d1b5079b.js';
|
|
10
|
+
import { d as defineCustomElement$f } from './p-480f708a.js';
|
|
11
|
+
import { d as defineCustomElement$e } from './p-17f84b2f.js';
|
|
12
|
+
import { d as defineCustomElement$d } from './p-e1ba0c44.js';
|
|
13
|
+
import { d as defineCustomElement$c } from './p-ff801ba1.js';
|
|
14
|
+
import { d as defineCustomElement$b } from './p-330caab8.js';
|
|
15
|
+
import { d as defineCustomElement$a } from './p-ffc40642.js';
|
|
16
|
+
import { d as defineCustomElement$9 } from './p-4d332eab.js';
|
|
17
|
+
import { d as defineCustomElement$8 } from './p-9104d427.js';
|
|
18
|
+
import { d as defineCustomElement$7 } from './p-2829c82c.js';
|
|
19
|
+
import { d as defineCustomElement$6 } from './p-cca36777.js';
|
|
20
|
+
import { d as defineCustomElement$5 } from './p-f2b53e8e.js';
|
|
21
|
+
import { d as defineCustomElement$4 } from './p-7ab0a273.js';
|
|
22
|
+
import { d as defineCustomElement$3 } from './p-b9875116.js';
|
|
23
|
+
import { d as defineCustomElement$2 } from './p-4e041807.js';
|
|
24
24
|
|
|
25
25
|
const LidoRoot$1 = /*@__PURE__*/ proxyCustomElement(class LidoRoot extends H {
|
|
26
26
|
constructor() {
|