Simplified editor plugin configuration management (#9485)

Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
Victor Ilyushchenko
2025-07-08 17:30:27 +07:00
committed by GitHub
parent 7b921eeeac
commit 99feb2e894
84 changed files with 1321 additions and 1330 deletions
@@ -1,6 +1,6 @@
import { ServerKit } from '@hcengineering/text'
import { extensionKit, ServerKit } from '@hcengineering/text'
import { AnyExtension, Extension, Node, mergeAttributes } from '@tiptap/core'
import { AnyExtension, mergeAttributes, Node } from '@tiptap/core'
export interface SubLinkOptions {
HTMLAttributes: Record<string, any>
@@ -55,23 +55,17 @@ export const SubLink = Node.create<SubLinkOptions>({
}
})
export interface GithubKitOptions {
sub?: Partial<SubLinkOptions> | false
}
export const GithubKit = Extension.create<GithubKitOptions>({
name: 'githubKit',
addExtensions () {
return [
ServerKit.configure({
export const GithubKit = extensionKit(
'github',
(e) =>
({
serverKit: e(ServerKit, {
image: {
getBlobRef: async () => ({ src: '', srcset: '' })
}
}),
...(this.options.sub !== false ? [SubLink.configure({ ...this.options.sub })] : [])
]
}
})
sub: e(SubLink)
}) as const
)
export const defaultExtensions: AnyExtension[] = [GithubKit.configure({})]
export const defaultExtensions: AnyExtension[] = [GithubKit]