Skip to content

Commit b640ca7

Browse files
[update] Whats new and migration
1 parent 41055e3 commit b640ca7

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

docs/guides/configuration.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,24 @@ You can also specify custom controls as objects in the [`toolbar`](api/config/to
138138

139139
You can specify custom buttons within a [toolbar](api/config/toolbar.md) as follows:
140140

141-
~~~jsx {6-14}
141+
~~~jsx {6-16}
142142
new richtext.Richtext("#root", {
143143
toolbar: [
144144
"bold",
145145
"italic",
146146
"separator",
147147
{
148148
type: "button",
149-
id: "btn1",
150-
icon: "wxo-help",
151-
css: "rounded",
152-
label: "Custom button",
153-
tooltip: "Some tooltip",
154-
handler: () => { /* some action here */ }
149+
id: "custom",
150+
css: "wx-primary",
151+
label: "Count characters",
152+
handler: () => {
153+
const text = widget.getValue(richtext.text.toText);
154+
const charCount = text.replace(/\s/g, "").length;
155+
document.getElementById("count").innerText = charCount;
156+
}
155157
},
156-
// other custom buttons
158+
// other custom controles
157159
],
158160
// other configuration properties
159161
});

docs/news/whats_new.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,28 +100,28 @@ A full list of new events is available [here](/category/richtext-events/)
100100
## Deprecated API
101101

102102
:::warning
103-
Do not use the deprecated API in your projects!
103+
Do not use the deprecated API in your projects! <br/> Refer to the [Migration](news/migration.md) topic for more information.
104104
:::
105105

106-
### Deprecated properties
106+
### [Deprecated properties](news/migration.md#properties-migration)
107107

108-
- `customStats`
109-
- `mode`
110-
- `toolbarBlocks`
108+
- [`customStats`](news/migration.md#--customstats)
109+
- [`mode`](news/migration.md#--mode--layoutmode)
110+
- [`toolbarBlocks`](news/migration.md#--toolbarblocks--toolbar)
111111

112-
### Deprecated methods
112+
### [Deprecated methods](news/migration.md#methods-migration)
113113

114114
- `exitFullScreen()`
115115
- `fullScreen()`
116116
- `getEditorAPI()`
117117
- `getStats()`
118118
- `paint()`
119119

120-
### Deprecated internal methods
120+
### Deprecated internal methods
121121

122-
- `events.fire()`
122+
- [`events.fire()`](news/migration.md#--fire--use-exec-and-intercept)
123123

124-
### Deprecated events
124+
### Deprecated events
125125

126126
- `Action`
127127
- `Change`

0 commit comments

Comments
 (0)