UNPKG

@atlaskit/adf-schema

Version:

Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs

15 lines 509 B
import { getDomAttrs } from './get-dom-attrs'; import { getParseDOMAttrs } from './get-parse-dom-attrs'; export const createPanelNodeSpecOptions = (allowCustomPanel, generateLocalId) => ({ parseDOM: [{ tag: 'div[data-panel-type]', getAttrs: dom => getParseDOMAttrs(allowCustomPanel, dom, generateLocalId) }], toDOM(node) { const attrs = getDomAttrs(node.attrs); const contentAttrs = { 'data-panel-content': 'true' }; return ['div', attrs, ['div', contentAttrs, 0]]; } });