mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-10 03:37:43 +02:00
Simplified editor plugin configuration management (#9485)
Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user