nextgen-block-editor 0.0.0-stage → 0.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.
@@ -0,0 +1,64 @@
1
+ import React$1 from 'react';
2
+ import { ToolConstructable, ToolSettings } from '@editorjs/editorjs';
3
+
4
+ interface EditorJSBlock {
5
+ id?: string;
6
+ type: string;
7
+ data: Record<string, unknown>;
8
+ }
9
+ interface EditorJSData {
10
+ time?: number;
11
+ version?: string;
12
+ blocks: EditorJSBlock[];
13
+ }
14
+ interface BlockEditorHandle {
15
+ save: () => Promise<EditorJSData | null>;
16
+ undo: () => void;
17
+ redo: () => void;
18
+ }
19
+ interface BlockEditorProps {
20
+ initialData?: EditorJSData;
21
+ placeholder?: string;
22
+ linkEndpoint?: string;
23
+ enabledTools?: string[];
24
+ showStats?: boolean;
25
+ showAiBar?: boolean;
26
+ onAiRequest?: (params: {
27
+ mode: 'continue' | 'ask';
28
+ prompt: string;
29
+ context: string;
30
+ }) => Promise<string>;
31
+ className?: string;
32
+ onReady?: () => void;
33
+ onChange?: (data: EditorJSData) => void;
34
+ }
35
+ interface BlockRendererProps {
36
+ data: EditorJSData | null | undefined;
37
+ className?: string;
38
+ }
39
+
40
+ declare const BlockEditor: React$1.ForwardRefExoticComponent<BlockEditorProps & React$1.RefAttributes<BlockEditorHandle>>;
41
+
42
+ declare const BlockRenderer: React$1.FC<BlockRendererProps>;
43
+
44
+ interface DocumentHeaderProps {
45
+ coverUrl?: string;
46
+ gradient?: string;
47
+ icon?: string;
48
+ title: string;
49
+ subtitle?: string;
50
+ className?: string;
51
+ }
52
+ declare const DocumentHeader: React$1.FC<DocumentHeaderProps>;
53
+
54
+ declare function getEditorTools(includeLayout?: boolean, enabledTools?: string[]): Record<string, ToolConstructable | ToolSettings>;
55
+
56
+ declare function useInteractiveArticle(containerRef: React.RefObject<HTMLElement | null>, depKey: unknown): void;
57
+
58
+ declare function escHtml(value: unknown): string;
59
+ declare function slugify(text: unknown): string;
60
+ declare function uploadFileToBucket(file: File, folder?: string): Promise<string | null>;
61
+ declare function sanitizeInlineHtml(value: unknown): string;
62
+ declare function blocksToHtml(data: EditorJSData | null | undefined): string;
63
+
64
+ export { BlockEditor, type BlockEditorHandle, type BlockEditorProps, BlockRenderer, type BlockRendererProps, DocumentHeader, type DocumentHeaderProps, type EditorJSBlock, type EditorJSData, blocksToHtml, escHtml, getEditorTools, sanitizeInlineHtml, slugify, uploadFileToBucket, useInteractiveArticle };
@@ -0,0 +1,64 @@
1
+ import React$1 from 'react';
2
+ import { ToolConstructable, ToolSettings } from '@editorjs/editorjs';
3
+
4
+ interface EditorJSBlock {
5
+ id?: string;
6
+ type: string;
7
+ data: Record<string, unknown>;
8
+ }
9
+ interface EditorJSData {
10
+ time?: number;
11
+ version?: string;
12
+ blocks: EditorJSBlock[];
13
+ }
14
+ interface BlockEditorHandle {
15
+ save: () => Promise<EditorJSData | null>;
16
+ undo: () => void;
17
+ redo: () => void;
18
+ }
19
+ interface BlockEditorProps {
20
+ initialData?: EditorJSData;
21
+ placeholder?: string;
22
+ linkEndpoint?: string;
23
+ enabledTools?: string[];
24
+ showStats?: boolean;
25
+ showAiBar?: boolean;
26
+ onAiRequest?: (params: {
27
+ mode: 'continue' | 'ask';
28
+ prompt: string;
29
+ context: string;
30
+ }) => Promise<string>;
31
+ className?: string;
32
+ onReady?: () => void;
33
+ onChange?: (data: EditorJSData) => void;
34
+ }
35
+ interface BlockRendererProps {
36
+ data: EditorJSData | null | undefined;
37
+ className?: string;
38
+ }
39
+
40
+ declare const BlockEditor: React$1.ForwardRefExoticComponent<BlockEditorProps & React$1.RefAttributes<BlockEditorHandle>>;
41
+
42
+ declare const BlockRenderer: React$1.FC<BlockRendererProps>;
43
+
44
+ interface DocumentHeaderProps {
45
+ coverUrl?: string;
46
+ gradient?: string;
47
+ icon?: string;
48
+ title: string;
49
+ subtitle?: string;
50
+ className?: string;
51
+ }
52
+ declare const DocumentHeader: React$1.FC<DocumentHeaderProps>;
53
+
54
+ declare function getEditorTools(includeLayout?: boolean, enabledTools?: string[]): Record<string, ToolConstructable | ToolSettings>;
55
+
56
+ declare function useInteractiveArticle(containerRef: React.RefObject<HTMLElement | null>, depKey: unknown): void;
57
+
58
+ declare function escHtml(value: unknown): string;
59
+ declare function slugify(text: unknown): string;
60
+ declare function uploadFileToBucket(file: File, folder?: string): Promise<string | null>;
61
+ declare function sanitizeInlineHtml(value: unknown): string;
62
+ declare function blocksToHtml(data: EditorJSData | null | undefined): string;
63
+
64
+ export { BlockEditor, type BlockEditorHandle, type BlockEditorProps, BlockRenderer, type BlockRendererProps, DocumentHeader, type DocumentHeaderProps, type EditorJSBlock, type EditorJSData, blocksToHtml, escHtml, getEditorTools, sanitizeInlineHtml, slugify, uploadFileToBucket, useInteractiveArticle };