@bendyline/squisq-editor-react 2.11.19 → 2.11.20

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/index.js CHANGED
@@ -3,6 +3,7 @@ import {
3
3
  PROOF_FRONTMATTER_KEYS,
4
4
  createHarperProofingProvider
5
5
  } from "./chunk-SAKLIEOX.js";
6
+ import "./chunk-2MP7QE7O.js";
6
7
  import {
7
8
  configureMonacoWorkers
8
9
  } from "./chunk-BWPFPHWY.js";
@@ -87,7 +88,10 @@ import {
87
88
  TransitionPicker,
88
89
  TreeOutlineWidget,
89
90
  TreeViewExtension,
91
+ VIDEO_EMBED_KEY,
90
92
  VersionHistoryPanel,
93
+ VideoEmbedDialog,
94
+ VideoEmbedExtension,
91
95
  ViewMenuPanel,
92
96
  WysiwygEditor,
93
97
  XLSX_LOCKED_REASON,
@@ -107,6 +111,7 @@ import {
107
111
  codeSnippetMarkdown,
108
112
  compileDraft,
109
113
  containFenceWidgetEvents,
114
+ convertVideoEmbedToLink,
110
115
  createXlsxFormulaSession,
111
116
  dataExtensionOf,
112
117
  dataLinkHrefOf,
@@ -121,11 +126,13 @@ import {
121
126
  findTimelineBlockPos,
122
127
  findTransitionEntry,
123
128
  findTreeBlockPos,
129
+ findVideoEmbedBlockPos,
124
130
  formatSeconds,
125
131
  getTimelineForNode,
126
132
  indentItemOp,
127
133
  ingestForWrite,
128
134
  ingestSidecarBytes,
135
+ insertVideoEmbedReference,
129
136
  inspectMermaidSource,
130
137
  isAsciiSourceVisible,
131
138
  isCodeSnippetFenceLanguage,
@@ -152,6 +159,7 @@ import {
152
159
  outdentItemOp,
153
160
  parseTimelineForNode,
154
161
  partitionFiles,
162
+ pasteVideoEmbedCode,
155
163
  persistFromWrite,
156
164
  platformShortcut,
157
165
  preloadMonaco,
@@ -219,9 +227,12 @@ import {
219
227
  useTimelineData,
220
228
  useTreeViewData,
221
229
  validateMermaidSource,
230
+ videoEmbedMarkdown,
231
+ videoEmbedOfParagraph,
232
+ videoEmbedParagraphJson,
222
233
  viewStateFromBinding,
223
234
  writeHeadingViewState
224
- } from "./chunk-5EB3BGPE.js";
235
+ } from "./chunk-NL4JP55H.js";
225
236
  import {
226
237
  EditorProvider,
227
238
  applySourceEditsToText,
@@ -240,8 +251,9 @@ import {
240
251
  sourceOutline,
241
252
  spliceBlock,
242
253
  useBlockNavigator,
243
- useEditorContext
244
- } from "./chunk-TZX7RKZV.js";
254
+ useEditorContext,
255
+ useEditorInsertMenuItems
256
+ } from "./chunk-JI74KA6C.js";
245
257
  import {
246
258
  SPEECH_INPUT_SAMPLE_RATE,
247
259
  isSpeechInputProviderFactory,
@@ -867,7 +879,10 @@ export {
867
879
  TransitionPicker,
868
880
  TreeOutlineWidget,
869
881
  TreeViewExtension,
882
+ VIDEO_EMBED_KEY,
870
883
  VersionHistoryPanel,
884
+ VideoEmbedDialog,
885
+ VideoEmbedExtension,
871
886
  ViewMenuPanel,
872
887
  ViewSwitcher,
873
888
  WysiwygEditor,
@@ -901,6 +916,7 @@ export {
901
916
  codeSnippetMarkdown,
902
917
  configureMonacoWorkers,
903
918
  containFenceWidgetEvents,
919
+ convertVideoEmbedToLink,
904
920
  createFloatingWindowManager,
905
921
  createHarperProofingProvider,
906
922
  createXlsxFormulaSession,
@@ -923,6 +939,7 @@ export {
923
939
  findTimelineBlockPos,
924
940
  findTransitionEntry,
925
941
  findTreeBlockPos,
942
+ findVideoEmbedBlockPos,
926
943
  formatSeconds,
927
944
  getBlockSlices,
928
945
  getCaptureKind,
@@ -935,6 +952,7 @@ export {
935
952
  ingestSidecarBytes,
936
953
  initialImageEditorState,
937
954
  insertNarrationPreamble,
955
+ insertVideoEmbedReference,
938
956
  inspectMermaidSource,
939
957
  isAsciiSourceVisible,
940
958
  isCodeSnippetFenceLanguage,
@@ -972,6 +990,7 @@ export {
972
990
  panelModeAfterToggle,
973
991
  parseTimelineForNode,
974
992
  partitionFiles,
993
+ pasteVideoEmbedCode,
975
994
  persistFromWrite,
976
995
  preloadMonaco,
977
996
  preloadMonacoSuggestions,
@@ -1056,6 +1075,7 @@ export {
1056
1075
  useDocCustomThemes,
1057
1076
  useEditorContext,
1058
1077
  useEditorContextMenuItems,
1078
+ useEditorInsertMenuItems,
1059
1079
  useFileDrop,
1060
1080
  useFloatingWindow,
1061
1081
  useImageEditor,
@@ -1075,6 +1095,9 @@ export {
1075
1095
  useTreeViewData,
1076
1096
  vadConfigForSensitivity,
1077
1097
  validateMermaidSource,
1098
+ videoEmbedMarkdown,
1099
+ videoEmbedOfParagraph,
1100
+ videoEmbedParagraphJson,
1078
1101
  viewStateFromBinding,
1079
1102
  writeHeadingViewState
1080
1103
  };
@@ -1,7 +1,9 @@
1
- export { C as CameraStreamOptions, D as DEFAULT_RECORDER_DEVICE_SETTINGS, M as MediaDeviceInventory, R as RecordedBookmark, a as RecordedMediaKind, b as RecorderAudioDeviceSettings, c as RecorderButton, d as RecorderButtonProps, e as RecorderCameraDeviceSettings, f as RecorderCameraSaveResult, g as RecorderColorScheme, h as RecorderConstraintMode, i as RecorderDeviceOption, j as RecorderDeviceQuickPicks, k as RecorderDeviceQuickPicksProps, l as RecorderDeviceSettings, m as RecorderDeviceSettingsPanel, n as RecorderDeviceSettingsPanelProps, o as RecorderEncodingSettings, p as RecorderModal, q as RecorderModalProps, s as RecorderPanel, t as RecorderPanelProps, u as RecorderSaveResult, v as RecorderScreenAudioSettings, w as RecorderScreenDeviceSettings, S as ScreenStreamHandle, y as ScreenStreamOptions, T as TimingJson, A as buildRecorderAudioConstraints, B as buildRecorderCameraConstraints, E as buildRecorderScreenAudioConstraints, F as buildRecorderScreenConstraints, G as buildTimingJson, H as encodeTimingJson, I as hasRecorderDeviceChoice, J as recordedMediaKind, K as recorderBitsPerSecond, L as recorderDeviceGroups, N as recorderDeviceOptions, O as requestCameraStream, P as requestMicStream, Q as requestScreenStream, U as timingPathFor, V as useMediaDevices, W as useStreamPreview } from '../recorder-DKN3vZPi.js';
2
- export { a as CaptureKind, i as RecorderAudioBitrateMode, j as RecorderCameraLane, k as RecorderExtendedMediaOptions, l as RecorderSource, R as RecorderState, m as ResolvedFormat, U as UseMediaRecorderOptions, p as UseMediaRecorderResult, r as buildFilename, u as getCaptureKind, v as resolveFormat, w as supportsDisplayMedia, x as supportsMediaRecorder, y as supportsUserMedia, A as useMediaRecorder } from '../useNarrationStage-CB8dynUg.js';
1
+ export { C as CameraStreamOptions, M as MediaDeviceInventory, R as RecordedBookmark, a as RecordedMediaKind, b as RecorderButton, c as RecorderButtonProps, d as RecorderCameraSaveResult, e as RecorderColorScheme, f as RecorderDeviceOption, g as RecorderDeviceQuickPicks, h as RecorderDeviceQuickPicksProps, i as RecorderDeviceSettingsPanel, j as RecorderDeviceSettingsPanelProps, k as RecorderModal, l as RecorderModalProps, n as RecorderPanel, o as RecorderPanelProps, p as RecorderSaveResult, S as ScreenStreamHandle, r as ScreenStreamOptions, T as TimingJson, t as buildTimingJson, u as encodeTimingJson, v as hasRecorderDeviceChoice, w as recordedMediaKind, x as recorderDeviceGroups, y as recorderDeviceOptions, z as requestCameraStream, A as requestMicStream, B as requestScreenStream, D as timingPathFor, E as useMediaDevices, F as useStreamPreview } from '../recorder-Civyq5SU.js';
2
+ export { D as DEFAULT_RECORDER_DEVICE_SETTINGS, a as RecorderAudioDeviceSettings, b as RecorderCameraDeviceSettings, c as RecorderConstraintMode, R as RecorderDeviceSettings, d as RecorderEncodingSettings, e as RecorderScreenAudioSettings, f as RecorderScreenDeviceSettings, g as buildRecorderAudioConstraints, h as buildRecorderCameraConstraints, i as buildRecorderScreenAudioConstraints, j as buildRecorderScreenConstraints, r as recorderBitsPerSecond } from '../deviceSettings-BSkIQncC.js';
3
+ export { a as CaptureKind, i as RecorderAudioBitrateMode, j as RecorderCameraLane, k as RecorderExtendedMediaOptions, l as RecorderSource, R as RecorderState, m as ResolvedFormat, U as UseMediaRecorderOptions, p as UseMediaRecorderResult, r as buildFilename, u as getCaptureKind, v as resolveFormat, w as supportsDisplayMedia, x as supportsMediaRecorder, y as supportsUserMedia, A as useMediaRecorder } from '../useNarrationStage-DlighI1z.js';
3
4
  import 'react/jsx-runtime';
4
5
  import '@bendyline/squisq/schemas';
5
6
  import '@bendyline/squisq/storage';
6
7
  import 'react';
8
+ import '../screenRegion-Ci_RsCzG.js';
7
9
  import '@bendyline/squisq/narration';
@@ -1,8 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { Doc, Theme, ViewportConfig, MediaProvider } from '@bendyline/squisq/schemas';
3
3
  import { ContentContainer } from '@bendyline/squisq/storage';
4
- import { l as RecorderSource, o as TeleprompterRecordingDeps, S as ScreenCaptureRegion } from './useNarrationStage-CB8dynUg.js';
4
+ import { l as RecorderSource, o as TeleprompterRecordingDeps } from './useNarrationStage-DlighI1z.js';
5
5
  import { CSSProperties, RefObject } from 'react';
6
+ import { R as RecorderDeviceSettings } from './deviceSettings-BSkIQncC.js';
7
+ import { S as ScreenCaptureRegion } from './screenRegion-Ci_RsCzG.js';
6
8
 
7
9
  type RecordedMediaKind = 'audio' | 'video';
8
10
  /**
@@ -216,86 +218,6 @@ interface RecorderPanelProps {
216
218
  }
217
219
  declare function RecorderPanel({ mediaProvider, container, initialMode, colorScheme, onSave, narration, slides, tooltip, title, className, open: controlledOpen, onOpenChange, showTrigger, }: RecorderPanelProps): react_jsx_runtime.JSX.Element;
218
220
 
219
- /**
220
- * User-configurable recorder device/encoding settings.
221
- *
222
- * Values stay serializable so the modal can include them in its capture key:
223
- * changing a setting releases any prepared preview before a new stream is
224
- * requested. Numeric and string track values are expressed as either `ideal`
225
- * (best effort) or `exact` (fail when unavailable) constraints. Display
226
- * capture is the exception: the screen-capture standard rejects exact
227
- * constraints during its user picker, so those values always remain ideal.
228
- */
229
-
230
- type RecorderConstraintMode = 'ideal' | 'exact';
231
- interface RecorderAudioDeviceSettings {
232
- deviceId: string;
233
- groupId?: string;
234
- autoGainControl?: boolean;
235
- channelCount?: number;
236
- echoCancellation?: boolean;
237
- latency?: number;
238
- noiseSuppression?: boolean;
239
- sampleRate?: number;
240
- sampleSize?: number;
241
- }
242
- interface RecorderCameraDeviceSettings {
243
- deviceId: string;
244
- groupId?: string;
245
- aspectRatio?: number;
246
- backgroundBlur?: boolean;
247
- facingMode?: string;
248
- frameRate?: number;
249
- height?: number;
250
- resizeMode?: string;
251
- width?: number;
252
- }
253
- interface RecorderScreenDeviceSettings {
254
- /** Crop in captured pixels, relative to the chosen surface (not the desktop). */
255
- crop?: ScreenCaptureRegion;
256
- aspectRatio?: number;
257
- cursor?: string;
258
- displaySurface?: string;
259
- frameRate?: number;
260
- height?: number;
261
- logicalSurface?: boolean;
262
- resizeMode?: string;
263
- width?: number;
264
- }
265
- interface RecorderScreenAudioSettings {
266
- restrictOwnAudio?: boolean;
267
- suppressLocalAudioPlayback?: boolean;
268
- }
269
- interface RecorderEncodingSettings {
270
- audioMimeType: string;
271
- videoMimeType: string;
272
- bitsPerSecond?: number;
273
- audioBitsPerSecond?: number;
274
- videoBitsPerSecond?: number;
275
- audioBitrateMode?: 'constant' | 'variable';
276
- videoKeyFrameIntervalDuration?: number;
277
- videoKeyFrameIntervalCount?: number;
278
- }
279
- interface RecorderDeviceSettings {
280
- constraintMode: RecorderConstraintMode;
281
- audio: RecorderAudioDeviceSettings;
282
- camera: RecorderCameraDeviceSettings;
283
- screen: RecorderScreenDeviceSettings;
284
- screenAudio: RecorderScreenAudioSettings;
285
- encoding: RecorderEncodingSettings;
286
- }
287
- declare const DEFAULT_RECORDER_DEVICE_SETTINGS: RecorderDeviceSettings;
288
- /** Build microphone constraints from the advanced settings form. */
289
- declare function buildRecorderAudioConstraints(settings: RecorderDeviceSettings): MediaTrackConstraints;
290
- /** Build camera constraints from the advanced settings form. */
291
- declare function buildRecorderCameraConstraints(settings: RecorderDeviceSettings): MediaTrackConstraints;
292
- /** Build display-capture constraints independently from camera constraints. */
293
- declare function buildRecorderScreenConstraints(settings: RecorderDeviceSettings): MediaTrackConstraints;
294
- /** Build the audio-track constraints specific to getDisplayMedia. */
295
- declare function buildRecorderScreenAudioConstraints(settings: RecorderDeviceSettings): MediaTrackConstraints;
296
- /** Convert the form's kbps values to the bps values MediaRecorder expects. */
297
- declare function recorderBitsPerSecond(value: number | undefined): number | undefined;
298
-
299
221
  interface RecorderDeviceSettingsPanelProps {
300
222
  value: RecorderDeviceSettings;
301
223
  onChange: (next: RecorderDeviceSettings) => void;
@@ -585,4 +507,4 @@ declare function encodeTimingJson(timing: TimingJson): Uint8Array;
585
507
  */
586
508
  declare function timingPathFor(audioRelativePath: string): string;
587
509
 
588
- export { buildRecorderAudioConstraints as A, buildRecorderCameraConstraints as B, type CameraStreamOptions as C, DEFAULT_RECORDER_DEVICE_SETTINGS as D, buildRecorderScreenAudioConstraints as E, buildRecorderScreenConstraints as F, buildTimingJson as G, encodeTimingJson as H, hasRecorderDeviceChoice as I, recordedMediaKind as J, recorderBitsPerSecond as K, recorderDeviceGroups as L, type MediaDeviceInventory as M, recorderDeviceOptions as N, requestCameraStream as O, requestMicStream as P, requestScreenStream as Q, type RecordedBookmark as R, type ScreenStreamHandle as S, type TimingJson as T, timingPathFor as U, useMediaDevices as V, useStreamPreview as W, type RecordedMediaKind as a, type RecorderAudioDeviceSettings as b, RecorderButton as c, type RecorderButtonProps as d, type RecorderCameraDeviceSettings as e, type RecorderCameraSaveResult as f, type RecorderColorScheme as g, type RecorderConstraintMode as h, type RecorderDeviceOption as i, RecorderDeviceQuickPicks as j, type RecorderDeviceQuickPicksProps as k, type RecorderDeviceSettings as l, RecorderDeviceSettingsPanel as m, type RecorderDeviceSettingsPanelProps as n, type RecorderEncodingSettings as o, RecorderModal as p, type RecorderModalProps as q, type RecorderNarrationOptions as r, RecorderPanel as s, type RecorderPanelProps as t, type RecorderSaveResult as u, type RecorderScreenAudioSettings as v, type RecorderScreenDeviceSettings as w, type RecorderSlidesOptions as x, type ScreenStreamOptions as y, type SlideTimingSaveResult as z };
510
+ export { requestMicStream as A, requestScreenStream as B, type CameraStreamOptions as C, timingPathFor as D, useMediaDevices as E, useStreamPreview as F, type MediaDeviceInventory as M, type RecordedBookmark as R, type ScreenStreamHandle as S, type TimingJson as T, type RecordedMediaKind as a, RecorderButton as b, type RecorderButtonProps as c, type RecorderCameraSaveResult as d, type RecorderColorScheme as e, type RecorderDeviceOption as f, RecorderDeviceQuickPicks as g, type RecorderDeviceQuickPicksProps as h, RecorderDeviceSettingsPanel as i, type RecorderDeviceSettingsPanelProps as j, RecorderModal as k, type RecorderModalProps as l, type RecorderNarrationOptions as m, RecorderPanel as n, type RecorderPanelProps as o, type RecorderSaveResult as p, type RecorderSlidesOptions as q, type ScreenStreamOptions as r, type SlideTimingSaveResult as s, buildTimingJson as t, encodeTimingJson as u, hasRecorderDeviceChoice as v, recordedMediaKind as w, recorderDeviceGroups as x, recorderDeviceOptions as y, requestCameraStream as z };
@@ -19,7 +19,7 @@ import {
19
19
  updateReviewDecorations,
20
20
  useReview,
21
21
  useReviewState
22
- } from "../chunk-TZX7RKZV.js";
22
+ } from "../chunk-JI74KA6C.js";
23
23
  import "../chunk-DNEVUOBZ.js";
24
24
  import "../chunk-HSWWEWT4.js";
25
25
 
@@ -0,0 +1,8 @@
1
+ interface ScreenCaptureRegion {
2
+ x: number;
3
+ y: number;
4
+ width: number;
5
+ height: number;
6
+ }
7
+
8
+ export type { ScreenCaptureRegion as S };
@@ -1,4 +1,4 @@
1
- export { g as BlockTagVisibility, j as DocumentLinkCandidate, k as DocumentLinkProvider, l as EditorActions, m as EditorColorScheme, n as EditorContextMenuContext, o as EditorContextMenuItem, p as EditorContextMenuItemVisibility, q as EditorContextMenuProvider, r as EditorContextMenuProviderProps, s as EditorContextValue, E as EditorHostMode, t as EditorMode, u as EditorProvider, v as EditorProviderProps, x as EditorShell, y as EditorShellProps, z as EditorState, G as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, N as MentionProvider, Q as PreviewPanel, R as PreviewPanelProps, T as RawEditor, U as RawEditorProps, V as ThemeInheritance, W as ViewPreferences, Z as WysiwygEditor, _ as WysiwygEditorProps, ag as useEditorContext, ah as useEditorContextMenuItems } from '../shell-Cje1A3zN.js';
1
+ export { h as BlockTagVisibility, k as DocumentLinkCandidate, l as DocumentLinkProvider, m as EditorActions, n as EditorColorScheme, o as EditorContextMenuContext, p as EditorContextMenuItem, q as EditorContextMenuItemVisibility, r as EditorContextMenuProvider, s as EditorContextMenuProviderProps, t as EditorContextValue, E as EditorHostMode, u as EditorInsertMenuItem, v as EditorMode, w as EditorProvider, x as EditorProviderProps, z as EditorShell, G as EditorShellProps, H as EditorState, b as EditorView, J as ImageDisplayMode, M as LayoutMode, N as MentionCandidate, O as MentionProvider, R as PreviewPanel, T as PreviewPanelProps, U as RawEditor, V as RawEditorProps, W as ThemeInheritance, Y as ViewPreferences, _ as WysiwygEditor, $ as WysiwygEditorProps, ah as useEditorContext, ai as useEditorContextMenuItems, aj as useEditorInsertMenuItems } from '../shell-DTefmCBG.js';
2
2
  import 'react/jsx-runtime';
3
3
  import '@bendyline/squisq/table';
4
4
  import '@bendyline/squisq-calc';
@@ -12,7 +12,7 @@ import '@bendyline/squisq/markdown';
12
12
  import '@bendyline/squisq/storage';
13
13
  import '../types-De4z-gGb.js';
14
14
  import '@bendyline/squisq/proof';
15
- import '../speech/index.js';
15
+ import '../types-Bi4ZVKvN.js';
16
16
  import '@bendyline/squisq/versions';
17
17
  import '@tiptap/core';
18
18
  import 'monaco-editor';
@@ -5,11 +5,12 @@ import {
5
5
  RawEditor,
6
6
  WysiwygEditor,
7
7
  useEditorContextMenuItems
8
- } from "../chunk-5EB3BGPE.js";
8
+ } from "../chunk-NL4JP55H.js";
9
9
  import {
10
10
  EditorProvider,
11
- useEditorContext
12
- } from "../chunk-TZX7RKZV.js";
11
+ useEditorContext,
12
+ useEditorInsertMenuItems
13
+ } from "../chunk-JI74KA6C.js";
13
14
  import "../chunk-DNEVUOBZ.js";
14
15
  import "../chunk-V4NBQF5C.js";
15
16
  import "../chunk-OCQEWWHI.js";
@@ -29,5 +30,6 @@ export {
29
30
  RawEditor,
30
31
  WysiwygEditor,
31
32
  useEditorContext,
32
- useEditorContextMenuItems
33
+ useEditorContextMenuItems,
34
+ useEditorInsertMenuItems
33
35
  };
@@ -10,7 +10,7 @@ import { CodeBlockCopyHandler } from '@bendyline/squisq-react';
10
10
  import { MarkdownSourceEdit, MarkdownDocument } from '@bendyline/squisq/markdown';
11
11
  import { ContentContainer } from '@bendyline/squisq/storage';
12
12
  import { a as ProofingCapability, c as ProofingIgnoreStore } from './types-De4z-gGb.js';
13
- import { DictationControl, SpeechInputCapability } from './speech/index.js';
13
+ import { D as DictationControl, b as SpeechInputCapability } from './types-Bi4ZVKvN.js';
14
14
  import { DocumentVersionManager, SaveVersionOptions, SaveVersionResult, PrunePolicy } from '@bendyline/squisq/versions';
15
15
  import { Editor } from '@tiptap/core';
16
16
  import { editor } from 'monaco-editor';
@@ -410,6 +410,8 @@ interface EditorSelectionInfo {
410
410
  view: EditorView;
411
411
  /** The selected text, empty when the selection is a bare cursor. */
412
412
  text: string;
413
+ /** Selected Markdown, preserving formatting and block metadata when available. */
414
+ markdown?: string;
413
415
  /** True when the selection is a bare cursor rather than a range. */
414
416
  empty: boolean;
415
417
  }
@@ -1693,12 +1695,31 @@ interface EditorShellProps {
1693
1695
  * in-progress theme without mutating the document.
1694
1696
  */
1695
1697
  themeOverride?: Theme | null;
1698
+ /**
1699
+ * Host default document theme — a FALLBACK for documents whose frontmatter
1700
+ * names no theme (`squisq-theme`, legacy `themeId` / `theme`). A document's
1701
+ * own theme always wins; built-in and custom-theme ids are accepted. Every
1702
+ * surface (Use/Play, inline and block previews, the Write view's
1703
+ * `themeInheritance` mirroring) renders the same resolved theme.
1704
+ *
1705
+ * While set, the theme pickers offer a "Default (<theme name>)" entry that
1706
+ * removes the document's theme key, and choosing any concrete theme —
1707
+ * `standard` included — writes it explicitly so the document stays pinned.
1708
+ * Unlike {@link themeOverride}, this never overrides the document.
1709
+ */
1710
+ defaultThemeId?: string;
1711
+ /**
1712
+ * Label for the picker entry that follows {@link defaultThemeId}, rendered
1713
+ * as `"<label> (<theme name>)"` — e.g. `'Workspace default'`. Defaults to
1714
+ * `'Default'`.
1715
+ */
1716
+ defaultThemeLabel?: string;
1696
1717
  }
1697
1718
  /**
1698
1719
  * Complete markdown editor shell with toolbar, view switcher, and three
1699
1720
  * editing modes: Raw (Monaco), WYSIWYG (Tiptap), and Preview.
1700
1721
  */
1701
- declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, mediaEditRenders, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFilesWhenNotEmpty, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, sidePanelSlot, reviewProviders, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, calcEngineFactory, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode, onFindModeChange, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, speechInput, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, placeholder, readOnly, imageSrc, imageAlt, imageMode, imageEditorContainer, onImageExport, inlinePreview, inlinePreviewWidth, outline, outlineWidth, blockTags, blockTagVisibility, themeInheritance, viewPreferences, onViewPreferencesChange, themeOverride, }: EditorShellProps): react_jsx_runtime.JSX.Element;
1722
+ declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, mediaEditRenders, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFilesWhenNotEmpty, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, sidePanelSlot, reviewProviders, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, calcEngineFactory, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode, onFindModeChange, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, speechInput, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, placeholder, readOnly, imageSrc, imageAlt, imageMode, imageEditorContainer, onImageExport, inlinePreview, inlinePreviewWidth, outline, outlineWidth, blockTags, blockTagVisibility, themeInheritance, viewPreferences, onViewPreferencesChange, themeOverride, defaultThemeId, defaultThemeLabel, }: EditorShellProps): react_jsx_runtime.JSX.Element;
1702
1723
 
1703
1724
  /**
1704
1725
  * Shared editor context menu.
@@ -1848,4 +1869,14 @@ interface PreviewPanelProps {
1848
1869
  */
1849
1870
  declare function PreviewPanel({ basePath, className, workspaceContainer, onLinkClick, showCodeCopyButton, onCopyCode, }: PreviewPanelProps): react_jsx_runtime.JSX.Element;
1850
1871
 
1851
- export { XLSX_LOCKED_REASON as $, type ApplySourceEditsOptions as A, type BlockInsertionBuilder as B, type CodeContext as C, type DashboardImageSaveOutput as D, type EditorHostMode as E, type FormulaEditRecord as F, type EditorView as G, type FormulaSessionOptions as H, type ImageDisplayMode as I, type IngestedSidecar as J, type InsertBlockOptions as K, type LayoutMode as L, type MentionCandidate as M, type MentionProvider as N, type OutlineBlock as O, type OutlineInsertion as P, PreviewPanel as Q, type PreviewPanelProps as R, type SceneTextChannel as S, RawEditor as T, type RawEditorProps as U, type ThemeInheritance as V, type ViewPreferences as W, type XlsxSourceMeta as X, type WriteCanvasSettings as Y, WysiwygEditor as Z, type WysiwygEditorProps as _, type CalcEngineFactory as a, type XlsxFormulaSession as a0, applySourceEditsToText as a1, blockInsertionPoint as a2, createXlsxFormulaSession as a3, getBlockSlices as a4, headingDepthForInsertion as a5, ingestSidecarBytes as a6, joinBlockAt as a7, lineToOffset as a8, minimalReplaceEdit as a9, normalizeSourceEdits as aa, offsetToLine as ab, resolveOutlineInsertion as ac, sliceIndexAtOffset as ad, sourceOutline as ae, spliceBlock as af, useEditorContext as ag, useEditorContextMenuItems as ah, type CsvSourceMeta as b, type BlockInsertionContext as c, type BlockPlacement as d, type BlockRange as e, type BlockSlice as f, type BlockTagVisibility as g, type CodeContextSection as h, type CoverImageSaveOutput as i, type DocumentLinkCandidate as j, type DocumentLinkProvider as k, type EditorActions as l, type EditorColorScheme as m, type EditorContextMenuContext as n, type EditorContextMenuItem as o, type EditorContextMenuItemVisibility as p, EditorContextMenuProvider as q, type EditorContextMenuProviderProps as r, type EditorContextValue as s, type EditorMode as t, EditorProvider as u, type EditorProviderProps as v, type EditorSelectionInfo as w, EditorShell as x, type EditorShellProps as y, type EditorState as z };
1872
+ interface EditorInsertMenuItem {
1873
+ id: string;
1874
+ label: string;
1875
+ icon?: ReactNode;
1876
+ disabled?: boolean;
1877
+ onSelect: () => void;
1878
+ }
1879
+ /** Call from a toolbar slot; callbacks retain access to the editor context. */
1880
+ declare function useEditorInsertMenuItems(items: readonly EditorInsertMenuItem[]): void;
1881
+
1882
+ export { type WysiwygEditorProps as $, type ApplySourceEditsOptions as A, type BlockInsertionBuilder as B, type CodeContext as C, type DashboardImageSaveOutput as D, type EditorHostMode as E, type FormulaEditRecord as F, type EditorShellProps as G, type EditorState as H, type FormulaSessionOptions as I, type ImageDisplayMode as J, type IngestedSidecar as K, type InsertBlockOptions as L, type LayoutMode as M, type MentionCandidate as N, type MentionProvider as O, type OutlineBlock as P, type OutlineInsertion as Q, PreviewPanel as R, type SceneTextChannel as S, type PreviewPanelProps as T, RawEditor as U, type RawEditorProps as V, type ThemeInheritance as W, type XlsxSourceMeta as X, type ViewPreferences as Y, type WriteCanvasSettings as Z, WysiwygEditor as _, type CalcEngineFactory as a, XLSX_LOCKED_REASON as a0, type XlsxFormulaSession as a1, applySourceEditsToText as a2, blockInsertionPoint as a3, createXlsxFormulaSession as a4, getBlockSlices as a5, headingDepthForInsertion as a6, ingestSidecarBytes as a7, joinBlockAt as a8, lineToOffset as a9, minimalReplaceEdit as aa, normalizeSourceEdits as ab, offsetToLine as ac, resolveOutlineInsertion as ad, sliceIndexAtOffset as ae, sourceOutline as af, spliceBlock as ag, useEditorContext as ah, useEditorContextMenuItems as ai, useEditorInsertMenuItems as aj, type EditorView as b, type CsvSourceMeta as c, type BlockInsertionContext as d, type BlockPlacement as e, type BlockRange as f, type BlockSlice as g, type BlockTagVisibility as h, type CodeContextSection as i, type CoverImageSaveOutput as j, type DocumentLinkCandidate as k, type DocumentLinkProvider as l, type EditorActions as m, type EditorColorScheme as n, type EditorContextMenuContext as o, type EditorContextMenuItem as p, type EditorContextMenuItemVisibility as q, EditorContextMenuProvider as r, type EditorContextMenuProviderProps as s, type EditorContextValue as t, type EditorInsertMenuItem as u, type EditorMode as v, EditorProvider as w, type EditorProviderProps as x, type EditorSelectionInfo as y, EditorShell as z };
@@ -1,126 +1,43 @@
1
+ import { R as RecorderDeviceSettings } from '../deviceSettings-BSkIQncC.js';
2
+ import { S as SpeechInputProvider } from '../types-Bi4ZVKvN.js';
3
+ export { D as DictationControl, a as SPEECH_INPUT_SAMPLE_RATE, b as SpeechInputCapability, c as SpeechInputProviderFactory, d as SpeechInputReadiness, e as SpeechInputReadinessState, f as SpeechInputTranscribeOptions, g as SpeechInputTranscript, i as isSpeechInputProviderFactory, r as resolveSpeechInputProvider } from '../types-Bi4ZVKvN.js';
4
+ import '../screenRegion-Ci_RsCzG.js';
5
+
1
6
  /**
2
- * The speech-input (dictation) capability contract between an editor host and
3
- * the shell.
4
- *
5
- * A host that can turn speech into text passes a {@link SpeechInputProvider}
6
- * (or a factory) to `EditorShell`'s `speechInput` prop — the same
7
- * capability-injection semantics as `proofing`: absent means the feature is
8
- * off, no dictation code loads, and no microphone button renders.
7
+ * One dictation session: microphone → progressive takes → 16 kHz WAV → the
8
+ * host's provider → transcript callbacks.
9
9
  *
10
- * The editor owns everything up to the recognizer: microphone capture, phrase
11
- * segmentation, WAV encoding, the toolbar button, the caret indicator and the
12
- * literal-text insertion. The provider owns only recognition. Audio crosses
13
- * the boundary as one self-contained mono 16-bit PCM WAV at 16 kHz per take,
14
- * which every whisper.cpp build accepts and which keeps IPC payloads small.
15
- * The surface is plain data end to end, so a provider can be a local engine
16
- * behind IPC, a call to a service, or a test fake.
17
- */
18
- /** Sample rate (Hz) of every WAV take handed to {@link SpeechInputProvider.transcribe}. */
19
- declare const SPEECH_INPUT_SAMPLE_RATE = 16000;
20
- /** Coarse readiness of a provider, as the editor's button presents it. */
21
- type SpeechInputReadinessState =
22
- /** Dictation can start now. */
23
- 'ready'
24
- /**
25
- * The host needs a one-time setup (typically a model download) first.
26
- * Clicking the microphone calls {@link SpeechInputProvider.requestSetup}
27
- * instead of starting.
10
+ * This module (with the engine, the activity gate and the WAV encoder it pulls
11
+ * in) is only ever reached through a dynamic `import()` from the dictation
12
+ * controller, so a shell without a `speechInput` capability loads none of it.
28
13
  */
29
- | 'download-required'
30
- /** Dictation can never work in this host/session. The button is hidden. */
31
- | 'unavailable'
32
- /**
33
- * The host still needs a permission (e.g. the OS microphone grant).
34
- * Starting proceeds — the microphone request is what prompts for it.
35
- */
36
- | 'permission-required';
37
- interface SpeechInputReadiness {
38
- readonly state: SpeechInputReadinessState;
39
- /** Optional human-readable detail, shown in the button's tooltip/errors. */
40
- readonly reason?: string;
41
- }
42
- interface SpeechInputTranscribeOptions {
43
- /**
44
- * The recent dictated text of this session (a word-aligned tail of at most
45
- * 1,000 characters), for engines that accept a priming prompt — Whisper's
46
- * `prompt`. Absent on the first take.
47
- */
48
- readonly prompt?: string;
49
- /** BCP-47-ish language hint. The editor does not currently set it. */
50
- readonly language?: string;
14
+
15
+ interface DictationSessionOptions {
16
+ provider: SpeechInputProvider;
17
+ /** Aborted when the controller cancels the session (or unmounts). */
18
+ signal: AbortSignal;
51
19
  /**
52
- * Aborted when the user cancels dictation or the editor unmounts. A
53
- * provider should stop promptly; a rejection after abort is ignored.
20
+ * Recorder device settings to honour (the chosen microphone and its
21
+ * constraints). Echo cancellation, noise suppression and auto gain are
22
+ * always on for dictation regardless.
54
23
  */
55
- readonly signal: AbortSignal;
24
+ deviceSettings?: RecorderDeviceSettings;
25
+ onTranscript: (text: string) => void;
26
+ onAudioLevel: (level: number) => void;
27
+ onPendingChange: (pending: number) => void;
28
+ onLongPause: (hadTranscript: boolean) => void;
29
+ onError: (error: Error) => void;
56
30
  }
57
- interface SpeechInputTranscript {
58
- /** Recognized text. Blank (or Whisper's `[BLANK_AUDIO]`) means silence. */
59
- readonly text: string;
60
- }
61
- interface SpeechInputProvider {
62
- /** Stable identifier, e.g. `whisper-local`. */
63
- readonly id: string;
64
- /** Human-readable name, e.g. `On-device speech recognition`. */
65
- readonly label: string;
66
- /**
67
- * Current readiness. Called once when the editor mounts with the
68
- * capability (to decide whether to render the microphone at all) and again
69
- * each time the user starts dictation. Must be cheap.
70
- */
71
- status(): Promise<SpeechInputReadiness>;
72
- /** Optional readiness push (e.g. a model finished downloading). Returns unsubscribe. */
73
- onStatus?(listener: (readiness: SpeechInputReadiness) => void): () => void;
74
- /** Called when the user starts dictation so the host can warm its engine; may reject. */
75
- prepare?(signal: AbortSignal): Promise<void>;
76
- /** Called when the user clicks the mic while readiness is 'download-required'; the host shows its own setup UI. */
77
- requestSetup?(): void;
78
- /** Transcribe one self-contained take: mono 16-bit PCM WAV at 16 kHz. */
79
- transcribe(wav: ArrayBuffer, options: SpeechInputTranscribeOptions): Promise<SpeechInputTranscript>;
80
- /** Release resources. Called by the editor only for a provider it created from a factory. */
81
- dispose?(): void;
82
- }
83
- /**
84
- * Deferred construction. The shell creates the provider when it mounts with
85
- * the capability (it needs `status()` to decide whether to render the
86
- * microphone) and disposes it on unmount or when the capability changes. A
87
- * host that passes an instance owns its lifetime — which is what lets one warm
88
- * engine survive shell remounts.
89
- */
90
- type SpeechInputProviderFactory = () => SpeechInputProvider;
91
- /** What the `speechInput` shell prop accepts. */
92
- type SpeechInputCapability = SpeechInputProvider | SpeechInputProviderFactory;
93
- /**
94
- * Resolve a capability to a provider instance. A factory is invoked (and the
95
- * caller then owns — must dispose — what it returns); an instance is returned
96
- * as-is and stays host-owned.
97
- */
98
- declare function resolveSpeechInputProvider(capability: SpeechInputCapability): SpeechInputProvider;
99
- /**
100
- * Whether a capability is a factory, i.e. whether the provider resolved from
101
- * it is owned (and must be disposed) by the resolver's caller.
102
- */
103
- declare function isSpeechInputProviderFactory(capability: SpeechInputCapability): capability is SpeechInputProviderFactory;
104
- /**
105
- * Imperative dictation control on the editor context
106
- * (`useEditorContext().dictation`), for a host component rendered inside the
107
- * shell's slots — e.g. to drive dictation from a native menu command. `null`
108
- * when the host injected no `speechInput` capability.
109
- */
110
- interface DictationControl {
111
- /** True from the moment dictation starts until its last take is inserted. */
112
- readonly active: boolean;
113
- /**
114
- * True when `toggle()` would do something: the provider is not
115
- * `unavailable` and a text-editing view (Write or Source) is showing.
116
- */
117
- readonly available: boolean;
118
- /**
119
- * Start dictation when idle (or ask the host to set up when readiness is
120
- * `download-required`); finish and stop when listening; cancel while the
121
- * microphone is still starting.
122
- */
123
- toggle(): void;
31
+ interface DictationSessionHandle {
32
+ /** Stop listening, transcribe and deliver every captured take, then resolve. */
33
+ stop(): Promise<void>;
34
+ /** Drop everything immediately — no further callbacks. */
35
+ cancel(): void;
124
36
  }
125
37
 
126
- export { type DictationControl, SPEECH_INPUT_SAMPLE_RATE, type SpeechInputCapability, type SpeechInputProvider, type SpeechInputProviderFactory, type SpeechInputReadiness, type SpeechInputReadinessState, type SpeechInputTranscribeOptions, type SpeechInputTranscript, isSpeechInputProviderFactory, resolveSpeechInputProvider };
38
+ /** Capture into a host-owned transcript without editing the document. Loaded only on a gesture. */
39
+ declare function startDictationSession(options: DictationSessionOptions): Promise<DictationSessionHandle>;
40
+ /** Encode an uploaded audio take using the same wire format as microphone capture. */
41
+ declare function encodeMonoPcm16Wav(channels: readonly Float32Array[], sampleRate: number): Promise<Uint8Array<ArrayBuffer>>;
42
+
43
+ export { type DictationSessionHandle, type DictationSessionOptions, SpeechInputProvider, encodeMonoPcm16Wav, startDictationSession };
@@ -1,3 +1,7 @@
1
+ import {
2
+ encodeMonoPcm16Wav,
3
+ startDictationSession
4
+ } from "../chunk-2MP7QE7O.js";
1
5
  import {
2
6
  SPEECH_INPUT_SAMPLE_RATE,
3
7
  isSpeechInputProviderFactory,
@@ -5,6 +9,8 @@ import {
5
9
  } from "../chunk-DNEVUOBZ.js";
6
10
  export {
7
11
  SPEECH_INPUT_SAMPLE_RATE,
12
+ encodeMonoPcm16Wav,
8
13
  isSpeechInputProviderFactory,
9
- resolveSpeechInputProvider
14
+ resolveSpeechInputProvider,
15
+ startDictationSession
10
16
  };
@@ -0,0 +1,13 @@
1
+ import {
2
+ downmixToMono,
3
+ encodeMonoPcm16Wav,
4
+ microphoneTakeAsWav,
5
+ resampleLinear
6
+ } from "./chunk-K56KR27T.js";
7
+ import "./chunk-DNEVUOBZ.js";
8
+ export {
9
+ downmixToMono,
10
+ encodeMonoPcm16Wav,
11
+ microphoneTakeAsWav,
12
+ resampleLinear
13
+ };