@atlaskit/editor-plugin-show-diff
Version:
ShowDiff plugin for @atlaskit/editor-core
34 lines (31 loc) • 1.97 kB
JavaScript
/**
* 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).
*/
import { addedCellOverlayRoundedStyle, addedCellOverlayStyle, deletedCellOverlayRoundedStyle, deletedCellOverlayStyle, getStandardDeletedRowStyle } from './colorSchemes/standard';
import { deletedTraditionalCellOverlayRoundedStyle, deletedTraditionalCellOverlayStyle, deletedTraditionalRowStyle, traditionalAddedCellOverlayRoundedStyle, traditionalAddedCellOverlayStyle } from './colorSchemes/traditional';
/**
* Pre-refactor deleted-row style for the `<tr>` element.
*/
export var resolveDeletedRowStyleLegacy = function resolveDeletedRowStyleLegacy(colorScheme) {
return colorScheme === 'traditional' ? deletedTraditionalRowStyle : getStandardDeletedRowStyle();
};
/**
* Pre-refactor cell overlay style.
*/
export var resolveCellOverlayStyleLegacy = function resolveCellOverlayStyleLegacy(_ref) {
var colorScheme = _ref.colorScheme,
isInserted = _ref.isInserted,
isRoundedTable = _ref.isRoundedTable;
var isTraditional = colorScheme === 'traditional';
var deletedCellStyle = isTraditional ? isRoundedTable ? deletedTraditionalCellOverlayRoundedStyle : deletedTraditionalCellOverlayStyle : isRoundedTable ? deletedCellOverlayRoundedStyle : deletedCellOverlayStyle;
var addedCellStyle = isTraditional ? isRoundedTable ? traditionalAddedCellOverlayRoundedStyle : traditionalAddedCellOverlayStyle : isRoundedTable ? addedCellOverlayRoundedStyle : addedCellOverlayStyle;
return isInserted ? addedCellStyle : deletedCellStyle;
};