/
quill.py
51 lines (38 loc) · 1.05 KB
/
quill.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from bokeh.core.properties import (
Any, Bool, Either, Enum, List, String,
)
from ..io.resources import bundled_files
from ..util import classproperty
from .layout import HTMLBox
class QuillInput(HTMLBox):
"""
WYSIWYG text editor based on Quill.js
"""
__css_raw__ = [
'https://cdn.quilljs.com/1.3.6/quill.bubble.css',
'https://cdn.quilljs.com/1.3.6/quill.snow.css'
]
__javascript_raw__ = [
'https://cdn.quilljs.com/1.3.6/quill.js',
]
@classproperty
def __javascript__(cls):
return bundled_files(cls)
@classproperty
def __css__(cls):
return bundled_files(cls, 'css')
@classproperty
def __js_skip__(cls):
return {'Quill': cls.__javascript__}
__js_require__ = {
'paths': {
'Quill': 'https://cdn.quilljs.com/1.3.6/quill',
},
'exports': {
'Quill': 'Quill'
}
}
mode = Enum("bubble", "toolbar", default='toolbar')
placeholder = String()
text = String()
toolbar = Either(List(Any), Bool)