1 | export var nestedExpand = {
|
2 | inline: false,
|
3 | content: '(paragraph | heading | mediaSingle | mediaGroup | unsupportedBlock)+',
|
4 | isolating: true,
|
5 | selectable: true,
|
6 | attrs: {
|
7 | title: { default: '' },
|
8 | __expanded: { default: true },
|
9 | },
|
10 | parseDOM: [
|
11 | {
|
12 | context: 'nestedExpand//',
|
13 | tag: '[data-node-type="nestedExpand"]',
|
14 | skip: true,
|
15 | },
|
16 | {
|
17 | tag: '[data-node-type="nestedExpand"] button',
|
18 | ignore: true,
|
19 | },
|
20 | {
|
21 | tag: '[data-node-type="expand"] button',
|
22 | ignore: true,
|
23 | },
|
24 | {
|
25 | tag: 'div[data-node-type="nestedExpand"]',
|
26 | getAttrs: function (domNode) {
|
27 | var dom = domNode;
|
28 | return {
|
29 | title: dom.getAttribute('data-title'),
|
30 | __expanded: true,
|
31 | };
|
32 | },
|
33 | },
|
34 | ],
|
35 | toDOM: function (node) {
|
36 | var attrs = {
|
37 | 'data-node-type': 'nestedExpand',
|
38 | 'data-title': node.attrs.title,
|
39 | 'data-expanded': node.attrs.__expanded,
|
40 | };
|
41 | return ['div', attrs, 0];
|
42 | },
|
43 | };
|
44 |
|
\ | No newline at end of file |