1 | import { ALIGNMENT, INDENTATION } from '../groups';
|
2 | export var indentation = {
|
3 | excludes: "indentation " + ALIGNMENT,
|
4 | group: INDENTATION,
|
5 | attrs: {
|
6 | level: {},
|
7 | },
|
8 | parseDOM: [
|
9 | {
|
10 | tag: 'div.fabric-editor-indentation-mark',
|
11 | getAttrs: function (dom) {
|
12 | var level = +(dom.getAttribute('data-level') || '0');
|
13 | return {
|
14 | level: level > 6 ? 6 : level < 1 ? false : level,
|
15 | };
|
16 | },
|
17 | },
|
18 | ],
|
19 | toDOM: function (mark) {
|
20 | return [
|
21 | 'div',
|
22 | {
|
23 | class: 'fabric-editor-block-mark fabric-editor-indentation-mark',
|
24 | 'data-level': mark.attrs.level,
|
25 | },
|
26 | 0,
|
27 | ];
|
28 | },
|
29 | };
|
30 |
|
\ | No newline at end of file |