tiptop-editor 1.2.0 → 1.3.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.
- package/README.md +97 -2
- package/dist/components/editor/TableSelectionMenu.d.ts +1 -1
- package/dist/components/editor/TiptopEditor.stories.d.ts +1 -0
- package/dist/components/editor/TiptopEditorContext.d.ts +3 -0
- package/dist/components/editor/createDefaultExtensions.d.ts +8 -0
- package/dist/components/editor/renderTiptopSlot.d.ts +4 -0
- package/dist/components/editor/useDuplicateExtensionWarnings.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/tiptop-editor.es.js +2907 -2834
- package/dist/tiptop-editor.umd.js +18 -18
- package/dist/types.d.ts +20 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Extensions } from '@tiptap/core';
|
|
1
2
|
import { Editor, EditorContentProps, Range, UseEditorOptions } from '@tiptap/react';
|
|
2
3
|
import { icons } from 'lucide-react';
|
|
3
4
|
export type ImageUploadResponseResolver = string | string[] | ((response: Record<string, unknown>) => string | null | undefined);
|
|
@@ -27,6 +28,12 @@ export type TiptopEditorOptions = Omit<Partial<UseEditorOptions & {
|
|
|
27
28
|
* @default true
|
|
28
29
|
*/
|
|
29
30
|
showDragHandle?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Additional Tiptap extensions to append after the built-in editor set.
|
|
33
|
+
* Use this to add feature-specific extensions like AI commands or collaboration.
|
|
34
|
+
* @default undefined
|
|
35
|
+
*/
|
|
36
|
+
extraExtensions?: Extensions;
|
|
30
37
|
}>, 'extensions'>;
|
|
31
38
|
export interface EditorButtonProps {
|
|
32
39
|
tooltipText?: React.ReactNode;
|
|
@@ -64,6 +71,7 @@ export type TiptopEditorProps = Omit<EditorContentProps, 'editor'> & {
|
|
|
64
71
|
* implementation.
|
|
65
72
|
*/
|
|
66
73
|
editorOptions?: TiptopEditorOptions;
|
|
74
|
+
slots?: TiptopEditorSlots;
|
|
67
75
|
};
|
|
68
76
|
export interface ColorButtonProps {
|
|
69
77
|
editor: Editor;
|
|
@@ -79,6 +87,18 @@ export interface TextSelectionMenuProps {
|
|
|
79
87
|
prepend?: React.ReactNode;
|
|
80
88
|
append?: React.ReactNode;
|
|
81
89
|
}
|
|
90
|
+
export interface TiptopEditorSlotProps {
|
|
91
|
+
editor: Editor;
|
|
92
|
+
}
|
|
93
|
+
export type TiptopEditorSlot = React.ReactNode | ((props: TiptopEditorSlotProps) => React.ReactNode);
|
|
94
|
+
export interface TiptopEditorSlots {
|
|
95
|
+
editorTop?: TiptopEditorSlot;
|
|
96
|
+
editorBottom?: TiptopEditorSlot;
|
|
97
|
+
selectionMenuPrepend?: TiptopEditorSlot;
|
|
98
|
+
selectionMenuAppend?: TiptopEditorSlot;
|
|
99
|
+
tableMenuPrepend?: TiptopEditorSlot;
|
|
100
|
+
tableMenuAppend?: TiptopEditorSlot;
|
|
101
|
+
}
|
|
82
102
|
export interface TiptopEditorHandle {
|
|
83
103
|
getEditor: () => Editor | null;
|
|
84
104
|
on: Editor['on'];
|