@@ -6,34 +6,59 @@ group: Components
66---
77
88import { MarkdownEditor } from ' boot-cell/source/Form/MarkdownEditor' ;
9+ import { FileUploader } from ' boot-cell/source/Form/FileUploader' ;
10+ import { Button } from ' boot-cell/source/Form/Button' ;
911
1012import { Example } from ' ../../../source/component/Example' ;
1113
12- This component is built on the top of [ MarkdownIME] [ 1 ] , these dependencies below should be installed:
14+ This component is built on the top of [ MarkdownIME] [ 1 ] & [ GitHub Markdown CSS] [ 2 ] ,
15+ these dependencies below should be installed:
1316
1417``` Shell
1518npm install markdown-ime marked turndown turndown-plugin-gfm
1619```
1720
18- and a [ CSS library] [ 2 ] is needed, too:
19-
20- ``` HTML
21- <link
22- rel =" stylesheet"
23- href =" https://cdn.jsdelivr.net/npm/github-markdown-css@4.0.0/github-markdown.min.css"
24- />
25- ```
21+ You can ** paste** or ** drop** images into the editor, and ** upload** them on ` <form /> ` submitting.
2622
2723<Example >
28- <MarkdownEditor value = " # WebCell" />
24+ <form onSubmit = { event => event .preventDefault ()} >
25+ <FileUploader
26+ transport = { () => ({
27+ path: Promise .resolve (
28+ ' https://web-cell.dev/WebCell-1.fb612fdb.png'
29+ )
30+ })}
31+ >
32+ <MarkdownEditor value = " WebCell" />
33+ </FileUploader >
34+ <Button type = " submit" color = " success" className = " my-3" >
35+ Submit
36+ </Button >
37+ </form >
2938</Example >
3039
3140``` TSX
3241import { render , createCell } from ' web-cell' ;
3342import { MarkdownEditor } from ' boot-cell/source/Form/MarkdownEditor' ;
43+ import { FileUploader } from ' boot-cell/source/Form/FileUploader' ;
44+ import { Button } from ' boot-cell/source/Form/Button' ;
3445
3546render (
36- <MarkdownEditor value = " # WebCell" />
47+ <form onSubmit = { event => event .preventDefault ()} >
48+ <FileUploader
49+ transport = { () => ({
50+ path: Promise .resolve (
51+ ' https://web-cell.dev/WebCell-1.fb612fdb.png'
52+ )
53+ })}
54+ >
55+ <MarkdownEditor value = " WebCell" />
56+ </FileUploader >
57+
58+ <Button type = " submit" color = " success" className = " my-3" >
59+ Submit
60+ </Button >
61+ </form >
3762);
3863```
3964
0 commit comments