Skip to content

Commit

Permalink
0.26.3
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed Sep 11, 2024
1 parent f68d9e7 commit 210fc8b
Show file tree
Hide file tree
Showing 14 changed files with 213 additions and 238 deletions.
160 changes: 13 additions & 147 deletions docs/API.md
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)
21 changes: 21 additions & 0 deletions docs/functions/RichTextarea.md
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)
21 changes: 21 additions & 0 deletions docs/functions/createCSSCustomHighlightRenderer.md
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)
23 changes: 23 additions & 0 deletions docs/functions/createRegexRenderer.md
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)
23 changes: 23 additions & 0 deletions docs/functions/experimental_RichInput.md
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)
10 changes: 6 additions & 4 deletions docs/interfaces/RichInputHandle.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[**API**](../API.md)**Docs**

***

# Interface: RichInputHandle

Methods of [RichInput](../API.md#experimental_richinput).
Methods of [RichInput](../functions/experimental_RichInput.md).

All the others not mentioned are proxied to ref of [input](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement).

Expand All @@ -10,8 +14,6 @@ All the others not mentioned are proxied to ref of [input](https://developer.moz
| selectionEnd | `number` | Same as original but has handling of composition event |
| setRangeText | | Same as original but has fallback to `document.execCommand("insertText")` |

## Hierarchy
## Extends

- `HTMLInputElement`

**`RichInputHandle`**
Loading

0 comments on commit 210fc8b

Please sign in to comment.