@yoopta/headings 4.5.2-rc.0 → 4.5.2-rc.1
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 +151 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,11 +1,157 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Headings plugins
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Headings include three plugins for Yoopta-Editor:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- HeadingOne
|
|
6
|
+
- HeadingTwo
|
|
7
|
+
- HeadingThree
|
|
6
8
|
|
|
9
|
+
### Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
yarn add @yoopta/headings
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Usage
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
import { HeadingOne, HeadingTwo, HeadingThree } from '@yoopta/headings';
|
|
19
|
+
|
|
20
|
+
const plugins = [HeadingOne, HeadingTwo, HeadingThree];
|
|
21
|
+
|
|
22
|
+
const Editor = () => {
|
|
23
|
+
return <YooptaEditor plugins={plugins} />;
|
|
24
|
+
};
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## HeadingOne
|
|
28
|
+
|
|
29
|
+
### Default classnames
|
|
30
|
+
|
|
31
|
+
- .yoopta-heading-one
|
|
32
|
+
|
|
33
|
+
### Default options
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
const HeadingOne = new YooptaPlugin({
|
|
37
|
+
options: {
|
|
38
|
+
display: {
|
|
39
|
+
title: 'Heading 1',
|
|
40
|
+
description: 'Big section heading',
|
|
41
|
+
},
|
|
42
|
+
shortcuts: ['h1', '#', '*'],
|
|
43
|
+
},
|
|
44
|
+
});
|
|
7
45
|
```
|
|
8
|
-
const paragraph = require('yoopta-paragraph');
|
|
9
46
|
|
|
10
|
-
|
|
47
|
+
### How to extend
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
const plugins = [
|
|
51
|
+
HeadingOne.extend({
|
|
52
|
+
renders: {
|
|
53
|
+
heading-one: (props) => <YourCustomComponent {...props} />
|
|
54
|
+
},
|
|
55
|
+
options: {
|
|
56
|
+
shortcuts: [`<your custom shortcuts>`],
|
|
57
|
+
align: 'left' | 'center' | 'right',
|
|
58
|
+
display: {
|
|
59
|
+
title: `<your custom title>`,
|
|
60
|
+
description: `<your custom description>`,
|
|
61
|
+
},
|
|
62
|
+
HTMLAttributes: {
|
|
63
|
+
className: '<your classname>',
|
|
64
|
+
// ...other HTML attributes
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
];
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## HeadingTwo
|
|
72
|
+
|
|
73
|
+
### Default classnames
|
|
74
|
+
|
|
75
|
+
- .yoopta-heading-two
|
|
76
|
+
|
|
77
|
+
### Default options
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
const HeadingTwo = new YooptaPlugin({
|
|
81
|
+
options: {
|
|
82
|
+
display: {
|
|
83
|
+
title: 'Heading 2',
|
|
84
|
+
description: 'Medium section heading',
|
|
85
|
+
},
|
|
86
|
+
shortcuts: ['h2', '##'],
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### How to extend
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
const plugins = [
|
|
95
|
+
HeadingTwo.extend({
|
|
96
|
+
renders: {
|
|
97
|
+
heading-two: (props) => <YourCustomComponent {...props} />
|
|
98
|
+
},
|
|
99
|
+
options: {
|
|
100
|
+
shortcuts: [`<your custom shortcuts>`],
|
|
101
|
+
align: 'left' | 'center' | 'right',
|
|
102
|
+
display: {
|
|
103
|
+
title: `<your custom title>`,
|
|
104
|
+
description: `<your custom description>`,
|
|
105
|
+
},
|
|
106
|
+
HTMLAttributes: {
|
|
107
|
+
className: '<your classname>',
|
|
108
|
+
// ...other HTML attributes
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
];
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## HeadingThree
|
|
116
|
+
|
|
117
|
+
### Default classnames
|
|
118
|
+
|
|
119
|
+
- .yoopta-heading-three
|
|
120
|
+
|
|
121
|
+
### Default options
|
|
122
|
+
|
|
123
|
+
```js
|
|
124
|
+
const HeadingThree = new YooptaPlugin({
|
|
125
|
+
options: {
|
|
126
|
+
display: {
|
|
127
|
+
title: 'Heading 3',
|
|
128
|
+
description: 'Small section heading',
|
|
129
|
+
},
|
|
130
|
+
shortcuts: ['h3', '###'],
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### How to extend
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
const plugins = [
|
|
139
|
+
HeadingThree.extend({
|
|
140
|
+
renders: {
|
|
141
|
+
heading-three: (props) => <YourCustomComponent {...props} />
|
|
142
|
+
},
|
|
143
|
+
options: {
|
|
144
|
+
shortcuts: [`<your custom shortcuts>`],
|
|
145
|
+
align: 'left' | 'center' | 'right',
|
|
146
|
+
display: {
|
|
147
|
+
title: `<your custom title>`,
|
|
148
|
+
description: `<your custom description>`,
|
|
149
|
+
},
|
|
150
|
+
HTMLAttributes: {
|
|
151
|
+
className: '<your classname>',
|
|
152
|
+
// ...other HTML attributes
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
];
|
|
11
157
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/headings",
|
|
3
|
-
"version": "4.5.2-rc.
|
|
3
|
+
"version": "4.5.2-rc.1",
|
|
4
4
|
"description": "Headings plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"bugs": {
|
|
40
40
|
"url": "https://github.com/Darginec05/Editor-Yoopta/issues"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "59437277a9ea6b47bb64b9bbbad8c4a96730ef1d"
|
|
43
43
|
}
|