import * as sl from 'prosemirror-schema-list'; import { toStyleString } from 'ngx-editor/utils'; const doc = { content: 'block+', }; // :: NodeSpec The text node. const text = { group: 'inline', }; // :: NodeSpec A plain paragraph textblock. Represented in the DOM // as a `

` element. const paragraph = { content: 'inline*', group: 'block', attrs: { align: { default: null, }, }, parseDOM: [ { tag: 'p', getAttrs(dom) { const { textAlign } = dom.style; const align = dom.getAttribute('align') || textAlign || null; return { align, }; }, }, ], toDOM(node) { const { align } = node.attrs; const styles = { textAlign: align !== 'left' ? align : null, }; const style = toStyleString(styles) || null; return ['p', { style }, 0]; }, }; // :: NodeSpec A blockquote (`

`) wrapping one or more blocks. const blockquote = { content: 'block+', group: 'block', defining: true, parseDOM: [{ tag: 'blockquote' }], toDOM() { return ['blockquote', 0]; }, }; // :: NodeSpec A horizontal rule (`
`). const horizontalRule = { group: 'block', parseDOM: [{ tag: 'hr' }], toDOM() { return ['hr']; }, }; // :: NodeSpec A heading textblock, with a `level` attribute that // should hold the number 1 to 6. Parsed and serialized as `

` to // `

` elements. const heading = { attrs: { level: { default: 1, }, align: { default: null, }, }, content: 'inline*', group: 'block', defining: true, parseDOM: [ { tag: 'h1', getAttrs(dom) { const { textAlign } = dom.style; const align = dom.getAttribute('align') || textAlign || null; return { level: 1, align, }; }, }, { tag: 'h2', getAttrs(dom) { const { textAlign } = dom.style; const align = dom.getAttribute('align') || textAlign || null; return { level: 2, align, }; }, }, { tag: 'h3', getAttrs(dom) { const { textAlign } = dom.style; const align = dom.getAttribute('align') || textAlign || null; return { level: 3, align, }; }, }, { tag: 'h4', getAttrs(dom) { const { textAlign } = dom.style; const align = dom.getAttribute('align') || textAlign || null; return { level: 4, align, }; }, }, { tag: 'h5', getAttrs(dom) { const { textAlign } = dom.style; const align = dom.getAttribute('align') || textAlign || null; return { level: 5, align, }; }, }, { tag: 'h6', getAttrs(dom) { const { textAlign } = dom.style; const align = dom.getAttribute('align') || textAlign || null; return { level: 6, align, }; }, }, ], toDOM(node) { const { level, align } = node.attrs; const styles = { textAlign: align !== 'left' ? align : null, }; const style = toStyleString(styles) || null; return [`h${level}`, { style }, 0]; }, }; // :: NodeSpec A code listing. Disallows marks or non-text inline // nodes by default. Represented as a `
` element with a
// `` element inside of it.
const codeBlock = {
    content: 'text*',
    marks: '',
    group: 'block',
    code: true,
    defining: true,
    parseDOM: [
        {
            tag: 'pre',
            preserveWhitespace: 'full',
        },
    ],
    toDOM() {
        return ['pre', ['code', 0]];
    },
};
// :: NodeSpec A hard line break, represented in the DOM as `
`. const hardBreak = { inline: true, group: 'inline', selectable: false, parseDOM: [{ tag: 'br' }], toDOM() { return ['br']; }, }; // :: NodeSpec An inline image (``) node. Supports `src`, // `alt`, and `href` attributes. The latter two default to the empty // string. export const image = { inline: true, attrs: { src: {}, alt: { default: null }, title: { default: null }, width: { default: null }, }, group: 'inline', draggable: true, parseDOM: [ { tag: 'img[src]', getAttrs(dom) { return { src: dom.getAttribute('src'), title: dom.getAttribute('title'), alt: dom.getAttribute('alt'), width: dom.getAttribute('width'), }; }, }, ], toDOM(node) { const { src, alt, title, width } = node.attrs; return ['img', { src, alt, title, width }]; }, }; const listItem = { ...sl.listItem, content: 'paragraph block*', }; const orderedList = { ...sl.orderedList, content: 'list_item+', group: 'block', }; const bulletList = { ...sl.bulletList, content: 'list_item+', group: 'block', }; const nodes = { doc, text, paragraph, blockquote, horizontal_rule: horizontalRule, heading, hard_break: hardBreak, code_block: codeBlock, image, list_item: listItem, ordered_list: orderedList, bullet_list: bulletList, }; export default nodes; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtZWRpdG9yL3NjaGVtYS9ub2Rlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRTlDLE9B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