springload / wagtaildraftail

🐦📝🍸 Draft.js editor for Wagtail, built upon Draftail and draftjs_exporter
https://pypi.python.org/pypi/wagtaildraftail
MIT License
24 stars 3 forks source link

Default max level of indentation in the editor #48

Open tomdyson opened 7 years ago

tomdyson commented 7 years ago

See screencast:

draftail-indent

thibaudcolas commented 7 years ago

@tomdyson this is a matter of configuration of the editor, with a maxListNesting attribute (default = 1). This is what overriding the default would look like (proper documentation to come):

WAGTAILADMIN_RICH_TEXT_EDITORS = {
    'lots_of_nesting': {
        'WIDGET': 'wagtaildraftail.widgets.DraftailTextArea',
        'OPTIONS': {
            'enableHorizontalRule': True,
            'enableLineBreak': False,
            'maxListNesting': 5,
            'entityTypes': [
                DRAFT_ENTITY_TYPE_LINK,
                DRAFT_ENTITY_TYPE_DOCUMENT,
            ],
            'blockTypes': [
                DRAFT_BLOCK_TYPE_H3,
                DRAFT_BLOCK_TYPE_UL,
            ],
            'inlineStyles': [
                DRAFT_INLINE_STYLE_BOLD,
                DRAFT_INLINE_STYLE_ITALIC,
            ],
        }
    },
}

We will want this package to come with the most sensible config, so most people don't have to touch all of this – what do you think the default should be?

tomdyson commented 7 years ago

Oh, great, thanks! I think the default should be unlimited, or a high number. I've just checked Dropbox Paper, which limits indents to the 7th level.

thibaudcolas commented 7 years ago

👌 personally I don't like the idea of encouraging nesting, but aligning with other word editors is more important.

jjanssen commented 7 years ago

Word - Office for Mac 2011 has a maximum of 9 (even in landscape)

thibaudcolas commented 7 years ago

Let's go with 9 whenever we get to make the default config.