diff --git a/docs/docs/fundamentals/your-first-editor.mdx b/docs/docs/fundamentals/your-first-editor.mdx index 716674f11..47050c811 100644 --- a/docs/docs/fundamentals/your-first-editor.mdx +++ b/docs/docs/fundamentals/your-first-editor.mdx @@ -198,4 +198,13 @@ Here's that editor running live on this page. Select some text and hit **Bold** notice the button turns green whenever the cursor sits on bold text. Switch to the **Code** tab to see the exact source. +:::note + +The `htmlStyle` you'll spot in the Code tab is only there to make the rendered +text match these docs' color palette, so +don't worry about it here. If you want to learn more, see +[Styling the input](/core-functionalities/styling-the-input). + +::: + diff --git a/docs/src/css/typography.css b/docs/src/css/typography.css index 0d94325c1..89625201d 100644 --- a/docs/src/css/typography.css +++ b/docs/src/css/typography.css @@ -171,6 +171,10 @@ code { border-bottom: 1px solid var(--ifm-font-color-base); } +.eti-editor a { + border-bottom: none; +} + /* Sidebar */ [class*='menu__list-item-collapsible'] a { font-family: var(--swm-title-font); diff --git a/docs/src/examples/BasicStylesEditor.tsx b/docs/src/examples/BasicStylesEditor.tsx index 8adff21ee..b932e2de1 100644 --- a/docs/src/examples/BasicStylesEditor.tsx +++ b/docs/src/examples/BasicStylesEditor.tsx @@ -5,6 +5,7 @@ import type { } from 'react-native-enriched-html'; import { useRef, useState } from 'react'; import { View, StyleSheet, Pressable, Text } from 'react-native'; +import { htmlStyle } from './htmlStyle'; export default function App() { const ref = useRef(null); @@ -73,6 +74,7 @@ export default function App() { setState(e.nativeEvent)} /> diff --git a/docs/src/examples/FirstEditor.tsx b/docs/src/examples/FirstEditor.tsx index 5578d685b..7c60f7e25 100644 --- a/docs/src/examples/FirstEditor.tsx +++ b/docs/src/examples/FirstEditor.tsx @@ -5,6 +5,7 @@ import type { } from 'react-native-enriched-html'; import { useRef, useState } from 'react'; import { View, StyleSheet, Pressable, Text } from 'react-native'; +import { htmlStyle } from './htmlStyle'; export default function App() { const ref = useRef(null); @@ -15,6 +16,7 @@ export default function App() { setState(e.nativeEvent)} /> diff --git a/docs/src/examples/ImagesEditor.tsx b/docs/src/examples/ImagesEditor.tsx index 2e459522e..2da583356 100644 --- a/docs/src/examples/ImagesEditor.tsx +++ b/docs/src/examples/ImagesEditor.tsx @@ -2,6 +2,7 @@ import { EnrichedTextInput } from 'react-native-enriched-html'; import type { EnrichedTextInputInstance } from 'react-native-enriched-html'; import { useRef } from 'react'; import { View, StyleSheet, Pressable, Text } from 'react-native'; +import { htmlStyle } from './htmlStyle'; export default function App() { const ref = useRef(null); @@ -23,6 +24,7 @@ export default function App() { diff --git a/docs/src/examples/LinksEditor.tsx b/docs/src/examples/LinksEditor.tsx index e4d64fd94..03392d744 100644 --- a/docs/src/examples/LinksEditor.tsx +++ b/docs/src/examples/LinksEditor.tsx @@ -5,6 +5,7 @@ import type { } from 'react-native-enriched-html'; import { useRef, useState } from 'react'; import { View, StyleSheet, Pressable, Text } from 'react-native'; +import { htmlStyle } from './htmlStyle'; // Autolink any "issue-123" style token. const linkRegex = /issue-\d+/g; @@ -33,6 +34,7 @@ export default function App() { setSelection(e.nativeEvent)} diff --git a/docs/src/examples/ListsEditor.tsx b/docs/src/examples/ListsEditor.tsx index 4336969f4..35c5d401f 100644 --- a/docs/src/examples/ListsEditor.tsx +++ b/docs/src/examples/ListsEditor.tsx @@ -5,6 +5,7 @@ import type { } from 'react-native-enriched-html'; import { useRef, useState } from 'react'; import { View, StyleSheet, Pressable, Text } from 'react-native'; +import { htmlStyle } from './htmlStyle'; export default function App() { const ref = useRef(null); @@ -52,6 +53,7 @@ export default function App() { setState(e.nativeEvent)} /> diff --git a/docs/src/examples/MentionEditor.tsx b/docs/src/examples/MentionEditor.tsx index efd3e9216..3444a8a70 100644 --- a/docs/src/examples/MentionEditor.tsx +++ b/docs/src/examples/MentionEditor.tsx @@ -2,6 +2,7 @@ import { EnrichedTextInput } from 'react-native-enriched-html'; import type { EnrichedTextInputInstance } from 'react-native-enriched-html'; import { useRef } from 'react'; import { View, StyleSheet, Pressable, Text } from 'react-native'; +import { htmlStyle } from './htmlStyle'; const user = { id: '1', name: 'John' }; @@ -18,6 +19,7 @@ export default function App() { diff --git a/docs/src/examples/RenderingEditor.tsx b/docs/src/examples/RenderingEditor.tsx index 3040dd015..477a1817e 100644 --- a/docs/src/examples/RenderingEditor.tsx +++ b/docs/src/examples/RenderingEditor.tsx @@ -5,6 +5,7 @@ import type { } from 'react-native-enriched-html'; import { useRef, useState } from 'react'; import { View, StyleSheet, Pressable, Text } from 'react-native'; +import { htmlStyle, enrichedTextHtmlStyle } from './htmlStyle'; export default function App() { const ref = useRef(null); @@ -43,6 +44,7 @@ export default function App() { setState(e.nativeEvent)} /> @@ -74,7 +76,10 @@ export default function App() { - + {html} diff --git a/docs/src/examples/TextAlignmentEditor.tsx b/docs/src/examples/TextAlignmentEditor.tsx index addc7d991..9a92e8732 100644 --- a/docs/src/examples/TextAlignmentEditor.tsx +++ b/docs/src/examples/TextAlignmentEditor.tsx @@ -5,6 +5,7 @@ import type { } from 'react-native-enriched-html'; import { useRef, useState } from 'react'; import { View, StyleSheet, Pressable, Text } from 'react-native'; +import { htmlStyle } from './htmlStyle'; const alignments = ['left', 'center', 'right', 'justify'] as const; @@ -32,6 +33,7 @@ export default function App() { setState(e.nativeEvent)} /> diff --git a/docs/src/examples/TextShortcutsEditor.tsx b/docs/src/examples/TextShortcutsEditor.tsx index d3d26422b..d4903b212 100644 --- a/docs/src/examples/TextShortcutsEditor.tsx +++ b/docs/src/examples/TextShortcutsEditor.tsx @@ -2,6 +2,7 @@ import { EnrichedTextInput } from 'react-native-enriched-html'; import type { EnrichedTextInputInstance } from 'react-native-enriched-html'; import { useRef } from 'react'; import { View, StyleSheet } from 'react-native'; +import { htmlStyle } from './htmlStyle'; export default function App() { const ref = useRef(null); @@ -11,6 +12,7 @@ export default function App() {