@springmicro/rte 0.6.4 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -68
- package/dist/index.js +50415 -38294
- package/dist/style.css +1 -1
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
# @springmicro/rte
|
|
2
|
-
|
|
3
|
-
> WARNING: This package will likely see many breaking changes until its first major release.
|
|
4
|
-
|
|
5
|
-
## Styling
|
|
6
|
-
|
|
7
|
-
For the slate editor styles.
|
|
8
|
-
|
|
9
|
-
```tsx
|
|
10
|
-
import "@springmicro/rte/dist/style.css";
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## PaperEditor
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
import { PaperEditor } from "@springmicro/rte";
|
|
17
|
-
|
|
18
|
-
declare type PaperEditorProps = {
|
|
19
|
-
value?: Descendant[];
|
|
20
|
-
};
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## InlineEditor
|
|
24
|
-
|
|
25
|
-
```tsx
|
|
26
|
-
import { InlineEditor } from "@springmicro/rte";
|
|
27
|
-
|
|
28
|
-
declare type InlineEditorProps = {
|
|
29
|
-
value?: Descendant[];
|
|
30
|
-
setValue?: React.Dispatch<React.SetStateAction<Descendant[]>>;
|
|
31
|
-
readOnly: boolean;
|
|
32
|
-
editor?: BaseEditor & ReactEditor;
|
|
33
|
-
scrollElement?: HTMLElement;
|
|
34
|
-
};
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
`scrollElement` refers to a parent scroll element. The default is the global `window` but if you are placing the `InlineEditor` in a custom scroll element then a reference to that element needs to be placed here to properly position the toolbar either above or below the editor.
|
|
38
|
-
|
|
39
|
-
```jsx
|
|
40
|
-
/**
|
|
41
|
-
* Scroll Element Example
|
|
42
|
-
* Put other content above and below to scroll and see the menu move.
|
|
43
|
-
*/
|
|
44
|
-
export function InlineEditorWithScrolling(props) {
|
|
45
|
-
const [ref, setRef] = React.useState();
|
|
46
|
-
return (
|
|
47
|
-
<div
|
|
48
|
-
style={{ height: "50vh", overflowY: "scroll" }}
|
|
49
|
-
ref={(newRef) => setRef(newRef)}
|
|
50
|
-
>
|
|
51
|
-
<div style={{ color: "#aaa" }}>
|
|
52
|
-
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure sint fuga
|
|
53
|
-
reprehenderit unde dolores expedita, nam, enim repellendus sit
|
|
54
|
-
doloremque eveniet quas vel perferendis! Cumque, eveniet? Dignissimos
|
|
55
|
-
mollitia voluptas provident?
|
|
56
|
-
</div>
|
|
57
|
-
<InlineEditor {...props} scrollElement={ref} />
|
|
58
|
-
<div style={{ color: "#aaa" }}>
|
|
59
|
-
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure sint fuga
|
|
60
|
-
reprehenderit unde dolores expedita, nam, enim repellendus sit
|
|
61
|
-
doloremque eveniet quas vel perferendis! Cumque, eveniet? Dignissimos
|
|
62
|
-
mollitia voluptas provident?
|
|
63
|
-
</div>
|
|
64
|
-
<div style={{ height: "100vh" }}></div>
|
|
65
|
-
</div>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
```
|
|
1
|
+
# @springmicro/rte
|
|
2
|
+
|
|
3
|
+
> WARNING: This package will likely see many breaking changes until its first major release.
|
|
4
|
+
|
|
5
|
+
## Styling
|
|
6
|
+
|
|
7
|
+
For the slate editor styles.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import "@springmicro/rte/dist/style.css";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## PaperEditor
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { PaperEditor } from "@springmicro/rte";
|
|
17
|
+
|
|
18
|
+
declare type PaperEditorProps = {
|
|
19
|
+
value?: Descendant[];
|
|
20
|
+
};
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## InlineEditor
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { InlineEditor } from "@springmicro/rte";
|
|
27
|
+
|
|
28
|
+
declare type InlineEditorProps = {
|
|
29
|
+
value?: Descendant[];
|
|
30
|
+
setValue?: React.Dispatch<React.SetStateAction<Descendant[]>>;
|
|
31
|
+
readOnly: boolean;
|
|
32
|
+
editor?: BaseEditor & ReactEditor;
|
|
33
|
+
scrollElement?: HTMLElement;
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`scrollElement` refers to a parent scroll element. The default is the global `window` but if you are placing the `InlineEditor` in a custom scroll element then a reference to that element needs to be placed here to properly position the toolbar either above or below the editor.
|
|
38
|
+
|
|
39
|
+
```jsx
|
|
40
|
+
/**
|
|
41
|
+
* Scroll Element Example
|
|
42
|
+
* Put other content above and below to scroll and see the menu move.
|
|
43
|
+
*/
|
|
44
|
+
export function InlineEditorWithScrolling(props) {
|
|
45
|
+
const [ref, setRef] = React.useState();
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
style={{ height: "50vh", overflowY: "scroll" }}
|
|
49
|
+
ref={(newRef) => setRef(newRef)}
|
|
50
|
+
>
|
|
51
|
+
<div style={{ color: "#aaa" }}>
|
|
52
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure sint fuga
|
|
53
|
+
reprehenderit unde dolores expedita, nam, enim repellendus sit
|
|
54
|
+
doloremque eveniet quas vel perferendis! Cumque, eveniet? Dignissimos
|
|
55
|
+
mollitia voluptas provident?
|
|
56
|
+
</div>
|
|
57
|
+
<InlineEditor {...props} scrollElement={ref} />
|
|
58
|
+
<div style={{ color: "#aaa" }}>
|
|
59
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure sint fuga
|
|
60
|
+
reprehenderit unde dolores expedita, nam, enim repellendus sit
|
|
61
|
+
doloremque eveniet quas vel perferendis! Cumque, eveniet? Dignissimos
|
|
62
|
+
mollitia voluptas provident?
|
|
63
|
+
</div>
|
|
64
|
+
<div style={{ height: "100vh" }}></div>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
```
|