@atlaskit/editor-plugin-table
Version:
Table plugin for the @atlaskit/editor
39 lines (38 loc) • 1.72 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.clearColumnResizingDecorations = exports.buildColumnResizingDecorations = void 0;
var _types = require("../../../types");
var _decoration = require("../../utils/decoration");
var _composeDecorations = require("./compose-decorations");
var updateColumnResizeHandle = function updateColumnResizeHandle(columnResizesDecorations) {
return function (_ref) {
var decorationSet = _ref.decorationSet,
tr = _ref.tr;
return (0, _decoration.updateDecorations)(tr.doc, decorationSet, columnResizesDecorations, _types.TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET);
};
};
var buildColumnResizingDecorations = exports.buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI) {
return function (_ref2) {
var tr = _ref2.tr,
decorationSet = _ref2.decorationSet;
var columnResizesDecorations = columnEndIndex < 0 ? [] : (0, _decoration.createResizeHandleDecoration)(tr, rowEndIndex, {
right: columnEndIndex
}, includeTooltip, getIntl, nodeViewPortalProviderAPI);
return (0, _composeDecorations.composeDecorations)([updateColumnResizeHandle(columnResizesDecorations)])({
decorationSet: decorationSet,
tr: tr
});
};
};
var clearColumnResizingDecorations = exports.clearColumnResizingDecorations = function clearColumnResizingDecorations() {
return function (_ref3) {
var tr = _ref3.tr,
decorationSet = _ref3.decorationSet;
return (0, _composeDecorations.composeDecorations)([updateColumnResizeHandle([])])({
decorationSet: decorationSet,
tr: tr
});
};
};