|
1 | 1 | import type { Extensions } from "@tiptap/vue-3"; |
2 | | -import type { Nullable, OnyxTextareaProps } from "sit-onyx"; |
| 2 | +import type { Nullable, OnyxTextareaProps, SharedFormElementProps } from "sit-onyx"; |
3 | 3 | import type { InjectionKey, Ref } from "vue"; |
4 | 4 |
|
5 | 5 | // TODO: consider the following features if possible: |
6 | 6 | // required, min/max length, custom errors, autocapitalize |
7 | | -export type OnyxTextEditorProps = Pick< |
8 | | - OnyxTextareaProps, |
9 | | - | "label" |
10 | | - | "labelTooltip" |
11 | | - | "disableManualResize" |
12 | | - | "disabled" |
13 | | - | "hideLabel" |
14 | | - | "autosize" |
15 | | - | "autofocus" |
16 | | - | "message" |
17 | | - | "success" |
18 | | - | "density" |
19 | | - | "placeholder" |
20 | | - | "reserveMessageSpace" |
21 | | -> & { |
22 | | - /** |
23 | | - * Current editor value. |
24 | | - */ |
25 | | - modelValue?: Nullable<string>; |
26 | | - /** |
27 | | - * Toolbar config. |
28 | | - */ |
29 | | - toolbar?: ToolbarOptions; |
30 | | - /** |
31 | | - * Tiptap extensions to use. Should not be changed dynamically. |
32 | | - * If set, default extensions will be overridden. Use or configure the OnyxStarterKit in this case. |
33 | | - */ |
34 | | - extensions?: Extensions; |
35 | | -}; |
| 7 | +export type OnyxTextEditorProps = Pick<OnyxTextareaProps, "disableManualResize" | "autosize"> & |
| 8 | + Pick< |
| 9 | + SharedFormElementProps, |
| 10 | + | "label" |
| 11 | + | "labelTooltip" |
| 12 | + | "disabled" |
| 13 | + | "hideLabel" |
| 14 | + | "autofocus" |
| 15 | + | "message" |
| 16 | + | "success" |
| 17 | + | "density" |
| 18 | + | "placeholder" |
| 19 | + | "reserveMessageSpace" |
| 20 | + > & { |
| 21 | + /** |
| 22 | + * Current editor value. |
| 23 | + */ |
| 24 | + modelValue?: Nullable<string>; |
| 25 | + /** |
| 26 | + * Toolbar config. |
| 27 | + */ |
| 28 | + toolbar?: ToolbarOptions; |
| 29 | + /** |
| 30 | + * Tiptap extensions to use. Should not be changed dynamically. |
| 31 | + * If set, default extensions will be overridden. Use or configure the OnyxStarterKit in this case. |
| 32 | + */ |
| 33 | + extensions?: Extensions; |
| 34 | + }; |
36 | 35 |
|
37 | 36 | export type ToolbarOptions = { |
38 | 37 | /** |
|
0 commit comments