Skip to content

Commit b7f70ed

Browse files
authored
Update peer dependencies version (#246)
* Format examples sources * Update dependencies * Audit fix dependencies
1 parent 52c7723 commit b7f70ed

File tree

22 files changed

+112
-117
lines changed

22 files changed

+112
-117
lines changed

examples/async-atomic-custom-block/index.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useRef, useState, FunctionComponent, useEffect } from 'react'
2-
import MUIRichTextEditor from '../..'
3-
import { TMUIRichTextEditorRef, TAsyncAtomicBlockResponse} from '../../src/MUIRichTextEditor'
2+
import MUIRichTextEditor, { TMUIRichTextEditorRef, TAsyncAtomicBlockResponse } from '../..'
43
import { makeStyles } from '@material-ui/core/styles'
54
import Card from '@material-ui/core/Card'
65
import CardContent from '@material-ui/core/CardContent'
@@ -140,9 +139,9 @@ const MyCardPopover: FunctionComponent<IMyCardPopoverProps> = (props) => {
140139
>
141140
<Grid container spacing={1} className={classes.root}>
142141
<Grid item xs={12}>
143-
<TextField
142+
<TextField
144143
{...textFieldProps}
145-
autoFocus={true}
144+
autoFocus={true}
146145
label="Search term"
147146
name="searchTerm"
148147
placeholder="Type anything here..."
@@ -174,12 +173,12 @@ const MyCardPopover: FunctionComponent<IMyCardPopoverProps> = (props) => {
174173
}
175174

176175
const AsyncAtomicCustomBlock: FunctionComponent = () => {
177-
176+
178177
const ref = useRef<TMUIRichTextEditorRef>(null)
179178
const [anchor, setAnchor] = useState<HTMLElement | null>(null)
180179
return (
181180
<>
182-
<MyCardPopover
181+
<MyCardPopover
183182
anchor={anchor}
184183
onSubmit={(data, insert) => {
185184
if (insert && data.searchTerm) {

examples/async-image-upload/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useRef, useState, FunctionComponent, useEffect } from 'react'
2-
import MUIRichTextEditor from '../..'
3-
import { TMUIRichTextEditorRef, TAsyncAtomicBlockResponse } from '../../src/MUIRichTextEditor'
2+
import MUIRichTextEditor, { TMUIRichTextEditorRef, TAsyncAtomicBlockResponse } from '../..'
43
import Grid from '@material-ui/core/Grid'
54
import { makeStyles } from '@material-ui/core/styles'
65
import Popover from '@material-ui/core/Popover'
@@ -106,8 +105,8 @@ const UploadImagePopover: FunctionComponent<IUploadImagePopoverProps> = (props)
106105
>
107106
<Grid container spacing={1} className={classes.root}>
108107
<Grid item xs={10}>
109-
<TextField
110-
className={classes.textField}
108+
<TextField
109+
className={classes.textField}
111110
disabled
112111
value={data.file?.name || ""}
113112
placeholder="Click icon to attach image"
@@ -167,7 +166,7 @@ const AsyncImageUpload: FunctionComponent = () => {
167166

168167
return (
169168
<>
170-
<UploadImagePopover
169+
<UploadImagePopover
171170
anchor={anchor}
172171
onSubmit={(data, insert) => {
173172
if (insert && data.file) {

examples/atomic-custom-block/index.tsx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React, { useRef, useState, FunctionComponent, useEffect } from 'react'
2-
import MUIRichTextEditor from '../..'
3-
import { TMUIRichTextEditorRef } from '../../src/MUIRichTextEditor'
4-
import { Card, CardHeader, Avatar, CardMedia, CardContent,
5-
Typography, IconButton, CardActions, Grid } from '@material-ui/core'
2+
import MUIRichTextEditor, { TMUIRichTextEditorRef } from '../..'
3+
import {
4+
Card, CardHeader, Avatar, CardMedia, CardContent,
5+
Typography, IconButton, CardActions, Grid
6+
} from '@material-ui/core'
67
import { makeStyles } from '@material-ui/core/styles'
78
import Popover from '@material-ui/core/Popover'
89
import TextField from '@material-ui/core/TextField'
@@ -94,12 +95,12 @@ const MyCard: FunctionComponent<any> = (props) => {
9495
</Typography>
9596
</CardContent>
9697
<CardActions disableSpacing>
97-
<IconButton
98-
aria-label="like card"
98+
<IconButton
99+
aria-label="like card"
99100
onClick={handleLiked}>
100101
<FavoriteIcon />
101102
</IconButton>
102-
<IconButton
103+
<IconButton
103104
aria-label="share"
104105
onClick={handleShared}
105106
>
@@ -161,29 +162,29 @@ const MyCardPopover: FunctionComponent<IMyCardPopoverProps> = (props) => {
161162
>
162163
<Grid container spacing={1} className={classes.root}>
163164
<Grid item xs={6}>
164-
<TextField
165+
<TextField
165166
{...textFieldProps}
166-
autoFocus={true}
167+
autoFocus={true}
167168
label="Title"
168169
name="title"
169170
/>
170171
</Grid>
171172
<Grid item xs={6}>
172-
<TextField
173+
<TextField
173174
{...textFieldProps}
174175
label="Name"
175176
name="name"
176177
/>
177178
</Grid>
178179
<Grid item xs={12}>
179-
<TextField
180+
<TextField
180181
{...textFieldProps}
181182
label="Text"
182183
name="text"
183184
/>
184185
</Grid>
185186
<Grid item xs={12}>
186-
<TextField
187+
<TextField
187188
{...textFieldProps}
188189
label="Image URL"
189190
name="image"
@@ -215,12 +216,12 @@ const MyCardPopover: FunctionComponent<IMyCardPopoverProps> = (props) => {
215216
}
216217

217218
const AtomicCustomBlock: FunctionComponent = () => {
218-
219+
219220
const ref = useRef<TMUIRichTextEditorRef>(null)
220221
const [anchor, setAnchor] = useState<HTMLElement | null>(null)
221222
return (
222223
<>
223-
<MyCardPopover
224+
<MyCardPopover
224225
anchor={anchor}
225226
onSubmit={(data, insert) => {
226227
if (insert) {

examples/autocomplete-atomic/index.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React, { FunctionComponent } from 'react'
22
import Avatar from '@material-ui/core/Avatar'
33
import Chip from '@material-ui/core/Chip'
4-
import MUIRichTextEditor from '../../'
5-
import { TAutocompleteItem } from '../../src/components/Autocomplete'
4+
import MUIRichTextEditor, { TAutocompleteItem } from '../../'
65

76
const save = (data: string) => {
87
console.log(data)
@@ -52,17 +51,17 @@ const CityChip: FunctionComponent<any> = (props) => {
5251
}
5352

5453
return (
55-
<Chip
56-
avatar={<Avatar>{value.image}</Avatar>}
57-
label={value.name}
58-
onClick={handleClick}
54+
<Chip
55+
avatar={<Avatar>{value.image}</Avatar>}
56+
label={value.name}
57+
onClick={handleClick}
5958
/>
6059
)
6160
}
6261

6362
const AutocompleteAtomic = () => {
6463
return (
65-
<MUIRichTextEditor
64+
<MUIRichTextEditor
6665
label="Try typing '/mexico'..."
6766
onSave={save}
6867
customControls={[
@@ -85,4 +84,4 @@ const AutocompleteAtomic = () => {
8584
)
8685
}
8786

88-
export default AutocompleteAtomic
87+
export default AutocompleteAtomic

examples/autocomplete/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import React, { FunctionComponent } from 'react'
22
import ListItemText from '@material-ui/core/ListItemText'
33
import ListItemAvatar from '@material-ui/core/ListItemAvatar'
44
import Avatar from '@material-ui/core/Avatar'
5-
import MUIRichTextEditor from '../../'
6-
import { TAutocompleteItem } from '../../src/components/Autocomplete'
5+
import MUIRichTextEditor, { TAutocompleteItem } from '../../'
76

87
const save = (data: string) => {
98
console.log(data)
@@ -107,7 +106,7 @@ const staff = [
107106

108107
const Autocomplete = () => {
109108
return (
110-
<MUIRichTextEditor
109+
<MUIRichTextEditor
111110
label="Try typing ':grin' or '/mexico'..."
112111
onSave={save}
113112
autocomplete={{
@@ -131,4 +130,4 @@ const Autocomplete = () => {
131130
)
132131
}
133132

134-
export default Autocomplete
133+
export default Autocomplete

examples/basic/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ const save = (data: string) => {
77

88
const Basic = () => {
99
return (
10-
<MUIRichTextEditor
10+
<MUIRichTextEditor
1111
label="Type something here..."
1212
onSave={save}
1313
/>
1414
)
1515
}
1616

17-
export default Basic
17+
export default Basic

examples/custom-controls/index.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React, { FunctionComponent } from 'react'
22
import { Chip, Avatar, Button } from '@material-ui/core'
33
import InvertColorsIcon from '@material-ui/icons/InvertColors'
4-
import MUIRichTextEditor from '../../'
5-
import { TToolbarComponentProps } from '../../src/components/Toolbar'
4+
import MUIRichTextEditor, { TToolbarComponentProps } from '../../'
65
import { EditorState } from 'draft-js'
76

87
const save = (data: string) => {
@@ -23,9 +22,9 @@ const MyBlock = (props: any) => {
2322

2423
const MyCallbackComponent: FunctionComponent<TToolbarComponentProps> = (props) => {
2524
return (
26-
<Chip
25+
<Chip
2726
id={props.id}
28-
avatar={<Avatar>C</Avatar>}
27+
avatar={<Avatar>C</Avatar>}
2928
onClick={props.onMouseDown}
3029
label="Callback"
3130
disabled={props.disabled}
@@ -35,7 +34,7 @@ const MyCallbackComponent: FunctionComponent<TToolbarComponentProps> = (props) =
3534

3635
const ClearComponent: FunctionComponent<TToolbarComponentProps> = (props) => {
3736
return (
38-
<Chip
37+
<Chip
3938
id={props.id}
4039
onClick={props.onMouseDown}
4140
label="Clear all"
@@ -50,7 +49,7 @@ const MyBlockComponent: FunctionComponent<TToolbarComponentProps> = (props) => {
5049
id={props.id}
5150
variant="contained"
5251
onMouseDown={props.onMouseDown}
53-
color={props.active ? "primary": "default"}
52+
color={props.active ? "primary" : "default"}
5453
disabled={props.disabled}
5554
>
5655
My Block
@@ -60,7 +59,7 @@ const MyBlockComponent: FunctionComponent<TToolbarComponentProps> = (props) => {
6059

6160
const CustomControls = () => {
6261
return (
63-
<MUIRichTextEditor
62+
<MUIRichTextEditor
6463
label="Type something here..."
6564
onSave={save}
6665
controls={["title", "bold", "my-block", "my-style", "clear", "my-callback", "clear-callback", "save"]}
@@ -101,4 +100,4 @@ const CustomControls = () => {
101100
)
102101
}
103102

104-
export default CustomControls
103+
export default CustomControls

examples/custom-inline-toolbar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const save = (data: string) => {
88

99
const CustomInlineToolbar = () => {
1010
return (
11-
<MUIRichTextEditor
11+
<MUIRichTextEditor
1212
label="Try selecting some text to show the inline toolbar..."
1313
inlineToolbar={true}
1414
inlineToolbarControls={["bold", "italic", "my-style", "link"]}
@@ -28,4 +28,4 @@ const CustomInlineToolbar = () => {
2828
)
2929
}
3030

31-
export default CustomInlineToolbar
31+
export default CustomInlineToolbar

examples/decorator/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const MyAtDecorator = (props: any) => {
3232

3333
const Decorators = () => {
3434
return (
35-
<MUIRichTextEditor
35+
<MUIRichTextEditor
3636
label="Try writing a #hashtag or a @mention..."
3737
onSave={save}
3838
decorators={[
@@ -49,4 +49,4 @@ const Decorators = () => {
4949
)
5050
}
5151

52-
export default Decorators
52+
export default Decorators

examples/events/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const blur = () => {
3232

3333
const Events = () => {
3434
return (
35-
<MUIRichTextEditor
35+
<MUIRichTextEditor
3636
label="Open the console to see the event callback as you type..."
3737
onSave={save}
3838
onChange={change}
@@ -42,4 +42,4 @@ const Events = () => {
4242
)
4343
}
4444

45-
export default Events
45+
export default Events

0 commit comments

Comments
 (0)