@magmamath/students-features 1.7.9 → 1.7.10-rc.1

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.
Files changed (154) hide show
  1. package/dist/commonjs/features/voice/constants.js +39 -3
  2. package/dist/commonjs/features/voice/constants.js.map +1 -1
  3. package/dist/commonjs/features/voice/helpers.js +67 -1
  4. package/dist/commonjs/features/voice/helpers.js.map +1 -1
  5. package/dist/commonjs/features/voice/index.js +77 -0
  6. package/dist/commonjs/features/voice/index.js.map +1 -1
  7. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js +17 -9
  8. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -1
  9. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js +4 -27
  10. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -1
  11. package/dist/commonjs/features/voice/recording/components/VoiceRecordWithTranscript.js +49 -0
  12. package/dist/commonjs/features/voice/recording/components/VoiceRecordWithTranscript.js.map +1 -0
  13. package/dist/commonjs/features/voice/recording/components/VoiceTranscriptPanel.js +245 -0
  14. package/dist/commonjs/features/voice/recording/components/VoiceTranscriptPanel.js.map +1 -0
  15. package/dist/commonjs/features/voice/recording/components/VoiceWaveform.js +93 -0
  16. package/dist/commonjs/features/voice/recording/components/VoiceWaveform.js.map +1 -0
  17. package/dist/commonjs/features/voice/recording/hooks/useTranscriptPanelAnimation.js +42 -0
  18. package/dist/commonjs/features/voice/recording/hooks/useTranscriptPanelAnimation.js.map +1 -0
  19. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js +17 -2
  20. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -1
  21. package/dist/commonjs/features/voice/recording/hooks/useVoiceWaveform.js +43 -0
  22. package/dist/commonjs/features/voice/recording/hooks/useVoiceWaveform.js.map +1 -0
  23. package/dist/commonjs/features/voice/recording/model/Recorder.model.js +3 -0
  24. package/dist/commonjs/features/voice/recording/model/Recorder.model.js.map +1 -1
  25. package/dist/commonjs/features/voice/recording/model/VoiceRecordWithTranscript.model.js +83 -0
  26. package/dist/commonjs/features/voice/recording/model/VoiceRecordWithTranscript.model.js.map +1 -0
  27. package/dist/commonjs/features/voice/recording/model/VoiceTranscriptPanel.model.js +65 -0
  28. package/dist/commonjs/features/voice/recording/model/VoiceTranscriptPanel.model.js.map +1 -0
  29. package/dist/commonjs/features/voice/transcript.helpers.js +36 -0
  30. package/dist/commonjs/features/voice/transcript.helpers.js.map +1 -0
  31. package/dist/commonjs/features/voice/types.js +11 -7
  32. package/dist/commonjs/features/voice/types.js.map +1 -1
  33. package/dist/module/features/voice/constants.js +38 -0
  34. package/dist/module/features/voice/constants.js.map +1 -1
  35. package/dist/module/features/voice/helpers.js +65 -1
  36. package/dist/module/features/voice/helpers.js.map +1 -1
  37. package/dist/module/features/voice/index.js +7 -0
  38. package/dist/module/features/voice/index.js.map +1 -1
  39. package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js +15 -9
  40. package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -1
  41. package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js +4 -27
  42. package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -1
  43. package/dist/module/features/voice/recording/components/VoiceRecordWithTranscript.js +43 -0
  44. package/dist/module/features/voice/recording/components/VoiceRecordWithTranscript.js.map +1 -0
  45. package/dist/module/features/voice/recording/components/VoiceTranscriptPanel.js +238 -0
  46. package/dist/module/features/voice/recording/components/VoiceTranscriptPanel.js.map +1 -0
  47. package/dist/module/features/voice/recording/components/VoiceWaveform.js +86 -0
  48. package/dist/module/features/voice/recording/components/VoiceWaveform.js.map +1 -0
  49. package/dist/module/features/voice/recording/hooks/useTranscriptPanelAnimation.js +37 -0
  50. package/dist/module/features/voice/recording/hooks/useTranscriptPanelAnimation.js.map +1 -0
  51. package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js +20 -3
  52. package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -1
  53. package/dist/module/features/voice/recording/hooks/useVoiceWaveform.js +38 -0
  54. package/dist/module/features/voice/recording/hooks/useVoiceWaveform.js.map +1 -0
  55. package/dist/module/features/voice/recording/model/Recorder.model.js +3 -0
  56. package/dist/module/features/voice/recording/model/Recorder.model.js.map +1 -1
  57. package/dist/module/features/voice/recording/model/VoiceRecordWithTranscript.model.js +78 -0
  58. package/dist/module/features/voice/recording/model/VoiceRecordWithTranscript.model.js.map +1 -0
  59. package/dist/module/features/voice/recording/model/VoiceTranscriptPanel.model.js +60 -0
  60. package/dist/module/features/voice/recording/model/VoiceTranscriptPanel.model.js.map +1 -0
  61. package/dist/module/features/voice/transcript.helpers.js +31 -0
  62. package/dist/module/features/voice/transcript.helpers.js.map +1 -0
  63. package/dist/module/features/voice/types.js +4 -6
  64. package/dist/module/features/voice/types.js.map +1 -1
  65. package/dist/typescript/commonjs/features/voice/__tests__/VoiceRecordWithTranscript.model.test.d.ts +2 -0
  66. package/dist/typescript/commonjs/features/voice/__tests__/VoiceRecordWithTranscript.model.test.d.ts.map +1 -0
  67. package/dist/typescript/commonjs/features/voice/__tests__/VoiceTranscriptPanel.model.test.d.ts +2 -0
  68. package/dist/typescript/commonjs/features/voice/__tests__/VoiceTranscriptPanel.model.test.d.ts.map +1 -0
  69. package/dist/typescript/commonjs/features/voice/constants.d.ts +32 -0
  70. package/dist/typescript/commonjs/features/voice/constants.d.ts.map +1 -1
  71. package/dist/typescript/commonjs/features/voice/helpers.d.ts +3 -0
  72. package/dist/typescript/commonjs/features/voice/helpers.d.ts.map +1 -1
  73. package/dist/typescript/commonjs/features/voice/index.d.ts +7 -0
  74. package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -1
  75. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts +2 -1
  76. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -1
  77. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +2 -7
  78. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -1
  79. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordWithTranscript.d.ts +13 -0
  80. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordWithTranscript.d.ts.map +1 -0
  81. package/dist/typescript/commonjs/features/voice/recording/components/VoiceTranscriptPanel.d.ts +11 -0
  82. package/dist/typescript/commonjs/features/voice/recording/components/VoiceTranscriptPanel.d.ts.map +1 -0
  83. package/dist/typescript/commonjs/features/voice/recording/components/VoiceWaveform.d.ts +8 -0
  84. package/dist/typescript/commonjs/features/voice/recording/components/VoiceWaveform.d.ts.map +1 -0
  85. package/dist/typescript/commonjs/features/voice/recording/hooks/useTranscriptPanelAnimation.d.ts +18 -0
  86. package/dist/typescript/commonjs/features/voice/recording/hooks/useTranscriptPanelAnimation.d.ts.map +1 -0
  87. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -1
  88. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceWaveform.d.ts +7 -0
  89. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceWaveform.d.ts.map +1 -0
  90. package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts +2 -0
  91. package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts.map +1 -1
  92. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordWithTranscript.model.d.ts +16 -0
  93. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordWithTranscript.model.d.ts.map +1 -0
  94. package/dist/typescript/commonjs/features/voice/recording/model/VoiceTranscriptPanel.model.d.ts +26 -0
  95. package/dist/typescript/commonjs/features/voice/recording/model/VoiceTranscriptPanel.model.d.ts.map +1 -0
  96. package/dist/typescript/commonjs/features/voice/transcript.helpers.d.ts +8 -0
  97. package/dist/typescript/commonjs/features/voice/transcript.helpers.d.ts.map +1 -0
  98. package/dist/typescript/commonjs/features/voice/types.d.ts +2 -5
  99. package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -1
  100. package/dist/typescript/module/features/voice/__tests__/VoiceRecordWithTranscript.model.test.d.ts +2 -0
  101. package/dist/typescript/module/features/voice/__tests__/VoiceRecordWithTranscript.model.test.d.ts.map +1 -0
  102. package/dist/typescript/module/features/voice/__tests__/VoiceTranscriptPanel.model.test.d.ts +2 -0
  103. package/dist/typescript/module/features/voice/__tests__/VoiceTranscriptPanel.model.test.d.ts.map +1 -0
  104. package/dist/typescript/module/features/voice/constants.d.ts +32 -0
  105. package/dist/typescript/module/features/voice/constants.d.ts.map +1 -1
  106. package/dist/typescript/module/features/voice/helpers.d.ts +3 -0
  107. package/dist/typescript/module/features/voice/helpers.d.ts.map +1 -1
  108. package/dist/typescript/module/features/voice/index.d.ts +7 -0
  109. package/dist/typescript/module/features/voice/index.d.ts.map +1 -1
  110. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts +2 -1
  111. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -1
  112. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +2 -7
  113. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -1
  114. package/dist/typescript/module/features/voice/recording/components/VoiceRecordWithTranscript.d.ts +13 -0
  115. package/dist/typescript/module/features/voice/recording/components/VoiceRecordWithTranscript.d.ts.map +1 -0
  116. package/dist/typescript/module/features/voice/recording/components/VoiceTranscriptPanel.d.ts +11 -0
  117. package/dist/typescript/module/features/voice/recording/components/VoiceTranscriptPanel.d.ts.map +1 -0
  118. package/dist/typescript/module/features/voice/recording/components/VoiceWaveform.d.ts +8 -0
  119. package/dist/typescript/module/features/voice/recording/components/VoiceWaveform.d.ts.map +1 -0
  120. package/dist/typescript/module/features/voice/recording/hooks/useTranscriptPanelAnimation.d.ts +18 -0
  121. package/dist/typescript/module/features/voice/recording/hooks/useTranscriptPanelAnimation.d.ts.map +1 -0
  122. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -1
  123. package/dist/typescript/module/features/voice/recording/hooks/useVoiceWaveform.d.ts +7 -0
  124. package/dist/typescript/module/features/voice/recording/hooks/useVoiceWaveform.d.ts.map +1 -0
  125. package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts +2 -0
  126. package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts.map +1 -1
  127. package/dist/typescript/module/features/voice/recording/model/VoiceRecordWithTranscript.model.d.ts +16 -0
  128. package/dist/typescript/module/features/voice/recording/model/VoiceRecordWithTranscript.model.d.ts.map +1 -0
  129. package/dist/typescript/module/features/voice/recording/model/VoiceTranscriptPanel.model.d.ts +26 -0
  130. package/dist/typescript/module/features/voice/recording/model/VoiceTranscriptPanel.model.d.ts.map +1 -0
  131. package/dist/typescript/module/features/voice/transcript.helpers.d.ts +8 -0
  132. package/dist/typescript/module/features/voice/transcript.helpers.d.ts.map +1 -0
  133. package/dist/typescript/module/features/voice/types.d.ts +2 -5
  134. package/dist/typescript/module/features/voice/types.d.ts.map +1 -1
  135. package/package.json +1 -1
  136. package/src/features/voice/__tests__/VoiceRecordWithTranscript.model.test.ts +145 -0
  137. package/src/features/voice/__tests__/VoiceTranscriptPanel.model.test.ts +135 -0
  138. package/src/features/voice/constants.ts +40 -0
  139. package/src/features/voice/helpers.ts +85 -1
  140. package/src/features/voice/index.ts +7 -0
  141. package/src/features/voice/playing/components/VoiceTranscriptContent.tsx +16 -8
  142. package/src/features/voice/playing/model/TranscriptionsDownloader.model.ts +8 -30
  143. package/src/features/voice/recording/components/VoiceRecordWithTranscript.tsx +52 -0
  144. package/src/features/voice/recording/components/VoiceTranscriptPanel.tsx +285 -0
  145. package/src/features/voice/recording/components/VoiceWaveform.tsx +102 -0
  146. package/src/features/voice/recording/hooks/useTranscriptPanelAnimation.ts +49 -0
  147. package/src/features/voice/recording/hooks/useVoiceRecorder.ts +26 -3
  148. package/src/features/voice/recording/hooks/useVoiceWaveform.ts +46 -0
  149. package/src/features/voice/recording/model/Recorder.model.ts +3 -0
  150. package/src/features/voice/recording/model/VoiceRecordWithTranscript.model.ts +81 -0
  151. package/src/features/voice/recording/model/VoiceTranscriptPanel.model.ts +76 -0
  152. package/src/features/voice/transcript.helpers.ts +37 -0
  153. package/src/features/voice/types.ts +5 -6
  154. package/src/i18n/.generated/schema.json +6 -5
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,qCAAqC,CAAA;AACnD,cAAc,0CAA0C,CAAA;AACxD,cAAc,wCAAwC,CAAA;AAEtD,cAAc,mCAAmC,CAAA;AACjD,cAAc,yCAAyC,CAAA;AACvD,cAAc,yCAAyC,CAAA;AAEvD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,kDAAkD,CAAA;AAChE,cAAc,sCAAsC,CAAA;AACpD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,oCAAoC,CAAA;AAClD,cAAc,qCAAqC,CAAA;AACnD,cAAc,mDAAmD,CAAA;AACjE,cAAc,8CAA8C,CAAA;AAC5D,cAAc,0CAA0C,CAAA;AACxD,cAAc,wCAAwC,CAAA;AACtD,cAAc,sBAAsB,CAAA;AAEpC,cAAc,mCAAmC,CAAA;AACjD,cAAc,yCAAyC,CAAA;AACvD,cAAc,yCAAyC,CAAA;AAEvD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA"}
@@ -2,7 +2,8 @@ import React from 'react';
2
2
  type VoiceTranscriptContentProps = {
3
3
  text: string;
4
4
  isLoading: boolean;
5
+ numberOfLines?: number;
5
6
  };
6
- export declare const VoiceTranscriptContent: ({ text, isLoading }: VoiceTranscriptContentProps) => React.JSX.Element;
7
+ export declare const VoiceTranscriptContent: ({ text, isLoading, numberOfLines, }: VoiceTranscriptContentProps) => React.JSX.Element;
7
8
  export {};
8
9
  //# sourceMappingURL=VoiceTranscriptContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VoiceTranscriptContent.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/components/VoiceTranscriptContent.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,KAAK,2BAA2B,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,sBAAsB,wBAAyB,2BAA2B,sBActF,CAAA"}
1
+ {"version":3,"file":"VoiceTranscriptContent.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/components/VoiceTranscriptContent.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,KAAK,2BAA2B,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,sBAAsB,wCAIhC,2BAA2B,sBAgB7B,CAAA"}
@@ -1,19 +1,14 @@
1
1
  import { TranscriptionsCollection } from './TranscriptionsCollection';
2
2
  import { VoicePlayerApi } from '../../types';
3
- type TranscriptResult = {
4
- text: string;
5
- language?: string;
6
- };
3
+ import { TranscriptResult } from '../../transcript.helpers';
7
4
  export declare class TranscriptionsDownloaderModel {
8
5
  private readonly collection;
9
6
  private readonly api;
10
7
  private readonly inflightFetches;
11
8
  private readonly transcriptCache;
12
9
  constructor(collection: TranscriptionsCollection, api: VoicePlayerApi);
13
- private fetchTranscriptWithRetry;
14
- private runFetchWithRetry;
10
+ private fetchTranscript;
15
11
  readonly loadTranscriptForAttempt: import("effector").Effect<number, void, Error>;
16
12
  getCachedTranscript(audioFileId: string): TranscriptResult | undefined;
17
13
  }
18
- export {};
19
14
  //# sourceMappingURL=TranscriptionsDownloader.model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TranscriptionsDownloader.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/TranscriptionsDownloader.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAuB,cAAc,EAAE,MAAM,aAAa,CAAA;AAOjE,KAAK,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D,qBAAa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0B;IACrD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+C;IAC/E,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAsC;gBAE1D,UAAU,EAAE,wBAAwB,EAAE,GAAG,EAAE,cAAc;YAKvD,wBAAwB;YAmBxB,iBAAiB;IAmB/B,SAAgB,wBAAwB,iDAsBtC;IAEK,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;CAG9E"}
1
+ {"version":3,"file":"TranscriptionsDownloader.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/TranscriptionsDownloader.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAA4B,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAErF,qBAAa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0B;IACrD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+C;IAC/E,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAsC;gBAE1D,UAAU,EAAE,wBAAwB,EAAE,GAAG,EAAE,cAAc;YAKvD,eAAe;IAsB7B,SAAgB,wBAAwB,iDAsBtC;IAEK,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;CAG9E"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { RecordButtonVariant } from '../../types';
4
+ import { VoiceRecordWithTranscriptModel } from '../model/VoiceRecordWithTranscript.model';
5
+ type VoiceRecordWithTranscriptProps = {
6
+ model: VoiceRecordWithTranscriptModel;
7
+ buttonVariant: RecordButtonVariant;
8
+ style?: StyleProp<ViewStyle>;
9
+ panelStyle?: StyleProp<ViewStyle>;
10
+ };
11
+ export declare const VoiceRecordWithTranscript: ({ model, buttonVariant, style, panelStyle, }: VoiceRecordWithTranscriptProps) => React.JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=VoiceRecordWithTranscript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoiceRecordWithTranscript.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/recording/components/VoiceRecordWithTranscript.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAA;AAKrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAA;AAIzF,KAAK,8BAA8B,GAAG;IACpC,KAAK,EAAE,8BAA8B,CAAA;IACrC,aAAa,EAAE,mBAAmB,CAAA;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC5B,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAClC,CAAA;AAID,eAAO,MAAM,yBAAyB,iDAKnC,8BAA8B,sBAahC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { VoiceTranscriptPanelModel } from '../model/VoiceTranscriptPanel.model';
4
+ type VoiceTranscriptPanelProps = {
5
+ model: VoiceTranscriptPanelModel;
6
+ metering: number | null;
7
+ style?: StyleProp<ViewStyle>;
8
+ };
9
+ export declare const VoiceTranscriptPanel: ({ model, metering, style }: VoiceTranscriptPanelProps) => React.JSX.Element | null;
10
+ export {};
11
+ //# sourceMappingURL=VoiceTranscriptPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoiceTranscriptPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/recording/components/VoiceTranscriptPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAClD,OAAO,EAEL,SAAS,EAIT,SAAS,EACV,MAAM,cAAc,CAAA;AA6BrB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AAsD/E,KAAK,yBAAyB,GAAG;IAC/B,KAAK,EAAE,yBAAyB,CAAA;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,oBAAoB,+BAAgC,yBAAyB,6BAgHzF,CAAA"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type VoiceWaveformProps = {
3
+ levels: number[];
4
+ width: number;
5
+ };
6
+ export declare const VoiceWaveform: ({ levels, width }: VoiceWaveformProps) => React.JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=VoiceWaveform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoiceWaveform.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/recording/components/VoiceWaveform.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAaxC,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAyBD,eAAO,MAAM,aAAa,sBAAuB,kBAAkB,sBAsClE,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { LayoutChangeEvent } from 'react-native';
2
+ export declare const useTranscriptPanelAnimation: (isExpanded: boolean) => {
3
+ onContentLayout: (event: LayoutChangeEvent) => void;
4
+ containerAnimatedStyle: {
5
+ width: 240 | 360;
6
+ };
7
+ bodyAnimatedStyle: {
8
+ height?: undefined;
9
+ } | {
10
+ height: number;
11
+ };
12
+ caretAnimatedStyle: {
13
+ transform: {
14
+ rotate: "180deg" | "0deg";
15
+ }[];
16
+ };
17
+ };
18
+ //# sourceMappingURL=useTranscriptPanelAnimation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTranscriptPanelAnimation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/recording/hooks/useTranscriptPanelAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAehD,eAAO,MAAM,2BAA2B,eAAgB,OAAO;6BAG7B,iBAAiB;;;;;;;;;;;;;;CA8BlD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useVoiceRecorder.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/recording/hooks/useVoiceRecorder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAM7D,eAAO,MAAM,gBAAgB,UAAW,gBAAgB;;CAsDvD,CAAA"}
1
+ {"version":3,"file":"useVoiceRecorder.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/recording/hooks/useVoiceRecorder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAmB7D,eAAO,MAAM,gBAAgB,UAAW,gBAAgB;;CAgEvD,CAAA"}
@@ -0,0 +1,7 @@
1
+ type UseVoiceWaveformParams = {
2
+ metering: number | null;
3
+ isActive: boolean;
4
+ };
5
+ export declare const useVoiceWaveform: ({ metering, isActive }: UseVoiceWaveformParams) => number[];
6
+ export {};
7
+ //# sourceMappingURL=useVoiceWaveform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVoiceWaveform.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/recording/hooks/useVoiceWaveform.ts"],"names":[],"mappings":"AAKA,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAWD,eAAO,MAAM,gBAAgB,2BAA4B,sBAAsB,aA0B9E,CAAA"}
@@ -7,9 +7,11 @@ export declare class RecorderModel<T = unknown> {
7
7
  readonly setVoiceRecordState: import("effector").EventCallable<VoiceRecorderState>;
8
8
  readonly setAvailableInputs: import("effector").EventCallable<MediaDeviceInfo[] | import("expo-audio").RecordingInput[]>;
9
9
  readonly setLastKnownDurationMs: import("effector").EventCallable<number>;
10
+ readonly setMetering: import("effector").EventCallable<number | null>;
10
11
  readonly $voiceRecordState: import("effector").StoreWritable<VoiceRecorderState>;
11
12
  readonly $availableInputs: import("effector").StoreWritable<MediaDeviceInfo[] | import("expo-audio").RecordingInput[]>;
12
13
  readonly $lastKnownDurationMs: import("effector").StoreWritable<number>;
14
+ readonly $metering: import("effector").StoreWritable<number | null>;
13
15
  readonly start: import("effector").Effect<void, void, Error>;
14
16
  readonly stop: import("effector").Effect<void, void | undefined, Error>;
15
17
  stopAndAwaitResult(): Promise<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"Recorder.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/recording/model/Recorder.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAqB,MAAM,YAAY,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAUpD,qBAAa,aAAa,CAAC,CAAC,GAAG,OAAO;IAC7B,QAAQ,EAAG,aAAa,CAAA;IAC/B,OAAO,CAAC,YAAY,CAA+B;IAEnD,SAAgB,KAAK,yCAAgB;IACrC,SAAgB,mBAAmB,uDAAoC;IACvE,SAAgB,kBAAkB,8FAAsC;IACxE,SAAgB,sBAAsB,2CAAwB;IAE9D,SAAgB,iBAAiB,uDAGd;IACnB,SAAgB,gBAAgB,8FAAuC;IACvE,SAAgB,oBAAoB,2CAA4D;IAEhG,SAAgB,KAAK,+CAUnB;IAEF,SAAgB,IAAI,2DAGlB;IAEK,kBAAkB,IAAI,OAAO,CAAC,CAAC,CAAC;IAOhC,aAAa,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI;IAO9B,iBAAiB,IAAI,IAAI;CAGjC"}
1
+ {"version":3,"file":"Recorder.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/recording/model/Recorder.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAqB,MAAM,YAAY,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAUpD,qBAAa,aAAa,CAAC,CAAC,GAAG,OAAO;IAC7B,QAAQ,EAAG,aAAa,CAAA;IAC/B,OAAO,CAAC,YAAY,CAA+B;IAEnD,SAAgB,KAAK,yCAAgB;IACrC,SAAgB,mBAAmB,uDAAoC;IACvE,SAAgB,kBAAkB,8FAAsC;IACxE,SAAgB,sBAAsB,2CAAwB;IAC9D,SAAgB,WAAW,kDAA+B;IAE1D,SAAgB,iBAAiB,uDAGd;IACnB,SAAgB,gBAAgB,8FAAuC;IACvE,SAAgB,oBAAoB,2CAA4D;IAEhG,SAAgB,SAAS,kDAAoD;IAE7E,SAAgB,KAAK,+CAUnB;IAEF,SAAgB,IAAI,2DAGlB;IAEK,kBAAkB,IAAI,OAAO,CAAC,CAAC,CAAC;IAOhC,aAAa,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI;IAO9B,iBAAiB,IAAI,IAAI;CAGjC"}
@@ -0,0 +1,16 @@
1
+ import { GetAudioFileTranscript } from '../../transcript.helpers';
2
+ import { VoiceTranscriptPanelModel } from './VoiceTranscriptPanel.model';
3
+ import type { VoiceRecordModel } from './VoiceRecord.model';
4
+ export type VoiceRecordWithTranscriptModelProps = {
5
+ recordModel: VoiceRecordModel;
6
+ getTranscript: GetAudioFileTranscript;
7
+ };
8
+ export declare class VoiceRecordWithTranscriptModel {
9
+ readonly record: VoiceRecordModel;
10
+ readonly panel: VoiceTranscriptPanelModel;
11
+ private readonly resolveTranscriptFx;
12
+ constructor({ recordModel, getTranscript }: VoiceRecordWithTranscriptModelProps);
13
+ private setupPanelLifecycle;
14
+ private setupTranscriptPipeline;
15
+ }
16
+ //# sourceMappingURL=VoiceRecordWithTranscript.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoiceRecordWithTranscript.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/recording/model/VoiceRecordWithTranscript.model.ts"],"names":[],"mappings":"AAGA,OAAO,EAA4B,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAC3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAG3D,MAAM,MAAM,mCAAmC,GAAG;IAChD,WAAW,EAAE,gBAAgB,CAAA;IAC7B,aAAa,EAAE,sBAAsB,CAAA;CACtC,CAAA;AAMD,qBAAa,8BAA8B;IACzC,SAAgB,MAAM,EAAE,gBAAgB,CAAA;IACxC,SAAgB,KAAK,4BAAkC;IAEvD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA2C;gBAEnE,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,mCAAmC;IAe/E,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,uBAAuB;CA8BhC"}
@@ -0,0 +1,26 @@
1
+ import { VoicePanelPhase } from '../../constants';
2
+ import { DropdownModel } from '../../playing/model/Dropdown.model';
3
+ type PhaseFlags = {
4
+ isOpen: boolean;
5
+ isRecording: boolean;
6
+ isProcessing: boolean;
7
+ isDone: boolean;
8
+ };
9
+ export declare class VoiceTranscriptPanelModel {
10
+ readonly reset: import("effector").EventCallable<void>;
11
+ readonly dropdown: DropdownModel;
12
+ readonly open: import("effector").EventCallable<void>;
13
+ readonly confirm: import("effector").EventCallable<void>;
14
+ readonly complete: import("effector").EventCallable<string>;
15
+ readonly fail: import("effector").EventCallable<void>;
16
+ readonly discard: import("effector").EventCallable<void>;
17
+ readonly $phase: import("effector").StoreWritable<VoicePanelPhase | null>;
18
+ readonly $transcript: import("effector").StoreWritable<string>;
19
+ readonly $hasError: import("effector").StoreWritable<boolean>;
20
+ readonly $flags: import("effector").Store<PhaseFlags>;
21
+ constructor();
22
+ private allowInPhase;
23
+ private setupPhaseTransitions;
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=VoiceTranscriptPanel.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoiceTranscriptPanel.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/recording/model/VoiceTranscriptPanel.model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAElE,KAAK,UAAU,GAAG;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,WAAW,EAAE,OAAO,CAAA;IACpB,YAAY,EAAE,OAAO,CAAA;IACrB,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA;AAQD,qBAAa,yBAAyB;IACpC,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,QAAQ,gBAAsB;IAE9C,SAAgB,IAAI,yCAAgB;IACpC,SAAgB,OAAO,yCAAgB;IACvC,SAAgB,QAAQ,2CAAwB;IAChD,SAAgB,IAAI,yCAAgB;IACpC,SAAgB,OAAO,yCAAgB;IAEvC,SAAgB,MAAM,2DAA4C;IAClE,SAAgB,WAAW,2CAAkB;IAC7C,SAAgB,SAAS,4CAAqB;IAE9C,SAAgB,MAAM,uCAOrB;;IAQD,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,qBAAqB;CAkB9B"}
@@ -0,0 +1,8 @@
1
+ import type { AudioTranscriptResponse } from './types';
2
+ export type TranscriptResult = {
3
+ text: string;
4
+ language?: string;
5
+ };
6
+ export type GetAudioFileTranscript = (audioFileId: string) => Promise<AudioTranscriptResponse>;
7
+ export declare const fetchTranscriptWithRetry: (getTranscript: GetAudioFileTranscript, audioFileId: string) => Promise<TranscriptResult>;
8
+ //# sourceMappingURL=transcript.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcript.helpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/transcript.helpers.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAEtD,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAClE,MAAM,MAAM,sBAAsB,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;AAO9F,eAAO,MAAM,wBAAwB,kBACpB,sBAAsB,eACxB,MAAM,KAClB,OAAO,CAAC,gBAAgB,CAiB1B,CAAA"}
@@ -1,7 +1,9 @@
1
1
  import { WithAbortSignal } from 'src/types/common.types';
2
+ import { TranscriptionStatus } from './constants';
2
3
  import { getAvailableInputs } from './helpers';
3
4
  import { VoiceRecordModel } from './recording/model/VoiceRecord.model';
4
5
  import { AxiosResponse } from 'axios';
6
+ export { TranscriptionStatus };
5
7
  import type { GoogleTranslateProps as GoogleTranslatePayload, GoogleTranslateResponse } from '../translation/providers/google.types';
6
8
  export type { GoogleTranslatePayload, GoogleTranslateResponse };
7
9
  export type VoiceRecordNotificationTypes = {
@@ -45,11 +47,6 @@ export type VoiceRecorderApi = {
45
47
  uploadAudioFile: (data: UploadAudioPayload) => Promise<UploadAudioResponse>;
46
48
  deleteAudioFile: (audioFileId: string) => Promise<void>;
47
49
  };
48
- export declare enum TranscriptionStatus {
49
- PENDING = "pending",
50
- COMPLETED = "completed",
51
- FAILED = "failed"
52
- }
53
50
  export type AudioTranscriptResponse = {
54
51
  text: string;
55
52
  language: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EACV,oBAAoB,IAAI,sBAAsB,EAC9C,uBAAuB,EACxB,MAAM,uCAAuC,CAAA;AAE9C,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,CAAA;AAE/D,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM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E,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;CACrF,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;IACnC,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,oBAAY,yBAAyB;IACnC,KAAK,UAAU;IACf,KAAK,UAAU;CAChB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmamath/students-features",
3
- "version": "1.7.9",
3
+ "version": "1.7.10-rc.1",
4
4
  "description": "Magmamath features library",
5
5
  "source": "src/index.ts",
6
6
  "main": "src/index.ts",
@@ -0,0 +1,145 @@
1
+ import { allSettled, createEffect, createEvent, fork, restore } from 'effector'
2
+
3
+ import { TranscriptionStatus, VoicePanelPhase, VoiceRecorderState } from '../constants'
4
+ import { VoiceRecordWithTranscriptModel } from '../recording/model/VoiceRecordWithTranscript.model'
5
+ import type { VoiceRecordModel } from '../recording/model/VoiceRecord.model'
6
+ import type { AudioTranscriptResponse, VoiceRecordCollectionItem } from '../types'
7
+
8
+ const createRecordModelStub = () => {
9
+ const setVoiceRecordState = createEvent<VoiceRecorderState>()
10
+ const setCurrentRecord = createEvent<VoiceRecordCollectionItem | null>()
11
+ const startAudioUpload = createEvent<string>()
12
+ const reset = createEvent()
13
+ const stop = createEffect(async () => {})
14
+
15
+ const stub = {
16
+ recorderModel: {
17
+ $voiceRecordState: restore(setVoiceRecordState, VoiceRecorderState.IDLE),
18
+ },
19
+ $currentRecord: restore(setCurrentRecord, null),
20
+ startAudioUpload,
21
+ reset,
22
+ stop,
23
+ }
24
+
25
+ return {
26
+ // The integration model only touches the members stubbed above
27
+ recordModel: stub as unknown as VoiceRecordModel,
28
+ setVoiceRecordState,
29
+ setCurrentRecord,
30
+ startAudioUpload,
31
+ reset,
32
+ }
33
+ }
34
+
35
+ const completedTranscript = (text: string): AudioTranscriptResponse => ({
36
+ text,
37
+ language: 'en',
38
+ status: TranscriptionStatus.COMPLETED,
39
+ })
40
+
41
+ const createUploadedRecord = (id: string): VoiceRecordCollectionItem => ({
42
+ durationMs: 5000,
43
+ audioUploadPromise: Promise.resolve({ id, fileName: 'rec', fileType: 'audio/mp4' }),
44
+ })
45
+
46
+ describe('VoiceRecordWithTranscriptModel', () => {
47
+ it('opens the panel when recording starts', async () => {
48
+ const stub = createRecordModelStub()
49
+ const model = new VoiceRecordWithTranscriptModel({
50
+ recordModel: stub.recordModel,
51
+ getTranscript: async () => completedTranscript('text'),
52
+ })
53
+ const scope = fork()
54
+
55
+ await allSettled(stub.setVoiceRecordState, { scope, params: VoiceRecorderState.RECORDING })
56
+
57
+ expect(scope.getState(model.panel.$phase)).toBe(VoicePanelPhase.RECORDING)
58
+ })
59
+
60
+ it('moves the panel to processing when the upload starts', async () => {
61
+ const stub = createRecordModelStub()
62
+ const model = new VoiceRecordWithTranscriptModel({
63
+ recordModel: stub.recordModel,
64
+ getTranscript: async () => completedTranscript('text'),
65
+ })
66
+ const scope = fork()
67
+
68
+ await allSettled(stub.setVoiceRecordState, { scope, params: VoiceRecorderState.RECORDING })
69
+ await allSettled(stub.startAudioUpload, { scope, params: 'file://rec' })
70
+
71
+ expect(scope.getState(model.panel.$phase)).toBe(VoicePanelPhase.PROCESSING)
72
+ })
73
+
74
+ it('shows the transcript once the uploaded record resolves', async () => {
75
+ const stub = createRecordModelStub()
76
+ const getTranscript = jest.fn(async () => completedTranscript('sixty times three'))
77
+ const model = new VoiceRecordWithTranscriptModel({
78
+ recordModel: stub.recordModel,
79
+ getTranscript,
80
+ })
81
+ const scope = fork()
82
+
83
+ await allSettled(stub.setVoiceRecordState, { scope, params: VoiceRecorderState.RECORDING })
84
+ await allSettled(stub.startAudioUpload, { scope, params: 'file://rec' })
85
+ await allSettled(stub.setCurrentRecord, { scope, params: createUploadedRecord('audio-1') })
86
+
87
+ expect(getTranscript).toHaveBeenCalledWith('audio-1')
88
+ expect(scope.getState(model.panel.$phase)).toBe(VoicePanelPhase.DONE)
89
+ expect(scope.getState(model.panel.$transcript)).toBe('sixty times three')
90
+ })
91
+
92
+ it('fails the panel when the transcript is not available', async () => {
93
+ const stub = createRecordModelStub()
94
+ const model = new VoiceRecordWithTranscriptModel({
95
+ recordModel: stub.recordModel,
96
+ getTranscript: async () => ({
97
+ text: '',
98
+ language: '',
99
+ status: TranscriptionStatus.FAILED,
100
+ }),
101
+ })
102
+ const scope = fork()
103
+
104
+ await allSettled(stub.setVoiceRecordState, { scope, params: VoiceRecorderState.RECORDING })
105
+ await allSettled(stub.startAudioUpload, { scope, params: 'file://rec' })
106
+ await allSettled(stub.setCurrentRecord, { scope, params: createUploadedRecord('audio-1') })
107
+
108
+ expect(scope.getState(model.panel.$phase)).toBe(VoicePanelPhase.DONE)
109
+ expect(scope.getState(model.panel.$hasError)).toBe(true)
110
+ })
111
+
112
+ it('discards the panel when the record is deleted', async () => {
113
+ const stub = createRecordModelStub()
114
+ const model = new VoiceRecordWithTranscriptModel({
115
+ recordModel: stub.recordModel,
116
+ getTranscript: async () => completedTranscript('text'),
117
+ })
118
+ const scope = fork()
119
+
120
+ await allSettled(stub.setVoiceRecordState, { scope, params: VoiceRecorderState.RECORDING })
121
+ await allSettled(stub.reset, { scope })
122
+
123
+ expect(scope.getState(model.panel.$phase)).toBeNull()
124
+ })
125
+
126
+ it('drops a transcript fetched for a record that is no longer current', async () => {
127
+ const stub = createRecordModelStub()
128
+ const model = new VoiceRecordWithTranscriptModel({
129
+ recordModel: stub.recordModel,
130
+ getTranscript: async () => completedTranscript('stale text'),
131
+ })
132
+ const scope = fork()
133
+
134
+ await allSettled(stub.setVoiceRecordState, { scope, params: VoiceRecorderState.RECORDING })
135
+ await allSettled(stub.startAudioUpload, { scope, params: 'file://rec' })
136
+
137
+ // The fetched record is replaced before its transcript resolves
138
+ const staleRecord = createUploadedRecord('audio-stale')
139
+ const replacementPromise = allSettled(stub.setCurrentRecord, { scope, params: staleRecord })
140
+ await allSettled(stub.setCurrentRecord, { scope, params: { durationMs: 1 } })
141
+ await replacementPromise
142
+
143
+ expect(scope.getState(model.panel.$transcript)).toBe('')
144
+ })
145
+ })
@@ -0,0 +1,135 @@
1
+ import { allSettled, fork } from 'effector'
2
+
3
+ import { VoicePanelPhase } from '../constants'
4
+ import { VoiceTranscriptPanelModel } from '../recording/model/VoiceTranscriptPanel.model'
5
+
6
+ describe('VoiceTranscriptPanelModel', () => {
7
+ it('opens into the recording phase', async () => {
8
+ const model = new VoiceTranscriptPanelModel()
9
+ const scope = fork()
10
+
11
+ await allSettled(model.open, { scope })
12
+
13
+ expect(scope.getState(model.$phase)).toBe(VoicePanelPhase.RECORDING)
14
+ expect(scope.getState(model.$flags).isRecording).toBe(true)
15
+ })
16
+
17
+ it('confirm moves recording to processing', async () => {
18
+ const model = new VoiceTranscriptPanelModel()
19
+ const scope = fork()
20
+
21
+ await allSettled(model.open, { scope })
22
+ await allSettled(model.confirm, { scope })
23
+
24
+ expect(scope.getState(model.$phase)).toBe(VoicePanelPhase.PROCESSING)
25
+ })
26
+
27
+ it('ignores confirm when the panel is not recording', async () => {
28
+ const model = new VoiceTranscriptPanelModel()
29
+ const scope = fork()
30
+
31
+ await allSettled(model.confirm, { scope })
32
+
33
+ expect(scope.getState(model.$phase)).toBeNull()
34
+ })
35
+
36
+ it('complete lands on done with the transcript text', async () => {
37
+ const transcript = 'three times sixty is one hundred eighty'
38
+ const model = new VoiceTranscriptPanelModel()
39
+ const scope = fork()
40
+
41
+ await allSettled(model.open, { scope })
42
+ await allSettled(model.confirm, { scope })
43
+ await allSettled(model.complete, { scope, params: transcript })
44
+
45
+ expect(scope.getState(model.$phase)).toBe(VoicePanelPhase.DONE)
46
+ expect(scope.getState(model.$transcript)).toBe(transcript)
47
+ expect(scope.getState(model.$hasError)).toBe(false)
48
+ })
49
+
50
+ it('fail lands on done with the error flag', async () => {
51
+ const model = new VoiceTranscriptPanelModel()
52
+ const scope = fork()
53
+
54
+ await allSettled(model.open, { scope })
55
+ await allSettled(model.confirm, { scope })
56
+ await allSettled(model.fail, { scope })
57
+
58
+ expect(scope.getState(model.$phase)).toBe(VoicePanelPhase.DONE)
59
+ expect(scope.getState(model.$hasError)).toBe(true)
60
+ })
61
+
62
+ it('ignores a transcript that arrives after discard', async () => {
63
+ const model = new VoiceTranscriptPanelModel()
64
+ const scope = fork()
65
+
66
+ await allSettled(model.open, { scope })
67
+ await allSettled(model.confirm, { scope })
68
+ await allSettled(model.discard, { scope })
69
+ await allSettled(model.complete, { scope, params: 'late transcript' })
70
+
71
+ expect(scope.getState(model.$phase)).toBeNull()
72
+ expect(scope.getState(model.$transcript)).toBe('')
73
+ })
74
+
75
+ it('discard closes the panel', async () => {
76
+ const model = new VoiceTranscriptPanelModel()
77
+ const scope = fork()
78
+
79
+ await allSettled(model.open, { scope })
80
+ await allSettled(model.discard, { scope })
81
+
82
+ expect(scope.getState(model.$flags).isOpen).toBe(false)
83
+ })
84
+
85
+ it('discard after done clears the transcript', async () => {
86
+ const model = new VoiceTranscriptPanelModel()
87
+ const scope = fork()
88
+
89
+ await allSettled(model.open, { scope })
90
+ await allSettled(model.confirm, { scope })
91
+ await allSettled(model.complete, { scope, params: 'transcript' })
92
+ await allSettled(model.discard, { scope })
93
+
94
+ expect(scope.getState(model.$phase)).toBeNull()
95
+ expect(scope.getState(model.$transcript)).toBe('')
96
+ })
97
+
98
+ it('the transcript arrives collapsed by default', async () => {
99
+ const model = new VoiceTranscriptPanelModel()
100
+ const scope = fork()
101
+
102
+ await allSettled(model.open, { scope })
103
+ await allSettled(model.confirm, { scope })
104
+ await allSettled(model.complete, { scope, params: 'transcript' })
105
+
106
+ expect(scope.getState(model.$phase)).toBe(VoicePanelPhase.DONE)
107
+ expect(scope.getState(model.dropdown.$isExpanded)).toBe(false)
108
+ })
109
+
110
+ it('toggleExpand unfolds the collapsed dropdown', async () => {
111
+ const model = new VoiceTranscriptPanelModel()
112
+ const scope = fork()
113
+
114
+ await allSettled(model.open, { scope })
115
+ await allSettled(model.confirm, { scope })
116
+ await allSettled(model.complete, { scope, params: 'transcript' })
117
+ await allSettled(model.dropdown.toggleExpand, { scope })
118
+
119
+ expect(scope.getState(model.dropdown.$isExpanded)).toBe(true)
120
+ })
121
+
122
+ it('discard resets the dropdown state', async () => {
123
+ const model = new VoiceTranscriptPanelModel()
124
+ const scope = fork()
125
+
126
+ await allSettled(model.open, { scope })
127
+ await allSettled(model.confirm, { scope })
128
+ await allSettled(model.complete, { scope, params: 'transcript' })
129
+ await allSettled(model.dropdown.toggleExpand, { scope })
130
+ await allSettled(model.discard, { scope })
131
+
132
+ expect(scope.getState(model.dropdown.$isExpanded)).toBe(false)
133
+ expect(scope.getState(model.$flags).isOpen).toBe(false)
134
+ })
135
+ })
@@ -20,8 +20,48 @@ export const TRANSCRIPT_RETRY_INTERVAL_MS = 4000
20
20
  export const TRANSCRIPT_MAX_RETRIES = 15
21
21
  export const NO_AUDIO_BE_MESSAGE = 'No audio'
22
22
 
23
+ export enum TranscriptionStatus {
24
+ PENDING = 'pending',
25
+ COMPLETED = 'completed',
26
+ FAILED = 'failed',
27
+ }
28
+
23
29
  //todo: remove native shadows from rn-ui and set from WEB for both platforms
24
30
  export const VOICE_RECORD_SHADOWS = {
25
31
  default: '0 1px 3px 0 rgba(51, 51, 51, 0.10), 0 0 1px 0 rgba(51, 51, 51, 0.40)',
26
32
  advanced: '0 0 1px 0 rgba(51, 51, 51, 0.20), 0 3px 10px 0 rgba(51, 51, 51, 0.16)',
27
33
  }
34
+
35
+ export enum VoicePanelPhase {
36
+ RECORDING = 'recording',
37
+ PROCESSING = 'processing',
38
+ DONE = 'done',
39
+ }
40
+
41
+ export const VOICE_WAVEFORM = {
42
+ BAR_WIDTH: 3,
43
+ BAR_GAP: 3,
44
+ MIN_BAR_HEIGHT: 2,
45
+ HEIGHT: 40,
46
+ AMPLITUDE_PADDING: 12,
47
+ MIN_LEVEL: 0.04,
48
+ MIN_BARS: 16,
49
+ BUFFER_SIZE: 120,
50
+ SAMPLE_INTERVAL_MS: 80,
51
+ FADE_RATIO: 0.22,
52
+ METERING_FLOOR_DB: -60,
53
+ // Low-pass factor for bar levels: 1 = raw values, lower = smoother flow
54
+ LEVEL_SMOOTHING: 0.55,
55
+ } as const
56
+
57
+ // expo-audio polls recorder status every 500ms by default — too coarse for a
58
+ // live waveform. The same cadence drives the web Audio API meter.
59
+ export const METERING_UPDATE_INTERVAL_MS = 100
60
+ export const WEB_METERING_FFT_SIZE = 1024
61
+
62
+ export const VOICE_TRANSCRIPT_PANEL = {
63
+ WIDTH: 240,
64
+ WIDTH_DONE: 360,
65
+ TRANSCRIPT_MAX_HEIGHT: 200,
66
+ SCROLLBAR_WIDTH: 8,
67
+ } as const