Skip to content

Commit c5686e5

Browse files
authored
Merge pull request #7092 from umbraco/cms/rte-tiptap-updates
Tiptap RTE updates for v15.4 and v16.0
2 parents 70d80ad + c9a3a06 commit c5686e5

File tree

16 files changed

+263
-2
lines changed

16 files changed

+263
-2
lines changed

15/umbraco-cms/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
* [Configuration](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/configuration.md)
8383
* [Extensions](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/extensions.md)
8484
* [Blocks](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/blocks.md)
85+
* [Style Menu](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/style-menu.md)
8586
* [Change Rich Text Editor UI](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/change-rich-text-editor-ui.md)
8687
* [Rich Text Editor TinyMce](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor-tinymce/README.md)
8788
* [Configuration](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor-tinymce/configuration.md)

15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ The Rich Text Editor (RTE) Tiptap property editor is highly configurable and bas
2121

2222
Customize everything from toolbar options to editor size to where pasted images are saved.
2323

24+
## [Style Menu](style-menu.md)
25+
26+
Define a cascading text formatting and style menu for the Rich Text Editor toolbar.
27+
2428
## [Blocks](blocks.md)
2529

2630
Use Blocks to define specific parts that can be added as part of the markup of the Rich Text Editor.

15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/configuration.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You have full control over which options should be available on the RTE.
88

99
![Toolbar: All options enabled](images/rte-tiptap-all-toolbar-items.png)
1010

11-
In the example above, all 27 options have been enabled. These options include font styles like bold and italics, bullet lists, and options to embed videos and insert images.
11+
In the example above, all 38 options have been enabled. These options include font styles like bold and italics, bullet lists, and options to embed videos and insert images.
1212

1313
You can customize the look of the toolbar:
1414

@@ -17,6 +17,18 @@ You can customize the look of the toolbar:
1717

1818
![Enhance and customize the capabilities of the Rich Text Editor toolbar](images/rte-tiptap-capabilities-and-toolbar.png)
1919

20+
## Statusbar
21+
22+
As well as the toolbar, you can configure extensions for the statusbar.
23+
24+
![Statusbar with Word Count extension enabled](images/rte-tiptap-statusbar.png)
25+
26+
## Stylesheets
27+
28+
To apply custom styles to the Rich Text Editor, you can select from any existing stylesheets.
29+
30+
Stylesheets can be created in the **Settings** section. To learn more about this feature, see the [Stylesheets in the Backoffice](../../../../design/stylesheets-javascript.md) article.
31+
2032
## Dimensions
2133

2234
Define `height` and `width` of the editor displayed in the content section.
Loading
Loading
Loading
Loading
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Style Menu
2+
3+
A Style Menu is a configurable extension that adds a cascading menu to the toolbar for applying text styles and formatting.
4+
5+
![Rich Text Editor cascading style menu](images/rte-tiptap-stylemenu.png)
6+
7+
{% hint style="info" %}
8+
Any custom stylesheets associated with the Rich Text Editor will not auto generate a style menu in the toolbar.
9+
{% endhint %}
10+
11+
### Creating a Style Menu
12+
13+
In this article, you can find an example of how to set up a Style Menu using the package manifest file.
14+
15+
{% code title="umbraco-package.json" %}
16+
```json
17+
{
18+
"name": "Name of your package",
19+
"alias": "My.Package",
20+
"extensions": [
21+
{
22+
"type": "tiptapToolbarExtension",
23+
"kind": "styleMenu",
24+
"alias": "MyCustom.Tiptap.StyleMenu",
25+
"name": "My Custom Tiptap Style Menu",
26+
"meta": {
27+
"alias": "myCustomStyleMenu",
28+
"icon": "icon-palette",
29+
"label": "My custom styles"
30+
},
31+
"items": [
32+
{
33+
"label": "Headings",
34+
"items": [
35+
{
36+
"label": "Heading 2",
37+
"data": { "tag": "h2" },
38+
"appearance": { "icon": "icon-heading-2" }
39+
},
40+
{
41+
"label": "Heading 3",
42+
"data": { "tag": "h3" },
43+
"appearance": { "style": "font-size: large;" }
44+
},
45+
{
46+
"label": "Heading 4",
47+
"data": { "tag": "h4" }
48+
}
49+
]
50+
},
51+
{
52+
"label": "Attributes",
53+
"items": [
54+
{
55+
"label": "Classes",
56+
"data": { "class": "foo" }
57+
},
58+
{
59+
"label": "IDs",
60+
"data": { "id": "bar" }
61+
},
62+
{
63+
"label": "Mixed",
64+
"data": { "tag": "span", "class": "foo", "id": "bar" }
65+
}
66+
]
67+
}
68+
]
69+
}
70+
]
71+
}
72+
```
73+
{% endcode %}
74+
75+
76+
The `items` property defines the structure of the style menu. Each menu item has the following options:
77+
78+
- `label`: _(required)_ The label of the menu item. This supports localization keys.
79+
- `appearance`: This defines the appearance of the menu item. The value has 2 optional properties:
80+
- `icon`: To prefix an icon to the menu item.
81+
- `style`: To apply CSS rules to the menu item.
82+
- `data`: To configure the function of the style menu item. The value has 3 optional properties:
83+
- `tag`: A [supported HTML tag](#supported-html-tags) name. This will be applied to the selected text.
84+
- `class`: Applies a class attribute with the defined class name to the containing tag of the selected text.
85+
- `id`: Applies an ID attribute with the defined ID value to the containing tag of the selected text.
86+
- `separatorAfter`: When `true`, it will add a line separator after the menu item.
87+
- `items`: To enable a cascading menu, an array of nested menu items may be added.
88+
89+
90+
Once configured, all custom style menus will appear in the Rich Text Editor toolbar options, as described in the [Rich Text Editor Configuration](configuration.md) article.
91+
92+
93+
#### Supported HTML tags
94+
95+
Since the Tiptap has a strict rich-text schema, only supported HTML tags can be used in the style menu, _(arbitrary markup will be excluded)._ The following HTML tag names are supported:
96+
97+
- `h1`
98+
- `h2`
99+
- `h3`
100+
- `h4`
101+
- `h5`
102+
- `h6`
103+
- `p`
104+
- `blockquote`
105+
- `code`
106+
- `codeBlock`
107+
- `div`
108+
- `em` (italic)
109+
- `ol`
110+
- `strong` (bold)
111+
- `s` (strike-through)
112+
- `span`
113+
- `u` (underline)
114+
- `ul`

16/umbraco-cms/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
* [Configuration](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/configuration.md)
8282
* [Extensions](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/extensions.md)
8383
* [Blocks](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/blocks.md)
84+
* [Style Menu](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/style-menu.md)
8485
* [Login](fundamentals/backoffice/login.md)
8586
* [Document Blueprints](fundamentals/backoffice/document-blueprints.md)
8687
* [Sidebar](fundamentals/backoffice/sidebar.md)

16/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ The Rich Text Editor property editor is highly configurable and based on [Tiptap
1616

1717
Customize everything from toolbar options to editor size to where pasted images are saved.
1818

19+
## [Style Menu](style-menu.md)
20+
21+
Define a cascading text formatting and style menu for the Rich Text Editor toolbar.
22+
1923
## [Blocks](blocks.md)
2024

2125
Use Blocks to define specific parts that can be added as part of the markup of the Rich Text Editor.

0 commit comments

Comments
 (0)