fix: resolve TypeScript errors in frontend build
This commit is contained in:
42
node_modules/@tiptap/extension-code-block-lowlight/src/code-block-lowlight.ts
generated
vendored
Normal file
42
node_modules/@tiptap/extension-code-block-lowlight/src/code-block-lowlight.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { CodeBlockOptions } from '@tiptap/extension-code-block'
|
||||
import { CodeBlock } from '@tiptap/extension-code-block'
|
||||
|
||||
import { LowlightPlugin } from './lowlight-plugin.js'
|
||||
|
||||
export interface CodeBlockLowlightOptions extends CodeBlockOptions {
|
||||
/**
|
||||
* The lowlight instance.
|
||||
*/
|
||||
lowlight: any
|
||||
}
|
||||
|
||||
/**
|
||||
* This extension allows you to highlight code blocks with lowlight.
|
||||
* @see https://tiptap.dev/api/nodes/code-block-lowlight
|
||||
*/
|
||||
export const CodeBlockLowlight = CodeBlock.extend<CodeBlockLowlightOptions>({
|
||||
addOptions() {
|
||||
return {
|
||||
...this.parent?.(),
|
||||
lowlight: {},
|
||||
languageClassPrefix: 'language-',
|
||||
exitOnTripleEnter: true,
|
||||
exitOnArrowDown: true,
|
||||
defaultLanguage: null,
|
||||
enableTabIndentation: false,
|
||||
tabSize: 4,
|
||||
HTMLAttributes: {},
|
||||
}
|
||||
},
|
||||
|
||||
addProseMirrorPlugins() {
|
||||
return [
|
||||
...(this.parent?.() || []),
|
||||
LowlightPlugin({
|
||||
name: this.name,
|
||||
lowlight: this.options.lowlight,
|
||||
defaultLanguage: this.options.defaultLanguage,
|
||||
}),
|
||||
]
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user