@atlaskit/editor-plugin-card
Version:
Card plugin for @atlaskit/editor-core
62 lines (61 loc) • 2.71 kB
TypeScript
/**
* @jsxRuntime classic
* @jsx jsx
*/
import React from 'react';
import { jsx } from '@emotion/react';
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
import type { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
import type { cardPlugin } from '../index';
export interface DatasourceProps extends ReactComponentProps {
eventDispatcher: EventDispatcher;
getPos: getPosHandler;
isNodeNested?: boolean;
node: PMNode;
pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
portalProviderAPI: PortalProviderAPI;
view: EditorView;
}
interface DatasourceComponentProps extends ReactComponentProps, Pick<DatasourceProps, 'node' | 'view' | 'getPos'> {
}
export declare class DatasourceComponent extends React.PureComponent<DatasourceComponentProps> {
constructor(props: DatasourceComponentProps);
private getDatasource;
private getTableView;
private updateTableProperties;
handleColumnChange: (columnKeys: string[]) => void;
handleColumnResize: (key: string, width: number) => void;
handleWrappedColumnChange: (key: string, shouldWrap: boolean) => void;
onError: ({ err }: {
err?: Error;
}) => void;
private getColumnsInfo;
render(): jsx.JSX.Element | null;
}
export declare class Datasource extends ReactNodeView<DatasourceProps> {
private tableWidth;
private isNodeNested;
constructor(props: DatasourceProps);
validUpdate(_: PMNode, newNode: PMNode): boolean;
update(node: PMNode, decorations: ReadonlyArray<Decoration>, _innerDecorations?: DecorationSource): boolean;
createDomRef(): HTMLElement;
/**
* Node views may render interactive elements that should not have their events reach editor
*
* We should the stop editor from handling events from following elements:
* - typing in input
* - activating buttons via spacebar
*
* Can be used to prevent the editor view from trying to handle some or all DOM events that bubble up from the node view.
* Events for which this returns true are not handled by the editor.
* @see {@link https://prosemirror.net/docs/ref/#view.NodeView.stopEvent}
*/
stopEvent(event: Event): boolean;
render(): jsx.JSX.Element;
}
export {};