dmed-voice-assistant 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  const VoiceAssistant = _ref => {
19
19
  let {
20
+ isOnlyRecognitionMode = false,
20
21
  recordListValue = [],
21
22
  recognitionListValue = [],
22
23
  onNewRecordEvent,
@@ -24,7 +25,7 @@ const VoiceAssistant = _ref => {
24
25
  onNewRecognitionEvent,
25
26
  onRecognitionDataChange
26
27
  } = _ref;
27
- const [mode, setMode] = (0, _react.useState)("recorder");
28
+ const [mode, setMode] = (0, _react.useState)(!isOnlyRecognitionMode ? "recorder" : "recognition");
28
29
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
29
30
  className: "dmed-voice-assistant-class",
30
31
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_LocalizationProvider.LocalizationProvider, {
@@ -40,7 +41,8 @@ const VoiceAssistant = _ref => {
40
41
  setMode: setMode,
41
42
  recognitionHistoryList: recognitionListValue,
42
43
  onNewRecognitionEvent: onNewRecognitionEvent,
43
- onRecognitionDataChange: onRecognitionDataChange
44
+ onRecognitionDataChange: onRecognitionDataChange,
45
+ isOnlyRecognitionMode: isOnlyRecognitionMode
44
46
  })]
45
47
  })
46
48
  });
@@ -59,6 +59,7 @@ const StyledTypography = (0, _material.styled)(_material.Typography)(_ref3 => {
59
59
  const Recognition = _ref4 => {
60
60
  let {
61
61
  mode = 'recorder',
62
+ isOnlyRecognitionMode,
62
63
  recognitionHistoryList,
63
64
  setMode,
64
65
  onNewRecognitionEvent,
@@ -91,6 +92,7 @@ const Recognition = _ref4 => {
91
92
  setAnchorEl(null);
92
93
  };
93
94
  const handleModeChange = () => {
95
+ if (isOnlyRecognitionMode) return;
94
96
  if (mode === "recorder") {
95
97
  setMode("recognition");
96
98
  } else if (mode === "recognition") {
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "dmed-voice-assistant",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
8
  "dependencies": {
9
- "react": "^18.3.1",
10
- "react-dom": "^18.3.1",
11
- "@mui/material": "^6.3.0",
12
9
  "@emotion/react": "^11.14.0",
13
10
  "@emotion/styled": "^11.14.0",
11
+ "@mui/material": "^6.3.0",
14
12
  "@mui/x-date-pickers": "^7.23.1",
15
13
  "@testing-library/jest-dom": "^5.17.0",
16
14
  "@testing-library/react": "^13.4.0",
17
15
  "@testing-library/user-event": "^13.5.0",
18
16
  "dayjs": "^1.11.13",
17
+ "react": "^18.3.1",
18
+ "react-dom": "^18.3.1",
19
19
  "react-scripts": "5.0.1",
20
20
  "recorder-js": "^1.0.7",
21
21
  "web-vitals": "^2.1.4"