import React from 'react'; import type { IntlShape } from 'react-intl'; import type { ADFEntity } from '@atlaskit/adf-utils/types'; import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model'; import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view'; import type { EventDispatcher } from '../event-dispatcher'; import type { ExtensionHandlers } from '../extensions'; import type { PortalProviderAPI } from '../portal'; import type { ProviderFactory } from '../provider-factory'; import type { ForwardRef, getPosHandler } from '../react-node-view'; import ReactNodeView from '../react-node-view'; import type { EditorAppearance } from '../types'; import type { ExtensionsPluginInjectionAPI, MacroInteractionDesignFeatureFlags, GetPMNodeHeight } from './types'; interface ExtensionNodeViewOptions { appearance?: EditorAppearance; getExtensionHeight?: GetPMNodeHeight; } interface ReactExtensionNodeProps { extensionHandlers: ExtensionHandlers; extensionLoadingHandlers?: ExtensionHandlers; extensionNodeViewOptions?: ExtensionNodeViewOptions; intl?: IntlShape; macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags; pluginInjectionApi: ExtensionsPluginInjectionAPI; providerFactory: ProviderFactory; rendererExtensionHandlers?: ExtensionHandlers; showLivePagesBodiedMacrosRendererView?: (node: ADFEntity) => boolean; showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean; } export declare class ExtensionNode extends ReactNodeView { /** True between SSR DOM adoption in `createDomRef` and the SSR→React handoff in `update`. */ private didReuseSsrDom; ignoreMutation(mutation: MutationRecord | { target: Node; type: 'selection'; }): boolean; /** See {@link consumedHydrationIdentitiesByEditor}. Null when attrs are missing → SSR reuse skipped. */ private getHydrationIdentityKey; /** True only for the first ExtensionNode of this identity in this editor. See {@link consumedHydrationIdentitiesByEditor}. */ private isInInitialHydrationWindow; createDomRef(): HTMLElement; /** * Cache for SSR element lookup to avoid repeated DOM queries. * undefined = not yet searched, null = searched but not found, HTMLElement = found */ private cachedSsrElement; /** * Attempts to find an existing SSR'd DOM element for this extension node by extensionKey and localId * which should uniquely identify the * extension node within the editor content. * * @returns The SSR'd element if found, otherwise null */ private findSSRElement; /** Skip React Portal render on first init when reusing SSR DOM. See {@link consumedHydrationIdentitiesByEditor}. */ init(): this; update(node: PmNode, decorations: ReadonlyArray, _innerDecorations?: DecorationSource, validUpdate?: (currentNode: PmNode, newNode: PmNode) => boolean): boolean; /** * Prevents ProseMirror from handling events that belong to the extension's React UI. * * For multibodied extensions: the node consists of a React app (e.g. tab bar) that controls * frames, and the editable frames themselves. Events inside frames must reach ProseMirror * for normal editing; events in the surrounding React app (buttons, navigation) are stopped * so ProseMirror doesn't create a NodeSelection on the entire node. * * For other extensions: input/textarea events are stopped so users can interact * with form elements inside the extension body without the editor intercepting them. */ stopEvent(event: Event): boolean; getContentDOM(): { contentDOM: HTMLDivElement; dom: HTMLDivElement; } | { contentDOM?: undefined; dom: HTMLDivElement; } | undefined; render(props: { extensionHandlers: ExtensionHandlers; extensionLoadingHandlers?: ExtensionHandlers; extensionNodeViewOptions?: ExtensionNodeViewOptions; intl?: IntlShape; macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags; pluginInjectionApi: ExtensionsPluginInjectionAPI; providerFactory: ProviderFactory; rendererExtensionHandlers?: ExtensionHandlers; showLivePagesBodiedMacrosRendererView?: (node: ADFEntity) => boolean; showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean; }, forwardRef: ForwardRef): React.JSX.Element; } export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionLoadingHandlers: ExtensionHandlers | undefined, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: ExtensionsPluginInjectionAPI, macroInteractionDesignFeatureFlags?: MacroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView?: (node: ADFEntity) => boolean, showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean, rendererExtensionHandlers?: ExtensionHandlers, intl?: IntlShape): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView; export {};