@bendyline/squisq-editor-react 2.9.0 → 2.10.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.
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Doc, Theme, MediaProvider } from '@bendyline/squisq/schemas';
2
+ import { Doc, Theme, ViewportConfig, MediaProvider } from '@bendyline/squisq/schemas';
3
3
  import { ContentContainer } from '@bendyline/squisq/storage';
4
- import { k as RecorderSource, o as TeleprompterRecordingDeps } from './useNarrationStage-Bk3mdW75.js';
4
+ import { l as RecorderSource, o as TeleprompterRecordingDeps } from './useNarrationStage-B6r9Zlq-.js';
5
5
  import { CSSProperties, RefObject } from 'react';
6
6
 
7
7
  type RecordedMediaKind = 'audio' | 'video';
@@ -31,6 +31,35 @@ interface RecorderNarrationOptions {
31
31
  /** Editor plumbing for the narration save pipeline; null hides the checkbox. */
32
32
  recording: TeleprompterRecordingDeps | null;
33
33
  }
34
+ /**
35
+ * Everything slides mode needs beyond the base recorder props. Supplying this
36
+ * with a non-null `doc` surfaces the "Show slides mode" checkbox; when
37
+ * checked, the dialog expands and the deck occupies the right column while
38
+ * capture controls stay on the left.
39
+ */
40
+ interface RecorderSlidesOptions {
41
+ /** Parsed document the deck is built from. Null hides the checkbox. */
42
+ doc: Doc | null;
43
+ /** Theme the slides render with — the same one the preview uses. */
44
+ theme: Theme;
45
+ /** Viewport the slides compose at. Defaults to landscape. */
46
+ viewport?: ViewportConfig;
47
+ /** Resolves relative media inside slides. Defaults to the modal's own provider. */
48
+ mediaProvider?: MediaProvider | null;
49
+ /** Base path for media URLs in the slide renderer. */
50
+ basePath?: string;
51
+ /**
52
+ * Turn slide advances made during the take into an authoritative per-block
53
+ * v3 timing sidecar on save.
54
+ *
55
+ * Only meaningful when the host inserts the take as a DOCUMENT-ANCHORED clip
56
+ * (the "Record document narration" entry) — that is the only clip
57
+ * `applyNarrationTiming` reads a sidecar for, so for an ordinary block-level
58
+ * recording the file would be written and never read. This flag is
59
+ * therefore also how the dialog learns it is in document-narration mode.
60
+ */
61
+ captureTimings?: boolean;
62
+ }
34
63
  interface RecorderModalProps {
35
64
  /** Required — recordings are written here. */
36
65
  mediaProvider: MediaProvider;
@@ -59,6 +88,14 @@ interface RecorderModalProps {
59
88
  onSave?: (result: RecorderSaveResult) => void;
60
89
  /** Enables the "Show narration mode" checkbox. Omit for the classic dialog. */
61
90
  narration?: RecorderNarrationOptions | null;
91
+ /** Enables the "Show slides mode" checkbox. Omit for the classic dialog. */
92
+ slides?: RecorderSlidesOptions | null;
93
+ /**
94
+ * Dialog heading (also its accessible name). Defaults to `'Record media'`;
95
+ * hosts that open the dialog for a specific purpose — e.g. "Record document
96
+ * narration" — pass their own so the dialog names what it is capturing.
97
+ */
98
+ title?: string;
62
99
  }
63
100
  /**
64
101
  * The camera companion of a `'screen+camera'` save. Present only on that
@@ -95,14 +132,30 @@ interface RecorderSaveResult {
95
132
  mimeType: string;
96
133
  /** Recording length in seconds. */
97
134
  duration: number;
98
- /** Whether a narration sidecar was written. Always `false` for video sources. */
135
+ /**
136
+ * Whether a timing sidecar was written — either the v1 script sidecar for a
137
+ * mic take, or the v3 per-block sidecar from slide advances.
138
+ */
99
139
  hasTimingSidecar: boolean;
100
140
  /** Script text the user typed (narration only). */
101
141
  sourceText?: string;
102
142
  /** The paired camera file — present only for `source === 'screen+camera'`. */
103
143
  camera?: RecorderCameraSaveResult;
144
+ /** Present when slide advances were saved as a v3 per-block timing sidecar. */
145
+ slideTiming?: SlideTimingSaveResult;
146
+ }
147
+ /** What a presenter-advance timing write produced, for host status messaging. */
148
+ interface SlideTimingSaveResult {
149
+ /** Container path the sidecar was written to. */
150
+ sidecarPath: string;
151
+ /** Renderable blocks written into the sidecar. */
152
+ blockCount: number;
153
+ /** Blocks never shown during the take — they save as zero-length ranges. */
154
+ unshownCount: number;
155
+ /** Take length the block ranges were normalized against. */
156
+ durationSec: number;
104
157
  }
105
- declare function RecorderModal({ mediaProvider, container, initialMode, colorScheme, onClose, onSave, narration, }: RecorderModalProps): react_jsx_runtime.JSX.Element;
158
+ declare function RecorderModal({ mediaProvider, container, initialMode, colorScheme, onClose, onSave, narration, slides, title, }: RecorderModalProps): react_jsx_runtime.JSX.Element;
106
159
 
107
160
  interface RecorderButtonProps {
108
161
  /** Where to write the resulting recording. Required. */
@@ -117,6 +170,8 @@ interface RecorderButtonProps {
117
170
  onSave?: (result: RecorderSaveResult) => void;
118
171
  /** Enables the modal's "Show narration mode" checkbox. */
119
172
  narration?: RecorderNarrationOptions | null;
173
+ /** Enables the modal's "Show slides mode" checkbox. */
174
+ slides?: RecorderSlidesOptions | null;
120
175
  /** Button label. Defaults to `'Record'`. */
121
176
  label?: string;
122
177
  /** Optional inline button styles. */
@@ -124,7 +179,7 @@ interface RecorderButtonProps {
124
179
  /** Whether the button is disabled. */
125
180
  disabled?: boolean;
126
181
  }
127
- declare function RecorderButton({ mediaProvider, container, initialMode, colorScheme, onSave, narration, label, style, disabled, }: RecorderButtonProps): react_jsx_runtime.JSX.Element;
182
+ declare function RecorderButton({ mediaProvider, container, initialMode, colorScheme, onSave, narration, slides, label, style, disabled, }: RecorderButtonProps): react_jsx_runtime.JSX.Element;
128
183
 
129
184
  interface RecorderPanelProps {
130
185
  mediaProvider: MediaProvider;
@@ -135,8 +190,12 @@ interface RecorderPanelProps {
135
190
  onSave?: (result: RecorderSaveResult) => void;
136
191
  /** Enables the modal's "Show narration mode" checkbox. */
137
192
  narration?: RecorderNarrationOptions | null;
193
+ /** Enables the modal's "Show slides mode" checkbox. */
194
+ slides?: RecorderSlidesOptions | null;
138
195
  /** ARIA / tooltip label. Defaults to `'Record media'`. */
139
196
  tooltip?: string;
197
+ /** Dialog heading / accessible name. Defaults to the modal's own `'Record media'`. */
198
+ title?: string;
140
199
  /** Optional className for the trigger button. */
141
200
  className?: string;
142
201
  /** Controlled modal state. Omit to let the panel manage its own state. */
@@ -146,7 +205,7 @@ interface RecorderPanelProps {
146
205
  /** Render the built-in trigger button. Defaults to true. */
147
206
  showTrigger?: boolean;
148
207
  }
149
- declare function RecorderPanel({ mediaProvider, container, initialMode, colorScheme, onSave, narration, tooltip, className, open: controlledOpen, onOpenChange, showTrigger, }: RecorderPanelProps): react_jsx_runtime.JSX.Element;
208
+ declare function RecorderPanel({ mediaProvider, container, initialMode, colorScheme, onSave, narration, slides, tooltip, title, className, open: controlledOpen, onOpenChange, showTrigger, }: RecorderPanelProps): react_jsx_runtime.JSX.Element;
150
209
 
151
210
  /**
152
211
  * User-configurable recorder device/encoding settings.
@@ -470,6 +529,7 @@ declare function requestScreenStream(options?: ScreenStreamOptions): Promise<Scr
470
529
  * alongside its audio file and have the existing audio-mapping pipeline
471
530
  * pick them up with no schema changes.
472
531
  */
532
+
473
533
  /**
474
534
  * Word-level timing bookmark — same shape as `AudioBookmark` in
475
535
  * `@bendyline/squisq`. Recorder output produces an empty `bookmarks`
@@ -511,4 +571,4 @@ declare function encodeTimingJson(timing: TimingJson): Uint8Array;
511
571
  */
512
572
  declare function timingPathFor(audioRelativePath: string): string;
513
573
 
514
- export { buildRecorderScreenAudioConstraints as A, buildRecorderScreenConstraints as B, type CameraStreamOptions as C, DEFAULT_RECORDER_DEVICE_SETTINGS as D, buildTimingJson as E, encodeTimingJson as F, hasRecorderDeviceChoice as G, recordedMediaKind as H, recorderBitsPerSecond as I, recorderDeviceGroups as J, recorderDeviceOptions as K, requestCameraStream as L, type MediaDeviceInventory as M, requestMicStream as N, requestScreenStream as O, timingPathFor as P, useMediaDevices as Q, type RecordedBookmark as R, type ScreenStreamHandle as S, type TimingJson as T, useStreamPreview as U, 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 ScreenStreamOptions as x, buildRecorderAudioConstraints as y, buildRecorderCameraConstraints as z };
574
+ 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 };
@@ -1,10 +1,12 @@
1
- export { B as BlockTagVisibility, c as DocumentLinkCandidate, d as DocumentLinkProvider, e as EditorActions, f as EditorColorScheme, g as EditorContextValue, E as EditorHostMode, h as EditorMode, i as EditorProvider, j as EditorProviderProps, k as EditorShell, l as EditorShellProps, m as EditorState, n as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, o as MentionProvider, P as PreviewPanel, p as PreviewPanelProps, R as RawEditor, q as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, r as WysiwygEditor, s as WysiwygEditorProps, u as useEditorContext } from '../shell-Bv6neeA6.js';
1
+ export { B as BlockTagVisibility, c as DocumentLinkCandidate, d as DocumentLinkProvider, e as EditorActions, f as EditorColorScheme, g as EditorContextValue, E as EditorHostMode, h as EditorMode, i as EditorProvider, j as EditorProviderProps, k as EditorShell, l as EditorShellProps, m as EditorState, n as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, o as MentionProvider, P as PreviewPanel, p as PreviewPanelProps, R as RawEditor, q as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, r as WysiwygEditor, s as WysiwygEditorProps, u as useEditorContext } from '../shell-Dlh-mkn9.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@bendyline/squisq/schemas';
5
5
  import '@bendyline/squisq/fence';
6
6
  import '@bendyline/squisq/markdown';
7
7
  import '@bendyline/squisq/storage';
8
+ import '../types-B_aHRuSc.js';
9
+ import '@bendyline/squisq/proof';
8
10
  import '@bendyline/squisq/versions';
9
11
  import '@tiptap/core';
10
12
  import 'monaco-editor';
@@ -5,14 +5,14 @@ import {
5
5
  RawEditor,
6
6
  WysiwygEditor,
7
7
  useEditorContext
8
- } from "../chunk-53PXOIMU.js";
8
+ } from "../chunk-TQPZ6VVM.js";
9
9
  import "../chunk-V4NBQF5C.js";
10
- import "../chunk-TLRB3IQC.js";
10
+ import "../chunk-TCLNRATG.js";
11
11
  import "../chunk-V44VP242.js";
12
- import "../chunk-V3J5S7X6.js";
12
+ import "../chunk-JNJ7XO5L.js";
13
13
  import "../chunk-GS7QWYFT.js";
14
- import "../chunk-IQFPX2CE.js";
15
- import "../chunk-OWOKKZAU.js";
14
+ import "../chunk-ZZTB6BEQ.js";
15
+ import "../chunk-IRPOMTYK.js";
16
16
  export {
17
17
  EditorProvider,
18
18
  EditorShell,
@@ -4,6 +4,7 @@ import { Doc, MediaProvider, ViewportPreset, Theme } from '@bendyline/squisq/sch
4
4
  import { FenceRendererMap } from '@bendyline/squisq/fence';
5
5
  import { MarkdownDocument } from '@bendyline/squisq/markdown';
6
6
  import { ContentContainer } from '@bendyline/squisq/storage';
7
+ import { P as ProofingCapability, b as ProofingIgnoreStore } from './types-B_aHRuSc.js';
7
8
  import { DocumentVersionManager, SaveVersionOptions, SaveVersionResult, PrunePolicy } from '@bendyline/squisq/versions';
8
9
  import { Editor } from '@tiptap/core';
9
10
  import { editor } from 'monaco-editor';
@@ -364,6 +365,27 @@ interface EditorContextValue extends EditorState, EditorActions {
364
365
  * the user types `@<query>`. When unset, `@` is just a literal character.
365
366
  */
366
367
  mentionProvider: MentionProvider | null;
368
+ /**
369
+ * Grammar/spellcheck capability injected by the host — a provider (or
370
+ * factory) from `@bendyline/squisq-editor-react/proofing`. `null`
371
+ * means the feature is off everywhere (the `ffmpegWasm` semantics:
372
+ * absent capability, absent feature).
373
+ */
374
+ proofing: ProofingCapability | null;
375
+ /**
376
+ * Host default for whether proofing checks documents when the
377
+ * capability is present. Per-doc frontmatter and the session toggle
378
+ * override it.
379
+ */
380
+ proofingDefaultEnabled: boolean;
381
+ /**
382
+ * Host-owned, per-document storage for dismissed findings. Ignores
383
+ * are never written into the document; without a store they last only
384
+ * for the session.
385
+ */
386
+ proofingIgnoreStore: ProofingIgnoreStore | null;
387
+ /** The document's article id — part of the proofing document ref. */
388
+ articleId: string;
367
389
  /**
368
390
  * Optional provider for sibling-document suggestions in the link
369
391
  * dialog. When set, the dialog shows a "Browse documents" picker that
@@ -455,6 +477,15 @@ interface EditorProviderProps {
455
477
  * entirely — typing `@` becomes just a literal character again.
456
478
  */
457
479
  mentionProvider?: MentionProvider | null;
480
+ /**
481
+ * Grammar/spellcheck capability. Omit for no proofing; see
482
+ * `EditorShellProps.proofing`.
483
+ */
484
+ proofing?: ProofingCapability | null;
485
+ /** Host default enable state for proofing (default true). */
486
+ proofingDefaultEnabled?: boolean;
487
+ /** Host-owned per-document storage for dismissed proofing findings. */
488
+ proofingIgnoreStore?: ProofingIgnoreStore | null;
458
489
  /**
459
490
  * Async provider for sibling-document suggestions in the link dialog.
460
491
  * Omit to fall back to URL-only link insertion.
@@ -587,7 +618,7 @@ interface ViewPreferences {
587
618
  /** Document vs. block-at-a-time layout. */
588
619
  layoutMode?: LayoutMode;
589
620
  }
590
- declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, documentLinkProvider, fenceRenderers, 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;
621
+ declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, proofing, proofingDefaultEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, 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;
591
622
 
592
623
  /**
593
624
  * Host-supplied context sections rendered INSIDE the Monaco (raw/code)
@@ -959,6 +990,32 @@ interface EditorShellProps {
959
990
  * inline. Omit to disable mentions entirely.
960
991
  */
961
992
  mentionProvider?: MentionProvider | null;
993
+ /**
994
+ * Grammar/spellcheck capability — a `ProofingProvider` (or factory)
995
+ * from `@bendyline/squisq-editor-react/proofing`, typically backed by
996
+ * harper.js. Same semantics as `ffmpegWasm` in video export: omit and
997
+ * the feature is completely off — no engine bytes are ever fetched,
998
+ * and no proofing UI renders. Pass an *instance* to own its lifetime
999
+ * yourself (it survives shell remounts); pass a *factory* and the
1000
+ * shell creates the provider on first use and disposes it on unmount.
1001
+ */
1002
+ proofing?: ProofingCapability | null;
1003
+ /**
1004
+ * Whether proofing checks documents by default when the capability is
1005
+ * present (default `true`). Per-doc frontmatter (`squisq-proofing`)
1006
+ * and the user's session toggle in the View menu override this.
1007
+ */
1008
+ proofingDefaultEnabled?: boolean;
1009
+ /**
1010
+ * Host-owned storage for findings the user dismissed with "Ignore",
1011
+ * scoped per document (`load`/`save` receive a
1012
+ * `ProofingDocumentRef` carrying `articleId` + `fileName`, so a host
1013
+ * can key by file path). Ignores are deliberately NEVER written into
1014
+ * the document — they are one person's editing preference, not
1015
+ * content that should travel through git to everyone else. Omit the
1016
+ * store and Ignore still works, lasting for the session only.
1017
+ */
1018
+ proofingIgnoreStore?: ProofingIgnoreStore | null;
962
1019
  /**
963
1020
  * Optional async provider for sibling-document suggestions in the
964
1021
  * link insert dialog. When supplied, the dialog gains a "Browse
@@ -1136,7 +1193,7 @@ interface EditorShellProps {
1136
1193
  * Complete markdown editor shell with toolbar, view switcher, and three
1137
1194
  * editing modes: Raw (Monaco), WYSIWYG (Tiptap), and Preview.
1138
1195
  */
1139
- declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode, onFindModeChange, mentionProvider, 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;
1196
+ declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode, onFindModeChange, mentionProvider, proofing, proofingDefaultEnabled, 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;
1140
1197
 
1141
1198
  /**
1142
1199
  * RawEditor