@atlaskit/editor-plugin-card
Version:
Card plugin for @atlaskit/editor-core
39 lines (38 loc) • 2.24 kB
TypeScript
import React from 'react';
import type { IntlShape } from 'react-intl';
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics/api';
import type { CardAppearance } from '@atlaskit/editor-common/provider-factory/card-provider';
import type { Command } from '@atlaskit/editor-common/types/command';
import type { FloatingToolbarDropdown, FloatingToolbarItem } from '@atlaskit/editor-common/types/floating-toolbar';
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
export interface LinkToolbarAppearanceProps {
allowBlockCards?: boolean;
allowEmbeds?: boolean;
currentAppearance?: CardAppearance;
editorAnalyticsApi: EditorAnalyticsAPI | undefined;
editorState: EditorState;
editorView?: EditorView;
intl: IntlShape;
isDatasourceView?: boolean;
showUpgradeDiscoverability?: boolean;
url?: string;
}
export declare const getUnavailableMessage: (state: EditorState, intl: IntlShape) => string;
/**
* Whether the node a registered embed transformer (for example native embeds) would insert for the
* selected card is allowed in its parent. That node can be allowed where `embedCard` is not.
*/
export declare const isTransformedEmbedSupportedInParent: (editorState: EditorState, currentAppearance?: CardAppearance) => boolean;
type Props = LinkToolbarAppearanceProps & {
allowDatasource?: boolean;
closeDropdownMenu?: () => void;
dispatchCommand: (command: Command) => void;
settingsConfig: FloatingToolbarItem<Command>;
};
export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, isDatasourceView, dispatchCommand, settingsConfig, closeDropdownMenu, }: Props) => React.JSX.Element | null;
export declare const getLinkAppearanceDropdown: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, settingsConfig, }: LinkToolbarAppearanceProps & {
allowDatasource?: boolean;
settingsConfig: FloatingToolbarItem<Command>;
}) => FloatingToolbarDropdown<Command>;
export {};