Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

Commit 3901c15

Browse files
committed
Added multiline attribute on Text, RichText, RichTextExt
React Bricks 3.0 (no beta)
1 parent 28007bb commit 3901c15

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

pages/api-reference/visual-components/rich-text-ext.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface RichTextProps {
1717
renderBlock: (props: RenderElementProps) => JSX.Element
1818
propName: string
1919
placeholder: string
20+
multiline?: boolean
2021
plugins?: types.RichTextPlugin[]
2122
}
2223
```
@@ -28,6 +29,7 @@ interface RichTextProps {
2829
| `renderBlock` | A React functional component used to render each paragraph of text. |
2930
| `propName` | The prop of the Brick component corresponding to this text. |
3031
| `placeholder` | The placeholder to show when the text is empty. |
32+
| `multiline` | Default: `true`. If set to `false` it prevents multiline text. |
3133
| `plugins` | An array of plugins extending the rich text functionality. |
3234

3335
## Change or create a plugin

pages/api-reference/visual-components/rich-text.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface RichTextProps {
2121
renderBlock: (props: RenderElementProps) => JSX.Element
2222
placeholder: string
2323
propName: string
24+
multiline?: boolean
2425
allowedFeatures?: types.RichTextFeatures[]
2526
renderBold?: (props: RenderLeafProps) => JSX.Element
2627
renderItalic?: (props: RenderLeafProps) => JSX.Element
@@ -47,6 +48,7 @@ interface RichTextProps {
4748
| `renderBlock` | A React functional component used to render each paragraph of text. |
4849
| `propName` | The prop of the Brick component corresponding to this text. |
4950
| `placeholder` | The placeholder to show when the text is empty. |
51+
| `multiline` | Default: `true`. If set to `false` it prevents multiline text. |
5052
| `allowedFeatures` | An array of allowed rich text features: the available features are of type [`types.RichTextFeatures`](/api-reference/types/enums#richtextfeatures) |
5153
| `renderBold` | The optional render function for the `BOLD` marker. |
5254
| `renderItalic` | The optional render function for the `ITALIC` marker. |

pages/api-reference/visual-components/text.mdx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,26 @@ interface TextProps {
1616
propName: string
1717
renderBlock: React.FC
1818
placeholder: string
19+
multiline?: boolean
1920
}
2021
```
2122

2223
## Properties definition
2324

24-
| Property | Definition |
25-
| --- | --- |
26-
| `propName` | The prop of the Brick component corresponding to this text. |
25+
| Property | Definition |
26+
| ------------- | ------------------------------------------------------------------------------------------- |
27+
| `propName` | The prop of the Brick component corresponding to this text. |
2728
| `renderBlock` | A React functional component used to render the text.<br />Typically it wraps the children. |
28-
| `placeholder` | The placeholder to show when the text is empty. |
29+
| `placeholder` | The placeholder to show when the text is empty. |
30+
| `multiline` | Default: `false`. If set to `true` allows multiline text. |
2931

3032
## Usage example
3133

3234
```tsx
3335
<Text
3436
propName="claim"
3537
renderBlock={(props: any) => (
36-
<p
37-
className="text-xl font-extrabold"
38-
{...props.attributes}
39-
>
38+
<p className="text-xl font-extrabold" {...props.attributes}>
4039
{props.children}
4140
</p>
4241
)}

pages/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"index": "React Bricks 3.0-beta",
2+
"index": "React Bricks 3.0",
33
"docs": "Documentation",
44
"advanced": "Advanced Guide",
55
"api-reference": "Api Reference"

0 commit comments

Comments
 (0)