@bendyline/squisq-editor-react 2.13.8 → 2.13.9

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.
@@ -1,11 +1,11 @@
1
1
  // src/speech/index.ts
2
2
  async function startDictationSession(options) {
3
- const session = await import("./dictationSession-SLDNYIZ2.js");
3
+ const session = await import("./dictationSession-4JBKD5EU.js");
4
4
  if (options.signal.aborted) throw new DOMException("Aborted", "AbortError");
5
5
  return session.startDictationSession(options);
6
6
  }
7
7
  async function encodeMonoPcm16Wav(channels, sampleRate) {
8
- const audio = await import("./speechAudioWav-WKIQWGIJ.js");
8
+ const audio = await import("./speechAudioWav-TBAG7W3V.js");
9
9
  return audio.encodeMonoPcm16Wav(channels, sampleRate);
10
10
  }
11
11
 
@@ -4,6 +4,10 @@ import {
4
4
  resolveFormat,
5
5
  supportsUserMedia
6
6
  } from "./chunk-DNJ6HOES.js";
7
+ import {
8
+ encodeTimingJson,
9
+ timingPathFor
10
+ } from "./chunk-GG35EBRB.js";
7
11
 
8
12
  // src/recorder/sources/cameraStream.ts
9
13
  async function requestCameraStream(options) {
@@ -36,25 +40,6 @@ function useStreamPreview(ref, stream) {
36
40
  }, [ref, stream]);
37
41
  }
38
42
 
39
- // src/recorder/timingJson.ts
40
- function buildTimingJson(sourceText, durationSec) {
41
- return {
42
- sourceText: sourceText ?? "",
43
- duration: Number.isFinite(durationSec) && durationSec >= 0 ? durationSec : 0,
44
- bookmarks: []
45
- };
46
- }
47
- function encodeTimingJson(timing) {
48
- const text = JSON.stringify(timing, null, 2);
49
- return new TextEncoder().encode(text);
50
- }
51
- function encodeNarrationTimingJson(timing) {
52
- return new TextEncoder().encode(JSON.stringify(timing, null, 2));
53
- }
54
- function timingPathFor(audioRelativePath) {
55
- return `${audioRelativePath}.timing.json`;
56
- }
57
-
58
43
  // src/teleprompter/pcmWorklet.ts
59
44
  var PCM_WORKLET_NAME = "squisq-pcm-tap";
60
45
  var PCM_WORKLET_SOURCE = `
@@ -2828,10 +2813,6 @@ export {
2828
2813
  formatRecordingBytes,
2829
2814
  requestCameraStream,
2830
2815
  useStreamPreview,
2831
- buildTimingJson,
2832
- encodeTimingJson,
2833
- encodeNarrationTimingJson,
2834
- timingPathFor,
2835
2816
  PCM_WORKLET_NAME,
2836
2817
  PCM_WORKLET_SOURCE,
2837
2818
  registerPcmWorklet,
@@ -932,7 +932,7 @@ function useDictationController({
932
932
  }
933
933
  return;
934
934
  }
935
- const { startDictationSession } = await import("./dictationSession-SLDNYIZ2.js");
935
+ const { startDictationSession } = await import("./dictationSession-4JBKD5EU.js");
936
936
  if (!isCurrent()) return;
937
937
  const handle = await startDictationSession({
938
938
  provider: active,
@@ -1123,7 +1123,11 @@ function useDictationController({
1123
1123
  dismissError
1124
1124
  ]
1125
1125
  );
1126
- return { control, state };
1126
+ const recognizer = useMemo3(
1127
+ () => provider ? { provider, readiness } : null,
1128
+ [provider, readiness]
1129
+ );
1130
+ return { control, state, recognizer };
1127
1131
  }
1128
1132
 
1129
1133
  // src/EditorContext.tsx
@@ -2271,6 +2275,7 @@ function EditorProvider({
2271
2275
  monacoEditor
2272
2276
  });
2273
2277
  const dictation = dictationController.control;
2278
+ const speechRecognizer = dictationController.recognizer;
2274
2279
  const value = useMemo4(
2275
2280
  () => ({
2276
2281
  markdownSource,
@@ -2320,6 +2325,7 @@ function EditorProvider({
2320
2325
  proofingGrammarEnabled,
2321
2326
  proofingIgnoreStore,
2322
2327
  dictation,
2328
+ speechRecognizer,
2323
2329
  articleId,
2324
2330
  documentLinkProvider,
2325
2331
  wikiLinks,
@@ -2404,6 +2410,7 @@ function EditorProvider({
2404
2410
  proofingGrammarEnabled,
2405
2411
  proofingIgnoreStore,
2406
2412
  dictation,
2413
+ speechRecognizer,
2407
2414
  articleId,
2408
2415
  documentLinkProvider,
2409
2416
  wikiLinks,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RecorderModal
3
- } from "./chunk-LXGQA2SY.js";
3
+ } from "./chunk-FOKUOC7E.js";
4
4
 
5
5
  // src/recorder/RecorderButton.tsx
6
6
  import { useCallback, useState } from "react";
@@ -11,16 +11,12 @@ import {
11
11
  } from "./chunk-UYB5CPRE.js";
12
12
  import {
13
13
  NarrationStage,
14
- buildTimingJson,
15
- encodeNarrationTimingJson,
16
- encodeTimingJson,
17
14
  formatRecordingBytes,
18
15
  requestCameraStream,
19
16
  resolveMaxRecordingBytes,
20
- timingPathFor,
21
17
  useNarrationStage,
22
18
  useStreamPreview
23
- } from "./chunk-ZS6G2P57.js";
19
+ } from "./chunk-CWSV5YGZ.js";
24
20
  import {
25
21
  buildFilename,
26
22
  requestMicStream,
@@ -30,6 +26,12 @@ import {
30
26
  supportsSystemAudioCapture,
31
27
  supportsUserMedia
32
28
  } from "./chunk-DNJ6HOES.js";
29
+ import {
30
+ buildTimingJson,
31
+ encodeNarrationTimingJson,
32
+ encodeTimingJson,
33
+ timingPathFor
34
+ } from "./chunk-GG35EBRB.js";
33
35
 
34
36
  // src/recorder/sources/screenRegion.ts
35
37
  function validateScreenCaptureRegion(region, width, height) {
@@ -1785,7 +1787,7 @@ function resolveBlockVisual(doc, block, theme, viewport, position = {
1785
1787
  totalBlocks: 1
1786
1788
  }) {
1787
1789
  try {
1788
- const slide = buildPreviewDoc({ ...doc, blocks: [block] }).blocks[0];
1790
+ const slide = buildPreviewDoc({ ...doc, blocks: [block], presentationApplied: true }).blocks[0];
1789
1791
  if (!slide) return null;
1790
1792
  const ctx = {
1791
1793
  ...position,
@@ -0,0 +1,25 @@
1
+ // src/recorder/timingJson.ts
2
+ function buildTimingJson(sourceText, durationSec) {
3
+ return {
4
+ sourceText: sourceText ?? "",
5
+ duration: Number.isFinite(durationSec) && durationSec >= 0 ? durationSec : 0,
6
+ bookmarks: []
7
+ };
8
+ }
9
+ function encodeTimingJson(timing) {
10
+ const text = JSON.stringify(timing, null, 2);
11
+ return new TextEncoder().encode(text);
12
+ }
13
+ function encodeNarrationTimingJson(timing) {
14
+ return new TextEncoder().encode(JSON.stringify(timing, null, 2));
15
+ }
16
+ function timingPathFor(audioRelativePath) {
17
+ return `${audioRelativePath}.timing.json`;
18
+ }
19
+
20
+ export {
21
+ buildTimingJson,
22
+ encodeTimingJson,
23
+ encodeNarrationTimingJson,
24
+ timingPathFor
25
+ };