@atlaskit/editor-plugin-show-diff
Version:
ShowDiff plugin for @atlaskit/editor-core
37 lines (34 loc) • 1.86 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.resolveDeletedRowStyleLegacy = exports.resolveCellOverlayStyleLegacy = void 0;
var _standard = require("./colorSchemes/standard");
var _traditional = require("./colorSchemes/traditional");
/**
* Pre-refactor code preserved for the OFF cohort of
* `platform_editor_show_diff_color_scheme_refactor`.
*
* These resolvers reproduce the per-scheme string-constant style decisions that
* `createChangedRowDOM` made before the `colorSchemeRegistry` + `factory.ts` migration, verbatim.
*
* Do not modify. Delete this file at experiment cleanup (EDITOR-8281).
*/
/**
* Pre-refactor deleted-row style for the `<tr>` element.
*/
var resolveDeletedRowStyleLegacy = exports.resolveDeletedRowStyleLegacy = function resolveDeletedRowStyleLegacy(colorScheme) {
return colorScheme === 'traditional' ? _traditional.deletedTraditionalRowStyle : _standard.deletedRowStyle;
};
/**
* Pre-refactor cell overlay style.
*/
var resolveCellOverlayStyleLegacy = exports.resolveCellOverlayStyleLegacy = function resolveCellOverlayStyleLegacy(_ref) {
var colorScheme = _ref.colorScheme,
isInserted = _ref.isInserted,
isRoundedTable = _ref.isRoundedTable;
var isTraditional = colorScheme === 'traditional';
var deletedCellStyle = isTraditional ? isRoundedTable ? _traditional.deletedTraditionalCellOverlayRoundedStyle : _traditional.deletedTraditionalCellOverlayStyle : isRoundedTable ? _standard.deletedCellOverlayRoundedStyle : _standard.deletedCellOverlayStyle;
var addedCellStyle = isTraditional ? isRoundedTable ? _traditional.traditionalAddedCellOverlayRoundedStyle : _traditional.traditionalAddedCellOverlayStyle : isRoundedTable ? _standard.addedCellOverlayRoundedStyle : _standard.addedCellOverlayStyle;
return isInserted ? addedCellStyle : deletedCellStyle;
};