Skip to content

Commit 93e6e33

Browse files
authored
Merge branch '@ksienkiewicz/docs-core-functionalities' into @ksienkiewicz/docs-guides
2 parents 3d67170 + 90b90d4 commit 93e6e33

6 files changed

Lines changed: 33 additions & 16 deletions

File tree

docs/docs/core-functionalities/rendering-rich-text.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ the only shape difference from the input's `htmlStyle`. See the
5959
- **`useHtmlNormalizer`** - normalize external or messy HTML into the library's canonical
6060
tag subset before rendering. Defaults to `true`. See
6161
[Normalization](/fundamentals/core-concepts#normalization).
62+
- **`allowFontScaling`** - whether to respect the system's accessibility font scaling settings.
6263

6364
:::note
6465

docs/docs/core-functionalities/styling-the-input.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ everything from the container's dimensions down to the color of a bullet point.
1212
- **`htmlStyle`** - the appearance of individual rich text elements: heading
1313
sizes, blockquote borders, code colors, list markers, mention colors, and so
1414
on.
15+
- **`placeholderTextColor`** - the color of the placeholder text.
16+
- **`selectionColor`** - the color of the text selection highlight.
17+
- **`cursorColor`** - the color of the text cursor.
1518

1619
```tsx
1720
<EnrichedTextInput

docs/docs/core-functionalities/web-support.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ detail stays behind the same public API.
1111

1212
## One API across platforms
1313

14-
The web build exposes the **same props, ref methods, and events** as native.
14+
The web build exposes the same core API as native - **props, ref methods, and events** -
15+
with one web-only addition - `sanitizationConfig` prop.
1516
Events keep their native shape too - they arrive as
1617
`NativeSyntheticEvent`, read off `e.nativeEvent`, so
1718
[event-handling](/core-functionalities/handling-events) code is portable as-is:

docs/docs/fundamentals/core-concepts.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ and you talk to it through a `ref`.
1616

1717
This is deliberate. Rich text changes constantly - every character, selection
1818
move and style toggle - and round-tripping all of that through JavaScript state
19-
would be extremely slow and open to a possible de-synchronization of those states.
20-
Keeping it native makes the editor fast and stable.
19+
would be extremely slow and open to a possible de-synchronization of those states
20+
between the JS and native side. Keeping it in the native makes the editor fast and stable.
2121

2222
In practice this means:
2323

@@ -26,6 +26,13 @@ In practice this means:
2626

2727
You never set a `value` prop and re-render to make an edit happen.
2828

29+
:::note
30+
31+
We have one value-setting prop - `defaultValue`. This provides the editor's initial value upon creation,
32+
so we don't violate the _uncontrolled_ nature of the component here.
33+
34+
:::
35+
2936
## HTML is the source of truth
3037

3138
The editor's content is HTML. `setValue` and `defaultValue` seeds it with an HTML string,

docs/docs/fundamentals/getting-started.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ renders the input's output. Both speak HTML - the input
2323
produces it, the display consumes it.
2424

2525
Not only does this library allow you to apply basic rich text styles you know well,
26-
like *bold* or _italic_, but also provides more powerful tools like `mentions`, something
26+
like _bold_ or _italic_, but also provides more powerful tools like _mentions_, something
2727
you will learn more about in the next chapters.
2828

2929
## Prerequisites
@@ -60,7 +60,7 @@ The library contains native code, so rebuild your app after installing. On iOS,
6060
install the pods first:
6161

6262
```sh
63-
cd ios && bundler install && bundler exec pod install
63+
cd ios && pod install
6464
```
6565

6666
### Expo
@@ -103,8 +103,7 @@ Install the package:
103103
</TabItem>
104104
</Tabs>
105105

106-
The shipped components share the React Native's API, minus the functionalities a
107-
browser can't provide. See the _Web support_ guide for what's covered.
106+
The web version should work right out of the box. Check the details in the Web Support section.
108107

109108
## Nightly builds
110109

docs/docs/fundamentals/your-first-editor.mdx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import FirstEditorSrc from '!!raw-loader!@site/src/examples/FirstEditor';
88

99
# Your first editor
1010

11-
Let's build a small editor with a button that toggles bold and lights up when
11+
Let's build a small editor with a button that toggles bold and highlights when
1212
the current selection is bold. It's just enough to see the two moving parts of
1313
the library: **calling methods on the input** and **reading its state back**.
1414

@@ -34,7 +34,9 @@ export default function App() {
3434
}
3535

3636
const styles = StyleSheet.create({
37-
container: { gap: 12 },
37+
container: {
38+
gap: 12
39+
},
3840
input: {
3941
fontSize: 18,
4042
color: '#232736',
@@ -48,9 +50,6 @@ const styles = StyleSheet.create({
4850

4951
## Toggling a style
5052

51-
The input is uncontrolled - you don't change its content through props. Instead
52-
you call methods on it through a `ref` of type `EnrichedTextInputInstance`.
53-
5453
Add a ref and a button that calls `toggleBold`. Each call flips bold on the
5554
current selection, or arms it for the next characters you type if nothing is
5655
selected.
@@ -79,7 +78,9 @@ export default function App() {
7978
}
8079

8180
const styles = StyleSheet.create({
82-
container: { gap: 12 },
81+
container: {
82+
gap: 12
83+
},
8384
input: {
8485
fontSize: 18,
8586
color: '#232736',
@@ -103,8 +104,11 @@ const styles = StyleSheet.create({
103104
});
104105
```
105106

106-
Every other style is toggled similarly via `ref` - there's a `toggleItalic`,
107-
`toggleUnderline`, `toggleH1`, `toggleOrderedList`, and so on.
107+
:::note
108+
109+
To learn how you can toggle each of the available styles, visit [Basic styles](/rich-text-formatting/basic-styles).
110+
111+
:::
108112

109113
## Reading the state back
110114

@@ -147,7 +151,9 @@ export default function App() {
147151
}
148152

149153
const styles = StyleSheet.create({
150-
container: { gap: 12 },
154+
container: {
155+
gap: 12
156+
},
151157
input: {
152158
fontSize: 18,
153159
color: '#232736',

0 commit comments

Comments
 (0)