-
Notifications
You must be signed in to change notification settings - Fork 1
Check API via AI agent #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: test
Are you sure you want to change the base?
Changes from all commits
bc296e9
fe14b93
06e3513
bbfae27
ffeaa1e
609deca
cd88536
9b686f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| sidebar_label: theme | ||
| title: theme Config | ||
| 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) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 }>; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| ~~~ | ||
|
|
||
| #### Available buttons within Toolbar | ||
|
|
@@ -129,7 +129,7 @@ new richtext.Richtext("#root", { | |
| ### Default config | ||
|
|
||
| ~~~jsx | ||
| const defaultToolbarButtons = { | ||
| const defaultToolbarButtons = [ | ||
| "undo", | ||
| "redo", | ||
| "separator", | ||
|
|
@@ -162,7 +162,7 @@ const defaultToolbarButtons = { | |
| "separator", | ||
| "fullscreen", | ||
| "mode" | ||
| }; | ||
| ]; | ||
| ~~~ | ||
|
|
||
| :::tip | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right, we should also correct the example below to: |
||
| - `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) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,20 @@ interface IImageContext { | |
| } | ||
| ~~~ | ||
|
|
||
| ### Parameters | ||
|
|
||
| The callback of the **insert-image** event receives an `IImageContext` object with the following parameters: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ( |
||
|
|
||
| - `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) | ||
| ::: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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"`) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not exactly, the and not though, in reality, there's little difference. but if we go by the typings, this is the expected input |
||
|
|
||
| ### Events | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ): 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 | ||
|
|
||
|
|
@@ -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 | ||
There was a problem hiding this comment.
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")