@bendyline/squisq-editor-react 2.3.4 → 2.4.1

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,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { Doc, MediaProvider, Theme } from '@bendyline/squisq/schemas';
3
+ import { Doc, MediaProvider, ViewportPreset, Theme } from '@bendyline/squisq/schemas';
4
4
  import { MarkdownDocument } from '@bendyline/squisq/markdown';
5
5
  import { ContentContainer } from '@bendyline/squisq/storage';
6
6
  import { DocumentVersionManager, SaveVersionOptions, SaveVersionResult, PrunePolicy } from '@bendyline/squisq/versions';
@@ -205,6 +205,15 @@ interface EditorState {
205
205
  * host may allow the recorder modal but not want a prompter surface.
206
206
  */
207
207
  allowNarrate: boolean;
208
+ /**
209
+ * Whether the Write view transparently unwraps hard-wrapped paragraph
210
+ * prose for editing and re-applies the document's detected wrap
211
+ * convention when serializing (see `detectMarkdownWrapState`). Without
212
+ * it, a hard-wrapped document renders as one choppy paragraph per
213
+ * physical line in Write view — and the first edit persists that
214
+ * chopped structure. Defaults to true; document layout mode only.
215
+ */
216
+ preserveSourceWrapping: boolean;
208
217
  /**
209
218
  * Document layout mode. `'document'` (default) edits the whole document;
210
219
  * `'block'` activates the block-at-a-time card view. Initialized from the
@@ -357,6 +366,13 @@ interface EditorContextValue extends EditorState, EditorActions {
357
366
  * host DOES resolve is unsupported. Executable schemes stay refused.
358
367
  */
359
368
  linkSchemes: readonly string[] | undefined;
369
+ /**
370
+ * File name the host opened this document as (e.g. `Longview Plan.md`), if
371
+ * any. Used as a display-title fallback — for example, the header of a
372
+ * heading-less leading "preamble" block in the slideshow preview when the
373
+ * document has no frontmatter `title:`.
374
+ */
375
+ fileName: string | undefined;
360
376
  }
361
377
  type ImageDisplayMode = 'inline' | 'thumbnail';
362
378
  /**
@@ -440,6 +456,12 @@ interface EditorProviderProps {
440
456
  * frontmatter-forced `display-mode: narrate` clamps back to video.
441
457
  */
442
458
  allowNarrate?: boolean;
459
+ /**
460
+ * Whether the Write view transparently unwraps hard-wrapped prose and
461
+ * re-applies the detected wrap convention on save. Defaults to true;
462
+ * pass false for literal behavior (Tiptap sees the wrapped source).
463
+ */
464
+ preserveSourceWrapping?: boolean;
443
465
  /**
444
466
  * File name (e.g. `foo.ts`) or bare extension — used to pick a Monaco
445
467
  * language and decide between markdown vs. code mode.
@@ -533,7 +555,7 @@ interface ViewPreferences {
533
555
  /** Document vs. block-at-a-time layout. */
534
556
  layoutMode?: LayoutMode;
535
557
  }
536
- declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, documentLinkProvider, linkSchemes, allowRecording, allowNarrate, fileName, language, findMode: controlledFindMode, onFindModeChange, inlinePreview, showStatusBar, outline, blockTags, blockTagVisibility: initialBlockTagVisibility, themeInheritance, layoutMode, viewPreferences, onViewPreferencesChange, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
558
+ declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, documentLinkProvider, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, fileName, language, findMode: controlledFindMode, onFindModeChange, inlinePreview, showStatusBar, outline, blockTags, blockTagVisibility: initialBlockTagVisibility, themeInheritance, layoutMode, viewPreferences, onViewPreferencesChange, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
537
559
 
538
560
  /**
539
561
  * Host-supplied context sections rendered INSIDE the Monaco (raw/code)
@@ -617,14 +639,48 @@ interface WriteCanvasSettings {
617
639
  textSize?: number;
618
640
  /** Unitless line-height multiplier for body text. */
619
641
  lineSpacing?: number;
642
+ /**
643
+ * CSS `font-family` value for Write-canvas headings. Applies only when no
644
+ * theme font override is active (the theme's title font always wins) — see
645
+ * the heading rule in `styles/editor.css`. Omit to inherit as before.
646
+ */
647
+ headerFont?: string;
648
+ /**
649
+ * CSS `font-family` value for Write-canvas body text. Applies only when no
650
+ * theme font override is active (the theme's body font always wins) — see
651
+ * the editor rule in `styles/editor.css`. Omit to inherit as before.
652
+ */
653
+ bodyFont?: string;
620
654
  }
621
655
 
656
+ /**
657
+ * Semantic embedding mode for the editor shell.
658
+ *
659
+ * The default document mode exposes the full multi-view authoring surface.
660
+ * Chat mode keeps the composer in Write view and removes document-level
661
+ * authoring controls that do not belong in a message composer.
662
+ */
663
+ type EditorHostMode = 'document' | 'chat';
664
+
622
665
  interface EditorShellProps {
623
666
  /** Initial markdown content */
624
667
  initialMarkdown?: string;
625
- /** Initial active view */
626
668
  /** Initial active view (default: 'wysiwyg') */
627
669
  initialView?: EditorView;
670
+ /**
671
+ * Semantic mode for the surface embedding the editor. `'document'`
672
+ * (default) exposes the normal multi-view authoring shell. `'chat'`
673
+ * starts and stays in Write view through the shell's own controls, hides
674
+ * the view tabs, and removes document-level layout, transform, view, and
675
+ * settings controls from the toolbar.
676
+ */
677
+ hostMode?: EditorHostMode;
678
+ /**
679
+ * Viewport preset used by slideshow/video preview when neither the document
680
+ * nor the user has selected one. Defaults to landscape. Hosts may update it
681
+ * responsively; explicit document and user choices remain authoritative.
682
+ */
683
+ defaultViewportPreset?: ViewportPreset;
628
684
  /** Article ID for Doc generation */
629
685
  articleId?: string;
630
686
  /** Base path for media URLs in preview */
@@ -712,6 +768,11 @@ interface EditorShellProps {
712
768
  onSaveVersion?: (result: SaveVersionResult) => void;
713
769
  /** Show the Files toggle in the toolbar. Defaults to true when mediaProvider is passed. */
714
770
  showFilesToggle?: boolean;
771
+ /**
772
+ * Whether the Files panel offers browser downloads for its binary entries.
773
+ * Defaults to true. Pass false to remove the built-in download affordance.
774
+ */
775
+ allowBinaryDownloads?: boolean;
715
776
  /** Content rendered at the left edge of the toolbar, before the view tabs. */
716
777
  toolbarSlotLeft?: ReactNode;
717
778
  /** Content rendered after the formatting controls (in the middle area of the toolbar). */
@@ -733,7 +794,7 @@ interface EditorShellProps {
733
794
  */
734
795
  allowPresentationWindow?: boolean;
735
796
  /**
736
- * Whether Use mode may enter browser full screen. Defaults to true. Disable
797
+ * Whether Use mode may enter native full screen. Defaults to true. Disable
737
798
  * this in embedded hosts whose webview does not support the Fullscreen API.
738
799
  */
739
800
  allowPresentationFullscreen?: boolean;
@@ -870,6 +931,15 @@ interface EditorShellProps {
870
931
  * `allowRecording` + a `mediaProvider`.
871
932
  */
872
933
  allowNarrate?: boolean;
934
+ /**
935
+ * Whether the Write view transparently unwraps hard-wrapped paragraph
936
+ * prose for editing and re-applies the document's detected wrap
937
+ * convention when serializing. Defaults to true — without it, a
938
+ * hard-wrapped document renders one choppy paragraph per physical line
939
+ * in Write view and the first edit persists that chopped structure.
940
+ * Pass `false` for literal behavior. Document layout mode only.
941
+ */
942
+ preserveSourceWrapping?: boolean;
873
943
  /**
874
944
  * Placeholder text shown in the WYSIWYG editor while the document is
875
945
  * empty. When omitted, the editor rotates through its own generic
@@ -995,7 +1065,7 @@ interface EditorShellProps {
995
1065
  * Complete markdown editor shell with toolbar, view switcher, and three
996
1066
  * editing modes: Raw (Monaco), WYSIWYG (Tiptap), and Preview.
997
1067
  */
998
- declare function EditorShell({ initialMarkdown, initialView, articleId, basePath, onChange, onLinkClick, colorScheme, className, height, minHeight, maxHeight, mediaProvider, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, language, findMode, onFindModeChange, mentionProvider, documentLinkProvider, linkSchemes, allowRecording, allowNarrate, placeholder, readOnly, imageSrc, imageAlt, imageMode, imageEditorContainer, onImageExport, inlinePreview, inlinePreviewWidth, outline, outlineWidth, blockTags, blockTagVisibility, themeInheritance, viewPreferences, onViewPreferencesChange, themeOverride, }: EditorShellProps): react_jsx_runtime.JSX.Element;
1068
+ declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, colorScheme, className, height, minHeight, maxHeight, mediaProvider, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, language, findMode, onFindModeChange, mentionProvider, documentLinkProvider, 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;
999
1069
 
1000
1070
  /**
1001
1071
  * RawEditor
@@ -1081,4 +1151,4 @@ interface PreviewPanelProps {
1081
1151
  */
1082
1152
  declare function PreviewPanel({ basePath, className, workspaceContainer, onLinkClick, }: PreviewPanelProps): react_jsx_runtime.JSX.Element;
1083
1153
 
1084
- export { type BlockTagVisibility as B, type CodeContext as C, type DocumentLinkCandidate as D, type EditorActions as E, type ImageDisplayMode as I, type LayoutMode as L, type MentionCandidate as M, PreviewPanel as P, RawEditor as R, type SceneTextChannel as S, type ThemeInheritance as T, type ViewPreferences as V, type WriteCanvasSettings as W, type CodeContextSection as a, type DocumentLinkProvider as b, type EditorColorScheme as c, type EditorContextValue as d, type EditorMode as e, EditorProvider as f, type EditorProviderProps as g, EditorShell as h, type EditorShellProps as i, type EditorState as j, type EditorView as k, type MentionProvider as l, type PreviewPanelProps as m, type RawEditorProps as n, WysiwygEditor as o, type WysiwygEditorProps as p, useEditorContext as u };
1154
+ export { type BlockTagVisibility as B, type CodeContext as C, type DocumentLinkCandidate as D, type EditorHostMode as E, type ImageDisplayMode as I, type LayoutMode as L, type MentionCandidate as M, PreviewPanel as P, RawEditor as R, type SceneTextChannel as S, type ThemeInheritance as T, type ViewPreferences as V, type WriteCanvasSettings as W, type CodeContextSection as a, type DocumentLinkProvider as b, type EditorActions as c, type EditorColorScheme as d, type EditorContextValue as e, type EditorMode as f, EditorProvider as g, type EditorProviderProps as h, EditorShell as i, type EditorShellProps as j, type EditorState as k, type EditorView as l, type MentionProvider as m, type PreviewPanelProps as n, type RawEditorProps as o, WysiwygEditor as p, type WysiwygEditorProps as q, useEditorContext as u };