Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/coderunner/CodeBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createReactBlockSpec } from "@blocknote/react";
import {
BlockNoteEditor,
insertOrUpdateBlock,
PropSchema,
defaultProps,
BlockConfig,
} from "@blocknote/core";
import { insertOrUpdateBlockForSlashMenu } from "@blocknote/core/extensions";
import { useMemo, useCallback, useState, useRef } from "react";
import { VscPlay, VscCode } from "react-icons/vsc";
import ReactCodeMirror, { EditorView } from "@uiw/react-codemirror";
Expand Down Expand Up @@ -49,7 +49,7 @@ export const CodeBlock = createReactBlockSpec(
{
type: TYPE,
propSchema: codeRunnerPropSchema,
content: "none",
content: "none" as const,
},
{
render: ({ block, editor }) => {
Expand Down Expand Up @@ -276,7 +276,7 @@ export const insertCode = () => ({
onItemClick: <BSchema extends Record<string, BlockConfig>>(
editor: BlockNoteEditor<BSchema>
) => {
insertOrUpdateBlock(editor, {
insertOrUpdateBlockForSlashMenu(editor, {
type: TYPE,
});
},
Expand All @@ -292,7 +292,7 @@ export const insertPythonCode = () => ({
editor: BlockNoteEditor<BSchema>
) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
insertOrUpdateBlock(editor, {
insertOrUpdateBlockForSlashMenu(editor, {
type: TYPE,
props: { language: "python" },
} as any);
Expand All @@ -309,7 +309,7 @@ export const insertJavaScriptCode = () => ({
editor: BlockNoteEditor<BSchema>
) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
insertOrUpdateBlock(editor, {
insertOrUpdateBlockForSlashMenu(editor, {
type: TYPE,
props: { language: "javascript" },
} as any);
Expand Down
4 changes: 2 additions & 2 deletions lib/genius/extensions/getGeniusSlashMenuItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
BlockSchema,
InlineContentSchema,
StyleSchema,
insertOrUpdateBlock,
} from "@blocknote/core";
import { insertOrUpdateBlockForSlashMenu } from "@blocknote/core/extensions";
import { DefaultReactSuggestionItem } from "@blocknote/react";
import { createElement } from "react";
import { RiSparklingLine } from "react-icons/ri";
Expand All @@ -15,7 +15,7 @@ function insertGenius<
ISchema extends InlineContentSchema,
SSchema extends StyleSchema,
>(editor: BlockNoteEditor<BSchema, ISchema, SSchema>): void {
insertOrUpdateBlock(
insertOrUpdateBlockForSlashMenu(
asBlockNoteEditorForView(editor),
{ type: "genius" },
);
Expand Down
4 changes: 2 additions & 2 deletions lib/multicolumn/extensions/ColumnResizeExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class ColumnResizePluginView implements PluginView {
this.view.state.tr.setMeta(columnResizePluginKey, newState),
);

this.editor.sideMenu.freezeMenu();
(this.editor.getExtension("sideMenu") as any)?.freezeMenu();
this.view.dom.classList.add("is-resizing-columns");
};

Expand Down Expand Up @@ -263,7 +263,7 @@ class ColumnResizePluginView implements PluginView {
this.view.state.tr.setMeta(columnResizePluginKey, newState),
);

this.editor.sideMenu.unfreezeMenu();
(this.editor.getExtension("sideMenu") as any)?.unfreezeMenu();
this.view.dom.classList.remove("is-resizing-columns");
};

Expand Down
7 changes: 4 additions & 3 deletions lib/whiteboard/extensions/getWhiteboardSlashMenuItems.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BlockNoteEditor, BlockSchema, InlineContentSchema, StyleSchema, insertOrUpdateBlock } from "@blocknote/core";
import { BlockNoteEditor, BlockSchema, InlineContentSchema, StyleSchema } from "@blocknote/core";
import { insertOrUpdateBlockForSlashMenu } from "@blocknote/core/extensions";
import { DefaultReactSuggestionItem } from "@blocknote/react";
import { FaPencilAlt } from "react-icons/fa";
import { asBlockNoteEditorForView } from "../../utils/editorUtils.js";
Expand All @@ -8,8 +9,8 @@ function insertWhiteboard<
ISchema extends InlineContentSchema,
SSchema extends StyleSchema
>(editor: BlockNoteEditor<BSchema, ISchema, SSchema>): void {
// Insert a whiteboard block using insertOrUpdateBlock (same pattern as mermaid)
insertOrUpdateBlock(
// Insert a whiteboard block using insertOrUpdateBlockForSlashMenu
insertOrUpdateBlockForSlashMenu(
asBlockNoteEditorForView(editor),
{ type: "whiteboard" }
);
Expand Down
Loading