Conversation
| @@ -0,0 +1,42 @@ | |||
| --- | |||
| sidebar_label: theme | |||
| title: theme Config | |||
There was a problem hiding this comment.
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")
|
|
||
| ~~~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.
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
| - `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.
right, we should also correct the example below to:
editor.api.exec("export", {
options: {
format: "pdf",
download: false,
fileName: "some file"
}
});
|
|
||
| ### Parameters | ||
|
|
||
| The callback of the **insert-image** event receives an `IImageContext` object with the following parameters: |
There was a problem hiding this comment.
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
|
|
||
| - `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.
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
| event: string, | ||
| handler: function | ||
| handler: function, | ||
| options?: { tag?: string } |
There was a problem hiding this comment.
config?: { tag?: number | string | symbol; } if we go by real types
| Initialize RichText with the `richtext.Richtext` constructor. The constructor takes two parameters: | ||
|
|
||
| - an HTML container (the ID of the HTML container) | ||
| - an HTML container — either a string with the ID of the HTML container or an `HTMLElement` object |
There was a problem hiding this comment.
if set as a string, it can basically be any CSS selector string. the point is that is must return a single target element
|
|
||
| ```js | ||
| new richtext.Richtext("#root", { | ||
| theme: { name: "dark", fonts: true } |
There was a problem hiding this comment.
|
|
||
| ## Available types | ||
|
|
||
| The following TypeScript types and interfaces are exported from the package: |
There was a problem hiding this comment.
this list looks kind of random
we don't actually export types explicitly (meaning they cannot be imported), so this entire section doesn't really apply. while TS is supported in general (everything is typed via d.ts files), types cannot be imported like that. all the exports are here: https://git.webix.io/XBS/richtext/src/branch/master/js/src/index.ts, and there are no types exported explicitly. this may change in the future (if needed), but this is not relevant for now
d.ts files are generated based on this input: https://git.webix.io/XBS/richtext/src/branch/master/js/src/types.index.ts (exported types and their dependencies are included in d.ts files)
No description provided.