@bendyline/squisq-editor-react 2.3.4 → 2.4.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.
@@ -0,0 +1,62 @@
1
+ // src/monacoLanguageDetection.ts
2
+ var LANGUAGE_ALIASES = {
3
+ bash: "shell",
4
+ c: "cpp",
5
+ "c++": "cpp",
6
+ "c#": "csharp",
7
+ cs: "csharp",
8
+ cxx: "cpp",
9
+ docker: "dockerfile",
10
+ htm: "html",
11
+ js: "javascript",
12
+ jsx: "javascript",
13
+ md: "markdown",
14
+ mdown: "markdown",
15
+ py: "python",
16
+ rb: "ruby",
17
+ sh: "shell",
18
+ text: "plaintext",
19
+ txt: "plaintext",
20
+ ts: "typescript",
21
+ tsx: "typescript",
22
+ yml: "yaml",
23
+ zsh: "shell"
24
+ };
25
+ function normalizeMonacoLanguage(language) {
26
+ const normalized = language.trim().toLowerCase();
27
+ return LANGUAGE_ALIASES[normalized] ?? normalized;
28
+ }
29
+ function normalizedMonacoLanguageRequests(requested) {
30
+ const values = typeof requested === "string" ? [requested] : requested ?? [];
31
+ return [...new Set(values.map(normalizeMonacoLanguage).filter(Boolean))].sort();
32
+ }
33
+ function monacoLanguageRequestKey(requested, options = {}) {
34
+ return `${options.languageServices ? "services" : "syntax"}:${normalizedMonacoLanguageRequests(requested).join(",")}`;
35
+ }
36
+ function monacoLanguagesForDocument(primaryLanguage, source) {
37
+ const primary = normalizeMonacoLanguage(primaryLanguage);
38
+ const requested = new Set(primary ? [primary] : []);
39
+ if (primary !== "markdown") return [...requested];
40
+ let openFence = null;
41
+ for (const line of source.split(/\r?\n/)) {
42
+ const match = line.match(/^ {0,3}(`{3,}|~{3,})[ \t]*([^\s`~]+)?/);
43
+ if (!match) continue;
44
+ const fence = match[1];
45
+ const marker = fence[0];
46
+ if (openFence) {
47
+ if (marker === openFence.marker && fence.length >= openFence.length) openFence = null;
48
+ continue;
49
+ }
50
+ openFence = { marker, length: fence.length };
51
+ const language = match[2];
52
+ if (language) requested.add(normalizeMonacoLanguage(language));
53
+ }
54
+ return [...requested];
55
+ }
56
+
57
+ export {
58
+ normalizeMonacoLanguage,
59
+ normalizedMonacoLanguageRequests,
60
+ monacoLanguageRequestKey,
61
+ monacoLanguagesForDocument
62
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RecorderModal
3
- } from "./chunk-MJJK7YQB.js";
3
+ } from "./chunk-F4NBECWR.js";
4
4
 
5
5
  // src/recorder/RecorderButton.tsx
6
6
  import { useCallback, useState } from "react";
package/dist/index.d.ts CHANGED
@@ -1,13 +1,16 @@
1
- import { C as CodeContext, S as SceneTextChannel } from './shell-C-KkTBz7.js';
2
- export { B as BlockTagVisibility, a as CodeContextSection, D as DocumentLinkCandidate, b as DocumentLinkProvider, E as EditorActions, c as EditorColorScheme, d as EditorContextValue, e as EditorMode, f as EditorProvider, g as EditorProviderProps, h as EditorShell, i as EditorShellProps, j as EditorState, k as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, l as MentionProvider, P as PreviewPanel, m as PreviewPanelProps, R as RawEditor, n as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, W as WriteCanvasSettings, o as WysiwygEditor, p as WysiwygEditorProps, u as useEditorContext } from './shell-C-KkTBz7.js';
1
+ import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel } from './shell-9Kxzxjbn.js';
2
+ export { B as BlockTagVisibility, a as CodeContextSection, D as DocumentLinkCandidate, b as DocumentLinkProvider, c as EditorActions, d as EditorColorScheme, e as EditorContextValue, f as EditorMode, g as EditorProvider, h as EditorProviderProps, i as EditorShell, j as EditorShellProps, k as EditorState, l as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, m as MentionProvider, P as PreviewPanel, n as PreviewPanelProps, R as RawEditor, o as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, W as WriteCanvasSettings, p as WysiwygEditor, q as WysiwygEditorProps, u as useEditorContext } from './shell-9Kxzxjbn.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, CSSProperties } from 'react';
6
+ import { ScheduledClip, Doc, MediaProvider, Theme, CustomTemplateDefinition, ThemeSeedColors, ViewportPreset, ViewportConfig, Block, MediaEntry, DiagramEdgeAnchor } from '@bendyline/squisq/schemas';
7
+ import { ContentContainer } from '@bendyline/squisq/storage';
6
8
  export { CanvasRect, ImageEditor, ImageEditorAction, ImageEditorProps, ImageEditorState, ImageEditorTool, ImageViewer, ImageViewerProps, UseImageEditorOptions, UseImageEditorReturn, imageEditorReducer, initialImageEditorState, useImageEditor } from './image-editor/index.js';
7
- import { MediaProvider, Theme, CustomTemplateDefinition, ThemeSeedColors, ViewportPreset, ViewportConfig, Doc, Block, MediaEntry, DiagramEdgeAnchor } from '@bendyline/squisq/schemas';
8
9
  import { IconFamily } from '@bendyline/squisq/icons';
9
- import { DisplayMode, CaptionStyle } from '@bendyline/squisq-react';
10
+ import { DisplayMode, CaptionStyle, VideoPresentation, PipShape, PipPosition } from '@bendyline/squisq-react';
11
+ import { MarkdownWrapState } from '@bendyline/squisq/markdown';
10
12
  import * as monaco_editor from 'monaco-editor';
13
+ import { M as MonacoLanguageRequest, a as MonacoLanguageLoadOptions } from './monacoLanguageDetection-DEyUW-BS.js';
11
14
  export { MonacoWorkerConstructor, MonacoWorkerConstructors, configureMonacoWorkers } from './monaco-workers/index.js';
12
15
  import { ConnectorRouting, AsciiDiagram, Tree, AsciiTimeline, AsciiTimelineSide, AsciiTimelineMarker } from '@bendyline/squisq/doc';
13
16
  import * as _tiptap_core from '@tiptap/core';
@@ -21,8 +24,6 @@ import { RenderResult } from 'mermaid';
21
24
  export { JsonEditor, JsonEditorProps } from './json-editor/index.js';
22
25
  export { CameraStreamOptions, CaptureKind, RecordedBookmark, RecorderButton, RecorderButtonProps, RecorderColorScheme, RecorderModal, RecorderModalProps, RecorderPanel, RecorderPanelProps, RecorderSaveResult, RecorderSource, RecorderState, ResolvedFormat, ScreenStreamHandle, ScreenStreamOptions, TimingJson, UseMediaRecorderOptions, UseMediaRecorderResult, buildFilename, buildTimingJson, encodeTimingJson, getCaptureKind, requestCameraStream, requestMicStream, requestScreenStream, resolveFormat, supportsDisplayMedia, supportsMediaRecorder, supportsUserMedia, timingPathFor, useMediaRecorder, useStreamPreview } from './recorder/index.js';
23
26
  export { CanvasSink, DEFAULT_TELEPROMPTER_PREFS, EYE_LINE_FRACTION, FloatOpenOptions, FloatTier, FloatingWindowHandle, FloatingWindowManager, MicAnalysisHandle, MicAnalysisStatus, NarrationRecorderController, NarrationRecorderState, NarrationSavePlan, NarrationSaveResult, NarrationTake, PCM_WORKLET_NAME, PCM_WORKLET_SOURCE, PrompterTransport, TELEPROMPTER_CSS, TeleprompterController, TeleprompterControls, TeleprompterControlsProps, TeleprompterPrefs, TeleprompterRecordingDeps, TeleprompterSurface, TeleprompterSurfaceProps, TeleprompterView, TeleprompterViewProps, TokenLineMap, buildNarrationSavePlan, cameraVideoLine, createFloatingWindowManager, detectFloatTiers, ensureTeleprompterStyles, executeNarrationSave, insertNarrationPreamble, measureTokenLines, narrationAnnotationLine, prompterVarsFromTheme, registerPcmWorklet, stepScroll, targetOffsetFor, useFloatingWindow, useMicAnalysis, useNarrationRecorder, useTeleprompter, vadConfigForSensitivity } from './teleprompter/index.js';
24
- import '@bendyline/squisq/markdown';
25
- import '@bendyline/squisq/storage';
26
27
  import '@bendyline/squisq/versions';
27
28
  import '@bendyline/squisq/imageEdit';
28
29
  import '@bendyline/squisq/jsonForm';
@@ -138,6 +139,12 @@ interface UseBlockNavigatorOptions {
138
139
  declare function useBlockNavigator(source: string, setSource: (s: string) => void, opts?: UseBlockNavigatorOptions): BlockNavigator;
139
140
 
140
141
  interface BlockCardViewProps {
142
+ /**
143
+ * Whether to show the block-card chrome. Defaults to true. When false the
144
+ * stable frame remains mounted around `children`, allowing hosts to switch
145
+ * between document and card layouts without remounting the editor surface.
146
+ */
147
+ active?: boolean;
141
148
  /** Total number of navigable blocks. */
142
149
  blockCount: number;
143
150
  /** Index of the block currently shown (0-based). */
@@ -153,7 +160,7 @@ interface BlockCardViewProps {
153
160
  /** Optional extra class for the outer container. */
154
161
  className?: string;
155
162
  }
156
- declare function BlockCardView({ blockCount, activeBlockKey, onPrev, onNext, onAdd, children, className, }: BlockCardViewProps): react_jsx_runtime.JSX.Element;
163
+ declare function BlockCardView({ active, blockCount, activeBlockKey, onPrev, onNext, onAdd, children, className, }: BlockCardViewProps): react_jsx_runtime.JSX.Element;
157
164
 
158
165
  /**
159
166
  * blockRange
@@ -206,21 +213,65 @@ declare function offsetToLine(source: string, offset: number): number;
206
213
  declare function sliceIndexAtOffset(slices: BlockSlice[], offset: number): number;
207
214
 
208
215
  /**
209
- * TimelineTrack
216
+ * useTimelineClock
210
217
  *
211
- * Horizontal timeline strip for the Timeline view. Shows every block as a bar
212
- * (width duration, x startTime) with its media clips as sub-bars below.
213
- * Clicking a block selects it (the editor above follows). Dragging a block's
214
- * right edge changes its duration; dragging its left edge changes the previous
215
- * block's duration (the boundary, since startTime is derived). Dragging a media
216
- * clip moves its `startAt`; dragging the clip's right edge changes its length;
217
- * double-clicking a clip toggles `spillover`. All edits are written back to the
218
- * markdown source via {@link timelineSource}.
218
+ * A minimal real-time playback clock for the timeline view a
219
+ * `requestAnimationFrame` loop that advances `currentTime` at wall-clock speed
220
+ * between `play()` and `pause()`, clamped to `[0, total]`. No audio element;
221
+ * media playback is driven separately (the timeline feeds `currentTime` to
222
+ * `MediaClipLayer`). Mirrors the fallback timer in `useAudioSync`.
219
223
  */
224
+ interface TimelineClock {
225
+ /** Seconds from the start of the timeline. */
226
+ currentTime: number;
227
+ isPlaying: boolean;
228
+ /** Start playing; restarts from 0 when already at the end. */
229
+ play: () => void;
230
+ pause: () => void;
231
+ toggle: () => void;
232
+ /** Jump to a time (clamped to `[0, total]`). */
233
+ seek: (t: number) => void;
234
+ }
235
+
220
236
  interface TimelineTrackProps {
221
237
  height?: number;
238
+ /** Optional shared clock used by docked timeline companions. */
239
+ clock?: TimelineClock;
240
+ /** Reuse an already-resolved schedule instead of deriving it from the doc. */
241
+ schedule?: ScheduledClip[];
242
+ /** Whether the docked video monitor is currently visible. */
243
+ videoVisible?: boolean;
244
+ }
245
+ declare function TimelineTrack({ height, clock, schedule, videoVisible, }: TimelineTrackProps): react_jsx_runtime.JSX.Element | null;
246
+
247
+ interface TimelineVideoPanelProps {
248
+ schedule: ScheduledClip[];
249
+ currentTime: number;
250
+ isPlaying: boolean;
251
+ basePath?: string;
252
+ onClose?: () => void;
253
+ }
254
+ declare function TimelineVideoPanel({ schedule, currentTime, isPlaying, basePath, onClose, }: TimelineVideoPanelProps): react_jsx_runtime.JSX.Element;
255
+
256
+ interface TimelineCompositionPanelProps {
257
+ doc: Doc | null;
258
+ clock: TimelineClock;
259
+ basePath?: string;
260
+ workspaceContainer?: ContentContainer | null;
261
+ onClose?: () => void;
262
+ }
263
+ declare function TimelineCompositionPanel({ doc, clock, basePath, workspaceContainer, onClose, }: TimelineCompositionPanelProps): react_jsx_runtime.JSX.Element;
264
+
265
+ /** Horizontal controls for Timeline-only companion panes. */
266
+ interface TimelineToolbarProps {
267
+ literalVideoVisible: boolean;
268
+ compositionVisible: boolean;
269
+ videoAvailable: boolean;
270
+ compositionAvailable: boolean;
271
+ onToggleLiteralVideo: () => void;
272
+ onToggleComposition: () => void;
222
273
  }
223
- declare function TimelineTrack({ height }: TimelineTrackProps): react_jsx_runtime.JSX.Element | null;
274
+ declare function TimelineToolbar({ literalVideoVisible, compositionVisible, videoAvailable, compositionAvailable, onToggleLiteralVideo, onToggleComposition, }: TimelineToolbarProps): react_jsx_runtime.JSX.Element;
224
275
 
225
276
  /**
226
277
  * timelineSource
@@ -670,10 +721,22 @@ interface PreviewSettings {
670
721
  * that style. The single entry point so the toggle buttons persist in one
671
722
  * frontmatter write. */
672
723
  setCaptionMode: (mode: CaptionMode) => void;
724
+ /** Whether the current document schedules any video media. */
725
+ hasVideoMedia: boolean;
726
+ activeVideoPresentation: VideoPresentation;
727
+ setVideoPresentation: (presentation: VideoPresentation) => void;
728
+ activePipShape: PipShape;
729
+ setPipShape: (shape: PipShape) => void;
730
+ activePipPosition: PipPosition;
731
+ setPipPosition: (position: PipPosition) => void;
673
732
  /** Whether Squisq should synthesize and show its managed cover slide. */
674
733
  activeCoverSlide: boolean;
675
734
  /** Enable/disable the managed cover slide. */
676
735
  setCoverSlideEnabled: (enabled: boolean) => void;
736
+ /** Whether Video mode restarts automatically when playback ends. */
737
+ activeVideoLoop: boolean;
738
+ /** Enable/disable automatic Video-mode playback restart. */
739
+ setVideoLoopEnabled: (enabled: boolean) => void;
677
740
  /** User-authored themes (doc + browser library) for the picker's "Custom" group. */
678
741
  customThemes: Theme[];
679
742
  /** Open the custom-theme designer for a theme (or null to create a new one). */
@@ -702,6 +765,12 @@ declare function usePreviewSettings(): PreviewSettings;
702
765
  interface PreviewSettingsProviderProps {
703
766
  doc: Doc | null;
704
767
  children: ReactNode;
768
+ /**
769
+ * Viewport preset to use when the document does not declare
770
+ * `document-render-as` and the user has not selected a format. Hosts can
771
+ * make this responsive to their available surface. Defaults to landscape.
772
+ */
773
+ defaultViewportPreset?: ViewportPreset;
705
774
  /**
706
775
  * Optional Theme to use for the preview, regardless of `Doc.themeId` or
707
776
  * the user's theme dropdown selection. Used by the theme customizer to
@@ -710,7 +779,7 @@ interface PreviewSettingsProviderProps {
710
779
  */
711
780
  themeOverride?: Theme | null;
712
781
  }
713
- declare function PreviewSettingsProvider({ doc, children, themeOverride, }: PreviewSettingsProviderProps): react_jsx_runtime.JSX.Element;
782
+ declare function PreviewSettingsProvider({ doc, children, defaultViewportPreset, themeOverride, }: PreviewSettingsProviderProps): react_jsx_runtime.JSX.Element;
714
783
  /**
715
784
  * Inline preview controls rendered in the main toolbar row.
716
785
  *
@@ -786,13 +855,19 @@ interface ToolbarProps {
786
855
  * editing free-form prompts — can pass false to suppress it.
787
856
  */
788
857
  showPlayTab?: boolean;
858
+ /**
859
+ * Semantic embedding mode inherited from EditorShell. Chat mode exposes
860
+ * only the Write surface, which suppresses the view tabs and their
861
+ * keyboard-switch targets. Defaults to `'document'`.
862
+ */
863
+ hostMode?: EditorHostMode;
789
864
  }
790
865
  /**
791
866
  * Formatting toolbar.
792
867
  * - WYSIWYG: calls Tiptap chain commands (toggleBold, etc.)
793
868
  * - Raw: appends markdown syntax to the source
794
869
  */
795
- declare function Toolbar({ className, showFiles, fileCount, onToggleFiles, slotLeft, slotAfterTabs, slotAfterActions, slotRight, showPlayTab, }: ToolbarProps): react_jsx_runtime.JSX.Element;
870
+ declare function Toolbar({ className, showFiles, fileCount, onToggleFiles, slotLeft, slotAfterTabs, slotAfterActions, slotRight, showPlayTab, hostMode, }: ToolbarProps): react_jsx_runtime.JSX.Element;
796
871
 
797
872
  /**
798
873
  * VersionHistoryPanel
@@ -821,6 +896,63 @@ declare function VersionHistoryPanel(): react_jsx_runtime.JSX.Element | null;
821
896
  */
822
897
  declare function ViewMenuPanel(): react_jsx_runtime.JSX.Element;
823
898
 
899
+ /**
900
+ * TransformMenu
901
+ *
902
+ * Toolbar popover applying one-time, undoable markdown source transforms
903
+ * (unwrap / wrap-at-width / cleanup) from core's
904
+ * `MARKDOWN_SOURCE_TRANSFORMS` registry, plus a readout of the document's
905
+ * detected wrap convention (`detectMarkdownWrapState`).
906
+ *
907
+ * Apply paths keep the operation a single undo step:
908
+ * - Source view: minimal per-paragraph `executeEdits` on the Monaco model
909
+ * between undo stops — native byte-exact undo, cursor/scroll stay put.
910
+ * - Write view: one `setMarkdownSource` write; the WYSIWYG external-sync
911
+ * `setContent` lands as one Tiptap history entry.
912
+ * - Use view has no editing surface (no undo), so rows are disabled there.
913
+ */
914
+ declare function TransformMenu(): react_jsx_runtime.JSX.Element | null;
915
+
916
+ /**
917
+ * Write-view wrap policy — "unwrap in Write view, persist with wrapping".
918
+ *
919
+ * The Tiptap bridge maps each physical source line to its own paragraph, so
920
+ * a hard-wrapped document renders as choppy one-line paragraphs in Write
921
+ * view — and the first edit serializes that chopped structure back into the
922
+ * source. These helpers make the wrap convention transparent instead:
923
+ * detect the document's prevailing wrap state, hand Tiptap the UNWRAPPED
924
+ * body (prose flows naturally), and re-apply the detected convention when
925
+ * serializing back to markdown. The exact same shape as WysiwygEditor's
926
+ * frontmatter strip/reattach dance, applied to wrapping.
927
+ *
928
+ * Pure string logic (no Tiptap, no DOM) so it stays Node-testable.
929
+ */
930
+
931
+ interface WrapPolicyIngest {
932
+ /** Body to hand to the Write view (unwrapped when the doc is wrapped). */
933
+ displayBody: string;
934
+ /**
935
+ * The detected wrap state to persist with, or null when the document has
936
+ * no confident wrap convention (unwrapped / mixed / no prose) — persist
937
+ * is then a pass-through.
938
+ */
939
+ state: MarkdownWrapState | null;
940
+ }
941
+ /**
942
+ * Prepare a markdown body (frontmatter already stripped) for Write-view
943
+ * editing. Only a confident `wrapped` detection unwraps; `mixed`,
944
+ * `unwrapped`, and `no-prose` documents pass through untouched, so docs
945
+ * without a convention behave exactly as before.
946
+ */
947
+ declare function ingestForWrite(body: string): WrapPolicyIngest;
948
+ /**
949
+ * Re-apply the detected wrap convention to a body serialized from the
950
+ * Write view. Pass-through when there is no wrapped state; on a degraded
951
+ * wrap (safety guard) the unwrapped body is persisted instead — a valid
952
+ * document that merely loses the convention for that save.
953
+ */
954
+ declare function persistFromWrite(bodyMd: string, state: MarkdownWrapState | null): string;
955
+
824
956
  interface OutlinePanelProps {
825
957
  /**
826
958
  * Fixed width of the pane in pixels. When omitted, the pane sizes
@@ -1139,8 +1271,15 @@ interface MediaBinProps {
1139
1271
  onMediaRemoved?: (relativePath: string, entry: MediaEntry) => void | Promise<void>;
1140
1272
  /** Fired whenever the panel scans media and knows the current entry count. */
1141
1273
  onCountChange?: (count: number) => void;
1274
+ /**
1275
+ * Opens the host's media recorder. When provided, the Files header shows a
1276
+ * compact Record button beside Upload.
1277
+ */
1278
+ onRecord?: () => void;
1279
+ /** Whether the recorder dialog opened by `onRecord` is currently visible. */
1280
+ isRecorderOpen?: boolean;
1142
1281
  }
1143
- declare function MediaBin({ mediaProvider, isDark, refreshKey, usedMediaPaths, onMediaUploaded, onMediaRemoved, onCountChange, }: MediaBinProps): react_jsx_runtime.JSX.Element;
1282
+ declare function MediaBin({ mediaProvider, isDark, refreshKey, usedMediaPaths, onMediaUploaded, onMediaRemoved, onCountChange, onRecord, isRecorderOpen, }: MediaBinProps): react_jsx_runtime.JSX.Element;
1144
1283
 
1145
1284
  interface StatusBarProps {
1146
1285
  /** Additional class name */
@@ -1271,38 +1410,18 @@ declare function processTextFile(file: File): Promise<string>;
1271
1410
  */
1272
1411
  declare function processTextFiles(files: File[]): Promise<string>;
1273
1412
 
1274
- /**
1275
- * useMonacoLoader
1276
- *
1277
- * Idempotently dynamic-imports `monaco-editor` and points the
1278
- * `@monaco-editor/react` singleton loader at the bundled copy. Replaces
1279
- * the historical top-of-module `import * as monaco from 'monaco-editor';
1280
- * loader.config({ monaco })` pattern, which forced every consumer of
1281
- * `@bendyline/squisq-editor-react` — including ones that only import
1282
- * `JsonEditor` or a type — to drag in monaco's ~9MB worth of language
1283
- * services and workers at module evaluation time.
1284
- *
1285
- * Hosts that want the smallest possible bundle can keep aliasing
1286
- * `monaco-editor` to a slim entry as before; the behavior is identical
1287
- * once the dynamic import settles.
1288
- *
1289
- * The promise is cached at module scope so the first subscriber
1290
- * anywhere in the app pays the import cost and every later subscriber
1291
- * reuses the same settled value.
1292
- */
1293
1413
  interface UseMonacoLoaderResult {
1294
- /** The monaco namespace once loaded, or `null` while the import is in flight. */
1414
+ /** The Monaco namespace once loaded, or `null` while the core is in flight. */
1295
1415
  monaco: typeof monaco_editor | null;
1296
- /** Flips to `true` after the import settles. Gate `<Editor>` / `<DiffEditor>` renders on this. */
1416
+ /** True after the compact core and this caller's language profile are ready. */
1297
1417
  ready: boolean;
1298
1418
  }
1299
- /**
1300
- * Subscribe to the lazy-loaded monaco namespace. The first caller
1301
- * triggers `import('monaco-editor')` and configures the
1302
- * `@monaco-editor/react` loader; subsequent callers receive the same
1303
- * cached value.
1304
- */
1305
- declare function useMonacoLoader(): UseMonacoLoaderResult;
1419
+ /** Start Monaco and the requested language profile before a React editor mounts. */
1420
+ declare function preloadMonaco(requestedLanguages?: MonacoLanguageRequest, options?: MonacoLanguageLoadOptions): Promise<typeof monaco_editor>;
1421
+ /** Load completion and snippet UI after the compact editor is already usable. */
1422
+ declare function preloadMonacoSuggestions(): Promise<void>;
1423
+ /** Subscribe to the shared Monaco namespace and a demand-loaded language profile. */
1424
+ declare function useMonacoLoader(requestedLanguages?: MonacoLanguageRequest, options?: MonacoLanguageLoadOptions): UseMonacoLoaderResult;
1306
1425
 
1307
1426
  interface CustomTemplateContextValue {
1308
1427
  /** Templates inlined into the current doc's frontmatter. */
@@ -2654,4 +2773,4 @@ declare function applyTimelineCommand(editor: Editor, blockId: string, command:
2654
2773
  /** Paste gate for bare, high-confidence Unicode timeline art. */
2655
2774
  declare function shouldPasteAsTimelineFence(text: string): boolean;
2656
2775
 
2657
- 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, CodeContext, CodeContextZones, type CodeSnippetBlockEntry, type CodeSnippetData, CodeSnippetExtension, type CodeSnippetExtensionOptions, type CodeSnippetLanguage, type CodeSnippetPluginState, CodeSnippetWidget, type CodeSnippetWidgetProps, type CustomTemplateContextValue, CustomTemplateProvider, type CustomTemplateProviderProps, type CustomThemeContextValue, CustomThemeProvider, type CustomThemeProviderProps, DEFAULT_MERMAID_DIAGRAM_TYPE, 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, EmojiPicker, type EmojiPickerProps, type FileCategory, type FileKind, type FolderEntry, FolderView, type FolderViewProps, type HeadingTransitionAttrs, HeadingWithTemplate, 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, OutlinePanel, type OutlinePanelProps, PICKER_CATEGORIES, type PickerCategory, type PickerEntry, PlainHtmlPreview, type PlainHtmlPreviewProps, PreviewFormatSwitch, PreviewModeMenu, PreviewModeSwitch, type PreviewSettings, PreviewSettingsProvider, PreviewToolbarControls, REPAIRABLE_KEY, type RepairableBlockEntry, RepairableDiagramExtension, type RepairableDiagramExtensionOptions, type RepairablePluginState, StatusBar, type StatusBarProps, TIMELINE_VIEW_KEY, TRANSITION_ENTRIES, TRANSITION_GROUPS, TemplatePicker, ThemeCustomizerPanel, type ThemeCustomizerPanelProps, ThemePicker, type ThemePickerProps, type ThemeSaveExtras, type TimelineBlockEntry, type TimelineCommand, type TimelineCommandResult, TimelineEditorWidget, type TimelineEditorWidgetProps, type TimelineEventPatch, TimelineTrack, type TimelineTrackProps, type TimelineViewData, TimelineViewExtension, type TimelineViewExtensionOptions, type TimelineViewPluginState, Toolbar, type ToolbarProps, TooltipLayer, 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, addEdgeOp, addItemOp, addNodeOp, addTimelineEventOp, applyAsciiDiagramCommand, applyRepairCommand, applyTimelineCommand, applyTreeCommand, asciiDiagramToCanvas, buildPreviewDoc, classifyFile, codeSnippetFenceLanguageToken, codeSnippetLanguageLabel, codeSnippetMarkdown, detectLanguageFromFileName, draftPatchFromImportedTheme, findAsciiDiagramBlockPos, findCodeSnippetBlockPos, findMermaidDiagramBlockPos, findRepairableBlockPos, findTimelineBlockPos, findTransitionEntry, findTreeBlockPos, formatSeconds, getBlockSlices, getTimelineForNode, indentItemOp, inspectMermaidSource, isAsciiSourceVisible, isCodeSnippetFenceLanguage, isCodeSnippetNode, isMermaidDiagramNode, isMermaidFlowchartShapeId, isMermaidSourceVisible, isRepairableFence, isTimelineSourceSafeForSemanticEdit, lineToOffset, markdownToTiptap, mermaidDiagramMarkdown, mermaidDiagramProperties, mermaidEditCapabilities, mermaidEditableTexts, mermaidErrorMessage, monacoLanguageForFence, moveItemDownOp, moveItemUpOp, moveNodeOp, nextTimelineEventId, normalizeMermaidFlowchartShape, offsetToLine, outdentItemOp, parseTimelineForNode, partitionFiles, processMediaFiles, processTextFile, processTextFiles, readBlockAttrsParams, readBlockAttrsTransition, readBlockAttrsValue, readHeadingLineTransition, removeEdgeOp, removeItemOp, removeNodeOp, removeTimelineEventOp, renameItemOp, renameNodeOp, renderMermaidDiagram, replaceAsciiFenceText, replaceCodeSnippetText, replaceAsciiFenceText as replaceTreeFenceText, resizeNodeOp, resolveFileKind, sanitizeAsciiLabel, sanitizeTimelineText, sanitizeTreeLabel, searchPickerEntries, setBlockAttrsValue, setBlockDurationInSource, setHeadingAttrsTransition, setHeadingLineTransition, setMediaClipInSource, shouldPasteAsAsciiFence, shouldPasteAsTimelineFence, shouldPasteAsTreeFence, sliceIndexAtOffset, spliceBlock, summarizeBlockProps, templateLabel, tiptapToMarkdown, toggleAsciiSource, toggleDirOp, toggleMermaidSource, transitionLabel, translateDiagramOp, updateTimelineEventOp, useAsciiDiagramData, useBlockNavigator, useCodeSnippetData, useCustomTemplates, useCustomThemes, useDocCustomTemplates, useDocCustomThemes, useFileDrop, useMermaidDiagramData, useMonacoLoader, usePreviewSettings, useTimelineData, useTreeViewData };
2776
+ 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, CodeContext, CodeContextZones, type CodeSnippetBlockEntry, type CodeSnippetData, CodeSnippetExtension, type CodeSnippetExtensionOptions, type CodeSnippetLanguage, type CodeSnippetPluginState, CodeSnippetWidget, type CodeSnippetWidgetProps, type CustomTemplateContextValue, CustomTemplateProvider, type CustomTemplateProviderProps, type CustomThemeContextValue, CustomThemeProvider, type CustomThemeProviderProps, DEFAULT_MERMAID_DIAGRAM_TYPE, 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, type FileCategory, type FileKind, type FolderEntry, FolderView, type FolderViewProps, type HeadingTransitionAttrs, HeadingWithTemplate, 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, MonacoLanguageLoadOptions, MonacoLanguageRequest, OutlinePanel, type OutlinePanelProps, PICKER_CATEGORIES, type PickerCategory, type PickerEntry, PlainHtmlPreview, type PlainHtmlPreviewProps, PreviewFormatSwitch, PreviewModeMenu, PreviewModeSwitch, type PreviewSettings, PreviewSettingsProvider, PreviewToolbarControls, REPAIRABLE_KEY, type RepairableBlockEntry, RepairableDiagramExtension, type RepairableDiagramExtensionOptions, type RepairablePluginState, StatusBar, type StatusBarProps, 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, addEdgeOp, addItemOp, addNodeOp, addTimelineEventOp, applyAsciiDiagramCommand, applyRepairCommand, applyTimelineCommand, applyTreeCommand, asciiDiagramToCanvas, buildPreviewDoc, classifyFile, codeSnippetFenceLanguageToken, codeSnippetLanguageLabel, codeSnippetMarkdown, detectLanguageFromFileName, draftPatchFromImportedTheme, findAsciiDiagramBlockPos, findCodeSnippetBlockPos, findMermaidDiagramBlockPos, findRepairableBlockPos, findTimelineBlockPos, findTransitionEntry, findTreeBlockPos, formatSeconds, getBlockSlices, getTimelineForNode, indentItemOp, ingestForWrite, inspectMermaidSource, isAsciiSourceVisible, isCodeSnippetFenceLanguage, isCodeSnippetNode, isMermaidDiagramNode, isMermaidFlowchartShapeId, isMermaidSourceVisible, isRepairableFence, isTimelineSourceSafeForSemanticEdit, lineToOffset, markdownToTiptap, mermaidDiagramMarkdown, mermaidDiagramProperties, mermaidEditCapabilities, mermaidEditableTexts, mermaidErrorMessage, monacoLanguageForFence, moveItemDownOp, moveItemUpOp, moveNodeOp, nextTimelineEventId, normalizeMermaidFlowchartShape, offsetToLine, outdentItemOp, parseTimelineForNode, partitionFiles, persistFromWrite, preloadMonaco, preloadMonacoSuggestions, processMediaFiles, processTextFile, processTextFiles, readBlockAttrsParams, readBlockAttrsTransition, readBlockAttrsValue, readHeadingLineTransition, removeEdgeOp, removeItemOp, removeNodeOp, removeTimelineEventOp, renameItemOp, renameNodeOp, renderMermaidDiagram, replaceAsciiFenceText, replaceCodeSnippetText, replaceAsciiFenceText as replaceTreeFenceText, resizeNodeOp, resolveFileKind, sanitizeAsciiLabel, sanitizeTimelineText, sanitizeTreeLabel, searchPickerEntries, setBlockAttrsValue, setBlockDurationInSource, setHeadingAttrsTransition, setHeadingLineTransition, setMediaClipInSource, shouldPasteAsAsciiFence, shouldPasteAsTimelineFence, shouldPasteAsTreeFence, sliceIndexAtOffset, spliceBlock, summarizeBlockProps, templateLabel, tiptapToMarkdown, toggleAsciiSource, toggleDirOp, toggleMermaidSource, transitionLabel, translateDiagramOp, updateTimelineEventOp, useAsciiDiagramData, useBlockNavigator, useCodeSnippetData, useCustomTemplates, useCustomThemes, useDocCustomTemplates, useDocCustomThemes, useFileDrop, useMermaidDiagramData, useMonacoLoader, usePreviewSettings, useTimelineData, useTreeViewData };
package/dist/index.js CHANGED
@@ -62,11 +62,15 @@ import {
62
62
  TRANSITION_GROUPS,
63
63
  TemplatePicker,
64
64
  ThemePicker,
65
+ TimelineCompositionPanel,
65
66
  TimelineEditorWidget,
67
+ TimelineToolbar,
66
68
  TimelineTrack,
69
+ TimelineVideoPanel,
67
70
  TimelineViewExtension,
68
71
  Toolbar,
69
72
  TooltipLayer,
73
+ TransformMenu,
70
74
  TransitionPicker,
71
75
  TreeOutlineWidget,
72
76
  TreeViewExtension,
@@ -101,6 +105,7 @@ import {
101
105
  getBlockSlices,
102
106
  getTimelineForNode,
103
107
  indentItemOp,
108
+ ingestForWrite,
104
109
  inspectMermaidSource,
105
110
  isAsciiSourceVisible,
106
111
  isCodeSnippetFenceLanguage,
@@ -126,7 +131,10 @@ import {
126
131
  outdentItemOp,
127
132
  parseTimelineForNode,
128
133
  partitionFiles,
134
+ persistFromWrite,
129
135
  platformShortcut,
136
+ preloadMonaco,
137
+ preloadMonacoSuggestions,
130
138
  processMediaFiles,
131
139
  processTextFile,
132
140
  processTextFiles,
@@ -176,20 +184,22 @@ import {
176
184
  useDocCustomTemplates,
177
185
  useDocCustomThemes,
178
186
  useEditorContext,
187
+ useEscapeDismissal,
179
188
  useFileDrop,
180
189
  useMermaidDiagramData,
181
190
  useMonacoLoader,
182
191
  usePreviewSettings,
183
192
  useTimelineData,
184
193
  useTreeViewData
185
- } from "./chunk-GNIVYDZH.js";
194
+ } from "./chunk-UPEGQYF4.js";
195
+ import "./chunk-V4NBQF5C.js";
186
196
  import {
187
197
  JsonEditor
188
- } from "./chunk-54UGTQBO.js";
198
+ } from "./chunk-IIWECJ26.js";
189
199
  import {
190
200
  markdownToTiptap,
191
201
  tiptapToMarkdown
192
- } from "./chunk-NITZVAXL.js";
202
+ } from "./chunk-MM3M2KUV.js";
193
203
  import {
194
204
  ImageEditor,
195
205
  ImageViewer,
@@ -199,14 +209,14 @@ import {
199
209
  } from "./chunk-V44VP242.js";
200
210
  import {
201
211
  RecorderButton
202
- } from "./chunk-6VDYKI3L.js";
212
+ } from "./chunk-VNUGP7NG.js";
203
213
  import {
204
214
  RecorderModal,
205
215
  RecorderPanel,
206
216
  getCaptureKind,
207
217
  requestScreenStream,
208
218
  useMediaRecorder
209
- } from "./chunk-MJJK7YQB.js";
219
+ } from "./chunk-F4NBECWR.js";
210
220
  import "./chunk-GS7QWYFT.js";
211
221
  import {
212
222
  DEFAULT_TELEPROMPTER_PREFS,
@@ -386,6 +396,9 @@ function ThemeCustomizerPanel({
386
396
  const [draft, setDraft] = useState(() => themeToDraft(value));
387
397
  const [popoverPosition, setPopoverPosition] = useState(null);
388
398
  const containerRef = useRef(null);
399
+ const triggerRef = useRef(null);
400
+ const close = useCallback(() => setOpen(false), []);
401
+ useEscapeDismissal(open, close, triggerRef);
389
402
  const externalIdRef = useRef(value?.id ?? null);
390
403
  useEffect(() => {
391
404
  const incomingId = value?.id ?? null;
@@ -476,6 +489,7 @@ function ThemeCustomizerPanel({
476
489
  /* @__PURE__ */ jsx3(
477
490
  "button",
478
491
  {
492
+ ref: triggerRef,
479
493
  type: "button",
480
494
  className: `squisq-toolbar-button squisq-theme-customizer-trigger${triggerLabel ? " squisq-theme-customizer-trigger--label" : ""}${open ? " squisq-toolbar-button--active" : ""}`,
481
495
  "data-tooltip": "Customize theme",
@@ -734,11 +748,15 @@ export {
734
748
  TemplatePicker,
735
749
  ThemeCustomizerPanel,
736
750
  ThemePicker,
751
+ TimelineCompositionPanel,
737
752
  TimelineEditorWidget,
753
+ TimelineToolbar,
738
754
  TimelineTrack,
755
+ TimelineVideoPanel,
739
756
  TimelineViewExtension,
740
757
  Toolbar,
741
758
  TooltipLayer,
759
+ TransformMenu,
742
760
  TransitionPicker,
743
761
  TreeOutlineWidget,
744
762
  TreeViewExtension,
@@ -785,6 +803,7 @@ export {
785
803
  getTimelineForNode,
786
804
  imageEditorReducer,
787
805
  indentItemOp,
806
+ ingestForWrite,
788
807
  initialImageEditorState,
789
808
  insertNarrationPreamble,
790
809
  inspectMermaidSource,
@@ -815,6 +834,9 @@ export {
815
834
  outdentItemOp,
816
835
  parseTimelineForNode,
817
836
  partitionFiles,
837
+ persistFromWrite,
838
+ preloadMonaco,
839
+ preloadMonacoSuggestions,
818
840
  processMediaFiles,
819
841
  processTextFile,
820
842
  processTextFiles,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  JsonEditor
3
- } from "../chunk-54UGTQBO.js";
4
- import "../chunk-NITZVAXL.js";
3
+ } from "../chunk-IIWECJ26.js";
4
+ import "../chunk-MM3M2KUV.js";
5
5
  export {
6
6
  JsonEditor
7
7
  };
package/dist/monaco.d.ts CHANGED
@@ -1 +1,27 @@
1
1
  export * from 'monaco-editor/esm/vs/editor/editor.api.js';
2
+ import { M as MonacoLanguageRequest, a as MonacoLanguageLoadOptions } from './monacoLanguageDetection-DEyUW-BS.js';
3
+ export { m as monacoLanguageRequestKey, b as monacoLanguagesForDocument, n as normalizeMonacoLanguage } from './monacoLanguageDetection-DEyUW-BS.js';
4
+
5
+ /** Demand-driven Monaco language registration for Squisq editor surfaces. */
6
+
7
+ /** Load only the requested grammar registrations and, when opted in, services. */
8
+ declare function loadMonacoLanguages(requested: MonacoLanguageRequest, options?: MonacoLanguageLoadOptions): Promise<void>;
9
+
10
+ /**
11
+ * Canonical Monaco entry for Squisq and downstream hosts.
12
+ *
13
+ * This entry deliberately avoids Monaco's `editor.main.js` and
14
+ * `editor.all.js` barrels. It registers the compact editing feature profile
15
+ * used by every Squisq editor. Language grammars and worker-backed services
16
+ * are loaded on demand through `loadMonacoLanguages`, so a Markdown source
17
+ * view does not initialize an IDE's worth of unrelated features and languages.
18
+ *
19
+ * Rich CSS/HTML/JSON/JavaScript/TypeScript services still need workers wired
20
+ * through `configureMonacoWorkers`. Syntax highlighting, editing, and Squisq's
21
+ * custom completion providers do not start those workers.
22
+ */
23
+
24
+ /** Load Monaco's completion/snippet UI without placing it in the editor core. */
25
+ declare function loadMonacoSuggestions(): Promise<void>;
26
+
27
+ export { MonacoLanguageLoadOptions, MonacoLanguageRequest, loadMonacoLanguages, loadMonacoSuggestions };