import { css, cx } from '@emotion/css'; import { ReactEditor } from '@src/components/slate-packages/slate-react'; import { f } from '@src/resource/string'; import { min } from 'lodash'; import React from 'react'; import { COLOR_DEFAULT } from '../Components'; import { ColorButton } from './buttons'; import { colorArray, colorChoice, ColorFormat } from './color'; const DEFAULT_COLOR = { FONT: 'rgb(0, 0, 0)', BACKGROUND: 'rgb(255, 255, 255)', }; const getDefaultColor = (colorFormat: ColorFormat) => { return colorFormat === 'fontColor' ? DEFAULT_COLOR.FONT : DEFAULT_COLOR.BACKGROUND; }; export const dropdownMenuColor = (editor: any, colorFormat: ColorFormat, callback: any, curSelectedColor: string) => (