UNPKG

@atlaskit/editor-plugin-hyperlink

Version:

Hyperlink plugin for @atlaskit/editor-core

127 lines (102 loc) 3.83 kB
<!-- API Report Version: 2.3 --> ## API Report File for "@atlaskit/editor-plugin-hyperlink" > Do not edit this file. This report is auto-generated using > [API Extractor](https://api-extractor.com/). > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports) ### Table of contents - [Main Entry Types](#main-entry-types) - [Peer Dependencies](#peer-dependencies) ### Main Entry Types <!--SECTION START: Main Entry Types--> ```ts import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics'; import type { Command } from '@atlaskit/editor-common/types'; import type { EditorCommand } from '@atlaskit/editor-common/types'; import type { EditorState } from '@atlaskit/editor-prosemirror/state'; import type { EditorView } from '@atlaskit/editor-prosemirror/view'; import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags'; import type { FloatingToolbarItem } from '@atlaskit/editor-common/types'; import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types'; import type { HyperlinkState } from '@atlaskit/editor-common/link'; import { INPUT_METHOD } from '@atlaskit/editor-common/analytics'; import type { IntlShape } from 'react-intl'; import type { LinkInputType } from '@atlaskit/editor-common/types'; import type { NextEditorPlugin } from '@atlaskit/editor-common/types'; import type { OptionalPlugin } from '@atlaskit/editor-common/types'; import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory'; import type { QueueCardsFromTransactionAction } from '@atlaskit/editor-common/card'; import type { Transaction } from '@atlaskit/editor-prosemirror/state'; import type { UIAnalyticsEvent } from '@atlaskit/analytics-next'; // @public (undocumented) type GetToolbarItems = ( state: EditorState, intl: IntlShape, providerFactory: ProviderFactory, link: string, ) => FloatingToolbarItem<any>[]; // @public (undocumented) export type HideLinkToolbar = (tr: Transaction) => Transaction; // @public (undocumented) export type HyperlinkPlugin = NextEditorPlugin< 'hyperlink', { pluginConfiguration: HyperlinkPluginOptions | undefined; dependencies: [OptionalPlugin<FeatureFlagsPlugin>, OptionalPlugin<AnalyticsPlugin>]; actions: { prependToolbarButtons: PrependToolbarButtons; hideLinkToolbar: HideLinkToolbar; insertLink: InsertLink; updateLink: UpdateLink; }; commands: { showLinkToolbar: ShowLinkToolbar; }; sharedState: HyperlinkState | undefined; } >; // @public export const hyperlinkPlugin: HyperlinkPlugin; // @public (undocumented) type HyperlinkToolbarItemsState = { items: GetToolbarItems; }; // @public (undocumented) type InputMethod = | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TOOLBAR; // @public (undocumented) export type InsertLink = ( inputMethod: LinkInputType, from: number, to: number, href: string, title?: string, displayText?: string, cardsAvailable?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined, ) => Command; // @public (undocumented) export type PrependToolbarButtons = (props: PrependToolbarButtonsProps) => void; // @public (undocumented) interface PrependToolbarButtonsProps extends HyperlinkToolbarItemsState { // (undocumented) view: EditorView; } // @public (undocumented) export type ShowLinkToolbar = (inputMethod: InputMethod) => EditorCommand; // @public (undocumented) export type UpdateLink = (href: string, text: string, pos: number, to?: number) => Command; // (No @packageDocumentation comment for this package) ``` <!--SECTION END: Main Entry Types--> ### Peer Dependencies <!--SECTION START: Peer Dependencies--> ```json { "react": "^16.8.0", "react-intl": "npm:react-intl@^5.18.1" } ``` <!--SECTION END: Peer Dependencies-->