Skip to content

Commit

Permalink
docs: Added links to API docs for respective packages (#5719)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladlen Fedosov <[email protected]>
Co-authored-by: Vladlen Fedosov <[email protected]>
  • Loading branch information
StyleT and StyleT authored Mar 15, 2024
1 parent 054c983 commit 5385fdf
Show file tree
Hide file tree
Showing 39 changed files with 61 additions and 111 deletions.
2 changes: 2 additions & 0 deletions packages/lexical-clipboard/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `@lexical/clipboard`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_clipboard)

This package contains the functionality for the clipboard feature of Lexical.
2 changes: 2 additions & 0 deletions packages/lexical-code/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `@lexical/code`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_code)

This package contains the functionality for the code blocks and code highlighting for Lexical.
2 changes: 2 additions & 0 deletions packages/lexical-dragon/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `@lexical/dragon`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_dragon)

This package contains compatibility with Dragon NaturallySpeaking accessibility tools.

More documentation coming soon.
2 changes: 2 additions & 0 deletions packages/lexical-file/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `@lexical/file`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_file)

This package contains the functionality for the file import/export feature of Lexical.
2 changes: 2 additions & 0 deletions packages/lexical-hashtag/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `@lexical/hashtag`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_hashtag)

This package contains the functionality for Lexical hashtags.

More documentation coming soon.
4 changes: 3 additions & 1 deletion packages/lexical-headless/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `@lexical/headless`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](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.
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions packages/lexical-history/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `@lexical/history`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_history)

This package contains history helpers for Lexical.

### Methods
Expand Down
4 changes: 3 additions & 1 deletion packages/lexical-html/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `@lexical/html`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](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.

Expand Down Expand Up @@ -38,4 +40,4 @@ const editor = createEditor({ ...config, nodes });

// Or insert them at a selection.
$insertNodes(nodes);
```
```
2 changes: 2 additions & 0 deletions packages/lexical-link/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `@lexical/link`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_link)

This package contains the functionality for Lexical links.

More documentation coming soon.
2 changes: 2 additions & 0 deletions packages/lexical-list/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
`@lexical/list`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](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.

Expand Down
2 changes: 2 additions & 0 deletions packages/lexical-mark/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `@lexical/mark`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_mark)

This package contains helpers and nodes for wrapping content in marks for Lexical.
2 changes: 2 additions & 0 deletions packages/lexical-markdown/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `@lexical/markdown`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_markdown)

This package contains markdown helpers for Lexical: import, export and shortcuts.

## Import and export
Expand Down
2 changes: 2 additions & 0 deletions packages/lexical-offset/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `@lexical/offset`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_offset)

This package contains selection offset helpers for Lexical.
2 changes: 2 additions & 0 deletions packages/lexical-overflow/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `@lexical/overflow`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_overflow)

This package contains selection overflow helpers and nodes for Lexical.
111 changes: 2 additions & 109 deletions packages/lexical-selection/README.md
Original file line number Diff line number Diff line change
@@ -1,112 +1,5 @@
# `@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.
[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_selection)

```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;
```
This package contains selection helpers for Lexical.
2 changes: 2 additions & 0 deletions packages/lexical-table/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `@lexical/table`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_table)

This package contains the functionality for the Tables feature of Lexical.

More documentation coming soon.
2 changes: 2 additions & 0 deletions packages/lexical-text/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `@lexical/text`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_text)

This package contains utilities and helpers for handling Lexical text.
2 changes: 2 additions & 0 deletions packages/lexical-utils/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `@lexical/utils`

[![See API Documentation](https://lexical.dev/img/see-api-documentation.svg)](https://lexical.dev/docs/api/modules/lexical_utils)

This package contains misc utilities for Lexical.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 7
sidebar_label: '@lexical/clipboard'
cache_reset: 1
---

{@import ../../../lexical-clipboard/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 13
sidebar_label: '@lexical/code'
cache_reset: 1
---

{@import ../../../lexical-code/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-dragon.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 15
sidebar_label: '@lexical/dragon'
cache_reset: 1
---

{@import ../../../lexical-dragon/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 15
sidebar_label: '@lexical/file'
cache_reset: 1
---

{@import ../../../lexical-file/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-hashtag.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 14
sidebar_label: '@lexical/hashtag'
cache_reset: 1
---

{@import ../../../lexical-hashtag/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-headless.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 16
sidebar_label: '@lexical/headless'
cache_reset: 1
---

{@import ../../../lexical-headless/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 8
sidebar_label: '@lexical/history'
cache_reset: 1
---

{@import ../../../lexical-history/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 4
sidebar_label: '@lexical/html'
cache_reset: 1
---

{@import ../../../lexical-html/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 15
sidebar_label: '@lexical/link'
cache_reset: 1
---

{@import ../../../lexical-link/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 9
sidebar_label: '@lexical/list'
cache_reset: 1
---

{@import ../../../lexical-list/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-mark.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 4
sidebar_label: '@lexical/mark'
cache_reset: 1
---

{@import ../../../lexical-mark/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 11
sidebar_label: '@lexical/markdown'
cache_reset: 1
---

{@import ../../../lexical-markdown/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-offset.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 12
sidebar_label: '@lexical/offset'
cache_reset: 1
---

{@import ../../../lexical-offset/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-overflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 4
sidebar_label: '@lexical/overflow'
cache_reset: 1
---

{@import ../../../lexical-overflow/README.md}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 4
sidebar_label: '@lexical/selection'
cache_reset: 1
---

{@import ../../../lexical-selection/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 10
sidebar_label: '@lexical/table'
cache_reset: 1
---

{@import ../../../lexical-table/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 5
sidebar_label: '@lexical/text'
cache_reset: 1
---

{@import ../../../lexical-text/README.md}
1 change: 1 addition & 0 deletions packages/lexical-website/docs/packages/lexical-utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ''
sidebar_position: 6
sidebar_label: '@lexical/utils'
cache_reset: 1
---

{@import ../../../lexical-utils/README.md}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5385fdf

Please sign in to comment.