@atlaskit/editor-plugin-table
Version:
Table plugin for the @atlaskit/editor
90 lines (89 loc) • 3.06 kB
TypeScript
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
import { type PluginInjectionAPI } from '../types';
import TableNodeView from './TableNodeViewBase';
export default class TableRowNativeStickyWithFallback extends TableNodeView<HTMLTableRowElement> implements NodeView {
private nodeVisibilityObserverCleanupFn?;
cleanup: () => void;
constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher, api?: PluginInjectionAPI);
subscribeWhenRowVisible(): void;
/**
* Variables
*/
private isHeaderRow;
private isInNestedTable;
private isStickyHeaderEnabled;
private editorScrollableElement?;
private colControlsOffset;
private focused;
private topPosEditorElement;
private isLegacySticky;
private intersectionObserver?;
private resizeObserver?;
private tableContainerObserver?;
private sentinels;
private sentinelData;
private stickyRowHeight?;
private listening;
private padding;
private top;
private api?;
/** Native sticky header variables */
private overflowObserver?;
private stickyStateObserver?;
private hasScrolledSinceLoad;
private scrollListener?;
private overflowObserverEntries?;
private isNativeSticky?;
private disableNativeSticky;
private onEditorContentAreaHeightChange?;
private editorContentAreaHeight?;
private nodeVisibilityObserver?;
/**
* Methods: Nodeview Lifecycle
*/
update(node: PMNode, ..._args: any[]): boolean;
destroy(): void;
ignoreMutation(mutationRecord: MutationRecord | {
target: Node;
type: 'selection';
}): boolean;
/**
* Methods
*/
private headerRowMouseScrollEnd;
private headerRowMouseScroll;
private subscribe;
private unsubscribe;
private initOverflowObserver;
/**
* This observer is used to track the 'stuck' state of the header row.
* This roughly mimics `(at)container scroll-state(stuck: top)` in CSS,
* but with full browser support.
*/
private initStickyStateObserver;
private initObservers;
private initNodeVisibilityObserver;
private createResizeObserver;
private createIntersectionObserver;
private refreshLegacyStickyState;
private shouldSticky;
private isHeaderSticky;
private onTablePluginState;
private updateStickyHeaderWidth;
/**
* Manually refire the intersection observers.
* Useful when the header may have detached from the table.
*/
private refireIntersectionObservers;
private toggleDisableNativeSticky;
private makeHeaderRowLegacySticky;
private makeRowHeaderNotLegacySticky;
private getWrapperoffset;
private getWrapperRefTop;
private getScrolledTableTop;
private getCurrentTableTop;
private emitOn;
private emitOff;
}