l-min-components 1.7.1409 → 1.7.1411

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.7.1409",
3
+ "version": "1.7.1411",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -50,6 +50,7 @@ const Container = styled.button`
50
50
  text-align: left;
51
51
  color: #636666;
52
52
  font-size: 14px;
53
+ white-space: nowrap;
53
54
  }
54
55
  &.ai-mode {
55
56
  background: #00c2c21a;
@@ -8,6 +8,7 @@ import {
8
8
  SpeechAnalysisContentWordScore,
9
9
  SpeechAnalysisContentWordSection,
10
10
  SpeechAnalysisHeader,
11
+ SpeechTitle,
11
12
  } from "../style";
12
13
  import HandIcon from "../icons/hand";
13
14
  import classNames from "classnames";
@@ -21,8 +22,9 @@ import Table from "./Table";
21
22
  import { Progress } from "rsuite";
22
23
  import ClarityItem from "./ClarityItem";
23
24
  import InlineClampedText from "./InlineClampedText";
25
+ import PlayButton from "./PlayButton";
24
26
 
25
- const SpeechAnalysis = ({ Aidata }) => {
27
+ const SpeechAnalysis = ({ Aidata, isPersonal }) => {
26
28
  const [selectedWord, setSelectedWord] = useState(1);
27
29
  const [selectedSection, setSelectedSection] = useState(null);
28
30
 
@@ -65,10 +67,19 @@ const SpeechAnalysis = ({ Aidata }) => {
65
67
  <ModelComtainer>
66
68
  <ModelContent>
67
69
  <SpeechAnalysisHeader>
68
- <div className="label">
69
- <HandIcon />
70
- <p>Click on the words to see detailed feedback</p>
71
- </div>
70
+ <SpeechTitle>
71
+ <div className="label">
72
+ <HandIcon />
73
+ <p>Click on the words to see detailed feedback</p>
74
+ </div>
75
+ {isPersonal && (
76
+ <div className="">
77
+ <PlayButton audio={Aidata?.audioData} />
78
+ <PlayButton type="ai" refernceText={Aidata?.data?.Reference} />
79
+ </div>
80
+ )}
81
+ </SpeechTitle>
82
+
72
83
  <div className="transcript-wrapper">
73
84
  {words.map((word) => (
74
85
  <span>
@@ -142,18 +153,11 @@ const SpeechAnalysis = ({ Aidata }) => {
142
153
  <p className="good">
143
154
  Perfect! you pronounced this sound correctly
144
155
  </p>
145
- ) : isPass ? (
156
+ ) : (
146
157
  <div className="feedback">
147
158
  <div className="feedback_header">
148
159
  <div className="feedback_header-content">
149
- {/* <p>
150
- You sound like{" "}
151
- <span className="bad">/ʌ/</span>
152
- </p>
153
- <p>It is actually /ʌ/</p> */}
154
- <p>
155
- {item?.["Phoneme Feedback Summary"] || ""}
156
- </p>
160
+ {item?.["Phoneme Feedback Summary"] || ""}
157
161
  </div>
158
162
  </div>
159
163
  <InlineClampedText
@@ -161,8 +165,6 @@ const SpeechAnalysis = ({ Aidata }) => {
161
165
  text={item?.["Phoneme Feedback"] || ""}
162
166
  />
163
167
  </div>
164
- ) : (
165
- <p className="bad">You missed this sound</p>
166
168
  )}
167
169
  </div>
168
170
  );
@@ -17,8 +17,9 @@ import Tabs from "../reportQuestions/components/tabs";
17
17
  import Evaluation from "./components/Evaluation";
18
18
  import SpeechAnalysis from "./components/SpeechAnalysis";
19
19
  import Grammar from "./components/Grammar";
20
+ import classNames from "classnames";
20
21
 
21
- const FullAnalysis = ({ data, onClose }) => {
22
+ const FullAnalysis = ({ data, onClose, accountType }) => {
22
23
  const { setRightLayout, setCenterLayoutStyle } = useContext(OutletContext);
23
24
 
24
25
  // const colors = [
@@ -73,94 +74,96 @@ const FullAnalysis = ({ data, onClose }) => {
73
74
  <ArrowLeft />
74
75
  <h1>Full analysis</h1>
75
76
  </Header>
76
- <Content>
77
- <Sidebar>
78
- <ProgressSidebar>
79
- <ProgressCircleSection>
80
- {thirdModel && (
81
- <Progress.Circle
82
- percent={thirdModel?.score}
83
- strokeWidth={4}
84
- trailWidth={4}
85
- strokeColor={thirdModel?.primaryColor}
86
- trailColor="#F2F2F2"
87
- showInfo={false}
88
- className="progress-circle"
89
- style={{
90
- width: "130px",
91
- }}
92
- />
93
- )}
94
- {secondModel && (
95
- <Progress.Circle
96
- percent={secondModel?.score}
97
- strokeWidth={4}
98
- trailWidth={4}
99
- strokeColor={secondModel?.primaryColor}
100
- trailColor="#F2F2F2"
101
- showInfo={false}
102
- className="progress-circle"
103
- style={{
104
- width: "110px",
105
- }}
106
- />
107
- )}
77
+ <Content className={classNames({ personal: accountType === "personal" })}>
78
+ {accountType !== "personal" && (
79
+ <Sidebar>
80
+ <ProgressSidebar>
81
+ <ProgressCircleSection>
82
+ {thirdModel && (
83
+ <Progress.Circle
84
+ percent={thirdModel?.score}
85
+ strokeWidth={4}
86
+ trailWidth={4}
87
+ strokeColor={thirdModel?.primaryColor}
88
+ trailColor="#F2F2F2"
89
+ showInfo={false}
90
+ className="progress-circle"
91
+ style={{
92
+ width: "130px",
93
+ }}
94
+ />
95
+ )}
96
+ {secondModel && (
97
+ <Progress.Circle
98
+ percent={secondModel?.score}
99
+ strokeWidth={4}
100
+ trailWidth={4}
101
+ strokeColor={secondModel?.primaryColor}
102
+ trailColor="#F2F2F2"
103
+ showInfo={false}
104
+ className="progress-circle"
105
+ style={{
106
+ width: "110px",
107
+ }}
108
+ />
109
+ )}
108
110
 
109
- {firstModel && (
110
- <Progress.Circle
111
- percent={firstModel?.score}
112
- strokeWidth={4}
113
- trailWidth={4}
114
- strokeColor={firstModel?.primaryColor}
115
- trailColor={"#F2F2F2"}
116
- showInfo={false}
117
- className="progress-circle"
118
- style={{
119
- width: "90px",
120
- }}
121
- />
122
- )}
111
+ {firstModel && (
112
+ <Progress.Circle
113
+ percent={firstModel?.score}
114
+ strokeWidth={4}
115
+ trailWidth={4}
116
+ strokeColor={firstModel?.primaryColor}
117
+ trailColor={"#F2F2F2"}
118
+ showInfo={false}
119
+ className="progress-circle"
120
+ style={{
121
+ width: "90px",
122
+ }}
123
+ />
124
+ )}
123
125
 
124
- <p>
125
- AI score <br />
126
- <span>{data?.AiScore || 0}%</span>
127
- </p>
128
- </ProgressCircleSection>
129
- <ul>
130
- {data?.models?.map((model) => {
131
- if (model?.id === "logic_evaluation") return null;
132
- return (
133
- <li key={model?.id}>
134
- <p>{`${model?.label} point`}</p>
135
- <div style={{ backgroundColor: model?.bgColor }}>
136
- <span style={{ color: model?.primaryColor }}>
137
- {model?.score || 0}%
138
- </span>
139
- <Progress.Line
140
- percent={model?.score || 0}
141
- strokeWidth={4}
142
- trailWidth={4}
143
- strokeColor={model?.primaryColor}
144
- trailColor={"#fff"}
145
- showInfo={false}
146
- style={{ width: "100%" }}
147
- />
148
- </div>
149
- </li>
150
- );
151
- })}
152
- </ul>
153
- </ProgressSidebar>
154
- {selectedModel?.id === "speech_analysis" && (
155
- <SpeechSideSection>
156
- <PlayButton audio={selectedModel?.audioData} />
157
- <PlayButton
158
- type="ai"
159
- refernceText={selectedModel?.data?.Reference}
160
- />
161
- </SpeechSideSection>
162
- )}
163
- </Sidebar>
126
+ <p>
127
+ AI score <br />
128
+ <span>{data?.AiScore || 0}%</span>
129
+ </p>
130
+ </ProgressCircleSection>
131
+ <ul>
132
+ {data?.models?.map((model) => {
133
+ if (model?.id === "logic_evaluation") return null;
134
+ return (
135
+ <li key={model?.id}>
136
+ <p>{`${model?.label} point`}</p>
137
+ <div style={{ backgroundColor: model?.bgColor }}>
138
+ <span style={{ color: model?.primaryColor }}>
139
+ {model?.score || 0}%
140
+ </span>
141
+ <Progress.Line
142
+ percent={model?.score || 0}
143
+ strokeWidth={4}
144
+ trailWidth={4}
145
+ strokeColor={model?.primaryColor}
146
+ trailColor={"#fff"}
147
+ showInfo={false}
148
+ style={{ width: "100%" }}
149
+ />
150
+ </div>
151
+ </li>
152
+ );
153
+ })}
154
+ </ul>
155
+ </ProgressSidebar>
156
+ {selectedModel?.id === "speech_analysis" && (
157
+ <SpeechSideSection>
158
+ <PlayButton audio={selectedModel?.audioData} />
159
+ <PlayButton
160
+ type="ai"
161
+ refernceText={selectedModel?.data?.Reference}
162
+ />
163
+ </SpeechSideSection>
164
+ )}
165
+ </Sidebar>
166
+ )}
164
167
  <MainSection>
165
168
  {tabs?.length > 0 && (
166
169
  <Tabs options={tabs} selected={selected} onChange={setSelected} />
@@ -169,7 +172,10 @@ const FullAnalysis = ({ data, onClose }) => {
169
172
  <Evaluation Aidata={selectedModel} />
170
173
  )}
171
174
  {selectedModel?.id === "speech_analysis" && (
172
- <SpeechAnalysis Aidata={selectedModel} />
175
+ <SpeechAnalysis
176
+ Aidata={selectedModel}
177
+ isPersonal={accountType === "personal"}
178
+ />
173
179
  )}
174
180
  {selectedModel?.id === "gammar" && <Grammar />}
175
181
  </MainSection>
@@ -10,6 +10,9 @@ export const Content = styled.div`
10
10
  grid-template-columns: 220px 1fr;
11
11
  gap: 10px;
12
12
  margin-top: 8px;
13
+ &.personal {
14
+ grid-template-columns: 1fr;
15
+ }
13
16
  `;
14
17
  export const Sidebar = styled.div`
15
18
  width: 100;
@@ -223,19 +226,6 @@ export const EvaluationCharactersItem = styled.div`
223
226
  `;
224
227
 
225
228
  export const SpeechAnalysisHeader = styled.div`
226
- .label {
227
- display: flex;
228
- align-items: center;
229
- padding: 0 20px;
230
- gap: 10px;
231
- margin-bottom: 10px;
232
-
233
- p {
234
- font-size: 14px;
235
- line-height: 24px;
236
- color: #7c8080;
237
- }
238
- }
239
229
  .capitalise {
240
230
  text-transform: capitalize;
241
231
  }
@@ -275,6 +265,36 @@ export const SpeechAnalysisHeader = styled.div`
275
265
  }
276
266
  `;
277
267
 
268
+ export const SpeechTitle = styled.div`
269
+ display: flex;
270
+ align-items: center;
271
+ justify-content: space-between;
272
+ width: 100%;
273
+
274
+ margin-bottom: 10px;
275
+ .label {
276
+ display: flex;
277
+ align-items: center;
278
+ padding: 0 20px;
279
+ gap: 10px;
280
+
281
+ p {
282
+ font-size: 14px;
283
+ line-height: 24px;
284
+ color: #7c8080;
285
+ }
286
+ }
287
+ > div {
288
+ display: flex;
289
+ align-items: center;
290
+ gap: 12px;
291
+ button {
292
+ width: 170px;
293
+ height: 40px;
294
+ }
295
+ }
296
+ `;
297
+
278
298
  export const SelectedWord = styled.p`
279
299
  color: #636666;
280
300
  font-size: 16px;
@@ -101,6 +101,7 @@ const ReportQuestions = ({
101
101
  if (toggle) {
102
102
  return (
103
103
  <FullAnalysis
104
+ accountType={accountType}
104
105
  data={toggle}
105
106
  onClose={() => {
106
107
  setToggle(null);