还是这啊实打实的样吗 asd

深爱的 asdasdasdasdasd
asdasasdass
| asdasdasdd | ||
|---|---|---|
| ss | ||
import { Editor } from '@tiptap/core';
import { NodeSelection } from 'prosemirror-state';
import { emitAppEvent } from '/@/hooks/useEvents';
export const nodeMenuActions: Record<
string,
(editor: Editor, ev: MouseEvent, params?: Record<string, any>) => void
> = {
codeBlockSwitchLanguage(editor, ev, params) {
emitAppEvent('event_controllCodeBlockSwitchLanguageMenu', true);
emitAppEvent('event_showCodeBlockSwitchLanguageMenu');
},
codeBlockCopyMarkdown(editor, ev, params) {
const node = (editor.state.selection as NodeSelection)?.node;
if (node.type.name == 'codeBlock') {
window?.actions?.writeTextToClipboard(`\`\`\`${node.attrs.language}\n${node.textContent}\n\`\`\`\n`);
window.appToastContext?.handlers.success(
window.appI18nContext.t(`toast.mdTextCopied`)
);
}
},
codeBlockCopyCode(editor, ev, params) {
const node = (editor.state.selection as NodeSelection)?.node;
if (node.type.name == 'codeBlock') {
window?.actions?.writeTextToClipboard(node.textContent);
window.appToastContext?.handlers.success(
window.appI18nContext.t(`toast.codeTextCopied`)
);
}
},
codeBlockNewAfter(editor, ev, params) {
editor.chain().createParagraphNear().focus().run();
},
codeBlockNodeDelete(editor, ev, params) {
editor.chain().deleteSelection().run();
},
};s