@bendyline/squisq-editor-react 2.11.4 → 2.11.6

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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel, a as CalcEngineFactory, b as CsvSourceMeta, X as XlsxSourceMeta, F as FormulaEditRecord } from './shell-CJkHDwpz.js';
2
- export { B as BlockTagVisibility, c as CodeContextSection, d as CoverImageSaveOutput, D as DashboardImageSaveOutput, e as DocumentLinkCandidate, f as DocumentLinkProvider, g as EditorActions, h as EditorColorScheme, i as EditorContextMenuContext, j as EditorContextMenuItem, k as EditorContextMenuItemVisibility, l as EditorContextMenuProvider, m as EditorContextMenuProviderProps, n as EditorContextValue, o as EditorMode, p as EditorProvider, q as EditorProviderProps, r as EditorShell, s as EditorShellProps, t as EditorState, u as EditorView, v as FormulaSessionOptions, I as ImageDisplayMode, w as IngestedSidecar, L as LayoutMode, M as MentionCandidate, x as MentionProvider, P as PreviewPanel, y as PreviewPanelProps, R as RawEditor, z as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, W as WriteCanvasSettings, A as WysiwygEditor, G as WysiwygEditorProps, H as XLSX_LOCKED_REASON, J as XlsxFormulaSession, K as createXlsxFormulaSession, N as ingestSidecarBytes, O as useEditorContext, Q as useEditorContextMenuItems } from './shell-CJkHDwpz.js';
1
+ import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel, a as CalcEngineFactory, b as CsvSourceMeta, X as XlsxSourceMeta, F as FormulaEditRecord } from './shell-Dwf_W4K4.js';
2
+ export { B as BlockRange, c as BlockSlice, d as BlockTagVisibility, e as CodeContextSection, f as CoverImageSaveOutput, D as DashboardImageSaveOutput, 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, q as EditorMode, r as EditorProvider, s as EditorProviderProps, t as EditorSelectionInfo, u as EditorShell, v as EditorShellProps, w as EditorState, x as EditorView, y as FormulaSessionOptions, I as ImageDisplayMode, z as IngestedSidecar, 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, W as WriteCanvasSettings, J as WysiwygEditor, K as WysiwygEditorProps, N as XLSX_LOCKED_REASON, O as XlsxFormulaSession, Q as createXlsxFormulaSession, U as getBlockSlices, Y as ingestSidecarBytes, Z as lineToOffset, _ as offsetToLine, $ as sliceIndexAtOffset, a0 as spliceBlock, a1 as useEditorContext, a2 as useEditorContextMenuItems } from './shell-Dwf_W4K4.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, CSSProperties, ReactElement } from 'react';
@@ -30,12 +30,14 @@ export { C as CameraStreamOptions, D as DEFAULT_RECORDER_DEVICE_SETTINGS, M as M
30
30
  import { R as RecorderState } from './useNarrationStage-D3Sgcf0L.js';
31
31
  export { C as CanvasSink, a as CaptureKind, D as DEFAULT_TELEPROMPTER_PREFS, F as FloatOpenOptions, b as FloatTier, c as FloatingWindowHandle, d as FloatingWindowManager, M as MicAnalysisHandle, e as MicAnalysisStatus, N as NarrationRecorderController, f as NarrationRecorderState, g as NarrationStageHandle, h as NarrationTake, P as PrompterTransport, i as RecorderAudioBitrateMode, j as RecorderCameraLane, k as RecorderExtendedMediaOptions, l as RecorderSource, m as ResolvedFormat, T as TeleprompterController, n as TeleprompterPrefs, o as TeleprompterRecordingDeps, U as UseMediaRecorderOptions, p as UseMediaRecorderResult, q as UseNarrationStageOptions, r as buildFilename, s as createFloatingWindowManager, t as detectFloatTiers, u as getCaptureKind, v as resolveFormat, w as supportsDisplayMedia, x as supportsMediaRecorder, y as supportsUserMedia, z as useFloatingWindow, A as useMediaRecorder, B as useMicAnalysis, E as useNarrationRecorder, G as useNarrationStage, H as useTeleprompter, I as vadConfigForSensitivity } from './useNarrationStage-D3Sgcf0L.js';
32
32
  export { EYE_LINE_FRACTION, NarrationSavePlan, NarrationSaveResult, NarrationStage, NarrationStageProps, PCM_WORKLET_NAME, PCM_WORKLET_SOURCE, TELEPROMPTER_CSS, TeleprompterControls, TeleprompterControlsProps, TeleprompterSurface, TeleprompterSurfaceProps, TeleprompterView, TeleprompterViewProps, TokenLineMap, buildNarrationSavePlan, cameraVideoLine, ensureTeleprompterStyles, executeNarrationSave, insertNarrationPreamble, measureTokenLines, narrationAnnotationLine, prompterVarsFromTheme, registerPcmWorklet, stepScroll, targetOffsetFor } from './teleprompter/index.js';
33
- export { H as HarperProofingConfig, P as ProofingCapability, a as ProofingDocumentRef, b as ProofingIgnoreStore, c as ProofingLanguage, d as ProofingLintOptions, e as ProofingProvider, f as ProofingProviderFactory } from './types-B_aHRuSc.js';
33
+ export { H as HarperProofingConfig, a as ProofingCapability, b as ProofingDocumentRef, c as ProofingIgnoreStore, d as ProofingLanguage, e as ProofingLintOptions, P as ProofingProvider, f as ProofingProviderFactory } from './types-De4z-gGb.js';
34
34
  export { createHarperProofingProvider } from './proofing/index.js';
35
35
  export { PROOF_DIALECTS, PROOF_FRONTMATTER_KEYS, ProofCategory, ProofDialect, ProofFinding, ProofRange, ProofSuggestion, ProofSuggestionKind } from '@bendyline/squisq/proof';
36
36
  import '@bendyline/squisq-calc';
37
37
  import '@bendyline/squisq-formats/xlsx';
38
38
  import '@bendyline/squisq/versions';
39
+ import './types-C0puuw-M.js';
40
+ import '@bendyline/squisq/review';
39
41
  import '@bendyline/squisq/imageEdit';
40
42
  import '@bendyline/squisq/jsonForm';
41
43
  import '@bendyline/squisq/narration';
@@ -173,56 +175,6 @@ interface BlockCardViewProps {
173
175
  }
174
176
  declare function BlockCardView({ active, blockCount, activeBlockKey, onPrev, onNext, onAdd, children, className, }: BlockCardViewProps): react_jsx_runtime.JSX.Element;
175
177
 
176
- /**
177
- * blockRange
178
- *
179
- * Source-text-range slicing for the block-at-a-time editing view. Splits a
180
- * full markdown document into ordered, contiguous slices — one per
181
- * heading-defined block plus an optional leading preamble — so a single
182
- * block can be shown in isolation and edits spliced back into the parent.
183
- *
184
- * A block runs from its heading line through the character just before the
185
- * next heading at ANY depth (or EOF). Sub-headings therefore start their own
186
- * slices — they are NOT folded into their parent — which matches the
187
- * "don't see child blocks" requirement and the `slicePastHeading` boundary
188
- * in `blockSlice.ts`. Ranges are half-open `[startOffset, endOffset)` and
189
- * line-aligned, so trailing blank lines stay with the current block and
190
- * `spliceBlock(src, range, getBlockSlices(src)[i].text) === src` for every i.
191
- *
192
- * These are pure functions over a markdown string — no React, no editor
193
- * coupling — so any host can reuse them.
194
- */
195
- /** Half-open character range into the full source: `[startOffset, endOffset)`. */
196
- interface BlockRange {
197
- startOffset: number;
198
- endOffset: number;
199
- }
200
- /** One block's source text plus the range it occupies in the full document. */
201
- interface BlockSlice {
202
- text: string;
203
- range: BlockRange;
204
- }
205
- /**
206
- * Split `fullSource` into ordered block slices.
207
- *
208
- * - With no headings, the entire post-frontmatter body is a single slice
209
- * (so an empty or heading-less document still shows one editable card).
210
- * - With headings, a leading preamble slice is included only when the text
211
- * before the first heading has non-whitespace content. Each heading then
212
- * yields one slice spanning up to the next heading (any depth) or EOF.
213
- *
214
- * Frontmatter is never part of any slice — slices start at the body offset.
215
- */
216
- declare function getBlockSlices(fullSource: string): BlockSlice[];
217
- /** Replace the text in `range` with `newText`, returning the new full source. */
218
- declare function spliceBlock(fullSource: string, range: BlockRange, newText: string): string;
219
- /** Character offset of the start of 1-based `line` (clamps past EOF). */
220
- declare function lineToOffset(source: string, line: number): number;
221
- /** 1-based line number containing `offset`. */
222
- declare function offsetToLine(source: string, offset: number): number;
223
- /** Index of the slice whose range contains `offset`, or -1. */
224
- declare function sliceIndexAtOffset(slices: BlockSlice[], offset: number): number;
225
-
226
178
  /**
227
179
  * useTimelineClock
228
180
  *
@@ -3380,4 +3332,4 @@ declare function unshownSlidesWarning(total: number, unshown: number): string |
3380
3332
  /** The exact label of the review-state block-timings checkbox. */
3381
3333
  declare const SLIDE_TIMING_CHECKBOX_LABEL = "Update block timings when I save this narration";
3382
3334
 
3383
- export { ALL_PICKER_ENTRIES, type AddTimelineEventOptions, type AddTimelineEventResult, type ApplyAsciiDiagramCommandOptions, type AsciiDiagramBlockEntry, AsciiDiagramExtension, type AsciiDiagramExtensionOptions, type AsciiDiagramPluginState, type AsciiDiagramView, AsciiDiagramWidget, BlockCardView, type BlockCardViewProps, type BlockNavigator, BlockPropertiesPopover, type BlockPropertiesPopoverProps, type BlockRange, type BlockSlice, CODE_SNIPPET_KEY, CODE_SNIPPET_LANGUAGES, CalcEngineFactory, CodeContext, CodeContextZones, type CodeSnippetBlockEntry, type CodeSnippetData, CodeSnippetExtension, type CodeSnippetExtensionOptions, type CodeSnippetLanguage, type CodeSnippetPluginState, CodeSnippetWidget, type CodeSnippetWidgetProps, CsvSourceMeta, type CustomTemplateContextValue, CustomTemplateProvider, type CustomTemplateProviderProps, type CustomThemeContextValue, CustomThemeProvider, type CustomThemeProviderProps, DATA_CARD_KEY, DEFAULT_MERMAID_DIAGRAM_TYPE, type DataCardBlockEntry, DataCardExtension, type DataCardExtensionOptions, type DataCardPluginState, DataCardWidget, type DataPreview, DiagramCanvas, type DiagramCommand, type DiagramData, type DiagramEdge, type DiagramNode, type DirectionModel, type DocCustomTemplates, type DocCustomThemes, DocumentSettingsDialog, type DocumentSettingsDialogProps, type DragContentType, type DropTarget, DropZoneOverlay, type DropZoneOverlayProps, EMPTY_TRANSITION, EditorHostMode, EmojiPicker, type EmojiPickerProps, FENCE_WIDGET_CONTAINED_EVENTS, type FenceBlockEntry, type FileCategory, type FileKind, type FolderEntry, FolderView, type FolderViewProps, FormulaEditRecord, type GridSaveResult, HOST_FENCE_KEY, type HeadingTransitionAttrs, type HeadingViewBinding, HeadingWithTemplate, type HostFenceBlockEntry, HostFenceExtension, type HostFenceExtensionOptions, type HostFencePluginState, ImportThemeSection, type ImportThemeSectionProps, type ImportedThemeResult, InlinePreviewGutter, type InlinePreviewGutterProps, MERMAID_DIAGRAM_KEY, MERMAID_DIAGRAM_TYPES, MERMAID_FLOWCHART_SHAPES, MediaBin, type MediaBinProps, type MediaClipPatch, type MermaidDiagramBlockEntry, MermaidDiagramCanvas, type MermaidDiagramCanvasProps, type MermaidDiagramCategory, type MermaidDiagramData, MermaidDiagramExtension, type MermaidDiagramExtensionOptions, type MermaidDiagramPluginState, type MermaidDiagramPreview, type MermaidDiagramProperty, type MermaidDiagramType, MermaidDiagramTypeThumbnail, MermaidDiagramWidget, type MermaidDiagramWidgetProps, type MermaidEditCapabilities, type MermaidEditableDiagramKind, type MermaidEditableEdge, type MermaidEditableModel, type MermaidEditableNode, type MermaidEditableText, type MermaidEditableTextTarget, type MermaidFlowchartDirection, type MermaidFlowchartModel, type MermaidFlowchartShape, type MermaidFlowchartShapeId, type MermaidNodeCanvasAction, type MermaidRenderResult, type MermaidSelection, MermaidShapePalette, type MermaidShapePaletteProps, type MermaidSourceEditableModel, type MermaidSurfaceScheme, MonacoLanguageLoadOptions, MonacoLanguageRequest, OutlinePanel, type OutlinePanelProps, PICKER_CATEGORIES, type PickerCategory, type PickerEntry, PlainHtmlPreview, type PlainHtmlPreviewProps, PreviewFormatSwitch, PreviewModeMenu, PreviewModeSwitch, type PreviewSettings, PreviewSettingsProvider, PreviewToolbarControls, type PreviewToolbarControlsProps, REPAIRABLE_KEY, type RecorderPanelMode, type RecorderSlide, RecorderSlidesPanel, type RecorderSlidesPanelProps, RecorderState, type RepairableBlockEntry, RepairableDiagramExtension, type RepairableDiagramExtensionOptions, type RepairablePluginState, SLIDE_TIMING_CHECKBOX_LABEL, type SaveCsvEditsOptions, type SaveXlsxEditsOptions, StatusBar, type StatusBarProps, Subscript, Superscript, TIMELINE_VIEW_KEY, TRANSITION_ENTRIES, TRANSITION_GROUPS, TemplatePicker, ThemeCustomizerPanel, type ThemeCustomizerPanelProps, ThemePicker, type ThemePickerProps, type ThemeSaveExtras, type TimelineBlockEntry, type TimelineCommand, type TimelineCommandResult, TimelineCompositionPanel, type TimelineCompositionPanelProps, TimelineEditorWidget, type TimelineEditorWidgetProps, type TimelineEventPatch, TimelineToolbar, type TimelineToolbarProps, TimelineTrack, type TimelineTrackProps, TimelineVideoPanel, type TimelineVideoPanelProps, type TimelineViewData, TimelineViewExtension, type TimelineViewExtensionOptions, type TimelineViewPluginState, Toolbar, type ToolbarProps, TooltipLayer, TransformMenu, type TransitionCatalogEntry, type TransitionFields, type TransitionGroup, TransitionPicker, type TransitionPickerProps, type TreeBlockEntry, type TreeCommand, TreeOutlineWidget, type TreeViewData, TreeViewExtension, type TreeViewExtensionOptions, type TreeViewPluginState, type UseBlockNavigatorOptions, type UseFileDropOptions, type UseFileDropResult, type UseMonacoLoaderResult, VersionHistoryPanel, ViewMenuPanel, ViewSwitcher, type ViewSwitcherProps, type WrapPolicyIngest, XlsxSourceMeta, adaptThemeToSurface, addEdgeOp, addItemOp, addNodeOp, addTimelineEventOp, applyAsciiDiagramCommand, applyRepairCommand, applyTimelineCommand, applyTreeCommand, asciiDiagramToCanvas, buildRecorderSlideDeck, clampSlideIndex, classifyFile, codeSnippetFenceLanguageToken, codeSnippetLanguageLabel, codeSnippetMarkdown, containFenceWidgetEvents, dataExtensionOf, dataLinkHrefOf, detectLanguageFromFileName, draftPatchFromImportedTheme, findAsciiDiagramBlockPos, findCodeSnippetBlockPos, findDataCardBlockPos, findHostFenceBlockPos, findMermaidDiagramBlockPos, findOwningHeadingPosition, findRepairableBlockPos, findTimelineBlockPos, findTransitionEntry, findTreeBlockPos, formatSeconds, getBlockSlices, getTimelineForNode, indentItemOp, ingestForWrite, inspectMermaidSource, isAsciiSourceVisible, isCodeSnippetFenceLanguage, isCodeSnippetNode, isExpandedPanel, isMermaidDiagramNode, isMermaidFlowchartShapeId, isMermaidSourceVisible, isRepairableFence, isTimelineSourceSafeForSemanticEdit, lineToOffset, loadDataPreview, mapFenceEntries, markdownToTiptap, mermaidDiagramMarkdown, mermaidDiagramProperties, mermaidEditCapabilities, mermaidEditableTexts, mermaidErrorMessage, mermaidSurfaceScheme, monacoLanguageForFence, moveItemDownOp, moveItemUpOp, moveNodeOp, nextTimelineEventId, normalizeMermaidFlowchartShape, offsetToLine, outdentItemOp, panelModeAfterToggle, parseTimelineForNode, partitionFiles, persistFromWrite, preloadMonaco, preloadMonacoSuggestions, processDataFiles, processMediaFiles, processTextFile, processTextFiles, readBlockAttrsParams, readBlockAttrsTransition, readBlockAttrsValue, readHeadingLineTransition, readHeadingViewBinding, removeEdgeOp, removeItemOp, removeNodeOp, removeTimelineEventOp, renameItemOp, renameNodeOp, renderMermaidDiagram, replaceAsciiFenceText, replaceCodeSnippetText, replaceHostFenceText, replaceAsciiFenceText as replaceTreeFenceText, resizeNodeOp, resolveFileKind, resolveMermaidSurfaceTheme, sanitizeAsciiLabel, sanitizeTimelineText, sanitizeTreeLabel, saveCsvEdits, saveXlsxEdits, searchPickerEntries, setBlockAttrsValue, setBlockDurationInSource, setBlockStartTimeInSource, setBlockTransitionInSource, setHeadingAttrsTransition, setHeadingLineTransition, setMediaClipInSource, shouldPasteAsAsciiFence, shouldPasteAsTimelineFence, shouldPasteAsTreeFence, showSlideTimingCheckbox, sliceIndexAtOffset, slideStepForKey, spliceBlock, summarizeBlockProps, templateLabel, tiptapToMarkdown, toggleAsciiSource, toggleDirOp, toggleMermaidSource, transitionLabel, translateDiagramOp, unshownSlidesWarning, updateTimelineEventOp, useAsciiDiagramData, useBlockNavigator, useCodeSnippetData, useCustomTemplates, useCustomThemes, useDocCustomTemplates, useDocCustomThemes, useFileDrop, useMermaidDiagramData, useMermaidSurfaceTheme, useMonacoLoader, usePreviewSettings, useTimelineData, useTreeViewData, viewStateFromBinding, writeHeadingViewState };
3335
+ export { ALL_PICKER_ENTRIES, type AddTimelineEventOptions, type AddTimelineEventResult, type ApplyAsciiDiagramCommandOptions, type AsciiDiagramBlockEntry, AsciiDiagramExtension, type AsciiDiagramExtensionOptions, type AsciiDiagramPluginState, type AsciiDiagramView, AsciiDiagramWidget, BlockCardView, type BlockCardViewProps, type BlockNavigator, BlockPropertiesPopover, type BlockPropertiesPopoverProps, CODE_SNIPPET_KEY, CODE_SNIPPET_LANGUAGES, CalcEngineFactory, CodeContext, CodeContextZones, type CodeSnippetBlockEntry, type CodeSnippetData, CodeSnippetExtension, type CodeSnippetExtensionOptions, type CodeSnippetLanguage, type CodeSnippetPluginState, CodeSnippetWidget, type CodeSnippetWidgetProps, CsvSourceMeta, type CustomTemplateContextValue, CustomTemplateProvider, type CustomTemplateProviderProps, type CustomThemeContextValue, CustomThemeProvider, type CustomThemeProviderProps, DATA_CARD_KEY, DEFAULT_MERMAID_DIAGRAM_TYPE, type DataCardBlockEntry, DataCardExtension, type DataCardExtensionOptions, type DataCardPluginState, DataCardWidget, type DataPreview, DiagramCanvas, type DiagramCommand, type DiagramData, type DiagramEdge, type DiagramNode, type DirectionModel, type DocCustomTemplates, type DocCustomThemes, DocumentSettingsDialog, type DocumentSettingsDialogProps, type DragContentType, type DropTarget, DropZoneOverlay, type DropZoneOverlayProps, EMPTY_TRANSITION, EditorHostMode, EmojiPicker, type EmojiPickerProps, FENCE_WIDGET_CONTAINED_EVENTS, type FenceBlockEntry, type FileCategory, type FileKind, type FolderEntry, FolderView, type FolderViewProps, FormulaEditRecord, type GridSaveResult, HOST_FENCE_KEY, type HeadingTransitionAttrs, type HeadingViewBinding, HeadingWithTemplate, type HostFenceBlockEntry, HostFenceExtension, type HostFenceExtensionOptions, type HostFencePluginState, ImportThemeSection, type ImportThemeSectionProps, type ImportedThemeResult, InlinePreviewGutter, type InlinePreviewGutterProps, MERMAID_DIAGRAM_KEY, MERMAID_DIAGRAM_TYPES, MERMAID_FLOWCHART_SHAPES, MediaBin, type MediaBinProps, type MediaClipPatch, type MermaidDiagramBlockEntry, MermaidDiagramCanvas, type MermaidDiagramCanvasProps, type MermaidDiagramCategory, type MermaidDiagramData, MermaidDiagramExtension, type MermaidDiagramExtensionOptions, type MermaidDiagramPluginState, type MermaidDiagramPreview, type MermaidDiagramProperty, type MermaidDiagramType, MermaidDiagramTypeThumbnail, MermaidDiagramWidget, type MermaidDiagramWidgetProps, type MermaidEditCapabilities, type MermaidEditableDiagramKind, type MermaidEditableEdge, type MermaidEditableModel, type MermaidEditableNode, type MermaidEditableText, type MermaidEditableTextTarget, type MermaidFlowchartDirection, type MermaidFlowchartModel, type MermaidFlowchartShape, type MermaidFlowchartShapeId, type MermaidNodeCanvasAction, type MermaidRenderResult, type MermaidSelection, MermaidShapePalette, type MermaidShapePaletteProps, type MermaidSourceEditableModel, type MermaidSurfaceScheme, MonacoLanguageLoadOptions, MonacoLanguageRequest, OutlinePanel, type OutlinePanelProps, PICKER_CATEGORIES, type PickerCategory, type PickerEntry, PlainHtmlPreview, type PlainHtmlPreviewProps, PreviewFormatSwitch, PreviewModeMenu, PreviewModeSwitch, type PreviewSettings, PreviewSettingsProvider, PreviewToolbarControls, type PreviewToolbarControlsProps, REPAIRABLE_KEY, type RecorderPanelMode, type RecorderSlide, RecorderSlidesPanel, type RecorderSlidesPanelProps, RecorderState, type RepairableBlockEntry, RepairableDiagramExtension, type RepairableDiagramExtensionOptions, type RepairablePluginState, SLIDE_TIMING_CHECKBOX_LABEL, type SaveCsvEditsOptions, type SaveXlsxEditsOptions, StatusBar, type StatusBarProps, Subscript, Superscript, TIMELINE_VIEW_KEY, TRANSITION_ENTRIES, TRANSITION_GROUPS, TemplatePicker, ThemeCustomizerPanel, type ThemeCustomizerPanelProps, ThemePicker, type ThemePickerProps, type ThemeSaveExtras, type TimelineBlockEntry, type TimelineCommand, type TimelineCommandResult, TimelineCompositionPanel, type TimelineCompositionPanelProps, TimelineEditorWidget, type TimelineEditorWidgetProps, type TimelineEventPatch, TimelineToolbar, type TimelineToolbarProps, TimelineTrack, type TimelineTrackProps, TimelineVideoPanel, type TimelineVideoPanelProps, type TimelineViewData, TimelineViewExtension, type TimelineViewExtensionOptions, type TimelineViewPluginState, Toolbar, type ToolbarProps, TooltipLayer, TransformMenu, type TransitionCatalogEntry, type TransitionFields, type TransitionGroup, TransitionPicker, type TransitionPickerProps, type TreeBlockEntry, type TreeCommand, TreeOutlineWidget, type TreeViewData, TreeViewExtension, type TreeViewExtensionOptions, type TreeViewPluginState, type UseBlockNavigatorOptions, type UseFileDropOptions, type UseFileDropResult, type UseMonacoLoaderResult, VersionHistoryPanel, ViewMenuPanel, ViewSwitcher, type ViewSwitcherProps, type WrapPolicyIngest, XlsxSourceMeta, adaptThemeToSurface, addEdgeOp, addItemOp, addNodeOp, addTimelineEventOp, applyAsciiDiagramCommand, applyRepairCommand, applyTimelineCommand, applyTreeCommand, asciiDiagramToCanvas, buildRecorderSlideDeck, clampSlideIndex, classifyFile, codeSnippetFenceLanguageToken, codeSnippetLanguageLabel, codeSnippetMarkdown, containFenceWidgetEvents, dataExtensionOf, dataLinkHrefOf, detectLanguageFromFileName, draftPatchFromImportedTheme, findAsciiDiagramBlockPos, findCodeSnippetBlockPos, findDataCardBlockPos, findHostFenceBlockPos, findMermaidDiagramBlockPos, findOwningHeadingPosition, findRepairableBlockPos, findTimelineBlockPos, findTransitionEntry, findTreeBlockPos, formatSeconds, getTimelineForNode, indentItemOp, ingestForWrite, inspectMermaidSource, isAsciiSourceVisible, isCodeSnippetFenceLanguage, isCodeSnippetNode, isExpandedPanel, isMermaidDiagramNode, isMermaidFlowchartShapeId, isMermaidSourceVisible, isRepairableFence, isTimelineSourceSafeForSemanticEdit, loadDataPreview, mapFenceEntries, markdownToTiptap, mermaidDiagramMarkdown, mermaidDiagramProperties, mermaidEditCapabilities, mermaidEditableTexts, mermaidErrorMessage, mermaidSurfaceScheme, monacoLanguageForFence, moveItemDownOp, moveItemUpOp, moveNodeOp, nextTimelineEventId, normalizeMermaidFlowchartShape, outdentItemOp, panelModeAfterToggle, parseTimelineForNode, partitionFiles, persistFromWrite, preloadMonaco, preloadMonacoSuggestions, processDataFiles, processMediaFiles, processTextFile, processTextFiles, readBlockAttrsParams, readBlockAttrsTransition, readBlockAttrsValue, readHeadingLineTransition, readHeadingViewBinding, removeEdgeOp, removeItemOp, removeNodeOp, removeTimelineEventOp, renameItemOp, renameNodeOp, renderMermaidDiagram, replaceAsciiFenceText, replaceCodeSnippetText, replaceHostFenceText, replaceAsciiFenceText as replaceTreeFenceText, resizeNodeOp, resolveFileKind, resolveMermaidSurfaceTheme, sanitizeAsciiLabel, sanitizeTimelineText, sanitizeTreeLabel, saveCsvEdits, saveXlsxEdits, searchPickerEntries, setBlockAttrsValue, setBlockDurationInSource, setBlockStartTimeInSource, setBlockTransitionInSource, setHeadingAttrsTransition, setHeadingLineTransition, setMediaClipInSource, shouldPasteAsAsciiFence, shouldPasteAsTimelineFence, shouldPasteAsTreeFence, showSlideTimingCheckbox, slideStepForKey, summarizeBlockProps, templateLabel, tiptapToMarkdown, toggleAsciiSource, toggleDirOp, toggleMermaidSource, transitionLabel, translateDiagramOp, unshownSlidesWarning, updateTimelineEventOp, useAsciiDiagramData, useBlockNavigator, useCodeSnippetData, useCustomTemplates, useCustomThemes, useDocCustomTemplates, useDocCustomThemes, useFileDrop, useMermaidDiagramData, useMermaidSurfaceTheme, useMonacoLoader, usePreviewSettings, useTimelineData, useTreeViewData, viewStateFromBinding, writeHeadingViewState };
package/dist/index.js CHANGED
@@ -32,7 +32,6 @@ import {
32
32
  DropZoneOverlay,
33
33
  EMPTY_TRANSITION,
34
34
  EditorContextMenuProvider,
35
- EditorProvider,
36
35
  EditorShell,
37
36
  EmojiPicker,
38
37
  FENCE_WIDGET_CONTAINED_EVENTS,
@@ -111,7 +110,6 @@ import {
111
110
  createXlsxFormulaSession,
112
111
  dataExtensionOf,
113
112
  dataLinkHrefOf,
114
- detectLanguageFromFileName,
115
113
  draftPatchFromImportedTheme,
116
114
  findAsciiDiagramBlockPos,
117
115
  findCodeSnippetBlockPos,
@@ -124,7 +122,6 @@ import {
124
122
  findTransitionEntry,
125
123
  findTreeBlockPos,
126
124
  formatSeconds,
127
- getBlockSlices,
128
125
  getTimelineForNode,
129
126
  indentItemOp,
130
127
  ingestForWrite,
@@ -138,7 +135,6 @@ import {
138
135
  isMermaidSourceVisible,
139
136
  isRepairableFence,
140
137
  isTimelineSourceSafeForSemanticEdit,
141
- lineToOffset,
142
138
  loadDataPreview,
143
139
  mapFenceEntries,
144
140
  mermaidDiagramMarkdown,
@@ -153,7 +149,6 @@ import {
153
149
  moveNodeOp,
154
150
  nextTimelineEventId,
155
151
  normalizeMermaidFlowchartShape,
156
- offsetToLine,
157
152
  outdentItemOp,
158
153
  parseTimelineForNode,
159
154
  partitionFiles,
@@ -181,7 +176,6 @@ import {
181
176
  replaceCodeSnippetText,
182
177
  replaceHostFenceText,
183
178
  resizeNodeOp,
184
- resolveFileKind,
185
179
  resolveMermaidSurfaceTheme,
186
180
  sanitizeAsciiLabel,
187
181
  sanitizeTimelineText,
@@ -199,8 +193,6 @@ import {
199
193
  shouldPasteAsAsciiFence,
200
194
  shouldPasteAsTimelineFence,
201
195
  shouldPasteAsTreeFence,
202
- sliceIndexAtOffset,
203
- spliceBlock,
204
196
  summarizeBlockProps,
205
197
  templateLabel,
206
198
  themeToDraft,
@@ -211,13 +203,11 @@ import {
211
203
  translateDiagramOp,
212
204
  updateTimelineEventOp,
213
205
  useAsciiDiagramData,
214
- useBlockNavigator,
215
206
  useCodeSnippetData,
216
207
  useCustomTemplates,
217
208
  useCustomThemes,
218
209
  useDocCustomTemplates,
219
210
  useDocCustomThemes,
220
- useEditorContext,
221
211
  useEditorContextMenuItems,
222
212
  useEscapeDismissal,
223
213
  useFileDrop,
@@ -229,7 +219,19 @@ import {
229
219
  useTreeViewData,
230
220
  viewStateFromBinding,
231
221
  writeHeadingViewState
232
- } from "./chunk-CDISORBP.js";
222
+ } from "./chunk-WMNH5ROU.js";
223
+ import {
224
+ EditorProvider,
225
+ detectLanguageFromFileName,
226
+ getBlockSlices,
227
+ lineToOffset,
228
+ offsetToLine,
229
+ resolveFileKind,
230
+ sliceIndexAtOffset,
231
+ spliceBlock,
232
+ useBlockNavigator,
233
+ useEditorContext
234
+ } from "./chunk-DUO5XZQK.js";
233
235
  import "./chunk-V4NBQF5C.js";
234
236
  import {
235
237
  JsonEditor
@@ -1,5 +1,5 @@
1
- import { H as HarperProofingConfig, e as ProofingProvider } from '../types-B_aHRuSc.js';
2
- export { P as ProofingCapability, a as ProofingDocumentRef, b as ProofingIgnoreStore, c as ProofingLanguage, d as ProofingLintOptions, f as ProofingProviderFactory } from '../types-B_aHRuSc.js';
1
+ import { H as HarperProofingConfig, P as ProofingProvider } from '../types-De4z-gGb.js';
2
+ export { a as ProofingCapability, b as ProofingDocumentRef, c as ProofingIgnoreStore, d as ProofingLanguage, e as ProofingLintOptions, f as ProofingProviderFactory } from '../types-De4z-gGb.js';
3
3
  export { PROOF_DIALECTS, PROOF_FRONTMATTER_KEYS, ProofCategory, ProofDialect, ProofFinding, ProofRange, ProofSuggestion, ProofSuggestionKind } from '@bendyline/squisq/proof';
4
4
 
5
5
  /**
@@ -0,0 +1,285 @@
1
+ import { R as ReviewProvider, a as ReviewCapability, b as ReviewHue } from '../types-C0puuw-M.js';
2
+ export { D as DEFAULT_REVIEW_DEBOUNCE_MS, c as DEFAULT_REVIEW_HUE, d as ReviewProviderFactory, r as resolveReviewProvider } from '../types-C0puuw-M.js';
3
+ import { ReactNode, ReactElement } from 'react';
4
+ import { ReviewFinding, ReviewRequest, ReviewDocumentRef, ReviewBlockInput } from '@bendyline/squisq/review';
5
+ export { PROOFING_REVIEW_SOURCE, ReviewBlockInput, ReviewDocumentRef, ReviewEvent, ReviewFinding, ReviewRequest, ReviewSeverity, ReviewSuggestion, ReviewSuggestionKind, proofFindingToReviewFinding } from '@bendyline/squisq/review';
6
+ import { Extension, Editor } from '@tiptap/core';
7
+ import { EditorState } from '@tiptap/pm/state';
8
+ import { Node } from '@tiptap/pm/model';
9
+ import { editor } from 'monaco-editor';
10
+ import { P as ProofingProvider } from '../types-De4z-gGb.js';
11
+ import '@bendyline/squisq/proof';
12
+
13
+ /**
14
+ * Multi-provider review orchestration, without React.
15
+ *
16
+ * Framework-free on purpose: the interesting behaviour here is scheduling —
17
+ * when a pass starts, what cancels it, and which results are still worth
18
+ * showing — and all of it is far easier to pin down against a fake clock than
19
+ * through a rendered component.
20
+ *
21
+ * The scheduling contract mirrors proofing's, with one difference that is the
22
+ * whole point of review: **each provider is scheduled independently**. A
23
+ * spellchecker re-running 450 ms after a keystroke and a model that takes
24
+ * seconds cannot share a cadence, and a single shared timer would have to be
25
+ * wrong for one of them.
26
+ *
27
+ * Per provider: one debounced single-flight pass at a time, a dirty flag
28
+ * coalescing anything arriving mid-pass into exactly one trailing pass, and
29
+ * results discarded when the document moved under them.
30
+ */
31
+
32
+ type ReviewProviderPhase = 'idle' | 'preparing' | 'running' | 'ready' | 'error';
33
+ interface ReviewProviderStatus {
34
+ id: string;
35
+ label: string;
36
+ phase: ReviewProviderPhase;
37
+ /** Findings from this provider's most recent completed pass. */
38
+ findings: readonly ReviewFinding[];
39
+ /** Set when the provider's last pass failed. */
40
+ error: string | null;
41
+ }
42
+ interface ReviewSnapshot {
43
+ /** Every provider's findings, in provider order then document order. */
44
+ findings: readonly ReviewFinding[];
45
+ providers: readonly ReviewProviderStatus[];
46
+ /** True while any provider has a pass in flight. */
47
+ running: boolean;
48
+ }
49
+ /** What the runner needs to build a request. Called fresh for every pass. */
50
+ type ReviewRequestSource = () => ReviewRequest | null;
51
+ interface ReviewRunnerOptions {
52
+ providers: readonly ReviewProvider[];
53
+ /** Builds the request for a pass, and reports the document revision. */
54
+ buildRequest: ReviewRequestSource;
55
+ /**
56
+ * Monotonic document revision. A pass whose revision no longer matches at
57
+ * completion is discarded: its findings are about text that has since
58
+ * changed, and drawing them would put a mark on an unrelated word.
59
+ */
60
+ revision: () => number;
61
+ onChange: (snapshot: ReviewSnapshot) => void;
62
+ setTimer?: (fn: () => void, ms: number) => unknown;
63
+ clearTimer?: (handle: unknown) => void;
64
+ }
65
+ declare class ReviewRunner {
66
+ private readonly runtimes;
67
+ private readonly options;
68
+ private readonly setTimer;
69
+ private readonly clearTimer;
70
+ private disposed;
71
+ constructor(options: ReviewRunnerOptions);
72
+ /** The document changed. Reschedule every provider. */
73
+ schedule(): void;
74
+ /** Run now, skipping the debounce — the user asked for a review. */
75
+ runNow(): void;
76
+ snapshot(): ReviewSnapshot;
77
+ /** Drop a finding from the visible set without re-running anything. */
78
+ removeFinding(findingId: string): void;
79
+ dispose(): void;
80
+ private scheduleOne;
81
+ private runPass;
82
+ private setPhase;
83
+ private fail;
84
+ private emit;
85
+ }
86
+
87
+ /**
88
+ * Review orchestration — the one place that coordinates the providers, the two
89
+ * editor surfaces, and the document.
90
+ *
91
+ * The scheduling itself lives in {@link ReviewRunner}, deliberately outside
92
+ * React so it can be tested against a fake clock. This hook owns only what is
93
+ * genuinely React's: turning the current document into a request, pushing the
94
+ * resulting findings at whichever surface is mounted, and tearing both down.
95
+ *
96
+ * Findings index the markdown SOURCE. That is exactly what Monaco shows, so
97
+ * the Source view draws them directly; the Write view has no published mapping
98
+ * from a source offset back to a ProseMirror position and anchors on the
99
+ * finding's own text instead — see `decorations.ts`.
100
+ */
101
+
102
+ interface ReviewState extends ReviewSnapshot {
103
+ /** Run every provider now, skipping the debounce. */
104
+ reviewNow: () => void;
105
+ /** Remove a finding from view without re-running anything. */
106
+ dismissFinding: (findingId: string) => void;
107
+ /** Move the caret to a finding, switching views when it can only be shown there. */
108
+ goToFinding: (findingId: string) => void;
109
+ }
110
+ declare function useReview(capabilities?: readonly ReviewCapability[]): ReviewState | null;
111
+
112
+ /**
113
+ * Review state distribution.
114
+ *
115
+ * `ReviewRoot` sits INSIDE `EditorProvider` and wraps the shell body, the same
116
+ * shape as `ProofingRoot`: children pass through with stable identity, so a
117
+ * review pass re-renders only review consumers and never the editors
118
+ * themselves. A pass can take seconds, and re-rendering an editor on each one
119
+ * would be felt.
120
+ */
121
+
122
+ /** Review state, or `null` when the host injected no providers. */
123
+ declare function useReviewState(): ReviewState | null;
124
+ declare function ReviewRoot({ providers, children, }: {
125
+ providers?: readonly ReviewCapability[];
126
+ children: ReactNode;
127
+ }): ReactElement;
128
+
129
+ /**
130
+ * Docked review pane — a right-side flex sibling of the editor, listing every
131
+ * provider's findings grouped by provider.
132
+ *
133
+ * Grouped rather than merged into one document-ordered list, because the
134
+ * providers are answering different questions. A spelling mistake and "this
135
+ * section buries its point" interleaved by position reads as noise; under their
136
+ * own headings each list is scannable.
137
+ */
138
+
139
+ declare function ReviewPanel(): ReactElement | null;
140
+
141
+ /**
142
+ * Turn a markdown source into the blocks a review provider receives.
143
+ *
144
+ * A block here is what the editor's own navigation calls one: a
145
+ * heading-delimited section, not a paragraph. That is the better review unit
146
+ * anyway — "does this section make its case?" is a question worth asking, and
147
+ * a provider that wants finer grain can split the text it was given.
148
+ *
149
+ * Two things happen that a provider should not have to redo. Machine
150
+ * vocabulary is masked — `{[…]}` annotations and code, which a reviewer would
151
+ * otherwise "fix" — using the same equal-length blanking proofing uses, so
152
+ * every offset still indexes the real source. And each block carries its
153
+ * heading, because the same paragraph reads differently under a different one.
154
+ */
155
+
156
+ interface BuildReviewRequestOptions {
157
+ source: string;
158
+ documentRef: ReviewDocumentRef;
159
+ /** Blocks whose text differs from the previous pass, when known. */
160
+ changedBlockKeys?: readonly number[];
161
+ language?: 'plaintext' | 'markdown';
162
+ }
163
+ declare function buildReviewRequest(options: BuildReviewRequestOptions): ReviewRequest;
164
+ /** Which blocks changed between two passes, by text identity. */
165
+ declare function changedBlockKeys(previous: readonly ReviewBlockInput[], next: readonly ReviewBlockInput[]): number[];
166
+
167
+ /**
168
+ * Where a review finding is drawn, in each surface.
169
+ *
170
+ * The two surfaces differ in a way that matters. A review finding's offsets
171
+ * index the markdown **source**, which is exactly what Monaco shows — so the
172
+ * Source view is a direct mapping. The Write view renders a ProseMirror
173
+ * document whose text differs from the source (frontmatter is stripped, prose
174
+ * may be rewrapped, markup is marks rather than characters), and there is no
175
+ * published mapping from a source offset back to a ProseMirror position.
176
+ *
177
+ * So the Write view anchors on the finding's own text instead, and only when
178
+ * that text appears exactly once. Anchoring on an ambiguous match would put a
179
+ * mark on a different paragraph than the one reviewed, which is worse than
180
+ * drawing nothing: the panel still lists the finding, and the host can offer
181
+ * Source view to act on it.
182
+ */
183
+
184
+ /** One squiggle to draw in the Write view, in absolute ProseMirror positions. */
185
+ interface ReviewDecorationSpec {
186
+ findingId: string;
187
+ source: string;
188
+ hue: ReviewHue;
189
+ from: number;
190
+ to: number;
191
+ }
192
+ /** The class pair every review mark carries. */
193
+ declare function reviewUnderlineClass(hue: ReviewHue): string;
194
+ /**
195
+ * Locate a finding in a ProseMirror document by its own text.
196
+ *
197
+ * Returns null when the text is absent or appears more than once. Ambiguity is
198
+ * treated as absence deliberately — see the module note.
199
+ */
200
+ declare function findUniqueTextRange(doc: Node, text: string): {
201
+ from: number;
202
+ to: number;
203
+ } | null;
204
+ /** Write-view decorations for the findings whose text can be located exactly. */
205
+ declare function buildWriteViewDecorations(doc: Node, findings: readonly ReviewFinding[], hueFor: (source: string) => ReviewHue): ReviewDecorationSpec[];
206
+ /**
207
+ * Source-view decorations. Offsets map straight through, because the finding
208
+ * and the model index the same string.
209
+ */
210
+ declare function buildSourceViewDecorations(model: editor.ITextModel, findings: readonly ReviewFinding[], hueFor: (source: string) => ReviewHue): editor.IModelDeltaDecoration[];
211
+ /** The hover card body for one finding. */
212
+ declare function reviewHoverMarkdown(finding: ReviewFinding): string;
213
+
214
+ /**
215
+ * Review marks for the Write view.
216
+ *
217
+ * A sibling of `proofing/ProofingExtension.ts`, and it inherits that file's
218
+ * load-bearing decision: on an ordinary document change the current
219
+ * `DecorationSet` is MAPPED through the transaction rather than rebuilt. A
220
+ * review pass can take seconds, so without mapping every mark would sit on
221
+ * stale text for the whole of it. Every consumer resolves positions from the
222
+ * live decorations, never from the offsets a pass reported.
223
+ *
224
+ * It registers its own plugin key, so review marks and proofing squiggles
225
+ * coexist rather than one replacing the other.
226
+ */
227
+
228
+ /** Write-view review marks. Registered unconditionally; inert until fed. */
229
+ declare const ReviewExtension: Extension<any, any>;
230
+ /** Replace the Write view's review marks with a fresh pass's results. */
231
+ declare function updateReviewDecorations(editor: Editor, specs: readonly ReviewDecorationSpec[]): void;
232
+ /** Clear every review mark. */
233
+ declare function clearReviewDecorations(editor: Editor): void;
234
+ interface ResolvedReviewDecoration {
235
+ findingId: string;
236
+ source: string;
237
+ hue: ReviewHue;
238
+ from: number;
239
+ to: number;
240
+ }
241
+ /** The review mark at a position, at its current mapped range. */
242
+ declare function reviewDecorationAt(state: EditorState, pos: number): ResolvedReviewDecoration | null;
243
+ /**
244
+ * The review mark for a finding id, at its current mapped range.
245
+ *
246
+ * This is what makes applying a suggestion safe after the user has typed: the
247
+ * range comes from the live decoration, so the edit lands where the text moved
248
+ * to rather than where it was when the pass ran.
249
+ */
250
+ declare function reviewDecorationById(state: EditorState, findingId: string): ResolvedReviewDecoration | null;
251
+
252
+ /**
253
+ * Run a proofing engine as a review provider.
254
+ *
255
+ * This is what keeps there from being two pipelines. Proofing predates review
256
+ * and has the narrower contract — one flat string in, a whole array out, no
257
+ * cancellation — so the adapter owns the difference: it joins the blocks the
258
+ * way proofing's own orchestration does, lints once, and maps each finding back
259
+ * to the block it came from.
260
+ *
261
+ * Linting the joined text rather than block by block is deliberate. A grammar
262
+ * engine reads across a paragraph boundary, and a per-block call would lose
263
+ * every finding that spans one.
264
+ */
265
+
266
+ interface ProofingReviewAdapterOptions {
267
+ /** Namespace for the findings. Defaults to `harper`. */
268
+ id?: string;
269
+ label?: string;
270
+ hue?: ReviewHue;
271
+ /** Proofing is cheap enough to re-run shortly after a keystroke. */
272
+ debounceMs?: number;
273
+ }
274
+ /** The idle delay proofing has always used. */
275
+ declare const PROOFING_DEBOUNCE_MS = 450;
276
+ /**
277
+ * Adapt a {@link ProofingProvider} to the review contract.
278
+ *
279
+ * The adapter does not own the provider's lifetime: a host that passed an
280
+ * instance keeps its warm engine across shell remounts, exactly as before.
281
+ * Only a provider the adapter constructed is disposed by it.
282
+ */
283
+ declare function createProofingReviewProvider(provider: ProofingProvider, options?: ProofingReviewAdapterOptions): ReviewProvider;
284
+
285
+ export { PROOFING_DEBOUNCE_MS, type ProofingReviewAdapterOptions, type ResolvedReviewDecoration, ReviewCapability, type ReviewDecorationSpec, ReviewExtension, ReviewHue, ReviewPanel, ReviewProvider, type ReviewProviderStatus, ReviewRoot, ReviewRunner, type ReviewSnapshot, type ReviewState, buildReviewRequest, buildSourceViewDecorations, buildWriteViewDecorations, changedBlockKeys, clearReviewDecorations, createProofingReviewProvider, findUniqueTextRange, reviewDecorationAt, reviewDecorationById, reviewHoverMarkdown, reviewUnderlineClass, updateReviewDecorations, useReview, useReviewState };
@@ -0,0 +1,103 @@
1
+ import {
2
+ DEFAULT_REVIEW_DEBOUNCE_MS,
3
+ DEFAULT_REVIEW_HUE,
4
+ ReviewExtension,
5
+ ReviewPanel,
6
+ ReviewRoot,
7
+ ReviewRunner,
8
+ buildReviewRequest,
9
+ buildSourceViewDecorations,
10
+ buildWriteViewDecorations,
11
+ changedBlockKeys,
12
+ clearReviewDecorations,
13
+ findUniqueTextRange,
14
+ resolveReviewProvider,
15
+ reviewDecorationAt,
16
+ reviewDecorationById,
17
+ reviewHoverMarkdown,
18
+ reviewUnderlineClass,
19
+ updateReviewDecorations,
20
+ useReview,
21
+ useReviewState
22
+ } from "../chunk-DUO5XZQK.js";
23
+ import "../chunk-ES6CPRCW.js";
24
+
25
+ // src/review/proofingAdapter.ts
26
+ import {
27
+ buildJoinedText,
28
+ mapJoinedSpanToSegment
29
+ } from "@bendyline/squisq/proof";
30
+ import { PROOFING_REVIEW_SOURCE, proofFindingToReviewFinding } from "@bendyline/squisq/review";
31
+ var PROOFING_DEBOUNCE_MS = 450;
32
+ function createProofingReviewProvider(provider, options = {}) {
33
+ const id = options.id ?? PROOFING_REVIEW_SOURCE;
34
+ return {
35
+ id,
36
+ label: options.label ?? "Spelling and grammar",
37
+ hue: options.hue ?? "spelling",
38
+ debounceMs: options.debounceMs ?? PROOFING_DEBOUNCE_MS,
39
+ setup: () => provider.setup(),
40
+ review: (request, signal) => reviewWithProofing(provider, id, request, signal),
41
+ dismissFinding: (findingId) => provider.ignoreFinding(findingId)
42
+ };
43
+ }
44
+ async function* reviewWithProofing(provider, id, request, signal) {
45
+ if (request.blocks.length === 0) {
46
+ yield { type: "done" };
47
+ return;
48
+ }
49
+ if (signal.aborted) return;
50
+ const joined = buildJoinedText(request.blocks.map((block) => block.text));
51
+ let findings;
52
+ try {
53
+ findings = await provider.lint(joined.text, { language: request.language ?? "plaintext" });
54
+ } catch (error) {
55
+ yield { type: "error", message: error instanceof Error ? error.message : String(error) };
56
+ return;
57
+ }
58
+ if (signal.aborted) return;
59
+ const mapped = [];
60
+ for (const finding of findings) {
61
+ const span = mapJoinedSpanToSegment(joined, finding.start, finding.end);
62
+ if (!span) continue;
63
+ const block = request.blocks[span.segmentIndex];
64
+ if (!block) continue;
65
+ mapped.push(
66
+ proofFindingToReviewFinding(
67
+ { ...finding, start: span.start, end: span.end },
68
+ { source: id, offset: block.offset, blockKey: block.key }
69
+ )
70
+ );
71
+ }
72
+ yield { type: "findings", findings: mapped };
73
+ yield { type: "done" };
74
+ }
75
+
76
+ // src/review/index.ts
77
+ import { PROOFING_REVIEW_SOURCE as PROOFING_REVIEW_SOURCE2, proofFindingToReviewFinding as proofFindingToReviewFinding2 } from "@bendyline/squisq/review";
78
+ export {
79
+ DEFAULT_REVIEW_DEBOUNCE_MS,
80
+ DEFAULT_REVIEW_HUE,
81
+ PROOFING_DEBOUNCE_MS,
82
+ PROOFING_REVIEW_SOURCE2 as PROOFING_REVIEW_SOURCE,
83
+ ReviewExtension,
84
+ ReviewPanel,
85
+ ReviewRoot,
86
+ ReviewRunner,
87
+ buildReviewRequest,
88
+ buildSourceViewDecorations,
89
+ buildWriteViewDecorations,
90
+ changedBlockKeys,
91
+ clearReviewDecorations,
92
+ createProofingReviewProvider,
93
+ findUniqueTextRange,
94
+ proofFindingToReviewFinding2 as proofFindingToReviewFinding,
95
+ resolveReviewProvider,
96
+ reviewDecorationAt,
97
+ reviewDecorationById,
98
+ reviewHoverMarkdown,
99
+ reviewUnderlineClass,
100
+ updateReviewDecorations,
101
+ useReview,
102
+ useReviewState
103
+ };
@@ -1,4 +1,4 @@
1
- export { B as BlockTagVisibility, e as DocumentLinkCandidate, f as DocumentLinkProvider, g as EditorActions, h as EditorColorScheme, i as EditorContextMenuContext, j as EditorContextMenuItem, k as EditorContextMenuItemVisibility, l as EditorContextMenuProvider, m as EditorContextMenuProviderProps, n as EditorContextValue, E as EditorHostMode, o as EditorMode, p as EditorProvider, q as EditorProviderProps, r as EditorShell, s as EditorShellProps, t as EditorState, u as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, x as MentionProvider, P as PreviewPanel, y as PreviewPanelProps, R as RawEditor, z as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, A as WysiwygEditor, G as WysiwygEditorProps, O as useEditorContext, Q as useEditorContextMenuItems } from '../shell-CJkHDwpz.js';
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-Dwf_W4K4.js';
2
2
  import 'react/jsx-runtime';
3
3
  import '@bendyline/squisq/table';
4
4
  import '@bendyline/squisq-calc';
@@ -10,8 +10,10 @@ import '@bendyline/squisq/fence';
10
10
  import '@bendyline/squisq-react';
11
11
  import '@bendyline/squisq/markdown';
12
12
  import '@bendyline/squisq/storage';
13
- import '../types-B_aHRuSc.js';
13
+ import '../types-De4z-gGb.js';
14
14
  import '@bendyline/squisq/proof';
15
15
  import '@bendyline/squisq/versions';
16
16
  import '@tiptap/core';
17
17
  import 'monaco-editor';
18
+ import '../types-C0puuw-M.js';
19
+ import '@bendyline/squisq/review';
@@ -1,13 +1,15 @@
1
1
  import {
2
2
  EditorContextMenuProvider,
3
- EditorProvider,
4
3
  EditorShell,
5
4
  PreviewPanel,
6
5
  RawEditor,
7
6
  WysiwygEditor,
8
- useEditorContext,
9
7
  useEditorContextMenuItems
10
- } from "../chunk-CDISORBP.js";
8
+ } from "../chunk-WMNH5ROU.js";
9
+ import {
10
+ EditorProvider,
11
+ useEditorContext
12
+ } from "../chunk-DUO5XZQK.js";
11
13
  import "../chunk-V4NBQF5C.js";
12
14
  import "../chunk-ES6CPRCW.js";
13
15
  import "../chunk-V44VP242.js";