neuphlo-editor 2.5.1 → 2.6.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/Markdown-BAW0cb-U.d.cts +153 -0
- package/dist/Markdown-BAW0cb-U.d.ts +153 -0
- package/dist/chunk-ABL4D65Z.js +1454 -0
- package/dist/chunk-ABL4D65Z.js.map +1 -0
- package/dist/chunk-Z2DR2FK3.js +1582 -0
- package/dist/chunk-Z2DR2FK3.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 +27 -0
- package/dist/headless/components/editor-command.d.ts +3 -0
- package/dist/headless/components/editor-command.js +136 -0
- package/dist/headless/components/editor.d.ts +24 -0
- package/dist/headless/components/editor.js +13 -0
- package/dist/headless/extensions/AISuggestion/AISuggestion.d.ts +82 -0
- package/dist/headless/extensions/AISuggestion/AISuggestion.js +244 -0
- package/dist/headless/extensions/AISuggestion/index.d.ts +2 -0
- package/dist/headless/extensions/AISuggestion/index.js +1 -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/DragHandle/DragHandle.d.ts +9 -0
- package/dist/headless/extensions/DragHandle/DragHandle.js +47 -0
- package/dist/headless/extensions/DragHandle/index.d.ts +2 -0
- package/dist/headless/extensions/DragHandle/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 +23 -0
- package/dist/headless/extensions/ImageBlock/ImageBlock.js +242 -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/Markdown.d.ts +9 -0
- package/dist/headless/extensions/Markdown.js +138 -0
- package/dist/headless/extensions/MarkdownPaste.d.ts +3 -0
- package/dist/headless/extensions/MarkdownPaste.js +168 -0
- package/dist/headless/extensions/Mention/index.d.ts +4 -0
- package/dist/headless/extensions/Mention/index.js +3 -0
- package/dist/headless/extensions/Mention/mention-command.d.ts +8 -0
- package/dist/headless/extensions/Mention/mention-command.js +165 -0
- package/dist/headless/extensions/Mention/mention-list.d.ts +8 -0
- package/dist/headless/extensions/Mention/mention-list.js +150 -0
- package/dist/headless/extensions/Mention/mention-node-view.d.ts +2 -0
- package/dist/headless/extensions/Mention/mention-node-view.js +92 -0
- package/dist/headless/extensions/Mention/mention.d.ts +46 -0
- package/dist/headless/extensions/Mention/mention.js +218 -0
- package/dist/headless/extensions/Table/index.d.ts +2 -0
- package/dist/headless/extensions/Table/index.js +2 -0
- package/dist/headless/extensions/VideoBlock/VideoBlock.d.ts +17 -0
- package/dist/headless/extensions/VideoBlock/VideoBlock.js +73 -0
- package/dist/headless/extensions/VideoBlock/index.d.ts +2 -0
- package/dist/headless/extensions/VideoBlock/index.js +1 -0
- package/dist/headless/extensions/extension-kit.d.ts +29 -0
- package/dist/headless/extensions/extension-kit.js +132 -0
- package/dist/headless/extensions/index.d.ts +16 -0
- package/dist/headless/extensions/index.js +12 -0
- package/dist/headless/extensions/slash-command.d.ts +24 -0
- package/dist/headless/extensions/slash-command.js +99 -0
- package/dist/headless/index.cjs +143 -2
- package/dist/headless/index.cjs.map +1 -1
- package/dist/headless/index.d.cts +3 -2
- package/dist/headless/index.d.ts +3 -2
- package/dist/headless/index.js +5 -1
- package/dist/headless/utils/atoms.d.ts +13 -0
- package/dist/headless/utils/atoms.js +5 -0
- package/dist/headless/utils/store.d.ts +2 -0
- package/dist/headless/utils/store.js +4 -0
- package/dist/highlight.css +0 -6
- package/dist/react/Editor.d.ts +43 -0
- package/dist/react/Editor.js +119 -0
- package/dist/react/TableOfContents.d.ts +7 -0
- package/dist/react/TableOfContents.js +96 -0
- package/dist/react/index.cjs +156 -9
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +5 -2
- package/dist/react/index.d.ts +5 -2
- package/dist/react/index.js +14 -4
- package/dist/react/index.js.map +1 -1
- package/dist/react/menus/DragHandle/BlockActionMenu.d.ts +7 -0
- package/dist/react/menus/DragHandle/BlockActionMenu.js +111 -0
- package/dist/react/menus/DragHandle/DragHandleMenu.d.ts +7 -0
- package/dist/react/menus/DragHandle/DragHandleMenu.js +97 -0
- 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 +8 -0
- package/dist/react/menus/ImageBlock/ImageBlockMenu.js +75 -0
- package/dist/react/menus/ImageBlock/ImageBlockView.d.ts +10 -0
- package/dist/react/menus/ImageBlock/ImageBlockView.js +60 -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/ImageResizeHandle.d.ts +8 -0
- package/dist/react/menus/ImageBlock/ImageResizeHandle.js +37 -0
- package/dist/react/menus/ImageBlock/ImageUploader.d.ts +7 -0
- package/dist/react/menus/ImageBlock/ImageUploader.js +73 -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 +77 -0
- package/dist/react/menus/ImagePopover.d.ts +8 -0
- package/dist/react/menus/ImagePopover.js +146 -0
- package/dist/react/menus/LinkMenu.d.ts +2 -0
- package/dist/react/menus/LinkMenu.js +69 -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 +156 -0
- package/dist/react/menus/TableMenu.d.ts +5 -0
- package/dist/react/menus/TableMenu.js +462 -0
- package/dist/react/menus/TaskItem/TaskItemView.d.ts +12 -0
- package/dist/react/menus/TaskItem/TaskItemView.js +11 -0
- package/dist/react/menus/TextMenu.d.ts +10 -0
- package/dist/react/menus/TextMenu.js +139 -0
- package/dist/react/menus/VideoBlock/VideoBlockMenu.d.ts +7 -0
- package/dist/react/menus/VideoBlock/VideoBlockMenu.js +72 -0
- package/dist/react/menus/VideoBlock/VideoBlockView.d.ts +10 -0
- package/dist/react/menus/VideoBlock/VideoBlockView.js +87 -0
- package/dist/react/menus/VideoBlock/index.d.ts +2 -0
- package/dist/react/menus/VideoBlock/index.js +2 -0
- package/dist/react/menus/index.d.ts +15 -0
- package/dist/react/menus/index.js +9 -0
- package/package.json +13 -9
- package/LICENSE +0 -21
package/dist/react/index.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Editor as Editor$1 } from '@tiptap/react';
|
|
3
|
-
import { b as EditorContentProps,
|
|
3
|
+
import { b as EditorContentProps, f as MentionOptions } from '../Markdown-BAW0cb-U.cjs';
|
|
4
|
+
export { c as Markdown, d as MarkdownStorage, m as markdownToHtml } from '../Markdown-BAW0cb-U.cjs';
|
|
4
5
|
import { ComponentType, ReactNode } from 'react';
|
|
5
6
|
import '@tiptap/core';
|
|
6
7
|
import '@tiptap/extension-mention';
|
|
8
|
+
import '@tiptap/pm/markdown';
|
|
7
9
|
|
|
8
10
|
type TaskItemCheckboxProps = {
|
|
9
11
|
checked: boolean;
|
|
@@ -23,6 +25,7 @@ type BubbleMenuExtras = Partial<{
|
|
|
23
25
|
}>;
|
|
24
26
|
type NeuphloEditorProps = {
|
|
25
27
|
content?: string;
|
|
28
|
+
markdown?: boolean;
|
|
26
29
|
className?: string;
|
|
27
30
|
editable?: boolean;
|
|
28
31
|
immediatelyRender?: boolean;
|
|
@@ -48,7 +51,7 @@ type NeuphloEditorProps = {
|
|
|
48
51
|
taskItemView?: any;
|
|
49
52
|
checkboxComponent?: TaskItemCheckboxComponent;
|
|
50
53
|
};
|
|
51
|
-
declare function Editor({ content, className, editable, immediatelyRender, showTextMenu, showSlashMenu, showImageMenu, showDragHandle, extensions, bubbleMenuExtras, onUpdate, onCreate, uploadImage, browseAssets, collaboration, mentionOptions, referenceOptions, slashCommand, placeholder, taskItemView, checkboxComponent, }: NeuphloEditorProps): react_jsx_runtime.JSX.Element;
|
|
54
|
+
declare function Editor({ content, markdown, className, editable, immediatelyRender, showTextMenu, showSlashMenu, showImageMenu, showDragHandle, extensions, bubbleMenuExtras, onUpdate, onCreate, uploadImage, browseAssets, collaboration, mentionOptions, referenceOptions, slashCommand, placeholder, taskItemView, checkboxComponent, }: NeuphloEditorProps): react_jsx_runtime.JSX.Element;
|
|
52
55
|
|
|
53
56
|
type ExtraRenderer = (editor: Editor$1) => ReactNode;
|
|
54
57
|
type TextMenuProps = {
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Editor as Editor$1 } from '@tiptap/react';
|
|
3
|
-
import { b as EditorContentProps,
|
|
3
|
+
import { b as EditorContentProps, f as MentionOptions } from '../Markdown-BAW0cb-U.js';
|
|
4
|
+
export { c as Markdown, d as MarkdownStorage, m as markdownToHtml } from '../Markdown-BAW0cb-U.js';
|
|
4
5
|
import { ComponentType, ReactNode } from 'react';
|
|
5
6
|
import '@tiptap/core';
|
|
6
7
|
import '@tiptap/extension-mention';
|
|
8
|
+
import '@tiptap/pm/markdown';
|
|
7
9
|
|
|
8
10
|
type TaskItemCheckboxProps = {
|
|
9
11
|
checked: boolean;
|
|
@@ -23,6 +25,7 @@ type BubbleMenuExtras = Partial<{
|
|
|
23
25
|
}>;
|
|
24
26
|
type NeuphloEditorProps = {
|
|
25
27
|
content?: string;
|
|
28
|
+
markdown?: boolean;
|
|
26
29
|
className?: string;
|
|
27
30
|
editable?: boolean;
|
|
28
31
|
immediatelyRender?: boolean;
|
|
@@ -48,7 +51,7 @@ type NeuphloEditorProps = {
|
|
|
48
51
|
taskItemView?: any;
|
|
49
52
|
checkboxComponent?: TaskItemCheckboxComponent;
|
|
50
53
|
};
|
|
51
|
-
declare function Editor({ content, className, editable, immediatelyRender, showTextMenu, showSlashMenu, showImageMenu, showDragHandle, extensions, bubbleMenuExtras, onUpdate, onCreate, uploadImage, browseAssets, collaboration, mentionOptions, referenceOptions, slashCommand, placeholder, taskItemView, checkboxComponent, }: NeuphloEditorProps): react_jsx_runtime.JSX.Element;
|
|
54
|
+
declare function Editor({ content, markdown, className, editable, immediatelyRender, showTextMenu, showSlashMenu, showImageMenu, showDragHandle, extensions, bubbleMenuExtras, onUpdate, onCreate, uploadImage, browseAssets, collaboration, mentionOptions, referenceOptions, slashCommand, placeholder, taskItemView, checkboxComponent, }: NeuphloEditorProps): react_jsx_runtime.JSX.Element;
|
|
52
55
|
|
|
53
56
|
type ExtraRenderer = (editor: Editor$1) => ReactNode;
|
|
54
57
|
type TextMenuProps = {
|
package/dist/react/index.js
CHANGED
|
@@ -9,17 +9,19 @@ import {
|
|
|
9
9
|
EditorRoot,
|
|
10
10
|
ImageBlock,
|
|
11
11
|
Link,
|
|
12
|
+
Markdown,
|
|
12
13
|
MarkdownPaste,
|
|
13
14
|
Placeholder,
|
|
14
15
|
StarterKit,
|
|
15
16
|
TableKit,
|
|
16
17
|
createMentionExtension,
|
|
17
18
|
handleCommandNavigation,
|
|
19
|
+
markdownToHtml,
|
|
18
20
|
novelStore,
|
|
19
21
|
queryAtom,
|
|
20
22
|
setDragHandleCallbacks,
|
|
21
23
|
store_exports
|
|
22
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-Z2DR2FK3.js";
|
|
23
25
|
|
|
24
26
|
// src/headless/extensions/extension-kit.ts
|
|
25
27
|
import Collaboration from "@tiptap/extension-collaboration";
|
|
@@ -147,7 +149,8 @@ var ExtensionKit = (options) => {
|
|
|
147
149
|
},
|
|
148
150
|
includeChildren: true
|
|
149
151
|
}),
|
|
150
|
-
MarkdownPaste
|
|
152
|
+
MarkdownPaste,
|
|
153
|
+
Markdown
|
|
151
154
|
];
|
|
152
155
|
if (options?.table !== false) {
|
|
153
156
|
extensions.push(
|
|
@@ -2805,6 +2808,7 @@ import { useMemo as useMemo2, useState as useState11, useCallback as useCallback
|
|
|
2805
2808
|
import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2806
2809
|
function Editor5({
|
|
2807
2810
|
content,
|
|
2811
|
+
markdown = false,
|
|
2808
2812
|
className,
|
|
2809
2813
|
editable = true,
|
|
2810
2814
|
immediatelyRender = false,
|
|
@@ -2831,6 +2835,10 @@ function Editor5({
|
|
|
2831
2835
|
if (checkboxComponent) return createTaskItemView(checkboxComponent);
|
|
2832
2836
|
return void 0;
|
|
2833
2837
|
}, [taskItemView, checkboxComponent]);
|
|
2838
|
+
const resolvedContent = useMemo2(() => {
|
|
2839
|
+
if (markdown && typeof content === "string") return markdownToHtml(content);
|
|
2840
|
+
return content;
|
|
2841
|
+
}, [markdown, content]);
|
|
2834
2842
|
const [actionMenuAnchor, setActionMenuAnchor] = useState11(null);
|
|
2835
2843
|
const [actionMenuEditor, setActionMenuEditor] = useState11(null);
|
|
2836
2844
|
const actionMenuRef = useRef11(null);
|
|
@@ -2893,7 +2901,7 @@ function Editor5({
|
|
|
2893
2901
|
onCreate,
|
|
2894
2902
|
immediatelyRender,
|
|
2895
2903
|
editable,
|
|
2896
|
-
content,
|
|
2904
|
+
content: resolvedContent,
|
|
2897
2905
|
extensions: [
|
|
2898
2906
|
...extension_kit_default({
|
|
2899
2907
|
uploadImage,
|
|
@@ -3061,7 +3069,9 @@ function TableOfContents({
|
|
|
3061
3069
|
}
|
|
3062
3070
|
export {
|
|
3063
3071
|
Editor5 as Editor,
|
|
3072
|
+
Markdown,
|
|
3064
3073
|
TableOfContents,
|
|
3065
|
-
TextMenu
|
|
3074
|
+
TextMenu,
|
|
3075
|
+
markdownToHtml
|
|
3066
3076
|
};
|
|
3067
3077
|
//# sourceMappingURL=index.js.map
|