Skip to content

Commit b7dadfb

Browse files
committed
Changed the example to use the "Highlight" extension
The "Task List" extension requires slightly more complexity, as the implementation requires extra CSS style rules (not in the docs).
1 parent 5d34e56 commit b7dadfb

File tree

1 file changed

+22
-22
lines changed
  • 15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor

1 file changed

+22
-22
lines changed

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,67 +30,67 @@ This example assumes that you will be creating an Umbraco package using the Vite
3030
You can learn how to do this [Vite Package Setup](../../../../../customizing/development-flow/vite-package-setup.md) article.
3131
{% endhint %}
3232

33-
In this example, you will take the native Tiptap open-source extension [Task List](https://tiptap.dev/docs/editor/extensions/nodes/task-list). Then register it with the rich text editor and add a toolbar button to invoke the Task List action.
33+
In this example, you will take the native Tiptap open-source extension [Highlight](https://tiptap.dev/docs/editor/extensions/marks/highlight). Then register it with the rich text editor and add a toolbar button to invoke the Task List action.
3434

35-
1. Install both the Task List and Task Item extensions from the npm registry.
35+
1. Install the Highlight extension from the npm registry.
3636

3737
```
38-
npm install @tiptap/extension-task-list @tiptap/extension-task-item
38+
npm install @tiptap/extension-highlight
3939
```
4040

4141
2. Create the code to register the native Tiptap extensions in the rich text editor.
4242

4343
```js
4444
import { UmbTiptapExtensionApiBase } from '@umbraco-cms/backoffice/tiptap';
45-
import { TaskItem } from '@tiptap/extension-task-item';
46-
import { TaskList } from '@tiptap/extension-task-list';
45+
import { Highlight } from '@tiptap/extension-highlight';
4746

48-
export default class UmbTiptapTaskListExtensionApi extends UmbTiptapExtensionApiBase {
49-
getTiptapExtensions = () => [TaskList, TaskItem];
47+
export default class UmbTiptapHighlightExtensionApi extends UmbTiptapExtensionApiBase {
48+
getTiptapExtensions = () => [Highlight];
5049
}
5150
```
5251

53-
3. Create the toolbar action to invoke the Task List extension.
52+
3. Create the toolbar action to invoke the Highlight extension.
5453

5554
```
5655
import { UmbTiptapToolbarElementApiBase } from '@umbraco-cms/backoffice/tiptap';
5756
import type { Editor } from '@umbraco-cms/backoffice/external/tiptap';
5857
59-
export default class UmbTiptapToolbarTaskListExtensionApi extends UmbTiptapToolbarElementApiBase {
58+
export default class UmbTiptapToolbarHighlightExtensionApi extends UmbTiptapToolbarElementApiBase {
6059
override execute(editor?: Editor) {
61-
editor?.chain().focus().toggleTaskList().run();
60+
editor?.chain().focus().toggleHighlight().run();
6261
}
6362
}
6463
```
6564

6665
Once you have the above code in place, they can be referenced in the [package manifest](../../../../../extending/property-editors/package-manifest.md) file.
6766

68-
{% code title="App_Plugins/MyTiptapTaskList/umbraco-package.json" lineNumbers="true" %}
67+
{% code title="App_Plugins/MyTiptapExtension/umbraco-package.json" lineNumbers="true" %}
6968
```json
7069
{
71-
"name": "My Tiptap Task List",
70+
"name": "My Tiptap Extension",
7271
"version": "1.0.0",
7372
"extensions": [
7473
{
7574
"type": "tiptapExtension",
76-
"alias": "My.Tiptap.TaskList",
77-
"name": "My Task List Tiptap Extension",
78-
"api": "/App_Plugins/MyTiptapTaskList/task-list.tiptap-api.js",
75+
"alias": "My.Tiptap.Highlight",
76+
"name": "My Highlight Tiptap Extension",
77+
"api": "/App_Plugins/MyTiptapExtension/highlight.tiptap-api.js",
7978
"meta": {
8079
"icon": "icon-thumbnail-list",
81-
"label": "Task List",
82-
"group": "#tiptap_extGroup_interactive"
80+
"label": "Highlight",
81+
"group": "#tiptap_extGroup_formatting"
8382
}
8483
},
8584
{
8685
"type": "tiptapToolbarExtension",
86+
"kind": "button",
8787
"alias": "My.Tiptap.Toolbar.TaskList",
88-
"name": "My Task List Tiptap Toolbar Extension",
89-
"api": "/App_Plugins/MyTiptapTaskList/task-list.tiptap-toolbar-api.js",
88+
"name": "My Highlight Tiptap Toolbar Extension",
89+
"api": "/App_Plugins/MyTiptapExtension/highlight.tiptap-toolbar-api.js",
9090
"meta": {
91-
"alias": "taskList",
92-
"icon": "icon-thumbnail-list",
93-
"label": "Task List"
91+
"alias": "highlight",
92+
"icon": "icon-brush",
93+
"label": "Highlight"
9494
}
9595
}
9696
]

0 commit comments

Comments
 (0)