UNPKG

@atlaskit/editor-plugin-show-diff

Version:

ShowDiff plugin for @atlaskit/editor-core

38 lines • 1.97 kB
/* IndicatorBar.tsx generated by @compiled/babel-plugin v3.0.2 */ import "./IndicatorBar.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { fg } from '@atlaskit/platform-feature-flags/fg'; import { getAccentBorderColor } from '../../pm-plugins/decorations/colorSchemes/factory'; import { colorSchemeRegistry } from '../../pm-plugins/decorations/colorSchemes/schemes'; import { AnchorDocMarginKey } from '../../pm-plugins/decorations/decorationKeys'; var barStyles = null; var barAlwaysVisibleStyles = null; var getIndicatorColor = function getIndicatorColor(colorScheme, isInserted) { if (colorScheme === undefined || colorScheme === 'standard' || colorScheme === 'traditional' || isInserted === undefined) { return "var(--ds-border-information, #357DE8)"; } return getAccentBorderColor(colorSchemeRegistry[colorScheme][isInserted ? 'insertColor' : 'deleteColor']); }; export function IndicatorBar(_ref) { var anchorTop = _ref.anchorTop, anchorBottom = _ref.anchorBottom, anchorLeft = _ref.anchorLeft, anchorLeftFallback = _ref.anchorLeftFallback, colorScheme = _ref.colorScheme, isInserted = _ref.isInserted; var leftAnchors = [anchorLeft, anchorLeftFallback, AnchorDocMarginKey].filter(Boolean).map(function (anchor) { return "anchor(--".concat(anchor, " left)"); }).join(', '); return /*#__PURE__*/React.createElement("span", { "data-testid": "diff-indicator-bar", style: { backgroundColor: getIndicatorColor(colorScheme, isInserted), // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values left: "min(".concat(leftAnchors, ")"), top: "anchor(--".concat(anchorTop, " top)"), bottom: "anchor(--".concat(anchorBottom, " bottom)") }, className: ax(["_2rko1rr0 _kqswstnw _1bsb1l7b _lcxvglyw _18u0mgjw _17c61i8t _19pk196n _otyr196n", fg('platform_editor_ai_show_diff_patch_2') && "_17c6oga4"]) }); }