dmed-voice-assistant 1.2.11 → 1.2.13
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/index.js +2 -1
- package/dist/recognition.js +1 -1
- package/dist/recorder.js +28 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -21,6 +21,7 @@ const VoiceAssistant = _ref => {
|
|
21
21
|
isOnlyRecognitionMode = false,
|
22
22
|
recordListValue = [],
|
23
23
|
recognitionListValue = [],
|
24
|
+
recordStyle = {},
|
24
25
|
onNewRecordEvent,
|
25
26
|
onRecordDataChange,
|
26
27
|
onNewRecognitionEvent,
|
@@ -32,7 +33,6 @@ const VoiceAssistant = _ref => {
|
|
32
33
|
} = _ref;
|
33
34
|
const [mode, setMode] = (0, _react.useState)(isOnlyRecorderMode ? "recorder" : isOnlyRecognitionMode ? "recognition" : "recorder");
|
34
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
35
|
-
className: "dmed-voice-assistant-class",
|
36
36
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_LocalizationProvider.LocalizationProvider, {
|
37
37
|
dateAdapter: _AdapterDayjs.AdapterDayjs,
|
38
38
|
children: [mode === 'recorder' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_recorder.default, {
|
@@ -40,6 +40,7 @@ const VoiceAssistant = _ref => {
|
|
40
40
|
setMode: setMode,
|
41
41
|
isOnlyRecorderMode: isOnlyRecorderMode,
|
42
42
|
recordHistoryList: recordListValue,
|
43
|
+
recordStyle: recordStyle,
|
43
44
|
onNewRecordEvent: onNewRecordEvent,
|
44
45
|
onRecordDataChange: onRecordDataChange
|
45
46
|
}), mode === 'recognition' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_recognition.default, {
|
package/dist/recognition.js
CHANGED
@@ -339,7 +339,7 @@ const Recognition = _ref4 => {
|
|
339
339
|
}
|
340
340
|
}, [result]);
|
341
341
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
342
|
-
className: "bg-white rounded-[5px] p-[20px] w-[440px]",
|
342
|
+
className: "bg-white rounded-[5px] p-[20px] w-[440px] dmed-voice-assistant-class",
|
343
343
|
sx: {
|
344
344
|
border: '1px solid #D8DEE4'
|
345
345
|
},
|
package/dist/recorder.js
CHANGED
@@ -48,6 +48,7 @@ const RecorderBox = _ref => {
|
|
48
48
|
mode = 'recorder',
|
49
49
|
recordHistoryList,
|
50
50
|
isOnlyRecorderMode,
|
51
|
+
recordStyle,
|
51
52
|
setMode,
|
52
53
|
onNewRecordEvent,
|
53
54
|
onRecordDataChange
|
@@ -103,16 +104,20 @@ const RecorderBox = _ref => {
|
|
103
104
|
} = _ref2;
|
104
105
|
let temp = [...recordList];
|
105
106
|
const newVoice = {
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
time: await getAudioDuration(blob)
|
107
|
+
voice_file: URL.createObjectURL(blob),
|
108
|
+
file_name: newRecordFileName,
|
109
|
+
voice_size: blob.size,
|
110
|
+
voice_duration: await getAudioDuration(blob)
|
111
111
|
};
|
112
112
|
temp.push(newVoice);
|
113
113
|
setRecordList(temp);
|
114
114
|
if (onNewRecordEvent) {
|
115
|
-
onNewRecordEvent(
|
115
|
+
onNewRecordEvent({
|
116
|
+
fileName: getVoiceFileName(new Date()),
|
117
|
+
audioBlob: blob,
|
118
|
+
lang: selectedLanguage === 0 || selectedLanguage === 1 ? "en-US" : "zh-TW",
|
119
|
+
date: new Date()
|
120
|
+
});
|
116
121
|
}
|
117
122
|
if (onRecordDataChange) {
|
118
123
|
onRecordDataChange(temp);
|
@@ -197,6 +202,7 @@ const RecorderBox = _ref => {
|
|
197
202
|
}, [recordHistoryList]);
|
198
203
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
199
204
|
className: "bg-[#0B0B0B] rounded-[5px] border p-[20px] w-[850px]",
|
205
|
+
sx: recordStyle,
|
200
206
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Grid.default, {
|
201
207
|
container: true,
|
202
208
|
spacing: 2,
|
@@ -205,7 +211,7 @@ const RecorderBox = _ref => {
|
|
205
211
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
206
212
|
className: "flex items-center justify-between",
|
207
213
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
208
|
-
className: "!text-[24px] !font-[600]",
|
214
|
+
className: "!text-[24px] !font-[600] ![font-family:'Afacad']",
|
209
215
|
color: "#EAE5DC",
|
210
216
|
children: "Voice assistant"
|
211
217
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
@@ -217,7 +223,7 @@ const RecorderBox = _ref => {
|
|
217
223
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
218
224
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_svgs.MicIcon, {})
|
219
225
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
220
|
-
className: "!font-600 !text-[14px]",
|
226
|
+
className: "!font-600 !text-[14px] ![font-family:'Afacad']",
|
221
227
|
color: "#EAE5DC",
|
222
228
|
children: "Recorder mode"
|
223
229
|
})]
|
@@ -237,6 +243,9 @@ const RecorderBox = _ref => {
|
|
237
243
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_svgs.StartIcon, {})
|
238
244
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
239
245
|
className: "!font-400 !text-[16px]",
|
246
|
+
style: {
|
247
|
+
fontFamily: "Reddit Sans"
|
248
|
+
},
|
240
249
|
color: "#EAE5DC",
|
241
250
|
children: "Start"
|
242
251
|
})]
|
@@ -254,6 +263,9 @@ const RecorderBox = _ref => {
|
|
254
263
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
255
264
|
className: "!font-400 !text-[14px]",
|
256
265
|
color: "#EAE5DC",
|
266
|
+
style: {
|
267
|
+
fontFamily: "Reddit Sans"
|
268
|
+
},
|
257
269
|
children: "Stop"
|
258
270
|
})]
|
259
271
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
@@ -270,6 +282,9 @@ const RecorderBox = _ref => {
|
|
270
282
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
271
283
|
className: "!font-400 !text-[14px]",
|
272
284
|
color: "#EAE5DC",
|
285
|
+
style: {
|
286
|
+
fontFamily: "Reddit Sans"
|
287
|
+
},
|
273
288
|
children: "Setup"
|
274
289
|
})]
|
275
290
|
})]
|
@@ -285,7 +300,7 @@ const RecorderBox = _ref => {
|
|
285
300
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
286
301
|
children: !isStartedRecord ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_svgs.StopIcon, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_svgs.RedStopIcon, {})
|
287
302
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
288
|
-
className: "!font-[600] !text-[14px]",
|
303
|
+
className: "!font-[600] !text-[14px] ![font-family:'Afacad']",
|
289
304
|
color: "#A3DBFE",
|
290
305
|
children: !isStartedRecord ? 'STOP' : 'REC'
|
291
306
|
})]
|
@@ -569,10 +584,10 @@ const RecorderBox = _ref => {
|
|
569
584
|
},
|
570
585
|
children: recordList.map((record, index) => {
|
571
586
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RecordListItem.default, {
|
572
|
-
audioURL: record.
|
573
|
-
label: record.
|
574
|
-
capacity: record.
|
575
|
-
time: record.
|
587
|
+
audioURL: record.voice_file,
|
588
|
+
label: record.file_name,
|
589
|
+
capacity: record.voice_size,
|
590
|
+
time: parseInt(record.voice_duration),
|
576
591
|
createdDate: record.date,
|
577
592
|
onLabelChange: newLabel => handleLabelChange(index, newLabel),
|
578
593
|
onDelete: () => handleDelete(index)
|