@magmamath/students-features 1.7.9 → 1.7.10-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +22 -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 +253 -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 +100 -0
- package/dist/commonjs/features/voice/recording/model/VoiceRecordWithTranscript.model.js.map +1 -0
- package/dist/commonjs/features/voice/recording/model/VoiceTranscriptPanel.model.js +115 -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/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 +20 -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 +246 -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 +95 -0
- package/dist/module/features/voice/recording/model/VoiceRecordWithTranscript.model.js.map +1 -0
- package/dist/module/features/voice/recording/model/VoiceTranscriptPanel.model.js +110 -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 +16 -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 +31 -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 +16 -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 +31 -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/voice/__tests__/VoiceRecordWithTranscript.model.test.ts +228 -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 +27 -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 +293 -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 +104 -0
- package/src/features/voice/recording/model/VoiceTranscriptPanel.model.ts +131 -0
- package/src/features/voice/transcript.helpers.ts +37 -0
- package/src/features/voice/types.ts +5 -6
- package/src/i18n/.generated/schema.json +6 -5
|
@@ -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,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;EAC9Ca,WAAW,GAAGb,WAAW,CAAgB,CAAC;EAE1Cc,iBAAiB,GAAGb,OAAO,CACzC,IAAI,CAACS,mBAAmB,EACxBP,kBAAkB,CAACY,IACrB,CAAC,CAACN,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EACHO,gBAAgB,GAAGf,OAAO,CAAC,IAAI,CAACU,kBAAkB,EAAE,EAAE,CAAC;EACvDM,oBAAoB,GAAGhB,OAAO,CAAC,IAAI,CAACW,sBAAsB,EAAE,CAAC,CAAC,CAACH,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EAChG;EACgBS,SAAS,GAAGjB,OAAO,CAAC,IAAI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
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
|
+
const upload = await record.audioUploadPromise;
|
|
20
|
+
if (!upload || !upload.id) throw new Error('Audio upload did not return a file id');
|
|
21
|
+
const {
|
|
22
|
+
text
|
|
23
|
+
} = await fetchTranscriptWithRetry(getTranscript, upload.id);
|
|
24
|
+
if (text === NO_AUDIO_BE_MESSAGE) throw new Error('Transcript is not available');
|
|
25
|
+
return text;
|
|
26
|
+
});
|
|
27
|
+
this.setupPanelLifecycle();
|
|
28
|
+
this.setupTranscriptPipeline();
|
|
29
|
+
}
|
|
30
|
+
setupPanelLifecycle() {
|
|
31
|
+
sample({
|
|
32
|
+
clock: this.record.recorderModel.$voiceRecordState,
|
|
33
|
+
filter: state => state === VoiceRecorderState.RECORDING,
|
|
34
|
+
target: this.panel.open
|
|
35
|
+
});
|
|
36
|
+
// startAudioUpload fires exactly when a recording was confirmed (the
|
|
37
|
+
// discard path never uploads), so it doubles as the panel's confirm clock.
|
|
38
|
+
sample({
|
|
39
|
+
clock: this.record.startAudioUpload,
|
|
40
|
+
target: this.panel.confirm
|
|
41
|
+
});
|
|
42
|
+
// The record resets as a side effect of a wrong answer (the attempt key
|
|
43
|
+
// rotates to a take with no recording). While the panel is handling its own
|
|
44
|
+
// dismissal — dimming a shown transcript, or waiting for one that is still
|
|
45
|
+
// loading — that incidental reset must not close it early; the panel owns
|
|
46
|
+
// the close.
|
|
47
|
+
sample({
|
|
48
|
+
clock: [this.record.reset, this.record.stop.done],
|
|
49
|
+
source: this.panel.$isHandlingDismissal,
|
|
50
|
+
filter: isHandlingDismissal => !isHandlingDismissal,
|
|
51
|
+
target: this.panel.discard
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
setupTranscriptPipeline() {
|
|
55
|
+
// A fetch result applies when the record it was fetched for is still the
|
|
56
|
+
// current one — late results from a discarded or re-recorded take are
|
|
57
|
+
// dropped. The exception is a pending dismissal: a wrong answer rotates
|
|
58
|
+
// $currentRecord away from the take it was fetched for, but that take's
|
|
59
|
+
// transcript is exactly the one the panel is waiting to show before it
|
|
60
|
+
// closes, so it must still apply.
|
|
61
|
+
const shouldApplyResult = ({
|
|
62
|
+
currentRecord,
|
|
63
|
+
isDismissPending
|
|
64
|
+
}, {
|
|
65
|
+
params
|
|
66
|
+
}) => isDismissPending || currentRecord === params;
|
|
67
|
+
const resultGuardSource = {
|
|
68
|
+
currentRecord: this.record.$currentRecord,
|
|
69
|
+
isDismissPending: this.panel.$isDismissPending
|
|
70
|
+
};
|
|
71
|
+
sample({
|
|
72
|
+
clock: this.record.$currentRecord.updates,
|
|
73
|
+
source: this.panel.$flags,
|
|
74
|
+
filter: (flags, record) => flags.isProcessing && Boolean(record?.audioUploadPromise),
|
|
75
|
+
fn: (_, record) => record,
|
|
76
|
+
target: this.resolveTranscriptFx
|
|
77
|
+
});
|
|
78
|
+
sample({
|
|
79
|
+
clock: this.resolveTranscriptFx.done,
|
|
80
|
+
source: resultGuardSource,
|
|
81
|
+
filter: shouldApplyResult,
|
|
82
|
+
fn: (_, {
|
|
83
|
+
result
|
|
84
|
+
}) => result,
|
|
85
|
+
target: this.panel.complete
|
|
86
|
+
});
|
|
87
|
+
sample({
|
|
88
|
+
clock: this.resolveTranscriptFx.fail,
|
|
89
|
+
source: resultGuardSource,
|
|
90
|
+
filter: shouldApplyResult,
|
|
91
|
+
target: this.panel.fail
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# 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","upload","audioUploadPromise","id","Error","text","setupPanelLifecycle","setupTranscriptPipeline","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"],"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,mBAAmB,GAAGZ,YAAY,CAAC,MAAOW,MAAiC,IAAK;MACnF,MAAME,MAAM,GAAG,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iBAAiB,GAAGA,CACxB;MAAEC,aAAa;MAAEC;IAAoC,CAAC,EACtD;MAAEC;IAA8C,CAAC,KAC9CD,gBAAgB,IAAID,aAAa,KAAKE,MAAM;IAEjD,MAAMC,iBAAiB,GAAG;MACxBH,aAAa,EAAE,IAAI,CAAC3B,MAAM,CAAC+B,cAAc;MACzCH,gBAAgB,EAAE,IAAI,CAAChC,KAAK,CAACoC;IAC/B,CAAC;IAED1C,MAAM,CAAC;MACLmB,KAAK,EAAE,IAAI,CAACT,MAAM,CAAC+B,cAAc,CAACE,OAAO;MACzCX,MAAM,EAAE,IAAI,CAAC1B,KAAK,CAACsC,MAAM;MACzBtB,MAAM,EAAEA,CAACuB,KAAK,EAAEnC,MAAM,KAAKmC,KAAK,CAACC,YAAY,IAAIC,OAAO,CAACrC,MAAM,EAAEG,kBAAkB,CAAC;MACpFmC,EAAE,EAAEA,CAACC,CAAC,EAAEvC,MAAM,KAAgCA,MAAM;MACpDe,MAAM,EAAE,IAAI,CAACd;IACf,CAAC,CAAC;IACFX,MAAM,CAAC;MACLmB,KAAK,EAAE,IAAI,CAACR,mBAAmB,CAACoB,IAAI;MACpCC,MAAM,EAAEQ,iBAAiB;MACzBlB,MAAM,EAAEc,iBAAiB;MACzBY,EAAE,EAAEA,CAACC,CAAC,EAAE;QAAEC;MAAO,CAAC,KAAKA,MAAM;MAC7BzB,MAAM,EAAE,IAAI,CAACnB,KAAK,CAAC6C;IACrB,CAAC,CAAC;IACFnD,MAAM,CAAC;MACLmB,KAAK,EAAE,IAAI,CAACR,mBAAmB,CAACyC,IAAI;MACpCpB,MAAM,EAAEQ,iBAAiB;MACzBlB,MAAM,EAAEc,iBAAiB;MACzBX,MAAM,EAAE,IAAI,CAACnB,KAAK,CAAC8C;IACrB,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
// The transcript shows inside a collapsible dropdown (same UX as the playing
|
|
10
|
+
// side): collapsed to a short preview by default, expandable via the caret.
|
|
11
|
+
// Transcript fetching itself is wired externally
|
|
12
|
+
// (see VoiceRecordWithTranscriptModel).
|
|
13
|
+
export class VoiceTranscriptPanelModel {
|
|
14
|
+
reset = createEvent();
|
|
15
|
+
dropdown = new DropdownModel();
|
|
16
|
+
open = createEvent();
|
|
17
|
+
confirm = createEvent();
|
|
18
|
+
complete = createEvent();
|
|
19
|
+
fail = createEvent();
|
|
20
|
+
discard = createEvent();
|
|
21
|
+
// Ask the panel to dismiss itself gracefully — dim the transcript, linger,
|
|
22
|
+
// then close (vs. discard, which closes immediately). Wired to a wrong answer
|
|
23
|
+
// by the consumer; the panel itself stays domain-agnostic and owns the timing.
|
|
24
|
+
requestDismiss = createEvent();
|
|
25
|
+
$phase = createStore(null);
|
|
26
|
+
$transcript = createStore('');
|
|
27
|
+
$hasError = createStore(false);
|
|
28
|
+
$isDimmed = createStore(false);
|
|
29
|
+
// A dismissal asked for while the transcript is still loading: there is
|
|
30
|
+
// nothing to dim yet, so we remember it and run the dismissal once the
|
|
31
|
+
// transcript resolves into the DONE phase.
|
|
32
|
+
$isDismissPending = createStore(false);
|
|
33
|
+
|
|
34
|
+
// True while the panel owns its own dismissal — either already dimming a
|
|
35
|
+
// shown transcript, or waiting for an in-flight transcript before it can.
|
|
36
|
+
// The consumer reads this so an incidental record reset can't close the
|
|
37
|
+
// panel out from under a dismissal in progress.
|
|
38
|
+
$isHandlingDismissal = combine(this.$isDimmed, this.$isDismissPending, (isDimmed, isDismissPending) => isDimmed || isDismissPending);
|
|
39
|
+
$flags = this.$phase.map(phase => ({
|
|
40
|
+
isOpen: phase !== null,
|
|
41
|
+
isRecording: phase === VoicePanelPhase.RECORDING,
|
|
42
|
+
isProcessing: phase === VoicePanelPhase.PROCESSING,
|
|
43
|
+
isDone: phase === VoicePanelPhase.DONE
|
|
44
|
+
}));
|
|
45
|
+
constructor() {
|
|
46
|
+
this.setupPhaseTransitions();
|
|
47
|
+
this.setupDelayedDismissal();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// The event passes through only while the panel is in the given phase —
|
|
51
|
+
// e.g. a transcript that arrives after a discard must not reopen the panel
|
|
52
|
+
allowInPhase(clock, phase) {
|
|
53
|
+
return sample({
|
|
54
|
+
clock,
|
|
55
|
+
source: this.$phase,
|
|
56
|
+
filter: currentPhase => currentPhase === phase,
|
|
57
|
+
fn: (_, payload) => payload
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
setupPhaseTransitions() {
|
|
61
|
+
const confirmed = this.allowInPhase(this.confirm, VoicePanelPhase.RECORDING);
|
|
62
|
+
const completed = this.allowInPhase(this.complete, VoicePanelPhase.PROCESSING);
|
|
63
|
+
const failed = this.allowInPhase(this.fail, VoicePanelPhase.PROCESSING);
|
|
64
|
+
this.$phase.on(this.open, () => VoicePanelPhase.RECORDING).on(confirmed, () => VoicePanelPhase.PROCESSING).on(completed, () => VoicePanelPhase.DONE).on(failed, () => VoicePanelPhase.DONE).reset(this.reset);
|
|
65
|
+
this.$transcript.on(completed, (_, transcript) => transcript).reset(this.reset);
|
|
66
|
+
this.$hasError.on(failed, () => true).reset(this.reset);
|
|
67
|
+
sample({
|
|
68
|
+
clock: this.discard,
|
|
69
|
+
target: this.reset
|
|
70
|
+
});
|
|
71
|
+
sample({
|
|
72
|
+
clock: this.reset,
|
|
73
|
+
target: this.dropdown.reset
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
setupDelayedDismissal() {
|
|
77
|
+
const beginDismissal = createEvent();
|
|
78
|
+
|
|
79
|
+
// Transcript already shown → dim and dismiss right away.
|
|
80
|
+
const dismissWhileDone = this.allowInPhase(this.requestDismiss, VoicePanelPhase.DONE);
|
|
81
|
+
|
|
82
|
+
// Transcript still loading → there is nothing to dim, so defer the request.
|
|
83
|
+
const dismissWhileProcessing = this.allowInPhase(this.requestDismiss, VoicePanelPhase.PROCESSING);
|
|
84
|
+
this.$isDismissPending.on(dismissWhileProcessing, () => true).reset([this.reset, this.open]);
|
|
85
|
+
|
|
86
|
+
// A deferred request fires the moment the transcript resolves into DONE.
|
|
87
|
+
const deferredDismiss = sample({
|
|
88
|
+
clock: this.$phase.updates,
|
|
89
|
+
source: this.$isDismissPending,
|
|
90
|
+
filter: (isDismissPending, phase) => isDismissPending && phase === VoicePanelPhase.DONE,
|
|
91
|
+
fn: () => undefined
|
|
92
|
+
});
|
|
93
|
+
sample({
|
|
94
|
+
clock: [dismissWhileDone, deferredDismiss],
|
|
95
|
+
target: beginDismissal
|
|
96
|
+
});
|
|
97
|
+
this.$isDimmed.on(beginDismissal, () => true).reset([this.reset, this.open]);
|
|
98
|
+
const dismissTimeout = delay({
|
|
99
|
+
source: beginDismissal,
|
|
100
|
+
timeout: VOICE_TRANSCRIPT_PANEL.WRONG_ANSWER_DISMISS_DELAY_MS
|
|
101
|
+
});
|
|
102
|
+
// The phase guard drops the timer if the panel was already discarded or a
|
|
103
|
+
// new recording started during the linger window
|
|
104
|
+
sample({
|
|
105
|
+
clock: this.allowInPhase(dismissTimeout, VoicePanelPhase.DONE),
|
|
106
|
+
target: this.reset
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# 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","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,QAAQ,UAAU;AAC3E,SAASC,KAAK,QAAQ,UAAU;AAEhC,SAASC,sBAAsB,EAAEC,eAAe,QAAQ,oBAAiB;AACzE,SAASC,aAAa,QAAQ,uCAAoC;AASlE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,CAAC;EACrBC,KAAK,GAAGR,WAAW,CAAC,CAAC;EAErBS,QAAQ,GAAG,IAAIH,aAAa,CAAC,CAAC;EAE9BI,IAAI,GAAGV,WAAW,CAAC,CAAC;EACpBW,OAAO,GAAGX,WAAW,CAAC,CAAC;EACvBY,QAAQ,GAAGZ,WAAW,CAAS,CAAC;EAChCa,IAAI,GAAGb,WAAW,CAAC,CAAC;EACpBc,OAAO,GAAGd,WAAW,CAAC,CAAC;EACvC;EACA;EACA;EACgBe,cAAc,GAAGf,WAAW,CAAC,CAAC;EAE9BgB,MAAM,GAAGf,WAAW,CAAyB,IAAI,CAAC;EAClDgB,WAAW,GAAGhB,WAAW,CAAC,EAAE,CAAC;EAC7BiB,SAAS,GAAGjB,WAAW,CAAC,KAAK,CAAC;EAC9BkB,SAAS,GAAGlB,WAAW,CAAC,KAAK,CAAC;EAC9C;EACA;EACA;EACgBmB,iBAAiB,GAAGnB,WAAW,CAAC,KAAK,CAAC;;EAEtD;EACA;EACA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E,IAAI,CAACE,IAAI,CAAC,CAAC;;IAE5F;IACA,MAAM4C,eAAe,GAAGpD,MAAM,CAAC;MAC7BoC,KAAK,EAAE,IAAI,CAACtB,MAAM,CAACuC,OAAO;MAC1BhB,MAAM,EAAE,IAAI,CAACnB,iBAAiB;MAC9BoB,MAAM,EAAEA,CAACjB,gBAAgB,EAAEG,KAAK,KAAKH,gBAAgB,IAAIG,KAAK,KAAKrB,eAAe,CAAC4B,IAAI;MACvFS,EAAE,EAAEA,CAAA,KAAMc;IACZ,CAAC,CAAC;IAEFtD,MAAM,CAAC;MAAEoC,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,CAAC3C,KAAK,CAAC,CAAC,IAAI,CAACA,KAAK,EAAE,IAAI,CAACE,IAAI,CAAC,CAAC;IAE5E,MAAM+C,cAAc,GAAGtD,KAAK,CAAC;MAC3BoC,MAAM,EAAEY,cAAc;MACtBO,OAAO,EAAEtD,sBAAsB,CAACuD;IAClC,CAAC,CAAC;IACF;IACA;IACAzD,MAAM,CAAC;MACLoC,KAAK,EAAE,IAAI,CAACD,YAAY,CAACoB,cAAc,EAAEpD,eAAe,CAAC4B,IAAI,CAAC;MAC9DiB,MAAM,EAAE,IAAI,CAAC1C;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>;
|
|
@@ -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;
|
|
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"}
|
package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordWithTranscript.model.d.ts
ADDED
|
@@ -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;AAWD,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;IAsB3B,OAAO,CAAC,uBAAuB;CAsChC"}
|