UNPKG

@atlaskit/editor-plugin-show-diff

Version:

ShowDiff plugin for @atlaskit/editor-core

33 lines (30 loc) 1.67 kB
/** * 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). */ import { addedCellOverlayRoundedStyle, addedCellOverlayStyle, deletedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedRowStyle } from './colorSchemes/standard'; import { deletedTraditionalCellOverlayRoundedStyle, deletedTraditionalCellOverlayStyle, deletedTraditionalRowStyle, traditionalAddedCellOverlayRoundedStyle, traditionalAddedCellOverlayStyle } from './colorSchemes/traditional'; /** * Pre-refactor deleted-row style for the `<tr>` element. */ export const resolveDeletedRowStyleLegacy = colorScheme => { return colorScheme === 'traditional' ? deletedTraditionalRowStyle : deletedRowStyle; }; /** * Pre-refactor cell overlay style. */ export const resolveCellOverlayStyleLegacy = ({ colorScheme, isInserted, isRoundedTable }) => { const isTraditional = colorScheme === 'traditional'; const deletedCellStyle = isTraditional ? isRoundedTable ? deletedTraditionalCellOverlayRoundedStyle : deletedTraditionalCellOverlayStyle : isRoundedTable ? deletedCellOverlayRoundedStyle : deletedCellOverlayStyle; const addedCellStyle = isTraditional ? isRoundedTable ? traditionalAddedCellOverlayRoundedStyle : traditionalAddedCellOverlayStyle : isRoundedTable ? addedCellOverlayRoundedStyle : addedCellOverlayStyle; return isInserted ? addedCellStyle : deletedCellStyle; };