Live-sync for reference label (#8016)

Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
Victor Ilyushchenko
2025-02-17 10:47:55 +07:00
committed by GitHub
parent 69384ad4a1
commit 2fe638297c
17 changed files with 523 additions and 493 deletions
@@ -21,7 +21,6 @@
import type { AnyExtension } from '@tiptap/core'
import { createEventDispatcher } from 'svelte'
import { Completion } from '../Completion'
import StyledTextEditor from './StyledTextEditor.svelte'
import { addTableHandler } from '../utils'
@@ -29,8 +28,9 @@
import { FocusExtension } from './extension/focus'
import { ImageUploadExtension } from './extension/imageUploadExt'
import { InlineCommandsExtension } from './extension/inlineCommands'
import { ReferenceExtension, referenceConfig } from './extension/reference'
import { type FileAttachFunction } from './extension/types'
import { completionConfig, InlineCommandId, inlineCommandsConfig } from './extensions'
import { InlineCommandId, inlineCommandsConfig } from './extensions'
export let label: IntlString | undefined = undefined
export let content: Markup
@@ -179,8 +179,8 @@
getFileUrl
})
const completionPlugin = Completion.configure({
...completionConfig,
const completionPlugin = ReferenceExtension.configure({
...referenceConfig,
showDoc (event: MouseEvent, _id: string, _class: string) {
dispatch('open-document', { event, _id, _class })
}