UNPKG

@atlaskit/editor-plugin-synced-block

Version:

SyncedBlock plugin for @atlaskit/editor-core

42 lines (41 loc) • 2.37 kB
import type { IntlShape } from 'react-intl'; import type { FloatingToolbarCustomRenderContext } from '@atlaskit/editor-common/types/floating-toolbar'; import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin'; import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model'; import type { ReferencesSourceInfo } from '@atlaskit/editor-synced-block-provider/common/types'; import type { SyncBlockSourceInfo } from '@atlaskit/editor-synced-block-provider/providers/types'; import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider/syncBlockStoreManager'; import type { SyncedBlockPlugin } from '../syncedBlockPluginType'; interface Props { api?: ExtractInjectionAPI<SyncedBlockPlugin>; doc?: PMNode; floatingToolbarRenderContext?: FloatingToolbarCustomRenderContext; intl: IntlShape; isSource: boolean; localId: string; resourceId: string; syncBlockStore: SyncBlockStoreManager; } /** * One field-aware dropdown row. Every string the row shows is composed here from the untouched * provider `reference`. Only built with `editor_synced_blocks_jira_custom_rich_text` on. */ export type SyncedLocationItem = { /** * Work item or page title, with the untitled fallback and the block index applied. * Never carries the field name, so the row and the tooltip can place it differently. */ baseTitle: string; /** Jira field holding the block, when the provider resolved one. */ fieldName?: string; /** `sourceAri` plus the block's position within that source. */ key: string; /** Same-location note shown after the title. */ note?: string; reference: SyncBlockSourceInfo; }; export declare const processReferenceData: (referenceData: ReferencesSourceInfo['references'], intl: IntlShape) => SyncBlockSourceInfo[]; export declare const buildFieldAwareItems: (referenceData: ReferencesSourceInfo['references'], formatMessage: IntlShape['formatMessage']) => SyncedLocationItem[]; export declare const SyncedLocationDropdown: ({ syncBlockStore, resourceId, intl, isSource, localId, api, floatingToolbarRenderContext, }: Props) => JSX.Element; export declare const SyncedLocationDropdownWithCount: ({ syncBlockStore, doc, resourceId, intl, isSource, localId, api, floatingToolbarRenderContext, }: Props) => JSX.Element; export {};