UNPKG

@atlaskit/editor-plugin-table

Version:

Table plugin for the @atlaskit/editor

34 lines 2.42 kB
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals'; import { isNativeStickySupported } from '../pm-plugins/utils/sticky-header'; // TODO: ED-23976 - Clean up import { createTableView } from './table'; import TableCell from './TableCell'; import TableRow from './TableRow'; import TableRowNativeStickyWithFallback from './TableRowNativeStickyWithFallback'; export var tableView = function tableView(options) { return function (node, view, getPos) { return createTableView(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isCommentEditor, options.isChromelessEditor, options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption); }; }; export var tableCellView = function tableCellView(options) { return function (node, view, getPos) { var _options$pluginInject; return new TableCell(node, view, getPos, options.eventDispatcher, (_options$pluginInject = options.pluginInjectionApi) === null || _options$pluginInject === void 0 || (_options$pluginInject = _options$pluginInject.analytics) === null || _options$pluginInject === void 0 ? void 0 : _options$pluginInject.actions); }; }; export var tableHeaderView = function tableHeaderView(options) { return function (node, view, getPos) { var _options$pluginInject2; return new TableCell(node, view, getPos, options.eventDispatcher, (_options$pluginInject2 = options.pluginInjectionApi) === null || _options$pluginInject2 === void 0 || (_options$pluginInject2 = _options$pluginInject2.analytics) === null || _options$pluginInject2 === void 0 ? void 0 : _options$pluginInject2.actions); }; }; export var tableRowView = function tableRowView(options) { return function (node, view, getPos) { var _options$isDragAndDro; if (isNativeStickySupported((_options$isDragAndDro = options.isDragAndDropEnabled) !== null && _options$isDragAndDro !== void 0 ? _options$isDragAndDro : false) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) { return new TableRowNativeStickyWithFallback(node, view, getPos, options.eventDispatcher, options.pluginInjectionApi); } else { return new TableRow(node, view, getPos, options.eventDispatcher, options.pluginInjectionApi); } }; };