mirror of
https://github.com/facebook/lexical.git
synced 2025-05-17 06:59:17 +08:00
docs: Added links to API docs for respective packages (#5719)
Signed-off-by: Vladlen Fedosov <vladlenfedosov@meta.com> Co-authored-by: Vladlen Fedosov <vladlenfedosov@meta.com>
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
# `@lexical/clipboard`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_clipboard)
|
||||
|
||||
This package contains the functionality for the clipboard feature of Lexical.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# `@lexical/code`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_code)
|
||||
|
||||
This package contains the functionality for the code blocks and code highlighting for Lexical.
|
||||
|
@ -1,5 +1,7 @@
|
||||
# `@lexical/dragon`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_dragon)
|
||||
|
||||
This package contains compatibility with Dragon NaturallySpeaking accessibility tools.
|
||||
|
||||
More documentation coming soon.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# `@lexical/file`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_file)
|
||||
|
||||
This package contains the functionality for the file import/export feature of Lexical.
|
||||
|
@ -1,5 +1,7 @@
|
||||
# `@lexical/hashtag`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_hashtag)
|
||||
|
||||
This package contains the functionality for Lexical hashtags.
|
||||
|
||||
More documentation coming soon.
|
||||
|
@ -1,5 +1,7 @@
|
||||
# `@lexical/headless`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_headless)
|
||||
|
||||
This package allows you to interact with Lexical in a headless environment (one that does not rely on DOM, e.g. for Node.js environment), and use its
|
||||
main features like editor.update(), editor.registerNodeTransform(), editor.registerUpdateListener()
|
||||
to create, update or traverse state.
|
||||
@ -40,7 +42,7 @@ app.get('article/:id/markdown', await (req, res) => {
|
||||
});
|
||||
|
||||
const articleEditorStateJSON = await loadArticleBody(req.query.id);
|
||||
editor.setEditorState(editor.parseEditorState(articleEditorStateJSON));
|
||||
editor.setEditorState(editor.parseEditorState(articleEditorStateJSON));
|
||||
|
||||
editor.update(() => {
|
||||
const markdown = $convertToMarkdownString(TRANSFORMERS);
|
||||
|
@ -1,5 +1,7 @@
|
||||
# `@lexical/history`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_history)
|
||||
|
||||
This package contains history helpers for Lexical.
|
||||
|
||||
### Methods
|
||||
|
@ -1,5 +1,7 @@
|
||||
# `@lexical/html`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_html)
|
||||
|
||||
# HTML
|
||||
This package exports utility functions for converting `Lexical` -> `HTML` and `HTML` -> `Lexical`. These same functions are also used in the `lexical-clipboard` package for copy and paste.
|
||||
|
||||
@ -38,4 +40,4 @@ const editor = createEditor({ ...config, nodes });
|
||||
|
||||
// Or insert them at a selection.
|
||||
$insertNodes(nodes);
|
||||
```
|
||||
```
|
||||
|
@ -1,5 +1,7 @@
|
||||
# `@lexical/link`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_link)
|
||||
|
||||
This package contains the functionality for Lexical links.
|
||||
|
||||
More documentation coming soon.
|
||||
|
@ -1,5 +1,7 @@
|
||||
`@lexical/list`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_list)
|
||||
|
||||
This package exposes the primitives for implementing lists in Lexical. If you're trying to implement conventional lists with React, take a look at the ListPlugin exposed
|
||||
by [@lexical/react](https://lexical.dev/docs/packages/lexical-react), which wraps these primitives into a neat component that you can drop into any LexicalComposer.
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# `@lexical/mark`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_mark)
|
||||
|
||||
This package contains helpers and nodes for wrapping content in marks for Lexical.
|
||||
|
@ -1,5 +1,7 @@
|
||||
# `@lexical/markdown`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_markdown)
|
||||
|
||||
This package contains markdown helpers for Lexical: import, export and shortcuts.
|
||||
|
||||
## Import and export
|
||||
|
@ -1,3 +1,5 @@
|
||||
# `@lexical/offset`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_offset)
|
||||
|
||||
This package contains selection offset helpers for Lexical.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# `@lexical/overflow`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_overflow)
|
||||
|
||||
This package contains selection overflow helpers and nodes for Lexical.
|
||||
|
@ -1,112 +1,5 @@
|
||||
# `@lexical/selection`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_selection)
|
||||
|
||||
This package contains selection helpers for Lexical.
|
||||
|
||||
### Methods
|
||||
|
||||
#### `getStyleObjectFromCSS`
|
||||
|
||||
Given a CSS string, returns an object from the style cache.
|
||||
|
||||
```ts
|
||||
export function getStyleObjectFromCSS(css: string): {
|
||||
[key: string]: string;
|
||||
} | null;
|
||||
```
|
||||
|
||||
#### `$patchStyleText`
|
||||
|
||||
Applies the provided styles to the TextNodes in the provided Selection. Key names in the patch argument should be
|
||||
the valid CSS properties (i.e., kebab-case).
|
||||
|
||||
```ts
|
||||
export function $patchStyleText(
|
||||
selection: BaseSelection,
|
||||
patch: {
|
||||
[key: string]: string;
|
||||
},
|
||||
): void;
|
||||
```
|
||||
|
||||
#### `$getSelectionStyleValueForProperty`
|
||||
|
||||
Given a selection and a valid CSS property name, returns the current value of that property for TextNodes in the Selection, if set. If not set, it returns the defaultValue. If all TextNodes do not have the same value, it returns an empty string.
|
||||
|
||||
```ts
|
||||
export function $getSelectionStyleValueForProperty(
|
||||
selection: RangeSelection,
|
||||
styleProperty: string,
|
||||
defaultValue: string,
|
||||
): string;
|
||||
```
|
||||
|
||||
#### `$moveCaretSelection`
|
||||
|
||||
Moves the selection according to the arguments.
|
||||
|
||||
```ts
|
||||
export function $moveCaretSelection(
|
||||
selection: RangeSelection,
|
||||
isHoldingShift: boolean,
|
||||
isBackward: boolean,
|
||||
granularity: 'character' | 'word' | 'lineboundary',
|
||||
): void;
|
||||
```
|
||||
|
||||
#### `$isParentElementRTL`
|
||||
|
||||
Returns true if the parent of the Selection anchor node is in Right-To-Left mode, false if not.
|
||||
|
||||
```ts
|
||||
export function $isParentElementRTL(selection: RangeSelection): boolean;
|
||||
```
|
||||
|
||||
#### `$moveCharacter`
|
||||
|
||||
Wraps $moveCaretSelection, using character granularity and accounting for RTL mode.
|
||||
|
||||
```ts
|
||||
export function $moveCharacter(
|
||||
selection: RangeSelection,
|
||||
isHoldingShift: boolean,
|
||||
isBackward: boolean,
|
||||
): void;
|
||||
```
|
||||
|
||||
#### `$selectAll`
|
||||
|
||||
Expands the current Selection to cover all of the content in the editor.
|
||||
|
||||
```ts
|
||||
export function $selectAll(selection: RangeSelection): void;
|
||||
```
|
||||
|
||||
#### `$setBlocksType`
|
||||
|
||||
Converts all nodes in the selection that are of one block type to another specified by parameter
|
||||
|
||||
```ts
|
||||
export function $setBlocksType(
|
||||
selection: RangeSelection,
|
||||
createElement: () => ElementNode,
|
||||
): void;
|
||||
```
|
||||
|
||||
#### `$isAtNodeEnd`
|
||||
|
||||
Returns true if the provided point offset is in the last possible position.
|
||||
|
||||
```ts
|
||||
export function $isAtNodeEnd(point: Point): boolean;
|
||||
```
|
||||
|
||||
#### `$shouldOverrideDefaultCharacterSelection`
|
||||
|
||||
Returns true if default character selection should be overridden, false if not. Used with DecoratorNodes
|
||||
|
||||
```ts
|
||||
export function $shouldOverrideDefaultCharacterSelection(
|
||||
selection: RangeSelection,
|
||||
isBackward: boolean,
|
||||
): boolean;
|
||||
```
|
||||
|
@ -1,5 +1,7 @@
|
||||
# `@lexical/table`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_table)
|
||||
|
||||
This package contains the functionality for the Tables feature of Lexical.
|
||||
|
||||
More documentation coming soon.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# `@lexical/text`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_text)
|
||||
|
||||
This package contains utilities and helpers for handling Lexical text.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# `@lexical/utils`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_utils)
|
||||
|
||||
This package contains misc utilities for Lexical.
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 7
|
||||
sidebar_label: '@lexical/clipboard'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-clipboard/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 13
|
||||
sidebar_label: '@lexical/code'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-code/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 15
|
||||
sidebar_label: '@lexical/dragon'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-dragon/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 15
|
||||
sidebar_label: '@lexical/file'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-file/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 14
|
||||
sidebar_label: '@lexical/hashtag'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-hashtag/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 16
|
||||
sidebar_label: '@lexical/headless'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-headless/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 8
|
||||
sidebar_label: '@lexical/history'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-history/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 4
|
||||
sidebar_label: '@lexical/html'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-html/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 15
|
||||
sidebar_label: '@lexical/link'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-link/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 9
|
||||
sidebar_label: '@lexical/list'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-list/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 4
|
||||
sidebar_label: '@lexical/mark'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-mark/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 11
|
||||
sidebar_label: '@lexical/markdown'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-markdown/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 12
|
||||
sidebar_label: '@lexical/offset'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-offset/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 4
|
||||
sidebar_label: '@lexical/overflow'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-overflow/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 4
|
||||
sidebar_label: '@lexical/selection'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-selection/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 10
|
||||
sidebar_label: '@lexical/table'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-table/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 5
|
||||
sidebar_label: '@lexical/text'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-text/README.md}
|
||||
|
@ -2,6 +2,7 @@
|
||||
title: ''
|
||||
sidebar_position: 6
|
||||
sidebar_label: '@lexical/utils'
|
||||
cache_reset: 1
|
||||
---
|
||||
|
||||
{@import ../../../lexical-utils/README.md}
|
||||
|
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="198.25" height="28" role="img" aria-label="SEE API DOCUMENTATION"><title>SEE API DOCUMENTATION</title><g shape-rendering="crispEdges"><rect width="198.25" height="28" fill="#3b82f6"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="100"><text transform="scale(.1)" x="991.25" y="175" textLength="1742.5" fill="#fff" font-weight="bold">SEE API DOCUMENTATION</text></g></svg>
|
After Width: | Height: | Size: 553 B |
@ -1,3 +1,5 @@
|
||||
# `@lexical/yjs`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical_yjs)
|
||||
|
||||
This package provides a set of bindings for Y.js that allow for collaborative editing with Lexical.
|
||||
|
@ -1,5 +1,7 @@
|
||||
# `lexical`
|
||||
|
||||
[](https://lexical.dev/docs/api/modules/lexical)
|
||||
|
||||
Lexical is an extensible JavaScript web text-editor framework with an emphasis on reliability, accessibility, and performance. Lexical aims to provide a best-in-class developer experience, so you can easily prototype and build features with confidence. Combined with a highly extensible architecture, Lexical allows developers to create unique text editing experiences that scale in size and functionality.
|
||||
|
||||
The core of Lexical is a dependency-free text editor engine that allows for powerful, simple and complex,
|
||||
|
Reference in New Issue
Block a user