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.
Files changed (105) hide show
  1. package/dist/AISuggestion-C8BbWrZc.d.cts +98 -0
  2. package/dist/AISuggestion-C8BbWrZc.d.ts +98 -0
  3. package/dist/chunk-5CLXSFDS.js +627 -0
  4. package/dist/chunk-5CLXSFDS.js.map +1 -0
  5. package/dist/chunk-BYYL4NTM.js +620 -0
  6. package/dist/chunk-BYYL4NTM.js.map +1 -0
  7. package/dist/chunk-FR2S7WLJ.js +619 -0
  8. package/dist/chunk-FR2S7WLJ.js.map +1 -0
  9. package/dist/chunk-LMAPK3FZ.js +602 -0
  10. package/dist/chunk-LMAPK3FZ.js.map +1 -0
  11. package/dist/chunk-NVDAKTK5.js +625 -0
  12. package/dist/chunk-NVDAKTK5.js.map +1 -0
  13. package/dist/chunk-OWNLX6MZ.js +619 -0
  14. package/dist/chunk-OWNLX6MZ.js.map +1 -0
  15. package/dist/chunk-PNWSC5HP.js +619 -0
  16. package/dist/chunk-PNWSC5HP.js.map +1 -0
  17. package/dist/chunk-PTPOSXWA.js +619 -0
  18. package/dist/chunk-PTPOSXWA.js.map +1 -0
  19. package/dist/chunk-RNN6NQQ7.js +616 -0
  20. package/dist/chunk-RNN6NQQ7.js.map +1 -0
  21. package/dist/chunk-SWG4LKYM.js +594 -0
  22. package/dist/chunk-SWG4LKYM.js.map +1 -0
  23. package/dist/chunk-V5D6DU4F.js +627 -0
  24. package/dist/chunk-V5D6DU4F.js.map +1 -0
  25. package/dist/chunk-Y4MYTPNW.js +619 -0
  26. package/dist/chunk-Y4MYTPNW.js.map +1 -0
  27. package/dist/headless/components/editor-bubble-item.d.ts +9 -0
  28. package/dist/headless/components/editor-bubble-item.js +29 -0
  29. package/dist/headless/components/editor-bubble.d.ts +9 -0
  30. package/dist/headless/components/editor-bubble.js +9 -0
  31. package/dist/headless/components/editor-command-item.d.ts +3 -0
  32. package/dist/headless/components/editor-command-item.js +18 -0
  33. package/dist/headless/components/editor-command.d.ts +10 -0
  34. package/dist/headless/components/editor-command.js +48 -0
  35. package/dist/headless/components/editor.d.ts +24 -0
  36. package/dist/headless/components/editor.js +13 -0
  37. package/dist/headless/extensions/CodeBlock/CodeBlock.d.ts +1 -0
  38. package/dist/headless/extensions/CodeBlock/CodeBlock.js +6 -0
  39. package/dist/headless/extensions/CodeBlock/index.d.ts +1 -0
  40. package/dist/headless/extensions/CodeBlock/index.js +1 -0
  41. package/dist/headless/extensions/Image/Image.d.ts +6 -0
  42. package/dist/headless/extensions/Image/Image.js +197 -0
  43. package/dist/headless/extensions/ImageBlock/ImageBlock.d.ts +22 -0
  44. package/dist/headless/extensions/ImageBlock/ImageBlock.js +243 -0
  45. package/dist/headless/extensions/ImageBlock/index.d.ts +2 -0
  46. package/dist/headless/extensions/ImageBlock/index.js +1 -0
  47. package/dist/headless/extensions/Link/Link.d.ts +2 -0
  48. package/dist/headless/extensions/Link/Link.js +44 -0
  49. package/dist/headless/extensions/Link/index.d.ts +1 -0
  50. package/dist/headless/extensions/Link/index.js +1 -0
  51. package/dist/headless/extensions/extension-kit.d.ts +12 -0
  52. package/dist/headless/extensions/extension-kit.js +44 -0
  53. package/dist/headless/extensions/index.d.ts +6 -0
  54. package/dist/headless/extensions/index.js +6 -0
  55. package/dist/headless/extensions/slash-command.d.ts +36 -0
  56. package/dist/headless/extensions/slash-command.js +114 -0
  57. package/dist/headless/index.cjs +7 -0
  58. package/dist/headless/index.cjs.map +1 -1
  59. package/dist/headless/index.d.cts +1 -1
  60. package/dist/headless/index.d.ts +1 -1
  61. package/dist/headless/index.js +1 -1
  62. package/dist/headless/utils/atoms.d.ts +7 -0
  63. package/dist/headless/utils/atoms.js +3 -0
  64. package/dist/headless/utils/store.d.ts +2 -0
  65. package/dist/headless/utils/store.js +4 -0
  66. package/dist/react/Editor.d.ts +32 -0
  67. package/dist/react/Editor.js +43 -0
  68. package/dist/react/index.cjs +368 -309
  69. package/dist/react/index.cjs.map +1 -1
  70. package/dist/react/index.css.map +1 -1
  71. package/dist/react/index.d.cts +1 -1
  72. package/dist/react/index.d.ts +1 -1
  73. package/dist/react/index.js +355 -303
  74. package/dist/react/index.js.map +1 -1
  75. package/dist/react/menus/ImageBlock/ImageBlockLoading.d.ts +2 -0
  76. package/dist/react/menus/ImageBlock/ImageBlockLoading.js +6 -0
  77. package/dist/react/menus/ImageBlock/ImageBlockMenu.d.ts +7 -0
  78. package/dist/react/menus/ImageBlock/ImageBlockMenu.js +100 -0
  79. package/dist/react/menus/ImageBlock/ImageBlockView.d.ts +10 -0
  80. package/dist/react/menus/ImageBlock/ImageBlockView.js +44 -0
  81. package/dist/react/menus/ImageBlock/ImageBlockWidth.d.ts +6 -0
  82. package/dist/react/menus/ImageBlock/ImageBlockWidth.js +29 -0
  83. package/dist/react/menus/ImageBlock/ImageUploader.d.ts +7 -0
  84. package/dist/react/menus/ImageBlock/ImageUploader.js +63 -0
  85. package/dist/react/menus/ImageBlock/index.d.ts +4 -0
  86. package/dist/react/menus/ImageBlock/index.js +4 -0
  87. package/dist/react/menus/ImageMenu.d.ts +10 -0
  88. package/dist/react/menus/ImageMenu.js +76 -0
  89. package/dist/react/menus/ImagePopover.d.ts +8 -0
  90. package/dist/react/menus/ImagePopover.js +146 -0
  91. package/dist/react/menus/LinkEditor.d.ts +8 -0
  92. package/dist/react/menus/LinkEditor.js +38 -0
  93. package/dist/react/menus/LinkMenu.d.ts +2 -0
  94. package/dist/react/menus/LinkMenu.js +69 -0
  95. package/dist/react/menus/LinkPopover.d.ts +9 -0
  96. package/dist/react/menus/LinkPopover.js +113 -0
  97. package/dist/react/menus/MenuList.d.ts +10 -0
  98. package/dist/react/menus/MenuList.js +94 -0
  99. package/dist/react/menus/SlashMenu.d.ts +5 -0
  100. package/dist/react/menus/SlashMenu.js +79 -0
  101. package/dist/react/menus/TextMenu.d.ts +10 -0
  102. package/dist/react/menus/TextMenu.js +131 -0
  103. package/dist/react/menus/index.d.ts +10 -0
  104. package/dist/react/menus/index.js +6 -0
  105. 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 };