@dxos/react-ui-transcription 0.0.0
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/LICENSE +105 -0
- package/dist/lib/browser/index.mjs +1002 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/node-esm/index.mjs +1004 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/types/src/capture/create-transcriber.d.ts +18 -0
- package/dist/types/src/capture/create-transcriber.d.ts.map +1 -0
- package/dist/types/src/capture/index.d.ts +3 -0
- package/dist/types/src/capture/index.d.ts.map +1 -0
- package/dist/types/src/capture/media-stream-recorder.d.ts +30 -0
- package/dist/types/src/capture/media-stream-recorder.d.ts.map +1 -0
- package/dist/types/src/components/MicSettings/MicSettings.d.ts +25 -0
- package/dist/types/src/components/MicSettings/MicSettings.d.ts.map +1 -0
- package/dist/types/src/components/MicSettings/index.d.ts +2 -0
- package/dist/types/src/components/MicSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/PipelineStatus/PipelineStatus.d.ts +20 -0
- package/dist/types/src/components/PipelineStatus/PipelineStatus.d.ts.map +1 -0
- package/dist/types/src/components/PipelineStatus/index.d.ts +2 -0
- package/dist/types/src/components/PipelineStatus/index.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts +11 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/index.d.ts +3 -0
- package/dist/types/src/components/Transcription/index.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/transcription-extension.d.ts +15 -0
- package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +4 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +8 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioFile.d.ts +7 -0
- package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioTrack.d.ts +6 -0
- package/dist/types/src/hooks/useAudioTrack.d.ts.map +1 -0
- package/dist/types/src/hooks/useFeedModelAdapter.d.ts +12 -0
- package/dist/types/src/hooks/useFeedModelAdapter.d.ts.map +1 -0
- package/dist/types/src/hooks/useIsSpeaking.d.ts +5 -0
- package/dist/types/src/hooks/useIsSpeaking.d.ts.map +1 -0
- package/dist/types/src/hooks/useRecordingPipeline.d.ts +40 -0
- package/dist/types/src/hooks/useRecordingPipeline.d.ts.map +1 -0
- package/dist/types/src/hooks/useSpeechRecognition.d.ts +9 -0
- package/dist/types/src/hooks/useSpeechRecognition.d.ts.map +1 -0
- package/dist/types/src/hooks/useTranscriber.d.ts +10 -0
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +7 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/model/index.d.ts +2 -0
- package/dist/types/src/model/index.d.ts.map +1 -0
- package/dist/types/src/model/transcript-model.d.ts +68 -0
- package/dist/types/src/model/transcript-model.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +3 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +2 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/render-byline.d.ts +4 -0
- package/dist/types/src/util/render-byline.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +69 -0
- package/src/capture/create-transcriber.ts +49 -0
- package/src/capture/index.ts +6 -0
- package/src/capture/media-stream-recorder.ts +137 -0
- package/src/components/MicSettings/MicSettings.tsx +126 -0
- package/src/components/MicSettings/index.ts +5 -0
- package/src/components/PipelineStatus/PipelineStatus.tsx +71 -0
- package/src/components/PipelineStatus/index.ts +5 -0
- package/src/components/Transcription/Transcription.tsx +67 -0
- package/src/components/Transcription/index.ts +6 -0
- package/src/components/Transcription/transcription-extension.ts +203 -0
- package/src/components/index.ts +7 -0
- package/src/hooks/index.ts +11 -0
- package/src/hooks/useAudioFile.ts +88 -0
- package/src/hooks/useAudioTrack.ts +56 -0
- package/src/hooks/useFeedModelAdapter.ts +46 -0
- package/src/hooks/useIsSpeaking.ts +42 -0
- package/src/hooks/useRecordingPipeline.ts +166 -0
- package/src/hooks/useSpeechRecognition.ts +56 -0
- package/src/hooks/useTranscriber.ts +45 -0
- package/src/index.ts +10 -0
- package/src/model/index.ts +5 -0
- package/src/model/transcript-model.ts +229 -0
- package/src/types.ts +6 -0
- package/src/util/index.ts +5 -0
- package/src/util/render-byline.ts +32 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/model/index.ts"],"names":[],"mappings":"AAIA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Text } from '@codemirror/state';
|
|
2
|
+
import { type EditorView } from '@codemirror/view';
|
|
3
|
+
import { Event } from '@dxos/async';
|
|
4
|
+
export type Chunk = {
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Covert block to a set of markdown lines.
|
|
9
|
+
*/
|
|
10
|
+
export type ChunkRenderer<T extends Chunk> = (chunk: T, index: number, debug?: boolean) => string[];
|
|
11
|
+
/**
|
|
12
|
+
* Abstract representation of the document model.
|
|
13
|
+
*/
|
|
14
|
+
export interface ChunkDocument {
|
|
15
|
+
lineCount(): number;
|
|
16
|
+
replaceLines(from: number, remove: number, insert: string[]): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* CodeMirror-backed {@link ChunkDocument}.
|
|
20
|
+
*/
|
|
21
|
+
export declare class EditorChunkDocument implements ChunkDocument {
|
|
22
|
+
private readonly _view;
|
|
23
|
+
constructor(_view: EditorView);
|
|
24
|
+
/** The document must always have at least one line. */
|
|
25
|
+
lineCount(): number;
|
|
26
|
+
replaceLines(from: number, remove: number, insert: string[]): void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Each Chunk can be converted into a set of lines.
|
|
30
|
+
* Chunks can be added, updated or deleted from the Queue.
|
|
31
|
+
* A Document is an immutable projection that represents a flat list of lines corresponding to the Queue.
|
|
32
|
+
*
|
|
33
|
+
* Ideally we would implement a custom virtual Text model for the View, but this currently isn't possible in Codemirror.
|
|
34
|
+
* Instead this model tracks changes and syncs them with the ChunkDocument.
|
|
35
|
+
*/
|
|
36
|
+
export declare class TranscriptModel<T extends Chunk> {
|
|
37
|
+
private readonly _renderer;
|
|
38
|
+
/** Emits when the document is updated. */
|
|
39
|
+
readonly update: Event<void>;
|
|
40
|
+
/** Ordered set of chunks. */
|
|
41
|
+
private readonly _chunks;
|
|
42
|
+
/** Map of chunk IDs to their current line counts. */
|
|
43
|
+
private readonly _chunkLineCounts;
|
|
44
|
+
/** Map of line numbers to chunk IDs. */
|
|
45
|
+
private readonly _lineToChunk;
|
|
46
|
+
/** Track chunk changes since last sync. */
|
|
47
|
+
private readonly _changes;
|
|
48
|
+
constructor(_renderer: ChunkRenderer<T>, initialChunks?: T[]);
|
|
49
|
+
toJSON(): {
|
|
50
|
+
chunks: number;
|
|
51
|
+
changes: number;
|
|
52
|
+
};
|
|
53
|
+
get doc(): Text;
|
|
54
|
+
get chunks(): T[];
|
|
55
|
+
/**
|
|
56
|
+
* Get the block ID at the given line number.
|
|
57
|
+
*/
|
|
58
|
+
getChunkAtLine(line: number): T | undefined;
|
|
59
|
+
reset(): this;
|
|
60
|
+
appendChunk(chunk: T): this;
|
|
61
|
+
updateChunk(chunk: T): this;
|
|
62
|
+
deleteBlock(id: string): this;
|
|
63
|
+
/**
|
|
64
|
+
* Syncs the tracked changes with the ChunkDocument.
|
|
65
|
+
*/
|
|
66
|
+
sync(document: ChunkDocument): this;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=transcript-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript-model.d.ts","sourceRoot":"","sources":["../../../../src/model/transcript-model.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIpC,MAAM,MAAM,KAAK,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,MAAM,EAAE,CAAC;AAEpG;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,IAAI,MAAM,CAAC;IACpB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACpE;AAED;;GAEG;AACH,qBAAa,mBAAoB,YAAW,aAAa;IAC3C,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAlC,YAA6B,KAAK,EAAE,UAAU,EAAI;IAElD,uDAAuD;IACvD,SAAS,IAAI,MAAM,CAElB;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAgBjE;CACF;AAmBD;;;;;;;GAOG;AACH,qBAAa,eAAe,CAAC,CAAC,SAAS,KAAK;IAiBxC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAhB5B,0CAA0C;IAC1C,SAAgB,MAAM,cAAqB;IAE3C,6BAA6B;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;IAEnC,qDAAqD;IACrD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA6B;IAE9D,wCAAwC;IACxC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAwB;IAErD,2CAA2C;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAEtD,YACmB,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC5C,aAAa,GAAE,CAAC,EAAO,EAKxB;IAED,MAAM,IAAI;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAK5C;IAED,IAAI,GAAG,SAEN;IAED,IAAI,MAAM,QAET;IAED;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAE1C;IAED,KAAK,IAAI,IAAI,CAMZ;IAED,WAAW,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAM1B;IAED,WAAW,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAO1B;IAED,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAO5B;IAED;;OAEG;IACH,IAAI,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CA8DlC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,0CAA0C;AAC1C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Identity } from '@dxos/react-client/halo';
|
|
2
|
+
import { type Message } from '@dxos/types';
|
|
3
|
+
export declare const renderByline: (identities: Identity[]) => (message: Message.Message, index: number, debug?: boolean) => string[];
|
|
4
|
+
//# sourceMappingURL=render-byline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-byline.d.ts","sourceRoot":"","sources":["../../../../src/util/render-byline.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,eAAO,MAAM,YAAY,eACV,QAAQ,EAAE,eACb,OAAO,CAAC,OAAO,SAAS,MAAM,sBAAkB,MAAM,EAsB/D,CAAC"}
|