@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
17 lines (16 loc) • 928 B
TypeScript
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
import type { EditorContainerWidth } from '../types/editor-container-width';
export declare const layoutToWidth: {
default: number;
'full-width': number;
wide: number;
};
/**
* Calculates width of parent node of a nested node (inside layouts, extension)
* If current node selection is not nested will return undefined
*/
export declare const getParentNodeWidth: (pos: number | undefined, state: EditorState, containerWidth: EditorContainerWidth, isFullWidthModeEnabled?: boolean) => number | undefined;
export declare const getNestedParentNode: (tablePos: number, state: EditorState) => PMNode | null;
export declare const getTableContainerWidth: (node?: PMNode) => number;
export declare const getTableWidthWithNumberColumn: (node: PMNode, offset: number) => number;