Skip to content
2 changes: 1 addition & 1 deletion docs/api/config/layout-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: You can learn about the layoutMode config in the documentation of t
### Usage

~~~jsx {}
layoutMode: "classic" | "document";
layoutMode?: "classic" | "document";
~~~

The `"classic"` mode represents the edit area that fits the entire page. The `"document"` mode closely represent the real document sizes (sizes used: A4, A5, A6, A7).
Expand Down
8 changes: 7 additions & 1 deletion docs/api/config/menubar.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ description: You can learn about the menubar config in the documentation of the
### Usage

~~~jsx {}
menubar?: boolean;
menubar?: boolean;
~~~

### Default config

~~~jsx
menubar: false;
~~~

### Example
Expand Down
42 changes: 42 additions & 0 deletions docs/api/config/theme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
sidebar_label: theme
title: theme Config

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this information is kind of pointless for now, since we only support one theme for the JS wrapper (Material). this may become useful if/when we introduce more themes (like Material Dark, if this ever happens), and there's actually a choice, but right now it's just misleading

i don't really care if this stays in or not (as a placeholder), but at least mention that only one theme is supported at the moment, and do not provide examples that use non-existent themes (like "dark")

description: You can learn about the theme config in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText.
---

# theme

### Description

@short: Optional. Specifies the visual theme applied to the RichText editor

### Usage

~~~jsx {}
theme?: {
name: string;
fonts: boolean;
};
~~~

### Parameters

- `name` - (required) the name of the theme to apply
- `fonts` - (required) defines whether to load the fonts bundled with the theme

### Example

~~~jsx {3-6}
// initialize RichText
new richtext.Richtext("#root", {
theme: {
name: "dark",
fonts: true
}
// other configuration properties
});
~~~

**Change log:** The property was added in v2.0

**Related articles:** [Configuration](guides/configuration.md)
6 changes: 3 additions & 3 deletions docs/api/config/toolbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: You can learn about the toolbar config in the documentation of the
### Usage

~~~jsx {}
toolbar?: boolean | Array<string | { id: string, type: string, label?: string, tooltip?: string, css?: string, handler?: () => any }>;
toolbar?: boolean | Array<string | { type: "button"; id?: string; icon?: string; label?: string; tooltip?: string; css?: string; handler?: () => void }>;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not exactly correct - this assumes that the object can only specify custom buttons. in actuality we may also define button/richselect/colorpicker types for pre-existing buttons. if you want to include the actual types, include the full union -> https://git.webix.io/XBS/richtext/src/branch/master/js/src/types.index.ts#L34-L49

~~~

#### Available buttons within Toolbar
Expand Down Expand Up @@ -129,7 +129,7 @@ new richtext.Richtext("#root", {
### Default config

~~~jsx
const defaultToolbarButtons = {
const defaultToolbarButtons = [
"undo",
"redo",
"separator",
Expand Down Expand Up @@ -162,7 +162,7 @@ const defaultToolbarButtons = {
"separator",
"fullscreen",
"mode"
};
];
~~~

:::tip
Expand Down
10 changes: 6 additions & 4 deletions docs/api/events/export.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ interface IExportOptions {

The callback of **export** event can take an object with the following parameters:

- `format` - a file format
- `url` - a base URL for file export
- `download` - allows a user to specify if he wants to download the file after receiving the response back from the server. If the property is set to "false", the file will not download, but the user will instead be able to get blob data from the event object (see the `result` prop in the event definition)
- `fileName` - a file name to be exported
- `options` - an object with export options:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, we should also correct the example below to:

editor.api.exec("export", {
  options: {
      format: "pdf",
      download: false,
      fileName: "some file"
  }
});

- `format` - (optional) a file format: `"docx"` or `"pdf"`
- `url` - (optional) a base URL for file export
- `download` - (optional) allows a user to specify if he wants to download the file after receiving the response back from the server. If the property is set to `false`, the file will not download, but the user will instead be able to get blob data from the event object (see the `result` parameter)
- `fileName` - (optional) a file name to be exported
- `result` - (optional) the blob data returned from the server when `download` is set to `false`

:::info
For handling inner events you can use [**Event Bus methods**](api/overview/event_bus_methods_overview.md)
Expand Down
14 changes: 14 additions & 0 deletions docs/api/events/insert-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ interface IImageContext {
}
~~~

### Parameters

The callback of the **insert-image** event receives an `IImageContext` object with the following parameters:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the description is fine here, but i'll probably just remove the irrelevant props from the types later on (name, file, status, selected, uploaded). fine for now, but will most likely get changed later


- `id` - the unique identifier of the image
- `value` - the image URL (src)
- `width` - the image width in pixels
- `height` - the image height in pixels
- `name` - (optional) the original file name
- `file` - (optional) the `File` object from the uploader
- `status` - (optional) the upload status string
- `selected` - a callback invoked when the image is selected; receives the `IImageContext` object
- `uploaded` - a callback invoked when the image upload completes; receives the `IImageContext` object

:::info
For handling inner events you can use [**Event Bus methods**](api/overview/event_bus_methods_overview.md)
:::
Expand Down
2 changes: 1 addition & 1 deletion docs/api/events/insert-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ description: You can learn about the insert-link event in the documentation of t

### Parameters

The callback of the **update-link** event can take an object with the following parameter:
The callback of the **insert-link** event can take an object with the following parameter:

- `url` - the url to be inserted

Expand Down
2 changes: 1 addition & 1 deletion docs/api/internal/detach.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sidebar_label: api.detach()
title: on Method
title: detach Method
description: You can learn about the on method in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText.
---

Expand Down
2 changes: 1 addition & 1 deletion docs/api/internal/exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ api.exec(
### Parameters

- `event` - (required) an event to be fired
- `config` - (required) the config object with parameters (see the event to be fired)
- `config` - (optional) the config object with parameters (see the event to be fired); omit for parameterless actions (e.g. `"undo"`, `"redo"`, `"print"`)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not exactly, the config param is technically not optional, so it's still expected that we call

api.exec("undo", {});

and not

api.exec("undo");

though, in reality, there's little difference. but if we go by the typings, this is the expected input


### Events

Expand Down
2 changes: 1 addition & 1 deletion docs/api/internal/get-reactive-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The method returns an object with the following parameters:
cursorState: { subscribe: any },
defaultStyles {...},
document {...},
fullscreen {...},
fullscreenMode {...},
history {...},
layoutMode {...},
popup {...},
Expand Down
2 changes: 1 addition & 1 deletion docs/api/internal/get-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The method returns an object with the following parameters:
cursorState: {},
defaultStyles: {},
document: {},
fullscreen: boolean,
fullscreenMode: boolean,
history: []
layoutMode: string,
popup: any,
Expand Down
7 changes: 5 additions & 2 deletions docs/api/internal/on.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ description: You can learn about the on method in the documentation of the DHTML
~~~jsx {}
api.on(
event: string,
handler: function
handler: function,
options?: { tag?: string }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config?: { tag?: number | string | symbol; } if we go by real types

): void;
~~~

### Parameters

- `event` - (required) an event to be fired
- `handler` - (required) a handler to be attached (the handler arguments will depend on the event to be fired)
- `options` - (optional) an object with the following property:
- `tag` - (optional) a string label used to group handlers; pass the same tag to [`api.detach()`](api/internal/detach.md) to remove all handlers with that tag at once

### Events

Expand All @@ -43,4 +46,4 @@ editor.api.on("set-font-size", (obj) => {
});
~~~

**Change log:** The method was updated in v2.0. The `context` parameter were removed
**Change log:** The method was updated in v2.0. The `context` parameter was removed
2 changes: 1 addition & 1 deletion docs/api/methods/set-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: You can learn about the setConfig method in the documentation of th
### Usage

~~~jsx {}
setConfig(config: { [key:any]: any }): void;
setConfig(config: Partial<IRichtextConfig>): void;
~~~

### Parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/api/methods/set-locale.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: You can learn about the setLocale method in the documentation of th
### Usage

~~~jsx {}
setLocale(null | locale?: object): void;
setLocale(locale?: Record<string, any> | null): void;
~~~

### Parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/api/methods/set-value.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: You can learn about the setValue method in the documentation of the
### Usage

~~~jsx {}
setValue: (value: string, encoder?: any): void;
setValue(value: string, encoder?: any): void;
~~~

### Parameters
Expand Down
10 changes: 5 additions & 5 deletions docs/api/overview/event_bus_methods_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ These methods are designed for advanced integrations and custom behavior based o

| Name | Description |
| ------------------------------------------------- | -------------------------------------------- |
| [](../internal/detach.md) | @getshort(../internal/detach.md) |
| [](../internal/exec.md) | @getshort(../internal/exec.md) |
| [](../internal/intercept.md) | @getshort(../internal/intercept.md) |
| [](../internal/on.md) | @getshort(../internal/on.md) |
| [](../internal/set-next.md) | @getshort(../internal/set-next.md) |
| [](api/internal/detach.md) | @getshort(api/internal/detach.md) |
| [](api/internal/exec.md) | @getshort(api/internal/exec.md) |
| [](api/internal/intercept.md) | @getshort(api/internal/intercept.md) |
| [](api/internal/on.md) | @getshort(api/internal/on.md) |
| [](api/internal/set-next.md) | @getshort(api/internal/set-next.md) |
64 changes: 32 additions & 32 deletions docs/api/overview/events_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ You can use these events to extend functionality, track user interaction, or tri

| Name | Description |
| ------------------------------------------------------ | --------------------------------------------- |
| [](../events/align.md) | @getshort(../events/align.md) |
| [](../events/clear-text-format.md) | @getshort(../events/clear-text-format.md) |
| [](../events/copy.md) | @getshort(../events/copy.md) |
| [](../events/create-new.md) | @getshort(../events/create-new.md) |
| [](../events/cut.md) | @getshort(../events/cut.md) |
| [](../events/delete-link.md) | @getshort(../events/delete-link.md) |
| [](../events/export.md) | @getshort(../events/export.md) |
| [](../events/import.md) | @getshort(../events/import.md) |
| [](../events/indent.md) | @getshort(../events/indent.md) |
| [](../events/insert-image.md) | @getshort(../events/insert-image.md) |
| [](../events/insert-line.md) | @getshort(../events/insert-line.md) |
| [](../events/insert-link.md) | @getshort(../events/insert-link.md) |
| [](../events/insert-list.md) | @getshort(../events/insert-list.md) |
| [](../events/outdent.md) | @getshort(../events/outdent.md) |
| [](../events/paste.md) | @getshort(../events/paste.md) |
| [](../events/print.md) | @getshort(../events/print.md) |
| [](../events/redo.md) | @getshort(../events/redo.md) |
| [](../events/resize-image.md) | @getshort(../events/resize-image.md) |
| [](../events/set-font-family.md) | @getshort(../events/set-font-family.md) |
| [](../events/set-font-size.md) | @getshort(../events/set-font-size.md) |
| [](../events/set-line-height.md) | @getshort(../events/set-line-height.md) |
| [](../events/set-text-color.md) | @getshort(../events/set-text-color.md) |
| [](../events/set-text-format.md) | @getshort(../events/set-text-format.md) |
| [](../events/set-text-style.md) | @getshort(../events/set-text-style.md) |
| [](../events/show-popup.md) | @getshort(../events/show-popup.md) |
| [](../events/subscript.md) | @getshort(../events/subscript.md) |
| [](../events/superscript.md) | @getshort(../events/superscript.md) |
| [](../events/toggle-fullscreen-mode.md) | @getshort(../events/toggle-fullscreen-mode.md)|
| [](../events/toggle-layout-mode.md) | @getshort(../events/toggle-layout-mode.md) |
| [](../events/toggle-shortcut-info.md) | @getshort(../events/toggle-shortcut-info.md) |
| [](../events/undo.md) | @getshort(../events/undo.md) |
| [](../events/update-link.md) | @getshort(../events/update-link.md) |
| [](api/events/align.md) | @getshort(api/events/align.md) |
| [](api/events/clear-text-format.md) | @getshort(api/events/clear-text-format.md) |
| [](api/events/copy.md) | @getshort(api/events/copy.md) |
| [](api/events/create-new.md) | @getshort(api/events/create-new.md) |
| [](api/events/cut.md) | @getshort(api/events/cut.md) |
| [](api/events/delete-link.md) | @getshort(api/events/delete-link.md) |
| [](api/events/export.md) | @getshort(api/events/export.md) |
| [](api/events/import.md) | @getshort(api/events/import.md) |
| [](api/events/indent.md) | @getshort(api/events/indent.md) |
| [](api/events/insert-image.md) | @getshort(api/events/insert-image.md) |
| [](api/events/insert-line.md) | @getshort(api/events/insert-line.md) |
| [](api/events/insert-link.md) | @getshort(api/events/insert-link.md) |
| [](api/events/insert-list.md) | @getshort(api/events/insert-list.md) |
| [](api/events/outdent.md) | @getshort(api/events/outdent.md) |
| [](api/events/paste.md) | @getshort(api/events/paste.md) |
| [](api/events/print.md) | @getshort(api/events/print.md) |
| [](api/events/redo.md) | @getshort(api/events/redo.md) |
| [](api/events/resize-image.md) | @getshort(api/events/resize-image.md) |
| [](api/events/set-font-family.md) | @getshort(api/events/set-font-family.md) |
| [](api/events/set-font-size.md) | @getshort(api/events/set-font-size.md) |
| [](api/events/set-line-height.md) | @getshort(api/events/set-line-height.md) |
| [](api/events/set-text-color.md) | @getshort(api/events/set-text-color.md) |
| [](api/events/set-text-format.md) | @getshort(api/events/set-text-format.md) |
| [](api/events/set-text-style.md) | @getshort(api/events/set-text-style.md) |
| [](api/events/show-popup.md) | @getshort(api/events/show-popup.md) |
| [](api/events/subscript.md) | @getshort(api/events/subscript.md) |
| [](api/events/superscript.md) | @getshort(api/events/superscript.md) |
| [](api/events/toggle-fullscreen-mode.md) | @getshort(api/events/toggle-fullscreen-mode.md)|
| [](api/events/toggle-layout-mode.md) | @getshort(api/events/toggle-layout-mode.md) |
| [](api/events/toggle-shortcut-info.md) | @getshort(api/events/toggle-shortcut-info.md) |
| [](api/events/undo.md) | @getshort(api/events/undo.md) |
| [](api/events/update-link.md) | @getshort(api/events/update-link.md) |
Loading