dmed-voice-assistant 1.2.0 → 1.2.2

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 CHANGED
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _recorder = _interopRequireDefault(require("./recorder"));
10
10
  var _recognition = _interopRequireDefault(require("./recognition"));
11
+ var _material = require("@mui/material");
11
12
  var _LocalizationProvider = require("@mui/x-date-pickers/LocalizationProvider");
12
13
  var _AdapterDayjs = require("@mui/x-date-pickers/AdapterDayjs");
13
14
  require("./style.css");
@@ -16,6 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
16
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; }
17
18
  const VoiceAssistant = _ref => {
18
19
  let {
20
+ isOnlyRecognitionMode = false,
19
21
  recordListValue = [],
20
22
  recognitionListValue = [],
21
23
  onNewRecordEvent,
@@ -23,8 +25,9 @@ const VoiceAssistant = _ref => {
23
25
  onNewRecognitionEvent,
24
26
  onRecognitionDataChange
25
27
  } = _ref;
26
- const [mode, setMode] = (0, _react.useState)("recorder");
27
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
28
+ const [mode, setMode] = (0, _react.useState)(!isOnlyRecognitionMode ? "recorder" : "recognition");
29
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
30
+ className: "dmed-voice-assistant-class",
28
31
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_LocalizationProvider.LocalizationProvider, {
29
32
  dateAdapter: _AdapterDayjs.AdapterDayjs,
30
33
  children: [mode === 'recorder' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_recorder.default, {
@@ -38,7 +41,8 @@ const VoiceAssistant = _ref => {
38
41
  setMode: setMode,
39
42
  recognitionHistoryList: recognitionListValue,
40
43
  onNewRecognitionEvent: onNewRecognitionEvent,
41
- onRecognitionDataChange: onRecognitionDataChange
44
+ onRecognitionDataChange: onRecognitionDataChange,
45
+ isOnlyRecognitionMode: isOnlyRecognitionMode
42
46
  })]
43
47
  })
44
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/dist/style.css CHANGED
@@ -34,23 +34,11 @@
34
34
  font-style: normal;
35
35
  }
36
36
 
37
- body {
38
- margin: 0;
39
- font-family: 'Reddit Sans';
40
- -webkit-font-smoothing: antialiased;
41
- -moz-osx-font-smoothing: grayscale;
42
- }
43
-
44
- body p,
45
- body span {
37
+ .dmed-voice-assistant-class p,
38
+ .dmed-voice-assistant-class span {
46
39
  font-family: 'Reddit Sans' !important;
47
40
  }
48
41
 
49
- code {
50
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
51
- monospace;
52
- }
53
-
54
42
  .scrollableBox {
55
43
  overflow-y: auto; /* Enables vertical scroll */
56
44
  scrollbar-width: thin; /* For Firefox */
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "dmed-voice-assistant",
3
- "version": "1.2.0",
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"