Skip to content

Commit

Permalink
[docs][examples] Update plain text and rich text examples (#6187)
Browse files Browse the repository at this point in the history
Co-authored-by: Maksym Plavinskyi <Maksym_Plavinskyi@epam.com>
  • Loading branch information
MaxPlav and Maksym Plavinskyi authored Jun 5, 2024
1 parent 2605b8b commit 7306c73
Show file tree
Hide file tree
Showing 21 changed files with 2,556 additions and 298 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Lexical version:
Link to code example:

<!--
Please provide a CodeSandbox (https://codesandbox.io/s/new) or (https://codesandbox.io/s/lexical-plain-text-example-g932e), a link to a
Please provide a CodeSandbox (https://codesandbox.io/s/new) or (https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview), a link to a
repository on GitHub, or provide a minimal code example that reproduces the
problem. You may provide a screenshot of the application if you think it is
relevant to your bug report. Here are some tips for providing a minimal
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ For documentation and more information about Lexical, be sure to [visit the Lexi
Here are some examples of what you can do with Lexical:

- [Lexical Playground](https://playground.lexical.dev)
- [Plain text sandbox](https://codesandbox.io/s/lexical-plain-text-example-g932e)
- [Rich text sandbox](https://codesandbox.io/s/lexical-rich-text-example-5tncvy)
- [Plain text sandbox](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)
- [Rich text sandbox](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-rich?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)


---
Expand All @@ -50,7 +50,7 @@ Install `lexical` and `@lexical/react`:
npm install --save lexical @lexical/react
```

Below is an example of a basic plain text editor using `lexical` and `@lexical/react` ([try it yourself](https://codesandbox.io/s/lexical-plain-text-example-g932e)).
Below is an example of a basic plain text editor using `lexical` and `@lexical/react` ([try it yourself](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)).

```jsx
import {$getRoot, $getSelection} from 'lexical';
Expand Down
7 changes: 7 additions & 0 deletions examples/react-plain-text/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# React Plain Text Lexical example

Here we have simplest Lexical setup in plaintext configuration (`@lexical/plain-text`) with history (`@lexical/history`) and accessibility (`@lexical/dragon`) features enabled.

**Run it locally:** `npm i && npm run dev`

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?file=src/main.tsx)
5 changes: 5 additions & 0 deletions examples/react-plain-text/icons/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bootstrap Icons
https://icons.getbootstrap.com

Licensed under MIT license
https://github.com/twbs/icons/blob/main/LICENSE.md
4 changes: 4 additions & 0 deletions examples/react-plain-text/icons/arrow-clockwise.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions examples/react-plain-text/icons/arrow-counterclockwise.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions examples/react-plain-text/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lexical Plain Text Example</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading

0 comments on commit 7306c73

Please sign in to comment.