1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

JS: Converted come common services to typescript

This commit is contained in:
Dan Brown
2024-07-03 11:00:57 +01:00
parent feca1f0502
commit a8f1160743
9 changed files with 172 additions and 187 deletions

View File

@ -10,6 +10,7 @@ import {
import type {EditorConfig} from "lexical/LexicalEditor";
import {el} from "../helpers";
import {EditorDecoratorAdapter} from "../ui/framework/decorator";
import {CodeEditor} from "../../components";
export type SerializedCodeBlockNode = Spread<{
language: string;
@ -170,7 +171,7 @@ export function $openCodeEditorForNode(editor: LexicalEditor, node: CodeBlockNod
const language = node.getLanguage();
// @ts-ignore
const codeEditor = window.$components.first('code-editor');
const codeEditor = window.$components.first('code-editor') as CodeEditor;
// TODO - Handle direction
codeEditor.open(code, language, 'ltr', (newCode: string, newLang: string) => {
editor.update(() => {