mathlean-canvas 0.3.4 → 0.3.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.
Files changed (36) hide show
  1. package/README.md +124 -6
  2. package/dist/InlineMathLiveField.d.ts +5 -1
  3. package/dist/MathCanvas/components/CanvasOverlayViewport.d.ts +5 -3
  4. package/dist/MathCanvas/components/CollaborationOverlay.d.ts +10 -0
  5. package/dist/MathCanvas/components/ShortcutMenu.d.ts +10 -0
  6. package/dist/MathCanvas/components/Toolbar.d.ts +7 -6
  7. package/dist/MathCanvas/components/icons.d.ts +13 -1
  8. package/dist/MathCanvas/core/hooks/useCanvasGlobalActions.d.ts +2 -9
  9. package/dist/MathCanvas/core/hooks/useCanvasSnapshot.d.ts +7 -2
  10. package/dist/MathCanvas/core/hooks/useCanvasStageInteractions.d.ts +31 -6
  11. package/dist/MathCanvas/core/hooks/useCanvasViewport.d.ts +5 -1
  12. package/dist/MathCanvas/features/geometry/components/CoordinatePlaneLayer.d.ts +2 -1
  13. package/dist/MathCanvas/features/graph/components/GraphLayer.d.ts +17 -2
  14. package/dist/MathCanvas/features/plot/components/PlotControls.d.ts +2 -1
  15. package/dist/MathCanvas/features/plot/components/PlotLayer.d.ts +3 -2
  16. package/dist/MathCanvas/features/plot/utils/plotCompiler.d.ts +6 -2
  17. package/dist/MathCanvas/features/plot/utils/plotModel.d.ts +3 -1
  18. package/dist/MathCanvas/features/stroke/hooks/useStrokeState.d.ts +13 -3
  19. package/dist/MathCanvas/features/text/components/InlineMathBubble.d.ts +3 -1
  20. package/dist/MathCanvas/features/text/components/TextBlockEditor.d.ts +3 -7
  21. package/dist/MathCanvas/features/text/components/TextBlockMenu.d.ts +8 -3
  22. package/dist/MathCanvas/features/text/components/TextBlockView.d.ts +7 -5
  23. package/dist/MathCanvas/features/text/components/TextInteractionLayer.d.ts +11 -2
  24. package/dist/MathCanvas/features/text/hooks/useTextBlockActions.d.ts +2 -2
  25. package/dist/MathCanvas/features/text/hooks/useTextBlockEditingActions.d.ts +1 -5
  26. package/dist/MathCanvas/features/text/hooks/useTextBlockLayoutEffects.d.ts +15 -22
  27. package/dist/MathCanvas/features/text/hooks/useTextBlockRenderHelpers.d.ts +1 -5
  28. package/dist/MathCanvas/features/text/hooks/useTextboxResize.d.ts +1 -5
  29. package/dist/MathCanvas/shortcuts.d.ts +20 -0
  30. package/dist/MathCanvas/types.d.ts +123 -0
  31. package/dist/MathCanvas/utils/latex.d.ts +1 -0
  32. package/dist/MathCanvas.d.ts +2 -2
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.js +18381 -15903
  35. package/dist/useInlineMathSession.d.ts +4 -2
  36. package/package.json +1 -1
package/README.md CHANGED
@@ -15,6 +15,7 @@ It is built as a single `MathCanvas` component. The component includes its own t
15
15
  - Square grid and coordinate plane backgrounds
16
16
  - Undo/redo and clear canvas controls
17
17
  - Controlled persistence through `initialState` and `onStateChange`
18
+ - Optional collaboration hooks for committed document state, pointer presence, and transient stroke previews
18
19
 
19
20
  For the full user-facing tool guide and shortcut reference, see [features.md](./features.md).
20
21
 
@@ -95,6 +96,68 @@ export default function NotesCanvas() {
95
96
  />
96
97
  ```
97
98
 
99
+ ## Realtime Collaboration Hooks
100
+
101
+ `MathCanvas` can emit collaboration-friendly events without requiring a realtime provider. Use these callbacks to connect MathCanvas to your own transport, such as Supabase Realtime, WebSockets, or a local `BroadcastChannel`.
102
+
103
+ ```tsx
104
+ import { MathCanvas, type CollaborationMessage, type DocumentCanvasState, type PointerPresence, type StrokePreview } from "mathlean-canvas";
105
+
106
+ <MathCanvas
107
+ initialState={state}
108
+ onDocumentStateChange={(state: DocumentCanvasState) => {
109
+ // Persist or broadcast committed document state.
110
+ }}
111
+ onPointerPresence={(presence: PointerPresence) => {
112
+ // Broadcast local cursor position.
113
+ }}
114
+ onStrokePreviewStart={(preview: StrokePreview) => {
115
+ // Broadcast transient stroke start.
116
+ }}
117
+ onStrokePreviewUpdate={(preview: StrokePreview) => {
118
+ // Broadcast transient stroke updates while dragging.
119
+ }}
120
+ onStrokePreviewEnd={(preview: StrokePreview) => {
121
+ // Broadcast transient stroke completion/cleanup.
122
+ }}
123
+ onObjectTransformPreviewUpdate={(preview) => {
124
+ // Broadcast live object movement/resizing previews.
125
+ }}
126
+ onTextDraftPreviewUpdate={(preview) => {
127
+ // Broadcast live textbox typing/caret previews.
128
+ }}
129
+ remotePresence={remotePresence}
130
+ remoteStrokePreviews={remoteStrokePreviews}
131
+ remoteObjectTransformPreviews={remoteObjectTransformPreviews}
132
+ remoteTextDraftPreviews={remoteTextDraftPreviews}
133
+ />
134
+ ```
135
+
136
+ `onDocumentStateChange` only includes committed document data: strokes, text blocks, graph objects, plots, grids, geometry objects, coordinate-plane mode, and render mode. It does not include selected tools, selected objects, active editors, viewport/pan/zoom, cursors, undo history, or empty draft textboxes.
137
+
138
+ `remotePresence`, `remoteStrokePreviews`, `remoteObjectTransformPreviews`, and `remoteTextDraftPreviews` render as overlays in the same canvas coordinate space as local content. Remote stroke previews are automatically hidden when the committed document state contains a stroke with the same id.
139
+
140
+ Use `idPrefix` in collaborative hosts to keep locally-created object ids unique across users. Use `documentState` when you want to apply remote committed snapshots without remounting the canvas. `MathCanvas` skips incoming `documentState` snapshots while the local user has an active editor or drag interaction, so stale remote commits do not overwrite local in-progress work.
141
+
142
+ The exported `CollaborationMessage` union is designed to be sent over Supabase Realtime broadcast channels, WebSockets, or any other JSON transport. For Supabase, keep committed snapshots and transient previews on the same channel but separate them by the `type` field:
143
+
144
+ ```tsx
145
+ const eventName = "mathcanvas";
146
+ const send = (message: CollaborationMessage) =>
147
+ channel.send({
148
+ type: "broadcast",
149
+ event: eventName,
150
+ payload: { ...message, senderId, documentId, sentAt: Date.now() },
151
+ });
152
+
153
+ channel.on("broadcast", { event: eventName }, ({ payload }) => {
154
+ const message = payload as CollaborationMessage;
155
+ if (message.senderId === senderId) return;
156
+ // Apply document messages to documentState.
157
+ // Apply presence and preview messages to remote overlay arrays.
158
+ });
159
+ ```
160
+
98
161
  ## Dark Mode
99
162
 
100
163
  ```tsx
@@ -111,7 +174,24 @@ type MathCanvasProps = {
111
174
  className?: string;
112
175
  style?: React.CSSProperties;
113
176
  initialState?: CanvasState;
177
+ documentState?: DocumentCanvasState;
178
+ idPrefix?: string;
114
179
  onStateChange?: (state: CanvasState) => void;
180
+ onDocumentStateChange?: (state: DocumentCanvasState) => void;
181
+ onPointerPresence?: (presence: PointerPresence) => void;
182
+ onStrokePreviewStart?: (preview: StrokePreview) => void;
183
+ onStrokePreviewUpdate?: (preview: StrokePreview) => void;
184
+ onStrokePreviewEnd?: (preview: StrokePreview) => void;
185
+ onObjectTransformPreviewStart?: (preview: ObjectTransformPreview) => void;
186
+ onObjectTransformPreviewUpdate?: (preview: ObjectTransformPreview) => void;
187
+ onObjectTransformPreviewEnd?: (preview: ObjectTransformPreview) => void;
188
+ onTextDraftPreviewStart?: (preview: TextDraftPreview) => void;
189
+ onTextDraftPreviewUpdate?: (preview: TextDraftPreview) => void;
190
+ onTextDraftPreviewEnd?: (preview: TextDraftPreview) => void;
191
+ remotePresence?: RemotePointerPresence[];
192
+ remoteStrokePreviews?: StrokePreview[];
193
+ remoteObjectTransformPreviews?: ObjectTransformPreview[];
194
+ remoteTextDraftPreviews?: TextDraftPreview[];
115
195
  };
116
196
  ```
117
197
 
@@ -120,7 +200,24 @@ Exports:
120
200
  ```ts
121
201
  export { MathCanvas };
122
202
  export default MathCanvas;
123
- export type { CanvasState, MathCanvasProps };
203
+ export type {
204
+ CanvasState,
205
+ CollaborationMessage,
206
+ CollaborationMessageBase,
207
+ CollaborationDocumentMessage,
208
+ CollaborationObjectTransformMessage,
209
+ CollaborationPresenceMessage,
210
+ CollaborationPreviewPhase,
211
+ CollaborationStrokePreviewMessage,
212
+ CollaborationTextDraftMessage,
213
+ DocumentCanvasState,
214
+ MathCanvasProps,
215
+ ObjectTransformPreview,
216
+ PointerPresence,
217
+ RemotePointerPresence,
218
+ StrokePreview,
219
+ TextDraftPreview,
220
+ };
124
221
  ```
125
222
 
126
223
  ## Tools At A Glance
@@ -131,11 +228,12 @@ export type { CanvasState, MathCanvasProps };
131
228
  - Eraser: erase freehand strokes.
132
229
  - Text: place text boxes and math text.
133
230
  - Graph: create nodes and connect relationships.
134
- - Matrix: create and edit matrices.
135
- - Table: create and edit tables.
136
- - Geometry: construct mathematical diagrams.
137
- - Toggle LaTeX: switch text entry between plain and LaTeX-oriented rendering.
138
- - Clear: clear the canvas.
231
+ - Matrix: create and edit matrices.
232
+ - Table: create and edit tables.
233
+ - Geometry: construct mathematical diagrams.
234
+ - Toggle grid: show or hide the centered square grid with axes. When enabled, its secondary control toggles coordinate numbers.
235
+ - Mixed math: available from a textbox menu when a textbox should treat `$` as a literal character.
236
+ - Clear: clear the canvas.
139
237
 
140
238
  See [features.md](./features.md) for detailed tutorials and shortcuts.
141
239
 
@@ -176,6 +274,26 @@ Run the demo app:
176
274
  npm run dev
177
275
  ```
178
276
 
277
+ Run the local collaboration demo:
278
+
279
+ ```bash
280
+ npm run dev -- --host 127.0.0.1 --port 4173
281
+ ```
282
+
283
+ Then open this URL in two browser tabs:
284
+
285
+ ```text
286
+ http://127.0.0.1:4173/?collab=local
287
+ ```
288
+
289
+ The local collaboration demo uses the browser `BroadcastChannel` API, so it does not need Supabase or any backend. Move the pointer, draw, type in textboxes, and drag text/graph objects in one tab to see remote presence and in-progress previews in the other tab. When content is committed, the demo broadcasts the committed document snapshot back into `MathCanvas` through `documentState`.
290
+
291
+ The demo also stores the last committed document snapshot in `localStorage`, so refreshing one tab restores the current canvas instead of waiting for another realtime message.
292
+
293
+ This is a transport emulator. It is useful for proving the MathCanvas collaboration hooks and message shape locally before wiring the same events into Supabase Realtime.
294
+
295
+ For the realtime collaboration behavior contract, scaling notes, and test plan, see [docs/collaboration-behavior.md](./docs/collaboration-behavior.md).
296
+
179
297
  Build the library package:
180
298
 
181
299
  ```bash
@@ -3,15 +3,19 @@ import type { MathfieldElement } from "mathlive";
3
3
  type InlineMathLiveFieldProps = {
4
4
  fieldRef: RefObject<MathfieldElement | null>;
5
5
  bubbleRef: RefObject<HTMLDivElement | null>;
6
+ preserveFocusTargetRefs?: RefObject<Element | null>[];
6
7
  initialLatex: string;
8
+ initialPosition?: "start" | "end";
7
9
  style: CSSProperties;
10
+ inlineShortcuts?: Record<string, string>;
8
11
  onReady: () => void;
9
12
  onLatexChange: (latex: string) => void;
10
13
  onCommit: () => void;
11
14
  onCancel: () => void;
12
15
  onArrowExit: (direction: "before" | "after") => void;
16
+ onStableEnter?: () => boolean;
13
17
  onError: () => void;
14
18
  onContextMenu?: (event: MouseEvent<MathfieldElement>) => void;
15
19
  };
16
- export default function InlineMathLiveField({ fieldRef, bubbleRef, initialLatex, style, onReady, onLatexChange, onCommit, onCancel, onArrowExit, onError, onContextMenu, }: InlineMathLiveFieldProps): import("react/jsx-runtime").JSX.Element;
20
+ export default function InlineMathLiveField({ fieldRef, bubbleRef, preserveFocusTargetRefs, initialLatex, initialPosition, style, inlineShortcuts, onReady, onLatexChange, onCommit, onCancel, onArrowExit, onStableEnter, onError, onContextMenu, }: InlineMathLiveFieldProps): import("react/jsx-runtime").JSX.Element;
17
21
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { ComponentProps } from "react";
2
- import type { TextBlock } from "../types";
2
+ import type { ObjectTransformPreview, TextBlock, TextDraftPreview } from "../types";
3
3
  import { GraphNodeEditor } from "../features/graph";
4
4
  import { GridObjectOverlays } from "../features/grid";
5
5
  import { InlineMathBubble, TextBlockEditor, TextBlockMenu, TextBlockView } from "../features/text";
@@ -10,12 +10,14 @@ type CanvasOverlayViewportProps = {
10
10
  gridObjectOverlaysProps: ComponentProps<typeof GridObjectOverlays>;
11
11
  inlineMathBubbleProps: ComponentProps<typeof InlineMathBubble>;
12
12
  textBlockEditorProps: ComponentProps<typeof TextBlockEditor>;
13
- textBlockMenuProps: ComponentProps<typeof TextBlockMenu>;
13
+ textBlockMenuProps: Omit<ComponentProps<typeof TextBlockMenu>, "viewport">;
14
14
  textBlockViewProps: Omit<ComponentProps<typeof TextBlockView>, "block">;
15
+ remoteObjectTransformPreviews: ObjectTransformPreview[];
16
+ remoteTextDraftPreviews: TextDraftPreview[];
15
17
  viewport: {
16
18
  x: number;
17
19
  y: number;
18
20
  };
19
21
  };
20
- export default function CanvasOverlayViewport({ blocks, editingBlockId, graphNodeEditorProps, gridObjectOverlaysProps, inlineMathBubbleProps, textBlockEditorProps, textBlockMenuProps, textBlockViewProps, viewport, }: CanvasOverlayViewportProps): import("react/jsx-runtime").JSX.Element;
22
+ export default function CanvasOverlayViewport({ blocks, editingBlockId, graphNodeEditorProps, gridObjectOverlaysProps, inlineMathBubbleProps, textBlockEditorProps, textBlockMenuProps, textBlockViewProps, remoteObjectTransformPreviews, remoteTextDraftPreviews, viewport, }: CanvasOverlayViewportProps): import("react/jsx-runtime").JSX.Element;
21
23
  export {};
@@ -0,0 +1,10 @@
1
+ import type { MathCanvasTheme, ObjectTransformPreview, RemotePointerPresence, Stroke, StrokePreview } from "../types";
2
+ type CollaborationOverlayProps = {
3
+ colors: MathCanvasTheme;
4
+ remoteObjectTransformPreviews: ObjectTransformPreview[];
5
+ remotePresence: RemotePointerPresence[];
6
+ remoteStrokePreviews: StrokePreview[];
7
+ strokes: Stroke[];
8
+ };
9
+ export default function CollaborationOverlay({ colors, remoteObjectTransformPreviews, remotePresence, remoteStrokePreviews, strokes, }: CollaborationOverlayProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { MathCanvasTheme, ShortcutSettings } from "../types";
2
+ type ShortcutMenuProps = {
3
+ colors: MathCanvasTheme;
4
+ darkMode: boolean;
5
+ open: boolean;
6
+ shortcutSettings: ShortcutSettings;
7
+ updateShortcutSettings: (updater: (settings: ShortcutSettings) => ShortcutSettings) => void;
8
+ };
9
+ export default function ShortcutMenu({ colors, darkMode, open, shortcutSettings, updateShortcutSettings, }: ShortcutMenuProps): import("react/jsx-runtime").JSX.Element | null;
10
+ export {};
@@ -1,13 +1,12 @@
1
- import type { Dispatch, SetStateAction } from "react";
1
+ import { type Dispatch, type SetStateAction } from "react";
2
2
  import { PEN_SIZE_OPTIONS } from "../constants";
3
3
  import type { CoordinatePlaneMode, GeometryMode, MathCanvasTheme, Tool } from "../types";
4
4
  type ToolbarProps = {
5
5
  colors: MathCanvasTheme;
6
6
  darkMode: boolean;
7
+ compact: boolean;
7
8
  tool: Tool;
8
9
  setTool: Dispatch<SetStateAction<Tool>>;
9
- renderMode: "plain" | "latex";
10
- toggleLatexMode: () => void;
11
10
  pastStateCount: number;
12
11
  futureStateCount: number;
13
12
  handleUndo: () => void;
@@ -23,12 +22,14 @@ type ToolbarProps = {
23
22
  setGeometryMode: Dispatch<SetStateAction<GeometryMode>>;
24
23
  clearGeometryDraft: () => void;
25
24
  clearGeometryLabelEditing: () => void;
26
- regularPolygonSides: number;
27
- setRegularPolygonSides: Dispatch<SetStateAction<number>>;
28
25
  coordinatePlaneMode: CoordinatePlaneMode;
26
+ coordinateLabelsVisible: boolean;
27
+ setCoordinateLabelsVisible: Dispatch<SetStateAction<boolean>>;
29
28
  setCoordinatePlaneMode: Dispatch<SetStateAction<CoordinatePlaneMode>>;
30
29
  pushHistoryState: () => void;
31
30
  clearCanvas: () => void;
31
+ shortcutMenuOpen: boolean;
32
+ setShortcutMenuOpen: Dispatch<SetStateAction<boolean>>;
32
33
  };
33
- export default function Toolbar({ colors, darkMode, tool, setTool, renderMode, toggleLatexMode, pastStateCount, futureStateCount, handleUndo, handleRedo, showPenSizes, setShowPenSizes, penWidth, setPenWidth, penColor, setPenColor, penColorOptions, geometryMode, setGeometryMode, clearGeometryDraft, clearGeometryLabelEditing, regularPolygonSides, setRegularPolygonSides, coordinatePlaneMode, setCoordinatePlaneMode, pushHistoryState, clearCanvas, }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
34
+ export default function Toolbar({ colors, darkMode, compact, tool, setTool, pastStateCount, futureStateCount, handleUndo, handleRedo, showPenSizes, setShowPenSizes, penWidth, setPenWidth, penColor, setPenColor, penColorOptions, geometryMode, setGeometryMode, clearGeometryDraft, clearGeometryLabelEditing, coordinatePlaneMode, coordinateLabelsVisible, setCoordinateLabelsVisible, setCoordinatePlaneMode, pushHistoryState, clearCanvas, shortcutMenuOpen, setShortcutMenuOpen, }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
34
35
  export {};
@@ -45,16 +45,28 @@ export declare function TableIcon({ active }: {
45
45
  export declare function LatexToggleIcon({ active }: {
46
46
  active: boolean;
47
47
  }): import("react/jsx-runtime").JSX.Element;
48
+ export declare function MixedMathIcon({ active }: {
49
+ active: boolean;
50
+ }): import("react/jsx-runtime").JSX.Element;
51
+ export declare function GridIcon({ active }: {
52
+ active: boolean;
53
+ }): import("react/jsx-runtime").JSX.Element;
54
+ export declare function GridNumbersIcon(): import("react/jsx-runtime").JSX.Element;
55
+ export declare function MenuIcon(): import("react/jsx-runtime").JSX.Element;
56
+ export declare function ShortcutIcon({ active }: {
57
+ active: boolean;
58
+ }): import("react/jsx-runtime").JSX.Element;
48
59
  export declare function UndoIcon({ active }: {
49
60
  active: boolean;
50
61
  }): import("react/jsx-runtime").JSX.Element;
51
62
  export declare function RedoIcon({ active }: {
52
63
  active: boolean;
53
64
  }): import("react/jsx-runtime").JSX.Element;
54
- export declare function ToolButton({ active, disabled, label, onClick, children, colors, }: {
65
+ export declare function ToolButton({ active, disabled, label, onMouseDown, onClick, children, colors, }: {
55
66
  active: boolean;
56
67
  disabled?: boolean;
57
68
  label: string;
69
+ onMouseDown?: React.MouseEventHandler<HTMLButtonElement>;
58
70
  onClick: () => void;
59
71
  children: React.ReactNode;
60
72
  colors: MathCanvasTheme;
@@ -1,5 +1,5 @@
1
1
  import type { Dispatch, MutableRefObject, SetStateAction } from "react";
2
- import type { GeoAngle, GeoCircle, GeoHelperSegment, GeoPoint, GeoPolygon, GeoRightAngleMarker, GeoSegment, GraphEdge, GraphNode, MatrixObject, RenderMode, Stroke, TableObject, TextBlock } from "../../types";
2
+ import type { GeoAngle, GeoCircle, GeoHelperSegment, GeoPoint, GeoPolygon, GeoRightAngleMarker, GeoSegment, GraphEdge, GraphNode, MatrixObject, Stroke, TableObject, TextBlock } from "../../types";
3
3
  type UseCanvasGlobalActionsOptions = {
4
4
  clearEditing: () => void;
5
5
  clearGeometryDraft: () => void;
@@ -11,11 +11,8 @@ type UseCanvasGlobalActionsOptions = {
11
11
  clearMatrixSelection: () => void;
12
12
  clearTableEditing: () => void;
13
13
  clearTableSelection: () => void;
14
- editingBlockId: string | null;
15
14
  isDrawing: MutableRefObject<boolean>;
16
15
  pushHistoryState: () => void;
17
- renderMode: RenderMode;
18
- selectedBlockId: string | null;
19
16
  setBlocks: Dispatch<SetStateAction<TextBlock[]>>;
20
17
  setGeoAngles: Dispatch<SetStateAction<GeoAngle[]>>;
21
18
  setGeoCircles: Dispatch<SetStateAction<GeoCircle[]>>;
@@ -27,15 +24,11 @@ type UseCanvasGlobalActionsOptions = {
27
24
  setGraphEdges: Dispatch<SetStateAction<GraphEdge[]>>;
28
25
  setGraphNodes: Dispatch<SetStateAction<GraphNode[]>>;
29
26
  setMatrices: Dispatch<SetStateAction<MatrixObject[]>>;
30
- setRenderMode: Dispatch<SetStateAction<RenderMode>>;
31
27
  setSelectedBlockId: Dispatch<SetStateAction<string | null>>;
32
28
  setStrokes: Dispatch<SetStateAction<Stroke[]>>;
33
29
  setTables: Dispatch<SetStateAction<TableObject[]>>;
34
- updateBlock: (id: string, updater: (block: TextBlock) => TextBlock) => void;
35
30
  };
36
- export declare function useCanvasGlobalActions({ clearEditing, clearGeometryDraft, clearGeometryLabelEditing, clearGeometrySelection, clearGraphEditing, clearGraphSelection, clearMatrixEditing, clearMatrixSelection, clearTableEditing, clearTableSelection, editingBlockId, isDrawing, pushHistoryState, renderMode, selectedBlockId, setBlocks, setGeoAngles, setGeoCircles, setGeoHelperSegments, setGeoPoints, setGeoPolygons, setGeoRightAngleMarkers, setGeoSegments, setGraphEdges, setGraphNodes, setMatrices, setRenderMode, setSelectedBlockId, setStrokes, setTables, updateBlock, }: UseCanvasGlobalActionsOptions): {
31
+ export declare function useCanvasGlobalActions({ clearEditing, clearGeometryDraft, clearGeometryLabelEditing, clearGeometrySelection, clearGraphEditing, clearGraphSelection, clearMatrixEditing, clearMatrixSelection, clearTableEditing, clearTableSelection, isDrawing, pushHistoryState, setBlocks, setGeoAngles, setGeoCircles, setGeoHelperSegments, setGeoPoints, setGeoPolygons, setGeoRightAngleMarkers, setGeoSegments, setGraphEdges, setGraphNodes, setMatrices, setSelectedBlockId, setStrokes, setTables, }: UseCanvasGlobalActionsOptions): {
37
32
  clearCanvas: () => void;
38
- handleRenderModeChange: (nextMode: RenderMode) => void;
39
- toggleLatexMode: () => void;
40
33
  };
41
34
  export {};
@@ -1,6 +1,7 @@
1
- import type { CanvasState, CoordinatePlaneMode, GeoAngle, GeoCircle, GeoHelperSegment, GeoPoint, GeoPolygon, GeoRightAngleMarker, GeoSegment, GraphEdge, GraphNode, MatrixObject, PlotFunction, RenderMode, Stroke, TableObject, TextBlock } from "../../types";
1
+ import type { CanvasState, CoordinatePlaneMode, DocumentCanvasState, GeoAngle, GeoCircle, GeoHelperSegment, GeoPoint, GeoPolygon, GeoRightAngleMarker, GeoSegment, GraphEdge, GraphNode, MatrixObject, PlotFunction, RenderMode, ShortcutSettings, Stroke, TableObject, TextBlock } from "../../types";
2
2
  type UseCanvasSnapshotOptions = {
3
3
  blocks: TextBlock[];
4
+ coordinateLabelsVisible: boolean;
4
5
  coordinatePlaneMode: CoordinatePlaneMode;
5
6
  geoAngles: GeoAngle[];
6
7
  geoCircles: GeoCircle[];
@@ -12,13 +13,17 @@ type UseCanvasSnapshotOptions = {
12
13
  graphEdges: GraphEdge[];
13
14
  graphNodes: GraphNode[];
14
15
  matrices: MatrixObject[];
16
+ onDocumentStateChange?: (state: DocumentCanvasState) => void;
15
17
  onStateChange?: (state: CanvasState) => void;
16
18
  plots: PlotFunction[];
17
19
  renderMode: RenderMode;
20
+ shortcutSettings: ShortcutSettings;
21
+ suppressDocumentStateChange?: boolean;
18
22
  strokes: Stroke[];
19
23
  tables: TableObject[];
20
24
  };
21
- export declare function useCanvasSnapshot({ blocks, coordinatePlaneMode, geoAngles, geoCircles, geoHelperSegments, geoPoints, geoPolygons, geoRightAngleMarkers, geoSegments, graphEdges, graphNodes, matrices, onStateChange, plots, renderMode, strokes, tables, }: UseCanvasSnapshotOptions): {
25
+ export declare function useCanvasSnapshot({ blocks, coordinateLabelsVisible, coordinatePlaneMode, geoAngles, geoCircles, geoHelperSegments, geoPoints, geoPolygons, geoRightAngleMarkers, geoSegments, graphEdges, graphNodes, matrices, onDocumentStateChange, onStateChange, plots, renderMode, shortcutSettings, suppressDocumentStateChange, strokes, tables, }: UseCanvasSnapshotOptions): {
22
26
  getCanvasState: () => CanvasState;
27
+ getDocumentState: () => DocumentCanvasState;
23
28
  };
24
29
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { Dispatch, MutableRefObject, SetStateAction } from "react";
2
2
  import type Konva from "konva";
3
- import type { GeoPoint, GeoSegment, GeometryLabelTarget, GeometryMode, GraphNode, MatrixObject, RenderMode, StageActivationEvent, StagePointerEvent, TableObject, TextBlock, Tool } from "../../types";
3
+ import type { GeoPoint, GeoSegment, GeometryLabelTarget, GeometryMode, GraphNode, MatrixObject, RenderMode, StageActivationEvent, StagePointerEvent, StrokePreview, TableObject, TextBlock, Tool } from "../../types";
4
4
  type ScenePoint = {
5
5
  x: number;
6
6
  y: number;
@@ -9,7 +9,7 @@ type SnapPoint = ScenePoint & {
9
9
  kind: "point" | "grid" | "midpoint";
10
10
  };
11
11
  type UseCanvasStageInteractionsOptions = {
12
- beginGraphSelectionDrag: (point: ScenePoint) => void;
12
+ activeStrokePreviewRef: MutableRefObject<StrokePreview | null>;
13
13
  clearEraserPreview: () => void;
14
14
  clearGeometryDraft: () => void;
15
15
  clearGeometrySelection: () => void;
@@ -31,7 +31,10 @@ type UseCanvasStageInteractionsOptions = {
31
31
  editingGraphNodeId: string | null;
32
32
  editingMatrixId: string | null;
33
33
  editingTableId: string | null;
34
- eraseAtPointState: (x: number, y: number, radius: number, createId: () => string) => void;
34
+ eraseAtPointState: (x: number, y: number, radius: number, createId: () => string, from?: {
35
+ x: number;
36
+ y: number;
37
+ } | null) => void;
35
38
  extendStroke: (x: number, y: number) => void;
36
39
  findGeoPointNear: (x: number, y: number) => GeoPoint | null;
37
40
  findGeoSegmentNear: (x: number, y: number) => GeoSegment | null;
@@ -53,6 +56,16 @@ type UseCanvasStageInteractionsOptions = {
53
56
  isErasing: MutableRefObject<boolean>;
54
57
  isPanning: MutableRefObject<boolean>;
55
58
  lastPanPoint: MutableRefObject<ScenePoint | null>;
59
+ onPointerPresence?: (presence: {
60
+ x: number;
61
+ y: number;
62
+ xPct: number;
63
+ yPct: number;
64
+ tool: string | null;
65
+ }) => void;
66
+ onStrokePreviewEnd?: (preview: StrokePreview) => void;
67
+ onStrokePreviewStart?: (preview: StrokePreview) => void;
68
+ onStrokePreviewUpdate?: (preview: StrokePreview) => void;
56
69
  penColor: string;
57
70
  penWidth: number;
58
71
  pushHistoryState: () => void;
@@ -70,6 +83,7 @@ type UseCanvasStageInteractionsOptions = {
70
83
  left: number;
71
84
  top: number;
72
85
  } | null) => void;
86
+ setPreviewInteractionActive: (active: boolean) => void;
73
87
  setRenderMode: Dispatch<SetStateAction<RenderMode>>;
74
88
  setSelectedBlockId: Dispatch<SetStateAction<string | null>>;
75
89
  setSelectedGraphEdgeId: Dispatch<SetStateAction<string | null>>;
@@ -87,15 +101,26 @@ type UseCanvasStageInteractionsOptions = {
87
101
  startGeometryLabelEditing: (target: GeometryLabelTarget) => void;
88
102
  startGraphEditing: (id: string) => void;
89
103
  startMatrixEditing: (id: string) => void;
90
- startStrokeState: (x: number, y: number, tool: Tool, strokeWidth: number, color: string, createId: () => string) => void;
104
+ startStrokeState: (x: number, y: number, tool: Tool, strokeWidth: number, color: string, id: string) => void;
91
105
  startTableEditing: (id: string) => void;
92
106
  suppressNextGraphActivationRef: MutableRefObject<boolean>;
107
+ stageSize: {
108
+ width: number;
109
+ height: number;
110
+ };
93
111
  toggleEqualSideMarker: (segmentId: string) => void;
94
112
  tool: Tool;
95
- updateEraserPreview: (x: number, y: number) => number;
113
+ updateEraserPreview: (x: number, y: number) => {
114
+ radius: number;
115
+ previous: {
116
+ x: number;
117
+ y: number;
118
+ time: number;
119
+ } | null;
120
+ };
96
121
  updateGraphSelectionDrag: (point: ScenePoint) => boolean;
97
122
  };
98
- export declare function useCanvasStageInteractions({ beginGraphSelectionDrag, clearEraserPreview, clearGeometryDraft, clearGeometrySelection, clearGraphSelection, clearMatrixSelection, clearTableSelection, commitEditing, commitGeometryLabelEditing, commitGraphEditing, commitMatrixEditing, commitTableEditing, createGraphNode, createId, createMatrix, createTable, createTextBlock, editingBlockId, editingGeometryLabel, editingGraphNodeId, editingMatrixId, editingTableId, eraseAtPointState, extendStroke, findGeoPointNear, findGeoSegmentNear, findGeometryLabelTargetNear, findGraphNodeAtPoint, findMatrixAtPoint, findTableAtPoint, findTextBlockBlockingCreation, findTextBlockNearPoint, finishGraphSelectionDrag, getDefaultMatrixPosition, getDefaultTablePosition, getGeoSnap, getScenePoint, geometryMode, handleGeometryCanvasPoint, handleGeometryPointChoice, isDrawing, isErasing, isPanning, lastPanPoint, penColor, penWidth, pushHistoryState, selectedGraphNodeId, selectedMatrixId, selectedPointId, selectedTableId, selectOnlyGeoSegment, selectOnlyGraphNode, setArmedSourceNodeId, setGeometryDraftPointIds, setGeometryPointer, setMatrixLatexPopover, setRenderMode, setSelectedBlockId, setSelectedGraphEdgeId, setSelectedMatrixId, setSelectedTableId, setSnapPreview, setTextBlockMenu, setViewport, skipNextMatrixCreationRef, skipNextTextCreationRef, skipNextTextCreationResetRef, startGeometryLabelEditing, startGraphEditing, startMatrixEditing, startStrokeState, startTableEditing, suppressNextGraphActivationRef, toggleEqualSideMarker, tool, updateEraserPreview, updateGraphSelectionDrag, }: UseCanvasStageInteractionsOptions): {
123
+ export declare function useCanvasStageInteractions({ activeStrokePreviewRef, clearEraserPreview, clearGeometryDraft, clearGeometrySelection, clearGraphSelection, clearMatrixSelection, clearTableSelection, commitEditing, commitGeometryLabelEditing, commitGraphEditing, commitMatrixEditing, commitTableEditing, createGraphNode, createId, createMatrix, createTable, createTextBlock, editingBlockId, editingGeometryLabel, editingGraphNodeId, editingMatrixId, editingTableId, eraseAtPointState, extendStroke, findGeoPointNear, findGeoSegmentNear, findGeometryLabelTargetNear, findGraphNodeAtPoint, findMatrixAtPoint, findTableAtPoint, findTextBlockBlockingCreation, findTextBlockNearPoint, finishGraphSelectionDrag, getDefaultMatrixPosition, getDefaultTablePosition, getGeoSnap, getScenePoint, geometryMode, handleGeometryCanvasPoint, handleGeometryPointChoice, isDrawing, isErasing, isPanning, lastPanPoint, onPointerPresence, onStrokePreviewEnd, onStrokePreviewStart, onStrokePreviewUpdate, penColor, penWidth, pushHistoryState, selectedGraphNodeId, selectedMatrixId, selectedPointId, selectedTableId, selectOnlyGeoSegment, selectOnlyGraphNode, setArmedSourceNodeId, setGeometryDraftPointIds, setGeometryPointer, setMatrixLatexPopover, setPreviewInteractionActive, setRenderMode, setSelectedBlockId, setSelectedGraphEdgeId, setSelectedMatrixId, setSelectedTableId, setSnapPreview, setTextBlockMenu, setViewport, skipNextMatrixCreationRef, skipNextTextCreationRef, skipNextTextCreationResetRef, startGeometryLabelEditing, startGraphEditing, startMatrixEditing, startStrokeState, startTableEditing, suppressNextGraphActivationRef, stageSize, toggleEqualSideMarker, tool, updateEraserPreview, updateGraphSelectionDrag, }: UseCanvasStageInteractionsOptions): {
99
124
  handleCanvasActivation: (e: StageActivationEvent) => void;
100
125
  handlePointerDown: (e: StagePointerEvent) => void;
101
126
  handlePointerMove: (e: StagePointerEvent) => void;
@@ -1,5 +1,8 @@
1
1
  import type Konva from "konva";
2
- export declare function useCanvasViewport(): {
2
+ type UseCanvasViewportOptions = {
3
+ centerInitialViewport?: boolean;
4
+ };
5
+ export declare function useCanvasViewport({ centerInitialViewport }?: UseCanvasViewportOptions): {
3
6
  containerRef: import("react").RefObject<HTMLDivElement | null>;
4
7
  getScenePoint: (stage: Konva.Stage | null) => {
5
8
  x: number;
@@ -23,3 +26,4 @@ export declare function useCanvasViewport(): {
23
26
  y: number;
24
27
  };
25
28
  };
29
+ export {};
@@ -1,6 +1,7 @@
1
1
  import type { CoordinatePlaneMode, MathCanvasTheme } from "../../../types";
2
2
  type CoordinatePlaneLayerProps = {
3
3
  coordinatePlaneMode: CoordinatePlaneMode;
4
+ coordinateLabelsVisible: boolean;
4
5
  colors: MathCanvasTheme;
5
6
  size: {
6
7
  width: number;
@@ -11,5 +12,5 @@ type CoordinatePlaneLayerProps = {
11
12
  y: number;
12
13
  };
13
14
  };
14
- export default function CoordinatePlaneLayer({ coordinatePlaneMode, colors, size, viewport, }: CoordinatePlaneLayerProps): import("react/jsx-runtime").JSX.Element | null;
15
+ export default function CoordinatePlaneLayer({ coordinatePlaneMode, coordinateLabelsVisible, colors, size, viewport, }: CoordinatePlaneLayerProps): import("react/jsx-runtime").JSX.Element | null;
15
16
  export {};
@@ -1,6 +1,6 @@
1
1
  import type Konva from "konva";
2
2
  import type { Dispatch, MutableRefObject, SetStateAction } from "react";
3
- import type { GraphEdge, GraphNode, MathCanvasTheme, Tool } from "../../../types";
3
+ import type { GraphEdge, GraphNode, MathCanvasTheme, ObjectTransformPreview, Tool } from "../../../types";
4
4
  type GraphSelectionBox = {
5
5
  x: number;
6
6
  y: number;
@@ -10,6 +10,12 @@ type GraphSelectionBox = {
10
10
  type GraphLayerProps = {
11
11
  graphNodes: GraphNode[];
12
12
  graphEdges: GraphEdge[];
13
+ liveGraphNodeTransforms: Record<string, {
14
+ x: number;
15
+ y: number;
16
+ width?: number;
17
+ height?: number;
18
+ }>;
13
19
  graphSelectionBox: GraphSelectionBox | null;
14
20
  graphNodeRefs: MutableRefObject<Record<string, Konva.Group | null>>;
15
21
  selectedGraphEdgeId: string | null;
@@ -34,6 +40,15 @@ type GraphLayerProps = {
34
40
  startGraphEditing: (id: string) => void;
35
41
  toggleGraphNodeSelection: (id: string) => void;
36
42
  updateGraphNode: (id: string, updater: (node: GraphNode) => GraphNode) => void;
43
+ setLiveGraphNodeTransforms: Dispatch<SetStateAction<Record<string, {
44
+ x: number;
45
+ y: number;
46
+ width?: number;
47
+ height?: number;
48
+ }>>>;
49
+ onObjectTransformPreviewStart?: (preview: ObjectTransformPreview) => void;
50
+ onObjectTransformPreviewUpdate?: (preview: ObjectTransformPreview) => void;
51
+ onObjectTransformPreviewEnd?: (preview: ObjectTransformPreview) => void;
37
52
  };
38
- export default function GraphLayer({ graphNodes, graphEdges, graphSelectionBox, graphNodeRefs, selectedGraphEdgeId, selectedGraphNodeId, selectedGraphNodeIds, armedSourceNodeId, hoveredGraphNodeId, editingGraphNodeId, tool, colors, darkMode, clearMatrixSelection, connectGraphNodes, pushHistoryState, selectOnlyGraphNode, setArmedSourceNodeId, setHoveredGraphNodeId, setSelectedBlockId, setSelectedGraphEdgeId, setSelectedGraphNodeId, setSelectedGraphNodeIds, startGraphEditing, toggleGraphNodeSelection, updateGraphNode, }: GraphLayerProps): import("react/jsx-runtime").JSX.Element;
53
+ export default function GraphLayer({ graphNodes, graphEdges, liveGraphNodeTransforms, graphSelectionBox, graphNodeRefs, selectedGraphEdgeId, selectedGraphNodeId, selectedGraphNodeIds, armedSourceNodeId, hoveredGraphNodeId, editingGraphNodeId, tool, colors, darkMode, clearMatrixSelection, connectGraphNodes, pushHistoryState, selectOnlyGraphNode, setArmedSourceNodeId, setHoveredGraphNodeId, setSelectedBlockId, setSelectedGraphEdgeId, setSelectedGraphNodeId, setSelectedGraphNodeIds, startGraphEditing, toggleGraphNodeSelection, updateGraphNode, setLiveGraphNodeTransforms, onObjectTransformPreviewStart, onObjectTransformPreviewUpdate, onObjectTransformPreviewEnd, }: GraphLayerProps): import("react/jsx-runtime").JSX.Element;
39
54
  export {};
@@ -5,6 +5,7 @@ type PlotControlsProps = {
5
5
  editingPlot: PlotFunction | null;
6
6
  editingPlotEquationId: string | null;
7
7
  editingPlotLatex: string;
8
+ inlineShortcuts: Record<string, string>;
8
9
  plotColorOptions: readonly string[];
9
10
  plotMenuPanel: "actions" | "color" | null;
10
11
  copySelectedPlot: (plot: PlotFunction) => Promise<void>;
@@ -24,5 +25,5 @@ type PlotControlsProps = {
24
25
  y: number;
25
26
  };
26
27
  };
27
- export default function PlotControls({ colors, editingPlot, editingPlotEquationId, editingPlotLatex, plotColorOptions, plotMenuPanel, copySelectedPlot, createPlotEquation, deletePlotEquation, deleteSelectedPlot, commitPlotEditing, pushHistoryState, setEditingPlotEquationId, setEditingPlotId, setEditingPlotLatex, setPlotMenuPanel, setPlots, updatePlotEquationColor, viewport, }: PlotControlsProps): import("react/jsx-runtime").JSX.Element | null;
28
+ export default function PlotControls({ colors, editingPlot, editingPlotEquationId, editingPlotLatex, inlineShortcuts, plotColorOptions, plotMenuPanel, copySelectedPlot, createPlotEquation, deletePlotEquation, deleteSelectedPlot, commitPlotEditing, pushHistoryState, setEditingPlotEquationId, setEditingPlotId, setEditingPlotLatex, setPlotMenuPanel, setPlots, updatePlotEquationColor, viewport, }: PlotControlsProps): import("react/jsx-runtime").JSX.Element | null;
28
29
  export {};
@@ -26,5 +26,6 @@ type PlotLayerProps = {
26
26
  startPlotEditing: (id: string) => void;
27
27
  updatePlot: (id: string, updater: (plot: PlotFunction) => PlotFunction) => void;
28
28
  };
29
- export default function PlotLayer({ plots, colors, darkMode, size, viewport, plotNodeRefs, selectedPlotId, tool, clearGraphSelection, clearMatrixSelection, clearTableSelection, pushHistoryState, setSelectedBlockId, setSelectedPlotId, openPlotActions, startPlotEditing, updatePlot, }: PlotLayerProps): import("react/jsx-runtime").JSX.Element;
30
- export {};
29
+ declare function PlotLayer({ plots, colors, darkMode, size, viewport, plotNodeRefs, selectedPlotId, tool, clearGraphSelection, clearMatrixSelection, clearTableSelection, pushHistoryState, setSelectedBlockId, setSelectedPlotId, openPlotActions, startPlotEditing, updatePlot, }: PlotLayerProps): import("react/jsx-runtime").JSX.Element;
30
+ declare const _default: import("react").MemoExoticComponent<typeof PlotLayer>;
31
+ export default _default;
@@ -9,10 +9,14 @@ export type PlotCompileResult = {
9
9
  };
10
10
  export type CompiledPlotFunction = {
11
11
  kind: "explicit";
12
- evaluate: (x: number) => number;
12
+ evaluate: (x: number, variables?: Record<string, number>) => number;
13
13
  } | {
14
14
  kind: "implicit";
15
- evaluate: (x: number, y: number) => number;
15
+ evaluate: (x: number, y: number, variables?: Record<string, number>) => number;
16
+ } | {
17
+ kind: "inequality";
18
+ evaluate: (x: number, y: number, variables?: Record<string, number>) => boolean;
16
19
  };
20
+ export declare function getPlotVariableNames(mathJson: MathJsonExpression | null): string[];
17
21
  export declare function compilePlotLatex(latex: string): PlotCompileResult;
18
22
  export declare function compilePlotMathJson(mathJson: MathJsonExpression | null): CompiledPlotFunction | null;
@@ -1,4 +1,4 @@
1
- import type { PlotEquation, PlotFunction } from "../../../types";
1
+ import type { PlotEquation, PlotFunction, PlotParameter } from "../../../types";
2
2
  export declare const PLOT_EQUATION_ROW_HEIGHT = 42;
3
3
  export declare const PLOT_EQUATION_TOP_PADDING = 8;
4
4
  export declare const PLOT_EQUATION_BOTTOM_PADDING = 8;
@@ -7,7 +7,9 @@ export declare const PLOT_EQUATION_PANEL_WIDTH = 190;
7
7
  export declare const PLOT_EQUATION_PANEL_MAX_WIDTH = 440;
8
8
  export declare const PLOT_EQUATION_PANEL_GAP = 8;
9
9
  export declare const PLOT_EQUATION_PANEL_DEFAULT_TOP = 10;
10
+ export declare const PLOT_PARAMETER_ROW_HEIGHT = 38;
10
11
  export declare function getPlotEquations(plot: PlotFunction): PlotEquation[];
12
+ export declare function getPlotParameters(plot: PlotFunction): PlotParameter[];
11
13
  export declare function getPlotEquationAreaHeight(plot: PlotFunction): number;
12
14
  export declare function getPlotEquationPanelWidth(plot: PlotFunction): number;
13
15
  export declare function getPlotEquationTextWidth(panelWidth: number): number;
@@ -13,7 +13,10 @@ export declare function useStrokeState({ initialState, defaultPenColor, pushHist
13
13
  radius: number;
14
14
  visible: boolean;
15
15
  };
16
- eraseAtPoint: (x: number, y: number, radius: number, createId: () => string) => void;
16
+ eraseAtPoint: (x: number, y: number, radius: number, createId: () => string, from?: {
17
+ x: number;
18
+ y: number;
19
+ } | null) => void;
17
20
  extendStroke: (x: number, y: number) => void;
18
21
  isDrawing: import("react").RefObject<boolean>;
19
22
  isErasing: import("react").RefObject<boolean>;
@@ -26,8 +29,15 @@ export declare function useStrokeState({ initialState, defaultPenColor, pushHist
26
29
  setShowPenSizes: import("react").Dispatch<import("react").SetStateAction<boolean>>;
27
30
  showPenSizes: boolean;
28
31
  showPenSizePreviewBriefly: () => void;
29
- startStroke: (x: number, y: number, tool: Tool, strokeWidth: number, color: string, createId: () => string) => boolean;
32
+ startStroke: (x: number, y: number, tool: Tool, strokeWidth: number, color: string, id: string) => boolean;
30
33
  strokes: Stroke[];
31
- updateEraserPreview: (x: number, y: number) => number;
34
+ updateEraserPreview: (x: number, y: number) => {
35
+ radius: number;
36
+ previous: {
37
+ x: number;
38
+ y: number;
39
+ time: number;
40
+ } | null;
41
+ };
32
42
  };
33
43
  export {};
@@ -22,6 +22,7 @@ type InlineMathBubbleProps = {
22
22
  exitActiveInlineMathDraft: (direction: "before" | "after") => void;
23
23
  handleInlineMathLatexChange: (latex: string) => void;
24
24
  inlineMathBubbleRef: RefObject<HTMLDivElement | null>;
25
+ inlineShortcuts: Record<string, string>;
25
26
  inlineMathEditorMode: "mathlive" | "fallback";
26
27
  inlineMathEditorRect: InlineMathEditorRect;
27
28
  inlineMathFieldRef: RefObject<MathfieldElement | null>;
@@ -31,6 +32,7 @@ type InlineMathBubbleProps = {
31
32
  setActiveInlineMathDraft: Dispatch<SetStateAction<string>>;
32
33
  setRenderMode: Dispatch<SetStateAction<"plain" | "latex">>;
33
34
  setSelectedBlockId: Dispatch<SetStateAction<string | null>>;
35
+ textareaRef: RefObject<HTMLTextAreaElement | null>;
34
36
  };
35
- export default function InlineMathBubble({ activeInlineMathAtomId, activeInlineMathDraft, activeInlineMathSession, activateInlineMathFallback, cancelActiveInlineMathDraft, colors, commitActiveInlineMathDraft, darkMode, editingBlock, editingBlockId, exitActiveInlineMathDraft, handleInlineMathLatexChange, inlineMathBubbleRef, inlineMathEditorMode, inlineMathEditorRect, inlineMathFieldRef, latexPreview, markInlineMathEditorReady, openTextBlockMenu, setActiveInlineMathDraft, setRenderMode, setSelectedBlockId, }: InlineMathBubbleProps): import("react/jsx-runtime").JSX.Element | null;
37
+ export default function InlineMathBubble({ activeInlineMathAtomId, activeInlineMathDraft, activeInlineMathSession, activateInlineMathFallback, cancelActiveInlineMathDraft, colors, commitActiveInlineMathDraft, darkMode, editingBlock, editingBlockId, exitActiveInlineMathDraft, handleInlineMathLatexChange, inlineMathBubbleRef, inlineShortcuts, inlineMathEditorMode, inlineMathEditorRect, inlineMathFieldRef, latexPreview, markInlineMathEditorReady, openTextBlockMenu, setActiveInlineMathDraft, setRenderMode, setSelectedBlockId, textareaRef, }: InlineMathBubbleProps): import("react/jsx-runtime").JSX.Element | null;
36
38
  export {};