-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
213 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,159 +1,25 @@ | ||
# API | ||
**API** • **Docs** | ||
|
||
## Table of contents | ||
*** | ||
|
||
### Functions | ||
# API | ||
|
||
- [RichTextarea](API.md#richtextarea) | ||
- [experimental\_RichInput](API.md#experimental_richinput) | ||
- [createRegexRenderer](API.md#createregexrenderer) | ||
- [createCSSCustomHighlightRenderer](API.md#createcsscustomhighlightrenderer) | ||
## Functions | ||
|
||
### Interfaces | ||
- [RichTextarea](functions/RichTextarea.md) | ||
- [experimental\_RichInput](functions/experimental_RichInput.md) | ||
- [createRegexRenderer](functions/createRegexRenderer.md) | ||
- [createCSSCustomHighlightRenderer](functions/createCSSCustomHighlightRenderer.md) | ||
|
||
## Interfaces | ||
|
||
- [RichTextareaProps](interfaces/RichTextareaProps.md) | ||
- [RichTextareaHandle](interfaces/RichTextareaHandle.md) | ||
- [RichInputProps](interfaces/RichInputProps.md) | ||
- [RichInputHandle](interfaces/RichInputHandle.md) | ||
|
||
### Type Aliases | ||
|
||
- [StyleOrRender](API.md#styleorrender) | ||
- [Renderer](API.md#renderer) | ||
- [CaretPosition](API.md#caretposition) | ||
|
||
## Functions | ||
|
||
### RichTextarea | ||
|
||
▸ **RichTextarea**(`props`): `ReactNode` | ||
|
||
Textarea component with some extra props. See [RichTextareaProps](interfaces/RichTextareaProps.md) and [RichTextareaHandle](interfaces/RichTextareaHandle.md). | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `props` | `Omit`<[`RichTextareaProps`](interfaces/RichTextareaProps.md), ``"ref"``\> & `RefAttributes`<[`RichTextareaHandle`](interfaces/RichTextareaHandle.md)\> | | ||
|
||
#### Returns | ||
|
||
`ReactNode` | ||
|
||
#### Defined in | ||
|
||
[src/textarea.tsx:128](https://github.com/inokawa/rich-textarea/blob/dc63a9fde91f2e2855d6240be87ca131d128cc23/src/textarea.tsx#L128) | ||
|
||
___ | ||
|
||
### experimental\_RichInput | ||
|
||
▸ **experimental_RichInput**(`props`): `ReactNode` | ||
|
||
Input component with some extra props. See [RichInputProps](interfaces/RichInputProps.md) and [RichInputHandle](interfaces/RichInputHandle.md). | ||
|
||
**NOTE: This component is experimental one so it may have some bugs.** | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `props` | `Omit`<[`RichInputProps`](interfaces/RichInputProps.md), ``"ref"``\> & `RefAttributes`<[`RichInputHandle`](interfaces/RichInputHandle.md)\> | | ||
|
||
#### Returns | ||
|
||
`ReactNode` | ||
|
||
#### Defined in | ||
|
||
[src/input.tsx:138](https://github.com/inokawa/rich-textarea/blob/dc63a9fde91f2e2855d6240be87ca131d128cc23/src/input.tsx#L138) | ||
|
||
___ | ||
|
||
### createRegexRenderer | ||
|
||
▸ **createRegexRenderer**(`matchers`): [`Renderer`](API.md#renderer) | ||
|
||
An utility to create renderer function with regex. | ||
|
||
The priority is descending order. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `matchers` | ([regex: RegExp, style: StyleOrRender] \| [regex: RegExp, style: StyleOrRender, shouldRender?: Function])[] | | ||
|
||
#### Returns | ||
|
||
[`Renderer`](API.md#renderer) | ||
|
||
#### Defined in | ||
|
||
[src/renderers/regex/index.tsx:19](https://github.com/inokawa/rich-textarea/blob/dc63a9fde91f2e2855d6240be87ca131d128cc23/src/renderers/regex/index.tsx#L19) | ||
|
||
___ | ||
|
||
### createCSSCustomHighlightRenderer | ||
|
||
▸ **createCSSCustomHighlightRenderer**(`matchers`): [`Renderer`](API.md#renderer) | ||
|
||
[createRegexRenderer](API.md#createregexrenderer) but rendered with [CSS Custom Highlight API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API). | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `matchers` | [regex: RegExp, style: string][] | | ||
|
||
#### Returns | ||
|
||
[`Renderer`](API.md#renderer) | ||
|
||
#### Defined in | ||
|
||
[src/renderers/regex/index.tsx:166](https://github.com/inokawa/rich-textarea/blob/dc63a9fde91f2e2855d6240be87ca131d128cc23/src/renderers/regex/index.tsx#L166) | ||
|
||
## Type Aliases | ||
|
||
### StyleOrRender | ||
|
||
Ƭ **StyleOrRender**: `React.CSSProperties` \| (`props`: { `children`: `React.ReactNode` ; `value`: `string` ; `key?`: `string` }) => `React.ReactNode` | ||
|
||
#### Defined in | ||
|
||
[src/renderers/regex/index.tsx:6](https://github.com/inokawa/rich-textarea/blob/dc63a9fde91f2e2855d6240be87ca131d128cc23/src/renderers/regex/index.tsx#L6) | ||
|
||
___ | ||
|
||
### Renderer | ||
|
||
Ƭ **Renderer**: (`value`: `string`) => `React.ReactNode` | ||
|
||
#### Type declaration | ||
|
||
▸ (`value`): `React.ReactNode` | ||
|
||
##### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `value` | `string` | | ||
|
||
##### Returns | ||
|
||
`React.ReactNode` | ||
|
||
#### Defined in | ||
|
||
[src/types.ts:1](https://github.com/inokawa/rich-textarea/blob/dc63a9fde91f2e2855d6240be87ca131d128cc23/src/types.ts#L1) | ||
|
||
___ | ||
|
||
### CaretPosition | ||
|
||
Ƭ **CaretPosition**: { `focused`: ``false`` ; `selectionStart`: `number` ; `selectionEnd`: `number` } \| { `focused`: ``true`` ; `selectionStart`: `number` ; `selectionEnd`: `number` ; `top`: `number` ; `left`: `number` ; `height`: `number` } | ||
|
||
#### Defined in | ||
|
||
[src/types.ts:3](https://github.com/inokawa/rich-textarea/blob/dc63a9fde91f2e2855d6240be87ca131d128cc23/src/types.ts#L3) | ||
- [StyleOrRender](type-aliases/StyleOrRender.md) | ||
- [Renderer](type-aliases/Renderer.md) | ||
- [CaretPosition](type-aliases/CaretPosition.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[**API**](../API.md) • **Docs** | ||
|
||
*** | ||
|
||
# Function: RichTextarea() | ||
|
||
> **RichTextarea**(`props`): `ReactNode` | ||
Textarea component with some extra props. See [RichTextareaProps](../interfaces/RichTextareaProps.md) and [RichTextareaHandle](../interfaces/RichTextareaHandle.md). | ||
|
||
## Parameters | ||
|
||
• **props**: `Omit`\<[`RichTextareaProps`](../interfaces/RichTextareaProps.md), `"ref"`\> & `RefAttributes`\<[`RichTextareaHandle`](../interfaces/RichTextareaHandle.md)\> | ||
|
||
## Returns | ||
|
||
`ReactNode` | ||
|
||
## Defined in | ||
|
||
[src/textarea.tsx:128](https://github.com/inokawa/rich-textarea/blob/f68d9e7ccb43f4a3c1bc208fe5bee1c78fa77f0e/src/textarea.tsx#L128) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[**API**](../API.md) • **Docs** | ||
|
||
*** | ||
|
||
# Function: createCSSCustomHighlightRenderer() | ||
|
||
> **createCSSCustomHighlightRenderer**(`matchers`): [`Renderer`](../type-aliases/Renderer.md) | ||
**`Experimental`** | ||
|
||
## Parameters | ||
|
||
• **matchers**: [`RegExp`, `string`][] | ||
|
||
## Returns | ||
|
||
[`Renderer`](../type-aliases/Renderer.md) | ||
|
||
## Defined in | ||
|
||
[src/renderers/regex/index.tsx:166](https://github.com/inokawa/rich-textarea/blob/f68d9e7ccb43f4a3c1bc208fe5bee1c78fa77f0e/src/renderers/regex/index.tsx#L166) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[**API**](../API.md) • **Docs** | ||
|
||
*** | ||
|
||
# Function: createRegexRenderer() | ||
|
||
> **createRegexRenderer**(`matchers`): [`Renderer`](../type-aliases/Renderer.md) | ||
An utility to create renderer function with regex. | ||
|
||
The priority is descending order. | ||
|
||
## Parameters | ||
|
||
• **matchers**: ([`RegExp`, [`StyleOrRender`](../type-aliases/StyleOrRender.md)] \| [`RegExp`, [`StyleOrRender`](../type-aliases/StyleOrRender.md), (`matchedText`, `matchResult`) => `boolean`])[] | ||
|
||
## Returns | ||
|
||
[`Renderer`](../type-aliases/Renderer.md) | ||
|
||
## Defined in | ||
|
||
[src/renderers/regex/index.tsx:19](https://github.com/inokawa/rich-textarea/blob/f68d9e7ccb43f4a3c1bc208fe5bee1c78fa77f0e/src/renderers/regex/index.tsx#L19) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[**API**](../API.md) • **Docs** | ||
|
||
*** | ||
|
||
# Function: experimental\_RichInput() | ||
|
||
> **experimental\_RichInput**(`props`): `ReactNode` | ||
Input component with some extra props. See [RichInputProps](../interfaces/RichInputProps.md) and [RichInputHandle](../interfaces/RichInputHandle.md). | ||
|
||
**NOTE: This component is experimental one so it may have some bugs.** | ||
|
||
## Parameters | ||
|
||
• **props**: `Omit`\<[`RichInputProps`](../interfaces/RichInputProps.md), `"ref"`\> & `RefAttributes`\<[`RichInputHandle`](../interfaces/RichInputHandle.md)\> | ||
|
||
## Returns | ||
|
||
`ReactNode` | ||
|
||
## Defined in | ||
|
||
[src/input.tsx:138](https://github.com/inokawa/rich-textarea/blob/f68d9e7ccb43f4a3c1bc208fe5bee1c78fa77f0e/src/input.tsx#L138) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.