UNPKG

@atlaskit/editor-plugin-synced-block

Version:

SyncedBlock plugin for @atlaskit/editor-core

37 lines (36 loc) • 2.01 kB
import type { IntlShape } from 'react-intl'; import type { ExtractInjectionAPI, FloatingToolbarCustomRenderContext } from '@atlaskit/editor-common/types'; import type { SyncBlockSourceInfo, SyncBlockStoreManager, ReferencesSourceInfo } from '@atlaskit/editor-synced-block-provider'; import type { SyncedBlockPlugin } from '../syncedBlockPluginType'; interface Props { api?: ExtractInjectionAPI<SyncedBlockPlugin>; 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, resourceId, intl, isSource, localId, api, floatingToolbarRenderContext, }: Props) => JSX.Element; export {};