Skip to content

Commit 508f65e

Browse files
committed
[migrate] move File Uploader & Markdown Editor to independent packages
1 parent 71a99b5 commit 508f65e

29 files changed

Lines changed: 107 additions & 384 deletions

ReadMe.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
```shell
1818
npm install boot-cell \
1919
iterable-observer \
20-
marked turndown turndown-plugin-gfm markdown-ime \
2120
quill quill-image-uploader \
2221
@nuintun/qrcode
2322
```
@@ -129,10 +128,8 @@ npm install boot-cell \
129128
9. [Field](https://web-cell.dev/BootCell/interfaces/form_field.fieldprops.html)
130129
10. [FormField](https://web-cell.dev/BootCell/interfaces/form_formfield.formfieldprops.html)
131130
11. [InputGroup](https://web-cell.dev/BootCell/interfaces/form_inputgroup.inputgroupprops.html)
132-
12. [FileUploader](https://web-cell.dev/BootCell/interfaces/form_fileuploader.fileuploaderprops.html)
133-
13. [FileInput](https://web-cell.dev/BootCell/interfaces/form_fileinput.fileinputprops.html)
134-
14. [MarkdownEditor](https://web-cell.dev/BootCell/interfaces/form_markdowneditor.markdowneditorprops.html)
135-
15. [HTMLEditor](https://web-cell.dev/BootCell/interfaces/form_htmleditor.htmleditorprops.html)
131+
12. [FileInput](https://web-cell.dev/BootCell/interfaces/form_fileinput.fileinputprops.html)
132+
13. [HTMLEditor](https://web-cell.dev/BootCell/interfaces/form_htmleditor.htmleditorprops.html)
136133

137134
### Calendar
138135

@@ -155,8 +152,7 @@ npm install boot-cell \
155152

156153
## Utilities
157154

158-
1. [SafeTurnDown](https://web-cell.dev/BootCell/classes/utility_turndown.safeturndown.html)
159-
2. [encodeQRC](https://web-cell.dev/BootCell/modules/utility_qrcode.html#encodeqrc)
155+
1. [encodeQRC](https://web-cell.dev/BootCell/modules/utility_qrcode.html#encodeqrc)
160156

161157
## Theme
162158

package.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"dependencies": {
2727
"@swc/helpers": "^0.3.2",
2828
"classnames": "^2.3.1",
29+
"file-cell": "^0.1.0",
2930
"regenerator-runtime": "^0.13.9",
3031
"web-cell": "^2.4.0-rc.6",
3132
"web-utility": "^3.0.0"
@@ -37,13 +38,9 @@
3738
"bootstrap-icons": "^1.0.0",
3839
"dialog-polyfill": "^0.5.0",
3940
"iterable-observer": "^1.0.0-rc.0",
40-
"markdown-ime": "^1.0.3",
41-
"marked": "^4.0.0",
4241
"quill": "^1.3.7",
4342
"quill-image-uploader": "^1.2.2",
44-
"share-api-polyfill": "1.0.21",
45-
"turndown": "^7.1.1",
46-
"turndown-plugin-gfm": "^1.0.2"
43+
"share-api-polyfill": "1.0.21"
4744
},
4845
"devDependencies": {
4946
"@jest/types": "^27.4.2",
@@ -55,7 +52,6 @@
5552
"@tech_query/snabbdom-looks-like": "^2.0.1",
5653
"@types/classnames": "^2.3.1",
5754
"@types/jest": "^27.4.0",
58-
"@types/marked": "^4.0.2",
5955
"@types/quill": "^2.0.9",
6056
"@types/resize-observer-browser": "^0.1.7",
6157
"@types/turndown": "^5.0.1",
@@ -68,8 +64,7 @@
6864
"jest": "^27.4.7",
6965
"less": "^4.1.2",
7066
"lint-staged": "^12.3.3",
71-
"markdown-ime": "^1.0.3",
72-
"marked": "^4.0.12",
67+
"markdown-area-element": "^0.2.3",
7368
"open-cli": "^7.0.1",
7469
"parcel": "^2.2.1",
7570
"postcss": "^8.4.6",
@@ -78,9 +73,8 @@
7873
"quill-image-uploader": "^1.2.2",
7974
"ts-jest": "^27.1.3",
8075
"ts-node": "^10.4.0",
81-
"turndown": "^7.1.1",
82-
"turndown-plugin-gfm": "^1.0.2",
8376
"typedoc": "^0.22.11",
77+
"typedoc-plugin-mdn-links": "^1.0.5",
8478
"typescript": "~4.3.5"
8579
},
8680
"scripts": {

source/Calendar/MonthCalendar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class MonthCalendar extends mixin<
127127
{ dayGrid }: MonthCalendarState
128128
) {
129129
return (
130-
<Fragment>
130+
<>
131131
<header className="d-flex justify-content-between align-items-center py-3">
132132
<IconButton
133133
className="px-2"
@@ -148,7 +148,7 @@ export class MonthCalendar extends mixin<
148148
<tr>{this.renderRow(row, index)}</tr>
149149
))}
150150
</CalendarTable>
151-
</Fragment>
151+
</>
152152
);
153153
}
154154
}

source/Content/Card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ export function Card({
129129
)}
130130
>
131131
{column ? (
132-
<Fragment>
132+
<>
133133
{header}
134134
{banner}
135135
{body}
136136
{footer}
137-
</Fragment>
137+
</>
138138
) : (
139139
<div className="row no-gutters align-items-center">
140140
<div className="col-md-4">{banner}</div>

source/Content/EdgeDetector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class EdgeDetector extends mixin<EdgeDetectorProps>() {
4242

4343
render() {
4444
return (
45-
<Fragment>
45+
<>
4646
<div ref={this.watch.bind(this, 'top')}>
4747
<slot name="top" />
4848
</div>
@@ -60,7 +60,7 @@ export class EdgeDetector extends mixin<EdgeDetectorProps>() {
6060
<div ref={this.watch.bind(this, 'bottom')}>
6161
<slot name="bottom" />
6262
</div>
63-
</Fragment>
63+
</>
6464
);
6565
}
6666
}

source/Content/Jumbotron.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ export function Jumbotron({
1616
...rest
1717
}: JumbotronProps) {
1818
const content = (
19-
<Fragment>
19+
<>
2020
<h1 className="display-4">{title}</h1>
2121
<p className="lead">{description}</p>
2222

2323
{defaultSlot[0] && (
24-
<Fragment>
24+
<>
2525
<hr className="my-4" />
2626
{defaultSlot}
27-
</Fragment>
27+
</>
2828
)}
29-
</Fragment>
29+
</>
3030
);
3131

3232
return (

source/Content/MediaObject.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function MediaObject({
2828
const Tag = listItem ? 'li' : 'div',
2929
Class = classNames('d-flex', !start && 'flex-row-reverse', className);
3030
const body = (
31-
<Fragment>
31+
<>
3232
<div className="flex-shrink-0">
3333
{typeof image === 'string' ? (
3434
<img
@@ -45,7 +45,7 @@ export function MediaObject({
4545
<h5 className="mt-0">{title}</h5>
4646
{defaultSlot}
4747
</div>
48-
</Fragment>
48+
</>
4949
);
5050

5151
return (

source/Content/SplitView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class SplitView extends mixin() {
3636
const [left, right] = this.defaultSlot;
3737

3838
return (
39-
<Fragment>
39+
<>
4040
<div style={{ width: '25%' }}>{left}</div>
4141
<div
4242
className="border border-secondary m-1"
@@ -46,7 +46,7 @@ export class SplitView extends mixin() {
4646
ref={this.watchLine}
4747
/>
4848
<div className="flex-fill">{right}</div>
49-
</Fragment>
49+
</>
5050
);
5151
}
5252
}

source/Content/TabView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export class TabView extends mixin<TabViewProps>() {
259259
);
260260

261261
return (
262-
<Fragment>
262+
<>
263263
{type === 'nav' ? (
264264
<Nav
265265
direction={direction}
@@ -285,7 +285,7 @@ export class TabView extends mixin<TabViewProps>() {
285285
)}
286286

287287
<div className={bodyClass}>{bodies}</div>
288-
</Fragment>
288+
</>
289289
);
290290
}
291291
}

source/Form/FileInput/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
watch,
88
createCell
99
} from 'web-cell';
10+
import { FileCell } from 'file-cell';
1011

11-
import { FileUploader } from '../FileUploader';
1212
import style from './index.less';
1313

1414
export interface FileInputProps extends WebFieldProps {
@@ -58,7 +58,7 @@ export class FileInput extends mixinForm<FileInputProps>() {
5858
connectedCallback() {
5959
this.classList.add(style.fileBox);
6060

61-
this.closest<FileUploader>('file-uploader')?.addEventListener(
61+
this.closest<FileCell>('file-cell')?.addEventListener(
6262
'upload',
6363
({ detail: { file, path } }) => {
6464
if (file === this.files[0]) this.value = path;

0 commit comments

Comments
 (0)