neuphlo-editor 1.4.7 → 1.5.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/dist/AISuggestion-C8BbWrZc.d.cts +98 -0
- package/dist/AISuggestion-C8BbWrZc.d.ts +98 -0
- package/dist/chunk-5CLXSFDS.js +627 -0
- package/dist/chunk-5CLXSFDS.js.map +1 -0
- package/dist/chunk-BYYL4NTM.js +620 -0
- package/dist/chunk-BYYL4NTM.js.map +1 -0
- package/dist/chunk-FR2S7WLJ.js +619 -0
- package/dist/chunk-FR2S7WLJ.js.map +1 -0
- package/dist/chunk-LMAPK3FZ.js +602 -0
- package/dist/chunk-LMAPK3FZ.js.map +1 -0
- package/dist/chunk-NVDAKTK5.js +625 -0
- package/dist/chunk-NVDAKTK5.js.map +1 -0
- package/dist/chunk-OWNLX6MZ.js +619 -0
- package/dist/chunk-OWNLX6MZ.js.map +1 -0
- package/dist/chunk-PNWSC5HP.js +619 -0
- package/dist/chunk-PNWSC5HP.js.map +1 -0
- package/dist/chunk-PTPOSXWA.js +619 -0
- package/dist/chunk-PTPOSXWA.js.map +1 -0
- package/dist/chunk-RNN6NQQ7.js +616 -0
- package/dist/chunk-RNN6NQQ7.js.map +1 -0
- package/dist/chunk-SWG4LKYM.js +594 -0
- package/dist/chunk-SWG4LKYM.js.map +1 -0
- package/dist/chunk-V5D6DU4F.js +627 -0
- package/dist/chunk-V5D6DU4F.js.map +1 -0
- package/dist/chunk-Y4MYTPNW.js +619 -0
- package/dist/chunk-Y4MYTPNW.js.map +1 -0
- package/dist/headless/components/editor-bubble-item.d.ts +9 -0
- package/dist/headless/components/editor-bubble-item.js +29 -0
- package/dist/headless/components/editor-bubble.d.ts +9 -0
- package/dist/headless/components/editor-bubble.js +9 -0
- package/dist/headless/components/editor-command-item.d.ts +3 -0
- package/dist/headless/components/editor-command-item.js +18 -0
- package/dist/headless/components/editor-command.d.ts +10 -0
- package/dist/headless/components/editor-command.js +48 -0
- package/dist/headless/components/editor.d.ts +24 -0
- package/dist/headless/components/editor.js +13 -0
- package/dist/headless/extensions/CodeBlock/CodeBlock.d.ts +1 -0
- package/dist/headless/extensions/CodeBlock/CodeBlock.js +6 -0
- package/dist/headless/extensions/CodeBlock/index.d.ts +1 -0
- package/dist/headless/extensions/CodeBlock/index.js +1 -0
- package/dist/headless/extensions/Image/Image.d.ts +6 -0
- package/dist/headless/extensions/Image/Image.js +197 -0
- package/dist/headless/extensions/ImageBlock/ImageBlock.d.ts +22 -0
- package/dist/headless/extensions/ImageBlock/ImageBlock.js +243 -0
- package/dist/headless/extensions/ImageBlock/index.d.ts +2 -0
- package/dist/headless/extensions/ImageBlock/index.js +1 -0
- package/dist/headless/extensions/Link/Link.d.ts +2 -0
- package/dist/headless/extensions/Link/Link.js +44 -0
- package/dist/headless/extensions/Link/index.d.ts +1 -0
- package/dist/headless/extensions/Link/index.js +1 -0
- package/dist/headless/extensions/extension-kit.d.ts +12 -0
- package/dist/headless/extensions/extension-kit.js +44 -0
- package/dist/headless/extensions/index.d.ts +6 -0
- package/dist/headless/extensions/index.js +6 -0
- package/dist/headless/extensions/slash-command.d.ts +36 -0
- package/dist/headless/extensions/slash-command.js +114 -0
- package/dist/headless/index.cjs +7 -0
- package/dist/headless/index.cjs.map +1 -1
- package/dist/headless/index.d.cts +1 -1
- package/dist/headless/index.d.ts +1 -1
- package/dist/headless/index.js +1 -1
- package/dist/headless/utils/atoms.d.ts +7 -0
- package/dist/headless/utils/atoms.js +3 -0
- package/dist/headless/utils/store.d.ts +2 -0
- package/dist/headless/utils/store.js +4 -0
- package/dist/react/Editor.d.ts +32 -0
- package/dist/react/Editor.js +43 -0
- package/dist/react/index.cjs +368 -309
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.css.map +1 -1
- package/dist/react/index.d.cts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +355 -303
- package/dist/react/index.js.map +1 -1
- package/dist/react/menus/ImageBlock/ImageBlockLoading.d.ts +2 -0
- package/dist/react/menus/ImageBlock/ImageBlockLoading.js +6 -0
- package/dist/react/menus/ImageBlock/ImageBlockMenu.d.ts +7 -0
- package/dist/react/menus/ImageBlock/ImageBlockMenu.js +100 -0
- package/dist/react/menus/ImageBlock/ImageBlockView.d.ts +10 -0
- package/dist/react/menus/ImageBlock/ImageBlockView.js +44 -0
- package/dist/react/menus/ImageBlock/ImageBlockWidth.d.ts +6 -0
- package/dist/react/menus/ImageBlock/ImageBlockWidth.js +29 -0
- package/dist/react/menus/ImageBlock/ImageUploader.d.ts +7 -0
- package/dist/react/menus/ImageBlock/ImageUploader.js +63 -0
- package/dist/react/menus/ImageBlock/index.d.ts +4 -0
- package/dist/react/menus/ImageBlock/index.js +4 -0
- package/dist/react/menus/ImageMenu.d.ts +10 -0
- package/dist/react/menus/ImageMenu.js +76 -0
- package/dist/react/menus/ImagePopover.d.ts +8 -0
- package/dist/react/menus/ImagePopover.js +146 -0
- package/dist/react/menus/LinkEditor.d.ts +8 -0
- package/dist/react/menus/LinkEditor.js +38 -0
- package/dist/react/menus/LinkMenu.d.ts +2 -0
- package/dist/react/menus/LinkMenu.js +69 -0
- package/dist/react/menus/LinkPopover.d.ts +9 -0
- package/dist/react/menus/LinkPopover.js +113 -0
- package/dist/react/menus/MenuList.d.ts +10 -0
- package/dist/react/menus/MenuList.js +94 -0
- package/dist/react/menus/SlashMenu.d.ts +5 -0
- package/dist/react/menus/SlashMenu.js +79 -0
- package/dist/react/menus/TextMenu.d.ts +10 -0
- package/dist/react/menus/TextMenu.js +131 -0
- package/dist/react/menus/index.d.ts +10 -0
- package/dist/react/menus/index.js +6 -0
- package/package.json +15 -15
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as _tiptap_core from '@tiptap/core';
|
|
2
|
+
import { Range } from '@tiptap/core';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { FC, ReactNode } from 'react';
|
|
5
|
+
import { EditorProviderProps } from '@tiptap/react';
|
|
6
|
+
|
|
7
|
+
interface EditorRootProps {
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const EditorRoot: FC<EditorRootProps>;
|
|
11
|
+
type EditorContentProps = EditorProviderProps & {
|
|
12
|
+
readonly children?: ReactNode;
|
|
13
|
+
readonly className?: string;
|
|
14
|
+
readonly initialContent?: any;
|
|
15
|
+
};
|
|
16
|
+
declare const EditorContent: react.ForwardRefExoticComponent<{
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
slotBefore?: ReactNode;
|
|
19
|
+
slotAfter?: ReactNode;
|
|
20
|
+
editorContainerProps?: react.HTMLAttributes<HTMLDivElement>;
|
|
21
|
+
} & Partial<_tiptap_core.EditorOptions> & {
|
|
22
|
+
immediatelyRender?: boolean;
|
|
23
|
+
shouldRerenderOnTransaction?: boolean;
|
|
24
|
+
} & {
|
|
25
|
+
readonly children?: ReactNode;
|
|
26
|
+
readonly className?: string;
|
|
27
|
+
readonly initialContent?: any;
|
|
28
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
|
|
30
|
+
declare module "@tiptap/core" {
|
|
31
|
+
interface Commands<ReturnType> {
|
|
32
|
+
imageBlock: {
|
|
33
|
+
setImageBlock: (attributes: {
|
|
34
|
+
src: string;
|
|
35
|
+
}) => ReturnType;
|
|
36
|
+
setImageBlockAt: (attributes: {
|
|
37
|
+
src: string;
|
|
38
|
+
pos: number | Range;
|
|
39
|
+
}) => ReturnType;
|
|
40
|
+
setImageBlockAlign: (align: "left" | "center" | "right") => ReturnType;
|
|
41
|
+
setImageBlockWidth: (width: number) => ReturnType;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* TipTap AI Suggestion Extension
|
|
48
|
+
*
|
|
49
|
+
* This extension provides inline AI-powered text completions that appear
|
|
50
|
+
* as ghost text at the cursor position.
|
|
51
|
+
*
|
|
52
|
+
* Usage:
|
|
53
|
+
* ```ts
|
|
54
|
+
* import { AISuggestion } from 'neuphlo-editor'
|
|
55
|
+
*
|
|
56
|
+
* const editor = new Editor({
|
|
57
|
+
* extensions: [
|
|
58
|
+
* AISuggestion.configure({
|
|
59
|
+
* onFetchSuggestion: async (context) => {
|
|
60
|
+
* // Call your AI API here
|
|
61
|
+
* const response = await fetch('/api/complete', {
|
|
62
|
+
* method: 'POST',
|
|
63
|
+
* body: JSON.stringify({ text: context }),
|
|
64
|
+
* })
|
|
65
|
+
* const data = await response.json()
|
|
66
|
+
* return data.completion
|
|
67
|
+
* },
|
|
68
|
+
* debounceMs: 2000,
|
|
69
|
+
* }),
|
|
70
|
+
* ],
|
|
71
|
+
* })
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
declare module "@tiptap/core" {
|
|
76
|
+
interface Commands<ReturnType> {
|
|
77
|
+
aiSuggestion: {
|
|
78
|
+
/**
|
|
79
|
+
* Accept the current AI suggestion
|
|
80
|
+
*/
|
|
81
|
+
acceptAISuggestion: () => ReturnType;
|
|
82
|
+
/**
|
|
83
|
+
* Dismiss the current AI suggestion
|
|
84
|
+
*/
|
|
85
|
+
dismissAISuggestion: () => ReturnType;
|
|
86
|
+
/**
|
|
87
|
+
* Manually trigger a suggestion fetch
|
|
88
|
+
*/
|
|
89
|
+
triggerAISuggestion: () => ReturnType;
|
|
90
|
+
/**
|
|
91
|
+
* Set a suggestion programmatically
|
|
92
|
+
*/
|
|
93
|
+
setAISuggestion: (text: string) => ReturnType;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export { EditorRoot as E, EditorContent as a, type EditorContentProps as b };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as _tiptap_core from '@tiptap/core';
|
|
2
|
+
import { Range } from '@tiptap/core';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { FC, ReactNode } from 'react';
|
|
5
|
+
import { EditorProviderProps } from '@tiptap/react';
|
|
6
|
+
|
|
7
|
+
interface EditorRootProps {
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const EditorRoot: FC<EditorRootProps>;
|
|
11
|
+
type EditorContentProps = EditorProviderProps & {
|
|
12
|
+
readonly children?: ReactNode;
|
|
13
|
+
readonly className?: string;
|
|
14
|
+
readonly initialContent?: any;
|
|
15
|
+
};
|
|
16
|
+
declare const EditorContent: react.ForwardRefExoticComponent<{
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
slotBefore?: ReactNode;
|
|
19
|
+
slotAfter?: ReactNode;
|
|
20
|
+
editorContainerProps?: react.HTMLAttributes<HTMLDivElement>;
|
|
21
|
+
} & Partial<_tiptap_core.EditorOptions> & {
|
|
22
|
+
immediatelyRender?: boolean;
|
|
23
|
+
shouldRerenderOnTransaction?: boolean;
|
|
24
|
+
} & {
|
|
25
|
+
readonly children?: ReactNode;
|
|
26
|
+
readonly className?: string;
|
|
27
|
+
readonly initialContent?: any;
|
|
28
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
|
|
30
|
+
declare module "@tiptap/core" {
|
|
31
|
+
interface Commands<ReturnType> {
|
|
32
|
+
imageBlock: {
|
|
33
|
+
setImageBlock: (attributes: {
|
|
34
|
+
src: string;
|
|
35
|
+
}) => ReturnType;
|
|
36
|
+
setImageBlockAt: (attributes: {
|
|
37
|
+
src: string;
|
|
38
|
+
pos: number | Range;
|
|
39
|
+
}) => ReturnType;
|
|
40
|
+
setImageBlockAlign: (align: "left" | "center" | "right") => ReturnType;
|
|
41
|
+
setImageBlockWidth: (width: number) => ReturnType;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* TipTap AI Suggestion Extension
|
|
48
|
+
*
|
|
49
|
+
* This extension provides inline AI-powered text completions that appear
|
|
50
|
+
* as ghost text at the cursor position.
|
|
51
|
+
*
|
|
52
|
+
* Usage:
|
|
53
|
+
* ```ts
|
|
54
|
+
* import { AISuggestion } from 'neuphlo-editor'
|
|
55
|
+
*
|
|
56
|
+
* const editor = new Editor({
|
|
57
|
+
* extensions: [
|
|
58
|
+
* AISuggestion.configure({
|
|
59
|
+
* onFetchSuggestion: async (context) => {
|
|
60
|
+
* // Call your AI API here
|
|
61
|
+
* const response = await fetch('/api/complete', {
|
|
62
|
+
* method: 'POST',
|
|
63
|
+
* body: JSON.stringify({ text: context }),
|
|
64
|
+
* })
|
|
65
|
+
* const data = await response.json()
|
|
66
|
+
* return data.completion
|
|
67
|
+
* },
|
|
68
|
+
* debounceMs: 2000,
|
|
69
|
+
* }),
|
|
70
|
+
* ],
|
|
71
|
+
* })
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
declare module "@tiptap/core" {
|
|
76
|
+
interface Commands<ReturnType> {
|
|
77
|
+
aiSuggestion: {
|
|
78
|
+
/**
|
|
79
|
+
* Accept the current AI suggestion
|
|
80
|
+
*/
|
|
81
|
+
acceptAISuggestion: () => ReturnType;
|
|
82
|
+
/**
|
|
83
|
+
* Dismiss the current AI suggestion
|
|
84
|
+
*/
|
|
85
|
+
dismissAISuggestion: () => ReturnType;
|
|
86
|
+
/**
|
|
87
|
+
* Manually trigger a suggestion fetch
|
|
88
|
+
*/
|
|
89
|
+
triggerAISuggestion: () => ReturnType;
|
|
90
|
+
/**
|
|
91
|
+
* Set a suggestion programmatically
|
|
92
|
+
*/
|
|
93
|
+
setAISuggestion: (text: string) => ReturnType;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export { EditorRoot as E, EditorContent as a, type EditorContentProps as b };
|