@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/index.js CHANGED
@@ -215,23 +215,38 @@ import {
215
215
  useMermaidSurfaceTheme,
216
216
  useMonacoLoader,
217
217
  usePreviewSettings,
218
+ usePreviewSettingsOptional,
218
219
  useTimelineData,
219
220
  useTreeViewData,
221
+ validateMermaidSource,
220
222
  viewStateFromBinding,
221
223
  writeHeadingViewState
222
- } from "./chunk-US5DALTZ.js";
224
+ } from "./chunk-GIXXD2O3.js";
223
225
  import {
224
226
  EditorProvider,
227
+ applySourceEditsToText,
228
+ blockInsertionPoint,
225
229
  detectLanguageFromFileName,
226
230
  getBlockSlices,
231
+ headingDepthForInsertion,
232
+ joinBlockAt,
227
233
  lineToOffset,
234
+ minimalReplaceEdit,
235
+ normalizeSourceEdits,
228
236
  offsetToLine,
229
237
  resolveFileKind,
238
+ resolveOutlineInsertion,
230
239
  sliceIndexAtOffset,
240
+ sourceOutline,
231
241
  spliceBlock,
232
242
  useBlockNavigator,
233
243
  useEditorContext
234
- } from "./chunk-HTO5MTTJ.js";
244
+ } from "./chunk-45NQUR62.js";
245
+ import {
246
+ SPEECH_INPUT_SAMPLE_RATE,
247
+ isSpeechInputProviderFactory,
248
+ resolveSpeechInputProvider
249
+ } from "./chunk-DNEVUOBZ.js";
235
250
  import "./chunk-V4NBQF5C.js";
236
251
  import {
237
252
  JsonEditor
@@ -252,9 +267,8 @@ import {
252
267
  } from "./chunk-K4Z2GIX4.js";
253
268
  import {
254
269
  RecorderButton
255
- } from "./chunk-EJKGXWNK.js";
270
+ } from "./chunk-WKZLBGPX.js";
256
271
  import {
257
- DEFAULT_RECORDER_DEVICE_SETTINGS,
258
272
  RecorderDeviceQuickPicks,
259
273
  RecorderDeviceSettingsPanel,
260
274
  RecorderModal,
@@ -262,10 +276,6 @@ import {
262
276
  RecorderSlidesPanel,
263
277
  SLIDE_TIMING_CHECKBOX_LABEL,
264
278
  buildPreviewDoc,
265
- buildRecorderAudioConstraints,
266
- buildRecorderCameraConstraints,
267
- buildRecorderScreenAudioConstraints,
268
- buildRecorderScreenConstraints,
269
279
  buildRecorderSlideDeck,
270
280
  clampSlideIndex,
271
281
  documentTitleFromFileName,
@@ -274,7 +284,6 @@ import {
274
284
  isExpandedPanel,
275
285
  panelModeAfterToggle,
276
286
  recordedMediaKind,
277
- recorderBitsPerSecond,
278
287
  recorderDeviceGroups,
279
288
  recorderDeviceOptions,
280
289
  requestScreenStream,
@@ -283,11 +292,19 @@ import {
283
292
  unshownSlidesWarning,
284
293
  useMediaDevices,
285
294
  useMediaRecorder
286
- } from "./chunk-C6QVA6TO.js";
295
+ } from "./chunk-U6NVT3BY.js";
296
+ import {
297
+ DEFAULT_RECORDER_DEVICE_SETTINGS,
298
+ buildRecorderAudioConstraints,
299
+ buildRecorderCameraConstraints,
300
+ buildRecorderScreenAudioConstraints,
301
+ buildRecorderScreenConstraints,
302
+ recorderBitsPerSecond
303
+ } from "./chunk-LRZJD5YD.js";
287
304
  import "./chunk-GS7QWYFT.js";
288
305
  import {
289
306
  TeleprompterView
290
- } from "./chunk-QZWFSSDE.js";
307
+ } from "./chunk-H7YTL6SL.js";
291
308
  import {
292
309
  DEFAULT_TELEPROMPTER_PREFS,
293
310
  EYE_LINE_FRACTION,
@@ -297,7 +314,6 @@ import {
297
314
  TELEPROMPTER_CSS,
298
315
  TeleprompterControls,
299
316
  TeleprompterSurface,
300
- buildFilename,
301
317
  buildNarrationSavePlan,
302
318
  buildTimingJson,
303
319
  cameraVideoLine,
@@ -312,12 +328,7 @@ import {
312
328
  prompterVarsFromTheme,
313
329
  registerPcmWorklet,
314
330
  requestCameraStream,
315
- requestMicStream,
316
- resolveFormat,
317
331
  stepScroll,
318
- supportsDisplayMedia,
319
- supportsMediaRecorder,
320
- supportsUserMedia,
321
332
  targetOffsetFor,
322
333
  timingPathFor,
323
334
  useFloatingWindow,
@@ -327,7 +338,15 @@ import {
327
338
  useStreamPreview,
328
339
  useTeleprompter,
329
340
  vadConfigForSensitivity
330
- } from "./chunk-XZVMKR5Q.js";
341
+ } from "./chunk-CGENKHWY.js";
342
+ import {
343
+ buildFilename,
344
+ requestMicStream,
345
+ resolveFormat,
346
+ supportsDisplayMedia,
347
+ supportsMediaRecorder,
348
+ supportsUserMedia
349
+ } from "./chunk-DNJ6HOES.js";
331
350
 
332
351
  // src/FolderView.tsx
333
352
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -822,6 +841,7 @@ export {
822
841
  RecorderSlidesPanel,
823
842
  RepairableDiagramExtension,
824
843
  SLIDE_TIMING_CHECKBOX_LABEL,
844
+ SPEECH_INPUT_SAMPLE_RATE,
825
845
  StatusBar,
826
846
  Subscript,
827
847
  Superscript,
@@ -859,9 +879,11 @@ export {
859
879
  addTimelineEventOp,
860
880
  applyAsciiDiagramCommand,
861
881
  applyRepairCommand,
882
+ applySourceEditsToText,
862
883
  applyTimelineCommand,
863
884
  applyTreeCommand,
864
885
  asciiDiagramToCanvas,
886
+ blockInsertionPoint,
865
887
  buildFilename,
866
888
  buildNarrationSavePlan,
867
889
  buildPreviewDoc,
@@ -906,6 +928,7 @@ export {
906
928
  getCaptureKind,
907
929
  getTimelineForNode,
908
930
  hasRecorderDeviceChoice,
931
+ headingDepthForInsertion,
909
932
  imageEditorReducer,
910
933
  indentItemOp,
911
934
  ingestForWrite,
@@ -921,7 +944,9 @@ export {
921
944
  isMermaidFlowchartShapeId,
922
945
  isMermaidSourceVisible,
923
946
  isRepairableFence,
947
+ isSpeechInputProviderFactory,
924
948
  isTimelineSourceSafeForSemanticEdit,
949
+ joinBlockAt,
925
950
  lineToOffset,
926
951
  loadDataPreview,
927
952
  mapFenceEntries,
@@ -933,6 +958,7 @@ export {
933
958
  mermaidEditableTexts,
934
959
  mermaidErrorMessage,
935
960
  mermaidSurfaceScheme,
961
+ minimalReplaceEdit,
936
962
  monacoLanguageForFence,
937
963
  moveItemDownOp,
938
964
  moveItemUpOp,
@@ -940,6 +966,7 @@ export {
940
966
  narrationAnnotationLine,
941
967
  nextTimelineEventId,
942
968
  normalizeMermaidFlowchartShape,
969
+ normalizeSourceEdits,
943
970
  offsetToLine,
944
971
  outdentItemOp,
945
972
  panelModeAfterToggle,
@@ -981,6 +1008,8 @@ export {
981
1008
  resolveFileKind,
982
1009
  resolveFormat,
983
1010
  resolveMermaidSurfaceTheme,
1011
+ resolveOutlineInsertion,
1012
+ resolveSpeechInputProvider,
984
1013
  sanitizeAsciiLabel,
985
1014
  sanitizeTimelineText,
986
1015
  sanitizeTreeLabel,
@@ -1000,6 +1029,7 @@ export {
1000
1029
  showSlideTimingCheckbox,
1001
1030
  sliceIndexAtOffset,
1002
1031
  slideStepForKey,
1032
+ sourceOutline,
1003
1033
  spliceBlock,
1004
1034
  stepScroll,
1005
1035
  summarizeBlockProps,
@@ -1038,11 +1068,13 @@ export {
1038
1068
  useNarrationRecorder,
1039
1069
  useNarrationStage,
1040
1070
  usePreviewSettings,
1071
+ usePreviewSettingsOptional,
1041
1072
  useStreamPreview,
1042
1073
  useTeleprompter,
1043
1074
  useTimelineData,
1044
1075
  useTreeViewData,
1045
1076
  vadConfigForSensitivity,
1077
+ validateMermaidSource,
1046
1078
  viewStateFromBinding,
1047
1079
  writeHeadingViewState
1048
1080
  };
@@ -1,40 +1,44 @@
1
1
  import {
2
2
  RecorderButton
3
- } from "../chunk-EJKGXWNK.js";
3
+ } from "../chunk-WKZLBGPX.js";
4
4
  import {
5
- DEFAULT_RECORDER_DEVICE_SETTINGS,
6
5
  RecorderDeviceQuickPicks,
7
6
  RecorderDeviceSettingsPanel,
8
7
  RecorderModal,
9
8
  RecorderPanel,
10
- buildRecorderAudioConstraints,
11
- buildRecorderCameraConstraints,
12
- buildRecorderScreenAudioConstraints,
13
- buildRecorderScreenConstraints,
14
9
  getCaptureKind,
15
10
  hasRecorderDeviceChoice,
16
11
  recordedMediaKind,
17
- recorderBitsPerSecond,
18
12
  recorderDeviceGroups,
19
13
  recorderDeviceOptions,
20
14
  requestScreenStream,
21
15
  useMediaDevices,
22
16
  useMediaRecorder
23
- } from "../chunk-C6QVA6TO.js";
17
+ } from "../chunk-U6NVT3BY.js";
18
+ import {
19
+ DEFAULT_RECORDER_DEVICE_SETTINGS,
20
+ buildRecorderAudioConstraints,
21
+ buildRecorderCameraConstraints,
22
+ buildRecorderScreenAudioConstraints,
23
+ buildRecorderScreenConstraints,
24
+ recorderBitsPerSecond
25
+ } from "../chunk-LRZJD5YD.js";
24
26
  import "../chunk-GS7QWYFT.js";
25
27
  import {
26
- buildFilename,
27
28
  buildTimingJson,
28
29
  encodeTimingJson,
29
30
  requestCameraStream,
31
+ timingPathFor,
32
+ useStreamPreview
33
+ } from "../chunk-CGENKHWY.js";
34
+ import {
35
+ buildFilename,
30
36
  requestMicStream,
31
37
  resolveFormat,
32
38
  supportsDisplayMedia,
33
39
  supportsMediaRecorder,
34
- supportsUserMedia,
35
- timingPathFor,
36
- useStreamPreview
37
- } from "../chunk-XZVMKR5Q.js";
40
+ supportsUserMedia
41
+ } from "../chunk-DNJ6HOES.js";
38
42
  export {
39
43
  DEFAULT_RECORDER_DEVICE_SETTINGS,
40
44
  RecorderButton,
@@ -19,7 +19,8 @@ import {
19
19
  updateReviewDecorations,
20
20
  useReview,
21
21
  useReviewState
22
- } from "../chunk-HTO5MTTJ.js";
22
+ } from "../chunk-45NQUR62.js";
23
+ import "../chunk-DNEVUOBZ.js";
23
24
  import "../chunk-DPAMJV6A.js";
24
25
 
25
26
  // src/review/proofingAdapter.ts
@@ -1,4 +1,4 @@
1
- export { d as BlockTagVisibility, g as DocumentLinkCandidate, h as DocumentLinkProvider, i as EditorActions, j as EditorColorScheme, k as EditorContextMenuContext, l as EditorContextMenuItem, m as EditorContextMenuItemVisibility, n as EditorContextMenuProvider, o as EditorContextMenuProviderProps, p as EditorContextValue, E as EditorHostMode, q as EditorMode, r as EditorProvider, s as EditorProviderProps, u as EditorShell, v as EditorShellProps, w as EditorState, x as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, A as MentionProvider, P as PreviewPanel, G as PreviewPanelProps, R as RawEditor, H as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, J as WysiwygEditor, K as WysiwygEditorProps, a1 as useEditorContext, a2 as useEditorContextMenuItems } from '../shell-X0EoQbbN.js';
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-Cb0P_ln8.js';
2
2
  import 'react/jsx-runtime';
3
3
  import '@bendyline/squisq/table';
4
4
  import '@bendyline/squisq-calc';
@@ -12,6 +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
16
  import '@bendyline/squisq/versions';
16
17
  import '@tiptap/core';
17
18
  import 'monaco-editor';
@@ -5,19 +5,22 @@ import {
5
5
  RawEditor,
6
6
  WysiwygEditor,
7
7
  useEditorContextMenuItems
8
- } from "../chunk-US5DALTZ.js";
8
+ } from "../chunk-GIXXD2O3.js";
9
9
  import {
10
10
  EditorProvider,
11
11
  useEditorContext
12
- } from "../chunk-HTO5MTTJ.js";
12
+ } from "../chunk-45NQUR62.js";
13
+ import "../chunk-DNEVUOBZ.js";
13
14
  import "../chunk-V4NBQF5C.js";
14
15
  import "../chunk-2XXBDECJ.js";
15
16
  import "../chunk-DPAMJV6A.js";
16
17
  import "../chunk-K4Z2GIX4.js";
17
- import "../chunk-C6QVA6TO.js";
18
+ import "../chunk-U6NVT3BY.js";
19
+ import "../chunk-LRZJD5YD.js";
18
20
  import "../chunk-GS7QWYFT.js";
19
- import "../chunk-QZWFSSDE.js";
20
- import "../chunk-XZVMKR5Q.js";
21
+ import "../chunk-H7YTL6SL.js";
22
+ import "../chunk-CGENKHWY.js";
23
+ import "../chunk-DNJ6HOES.js";
21
24
  export {
22
25
  EditorContextMenuProvider,
23
26
  EditorProvider,
@@ -7,9 +7,10 @@ import { ReactNode, RefObject, ReactElement } from 'react';
7
7
  import { Doc, MediaProvider, ViewportPreset, Theme } from '@bendyline/squisq/schemas';
8
8
  import { FenceRendererMap } from '@bendyline/squisq/fence';
9
9
  import { CodeBlockCopyHandler } from '@bendyline/squisq-react';
10
- import { MarkdownDocument } from '@bendyline/squisq/markdown';
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
14
  import { DocumentVersionManager, SaveVersionOptions, SaveVersionResult, PrunePolicy } from '@bendyline/squisq/versions';
14
15
  import { Editor } from '@tiptap/core';
15
16
  import { editor } from 'monaco-editor';
@@ -207,6 +208,102 @@ declare function offsetToLine(source: string, offset: number): number;
207
208
  /** Index of the slice whose range contains `offset`, or -1. */
208
209
  declare function sliceIndexAtOffset(slices: BlockSlice[], offset: number): number;
209
210
 
211
+ /**
212
+ * sourceEdits
213
+ *
214
+ * Pure helpers behind the editor's undoable source-edit actions
215
+ * (`applySourceEdits`, `insertBlockAfterCursor`) and usable by any host that
216
+ * plans edits against a markdown string:
217
+ *
218
+ * - validating and applying `{ start, end, text }` edits to a source string;
219
+ * - the smallest single edit that turns one source into another;
220
+ * - where a new block may go relative to a cursor, without splitting a
221
+ * container template (drawing, layout, diagram) or letting a new heading
222
+ * capture the paragraphs that follow it.
223
+ *
224
+ * Placement is decided on an abstract outline of top-level blocks so the Write
225
+ * view (ProseMirror nodes) and the Source view (markdown AST) share one rule.
226
+ */
227
+
228
+ /**
229
+ * Where `insertBlockAfterCursor` puts a block.
230
+ *
231
+ * - `afterBlock`: straight after the top-level block holding the cursor. Right
232
+ * for fences, tables and paragraphs.
233
+ * - `sectionEnd`: at the end of the cursor's section, just before the next
234
+ * heading. Right for heading-based blocks, which would otherwise capture
235
+ * the paragraphs after them.
236
+ */
237
+ type BlockPlacement = 'afterBlock' | 'sectionEnd';
238
+ /** The heading structure around an insertion point. */
239
+ interface BlockInsertionContext {
240
+ /** Depth of the section the insertion point belongs to; 0 before any heading. */
241
+ sectionDepth: number;
242
+ /** Depth of the first heading after the insertion point, or null at the end. */
243
+ nextHeadingDepth: number | null;
244
+ /**
245
+ * Deepest heading depth a heading-based block may use here. Normally 6;
246
+ * lower straight after a container template, whose children any deeper
247
+ * heading would join.
248
+ */
249
+ maxHeadingDepth: number;
250
+ }
251
+ /** One top-level block, as an outline sees it. */
252
+ interface OutlineBlock {
253
+ /** Heading depth, or null for any non-heading block. */
254
+ headingDepth: number | null;
255
+ /** True for a heading whose template consumes the headings under it. */
256
+ container: boolean;
257
+ }
258
+ /** An insertion point in an outline: insert before `blocks[index]`. */
259
+ interface OutlineInsertion extends BlockInsertionContext {
260
+ index: number;
261
+ }
262
+ /** Validate edits against `source` and sort them by position; null if any is unusable. */
263
+ declare function normalizeSourceEdits(source: string, edits: readonly MarkdownSourceEdit[]): MarkdownSourceEdit[] | null;
264
+ /** Apply edits to `source`. Throws on edits `normalizeSourceEdits` rejects. */
265
+ declare function applySourceEditsToText(source: string, edits: readonly MarkdownSourceEdit[]): string;
266
+ /** The smallest single edit turning `previous` into `next`, or null when they are equal. */
267
+ declare function minimalReplaceEdit(previous: string, next: string): MarkdownSourceEdit | null;
268
+ /**
269
+ * Decide where a block goes in an outline, given the block holding the cursor
270
+ * (`cursorIndex`, -1 when the cursor is before every block).
271
+ *
272
+ * A cursor inside a container template never puts a block among its children:
273
+ * `afterBlock` moves before the container and `sectionEnd` after its subtree.
274
+ */
275
+ declare function resolveOutlineInsertion(blocks: readonly OutlineBlock[], cursorIndex: number, placement: BlockPlacement): OutlineInsertion;
276
+ /**
277
+ * Heading depth for a heading-based block inserted at this point, so the
278
+ * heading that follows closes it instead of being captured, and it does not
279
+ * join a preceding container's children. `childLevels` reserves depth for the
280
+ * block's own child headings (1 for drawing and layout). Null when nothing fits.
281
+ */
282
+ declare function headingDepthForInsertion(context: BlockInsertionContext, options?: {
283
+ childLevels?: number;
284
+ }): number | null;
285
+ /** Top-level blocks of a markdown source with their character ranges. */
286
+ declare function sourceOutline(source: string): {
287
+ blocks: OutlineBlock[];
288
+ ranges: Array<{
289
+ start: number;
290
+ end: number;
291
+ }>;
292
+ };
293
+ /**
294
+ * Where a block goes in a markdown source for a cursor at `cursorOffset`.
295
+ * `offset` is the end of the block the new one follows (or the body start);
296
+ * pass it to {@link joinBlockAt}.
297
+ */
298
+ declare function blockInsertionPoint(source: string, cursorOffset: number, placement: BlockPlacement): BlockInsertionContext & {
299
+ offset: number;
300
+ };
301
+ /**
302
+ * The edit that puts `block` at `offset` with exactly one blank line on each
303
+ * side, absorbing whatever whitespace already surrounds that point.
304
+ */
305
+ declare function joinBlockAt(source: string, offset: number, block: string): MarkdownSourceEdit;
306
+
210
307
  /**
211
308
  * Configuration a Scene host (diagram / drawing / layout widget) supplies
212
309
  * so the shared inline text editor knows how to read and write the text of
@@ -288,6 +385,25 @@ interface DocumentLinkCandidate {
288
385
  */
289
386
  type DocumentLinkProvider = (query: string) => Promise<DocumentLinkCandidate[]>;
290
387
  type EditorView = 'raw' | 'wysiwyg' | 'preview';
388
+ /** Options for {@link EditorActions.applySourceEdits}. */
389
+ interface ApplySourceEditsOptions {
390
+ /**
391
+ * The source the edits were planned against. When the document no longer
392
+ * matches it, nothing is applied and the action returns false.
393
+ */
394
+ baseSource?: string;
395
+ }
396
+ /**
397
+ * Builds the markdown for {@link EditorActions.insertBlockAfterCursor} once the
398
+ * insertion point is known, so a heading-based block can pick a depth that
399
+ * fits there. Return null to cancel.
400
+ */
401
+ type BlockInsertionBuilder = (context: BlockInsertionContext) => string | null;
402
+ /** Options for {@link EditorActions.insertBlockAfterCursor}. */
403
+ interface InsertBlockOptions {
404
+ /** Defaults to `'afterBlock'`. Use `'sectionEnd'` for heading-based blocks. */
405
+ placement?: BlockPlacement;
406
+ }
291
407
  /** What is selected in the active editing surface. */
292
408
  interface EditorSelectionInfo {
293
409
  /** Which surface reported it. */
@@ -525,8 +641,34 @@ interface EditorActions {
525
641
  getBlockAtCursor: () => BlockSlice | null;
526
642
  /** Insert text at the current cursor position in the active editor */
527
643
  insertAtCursor: (text: string) => void;
528
- /** Replace all editor content with the given text */
644
+ /**
645
+ * Replace all editor content with the given text. Undoable as one step in
646
+ * Write and Source views (Document layout); elsewhere it replaces the
647
+ * source directly.
648
+ */
529
649
  replaceAll: (text: string) => void;
650
+ /**
651
+ * Apply `{ start, end, text }` edits to the full markdown source as ONE
652
+ * undoable step. Offsets refer to `markdownSource` (frontmatter included).
653
+ *
654
+ * Source view edits Monaco's model in place, so the cursor, scroll and undo
655
+ * history survive. Write view loads the result as a minimal change.
656
+ * Returns false, applying nothing, in Preview, outside the Document layout,
657
+ * when the edits overlap or fall outside the source, or when the source no
658
+ * longer matches `options.baseSource`.
659
+ */
660
+ applySourceEdits: (edits: readonly MarkdownSourceEdit[], options?: ApplySourceEditsOptions) => boolean;
661
+ /**
662
+ * Insert a markdown block near the cursor as ONE undoable step, leaving the
663
+ * selection where it is.
664
+ *
665
+ * `'afterBlock'` (default) puts it after the top-level block holding the
666
+ * cursor; `'sectionEnd'` puts it just before the next heading. Neither ever
667
+ * lands among a drawing's or layout's child headings. Pass a builder to
668
+ * choose the markdown once the surrounding heading depths are known.
669
+ * Returns false when the surface cannot be edited or the builder cancels.
670
+ */
671
+ insertBlockAfterCursor: (block: string | BlockInsertionBuilder, options?: InsertBlockOptions) => boolean;
530
672
  /**
531
673
  * Request the modal image editor open on the given relative media path.
532
674
  * The path must resolve through the active `mediaProvider`. No-op when
@@ -645,6 +787,13 @@ interface EditorContextValue extends EditorState, EditorActions {
645
787
  * for the session.
646
788
  */
647
789
  proofingIgnoreStore: ProofingIgnoreStore | null;
790
+ /**
791
+ * Imperative dictation control for the host-injected `speechInput`
792
+ * capability — e.g. to drive dictation from a native menu command in a
793
+ * component rendered inside the shell's slots. `null` when no capability
794
+ * was injected. See docs/speech-input.md.
795
+ */
796
+ dictation: DictationControl | null;
648
797
  /** The document's article id — part of the proofing document ref. */
649
798
  articleId: string;
650
799
  /**
@@ -760,6 +909,11 @@ interface EditorProviderProps {
760
909
  proofingGrammarEnabled?: boolean;
761
910
  /** Host-owned per-document storage for dismissed proofing findings. */
762
911
  proofingIgnoreStore?: ProofingIgnoreStore | null;
912
+ /**
913
+ * Speech-input (dictation) capability. Omit for no dictation; see
914
+ * `EditorShellProps.speechInput`.
915
+ */
916
+ speechInput?: SpeechInputCapability | null;
763
917
  /**
764
918
  * Async provider for sibling-document suggestions in the link dialog.
765
919
  * Omit to fall back to URL-only link insertion.
@@ -897,7 +1051,7 @@ interface ViewPreferences {
897
1051
  /** Document vs. block-at-a-time layout. */
898
1052
  layoutMode?: LayoutMode;
899
1053
  }
900
- declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, mediaEditRenders, imageDisplayMode, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, onCopyCode, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode: controlledFindMode, onFindModeChange, inlinePreview, showStatusBar, outline, blockTags, blockTagVisibility: initialBlockTagVisibility, themeInheritance, layoutMode, viewPreferences, onViewPreferencesChange, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
1054
+ declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, mediaEditRenders, imageDisplayMode, mentionProvider, proofing, proofingDefaultEnabled, proofingSpellingEnabled, proofingGrammarEnabled, proofingIgnoreStore, speechInput, documentLinkProvider, fenceRenderers, onCopyCode, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode: controlledFindMode, onFindModeChange, inlinePreview, showStatusBar, outline, blockTags, blockTagVisibility: initialBlockTagVisibility, themeInheritance, layoutMode, viewPreferences, onViewPreferencesChange, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
901
1055
 
902
1056
  /**
903
1057
  * Host-supplied context sections rendered INSIDE the Monaco (raw/code)
@@ -1350,6 +1504,17 @@ interface EditorShellProps {
1350
1504
  * store and Ignore still works, lasting for the session only.
1351
1505
  */
1352
1506
  proofingIgnoreStore?: ProofingIgnoreStore | null;
1507
+ /**
1508
+ * Dictation capability — a `SpeechInputProvider` (or factory) from
1509
+ * `@bendyline/squisq-editor-react/speech`. Omit and the feature is off:
1510
+ * no microphone button, no capture code loaded. With it, the toolbar
1511
+ * gains a microphone in the Write and Source views that inserts
1512
+ * recognized phrases as literal text at the caret; hosts can also drive
1513
+ * it via `useEditorContext().dictation`. Instance = host-owned; factory =
1514
+ * created on mount, disposed on unmount. Ignored when `readOnly`. Host
1515
+ * guide: docs/speech-input.md.
1516
+ */
1517
+ speechInput?: SpeechInputCapability | null;
1353
1518
  /**
1354
1519
  * Optional async provider for sibling-document suggestions in the
1355
1520
  * link insert dialog. When supplied, the dialog gains a "Browse
@@ -1527,7 +1692,7 @@ interface EditorShellProps {
1527
1692
  * Complete markdown editor shell with toolbar, view switcher, and three
1528
1693
  * editing modes: Raw (Monaco), WYSIWYG (Tiptap), and Preview.
1529
1694
  */
1530
- 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, 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;
1695
+ 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;
1531
1696
 
1532
1697
  /**
1533
1698
  * Shared editor context menu.
@@ -1677,4 +1842,4 @@ interface PreviewPanelProps {
1677
1842
  */
1678
1843
  declare function PreviewPanel({ basePath, className, workspaceContainer, onLinkClick, showCodeCopyButton, onCopyCode, }: PreviewPanelProps): react_jsx_runtime.JSX.Element;
1679
1844
 
1680
- export { sliceIndexAtOffset as $, type MentionProvider as A, type BlockRange as B, type CodeContext as C, type DashboardImageSaveOutput as D, type EditorHostMode as E, type FormulaEditRecord as F, type PreviewPanelProps as G, type RawEditorProps as H, type ImageDisplayMode as I, WysiwygEditor as J, type WysiwygEditorProps as K, type LayoutMode as L, type MentionCandidate as M, XLSX_LOCKED_REASON as N, type XlsxFormulaSession as O, PreviewPanel as P, createXlsxFormulaSession as Q, RawEditor as R, type SceneTextChannel as S, type ThemeInheritance as T, getBlockSlices as U, type ViewPreferences as V, type WriteCanvasSettings as W, type XlsxSourceMeta as X, ingestSidecarBytes as Y, lineToOffset as Z, offsetToLine as _, type CalcEngineFactory as a, spliceBlock as a0, useEditorContext as a1, useEditorContextMenuItems as a2, type CsvSourceMeta as b, type BlockSlice as c, type BlockTagVisibility as d, type CodeContextSection as e, type CoverImageSaveOutput as f, type DocumentLinkCandidate as g, type DocumentLinkProvider as h, type EditorActions as i, type EditorColorScheme as j, type EditorContextMenuContext as k, type EditorContextMenuItem as l, type EditorContextMenuItemVisibility as m, EditorContextMenuProvider as n, type EditorContextMenuProviderProps as o, type EditorContextValue as p, type EditorMode as q, EditorProvider as r, type EditorProviderProps as s, type EditorSelectionInfo as t, EditorShell as u, type EditorShellProps as v, type EditorState as w, type EditorView as x, type FormulaSessionOptions as y, type IngestedSidecar as z };
1845
+ 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 };