@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
54 lines (52 loc) • 2.53 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPanelTypeBackgroundNoTokens = exports.getPanelTypeBackground = exports.PanelSharedSelectors = exports.PanelSharedCssClassName = void 0;
var _adfSchema = require("@atlaskit/adf-schema");
var _editorPalette = require("@atlaskit/editor-palette");
var lightPanelColors = {
info: '#DEEBFF',
note: '#EAE6FF',
tip: '#E3FCEF',
success: '#E3FCEF',
warning: '#FFFAE6',
error: '#FFEBE6'
};
var prefix = 'ak-editor-panel';
var PanelSharedCssClassName = exports.PanelSharedCssClassName = {
prefix: prefix,
content: "".concat(prefix, "__content"),
icon: "".concat(prefix, "__icon"),
noIcon: "".concat(prefix, "__no-icon")
};
var PanelSharedSelectors = exports.PanelSharedSelectors = {
infoPanel: ".".concat(prefix, "[data-panel-type=").concat(_adfSchema.PanelType.INFO, "]"),
notePanel: ".".concat(prefix, "[data-panel-type=").concat(_adfSchema.PanelType.NOTE, "]"),
warningPanel: ".".concat(prefix, "[data-panel-type=").concat(_adfSchema.PanelType.WARNING, "]"),
errorPanel: ".".concat(prefix, "[data-panel-type=").concat(_adfSchema.PanelType.ERROR, "]"),
successPanel: ".".concat(prefix, "[data-panel-type=").concat(_adfSchema.PanelType.SUCCESS, "]"),
noteButton: "button[aria-label=\"Note\"]",
warningButton: "button[aria-label=\"Warning\"]",
removeButton: "button[aria-label=\"Remove\"]",
colorPalette: "[aria-label=\"Background color\"]",
selectedColor: "[aria-label=\"Light green\"]",
removeEmojiIcon: "[aria-label=\"Remove emoji\"]",
emojiIcon: "[aria-label=\"editor-add-emoji\"]",
selectedEmoji: "[aria-label=\":grinning:\"]",
addYourOwnEmoji: "#add-custom-emoji",
emojiNameInCustomEmoji: "[aria-label=\"Enter a name for the new emoji\"]",
title: "#editor-title",
emojiPopup: "[aria-label=\"Popup\"]",
searchEmoji: "[aria-label=\"Emoji name\"]",
orangeWarningIcon: "[aria-label=\":warning:\"]",
yellowWarningIcon: "[aria-label=\":warning:\"] span:nth-child(1)",
copyButton: "button[aria-label=\"Copy\"]"
};
// Provides the color without tokens, used when converting to a custom panel
var getPanelTypeBackgroundNoTokens = exports.getPanelTypeBackgroundNoTokens = function getPanelTypeBackgroundNoTokens(panelType) {
return lightPanelColors[panelType] || 'none';
};
var getPanelTypeBackground = exports.getPanelTypeBackground = function getPanelTypeBackground(panelType) {
return (0, _editorPalette.hexToEditorBackgroundPaletteColor)(lightPanelColors[panelType]) || 'none';
};