UNPKG

@atlaskit/editor-plugin-card

Version:

Card plugin for @atlaskit/editor-core

21 lines (20 loc) 1.71 kB
import React from 'react'; import type { InlineNodeViewComponentProps, getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view'; import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model'; import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view'; import type { SmartCardProps } from './genericCard'; import type { InlineCardWithAwarenessProps } from './inlineCardWithAwareness'; export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick, onResolve, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, pluginInjectionApi, disablePreviewPanel, }: SmartCardProps) => React.JSX.Element | null>; export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | 'isPageSSRed' | 'CompetitorPrompt' | 'provider'>; /** * Inline card node view component that renders a Smart Link inline card within the editor. * * @param props * @example */ export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps & InlineCardWithAwarenessProps): React.JSX.Element; export interface InlineCardNodeViewProperties { inlineCardViewProducer: ReturnType<typeof getInlineNodeViewProducer>; isPageSSRed: InlineCardNodeViewProps['isPageSSRed']; } export declare const inlineCardNodeView: ({ inlineCardViewProducer }: InlineCardNodeViewProperties) => (node: PMNode, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => NodeView;