@atlaskit/editor-plugin-rule
Version:
Rule plugin for @atlaskit/editor-core
25 lines • 1.87 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import { ruleMessages } from '@atlaskit/editor-common/messages/rule';
import { textColorPaletteNew } from '@atlaskit/editor-common/ui-color';
/**
* The dividerColorPalette mirrors the textColorPalette, with the following minor changes –
*/
export var dividerColorPalette = [
// 1. the textColorPalette does not have the "bold gray" color. it is added separately
// in `platform/packages/editor/editor-plugin-text-color/src/pm-plugins/utils/constants.ts`
// by editor-plugin-text-color so we need to do the same for the dividerColorPalette
{
border: "var(--ds-border, #0B120E24)",
label: ruleMessages.boldGrayDividerColor.defaultMessage,
message: ruleMessages.boldGrayDividerColor,
value: '#172B4D'
}].concat(_toConsumableArray(textColorPaletteNew.map(function (swatch) {
return swatch.value.toUpperCase() === '#FFFFFF' ? _objectSpread(_objectSpread({}, swatch), {}, {
label: ruleMessages.defaultDividerColor.defaultMessage,
message: undefined,
value: "var(--ds-border, #0B120E24)"
}) : swatch;
})));