@otmc/ui 0.1.6 → 0.1.7
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/chunk-BGUL4HIW.js +410 -0
- package/dist/chunk-BGUL4HIW.js.map +1 -0
- package/dist/editor.cjs +5075 -0
- package/dist/editor.cjs.map +1 -0
- package/dist/editor.d.cts +217 -0
- package/dist/editor.d.ts +217 -0
- package/dist/editor.js +4807 -0
- package/dist/editor.js.map +1 -0
- package/dist/index.cjs +417 -128
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +104 -203
- package/dist/index.js.map +1 -1
- package/dist/instructions-CCxIhaa6.d.cts +116 -0
- package/dist/instructions-CCxIhaa6.d.ts +116 -0
- package/package.json +91 -12
- /package/{scripts → src/scripts}/prebuild.js +0 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
import { Editor, EditorOptions, ReactNodeViewProps } from '@tiptap/react';
|
|
4
|
+
export { A as ApiResponse, B as BACKEND_URL, E as ErrorResponse, F as FormatDocumentRequest, a as FormatDocumentResponse, G as GenerateDocumentRequest, b as GenerateDocumentResponse, I as Instruction, L as LLMConfigResponse, c as LLMReloadResponse, d as LLMRequest, e as LLMResponse, f as LLMTestResponse, S as SuccessResponse, g as apiClient, h as apiUtils, i as getBackendUrl, j as instructionsApi, l as llmApi, s as setAccessTokenGetter, k as setBackendUrl } from './instructions-CCxIhaa6.cjs';
|
|
5
|
+
import * as _tiptap_core from '@tiptap/core';
|
|
6
|
+
import { Extension, Node } from '@tiptap/core';
|
|
7
|
+
import { BoxProps } from '@mantine/core';
|
|
8
|
+
import * as _tiptap_extension_list from '@tiptap/extension-list';
|
|
9
|
+
import * as _tiptap_extension_code_block_lowlight from '@tiptap/extension-code-block-lowlight';
|
|
10
|
+
|
|
11
|
+
interface EditorProps {
|
|
12
|
+
initialContent?: string;
|
|
13
|
+
onChange?: (content: string) => void;
|
|
14
|
+
outputFormat?: 'html' | 'markdown' | 'json';
|
|
15
|
+
showTableOfContents?: boolean;
|
|
16
|
+
showHeadingDividers?: boolean;
|
|
17
|
+
minHeight?: number;
|
|
18
|
+
editable?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const MarkdownEditor: react.NamedExoticComponent<EditorProps>;
|
|
21
|
+
|
|
22
|
+
interface DocumentEditorProps {
|
|
23
|
+
editor: Editor;
|
|
24
|
+
opened: boolean;
|
|
25
|
+
onClose: () => void;
|
|
26
|
+
}
|
|
27
|
+
declare function DocumentEditor({ editor, opened, onClose }: DocumentEditorProps): react.JSX.Element;
|
|
28
|
+
|
|
29
|
+
interface UseEditorWithStorageOptions extends Partial<EditorOptions> {
|
|
30
|
+
initialContent?: string;
|
|
31
|
+
onContentChange?: (content: string) => void;
|
|
32
|
+
debounceDelay?: number;
|
|
33
|
+
outputFormat?: 'html' | 'markdown' | 'json';
|
|
34
|
+
extensions?: any[];
|
|
35
|
+
}
|
|
36
|
+
declare const useEditorWithStorage: ({ initialContent, onContentChange, debounceDelay, outputFormat, extensions, ...editorOptions }: UseEditorWithStorageOptions) => _tiptap_core.Editor;
|
|
37
|
+
|
|
38
|
+
interface EditorContentProps {
|
|
39
|
+
editor: any;
|
|
40
|
+
minHeight?: number;
|
|
41
|
+
}
|
|
42
|
+
declare function EditorContent({ editor, minHeight }: EditorContentProps): react.JSX.Element;
|
|
43
|
+
|
|
44
|
+
interface BubbleMenuProps {
|
|
45
|
+
editor: Editor;
|
|
46
|
+
}
|
|
47
|
+
declare function BubbleMenu({ editor }: BubbleMenuProps): react.JSX.Element;
|
|
48
|
+
|
|
49
|
+
interface TableControlsProps {
|
|
50
|
+
editor: Editor;
|
|
51
|
+
}
|
|
52
|
+
declare function TableControls({ editor }: TableControlsProps): react.JSX.Element | null;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @License OTMC License
|
|
56
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
57
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
58
|
+
**/
|
|
59
|
+
|
|
60
|
+
interface BlockNode {
|
|
61
|
+
type: {
|
|
62
|
+
name: string;
|
|
63
|
+
};
|
|
64
|
+
attrs: Record<string, any>;
|
|
65
|
+
content: any[];
|
|
66
|
+
textContent: string;
|
|
67
|
+
}
|
|
68
|
+
interface BlockConfig {
|
|
69
|
+
type: string;
|
|
70
|
+
label: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
icon: React.ReactNode;
|
|
73
|
+
keywords?: string[];
|
|
74
|
+
command: (editor: Editor) => void;
|
|
75
|
+
render: ComponentType<{
|
|
76
|
+
node: BlockNode;
|
|
77
|
+
editor?: Editor;
|
|
78
|
+
updateAttributes?: (attrs: any) => void;
|
|
79
|
+
deleteNode?: () => void;
|
|
80
|
+
}>;
|
|
81
|
+
group?: 'block' | 'inline' | 'mark';
|
|
82
|
+
}
|
|
83
|
+
type CommandItem = {
|
|
84
|
+
title: string;
|
|
85
|
+
description: string;
|
|
86
|
+
icon: React.ReactNode;
|
|
87
|
+
keywords?: string[];
|
|
88
|
+
command: (props: {
|
|
89
|
+
editor: Editor;
|
|
90
|
+
range: any;
|
|
91
|
+
}) => void;
|
|
92
|
+
};
|
|
93
|
+
type BlockComponent = ComponentType<ReactNodeViewProps>;
|
|
94
|
+
declare const BLOCKS: BlockConfig[];
|
|
95
|
+
declare function registerBlock(block: BlockConfig): void;
|
|
96
|
+
declare function getBlockByType(type: string): BlockConfig | undefined;
|
|
97
|
+
declare function filterBlocks(query: string): BlockConfig[];
|
|
98
|
+
declare function getDefaultBlockItems(editor: Editor): CommandItem[];
|
|
99
|
+
|
|
100
|
+
interface SlashCommandListProps {
|
|
101
|
+
items: CommandItem[];
|
|
102
|
+
command: (item: CommandItem) => void;
|
|
103
|
+
}
|
|
104
|
+
declare const SlashCommandList: react.ForwardRefExoticComponent<SlashCommandListProps & react.RefAttributes<unknown>>;
|
|
105
|
+
declare function createSlashCommand(options: {
|
|
106
|
+
char: string;
|
|
107
|
+
items: (props: {
|
|
108
|
+
editor: any;
|
|
109
|
+
query: string;
|
|
110
|
+
}) => any[];
|
|
111
|
+
}): Extension<any, any>;
|
|
112
|
+
|
|
113
|
+
interface BlockRendererProps {
|
|
114
|
+
node: BlockNode;
|
|
115
|
+
editor?: any;
|
|
116
|
+
updateAttributes?: (attrs: any) => void;
|
|
117
|
+
deleteNode?: () => void;
|
|
118
|
+
}
|
|
119
|
+
declare const BlockRenderer: react.NamedExoticComponent<BlockRendererProps>;
|
|
120
|
+
|
|
121
|
+
interface BlockWrapperProps extends BoxProps {
|
|
122
|
+
children: React.ReactNode;
|
|
123
|
+
selected?: boolean;
|
|
124
|
+
}
|
|
125
|
+
declare function BlockWrapper({ children, selected, ...props }: BlockWrapperProps): react.JSX.Element;
|
|
126
|
+
|
|
127
|
+
declare function NoticeBlock({ node, updateAttributes, deleteNode }: ReactNodeViewProps): react.JSX.Element;
|
|
128
|
+
|
|
129
|
+
declare const TaskBlock: react.MemoExoticComponent<({ node, updateAttributes }: ReactNodeViewProps) => react.JSX.Element>;
|
|
130
|
+
|
|
131
|
+
declare function CodeBlock({ node, updateAttributes, selected }: ReactNodeViewProps): react.JSX.Element;
|
|
132
|
+
|
|
133
|
+
declare function TimelineBlock({ node, updateAttributes, deleteNode }: ReactNodeViewProps): react.JSX.Element;
|
|
134
|
+
|
|
135
|
+
declare function DiagramBlock({ node, updateAttributes, deleteNode }: ReactNodeViewProps): react.JSX.Element;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @License OTMC License
|
|
139
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
140
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
141
|
+
**/
|
|
142
|
+
|
|
143
|
+
interface CreateBlockNodeOptions {
|
|
144
|
+
name: string;
|
|
145
|
+
group?: string;
|
|
146
|
+
content?: string;
|
|
147
|
+
draggable?: boolean;
|
|
148
|
+
defining?: boolean;
|
|
149
|
+
component?: BlockComponent;
|
|
150
|
+
}
|
|
151
|
+
declare function createBlockNode(options: CreateBlockNodeOptions): Node<any, any>;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @License OTMC License
|
|
155
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
156
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
157
|
+
**/
|
|
158
|
+
|
|
159
|
+
declare const NoticeExtension: Node<any, any>;
|
|
160
|
+
|
|
161
|
+
declare const TaskItemExtension: _tiptap_core.Node<_tiptap_extension_list.TaskItemOptions, any>;
|
|
162
|
+
|
|
163
|
+
declare const CodeBlockExtension: _tiptap_core.Node<_tiptap_extension_code_block_lowlight.CodeBlockLowlightOptions, any>;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @License OTMC License
|
|
167
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
168
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
169
|
+
**/
|
|
170
|
+
|
|
171
|
+
declare const TimelineExtension: Node<any, any>;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @License OTMC License
|
|
175
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
176
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
177
|
+
**/
|
|
178
|
+
|
|
179
|
+
declare const DiagramExtension: Node<any, any>;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @License OTMC License
|
|
183
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
184
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
185
|
+
**/
|
|
186
|
+
|
|
187
|
+
declare const serializeToMarkdown: (editor: Editor) => string;
|
|
188
|
+
declare const serializeSelectionToMarkdown: (editor: Editor, from: number, to: number) => string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @License OTMC License
|
|
192
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
193
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
194
|
+
**/
|
|
195
|
+
|
|
196
|
+
declare const handlePaste: (editor: Editor | null, event: ClipboardEvent) => boolean;
|
|
197
|
+
|
|
198
|
+
declare const markdownToTiptapJSON: (markdown: string) => string;
|
|
199
|
+
declare const isTiptapJSON: (content: string) => boolean;
|
|
200
|
+
declare const migrateToTiptapJSON: (content: string) => string;
|
|
201
|
+
|
|
202
|
+
interface HeadingNode {
|
|
203
|
+
id: string;
|
|
204
|
+
text: string;
|
|
205
|
+
level: number;
|
|
206
|
+
pos: number;
|
|
207
|
+
}
|
|
208
|
+
interface TableOfContentsOptions {
|
|
209
|
+
onUpdate?: (headings: HeadingNode[]) => void;
|
|
210
|
+
}
|
|
211
|
+
interface TableOfContentsPanelProps {
|
|
212
|
+
headings: HeadingNode[];
|
|
213
|
+
editor: any;
|
|
214
|
+
}
|
|
215
|
+
declare const TableOfContentsPanel: react.MemoExoticComponent<({ headings, editor }: TableOfContentsPanelProps) => react.JSX.Element | null>;
|
|
216
|
+
|
|
217
|
+
export { BLOCKS, type BlockConfig, type BlockNode, BlockRenderer, BlockWrapper, BubbleMenu, CodeBlock, CodeBlockExtension, type CommandItem, type CreateBlockNodeOptions, DiagramBlock, DiagramExtension, DocumentEditor, EditorContent, type HeadingNode, MarkdownEditor, NoticeBlock, NoticeExtension, SlashCommandList, TableControls, type TableOfContentsOptions, TableOfContentsPanel, TaskBlock, TaskItemExtension, TimelineBlock, TimelineExtension, createBlockNode, createSlashCommand, filterBlocks, getBlockByType, getDefaultBlockItems, handlePaste, isTiptapJSON, markdownToTiptapJSON, migrateToTiptapJSON, registerBlock, serializeSelectionToMarkdown, serializeToMarkdown, useEditorWithStorage };
|
package/dist/editor.d.ts
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
import { Editor, EditorOptions, ReactNodeViewProps } from '@tiptap/react';
|
|
4
|
+
export { A as ApiResponse, B as BACKEND_URL, E as ErrorResponse, F as FormatDocumentRequest, a as FormatDocumentResponse, G as GenerateDocumentRequest, b as GenerateDocumentResponse, I as Instruction, L as LLMConfigResponse, c as LLMReloadResponse, d as LLMRequest, e as LLMResponse, f as LLMTestResponse, S as SuccessResponse, g as apiClient, h as apiUtils, i as getBackendUrl, j as instructionsApi, l as llmApi, s as setAccessTokenGetter, k as setBackendUrl } from './instructions-CCxIhaa6.js';
|
|
5
|
+
import * as _tiptap_core from '@tiptap/core';
|
|
6
|
+
import { Extension, Node } from '@tiptap/core';
|
|
7
|
+
import { BoxProps } from '@mantine/core';
|
|
8
|
+
import * as _tiptap_extension_list from '@tiptap/extension-list';
|
|
9
|
+
import * as _tiptap_extension_code_block_lowlight from '@tiptap/extension-code-block-lowlight';
|
|
10
|
+
|
|
11
|
+
interface EditorProps {
|
|
12
|
+
initialContent?: string;
|
|
13
|
+
onChange?: (content: string) => void;
|
|
14
|
+
outputFormat?: 'html' | 'markdown' | 'json';
|
|
15
|
+
showTableOfContents?: boolean;
|
|
16
|
+
showHeadingDividers?: boolean;
|
|
17
|
+
minHeight?: number;
|
|
18
|
+
editable?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const MarkdownEditor: react.NamedExoticComponent<EditorProps>;
|
|
21
|
+
|
|
22
|
+
interface DocumentEditorProps {
|
|
23
|
+
editor: Editor;
|
|
24
|
+
opened: boolean;
|
|
25
|
+
onClose: () => void;
|
|
26
|
+
}
|
|
27
|
+
declare function DocumentEditor({ editor, opened, onClose }: DocumentEditorProps): react.JSX.Element;
|
|
28
|
+
|
|
29
|
+
interface UseEditorWithStorageOptions extends Partial<EditorOptions> {
|
|
30
|
+
initialContent?: string;
|
|
31
|
+
onContentChange?: (content: string) => void;
|
|
32
|
+
debounceDelay?: number;
|
|
33
|
+
outputFormat?: 'html' | 'markdown' | 'json';
|
|
34
|
+
extensions?: any[];
|
|
35
|
+
}
|
|
36
|
+
declare const useEditorWithStorage: ({ initialContent, onContentChange, debounceDelay, outputFormat, extensions, ...editorOptions }: UseEditorWithStorageOptions) => _tiptap_core.Editor;
|
|
37
|
+
|
|
38
|
+
interface EditorContentProps {
|
|
39
|
+
editor: any;
|
|
40
|
+
minHeight?: number;
|
|
41
|
+
}
|
|
42
|
+
declare function EditorContent({ editor, minHeight }: EditorContentProps): react.JSX.Element;
|
|
43
|
+
|
|
44
|
+
interface BubbleMenuProps {
|
|
45
|
+
editor: Editor;
|
|
46
|
+
}
|
|
47
|
+
declare function BubbleMenu({ editor }: BubbleMenuProps): react.JSX.Element;
|
|
48
|
+
|
|
49
|
+
interface TableControlsProps {
|
|
50
|
+
editor: Editor;
|
|
51
|
+
}
|
|
52
|
+
declare function TableControls({ editor }: TableControlsProps): react.JSX.Element | null;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @License OTMC License
|
|
56
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
57
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
58
|
+
**/
|
|
59
|
+
|
|
60
|
+
interface BlockNode {
|
|
61
|
+
type: {
|
|
62
|
+
name: string;
|
|
63
|
+
};
|
|
64
|
+
attrs: Record<string, any>;
|
|
65
|
+
content: any[];
|
|
66
|
+
textContent: string;
|
|
67
|
+
}
|
|
68
|
+
interface BlockConfig {
|
|
69
|
+
type: string;
|
|
70
|
+
label: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
icon: React.ReactNode;
|
|
73
|
+
keywords?: string[];
|
|
74
|
+
command: (editor: Editor) => void;
|
|
75
|
+
render: ComponentType<{
|
|
76
|
+
node: BlockNode;
|
|
77
|
+
editor?: Editor;
|
|
78
|
+
updateAttributes?: (attrs: any) => void;
|
|
79
|
+
deleteNode?: () => void;
|
|
80
|
+
}>;
|
|
81
|
+
group?: 'block' | 'inline' | 'mark';
|
|
82
|
+
}
|
|
83
|
+
type CommandItem = {
|
|
84
|
+
title: string;
|
|
85
|
+
description: string;
|
|
86
|
+
icon: React.ReactNode;
|
|
87
|
+
keywords?: string[];
|
|
88
|
+
command: (props: {
|
|
89
|
+
editor: Editor;
|
|
90
|
+
range: any;
|
|
91
|
+
}) => void;
|
|
92
|
+
};
|
|
93
|
+
type BlockComponent = ComponentType<ReactNodeViewProps>;
|
|
94
|
+
declare const BLOCKS: BlockConfig[];
|
|
95
|
+
declare function registerBlock(block: BlockConfig): void;
|
|
96
|
+
declare function getBlockByType(type: string): BlockConfig | undefined;
|
|
97
|
+
declare function filterBlocks(query: string): BlockConfig[];
|
|
98
|
+
declare function getDefaultBlockItems(editor: Editor): CommandItem[];
|
|
99
|
+
|
|
100
|
+
interface SlashCommandListProps {
|
|
101
|
+
items: CommandItem[];
|
|
102
|
+
command: (item: CommandItem) => void;
|
|
103
|
+
}
|
|
104
|
+
declare const SlashCommandList: react.ForwardRefExoticComponent<SlashCommandListProps & react.RefAttributes<unknown>>;
|
|
105
|
+
declare function createSlashCommand(options: {
|
|
106
|
+
char: string;
|
|
107
|
+
items: (props: {
|
|
108
|
+
editor: any;
|
|
109
|
+
query: string;
|
|
110
|
+
}) => any[];
|
|
111
|
+
}): Extension<any, any>;
|
|
112
|
+
|
|
113
|
+
interface BlockRendererProps {
|
|
114
|
+
node: BlockNode;
|
|
115
|
+
editor?: any;
|
|
116
|
+
updateAttributes?: (attrs: any) => void;
|
|
117
|
+
deleteNode?: () => void;
|
|
118
|
+
}
|
|
119
|
+
declare const BlockRenderer: react.NamedExoticComponent<BlockRendererProps>;
|
|
120
|
+
|
|
121
|
+
interface BlockWrapperProps extends BoxProps {
|
|
122
|
+
children: React.ReactNode;
|
|
123
|
+
selected?: boolean;
|
|
124
|
+
}
|
|
125
|
+
declare function BlockWrapper({ children, selected, ...props }: BlockWrapperProps): react.JSX.Element;
|
|
126
|
+
|
|
127
|
+
declare function NoticeBlock({ node, updateAttributes, deleteNode }: ReactNodeViewProps): react.JSX.Element;
|
|
128
|
+
|
|
129
|
+
declare const TaskBlock: react.MemoExoticComponent<({ node, updateAttributes }: ReactNodeViewProps) => react.JSX.Element>;
|
|
130
|
+
|
|
131
|
+
declare function CodeBlock({ node, updateAttributes, selected }: ReactNodeViewProps): react.JSX.Element;
|
|
132
|
+
|
|
133
|
+
declare function TimelineBlock({ node, updateAttributes, deleteNode }: ReactNodeViewProps): react.JSX.Element;
|
|
134
|
+
|
|
135
|
+
declare function DiagramBlock({ node, updateAttributes, deleteNode }: ReactNodeViewProps): react.JSX.Element;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @License OTMC License
|
|
139
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
140
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
141
|
+
**/
|
|
142
|
+
|
|
143
|
+
interface CreateBlockNodeOptions {
|
|
144
|
+
name: string;
|
|
145
|
+
group?: string;
|
|
146
|
+
content?: string;
|
|
147
|
+
draggable?: boolean;
|
|
148
|
+
defining?: boolean;
|
|
149
|
+
component?: BlockComponent;
|
|
150
|
+
}
|
|
151
|
+
declare function createBlockNode(options: CreateBlockNodeOptions): Node<any, any>;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @License OTMC License
|
|
155
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
156
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
157
|
+
**/
|
|
158
|
+
|
|
159
|
+
declare const NoticeExtension: Node<any, any>;
|
|
160
|
+
|
|
161
|
+
declare const TaskItemExtension: _tiptap_core.Node<_tiptap_extension_list.TaskItemOptions, any>;
|
|
162
|
+
|
|
163
|
+
declare const CodeBlockExtension: _tiptap_core.Node<_tiptap_extension_code_block_lowlight.CodeBlockLowlightOptions, any>;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @License OTMC License
|
|
167
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
168
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
169
|
+
**/
|
|
170
|
+
|
|
171
|
+
declare const TimelineExtension: Node<any, any>;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @License OTMC License
|
|
175
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
176
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
177
|
+
**/
|
|
178
|
+
|
|
179
|
+
declare const DiagramExtension: Node<any, any>;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @License OTMC License
|
|
183
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
184
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
185
|
+
**/
|
|
186
|
+
|
|
187
|
+
declare const serializeToMarkdown: (editor: Editor) => string;
|
|
188
|
+
declare const serializeSelectionToMarkdown: (editor: Editor, from: number, to: number) => string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @License OTMC License
|
|
192
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
193
|
+
* @Contributors Trung Ng, OTMC Authors.
|
|
194
|
+
**/
|
|
195
|
+
|
|
196
|
+
declare const handlePaste: (editor: Editor | null, event: ClipboardEvent) => boolean;
|
|
197
|
+
|
|
198
|
+
declare const markdownToTiptapJSON: (markdown: string) => string;
|
|
199
|
+
declare const isTiptapJSON: (content: string) => boolean;
|
|
200
|
+
declare const migrateToTiptapJSON: (content: string) => string;
|
|
201
|
+
|
|
202
|
+
interface HeadingNode {
|
|
203
|
+
id: string;
|
|
204
|
+
text: string;
|
|
205
|
+
level: number;
|
|
206
|
+
pos: number;
|
|
207
|
+
}
|
|
208
|
+
interface TableOfContentsOptions {
|
|
209
|
+
onUpdate?: (headings: HeadingNode[]) => void;
|
|
210
|
+
}
|
|
211
|
+
interface TableOfContentsPanelProps {
|
|
212
|
+
headings: HeadingNode[];
|
|
213
|
+
editor: any;
|
|
214
|
+
}
|
|
215
|
+
declare const TableOfContentsPanel: react.MemoExoticComponent<({ headings, editor }: TableOfContentsPanelProps) => react.JSX.Element | null>;
|
|
216
|
+
|
|
217
|
+
export { BLOCKS, type BlockConfig, type BlockNode, BlockRenderer, BlockWrapper, BubbleMenu, CodeBlock, CodeBlockExtension, type CommandItem, type CreateBlockNodeOptions, DiagramBlock, DiagramExtension, DocumentEditor, EditorContent, type HeadingNode, MarkdownEditor, NoticeBlock, NoticeExtension, SlashCommandList, TableControls, type TableOfContentsOptions, TableOfContentsPanel, TaskBlock, TaskItemExtension, TimelineBlock, TimelineExtension, createBlockNode, createSlashCommand, filterBlocks, getBlockByType, getDefaultBlockItems, handlePaste, isTiptapJSON, markdownToTiptapJSON, migrateToTiptapJSON, registerBlock, serializeSelectionToMarkdown, serializeToMarkdown, useEditorWithStorage };
|