@bendyline/squisq-editor-react 2.11.17 → 2.11.18
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/{chunk-HTO5MTTJ.js → chunk-45NQUR62.js} +1104 -129
- package/dist/{chunk-XZVMKR5Q.js → chunk-CGENKHWY.js} +14 -93
- package/dist/chunk-DNEVUOBZ.js +14 -0
- package/dist/chunk-DNJ6HOES.js +93 -0
- package/dist/{chunk-US5DALTZ.js → chunk-GIXXD2O3.js} +2117 -1941
- package/dist/{chunk-QZWFSSDE.js → chunk-H7YTL6SL.js} +1 -1
- package/dist/chunk-LRZJD5YD.js +107 -0
- package/dist/{chunk-C6QVA6TO.js → chunk-U6NVT3BY.js} +17 -112
- package/dist/{chunk-EJKGXWNK.js → chunk-WKZLBGPX.js} +1 -1
- package/dist/dictationSession-PN3OT5LJ.js +521 -0
- package/dist/index.d.ts +27 -4
- package/dist/index.js +50 -18
- package/dist/recorder/index.js +17 -13
- package/dist/review/index.js +2 -1
- package/dist/shell/index.d.ts +2 -1
- package/dist/shell/index.js +8 -5
- package/dist/{shell-X0EoQbbN.d.ts → shell-Cb0P_ln8.d.ts} +170 -5
- package/dist/speech/index.d.ts +126 -0
- package/dist/speech/index.js +10 -0
- package/dist/styles/index.css +125 -0
- package/dist/teleprompter/index.d.ts +11 -3
- package/dist/teleprompter/index.js +3 -2
- package/package.json +10 -6
|
@@ -1,86 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"audio/ogg;codecs=opus"
|
|
8
|
-
];
|
|
9
|
-
var VIDEO_CANDIDATES = [
|
|
10
|
-
"video/webm;codecs=vp9,opus",
|
|
11
|
-
"video/webm;codecs=vp8,opus",
|
|
12
|
-
"video/webm",
|
|
13
|
-
"video/mp4;codecs=avc1.42E01E,mp4a.40.2",
|
|
14
|
-
"video/mp4"
|
|
15
|
-
];
|
|
16
|
-
function extensionForMime(mimeType) {
|
|
17
|
-
const m = mimeType.toLowerCase();
|
|
18
|
-
if (m.startsWith("audio/webm")) return ".webm";
|
|
19
|
-
if (m.startsWith("audio/ogg")) return ".ogg";
|
|
20
|
-
if (m.startsWith("audio/mp4")) return ".m4a";
|
|
21
|
-
if (m.startsWith("audio/mpeg")) return ".mp3";
|
|
22
|
-
if (m.startsWith("audio/wav")) return ".wav";
|
|
23
|
-
if (m.startsWith("video/webm")) return ".webm";
|
|
24
|
-
if (m.startsWith("video/mp4")) return ".mp4";
|
|
25
|
-
return ".bin";
|
|
26
|
-
}
|
|
27
|
-
function probeMimeType(candidates) {
|
|
28
|
-
if (typeof MediaRecorder === "undefined") return null;
|
|
29
|
-
for (const candidate of candidates) {
|
|
30
|
-
try {
|
|
31
|
-
if (MediaRecorder.isTypeSupported(candidate)) return candidate;
|
|
32
|
-
} catch {
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
function resolveFormat(kind, preferred) {
|
|
38
|
-
const candidates = kind === "audio" ? AUDIO_CANDIDATES : VIDEO_CANDIDATES;
|
|
39
|
-
const probed = (preferred && probeMimeType([preferred])) ?? probeMimeType(candidates) ?? "";
|
|
40
|
-
const directory = kind === "audio" ? "audio" : "video";
|
|
41
|
-
const extension = probed ? extensionForMime(probed) : ".webm";
|
|
42
|
-
return { mimeType: probed, extension, directory };
|
|
43
|
-
}
|
|
44
|
-
function supportsMediaRecorder() {
|
|
45
|
-
return typeof MediaRecorder !== "undefined";
|
|
46
|
-
}
|
|
47
|
-
function supportsUserMedia() {
|
|
48
|
-
return typeof navigator !== "undefined" && typeof navigator.mediaDevices !== "undefined" && typeof navigator.mediaDevices.getUserMedia === "function";
|
|
49
|
-
}
|
|
50
|
-
function supportsDisplayMedia() {
|
|
51
|
-
return typeof navigator !== "undefined" && typeof navigator.mediaDevices !== "undefined" && typeof navigator.mediaDevices.getDisplayMedia === "function";
|
|
52
|
-
}
|
|
53
|
-
function supportsSystemAudioCapture() {
|
|
54
|
-
if (!supportsDisplayMedia()) return false;
|
|
55
|
-
const nav = navigator;
|
|
56
|
-
const uaData = nav.userAgentData;
|
|
57
|
-
if (uaData?.mobile === true) return false;
|
|
58
|
-
if (uaData?.brands?.length) {
|
|
59
|
-
return uaData.brands.some(({ brand }) => /chromium/i.test(brand));
|
|
60
|
-
}
|
|
61
|
-
const userAgent = nav.userAgent ?? "";
|
|
62
|
-
if (/Android|Mobile|iPhone|iPad|iPod/i.test(userAgent)) return false;
|
|
63
|
-
return /(?:Chrome|Chromium|Edg|OPR)\//.test(userAgent);
|
|
64
|
-
}
|
|
65
|
-
function buildFilename(kind, extension, basename, seed) {
|
|
66
|
-
const safe = basename ? basename.trim().replace(/[\\/:*?"<>|]+/g, "-").replace(/\s+/g, "-") : "";
|
|
67
|
-
if (safe) return `${safe}${extension}`;
|
|
68
|
-
const now = /* @__PURE__ */ new Date();
|
|
69
|
-
const stamp = now.getFullYear().toString().padStart(4, "0") + (now.getMonth() + 1).toString().padStart(2, "0") + now.getDate().toString().padStart(2, "0") + "-" + now.getHours().toString().padStart(2, "0") + now.getMinutes().toString().padStart(2, "0") + now.getSeconds().toString().padStart(2, "0");
|
|
70
|
-
const prefix = seed ?? (kind === "audio" ? "narration" : "recording");
|
|
71
|
-
return `${prefix}-${stamp}${extension}`;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// src/recorder/sources/micStream.ts
|
|
75
|
-
async function requestMicStream(constraints) {
|
|
76
|
-
if (!supportsUserMedia()) {
|
|
77
|
-
throw new Error("navigator.mediaDevices.getUserMedia is not available in this environment.");
|
|
78
|
-
}
|
|
79
|
-
return navigator.mediaDevices.getUserMedia({
|
|
80
|
-
audio: constraints ?? true,
|
|
81
|
-
video: false
|
|
82
|
-
});
|
|
83
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
buildFilename,
|
|
3
|
+
requestMicStream,
|
|
4
|
+
resolveFormat,
|
|
5
|
+
supportsUserMedia
|
|
6
|
+
} from "./chunk-DNJ6HOES.js";
|
|
84
7
|
|
|
85
8
|
// src/recorder/sources/cameraStream.ts
|
|
86
9
|
async function requestCameraStream(options) {
|
|
@@ -1793,11 +1716,16 @@ function insertNarrationPreamble(source, audioPath, cameraPath) {
|
|
|
1793
1716
|
|
|
1794
1717
|
// src/teleprompter/recording/narrationSave.ts
|
|
1795
1718
|
import {
|
|
1796
|
-
buildNarrationTimingJson
|
|
1719
|
+
buildNarrationTimingJson,
|
|
1720
|
+
resolveNarrationTimingGenerator
|
|
1797
1721
|
} from "@bendyline/squisq/narration";
|
|
1798
1722
|
function buildNarrationSavePlan(args) {
|
|
1723
|
+
const timingOptions = {
|
|
1724
|
+
...args.baseWpm !== void 0 ? { baseWpm: args.baseWpm } : {},
|
|
1725
|
+
...args.generator ? { generator: args.generator } : {}
|
|
1726
|
+
};
|
|
1799
1727
|
const sidecarPayload = args.alignment ? buildNarrationTimingJson(args.script, args.alignment, args.durationSec, {
|
|
1800
|
-
|
|
1728
|
+
...timingOptions,
|
|
1801
1729
|
...args.cameraOffsetSec !== void 0 ? { cameraOffsetSec: args.cameraOffsetSec } : {}
|
|
1802
1730
|
}) : {
|
|
1803
1731
|
version: 3,
|
|
@@ -1805,7 +1733,7 @@ function buildNarrationSavePlan(args) {
|
|
|
1805
1733
|
duration: args.durationSec,
|
|
1806
1734
|
bookmarks: [],
|
|
1807
1735
|
blocks: [],
|
|
1808
|
-
generator:
|
|
1736
|
+
generator: resolveNarrationTimingGenerator(timingOptions)
|
|
1809
1737
|
};
|
|
1810
1738
|
return {
|
|
1811
1739
|
audioRelativeName: `audio/${buildFilename("audio", args.audioExt, args.audioBasename)}`,
|
|
@@ -2874,13 +2802,6 @@ function NarrationStage(props) {
|
|
|
2874
2802
|
export {
|
|
2875
2803
|
resolveMaxRecordingBytes,
|
|
2876
2804
|
formatRecordingBytes,
|
|
2877
|
-
resolveFormat,
|
|
2878
|
-
supportsMediaRecorder,
|
|
2879
|
-
supportsUserMedia,
|
|
2880
|
-
supportsDisplayMedia,
|
|
2881
|
-
supportsSystemAudioCapture,
|
|
2882
|
-
buildFilename,
|
|
2883
|
-
requestMicStream,
|
|
2884
2805
|
requestCameraStream,
|
|
2885
2806
|
useStreamPreview,
|
|
2886
2807
|
buildTimingJson,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/speech/types.ts
|
|
2
|
+
var SPEECH_INPUT_SAMPLE_RATE = 16e3;
|
|
3
|
+
function resolveSpeechInputProvider(capability) {
|
|
4
|
+
return typeof capability === "function" ? capability() : capability;
|
|
5
|
+
}
|
|
6
|
+
function isSpeechInputProviderFactory(capability) {
|
|
7
|
+
return typeof capability === "function";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
SPEECH_INPUT_SAMPLE_RATE,
|
|
12
|
+
resolveSpeechInputProvider,
|
|
13
|
+
isSpeechInputProviderFactory
|
|
14
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// src/recorder/formats.ts
|
|
2
|
+
var AUDIO_CANDIDATES = [
|
|
3
|
+
"audio/webm;codecs=opus",
|
|
4
|
+
"audio/webm",
|
|
5
|
+
"audio/mp4;codecs=mp4a.40.2",
|
|
6
|
+
"audio/mp4",
|
|
7
|
+
"audio/ogg;codecs=opus"
|
|
8
|
+
];
|
|
9
|
+
var VIDEO_CANDIDATES = [
|
|
10
|
+
"video/webm;codecs=vp9,opus",
|
|
11
|
+
"video/webm;codecs=vp8,opus",
|
|
12
|
+
"video/webm",
|
|
13
|
+
"video/mp4;codecs=avc1.42E01E,mp4a.40.2",
|
|
14
|
+
"video/mp4"
|
|
15
|
+
];
|
|
16
|
+
function extensionForMime(mimeType) {
|
|
17
|
+
const m = mimeType.toLowerCase();
|
|
18
|
+
if (m.startsWith("audio/webm")) return ".webm";
|
|
19
|
+
if (m.startsWith("audio/ogg")) return ".ogg";
|
|
20
|
+
if (m.startsWith("audio/mp4")) return ".m4a";
|
|
21
|
+
if (m.startsWith("audio/mpeg")) return ".mp3";
|
|
22
|
+
if (m.startsWith("audio/wav")) return ".wav";
|
|
23
|
+
if (m.startsWith("video/webm")) return ".webm";
|
|
24
|
+
if (m.startsWith("video/mp4")) return ".mp4";
|
|
25
|
+
return ".bin";
|
|
26
|
+
}
|
|
27
|
+
function probeMimeType(candidates) {
|
|
28
|
+
if (typeof MediaRecorder === "undefined") return null;
|
|
29
|
+
for (const candidate of candidates) {
|
|
30
|
+
try {
|
|
31
|
+
if (MediaRecorder.isTypeSupported(candidate)) return candidate;
|
|
32
|
+
} catch {
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
function resolveFormat(kind, preferred) {
|
|
38
|
+
const candidates = kind === "audio" ? AUDIO_CANDIDATES : VIDEO_CANDIDATES;
|
|
39
|
+
const probed = (preferred && probeMimeType([preferred])) ?? probeMimeType(candidates) ?? "";
|
|
40
|
+
const directory = kind === "audio" ? "audio" : "video";
|
|
41
|
+
const extension = probed ? extensionForMime(probed) : ".webm";
|
|
42
|
+
return { mimeType: probed, extension, directory };
|
|
43
|
+
}
|
|
44
|
+
function supportsMediaRecorder() {
|
|
45
|
+
return typeof MediaRecorder !== "undefined";
|
|
46
|
+
}
|
|
47
|
+
function supportsUserMedia() {
|
|
48
|
+
return typeof navigator !== "undefined" && typeof navigator.mediaDevices !== "undefined" && typeof navigator.mediaDevices.getUserMedia === "function";
|
|
49
|
+
}
|
|
50
|
+
function supportsDisplayMedia() {
|
|
51
|
+
return typeof navigator !== "undefined" && typeof navigator.mediaDevices !== "undefined" && typeof navigator.mediaDevices.getDisplayMedia === "function";
|
|
52
|
+
}
|
|
53
|
+
function supportsSystemAudioCapture() {
|
|
54
|
+
if (!supportsDisplayMedia()) return false;
|
|
55
|
+
const nav = navigator;
|
|
56
|
+
const uaData = nav.userAgentData;
|
|
57
|
+
if (uaData?.mobile === true) return false;
|
|
58
|
+
if (uaData?.brands?.length) {
|
|
59
|
+
return uaData.brands.some(({ brand }) => /chromium/i.test(brand));
|
|
60
|
+
}
|
|
61
|
+
const userAgent = nav.userAgent ?? "";
|
|
62
|
+
if (/Android|Mobile|iPhone|iPad|iPod/i.test(userAgent)) return false;
|
|
63
|
+
return /(?:Chrome|Chromium|Edg|OPR)\//.test(userAgent);
|
|
64
|
+
}
|
|
65
|
+
function buildFilename(kind, extension, basename, seed) {
|
|
66
|
+
const safe = basename ? basename.trim().replace(/[\\/:*?"<>|]+/g, "-").replace(/\s+/g, "-") : "";
|
|
67
|
+
if (safe) return `${safe}${extension}`;
|
|
68
|
+
const now = /* @__PURE__ */ new Date();
|
|
69
|
+
const stamp = now.getFullYear().toString().padStart(4, "0") + (now.getMonth() + 1).toString().padStart(2, "0") + now.getDate().toString().padStart(2, "0") + "-" + now.getHours().toString().padStart(2, "0") + now.getMinutes().toString().padStart(2, "0") + now.getSeconds().toString().padStart(2, "0");
|
|
70
|
+
const prefix = seed ?? (kind === "audio" ? "narration" : "recording");
|
|
71
|
+
return `${prefix}-${stamp}${extension}`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// src/recorder/sources/micStream.ts
|
|
75
|
+
async function requestMicStream(constraints) {
|
|
76
|
+
if (!supportsUserMedia()) {
|
|
77
|
+
throw new Error("navigator.mediaDevices.getUserMedia is not available in this environment.");
|
|
78
|
+
}
|
|
79
|
+
return navigator.mediaDevices.getUserMedia({
|
|
80
|
+
audio: constraints ?? true,
|
|
81
|
+
video: false
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
resolveFormat,
|
|
87
|
+
supportsMediaRecorder,
|
|
88
|
+
supportsUserMedia,
|
|
89
|
+
supportsDisplayMedia,
|
|
90
|
+
supportsSystemAudioCapture,
|
|
91
|
+
buildFilename,
|
|
92
|
+
requestMicStream
|
|
93
|
+
};
|