UNPKG

@atlaskit/editor-plugin-card

Version:

Card plugin for @atlaskit/editor-core

31 lines (30 loc) 1.5 kB
import { type MutableRefObject } from 'react'; import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types'; import type { EditorView } from '@atlaskit/editor-prosemirror/view'; import type { RegisterComponent } from '@atlaskit/editor-ui-control-model/types'; import { type CardContext } from '@atlaskit/link-provider/context'; import type { CardPlugin } from '../cardPluginType'; export declare const SMART_LINK_DISPLAY_AS_PASTE_MENU_SECTION_KEY = "smart-link-display-as-paste-menu-section"; type SmartCardClient = CardContext['connections']['client']; export declare const setAppearanceSelection: ({ editorView, pasteStartPos, pasteEndPos, targetPos, }: { editorView: EditorView; pasteEndPos: number; pasteStartPos: number; targetPos: number | undefined; }) => boolean; export declare const getFirstLinkRangeInSelection: (editorView: EditorView) => { from: number; to: number; } | undefined; export declare const normalizeSelectionToLinkRangeForUrlAppearance: ({ editorView, targetPos, }: { editorView: EditorView; targetPos: number | undefined; }) => void; export declare const getPasteDisplayAsMenuComponents: ({ api, allowBlockCards, allowEmbeds, getEditorView, smartCardClientRef, }: { allowBlockCards: boolean; allowEmbeds?: boolean; api: ExtractInjectionAPI<CardPlugin> | undefined; getEditorView: () => EditorView | undefined; smartCardClientRef: MutableRefObject<SmartCardClient | undefined>; }) => RegisterComponent[]; export {};