@bendyline/squisq-editor-react 2.6.0 → 2.7.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,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
  import { Doc, MediaProvider, ViewportPreset, Theme } from '@bendyline/squisq/schemas';
4
+ import { FenceRendererMap } from '@bendyline/squisq/fence';
4
5
  import { MarkdownDocument } from '@bendyline/squisq/markdown';
5
6
  import { ContentContainer } from '@bendyline/squisq/storage';
6
7
  import { DocumentVersionManager, SaveVersionOptions, SaveVersionResult, PrunePolicy } from '@bendyline/squisq/versions';
@@ -367,6 +368,13 @@ interface EditorContextValue extends EditorState, EditorActions {
367
368
  * host DOES resolve is unsupported. Executable schemes stay refused.
368
369
  */
369
370
  linkSchemes: readonly string[] | undefined;
371
+ /**
372
+ * Host fence-renderer registry (`@bendyline/squisq/fence`). Claimed
373
+ * fence languages render as interactive host widgets in the WYSIWYG
374
+ * editor (via `HostFenceExtension`) instead of Monaco code insets, and
375
+ * flow into the preview panel's read path. Null disables.
376
+ */
377
+ fenceRenderers: FenceRendererMap | null;
370
378
  /**
371
379
  * File name the host opened this document as (e.g. `Longview Plan.md`), if
372
380
  * any. Used as a display-title fallback — for example, the header of a
@@ -438,6 +446,11 @@ interface EditorProviderProps {
438
446
  * Omit to fall back to URL-only link insertion.
439
447
  */
440
448
  documentLinkProvider?: DocumentLinkProvider | null;
449
+ /**
450
+ * Host fence-renderer registry (`@bendyline/squisq/fence`). Omit to
451
+ * leave every explicit-language fence to the built-in families.
452
+ */
453
+ fenceRenderers?: FenceRendererMap | null;
441
454
  /**
442
455
  * Extra link schemes this host resolves itself. Threaded into the link
443
456
  * dialog's `sanitizeUrl` check so a host-custom protocol is accepted;
@@ -556,7 +569,7 @@ interface ViewPreferences {
556
569
  /** Document vs. block-at-a-time layout. */
557
570
  layoutMode?: LayoutMode;
558
571
  }
559
- 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;
572
+ declare function EditorProvider({ initialMarkdown, initialView, articleId, colorScheme: initialColorScheme, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, mediaProvider, imageDisplayMode, mentionProvider, documentLinkProvider, fenceRenderers, 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;
560
573
 
561
574
  /**
562
575
  * Host-supplied context sections rendered INSIDE the Monaco (raw/code)
@@ -927,6 +940,15 @@ interface EditorShellProps {
927
940
  * remote API, …) implement this; the editor stays agnostic.
928
941
  */
929
942
  documentLinkProvider?: DocumentLinkProvider | null;
943
+ /**
944
+ * Host fence-renderer registry (`@bendyline/squisq/fence`). Claimed
945
+ * fence languages mount as interactive host widgets in the WYSIWYG
946
+ * view (via `HostFenceExtension`) instead of Monaco code insets. The
947
+ * *set* of claimed languages is read at editor configure time;
948
+ * renderer implementations stay live behind a getter. Omit to leave
949
+ * every fence to the built-in families.
950
+ */
951
+ fenceRenderers?: FenceRendererMap | null;
930
952
  /**
931
953
  * Extra link schemes this host resolves itself (e.g. an app-internal
932
954
  * navigation protocol). The link dialog validates typed URLs against
@@ -1086,7 +1108,7 @@ interface EditorShellProps {
1086
1108
  * Complete markdown editor shell with toolbar, view switcher, and three
1087
1109
  * editing modes: Raw (Monaco), WYSIWYG (Tiptap), and Preview.
1088
1110
  */
1089
- declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, 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;
1111
+ declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, language, findMode, onFindModeChange, mentionProvider, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, placeholder, readOnly, imageSrc, imageAlt, imageMode, imageEditorContainer, onImageExport, inlinePreview, inlinePreviewWidth, outline, outlineWidth, blockTags, blockTagVisibility, themeInheritance, viewPreferences, onViewPreferencesChange, themeOverride, }: EditorShellProps): react_jsx_runtime.JSX.Element;
1090
1112
 
1091
1113
  /**
1092
1114
  * RawEditor
@@ -16493,6 +16493,14 @@
16493
16493
  color: var(--squisq-text-muted, #6b7280);
16494
16494
  }
16495
16495
 
16496
+ /* src/styles/host-fence.css */
16497
+ .squisq-wysiwyg-editor pre.squisq-host-fence-hidden {
16498
+ display: none;
16499
+ }
16500
+ .squisq-host-fence-widget-host {
16501
+ margin: 0.6rem 0;
16502
+ }
16503
+
16496
16504
  /* src/styles/ascii-timeline.css */
16497
16505
  .squisq-wysiwyg-editor pre.squisq-ascii-timeline-fence-hidden {
16498
16506
  display: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq-editor-react",
3
- "version": "2.6.0",
3
+ "version": "2.7.1",
4
4
  "description": "React editor shell with raw/WYSIWYG/preview modes for Squisq documents",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -84,10 +84,10 @@
84
84
  "react-dom": "^18.0.0 || ^19.0.0"
85
85
  },
86
86
  "dependencies": {
87
- "@bendyline/squisq": "2.6.0",
88
- "@bendyline/squisq-formats": "2.4.0",
89
- "@bendyline/squisq-react": "2.6.0",
90
- "@bendyline/squisq-video-react": "2.3.1",
87
+ "@bendyline/squisq": "2.7.1",
88
+ "@bendyline/squisq-formats": "2.4.2",
89
+ "@bendyline/squisq-react": "2.7.1",
90
+ "@bendyline/squisq-video-react": "2.3.3",
91
91
  "@fortawesome/fontawesome-free": "7.2.0",
92
92
  "@tiptap/core": "2.27.2",
93
93
  "@tiptap/extension-heading": "2.27.2",