UNPKG

@atlaskit/editor-wikimarkup-transformer

Version:

Wiki markup transformer for JIRA and Confluence

19 lines 418 B
import { encode } from '..'; const panelTypeColorMapping = { info: '#deebff', note: '#eae6ff', success: '#e3fcef', warning: '#fffae6', error: '#ffebe6' }; export const panel = (node, { context } = {}) => { const result = []; node.forEach(n => { result.push(encode(n, context)); }); return `{panel:bgColor=${panelTypeColorMapping[node.attrs.panelType] || ''}} ${result.join('\n\n')} {panel}`; };