@mantine-vue/tiptap 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/cjs/index.cjs +725 -588
  2. package/cjs/index.cjs.map +1 -1
  3. package/esm/index.mjs +725 -614
  4. package/esm/index.mjs.map +1 -1
  5. package/lib/RichTextEditor.d.ts +63 -2674
  6. package/lib/RichTextEditor.types.d.ts +83 -0
  7. package/lib/RichTextEditor.vue.d.ts +25 -0
  8. package/lib/RichTextEditorContent/RichTextEditorContent.d.ts +8 -42
  9. package/lib/RichTextEditorContent/RichTextEditorContent.types.d.ts +18 -0
  10. package/lib/RichTextEditorContent/RichTextEditorContent.vue.d.ts +4 -0
  11. package/lib/RichTextEditorControl/RichTextEditorColorControl.d.ts +8 -17
  12. package/lib/RichTextEditorControl/RichTextEditorColorControl.types.d.ts +15 -0
  13. package/lib/RichTextEditorControl/RichTextEditorColorControl.vue.d.ts +4 -0
  14. package/lib/RichTextEditorControl/RichTextEditorColorPickerControl.d.ts +8 -39
  15. package/lib/RichTextEditorControl/RichTextEditorColorPickerControl.types.d.ts +19 -0
  16. package/lib/RichTextEditorControl/RichTextEditorColorPickerControl.vue.d.ts +4 -0
  17. package/lib/RichTextEditorControl/RichTextEditorControl.d.ts +18 -240
  18. package/lib/RichTextEditorControl/RichTextEditorControl.types.d.ts +91 -0
  19. package/lib/RichTextEditorControl/RichTextEditorControl.vue.d.ts +11 -0
  20. package/lib/RichTextEditorControl/RichTextEditorControlBase.vue.d.ts +11 -0
  21. package/lib/RichTextEditorControl/RichTextEditorGeneratedControl.vue.d.ts +11 -0
  22. package/lib/RichTextEditorControl/RichTextEditorLinkControl.d.ts +9 -81
  23. package/lib/RichTextEditorControl/RichTextEditorLinkControl.types.d.ts +34 -0
  24. package/lib/RichTextEditorControl/RichTextEditorLinkControl.vue.d.ts +11 -0
  25. package/lib/RichTextEditorControl/RichTextEditorSourceCodeControl.d.ts +8 -6
  26. package/lib/RichTextEditorControl/RichTextEditorSourceCodeControl.types.d.ts +10 -0
  27. package/lib/RichTextEditorControl/RichTextEditorSourceCodeControl.vue.d.ts +3 -0
  28. package/lib/RichTextEditorControl/controls.d.ts +248 -2139
  29. package/lib/RichTextEditorControl/use-editor-selector.d.ts +3 -0
  30. package/lib/RichTextEditorControlsGroup/RichTextEditorControlsGroup.d.ts +9 -50
  31. package/lib/RichTextEditorControlsGroup/RichTextEditorControlsGroup.types.d.ts +24 -0
  32. package/lib/RichTextEditorControlsGroup/RichTextEditorControlsGroup.vue.d.ts +11 -0
  33. package/lib/RichTextEditorToolbar/RichTextEditorToolbar.d.ts +9 -81
  34. package/lib/RichTextEditorToolbar/RichTextEditorToolbar.types.d.ts +32 -0
  35. package/lib/RichTextEditorToolbar/RichTextEditorToolbar.vue.d.ts +11 -0
  36. package/lib/icons/Icons.d.ts +40 -113
  37. package/lib/icons/RichTextEditorIcon.d.ts +5 -0
  38. package/lib/icons/RichTextEditorIcon.types.d.ts +10 -0
  39. package/lib/icons/RichTextEditorIcon.vue.d.ts +4 -0
  40. package/package.json +3 -3
@@ -0,0 +1,83 @@
1
+ import type { VNodeChild } from 'vue';
2
+ import type { Editor } from '@tiptap/vue-3';
3
+ import type { BoxProps, Factory, StylesApiProps } from '@mantine-vue/core';
4
+ import type { RichTextEditorLabels } from './labels';
5
+ import type { RichTextEditorContent } from './RichTextEditorContent/RichTextEditorContent';
6
+ import type { RichTextEditorControl } from './RichTextEditorControl/RichTextEditorControl';
7
+ import type { BoldControl, ItalicControl, StrikeThroughControl, UnderlineControl, ClearFormattingControl, H1Control, H2Control, H3Control, H4Control, H5Control, H6Control, BulletListControl, OrderedListControl, UnlinkControl, BlockquoteControl, AlignLeftControl, AlignRightControl, AlignCenterControl, AlignJustifyControl, SuperscriptControl, SubscriptControl, CodeControl, CodeBlockControl, HighlightControl, HrControl, UnsetColorControl, UndoControl, RedoControl, TaskListControl, TaskListSinkControl, TaskListLiftControl } from './RichTextEditorControl/controls';
8
+ import type { RichTextEditorColorControl } from './RichTextEditorControl/RichTextEditorColorControl';
9
+ import type { RichTextEditorColorPickerControl } from './RichTextEditorControl/RichTextEditorColorPickerControl';
10
+ import type { RichTextEditorLinkControl } from './RichTextEditorControl/RichTextEditorLinkControl';
11
+ import type { RichTextEditorSourceCodeControl } from './RichTextEditorControl/RichTextEditorSourceCodeControl';
12
+ import type { RichTextEditorControlsGroup } from './RichTextEditorControlsGroup/RichTextEditorControlsGroup';
13
+ import type { RichTextEditorToolbar } from './RichTextEditorToolbar/RichTextEditorToolbar';
14
+ export type RichTextEditorVariant = 'default' | 'subtle';
15
+ export type RichTextEditorStylesNames = 'linkEditorSave' | 'linkEditorDropdown' | 'root' | 'content' | 'Typography' | 'control' | 'controlIcon' | 'controlsGroup' | 'toolbar' | 'linkEditor' | 'linkEditorInput' | 'linkEditorExternalControl';
16
+ export interface RichTextEditorOwnProps extends StylesApiProps<RichTextEditorFactory> {
17
+ /** Tiptap editor instance. */
18
+ editor: Editor | null | undefined;
19
+ /** Determines whether code highlight styles are enabled. @default true */
20
+ withCodeHighlightStyles?: boolean;
21
+ /** Determines whether typography styles are enabled. @default true */
22
+ withTypographyStyles?: boolean;
23
+ /** Called when source code mode changes. */
24
+ onSourceCodeTextSwitch?: (isSourceCodeModeActive: boolean) => void;
25
+ /** Labels used by editor controls. */
26
+ labels?: Partial<RichTextEditorLabels>;
27
+ /** Visual variant. @default 'default' */
28
+ variant?: RichTextEditorVariant;
29
+ }
30
+ export interface RichTextEditorProps extends Omit<BoxProps, keyof RichTextEditorOwnProps | 'component'>, RichTextEditorOwnProps {
31
+ }
32
+ export interface RichTextEditorSlots {
33
+ default?: () => VNodeChild;
34
+ }
35
+ export type RichTextEditorFactory = Factory<{
36
+ props: RichTextEditorProps;
37
+ slots: RichTextEditorSlots;
38
+ ref: HTMLDivElement;
39
+ element: 'div';
40
+ stylesNames: RichTextEditorStylesNames;
41
+ variant: RichTextEditorVariant;
42
+ staticComponents: {
43
+ Content: typeof RichTextEditorContent;
44
+ Control: typeof RichTextEditorControl;
45
+ Toolbar: typeof RichTextEditorToolbar;
46
+ ControlsGroup: typeof RichTextEditorControlsGroup;
47
+ Bold: typeof BoldControl;
48
+ Italic: typeof ItalicControl;
49
+ Strikethrough: typeof StrikeThroughControl;
50
+ Underline: typeof UnderlineControl;
51
+ ClearFormatting: typeof ClearFormattingControl;
52
+ H1: typeof H1Control;
53
+ H2: typeof H2Control;
54
+ H3: typeof H3Control;
55
+ H4: typeof H4Control;
56
+ H5: typeof H5Control;
57
+ H6: typeof H6Control;
58
+ BulletList: typeof BulletListControl;
59
+ OrderedList: typeof OrderedListControl;
60
+ Link: typeof RichTextEditorLinkControl;
61
+ Unlink: typeof UnlinkControl;
62
+ Blockquote: typeof BlockquoteControl;
63
+ AlignLeft: typeof AlignLeftControl;
64
+ AlignRight: typeof AlignRightControl;
65
+ AlignCenter: typeof AlignCenterControl;
66
+ AlignJustify: typeof AlignJustifyControl;
67
+ Superscript: typeof SuperscriptControl;
68
+ Subscript: typeof SubscriptControl;
69
+ Code: typeof CodeControl;
70
+ CodeBlock: typeof CodeBlockControl;
71
+ ColorPicker: typeof RichTextEditorColorPickerControl;
72
+ Color: typeof RichTextEditorColorControl;
73
+ Highlight: typeof HighlightControl;
74
+ Hr: typeof HrControl;
75
+ UnsetColor: typeof UnsetColorControl;
76
+ Undo: typeof UndoControl;
77
+ Redo: typeof RedoControl;
78
+ TaskList: typeof TaskListControl;
79
+ TaskListSink: typeof TaskListSinkControl;
80
+ TaskListLift: typeof TaskListLiftControl;
81
+ SourceCode: typeof RichTextEditorSourceCodeControl;
82
+ };
83
+ }>;
@@ -0,0 +1,25 @@
1
+ import type { Editor } from '@tiptap/vue-3';
2
+ import type { RichTextEditorLabels } from './labels';
3
+ import type { RichTextEditorSlots, RichTextEditorVariant } from './RichTextEditor.types';
4
+ interface RichTextEditorRuntimeProps {
5
+ editor: Editor | null | undefined;
6
+ withCodeHighlightStyles?: boolean;
7
+ withTypographyStyles?: boolean;
8
+ onSourceCodeTextSwitch?: (isSourceCodeModeActive: boolean) => void;
9
+ labels?: Partial<RichTextEditorLabels>;
10
+ variant?: RichTextEditorVariant;
11
+ classNames?: unknown;
12
+ styles?: unknown;
13
+ vars?: unknown;
14
+ unstyled?: boolean;
15
+ }
16
+ type __VLS_Slots = RichTextEditorSlots;
17
+ declare const __VLS_base: import("vue").DefineComponent<RichTextEditorRuntimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RichTextEditorRuntimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -1,42 +1,8 @@
1
- export type RichTextEditorContentStylesNames = 'root';
2
- export interface RichTextEditorContentProps {
3
- classNames?: any;
4
- styles?: any;
5
- vars?: any;
6
- class?: any;
7
- style?: any;
8
- [key: string]: any;
9
- }
10
- export declare const RichTextEditorContent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
11
- classNames: {
12
- type: (ObjectConstructor | FunctionConstructor)[];
13
- default: undefined;
14
- };
15
- styles: {
16
- type: (ObjectConstructor | FunctionConstructor)[];
17
- default: undefined;
18
- };
19
- vars: {
20
- type: (ObjectConstructor | FunctionConstructor)[];
21
- default: undefined;
22
- };
23
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
24
- [key: string]: any;
25
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
- classNames: {
27
- type: (ObjectConstructor | FunctionConstructor)[];
28
- default: undefined;
29
- };
30
- styles: {
31
- type: (ObjectConstructor | FunctionConstructor)[];
32
- default: undefined;
33
- };
34
- vars: {
35
- type: (ObjectConstructor | FunctionConstructor)[];
36
- default: undefined;
37
- };
38
- }>> & Readonly<{}>, {
39
- classNames: Function | Record<string, any>;
40
- styles: Function | Record<string, any>;
41
- vars: Function | Record<string, any>;
42
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ export declare const RichTextEditorContent: import("@mantine-vue/core").MantineComponent<{
2
+ props: import("./RichTextEditorContent.types").RichTextEditorContentProps;
3
+ ref: HTMLDivElement;
4
+ element: "div";
5
+ stylesNames: import("./RichTextEditorContent.types").RichTextEditorContentStylesNames;
6
+ compound: true;
7
+ }>;
8
+ export type { RichTextEditorContentFactory, RichTextEditorContentOwnProps, RichTextEditorContentProps, RichTextEditorContentStylesNames, } from './RichTextEditorContent.types';
@@ -0,0 +1,18 @@
1
+ import type { BoxProps, Factory, StylesApiProps } from '@mantine-vue/core';
2
+ export type RichTextEditorContentStylesNames = 'root';
3
+ export interface RichTextEditorContentRuntimeProps {
4
+ classNames?: unknown;
5
+ styles?: unknown;
6
+ vars?: unknown;
7
+ unstyled?: boolean;
8
+ }
9
+ export type RichTextEditorContentOwnProps = StylesApiProps<RichTextEditorContentFactory>;
10
+ export interface RichTextEditorContentProps extends Omit<BoxProps, keyof RichTextEditorContentOwnProps | 'component'>, RichTextEditorContentOwnProps {
11
+ }
12
+ export type RichTextEditorContentFactory = Factory<{
13
+ props: RichTextEditorContentProps;
14
+ ref: HTMLDivElement;
15
+ element: 'div';
16
+ stylesNames: RichTextEditorContentStylesNames;
17
+ compound: true;
18
+ }>;
@@ -0,0 +1,4 @@
1
+ import type { RichTextEditorContentRuntimeProps } from './RichTextEditorContent.types';
2
+ declare const __VLS_export: import("vue").DefineComponent<RichTextEditorContentRuntimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RichTextEditorContentRuntimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -1,17 +1,8 @@
1
- export interface RichTextEditorColorControlProps {
2
- color: string;
3
- [key: string]: any;
4
- }
5
- export declare const RichTextEditorColorControl: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
- color: {
7
- type: StringConstructor;
8
- required: true;
9
- };
10
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
11
- [key: string]: any;
12
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
- color: {
14
- type: StringConstructor;
15
- required: true;
16
- };
17
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ export declare const RichTextEditorColorControl: import("@mantine-vue/core").MantineComponent<{
2
+ props: import("./RichTextEditorColorControl.types").RichTextEditorColorControlProps;
3
+ ref: HTMLButtonElement;
4
+ element: "button";
5
+ stylesNames: "control";
6
+ compound: true;
7
+ }>;
8
+ export type { RichTextEditorColorControlFactory, RichTextEditorColorControlProps, } from './RichTextEditorColorControl.types';
@@ -0,0 +1,15 @@
1
+ import type { Factory } from '@mantine-vue/core';
2
+ import type { RichTextEditorControlProps } from './RichTextEditorControl.types';
3
+ export interface RichTextEditorColorControlOwnProps {
4
+ /** Color applied to the selected text. */
5
+ color: string;
6
+ }
7
+ export interface RichTextEditorColorControlProps extends Omit<RichTextEditorControlProps, keyof RichTextEditorColorControlOwnProps>, RichTextEditorColorControlOwnProps {
8
+ }
9
+ export type RichTextEditorColorControlFactory = Factory<{
10
+ props: RichTextEditorColorControlProps;
11
+ ref: HTMLButtonElement;
12
+ element: 'button';
13
+ stylesNames: 'control';
14
+ compound: true;
15
+ }>;
@@ -0,0 +1,4 @@
1
+ import type { RichTextEditorColorControlOwnProps } from './RichTextEditorColorControl.types';
2
+ declare const __VLS_export: import("vue").DefineComponent<RichTextEditorColorControlOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RichTextEditorColorControlOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -1,39 +1,8 @@
1
- import { type PropType } from 'vue';
2
- export interface RichTextEditorColorPickerControlProps {
3
- popoverProps?: Record<string, any>;
4
- colorPickerProps?: Record<string, any>;
5
- colors: string[];
6
- [key: string]: any;
7
- }
8
- export declare const RichTextEditorColorPickerControl: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
9
- popoverProps: {
10
- type: PropType<Record<string, any>>;
11
- default: undefined;
12
- };
13
- colorPickerProps: {
14
- type: PropType<Record<string, any>>;
15
- default: undefined;
16
- };
17
- colors: {
18
- type: PropType<string[]>;
19
- required: true;
20
- };
21
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
22
- [key: string]: any;
23
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
- popoverProps: {
25
- type: PropType<Record<string, any>>;
26
- default: undefined;
27
- };
28
- colorPickerProps: {
29
- type: PropType<Record<string, any>>;
30
- default: undefined;
31
- };
32
- colors: {
33
- type: PropType<string[]>;
34
- required: true;
35
- };
36
- }>> & Readonly<{}>, {
37
- popoverProps: Record<string, any>;
38
- colorPickerProps: Record<string, any>;
39
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ export type { RichTextEditorColorPickerControlFactory, RichTextEditorColorPickerControlOwnProps, RichTextEditorColorPickerControlProps, } from './RichTextEditorColorPickerControl.types';
2
+ export declare const RichTextEditorColorPickerControl: import("@mantine-vue/core").MantineComponent<{
3
+ props: import("./RichTextEditorColorPickerControl.types").RichTextEditorColorPickerControlProps;
4
+ ref: HTMLButtonElement;
5
+ element: "button";
6
+ stylesNames: "control";
7
+ compound: true;
8
+ }>;
@@ -0,0 +1,19 @@
1
+ import type { ColorPickerProps, Factory, PopoverProps } from '@mantine-vue/core';
2
+ import type { RichTextEditorControlProps } from './RichTextEditorControl.types';
3
+ export interface RichTextEditorColorPickerControlOwnProps {
4
+ /** Props passed down to the `Popover` component. */
5
+ popoverProps?: Partial<PopoverProps>;
6
+ /** Props passed down to the `ColorPicker` component. */
7
+ colorPickerProps?: Partial<ColorPickerProps>;
8
+ /** Colors displayed in the color palette. */
9
+ colors: string[];
10
+ }
11
+ export interface RichTextEditorColorPickerControlProps extends Omit<RichTextEditorControlProps, keyof RichTextEditorColorPickerControlOwnProps>, RichTextEditorColorPickerControlOwnProps {
12
+ }
13
+ export type RichTextEditorColorPickerControlFactory = Factory<{
14
+ props: RichTextEditorColorPickerControlProps;
15
+ ref: HTMLButtonElement;
16
+ element: 'button';
17
+ stylesNames: 'control';
18
+ compound: true;
19
+ }>;
@@ -0,0 +1,4 @@
1
+ import type { RichTextEditorColorPickerControlOwnProps } from './RichTextEditorColorPickerControl.types';
2
+ declare const __VLS_export: import("vue").DefineComponent<RichTextEditorColorPickerControlOwnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RichTextEditorColorPickerControlOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -1,241 +1,19 @@
1
- import { type PropType } from 'vue';
2
- import type { Editor } from '@tiptap/vue-3';
3
- import type { RichTextEditorLabels } from '../labels';
4
- export type RichTextEditorControlStylesNames = 'control';
5
- export interface RichTextEditorControlProps {
6
- active?: boolean;
7
- interactive?: boolean;
8
- disabled?: boolean;
9
- variant?: string;
10
- classNames?: any;
11
- styles?: any;
12
- vars?: any;
13
- class?: any;
14
- style?: any;
15
- [key: string]: any;
16
- }
17
- export declare const RichTextEditorControl: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
18
- active: {
19
- type: BooleanConstructor;
20
- default: undefined;
21
- };
22
- interactive: {
23
- type: BooleanConstructor;
24
- default: undefined;
25
- };
26
- disabled: {
27
- type: BooleanConstructor;
28
- default: undefined;
29
- };
30
- variant: {
31
- type: StringConstructor;
32
- default: undefined;
33
- };
34
- classNames: {
35
- type: (ObjectConstructor | FunctionConstructor)[];
36
- default: undefined;
37
- };
38
- styles: {
39
- type: (ObjectConstructor | FunctionConstructor)[];
40
- default: undefined;
41
- };
42
- vars: {
43
- type: (ObjectConstructor | FunctionConstructor)[];
44
- default: undefined;
45
- };
46
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
47
- [key: string]: any;
48
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
49
- active: {
50
- type: BooleanConstructor;
51
- default: undefined;
52
- };
53
- interactive: {
54
- type: BooleanConstructor;
55
- default: undefined;
56
- };
57
- disabled: {
58
- type: BooleanConstructor;
59
- default: undefined;
60
- };
61
- variant: {
62
- type: StringConstructor;
63
- default: undefined;
64
- };
65
- classNames: {
66
- type: (ObjectConstructor | FunctionConstructor)[];
67
- default: undefined;
68
- };
69
- styles: {
70
- type: (ObjectConstructor | FunctionConstructor)[];
71
- default: undefined;
72
- };
73
- vars: {
74
- type: (ObjectConstructor | FunctionConstructor)[];
75
- default: undefined;
76
- };
77
- }>> & Readonly<{}>, {
78
- variant: string;
79
- classNames: Function | Record<string, any>;
80
- styles: Function | Record<string, any>;
81
- disabled: boolean;
82
- active: boolean;
83
- vars: Function | Record<string, any>;
84
- interactive: boolean;
85
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
86
- export interface RichTextEditorControlBaseProps extends RichTextEditorControlProps {
87
- icon?: any;
88
- }
89
- export declare const RichTextEditorControlBase: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
90
- icon: {
91
- type: PropType<any>;
92
- required: true;
93
- };
94
- active: {
95
- type: BooleanConstructor;
96
- default: undefined;
97
- };
98
- interactive: {
99
- type: BooleanConstructor;
100
- default: undefined;
101
- };
102
- disabled: {
103
- type: BooleanConstructor;
104
- default: undefined;
105
- };
106
- variant: {
107
- type: StringConstructor;
108
- default: undefined;
109
- };
110
- classNames: {
111
- type: (ObjectConstructor | FunctionConstructor)[];
112
- default: undefined;
113
- };
114
- styles: {
115
- type: (ObjectConstructor | FunctionConstructor)[];
116
- default: undefined;
117
- };
118
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
119
- [key: string]: any;
120
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
121
- icon: {
122
- type: PropType<any>;
123
- required: true;
124
- };
125
- active: {
126
- type: BooleanConstructor;
127
- default: undefined;
128
- };
129
- interactive: {
130
- type: BooleanConstructor;
131
- default: undefined;
132
- };
133
- disabled: {
134
- type: BooleanConstructor;
135
- default: undefined;
136
- };
137
- variant: {
138
- type: StringConstructor;
139
- default: undefined;
140
- };
141
- classNames: {
142
- type: (ObjectConstructor | FunctionConstructor)[];
143
- default: undefined;
144
- };
145
- styles: {
146
- type: (ObjectConstructor | FunctionConstructor)[];
147
- default: undefined;
148
- };
149
- }>> & Readonly<{}>, {
150
- variant: string;
151
- classNames: Function | Record<string, any>;
152
- styles: Function | Record<string, any>;
153
- disabled: boolean;
154
- active: boolean;
155
- interactive: boolean;
156
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
157
- export interface CreateControlProps {
158
- label: keyof RichTextEditorLabels;
159
- icon: any;
160
- isActive?: {
161
- name: string;
162
- attributes?: Record<string, any> | string;
163
- };
164
- isDisabled?: (editor: Editor) => boolean;
165
- operation: {
166
- name: string;
167
- attributes?: Record<string, any> | string;
168
- };
169
- }
170
- export declare function createControl({ label, isActive, operation, icon, isDisabled, }: CreateControlProps): import("vue").DefineComponent<import("vue").ExtractPropTypes<{
171
- icon: {
172
- type: PropType<any>;
173
- default: undefined;
174
- };
175
- active: {
176
- type: BooleanConstructor;
177
- default: undefined;
178
- };
179
- interactive: {
180
- type: BooleanConstructor;
181
- default: undefined;
182
- };
183
- disabled: {
184
- type: BooleanConstructor;
185
- default: undefined;
186
- };
187
- variant: {
188
- type: StringConstructor;
189
- default: undefined;
190
- };
191
- classNames: {
192
- type: (ObjectConstructor | FunctionConstructor)[];
193
- default: undefined;
194
- };
195
- styles: {
196
- type: (ObjectConstructor | FunctionConstructor)[];
197
- default: undefined;
198
- };
199
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
200
- [key: string]: any;
201
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
202
- icon: {
203
- type: PropType<any>;
204
- default: undefined;
205
- };
206
- active: {
207
- type: BooleanConstructor;
208
- default: undefined;
209
- };
210
- interactive: {
211
- type: BooleanConstructor;
212
- default: undefined;
213
- };
214
- disabled: {
215
- type: BooleanConstructor;
216
- default: undefined;
217
- };
218
- variant: {
219
- type: StringConstructor;
220
- default: undefined;
221
- };
222
- classNames: {
223
- type: (ObjectConstructor | FunctionConstructor)[];
224
- default: undefined;
225
- };
226
- styles: {
227
- type: (ObjectConstructor | FunctionConstructor)[];
228
- default: undefined;
229
- };
230
- }>> & Readonly<{}>, {
231
- variant: string;
232
- classNames: Function | Record<string, any>;
233
- styles: Function | Record<string, any>;
234
- disabled: boolean;
235
- active: boolean;
236
- icon: any;
237
- interactive: boolean;
238
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
239
- export declare function renderControlIcon(Icon: any): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
240
- [key: string]: any;
1
+ import type { CreateControlProps } from './RichTextEditorControl.types';
2
+ export declare const RichTextEditorControl: import("@mantine-vue/core").MantineComponent<{
3
+ props: import("./RichTextEditorControl.types").RichTextEditorControlProps;
4
+ slots: import("./RichTextEditorControl.types").RichTextEditorControlSlots;
5
+ ref: HTMLButtonElement;
6
+ element: "button";
7
+ stylesNames: import("./RichTextEditorControl.types").RichTextEditorControlStylesNames;
8
+ compound: true;
241
9
  }>;
10
+ export declare const RichTextEditorControlBase: import("@mantine-vue/core").MantineComponent<{
11
+ props: import("./RichTextEditorControl.types").RichTextEditorControlBaseProps;
12
+ slots: import("./RichTextEditorControl.types").RichTextEditorControlBaseSlots;
13
+ ref: HTMLButtonElement;
14
+ element: "button";
15
+ stylesNames: import("./RichTextEditorControl.types").RichTextEditorControlStylesNames;
16
+ compound: true;
17
+ }>;
18
+ export declare function createControl(config: CreateControlProps): typeof RichTextEditorControlBase;
19
+ export type { ControlActiveState, ControlOperation, CreateControlProps, RichTextEditorControlBaseFactory, RichTextEditorControlBaseOwnProps, RichTextEditorControlBaseProps, RichTextEditorControlBaseSlots, RichTextEditorControlFactory, RichTextEditorControlIconSlotProps, RichTextEditorControlOwnProps, RichTextEditorControlProps, RichTextEditorControlSlots, RichTextEditorControlStylesNames, } from './RichTextEditorControl.types';
@@ -0,0 +1,91 @@
1
+ import type { Component, HTMLAttributes, VNodeChild } from 'vue';
2
+ import type { Editor } from '@tiptap/vue-3';
3
+ import type { BoxProps, Factory, StylesApiProps } from '@mantine-vue/core';
4
+ import type { RichTextEditorLabels } from '../labels';
5
+ export type RichTextEditorControlStylesNames = 'control';
6
+ export interface RichTextEditorControlRuntimeProps {
7
+ classNames?: unknown;
8
+ styles?: unknown;
9
+ vars?: unknown;
10
+ unstyled?: boolean;
11
+ active?: boolean;
12
+ interactive?: boolean;
13
+ disabled?: boolean;
14
+ variant?: string;
15
+ }
16
+ export interface RichTextEditorControlOwnProps extends StylesApiProps<RichTextEditorControlFactory> {
17
+ /** Determines whether the control has an active state. */
18
+ active?: boolean;
19
+ /** Determines whether the control can be interacted with. @default true */
20
+ interactive?: boolean;
21
+ /** Disables the control. */
22
+ disabled?: boolean;
23
+ /** Visual variant inherited from the editor by default. */
24
+ variant?: string;
25
+ }
26
+ export interface RichTextEditorControlProps extends Omit<BoxProps, keyof RichTextEditorControlOwnProps | 'component'>, RichTextEditorControlOwnProps {
27
+ }
28
+ export interface RichTextEditorControlSlots {
29
+ default?: () => VNodeChild;
30
+ }
31
+ export type RichTextEditorControlFactory = Factory<{
32
+ props: RichTextEditorControlProps;
33
+ slots: RichTextEditorControlSlots;
34
+ ref: HTMLButtonElement;
35
+ element: 'button';
36
+ stylesNames: RichTextEditorControlStylesNames;
37
+ compound: true;
38
+ }>;
39
+ export interface RichTextEditorControlBaseOwnProps extends RichTextEditorControlOwnProps {
40
+ /** Icon displayed inside the control. @deprecated Use the `icon` slot instead. */
41
+ icon?: Component;
42
+ }
43
+ export interface RichTextEditorControlBaseRuntimeProps extends RichTextEditorControlRuntimeProps {
44
+ /** Icon displayed inside the control. @deprecated Use the `icon` slot instead. */
45
+ icon?: Component;
46
+ }
47
+ export type RichTextEditorControlIconSlotProps = HTMLAttributes;
48
+ export interface RichTextEditorControlBaseSlots {
49
+ /** Replaces the default control icon. */
50
+ icon?: (props: RichTextEditorControlIconSlotProps) => VNodeChild;
51
+ }
52
+ export interface RichTextEditorControlBaseProps extends Omit<RichTextEditorControlProps, keyof RichTextEditorControlBaseOwnProps>, RichTextEditorControlBaseOwnProps {
53
+ }
54
+ export type RichTextEditorControlBaseFactory = Factory<{
55
+ props: RichTextEditorControlBaseProps;
56
+ slots: RichTextEditorControlBaseSlots;
57
+ ref: HTMLButtonElement;
58
+ element: 'button';
59
+ stylesNames: RichTextEditorControlStylesNames;
60
+ compound: true;
61
+ }>;
62
+ export interface ControlOperation {
63
+ name: string;
64
+ attributes?: Record<string, any> | string;
65
+ }
66
+ export interface ControlActiveState {
67
+ name: string;
68
+ attributes?: Record<string, any> | string;
69
+ }
70
+ export interface CreateControlProps {
71
+ label: keyof RichTextEditorLabels;
72
+ icon: Component;
73
+ isActive?: ControlActiveState;
74
+ isDisabled?: (editor: Editor) => boolean;
75
+ operation: ControlOperation;
76
+ }
77
+ export interface RichTextEditorGeneratedControlOwnProps extends RichTextEditorControlOwnProps, CreateControlProps {
78
+ }
79
+ export interface RichTextEditorGeneratedControlRuntimeProps extends RichTextEditorControlRuntimeProps, CreateControlProps {
80
+ }
81
+ export type RichTextEditorGeneratedControlSlots = RichTextEditorControlBaseSlots;
82
+ export interface RichTextEditorGeneratedControlProps extends Omit<RichTextEditorControlProps, keyof RichTextEditorGeneratedControlOwnProps>, RichTextEditorGeneratedControlOwnProps {
83
+ }
84
+ export type RichTextEditorGeneratedControlFactory = Factory<{
85
+ props: RichTextEditorGeneratedControlProps;
86
+ slots: RichTextEditorGeneratedControlSlots;
87
+ ref: HTMLButtonElement;
88
+ element: 'button';
89
+ stylesNames: RichTextEditorControlStylesNames;
90
+ compound: true;
91
+ }>;