@magmamath/students-features 1.8.6 → 1.8.8-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.
- package/dist/commonjs/features/profile/components/settings/TextSettingsCard.js +2 -1
- package/dist/commonjs/features/profile/components/settings/TextSettingsCard.js.map +1 -1
- package/dist/commonjs/features/voice/constants.js +42 -3
- package/dist/commonjs/features/voice/constants.js.map +1 -1
- package/dist/commonjs/features/voice/helpers.js +67 -1
- package/dist/commonjs/features/voice/helpers.js.map +1 -1
- package/dist/commonjs/features/voice/index.js +77 -0
- package/dist/commonjs/features/voice/index.js.map +1 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js +21 -9
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -1
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js +4 -27
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -1
- package/dist/commonjs/features/voice/recording/components/VoiceRecordWithTranscript.js +49 -0
- package/dist/commonjs/features/voice/recording/components/VoiceRecordWithTranscript.js.map +1 -0
- package/dist/commonjs/features/voice/recording/components/VoiceTranscriptPanel.js +252 -0
- package/dist/commonjs/features/voice/recording/components/VoiceTranscriptPanel.js.map +1 -0
- package/dist/commonjs/features/voice/recording/components/VoiceWaveform.js +93 -0
- package/dist/commonjs/features/voice/recording/components/VoiceWaveform.js.map +1 -0
- package/dist/commonjs/features/voice/recording/hooks/useTranscriptPanelAnimation.js +42 -0
- package/dist/commonjs/features/voice/recording/hooks/useTranscriptPanelAnimation.js.map +1 -0
- package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js +17 -2
- package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -1
- package/dist/commonjs/features/voice/recording/hooks/useVoiceWaveform.js +43 -0
- package/dist/commonjs/features/voice/recording/hooks/useVoiceWaveform.js.map +1 -0
- package/dist/commonjs/features/voice/recording/model/Recorder.model.js +3 -0
- package/dist/commonjs/features/voice/recording/model/Recorder.model.js.map +1 -1
- package/dist/commonjs/features/voice/recording/model/VoiceRecordWithTranscript.model.js +122 -0
- package/dist/commonjs/features/voice/recording/model/VoiceRecordWithTranscript.model.js.map +1 -0
- package/dist/commonjs/features/voice/recording/model/VoiceTranscriptPanel.model.js +118 -0
- package/dist/commonjs/features/voice/recording/model/VoiceTranscriptPanel.model.js.map +1 -0
- package/dist/commonjs/features/voice/transcript.helpers.js +36 -0
- package/dist/commonjs/features/voice/transcript.helpers.js.map +1 -0
- package/dist/commonjs/features/voice/types.js +11 -7
- package/dist/commonjs/features/voice/types.js.map +1 -1
- package/dist/module/features/profile/components/settings/TextSettingsCard.js +2 -1
- package/dist/module/features/profile/components/settings/TextSettingsCard.js.map +1 -1
- package/dist/module/features/voice/constants.js +41 -0
- package/dist/module/features/voice/constants.js.map +1 -1
- package/dist/module/features/voice/helpers.js +65 -1
- package/dist/module/features/voice/helpers.js.map +1 -1
- package/dist/module/features/voice/index.js +7 -0
- package/dist/module/features/voice/index.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js +19 -9
- package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -1
- package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js +4 -27
- package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -1
- package/dist/module/features/voice/recording/components/VoiceRecordWithTranscript.js +43 -0
- package/dist/module/features/voice/recording/components/VoiceRecordWithTranscript.js.map +1 -0
- package/dist/module/features/voice/recording/components/VoiceTranscriptPanel.js +245 -0
- package/dist/module/features/voice/recording/components/VoiceTranscriptPanel.js.map +1 -0
- package/dist/module/features/voice/recording/components/VoiceWaveform.js +86 -0
- package/dist/module/features/voice/recording/components/VoiceWaveform.js.map +1 -0
- package/dist/module/features/voice/recording/hooks/useTranscriptPanelAnimation.js +37 -0
- package/dist/module/features/voice/recording/hooks/useTranscriptPanelAnimation.js.map +1 -0
- package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js +20 -3
- package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -1
- package/dist/module/features/voice/recording/hooks/useVoiceWaveform.js +38 -0
- package/dist/module/features/voice/recording/hooks/useVoiceWaveform.js.map +1 -0
- package/dist/module/features/voice/recording/model/Recorder.model.js +3 -0
- package/dist/module/features/voice/recording/model/Recorder.model.js.map +1 -1
- package/dist/module/features/voice/recording/model/VoiceRecordWithTranscript.model.js +117 -0
- package/dist/module/features/voice/recording/model/VoiceRecordWithTranscript.model.js.map +1 -0
- package/dist/module/features/voice/recording/model/VoiceTranscriptPanel.model.js +113 -0
- package/dist/module/features/voice/recording/model/VoiceTranscriptPanel.model.js.map +1 -0
- package/dist/module/features/voice/transcript.helpers.js +31 -0
- package/dist/module/features/voice/transcript.helpers.js.map +1 -0
- package/dist/module/features/voice/types.js +4 -6
- package/dist/module/features/voice/types.js.map +1 -1
- package/dist/typescript/commonjs/features/voice/__tests__/VoiceRecordWithTranscript.model.test.d.ts +2 -0
- package/dist/typescript/commonjs/features/voice/__tests__/VoiceRecordWithTranscript.model.test.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/__tests__/VoiceTranscriptPanel.model.test.d.ts +2 -0
- package/dist/typescript/commonjs/features/voice/__tests__/VoiceTranscriptPanel.model.test.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/constants.d.ts +34 -0
- package/dist/typescript/commonjs/features/voice/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/helpers.d.ts +3 -0
- package/dist/typescript/commonjs/features/voice/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/index.d.ts +7 -0
- package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts +3 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +2 -7
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordWithTranscript.d.ts +13 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordWithTranscript.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceTranscriptPanel.d.ts +11 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceTranscriptPanel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceWaveform.d.ts +8 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceWaveform.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/hooks/useTranscriptPanelAnimation.d.ts +18 -0
- package/dist/typescript/commonjs/features/voice/recording/hooks/useTranscriptPanelAnimation.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceWaveform.d.ts +7 -0
- package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceWaveform.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts +2 -0
- package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordWithTranscript.model.d.ts +17 -0
- package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordWithTranscript.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/model/VoiceTranscriptPanel.model.d.ts +32 -0
- package/dist/typescript/commonjs/features/voice/recording/model/VoiceTranscriptPanel.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/transcript.helpers.d.ts +8 -0
- package/dist/typescript/commonjs/features/voice/transcript.helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/types.d.ts +2 -5
- package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/__tests__/VoiceRecordWithTranscript.model.test.d.ts +2 -0
- package/dist/typescript/module/features/voice/__tests__/VoiceRecordWithTranscript.model.test.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/__tests__/VoiceTranscriptPanel.model.test.d.ts +2 -0
- package/dist/typescript/module/features/voice/__tests__/VoiceTranscriptPanel.model.test.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/constants.d.ts +34 -0
- package/dist/typescript/module/features/voice/constants.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/helpers.d.ts +3 -0
- package/dist/typescript/module/features/voice/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/index.d.ts +7 -0
- package/dist/typescript/module/features/voice/index.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts +3 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +2 -7
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordWithTranscript.d.ts +13 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordWithTranscript.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceTranscriptPanel.d.ts +11 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceTranscriptPanel.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceWaveform.d.ts +8 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceWaveform.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/hooks/useTranscriptPanelAnimation.d.ts +18 -0
- package/dist/typescript/module/features/voice/recording/hooks/useTranscriptPanelAnimation.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/recording/hooks/useVoiceWaveform.d.ts +7 -0
- package/dist/typescript/module/features/voice/recording/hooks/useVoiceWaveform.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts +2 -0
- package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/recording/model/VoiceRecordWithTranscript.model.d.ts +17 -0
- package/dist/typescript/module/features/voice/recording/model/VoiceRecordWithTranscript.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/model/VoiceTranscriptPanel.model.d.ts +32 -0
- package/dist/typescript/module/features/voice/recording/model/VoiceTranscriptPanel.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/transcript.helpers.d.ts +8 -0
- package/dist/typescript/module/features/voice/transcript.helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/types.d.ts +2 -5
- package/dist/typescript/module/features/voice/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/profile/components/settings/TextSettingsCard.tsx +2 -1
- package/src/features/voice/__tests__/VoiceRecordWithTranscript.model.test.ts +249 -0
- package/src/features/voice/__tests__/VoiceTranscriptPanel.model.test.ts +237 -0
- package/src/features/voice/constants.ts +43 -0
- package/src/features/voice/helpers.ts +85 -1
- package/src/features/voice/index.ts +7 -0
- package/src/features/voice/playing/components/VoiceTranscriptContent.tsx +26 -8
- package/src/features/voice/playing/model/TranscriptionsDownloader.model.ts +8 -30
- package/src/features/voice/recording/components/VoiceRecordWithTranscript.tsx +52 -0
- package/src/features/voice/recording/components/VoiceTranscriptPanel.tsx +292 -0
- package/src/features/voice/recording/components/VoiceWaveform.tsx +102 -0
- package/src/features/voice/recording/hooks/useTranscriptPanelAnimation.ts +49 -0
- package/src/features/voice/recording/hooks/useVoiceRecorder.ts +26 -3
- package/src/features/voice/recording/hooks/useVoiceWaveform.ts +46 -0
- package/src/features/voice/recording/model/Recorder.model.ts +3 -0
- package/src/features/voice/recording/model/VoiceRecordWithTranscript.model.ts +121 -0
- package/src/features/voice/recording/model/VoiceTranscriptPanel.model.ts +137 -0
- package/src/features/voice/transcript.helpers.ts +37 -0
- package/src/features/voice/types.ts +5 -6
- package/src/i18n/.generated/schema.json +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useState","VOICE_WAVEFORM","normalizeMetering","createSilentBuffer","Array","BUFFER_SIZE","fill","MIN_LEVEL","useVoiceWaveform","metering","isActive","meteringRef","current","smoothedLevelRef","levels","setLevels","intervalId","setInterval","target","LEVEL_SMOOTHING","level","Math","max","prev","slice","SAMPLE_INTERVAL_MS","clearInterval"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/hooks/useVoiceWaveform.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAEnD,SAASC,cAAc,QAAQ,oBAAiB;AAChD,SAASC,iBAAiB,QAAQ,kBAAe;AAOjD,MAAMC,kBAAkB,GAAGA,CAAA,KACzB,IAAIC,KAAK,CAASH,cAAc,CAACI,WAAW,CAAC,CAACC,IAAI,CAACL,cAAc,CAACM,SAAS,CAAC;;AAE9E;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAiC,CAAC,KAAK;EAClF,MAAMC,WAAW,GAAGZ,MAAM,CAACU,QAAQ,CAAC;EACpCE,WAAW,CAACC,OAAO,GAAGH,QAAQ;EAE9B,MAAMI,gBAAgB,GAAGd,MAAM,CAACE,cAAc,CAACM,SAAS,CAAC;EACzD,MAAM,CAACO,MAAM,EAAEC,SAAS,CAAC,GAAGf,QAAQ,CAAWG,kBAAkB,CAAC;EAElEL,SAAS,CAAC,MAAM;IACd,IAAI,CAACY,QAAQ,EAAE;MACbG,gBAAgB,CAACD,OAAO,GAAGX,cAAc,CAACM,SAAS;MACnDQ,SAAS,CAACZ,kBAAkB,CAAC,CAAC,CAAC;MAC/B;IACF;IAEA,MAAMa,UAAU,GAAGC,WAAW,CAAC,MAAM;MACnC,MAAMC,MAAM,GAAGhB,iBAAiB,CAACS,WAAW,CAACC,OAAO,CAAC;MACrDC,gBAAgB,CAACD,OAAO,IACtB,CAACM,MAAM,GAAGL,gBAAgB,CAACD,OAAO,IAAIX,cAAc,CAACkB,eAAe;MACtE,MAAMC,KAAK,GAAGC,IAAI,CAACC,GAAG,CAACrB,cAAc,CAACM,SAAS,EAAEM,gBAAgB,CAACD,OAAO,CAAC;MAC1EG,SAAS,CAAEQ,IAAI,IAAK,CAAC,GAAGA,IAAI,CAACC,KAAK,CAAC,CAAC,CAAC,EAAEJ,KAAK,CAAC,CAAC;IAChD,CAAC,EAAEnB,cAAc,CAACwB,kBAAkB,CAAC;IAErC,OAAO,MAAMC,aAAa,CAACV,UAAU,CAAC;EACxC,CAAC,EAAE,CAACN,QAAQ,CAAC,CAAC;EAEd,OAAOI,MAAM;AACf,CAAC","ignoreList":[]}
|
|
@@ -13,9 +13,12 @@ export class RecorderModel {
|
|
|
13
13
|
setVoiceRecordState = createEvent();
|
|
14
14
|
setAvailableInputs = createEvent();
|
|
15
15
|
setLastKnownDurationMs = createEvent();
|
|
16
|
+
setMetering = createEvent();
|
|
16
17
|
$voiceRecordState = restore(this.setVoiceRecordState, VoiceRecorderState.IDLE).reset(this.reset);
|
|
17
18
|
$availableInputs = restore(this.setAvailableInputs, []);
|
|
18
19
|
$lastKnownDurationMs = restore(this.setLastKnownDurationMs, 0).reset(this.reset);
|
|
20
|
+
// Live input level in dBFS while recording (powers the waveform)
|
|
21
|
+
$metering = restore(this.setMetering, null).reset(this.reset);
|
|
19
22
|
start = createEffect(async () => {
|
|
20
23
|
try {
|
|
21
24
|
await setAudioModeAsync(AUDIO_MODE_CONFIG);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createEffect","createEvent","restore","setAudioModeAsync","VoiceRecorderState","AUDIO_MODE_CONFIG","playsInSilentMode","allowsRecording","RecorderModel","stopResolver","reset","setVoiceRecordState","setAvailableInputs","setLastKnownDurationMs","$voiceRecordState","IDLE","$availableInputs","$lastKnownDurationMs","start","recorder","prepareToRecordAsync","record","RECORDING","error","console","stop","getStatus","isRecording","stopAndAwaitResult","Promise","resolve","resolveRecord","result","clearStopResolver"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/model/Recorder.model.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAC7D,SAAwBC,iBAAiB,QAAQ,YAAY;AAC7D,SAASC,kBAAkB,QAAQ,oBAAiB;AAGpD,MAAMC,iBAAiB,GAAG;EACxBC,iBAAiB,EAAE,IAAI;EACvBC,eAAe,EAAE;AACnB,CAAU;AAIV,OAAO,MAAMC,aAAa,CAAc;EAE9BC,YAAY,GAA2B,IAAI;EAEnCC,KAAK,GAAGT,WAAW,CAAC,CAAC;EACrBU,mBAAmB,GAAGV,WAAW,CAAqB,CAAC;EACvDW,kBAAkB,GAAGX,WAAW,CAAuB,CAAC;EACxDY,sBAAsB,GAAGZ,WAAW,CAAS,CAAC;
|
|
1
|
+
{"version":3,"names":["createEffect","createEvent","restore","setAudioModeAsync","VoiceRecorderState","AUDIO_MODE_CONFIG","playsInSilentMode","allowsRecording","RecorderModel","stopResolver","reset","setVoiceRecordState","setAvailableInputs","setLastKnownDurationMs","setMetering","$voiceRecordState","IDLE","$availableInputs","$lastKnownDurationMs","$metering","start","recorder","prepareToRecordAsync","record","RECORDING","error","console","stop","getStatus","isRecording","stopAndAwaitResult","Promise","resolve","resolveRecord","result","clearStopResolver"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/model/Recorder.model.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAC7D,SAAwBC,iBAAiB,QAAQ,YAAY;AAC7D,SAASC,kBAAkB,QAAQ,oBAAiB;AAGpD,MAAMC,iBAAiB,GAAG;EACxBC,iB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QAAQ,CAACO,SAAS,CAAC,CAAC,CAACC,WAAW,EAAE;IAC5C,OAAO,IAAI,CAACR,QAAQ,CAACM,IAAI,CAAC,CAAC;EAC7B,CAAC,CAAC;EAEKG,kBAAkBA,CAAA,EAAe;IACtC,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;MAC9B,IAAI,CAACvB,YAAY,GAAGuB,OAAO;MAC3B,IAAI,CAACX,QAAQ,CAACO,SAAS,CAAC,CAAC,CAACC,WAAW,IAAI,IAAI,CAACR,QAAQ,CAACM,IAAI,CAAC,CAAC;IAC/D,CAAC,CAAC;EACJ;EAEOM,aAAaA,CAACC,MAAS,EAAQ;IACpC,IAAI,IAAI,CAACzB,YAAY,EAAE;MACrB,IAAI,CAACA,YAAY,CAACyB,MAAM,CAAC;MACzB,IAAI,CAACzB,YAAY,GAAG,IAAI;IAC1B;EACF;EAEO0B,iBAAiBA,CAAA,EAAS;IAC/B,IAAI,CAAC1B,YAAY,GAAG,IAAI;EAC1B;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createEffect, sample } from 'effector';
|
|
4
|
+
import { NO_AUDIO_BE_MESSAGE, VoiceRecorderState } from "../../constants.js";
|
|
5
|
+
import { fetchTranscriptWithRetry } from "../../transcript.helpers.js";
|
|
6
|
+
import { VoiceTranscriptPanelModel } from "./VoiceTranscriptPanel.model.js";
|
|
7
|
+
// Wires the existing recording flow to the transcript panel:
|
|
8
|
+
// recording starts → panel opens with the waveform; the recording is confirmed
|
|
9
|
+
// (upload kicks off) → panel shows the loader; the uploaded file's transcript
|
|
10
|
+
// arrives → panel shows the text. Deleting/discarding the record closes the panel.
|
|
11
|
+
export class VoiceRecordWithTranscriptModel {
|
|
12
|
+
panel = new VoiceTranscriptPanelModel();
|
|
13
|
+
constructor({
|
|
14
|
+
recordModel,
|
|
15
|
+
getTranscript
|
|
16
|
+
}) {
|
|
17
|
+
this.record = recordModel;
|
|
18
|
+
this.resolveTranscriptFx = createEffect(async record => {
|
|
19
|
+
// A restored recording already carries its uploaded file id; a fresh take
|
|
20
|
+
// gets it from the in-flight upload promise.
|
|
21
|
+
const fileId = record.id ?? (await record.audioUploadPromise)?.id;
|
|
22
|
+
if (!fileId) throw new Error('Audio upload did not return a file id');
|
|
23
|
+
const {
|
|
24
|
+
text
|
|
25
|
+
} = await fetchTranscriptWithRetry(getTranscript, fileId);
|
|
26
|
+
if (text === NO_AUDIO_BE_MESSAGE) throw new Error('Transcript is not available');
|
|
27
|
+
return text;
|
|
28
|
+
});
|
|
29
|
+
this.setupPanelLifecycle();
|
|
30
|
+
this.setupTranscriptPipeline();
|
|
31
|
+
this.setupTranscriptRestore();
|
|
32
|
+
}
|
|
33
|
+
setupPanelLifecycle() {
|
|
34
|
+
sample({
|
|
35
|
+
clock: this.record.recorderModel.$voiceRecordState,
|
|
36
|
+
filter: state => state === VoiceRecorderState.RECORDING,
|
|
37
|
+
target: this.panel.open
|
|
38
|
+
});
|
|
39
|
+
// startAudioUpload fires exactly when a recording was confirmed (the
|
|
40
|
+
// discard path never uploads), so it doubles as the panel's confirm clock.
|
|
41
|
+
sample({
|
|
42
|
+
clock: this.record.startAudioUpload,
|
|
43
|
+
target: this.panel.confirm
|
|
44
|
+
});
|
|
45
|
+
// The record resets as a side effect of a wrong answer (the attempt key
|
|
46
|
+
// rotates to a take with no recording). While the panel is handling its own
|
|
47
|
+
// dismissal — dimming a shown transcript, or waiting for one that is still
|
|
48
|
+
// loading — that incidental reset must not close it early; the panel owns
|
|
49
|
+
// the close.
|
|
50
|
+
sample({
|
|
51
|
+
clock: [this.record.reset, this.record.stop.done],
|
|
52
|
+
source: this.panel.$isHandlingDismissal,
|
|
53
|
+
filter: isHandlingDismissal => !isHandlingDismissal,
|
|
54
|
+
target: this.panel.discard
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
setupTranscriptPipeline() {
|
|
58
|
+
// A fetch result applies when the record it was fetched for is still the
|
|
59
|
+
// current one — late results from a discarded or re-recorded take are
|
|
60
|
+
// dropped. The exception is a pending dismissal: a wrong answer rotates
|
|
61
|
+
// $currentRecord away from the take it was fetched for, but that take's
|
|
62
|
+
// transcript is exactly the one the panel is waiting to show before it
|
|
63
|
+
// closes, so it must still apply.
|
|
64
|
+
const shouldApplyResult = ({
|
|
65
|
+
currentRecord,
|
|
66
|
+
isDismissPending
|
|
67
|
+
}, {
|
|
68
|
+
params
|
|
69
|
+
}) => isDismissPending || currentRecord === params;
|
|
70
|
+
const resultGuardSource = {
|
|
71
|
+
currentRecord: this.record.$currentRecord,
|
|
72
|
+
isDismissPending: this.panel.$isDismissPending
|
|
73
|
+
};
|
|
74
|
+
sample({
|
|
75
|
+
clock: this.record.$currentRecord.updates,
|
|
76
|
+
source: this.panel.$flags,
|
|
77
|
+
filter: (flags, record) => flags.isProcessing && Boolean(record?.audioUploadPromise) && !record?.id,
|
|
78
|
+
fn: (_, record) => record,
|
|
79
|
+
target: this.resolveTranscriptFx
|
|
80
|
+
});
|
|
81
|
+
sample({
|
|
82
|
+
clock: this.resolveTranscriptFx.done,
|
|
83
|
+
source: resultGuardSource,
|
|
84
|
+
filter: shouldApplyResult,
|
|
85
|
+
fn: (_, {
|
|
86
|
+
result
|
|
87
|
+
}) => result,
|
|
88
|
+
target: this.panel.complete
|
|
89
|
+
});
|
|
90
|
+
sample({
|
|
91
|
+
clock: this.resolveTranscriptFx.fail,
|
|
92
|
+
source: resultGuardSource,
|
|
93
|
+
filter: shouldApplyResult,
|
|
94
|
+
target: this.panel.fail
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Reopening a problem whose recording was already uploaded: $currentRecord is
|
|
99
|
+
// restored with its file id (no live take in progress), so the live pipeline
|
|
100
|
+
// never runs. Reopen the panel into the loader and refetch — a still-pending
|
|
101
|
+
// transcript keeps polling, a completed one resolves on the first call.
|
|
102
|
+
setupTranscriptRestore() {
|
|
103
|
+
const restored = sample({
|
|
104
|
+
clock: this.record.$currentRecord.updates,
|
|
105
|
+
filter: record => Boolean(record?.id)
|
|
106
|
+
});
|
|
107
|
+
sample({
|
|
108
|
+
clock: restored,
|
|
109
|
+
target: this.panel.restore
|
|
110
|
+
});
|
|
111
|
+
sample({
|
|
112
|
+
clock: restored,
|
|
113
|
+
target: this.resolveTranscriptFx
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=VoiceRecordWithTranscript.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEffect","sample","NO_AUDIO_BE_MESSAGE","VoiceRecorderState","fetchTranscriptWithRetry","VoiceTranscriptPanelModel","VoiceRecordWithTranscriptModel","panel","constructor","recordModel","getTranscript","record","resolveTranscriptFx","fileId","id","audioUploadPromise","Error","text","setupPanelLifecycle","setupTranscriptPipeline","setupTranscriptRestore","clock","recorderModel","$voiceRecordState","filter","state","RECORDING","target","open","startAudioUpload","confirm","reset","stop","done","source","$isHandlingDismissal","isHandlingDismissal","discard","shouldApplyResult","currentRecord","isDismissPending","params","resultGuardSource","$currentRecord","$isDismissPending","updates","$flags","flags","isProcessing","Boolean","fn","_","result","complete","fail","restored","restore"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/model/VoiceRecordWithTranscript.model.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAUC,MAAM,QAAQ,UAAU;AAEvD,SAASC,mBAAmB,EAAEC,kBAAkB,QAAQ,oBAAiB;AACzE,SAASC,wBAAwB,QAAgC,6BAA0B;AAC3F,SAASC,yBAAyB,QAAQ,iCAA8B;AAcxE;AACA;AACA;AACA;AACA,OAAO,MAAMC,8BAA8B,CAAC;EAE1BC,KAAK,GAAG,IAAIF,yBAAyB,CAAC,CAAC;EAIvDG,WAAWA,CAAC;IAAEC,WAAW;IAAEC;EAAmD,CAAC,EAAE;IAC/E,IAAI,CAACC,MAAM,GAAGF,WAAW;IACzB,IAAI,CAACG,mBA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CAAC+C;IACrB,CAAC,CAAC;EACJ;;EAEA;EACA;EACA;EACA;EACQlC,sBAAsBA,CAAA,EAAG;IAC/B,MAAMmC,QAAQ,GAAGtD,MAAM,CAAC;MACtBoB,KAAK,EAAE,IAAI,CAACV,MAAM,CAACgC,cAAc,CAACE,OAAO;MACzCrB,MAAM,EAAGb,MAAM,IAA0CsC,OAAO,CAACtC,MAAM,EAAEG,EAAE;IAC7E,CAAC,CAAC;IACFb,MAAM,CAAC;MAAEoB,KAAK,EAAEkC,QAAQ;MAAE5B,MAAM,EAAE,IAAI,CAACpB,KAAK,CAACiD;IAAQ,CAAC,CAAC;IACvDvD,MAAM,CAAC;MAAEoB,KAAK,EAAEkC,QAAQ;MAAE5B,MAAM,EAAE,IAAI,CAACf;IAAoB,CAAC,CAAC;EAC/D;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { combine, createEvent, createStore, sample } from 'effector';
|
|
4
|
+
import { delay } from 'patronum';
|
|
5
|
+
import { VOICE_TRANSCRIPT_PANEL, VoicePanelPhase } from "../../constants.js";
|
|
6
|
+
import { DropdownModel } from "../../playing/model/Dropdown.model.js";
|
|
7
|
+
// Phase machine for the recording-flow panel: open → RECORDING (waveform),
|
|
8
|
+
// confirm → PROCESSING (loader), complete/fail → DONE (transcript text).
|
|
9
|
+
// restore → PROCESSING is the reopen path: a saved recording becomes current
|
|
10
|
+
// again (no live take), so the panel jumps straight to the loader and refetches.
|
|
11
|
+
// The transcript shows inside a collapsible dropdown (same UX as the playing
|
|
12
|
+
// side): collapsed to a short preview by default, expandable via the caret.
|
|
13
|
+
// Transcript fetching itself is wired externally
|
|
14
|
+
// (see VoiceRecordWithTranscriptModel).
|
|
15
|
+
export class VoiceTranscriptPanelModel {
|
|
16
|
+
reset = createEvent();
|
|
17
|
+
dropdown = new DropdownModel();
|
|
18
|
+
open = createEvent();
|
|
19
|
+
restore = createEvent();
|
|
20
|
+
confirm = createEvent();
|
|
21
|
+
complete = createEvent();
|
|
22
|
+
fail = createEvent();
|
|
23
|
+
discard = createEvent();
|
|
24
|
+
// Ask the panel to dismiss itself gracefully — dim the transcript, linger,
|
|
25
|
+
// then close (vs. discard, which closes immediately). Wired to a wrong answer
|
|
26
|
+
// by the consumer; the panel itself stays domain-agnostic and owns the timing.
|
|
27
|
+
requestDismiss = createEvent();
|
|
28
|
+
$phase = createStore(null);
|
|
29
|
+
$transcript = createStore('');
|
|
30
|
+
$hasError = createStore(false);
|
|
31
|
+
$isDimmed = createStore(false);
|
|
32
|
+
// A dismissal asked for while the transcript is still loading: there is
|
|
33
|
+
// nothing to dim yet, so we remember it and run the dismissal once the
|
|
34
|
+
// transcript resolves into the DONE phase.
|
|
35
|
+
$isDismissPending = createStore(false);
|
|
36
|
+
|
|
37
|
+
// True while the panel owns its own dismissal — either already dimming a
|
|
38
|
+
// shown transcript, or waiting for an in-flight transcript before it can.
|
|
39
|
+
// The consumer reads this so an incidental record reset can't close the
|
|
40
|
+
// panel out from under a dismissal in progress.
|
|
41
|
+
$isHandlingDismissal = combine(this.$isDimmed, this.$isDismissPending, (isDimmed, isDismissPending) => isDimmed || isDismissPending);
|
|
42
|
+
$flags = this.$phase.map(phase => ({
|
|
43
|
+
isOpen: phase !== null,
|
|
44
|
+
isRecording: phase === VoicePanelPhase.RECORDING,
|
|
45
|
+
isProcessing: phase === VoicePanelPhase.PROCESSING,
|
|
46
|
+
isDone: phase === VoicePanelPhase.DONE
|
|
47
|
+
}));
|
|
48
|
+
constructor() {
|
|
49
|
+
this.setupPhaseTransitions();
|
|
50
|
+
this.setupDelayedDismissal();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// The event passes through only while the panel is in the given phase —
|
|
54
|
+
// e.g. a transcript that arrives after a discard must not reopen the panel
|
|
55
|
+
allowInPhase(clock, phase) {
|
|
56
|
+
return sample({
|
|
57
|
+
clock,
|
|
58
|
+
source: this.$phase,
|
|
59
|
+
filter: currentPhase => currentPhase === phase,
|
|
60
|
+
fn: (_, payload) => payload
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
setupPhaseTransitions() {
|
|
64
|
+
const confirmed = this.allowInPhase(this.confirm, VoicePanelPhase.RECORDING);
|
|
65
|
+
const completed = this.allowInPhase(this.complete, VoicePanelPhase.PROCESSING);
|
|
66
|
+
const failed = this.allowInPhase(this.fail, VoicePanelPhase.PROCESSING);
|
|
67
|
+
this.$phase.on(this.open, () => VoicePanelPhase.RECORDING).on(this.restore, () => VoicePanelPhase.PROCESSING).on(confirmed, () => VoicePanelPhase.PROCESSING).on(completed, () => VoicePanelPhase.DONE).on(failed, () => VoicePanelPhase.DONE).reset(this.reset);
|
|
68
|
+
this.$transcript.on(completed, (_, transcript) => transcript).reset([this.reset, this.restore]);
|
|
69
|
+
this.$hasError.on(failed, () => true).reset([this.reset, this.restore]);
|
|
70
|
+
sample({
|
|
71
|
+
clock: this.discard,
|
|
72
|
+
target: this.reset
|
|
73
|
+
});
|
|
74
|
+
sample({
|
|
75
|
+
clock: [this.reset, this.restore],
|
|
76
|
+
target: this.dropdown.reset
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
setupDelayedDismissal() {
|
|
80
|
+
const beginDismissal = createEvent();
|
|
81
|
+
|
|
82
|
+
// Transcript already shown → dim and dismiss right away.
|
|
83
|
+
const dismissWhileDone = this.allowInPhase(this.requestDismiss, VoicePanelPhase.DONE);
|
|
84
|
+
|
|
85
|
+
// Transcript still loading → there is nothing to dim, so defer the request.
|
|
86
|
+
const dismissWhileProcessing = this.allowInPhase(this.requestDismiss, VoicePanelPhase.PROCESSING);
|
|
87
|
+
this.$isDismissPending.on(dismissWhileProcessing, () => true).reset([this.reset, this.open, this.restore]);
|
|
88
|
+
|
|
89
|
+
// A deferred request fires the moment the transcript resolves into DONE.
|
|
90
|
+
const deferredDismiss = sample({
|
|
91
|
+
clock: this.$phase.updates,
|
|
92
|
+
source: this.$isDismissPending,
|
|
93
|
+
filter: (isDismissPending, phase) => isDismissPending && phase === VoicePanelPhase.DONE,
|
|
94
|
+
fn: () => undefined
|
|
95
|
+
});
|
|
96
|
+
sample({
|
|
97
|
+
clock: [dismissWhileDone, deferredDismiss],
|
|
98
|
+
target: beginDismissal
|
|
99
|
+
});
|
|
100
|
+
this.$isDimmed.on(beginDismissal, () => true).reset([this.reset, this.open, this.restore]);
|
|
101
|
+
const dismissTimeout = delay({
|
|
102
|
+
source: beginDismissal,
|
|
103
|
+
timeout: VOICE_TRANSCRIPT_PANEL.WRONG_ANSWER_DISMISS_DELAY_MS
|
|
104
|
+
});
|
|
105
|
+
// The phase guard drops the timer if the panel was already discarded or a
|
|
106
|
+
// new recording started during the linger window
|
|
107
|
+
sample({
|
|
108
|
+
clock: this.allowInPhase(dismissTimeout, VoicePanelPhase.DONE),
|
|
109
|
+
target: this.reset
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=VoiceTranscriptPanel.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["combine","createEvent","createStore","sample","delay","VOICE_TRANSCRIPT_PANEL","VoicePanelPhase","DropdownModel","VoiceTranscriptPanelModel","reset","dropdown","open","restore","confirm","complete","fail","discard","requestDismiss","$phase","$transcript","$hasError","$isDimmed","$isDismissPending","$isHandlingDismissal","isDimmed","isDismissPending","$flags","map","phase","isOpen","isRecording","RECORDING","isProcessing","PROCESSING","isDone","DONE","constructor","setupPhaseTransitions","setupDelayedDismissal","allowInPhase","clock","source","filter","currentPhase","fn","_","payload","confirmed","completed","failed","on","transcript","target","beginDismissal","dismissWhileDone","dismissWhileProcessing","deferredDismiss","updates","undefined","dismissTimeout","timeout","WRONG_ANSWER_DISMISS_DELAY_MS"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/model/VoiceTranscriptPanel.model.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,WAAW,EAAEC,WAAW,EAASC,MAAM,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nB,iBAAiB;MAC9BoB,MAAM,EAAEA,CAACjB,gBAAgB,EAAEG,KAAK,KAAKH,gBAAgB,IAAIG,KAAK,KAAKtB,eAAe,CAAC6B,IAAI;MACvFS,EAAE,EAAEA,CAAA,KAAMc;IACZ,CAAC,CAAC;IAEFvD,MAAM,CAAC;MAAEqC,KAAK,EAAE,CAACc,gBAAgB,EAAEE,eAAe,CAAC;MAAEJ,MAAM,EAAEC;IAAe,CAAC,CAAC;IAE9E,IAAI,CAAChC,SAAS,CAAC6B,EAAE,CAACG,cAAc,EAAE,MAAM,IAAI,CAAC,CAAC5C,KAAK,CAAC,CAAC,IAAI,CAACA,KAAK,EAAE,IAAI,CAACE,IAAI,EAAE,IAAI,CAACC,OAAO,CAAC,CAAC;IAE1F,MAAM+C,cAAc,GAAGvD,KAAK,CAAC;MAC3BqC,MAAM,EAAEY,cAAc;MACtBO,OAAO,EAAEvD,sBAAsB,CAACwD;IAClC,CAAC,CAAC;IACF;IACA;IACA1D,MAAM,CAAC;MACLqC,KAAK,EAAE,IAAI,CAACD,YAAY,CAACoB,cAAc,EAAErD,eAAe,CAAC6B,IAAI,CAAC;MAC9DiB,MAAM,EAAE,IAAI,CAAC3C;IACf,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { NO_AUDIO_BE_MESSAGE, TRANSCRIPT_MAX_RETRIES, TRANSCRIPT_RETRY_INTERVAL_MS, TranscriptionStatus } from "./constants.js";
|
|
4
|
+
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
|
|
5
|
+
|
|
6
|
+
// Polls the transcript endpoint until the BE finishes processing. FAILED and
|
|
7
|
+
// exhausted retries both resolve to the NO_AUDIO sentinel — same contract the
|
|
8
|
+
// playing side relies on.
|
|
9
|
+
export const fetchTranscriptWithRetry = async (getTranscript, audioFileId) => {
|
|
10
|
+
for (let attempt = 0; attempt < TRANSCRIPT_MAX_RETRIES; attempt++) {
|
|
11
|
+
const response = await getTranscript(audioFileId);
|
|
12
|
+
if (response.status === TranscriptionStatus.COMPLETED) {
|
|
13
|
+
return {
|
|
14
|
+
text: response.text,
|
|
15
|
+
language: response.language
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
if (response.status === TranscriptionStatus.FAILED) {
|
|
19
|
+
return {
|
|
20
|
+
text: NO_AUDIO_BE_MESSAGE
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (attempt < TRANSCRIPT_MAX_RETRIES - 1) {
|
|
24
|
+
await delay(TRANSCRIPT_RETRY_INTERVAL_MS);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
text: NO_AUDIO_BE_MESSAGE
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=transcript.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NO_AUDIO_BE_MESSAGE","TRANSCRIPT_MAX_RETRIES","TRANSCRIPT_RETRY_INTERVAL_MS","TranscriptionStatus","delay","ms","Promise","resolve","setTimeout","fetchTranscriptWithRetry","getTranscript","audioFileId","attempt","response","status","COMPLETED","text","language","FAILED"],"sourceRoot":"../../../../src","sources":["features/voice/transcript.helpers.ts"],"mappings":";;AAAA,SACEA,mBAAmB,EACnBC,sBAAsB,EACtBC,4BAA4B,EAC5BC,mBAAmB,QACd,gBAAa;AAMpB,MAAMC,KAAK,GAAIC,EAAU,IAAK,IAAIC,OAAO,CAAEC,OAAO,IAAKC,UAAU,CAACD,OAAO,EAAEF,EAAE,CAAC,CAAC;;AAE/E;AACA;AACA;AACA,OAAO,MAAMI,wBAAwB,GAAG,MAAAA,CACtCC,aAAqC,EACrCC,WAAmB,KACW;EAC9B,KAAK,IAAIC,OAAO,GAAG,CAAC,EAAEA,OAAO,GAAGX,sBAAsB,EAAEW,OAAO,EAAE,EAAE;IACjE,MAAMC,QAAQ,GAAG,MAAMH,aAAa,CAACC,WAAW,CAAC;IAEjD,IAAIE,QAAQ,CAACC,MAAM,KAAKX,mBAAmB,CAACY,SAAS,EAAE;MACrD,OAAO;QAAEC,IAAI,EAAEH,QAAQ,CAACG,IAAI;QAAEC,QAAQ,EAAEJ,QAAQ,CAACI;MAAS,CAAC;IAC7D;IAEA,IAAIJ,QAAQ,CAACC,MAAM,KAAKX,mBAAmB,CAACe,MAAM,EAAE;MAClD,OAAO;QAAEF,IAAI,EAAEhB;MAAoB,CAAC;IACtC;IAEA,IAAIY,OAAO,GAAGX,sBAAsB,GAAG,CAAC,EAAE;MACxC,MAAMG,KAAK,CAACF,4BAA4B,CAAC;IAC3C;EACF;EACA,OAAO;IAAEc,IAAI,EAAEhB;EAAoB,CAAC;AACtC,CAAC","ignoreList":[]}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return TranscriptionStatus;
|
|
8
|
-
}({});
|
|
3
|
+
import { TranscriptionStatus } from "./constants.js";
|
|
4
|
+
// The enum moved to constants.ts (jest-safe import chain for transcript helpers);
|
|
5
|
+
// re-exported here to keep the public surface unchanged.
|
|
6
|
+
export { TranscriptionStatus };
|
|
9
7
|
export let RecordButtonVariant = /*#__PURE__*/function (RecordButtonVariant) {
|
|
10
8
|
RecordButtonVariant["DEFAULT"] = "default";
|
|
11
9
|
RecordButtonVariant["ADVANCED"] = "advanced";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TranscriptionStatus","RecordButtonVariant","VoiceTranscriptionVariant"],"sourceRoot":"../../../../src","sources":["features/voice/types.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["TranscriptionStatus","RecordButtonVariant","VoiceTranscriptionVariant"],"sourceRoot":"../../../../src","sources":["features/voice/types.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,gBAAa;AAKjD;AACA;AACA,SAASA,mBAAmB;AA0F5B,WAAYC,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAK/B,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceRecordWithTranscript.model.test.d.ts","sourceRoot":"","sources":["../../../../../../src/features/voice/__tests__/VoiceRecordWithTranscript.model.test.ts"],"names":[],"mappings":""}
|
package/dist/typescript/commonjs/features/voice/__tests__/VoiceTranscriptPanel.model.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceTranscriptPanel.model.test.d.ts","sourceRoot":"","sources":["../../../../../../src/features/voice/__tests__/VoiceTranscriptPanel.model.test.ts"],"names":[],"mappings":""}
|
|
@@ -19,8 +19,42 @@ export declare const DROPDOWN_MAX_CONTENT_HEIGHT = 330;
|
|
|
19
19
|
export declare const TRANSCRIPT_RETRY_INTERVAL_MS = 4000;
|
|
20
20
|
export declare const TRANSCRIPT_MAX_RETRIES = 15;
|
|
21
21
|
export declare const NO_AUDIO_BE_MESSAGE = "No audio";
|
|
22
|
+
export declare enum TranscriptionStatus {
|
|
23
|
+
PENDING = "pending",
|
|
24
|
+
COMPLETED = "completed",
|
|
25
|
+
FAILED = "failed"
|
|
26
|
+
}
|
|
22
27
|
export declare const VOICE_RECORD_SHADOWS: {
|
|
23
28
|
default: string;
|
|
24
29
|
advanced: string;
|
|
25
30
|
};
|
|
31
|
+
export declare enum VoicePanelPhase {
|
|
32
|
+
RECORDING = "recording",
|
|
33
|
+
PROCESSING = "processing",
|
|
34
|
+
DONE = "done"
|
|
35
|
+
}
|
|
36
|
+
export declare const VOICE_WAVEFORM: {
|
|
37
|
+
readonly BAR_WIDTH: 3;
|
|
38
|
+
readonly BAR_GAP: 3;
|
|
39
|
+
readonly MIN_BAR_HEIGHT: 2;
|
|
40
|
+
readonly HEIGHT: 40;
|
|
41
|
+
readonly AMPLITUDE_PADDING: 12;
|
|
42
|
+
readonly MIN_LEVEL: 0.04;
|
|
43
|
+
readonly MIN_BARS: 16;
|
|
44
|
+
readonly BUFFER_SIZE: 120;
|
|
45
|
+
readonly SAMPLE_INTERVAL_MS: 80;
|
|
46
|
+
readonly FADE_RATIO: 0.22;
|
|
47
|
+
readonly METERING_FLOOR_DB: -60;
|
|
48
|
+
readonly LEVEL_SMOOTHING: 0.55;
|
|
49
|
+
};
|
|
50
|
+
export declare const METERING_UPDATE_INTERVAL_MS = 100;
|
|
51
|
+
export declare const WEB_METERING_FFT_SIZE = 1024;
|
|
52
|
+
export declare const VOICE_TRANSCRIPT_PANEL: {
|
|
53
|
+
readonly WIDTH: 240;
|
|
54
|
+
readonly WIDTH_DONE: 360;
|
|
55
|
+
readonly TRANSCRIPT_MAX_HEIGHT: 200;
|
|
56
|
+
readonly SCROLLBAR_WIDTH: 8;
|
|
57
|
+
readonly WRONG_ANSWER_DISMISS_DELAY_MS: 5000;
|
|
58
|
+
readonly DIMMED_OPACITY: 0.4;
|
|
59
|
+
};
|
|
26
60
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B;;;;;;;;;CAS1C,CAAA;AACD,eAAO,MAAM,8BAA8B,QAAQ,CAAA;AACnD,eAAO,MAAM,8BAA8B,MAAM,CAAA;AACjD,oBAAY,kBAAkB;IAC5B,IAAI,IAAA;IACJ,SAAS,IAAA;IACT,MAAM,IAAA;CACP;AACD,eAAO,MAAM,2BAA2B,MAAM,CAAA;AAC9C,eAAO,MAAM,4BAA4B,OAAO,CAAA;AAChD,eAAO,MAAM,sBAAsB,KAAK,CAAA;AACxC,eAAO,MAAM,mBAAmB,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B;;;;;;;;;CAS1C,CAAA;AACD,eAAO,MAAM,8BAA8B,QAAQ,CAAA;AACnD,eAAO,MAAM,8BAA8B,MAAM,CAAA;AACjD,oBAAY,kBAAkB;IAC5B,IAAI,IAAA;IACJ,SAAS,IAAA;IACT,MAAM,IAAA;CACP;AACD,eAAO,MAAM,2BAA2B,MAAM,CAAA;AAC9C,eAAO,MAAM,4BAA4B,OAAO,CAAA;AAChD,eAAO,MAAM,sBAAsB,KAAK,CAAA;AACxC,eAAO,MAAM,mBAAmB,aAAa,CAAA;AAE7C,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAGD,eAAO,MAAM,oBAAoB;;;CAGhC,CAAA;AAED,oBAAY,eAAe;IACzB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;CAcjB,CAAA;AAIV,eAAO,MAAM,2BAA2B,MAAM,CAAA;AAC9C,eAAO,MAAM,qBAAqB,OAAO,CAAA;AAEzC,eAAO,MAAM,sBAAsB;;;;;;;CAQzB,CAAA"}
|
|
@@ -3,6 +3,9 @@ import { VoicePlayerApi, VoiceRecorderApi } from './types';
|
|
|
3
3
|
import { PlayerState } from './playing/model';
|
|
4
4
|
import { AudioStatus } from '../chatbot';
|
|
5
5
|
export declare const formatDuration: (ms: number) => string;
|
|
6
|
+
export declare const normalizeMetering: (metering: number | null | undefined) => number;
|
|
7
|
+
type MeteringCallback = (decibels: number | null) => void;
|
|
8
|
+
export declare const createWebMeteringMonitor: (recorder: AudioRecorder, onMetering: MeteringCallback) => (() => void);
|
|
6
9
|
export declare const ensureRecordingPermissions: () => Promise<boolean>;
|
|
7
10
|
export declare const getAvailableInputs: (recorder: AudioRecorder) => Promise<MediaDeviceInfo[] | import("expo-audio").RecordingInput[]>;
|
|
8
11
|
export declare const addAudioInputsListenerWeb: (callback: (devices: MediaDeviceInfo[]) => void) => () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,aAAa,EAId,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,aAAa,EAId,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAO1D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC,eAAO,MAAM,cAAc,OAAQ,MAAM,KAAG,MAK3C,CAAA;AAID,eAAO,MAAM,iBAAiB,aAAc,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,MAQvE,CAAA;AAaD,KAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;AAazD,eAAO,MAAM,wBAAwB,aACzB,aAAa,cACX,gBAAgB,KAC3B,CAAC,MAAM,IAAI,CAsCb,CAAA;AAED,eAAO,MAAM,0BAA0B,wBAStC,CAAA;AASD,eAAO,MAAM,kBAAkB,aAAoB,aAAa,uEAQ/D,CAAA;AAED,eAAO,MAAM,yBAAyB,aAAc,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,eAiBvF,CAAA;AACD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,YACpB,MAAM,mBACE,WAAW,KAC3B,OAAO,CAAC,MAAM,GAAG,SAAS,CAkC5B,CAAA;AAED,KAAK,2BAA2B,GAAG;IACjC,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,qBAAqB,4CAI/B,2BAA2B,KAAG,OAAO,CAAC,QAAQ,CA4BhD,CAAA;AAED,eAAO,MAAM,+BAA+B,sBACvB,QAAQ,OACtB,gBAAgB;;;;;;;CAiBtB,CAAA;AA2CD,eAAO,MAAM,iCAAiC,gBAAiB,MAAM,OAAO,cAAc;;;;;;;;;;;CAgBzF,CAAA;AAED,eAAO,MAAM,gBAAgB,mBAAoB,MAAM,kBAAkB,MAAM,KAAG,MAAM,GAAG,IAG1F,CAAA;AAED,eAAO,MAAM,cAAc,UAAW,WAAW,KAAG,WAAW,GAAG,SAIjE,CAAA;AAED,eAAO,MAAM,UAAU,UAAW,OAAO,KAAG,OAM3C,CAAA"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
export * from './recording/components/VoiceRecord';
|
|
2
|
+
export * from './recording/components/VoiceRecordWithTranscript';
|
|
3
|
+
export * from './recording/components/VoiceWaveform';
|
|
4
|
+
export * from './recording/components/VoiceTranscriptPanel';
|
|
5
|
+
export * from './recording/hooks/useVoiceWaveform';
|
|
2
6
|
export * from './recording/model/VoiceRecord.model';
|
|
7
|
+
export * from './recording/model/VoiceRecordWithTranscript.model';
|
|
8
|
+
export * from './recording/model/VoiceTranscriptPanel.model';
|
|
3
9
|
export * from './recording/modal/VoiceRecordDeleteModal';
|
|
4
10
|
export * from './recording/modal/VoiceRecordUndoModal';
|
|
11
|
+
export * from './transcript.helpers';
|
|
5
12
|
export * from './playing/model/VoicePlayer.model';
|
|
6
13
|
export * from './playing/components/VoiceTranscription';
|
|
7
14
|
export * from './playing/hooks/useVoicePlayerLifecycle';
|
|
@@ -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;
|
|
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"}
|
package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import React from 'react';
|
|
|
2
2
|
type VoiceTranscriptContentProps = {
|
|
3
3
|
text: string;
|
|
4
4
|
isLoading: boolean;
|
|
5
|
+
numberOfLines?: number;
|
|
6
|
+
dimmed?: boolean;
|
|
5
7
|
};
|
|
6
|
-
export declare const VoiceTranscriptContent: ({ text, isLoading }: VoiceTranscriptContentProps) => React.JSX.Element;
|
|
8
|
+
export declare const VoiceTranscriptContent: ({ text, isLoading, numberOfLines, dimmed, }: VoiceTranscriptContentProps) => React.JSX.Element;
|
|
7
9
|
export {};
|
|
8
10
|
//# sourceMappingURL=VoiceTranscriptContent.d.ts.map
|
package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts.map
CHANGED
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"VoiceTranscriptContent.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/components/VoiceTranscriptContent.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,KAAK,2BAA2B,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,sBAAsB,gDAKhC,2BAA2B,sBAoB7B,CAAA"}
|
package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { TranscriptionsCollection } from './TranscriptionsCollection';
|
|
2
2
|
import { VoicePlayerApi } from '../../types';
|
|
3
|
-
|
|
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
|
|
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,
|
|
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"}
|
package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordWithTranscript.d.ts
ADDED
|
@@ -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"}
|
package/dist/typescript/commonjs/features/voice/recording/components/VoiceTranscriptPanel.d.ts
ADDED
|
@@ -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
|
package/dist/typescript/commonjs/features/voice/recording/components/VoiceTranscriptPanel.d.ts.map
ADDED
|
@@ -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;AA8BrB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AAuD/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,6BAmHzF,CAAA"}
|
|
@@ -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"}
|
package/dist/typescript/commonjs/features/voice/recording/hooks/useTranscriptPanelAnimation.d.ts
ADDED
|
@@ -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
|
package/dist/typescript/commonjs/features/voice/recording/hooks/useTranscriptPanelAnimation.d.ts.map
ADDED
|
@@ -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;
|
|
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 @@
|
|
|
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>;
|