@atlaskit/editor-plugin-show-diff
Version:
ShowDiff plugin for @atlaskit/editor-core
39 lines (36 loc) • 2.02 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 style decisions that `createChangedRowDOM` made before
* the `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at
* runtime only so the ADF-safety gate can select the equivalent longhand; with that gate off,
* their CSS remains unchanged.
*
* 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 : (0, _standard.getStandardDeletedRowStyle)();
};
/**
* 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;
};