Skip to content

Commit 3c196cc

Browse files
authored
Merge branch '@ksienkiewicz/docs-fundamentals' into @kacperzolkiewski/docs-api-reference
2 parents fe3b12a + 9f38b2d commit 3c196cc

5 files changed

Lines changed: 33 additions & 21 deletions

File tree

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',

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"react": "19.1.1",
3636
"react-dom": "19.1.1",
3737
"react-native": "0.86.0",
38-
"react-native-enriched-html": "1.0.1",
38+
"react-native-enriched-html": "1.1.0",
3939
"react-native-web": "0.21.2"
4040
},
4141
"resolutions": {

docs/yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7537,7 +7537,7 @@ __metadata:
75377537
react: "npm:19.1.1"
75387538
react-dom: "npm:19.1.1"
75397539
react-native: "npm:0.86.0"
7540-
react-native-enriched-html: "npm:1.0.1"
7540+
react-native-enriched-html: "npm:1.1.0"
75417541
react-native-web: "npm:0.21.2"
75427542
languageName: unknown
75437543
linkType: soft
@@ -13292,9 +13292,9 @@ __metadata:
1329213292
languageName: node
1329313293
linkType: hard
1329413294

13295-
"react-native-enriched-html@npm:1.0.1":
13296-
version: 1.0.1
13297-
resolution: "react-native-enriched-html@npm:1.0.1"
13295+
"react-native-enriched-html@npm:1.1.0":
13296+
version: 1.1.0
13297+
resolution: "react-native-enriched-html@npm:1.1.0"
1329813298
dependencies:
1329913299
"@tiptap/core": "npm:3.27.1"
1330013300
"@tiptap/extension-blockquote": "npm:3.27.1"
@@ -13319,7 +13319,7 @@ __metadata:
1331913319
peerDependencies:
1332013320
react: "*"
1332113321
react-native: "*"
13322-
checksum: 10c0/692120bc1bb9bd1698e9d0909d7ec34ef0879b22665da657b27502bb7c86d05fbc3e52981e0d66c6124e779a1844a4e0dde17c7f81932c3fd70e73c43135aeb2
13322+
checksum: 10c0/2037f347164db268e115207241d2642e15e6713c7fb51d48fd44556c724b69d98e4fe82e4dc99b90ef4208bb319262d072020c85afe7991d8a20fef3b2408e4c
1332313323
languageName: node
1332413324
linkType: hard
1332513325

0 commit comments

Comments
 (0)