wbu-design-system
Version:
WhereBy.Design is the nascent design system for WhereBy.Us
34 lines (25 loc) • 926 B
JavaScript
import Quill from 'quill';
import Parchment from '../../node_modules/quill/node_modules/parchment';
const Container = Quill.import('blots/container');
class Section extends Container {
static create() {
const node = super.create();
const titlePlaceholderNode = document.createElement('h3');
titlePlaceholderNode.innerHTML = 'A new section';
const contentPlaceholderNode = document.createElement('p');
contentPlaceholderNode.innerHTML = 'Write your heart ♥ out.';
node.appendChild(titlePlaceholderNode);
node.appendChild(contentPlaceholderNode);
return node;
}
constructor(domNode) {
super(domNode);
domNode.classList.add('composer__section__wrapper');
}
}
Section.blotName = 'section';
Section.scope = Parchment.Scope.BLOCK_BLOT;
Section.tagName = ['DIV'];
Section.defaultChild = 'section';
// eslint-disable-next-line import/prefer-default-export
export { Section };