@bendyline/squisq-editor-react 2.10.1 → 2.10.2

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.
@@ -1254,7 +1254,7 @@ var TELEPROMPTER_CSS = `
1254
1254
  align-items: center;
1255
1255
  justify-content: center;
1256
1256
  gap: 12px;
1257
- color: var(--squisq-text-muted, #6b7280);
1257
+ color: var(--squisq-text-muted, #4b5563);
1258
1258
  font-size: 14px;
1259
1259
  }
1260
1260
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  NarrationStage,
3
3
  useNarrationStage
4
- } from "./chunk-IRPOMTYK.js";
4
+ } from "./chunk-PMNNJYFD.js";
5
5
 
6
6
  // src/teleprompter/TeleprompterView.tsx
7
7
  import { jsx } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RecorderModal
3
- } from "./chunk-JNJ7XO5L.js";
3
+ } from "./chunk-7RRYZULY.js";
4
4
 
5
5
  // src/recorder/RecorderButton.tsx
6
6
  import { useCallback, useState } from "react";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel } from './shell-Dlh-mkn9.js';
2
- export { B as BlockTagVisibility, a as CodeContextSection, b as CoverImageSaveOutput, D as DashboardImageSaveOutput, c as DocumentLinkCandidate, d as DocumentLinkProvider, e as EditorActions, f as EditorColorScheme, g as EditorContextValue, h as EditorMode, i as EditorProvider, j as EditorProviderProps, k as EditorShell, l as EditorShellProps, m as EditorState, n as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, o as MentionProvider, P as PreviewPanel, p as PreviewPanelProps, R as RawEditor, q as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, W as WriteCanvasSettings, r as WysiwygEditor, s as WysiwygEditorProps, u as useEditorContext } from './shell-Dlh-mkn9.js';
1
+ import { C as CodeContext, E as EditorHostMode, S as SceneTextChannel } from './shell-vNr6KOF9.js';
2
+ export { B as BlockTagVisibility, a as CodeContextSection, b as CoverImageSaveOutput, D as DashboardImageSaveOutput, c as DocumentLinkCandidate, d as DocumentLinkProvider, e as EditorActions, f as EditorColorScheme, g as EditorContextMenuContext, h as EditorContextMenuItem, i as EditorContextMenuItemVisibility, j as EditorContextMenuProvider, k as EditorContextMenuProviderProps, l as EditorContextValue, m as EditorMode, n as EditorProvider, o as EditorProviderProps, p as EditorShell, q as EditorShellProps, r as EditorState, s as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, t as MentionProvider, P as PreviewPanel, u as PreviewPanelProps, R as RawEditor, v as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, W as WriteCanvasSettings, w as WysiwygEditor, x as WysiwygEditorProps, y as useEditorContext, z as useEditorContextMenuItems } from './shell-vNr6KOF9.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';
package/dist/index.js CHANGED
@@ -28,6 +28,7 @@ import {
28
28
  DocumentSettingsDialog,
29
29
  DropZoneOverlay,
30
30
  EMPTY_TRANSITION,
31
+ EditorContextMenuProvider,
31
32
  EditorProvider,
32
33
  EditorShell,
33
34
  EmojiPicker,
@@ -202,6 +203,7 @@ import {
202
203
  useDocCustomTemplates,
203
204
  useDocCustomThemes,
204
205
  useEditorContext,
206
+ useEditorContextMenuItems,
205
207
  useEscapeDismissal,
206
208
  useFileDrop,
207
209
  useMermaidDiagramData,
@@ -210,7 +212,7 @@ import {
210
212
  usePreviewSettings,
211
213
  useTimelineData,
212
214
  useTreeViewData
213
- } from "./chunk-TQPZ6VVM.js";
215
+ } from "./chunk-HFNE3K7X.js";
214
216
  import "./chunk-V4NBQF5C.js";
215
217
  import {
216
218
  JsonEditor
@@ -228,7 +230,7 @@ import {
228
230
  } from "./chunk-V44VP242.js";
229
231
  import {
230
232
  RecorderButton
231
- } from "./chunk-WCGDDZB6.js";
233
+ } from "./chunk-VH45VMPL.js";
232
234
  import {
233
235
  DEFAULT_RECORDER_DEVICE_SETTINGS,
234
236
  RecorderDeviceQuickPicks,
@@ -259,11 +261,11 @@ import {
259
261
  unshownSlidesWarning,
260
262
  useMediaDevices,
261
263
  useMediaRecorder
262
- } from "./chunk-JNJ7XO5L.js";
264
+ } from "./chunk-7RRYZULY.js";
263
265
  import "./chunk-GS7QWYFT.js";
264
266
  import {
265
267
  TeleprompterView
266
- } from "./chunk-ZZTB6BEQ.js";
268
+ } from "./chunk-UNOKKSAC.js";
267
269
  import {
268
270
  DEFAULT_TELEPROMPTER_PREFS,
269
271
  EYE_LINE_FRACTION,
@@ -303,7 +305,7 @@ import {
303
305
  useStreamPreview,
304
306
  useTeleprompter,
305
307
  vadConfigForSensitivity
306
- } from "./chunk-IRPOMTYK.js";
308
+ } from "./chunk-PMNNJYFD.js";
307
309
 
308
310
  // src/FolderView.tsx
309
311
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -747,6 +749,7 @@ export {
747
749
  DropZoneOverlay,
748
750
  EMPTY_TRANSITION,
749
751
  EYE_LINE_FRACTION,
752
+ EditorContextMenuProvider,
750
753
  EditorProvider,
751
754
  EditorShell,
752
755
  EmojiPicker,
@@ -984,6 +987,7 @@ export {
984
987
  useDocCustomTemplates,
985
988
  useDocCustomThemes,
986
989
  useEditorContext,
990
+ useEditorContextMenuItems,
987
991
  useFileDrop,
988
992
  useFloatingWindow,
989
993
  useImageEditor,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RecorderButton
3
- } from "../chunk-WCGDDZB6.js";
3
+ } from "../chunk-VH45VMPL.js";
4
4
  import {
5
5
  DEFAULT_RECORDER_DEVICE_SETTINGS,
6
6
  RecorderDeviceQuickPicks,
@@ -20,7 +20,7 @@ import {
20
20
  requestScreenStream,
21
21
  useMediaDevices,
22
22
  useMediaRecorder
23
- } from "../chunk-JNJ7XO5L.js";
23
+ } from "../chunk-7RRYZULY.js";
24
24
  import "../chunk-GS7QWYFT.js";
25
25
  import {
26
26
  buildFilename,
@@ -34,7 +34,7 @@ import {
34
34
  supportsUserMedia,
35
35
  timingPathFor,
36
36
  useStreamPreview
37
- } from "../chunk-IRPOMTYK.js";
37
+ } from "../chunk-PMNNJYFD.js";
38
38
  export {
39
39
  DEFAULT_RECORDER_DEVICE_SETTINGS,
40
40
  RecorderButton,
@@ -1,4 +1,4 @@
1
- export { B as BlockTagVisibility, c as DocumentLinkCandidate, d as DocumentLinkProvider, e as EditorActions, f as EditorColorScheme, g as EditorContextValue, E as EditorHostMode, h as EditorMode, i as EditorProvider, j as EditorProviderProps, k as EditorShell, l as EditorShellProps, m as EditorState, n as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, o as MentionProvider, P as PreviewPanel, p as PreviewPanelProps, R as RawEditor, q as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, r as WysiwygEditor, s as WysiwygEditorProps, u as useEditorContext } from '../shell-Dlh-mkn9.js';
1
+ export { B as BlockTagVisibility, c as DocumentLinkCandidate, d as DocumentLinkProvider, e as EditorActions, f as EditorColorScheme, g as EditorContextMenuContext, h as EditorContextMenuItem, i as EditorContextMenuItemVisibility, j as EditorContextMenuProvider, k as EditorContextMenuProviderProps, l as EditorContextValue, E as EditorHostMode, m as EditorMode, n as EditorProvider, o as EditorProviderProps, p as EditorShell, q as EditorShellProps, r as EditorState, s as EditorView, I as ImageDisplayMode, L as LayoutMode, M as MentionCandidate, t as MentionProvider, P as PreviewPanel, u as PreviewPanelProps, R as RawEditor, v as RawEditorProps, T as ThemeInheritance, V as ViewPreferences, w as WysiwygEditor, x as WysiwygEditorProps, y as useEditorContext, z as useEditorContextMenuItems } from '../shell-vNr6KOF9.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@bendyline/squisq/schemas';
@@ -1,23 +1,27 @@
1
1
  import {
2
+ EditorContextMenuProvider,
2
3
  EditorProvider,
3
4
  EditorShell,
4
5
  PreviewPanel,
5
6
  RawEditor,
6
7
  WysiwygEditor,
7
- useEditorContext
8
- } from "../chunk-TQPZ6VVM.js";
8
+ useEditorContext,
9
+ useEditorContextMenuItems
10
+ } from "../chunk-HFNE3K7X.js";
9
11
  import "../chunk-V4NBQF5C.js";
10
12
  import "../chunk-TCLNRATG.js";
11
13
  import "../chunk-V44VP242.js";
12
- import "../chunk-JNJ7XO5L.js";
14
+ import "../chunk-7RRYZULY.js";
13
15
  import "../chunk-GS7QWYFT.js";
14
- import "../chunk-ZZTB6BEQ.js";
15
- import "../chunk-IRPOMTYK.js";
16
+ import "../chunk-UNOKKSAC.js";
17
+ import "../chunk-PMNNJYFD.js";
16
18
  export {
19
+ EditorContextMenuProvider,
17
20
  EditorProvider,
18
21
  EditorShell,
19
22
  PreviewPanel,
20
23
  RawEditor,
21
24
  WysiwygEditor,
22
- useEditorContext
25
+ useEditorContext,
26
+ useEditorContextMenuItems
23
27
  };
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode } from 'react';
2
+ import { ReactNode, RefObject } from 'react';
3
3
  import { Doc, MediaProvider, ViewportPreset, Theme } from '@bendyline/squisq/schemas';
4
4
  import { FenceRendererMap } from '@bendyline/squisq/fence';
5
5
  import { MarkdownDocument } from '@bendyline/squisq/markdown';
@@ -1195,6 +1195,54 @@ interface EditorShellProps {
1195
1195
  */
1196
1196
  declare function EditorShell({ initialMarkdown, initialView, hostMode, defaultViewportPreset, articleId, basePath, onChange, onLinkClick, showCodeCopyButton, onCopyCode, colorScheme, className, height, minHeight, maxHeight, mediaProvider, workspaceContainer, allowVersioning, versionBasename, versioningPrunePolicy, versioningAutoSaveIdleMs, onSaveVersion, showFilesToggle, showFormattingControls, showInsertControls, allowBinaryDownloads, toolbarSlotLeft, toolbarSlotAfterActions, toolbarSlotRight, statusBarSlotRight, showPlayTab, allowPresentationWindow, allowPresentationFullscreen, allowPrint, submitOnEnter, codeContext, fullWidth, uxFont, thinMargins, writeCanvasSettings, showStatusBar, imageDisplayMode, fileName, saveCoverImageOutput, saveDashboardImageOutput, language, findMode, onFindModeChange, mentionProvider, proofing, proofingDefaultEnabled, proofingIgnoreStore, documentLinkProvider, fenceRenderers, linkSchemes, allowRecording, allowNarrate, preserveSourceWrapping, placeholder, readOnly, imageSrc, imageAlt, imageMode, imageEditorContainer, onImageExport, inlinePreview, inlinePreviewWidth, outline, outlineWidth, blockTags, blockTagVisibility, themeInheritance, viewPreferences, onViewPreferencesChange, themeOverride, }: EditorShellProps): react_jsx_runtime.JSX.Element;
1197
1197
 
1198
+ /**
1199
+ * Shared editor context menu.
1200
+ *
1201
+ * EditorShell installs this once for every text surface. Squisq contributes
1202
+ * the ordinary clipboard actions; hosts register domain-specific actions with
1203
+ * `useEditorContextMenuItems` without installing competing DOM listeners.
1204
+ */
1205
+
1206
+ interface EditorContextMenuContext {
1207
+ /** Editor rendition that was right-clicked. */
1208
+ view: EditorView;
1209
+ /** Exact selected plain text at the time the menu opened. */
1210
+ selectedText: string;
1211
+ hasSelection: boolean;
1212
+ /** False in Preview and when the host made the editor read-only. */
1213
+ editable: boolean;
1214
+ clientX: number;
1215
+ clientY: number;
1216
+ target: Element;
1217
+ }
1218
+ type EditorContextMenuItemVisibility = 'always' | 'selection' | 'location' | ((context: EditorContextMenuContext) => boolean);
1219
+ interface EditorContextMenuItem {
1220
+ /** Stable within one host registration. */
1221
+ id: string;
1222
+ label: string;
1223
+ /** Optional trailing shortcut hint, e.g. `Ctrl+C`. */
1224
+ shortcut?: string;
1225
+ /** Consecutive groups are separated visually. Defaults to `host`. */
1226
+ group?: string;
1227
+ icon?: ReactNode;
1228
+ /** Defaults to `always`. */
1229
+ when?: EditorContextMenuItemVisibility;
1230
+ disabled?: boolean | ((context: EditorContextMenuContext) => boolean);
1231
+ onSelect: (context: EditorContextMenuContext) => void | Promise<void>;
1232
+ }
1233
+ /** Register host actions with the nearest EditorShell context menu. */
1234
+ declare function useEditorContextMenuItems(items: readonly EditorContextMenuItem[]): void;
1235
+ interface EditorContextMenuProviderProps {
1236
+ rootRef: RefObject<HTMLElement | null>;
1237
+ readOnly?: boolean;
1238
+ children: ReactNode;
1239
+ }
1240
+ /**
1241
+ * Context-menu owner used by EditorShell. Exported for hosts that compose the
1242
+ * lower-level RawEditor/WysiwygEditor primitives into their own shell.
1243
+ */
1244
+ declare function EditorContextMenuProvider({ rootRef, readOnly, children, }: EditorContextMenuProviderProps): JSX.Element;
1245
+
1198
1246
  /**
1199
1247
  * RawEditor
1200
1248
  *
@@ -1283,4 +1331,4 @@ interface PreviewPanelProps {
1283
1331
  */
1284
1332
  declare function PreviewPanel({ basePath, className, workspaceContainer, onLinkClick, showCodeCopyButton, onCopyCode, }: PreviewPanelProps): react_jsx_runtime.JSX.Element;
1285
1333
 
1286
- export { type BlockTagVisibility as B, type CodeContext as C, type DashboardImageSaveOutput 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 CoverImageSaveOutput as b, type DocumentLinkCandidate as c, type DocumentLinkProvider as d, type EditorActions as e, type EditorColorScheme as f, type EditorContextValue as g, type EditorMode as h, EditorProvider as i, type EditorProviderProps as j, EditorShell as k, type EditorShellProps as l, type EditorState as m, type EditorView as n, type MentionProvider as o, type PreviewPanelProps as p, type RawEditorProps as q, WysiwygEditor as r, type WysiwygEditorProps as s, useEditorContext as u };
1334
+ export { type BlockTagVisibility as B, type CodeContext as C, type DashboardImageSaveOutput 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 CoverImageSaveOutput as b, type DocumentLinkCandidate as c, type DocumentLinkProvider as d, type EditorActions as e, type EditorColorScheme as f, type EditorContextMenuContext as g, type EditorContextMenuItem as h, type EditorContextMenuItemVisibility as i, EditorContextMenuProvider as j, type EditorContextMenuProviderProps as k, type EditorContextValue as l, type EditorMode as m, EditorProvider as n, type EditorProviderProps as o, EditorShell as p, type EditorShellProps as q, type EditorState as r, type EditorView as s, type MentionProvider as t, type PreviewPanelProps as u, type RawEditorProps as v, WysiwygEditor as w, type WysiwygEditorProps as x, useEditorContext as y, useEditorContextMenuItems as z };