@oyat/editor 1.6.5 → 1.7.1
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/README.md +53 -36
- package/dist/components/editor/editor-base-kit.d.ts +283 -1
- package/dist/components/editor/editor-base-kit.d.ts.map +1 -1
- package/dist/components/editor/editor-kit.d.ts +604 -1
- package/dist/components/editor/editor-kit.d.ts.map +1 -1
- package/dist/components/editor/plate-editor.d.ts +11 -1
- package/dist/components/editor/plate-editor.d.ts.map +1 -1
- package/dist/components/editor/plugins/discussion-kit.d.ts +4 -24
- package/dist/components/editor/plugins/discussion-kit.d.ts.map +1 -1
- package/dist/components/editor/plugins/media-base-kit.d.ts +2 -2
- package/dist/components/editor/plugins/media-base-kit.d.ts.map +1 -1
- package/dist/components/editor/plugins/media-kit.d.ts +2 -2
- package/dist/components/editor/plugins/media-kit.d.ts.map +1 -1
- package/dist/components/editor/plugins/suggestion-kit.d.ts.map +1 -1
- package/dist/components/ui/block-suggestion.d.ts.map +1 -1
- package/dist/components/ui/callout-node-static.d.ts +4 -0
- package/dist/components/ui/callout-node-static.d.ts.map +1 -1
- package/dist/components/ui/caption.d.ts +11 -0
- package/dist/components/ui/caption.d.ts.map +1 -0
- package/dist/components/ui/code-block-node-static.d.ts +7 -0
- package/dist/components/ui/code-block-node-static.d.ts.map +1 -1
- package/dist/components/ui/column-node-static.d.ts +8 -0
- package/dist/components/ui/column-node-static.d.ts.map +1 -1
- package/dist/components/ui/comment.d.ts.map +1 -1
- package/dist/components/ui/editor.d.ts +1 -1
- package/dist/components/ui/equation-node-static.d.ts +10 -0
- package/dist/components/ui/equation-node-static.d.ts.map +1 -1
- package/dist/components/ui/fixed-toolbar-buttons.d.ts.map +1 -1
- package/dist/components/ui/floating-toolbar-buttons.d.ts.map +1 -1
- package/dist/components/ui/font-color-toolbar-button.d.ts +23 -0
- package/dist/components/ui/font-color-toolbar-button.d.ts.map +1 -0
- package/dist/components/ui/insert-image-url-toolbar-button.d.ts +2 -0
- package/dist/components/ui/insert-image-url-toolbar-button.d.ts.map +1 -0
- package/dist/components/ui/insert-toolbar-button.d.ts.map +1 -1
- package/dist/components/ui/media-picker-toolbar-trigger.d.ts +2 -0
- package/dist/components/ui/media-picker-toolbar-trigger.d.ts.map +1 -0
- package/dist/components/ui/more-toolbar-button.d.ts.map +1 -1
- package/dist/components/ui/toc-node-static.d.ts +5 -0
- package/dist/components/ui/toc-node-static.d.ts.map +1 -1
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/turn-into-toolbar-button.d.ts.map +1 -1
- package/dist/contexts/media-picker-context.d.ts +14 -0
- package/dist/contexts/media-picker-context.d.ts.map +1 -0
- package/dist/contexts/media-picker-provider.d.ts +8 -0
- package/dist/contexts/media-picker-provider.d.ts.map +1 -0
- package/dist/demo/MockMediaPicker.d.ts +6 -0
- package/dist/demo/MockMediaPicker.d.ts.map +1 -0
- package/dist/demo/discussions.d.ts +3 -0
- package/dist/demo/discussions.d.ts.map +1 -0
- package/dist/demo/value.d.ts +3 -0
- package/dist/demo/value.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +829 -841
- package/dist/index.js.map +1 -1
- package/package.json +37 -50
- package/dist/components/editor/plate-types.d.ts +0 -85
- package/dist/components/editor/plate-types.d.ts.map +0 -1
- package/dist/components/editor/plugins/basic-nodes-kit.d.ts +0 -24
- package/dist/components/editor/plugins/basic-nodes-kit.d.ts.map +0 -1
- package/dist/components/editor/plugins/emoji-kit.d.ts +0 -6
- package/dist/components/editor/plugins/emoji-kit.d.ts.map +0 -1
- package/dist/components/editor/settings-dialog.d.ts +0 -8
- package/dist/components/editor/settings-dialog.d.ts.map +0 -1
- package/dist/components/editor/use-chat.d.ts +0 -64
- package/dist/components/editor/use-chat.d.ts.map +0 -1
- package/dist/components/ui/ai-chat-editor.d.ts +0 -5
- package/dist/components/ui/ai-chat-editor.d.ts.map +0 -1
- package/dist/components/ui/ai-menu.d.ts +0 -8
- package/dist/components/ui/ai-menu.d.ts.map +0 -1
- package/dist/components/ui/ai-node.d.ts +0 -4
- package/dist/components/ui/ai-node.d.ts.map +0 -1
- package/dist/components/ui/ai-toolbar-button.d.ts +0 -4
- package/dist/components/ui/ai-toolbar-button.d.ts.map +0 -1
- package/dist/components/ui/editor-static.d.ts +0 -9
- package/dist/components/ui/editor-static.d.ts.map +0 -1
- package/dist/components/ui/emoji-node.d.ts +0 -3
- package/dist/components/ui/emoji-node.d.ts.map +0 -1
- package/dist/components/ui/equation-toolbar-button.d.ts +0 -4
- package/dist/components/ui/equation-toolbar-button.d.ts.map +0 -1
- package/dist/components/ui/export-toolbar-button.d.ts +0 -3
- package/dist/components/ui/export-toolbar-button.d.ts.map +0 -1
- package/dist/components/ui/font-size-toolbar-button.d.ts +0 -2
- package/dist/components/ui/font-size-toolbar-button.d.ts.map +0 -1
- package/dist/components/ui/ghost-text.d.ts +0 -2
- package/dist/components/ui/ghost-text.d.ts.map +0 -1
- package/dist/components/ui/import-toolbar-button.d.ts +0 -3
- package/dist/components/ui/import-toolbar-button.d.ts.map +0 -1
- package/dist/components/ui/line-height-toolbar-button.d.ts +0 -3
- package/dist/components/ui/line-height-toolbar-button.d.ts.map +0 -1
- package/dist/components/ui/media-embed-node.d.ts +0 -5
- package/dist/components/ui/media-embed-node.d.ts.map +0 -1
- package/dist/components/ui/media-video-node-static.d.ts +0 -4
- package/dist/components/ui/media-video-node-static.d.ts.map +0 -1
- package/dist/components/ui/media-video-node.d.ts +0 -5
- package/dist/components/ui/media-video-node.d.ts.map +0 -1
- package/dist/components/ui/mode-toolbar-button.d.ts +0 -3
- package/dist/components/ui/mode-toolbar-button.d.ts.map +0 -1
- package/dist/components/ui/toggle-toolbar-button.d.ts +0 -4
- package/dist/components/ui/toggle-toolbar-button.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -6,8 +6,7 @@ A powerful, feature-rich Plate.js editor component with AI integration, collabor
|
|
|
6
6
|
|
|
7
7
|
- 🚀 **Rich Text Editing** - Full-featured WYSIWYG editor with modern UI
|
|
8
8
|
- 🤖 **AI Integration** - Built-in AI assistance for content generation and editing
|
|
9
|
-
- 👥 **Collaboration** - Comments, suggestions, and
|
|
10
|
-
- 📝 **Markdown Support** - Import/export Markdown with full compatibility
|
|
9
|
+
- 👥 **Collaboration** - Comments, suggestions, and discussion features
|
|
11
10
|
- 🎨 **Customizable** - Extensive theming and plugin system
|
|
12
11
|
- 📱 **Responsive** - Works seamlessly across all device sizes
|
|
13
12
|
- ♿ **Accessible** - Built with accessibility in mind
|
|
@@ -34,45 +33,48 @@ npm install react react-dom platejs
|
|
|
34
33
|
## Quick Start
|
|
35
34
|
|
|
36
35
|
```tsx
|
|
37
|
-
import React from
|
|
38
|
-
import { PlateEditor } from
|
|
36
|
+
import React from 'react';
|
|
37
|
+
import { PlateEditor, TooltipProvider } from '@oyat/editor';
|
|
39
38
|
// Styles are automatically included - no separate import needed!
|
|
40
39
|
|
|
41
40
|
function App() {
|
|
42
41
|
const handleChange = (value) => {
|
|
43
|
-
console.log(
|
|
42
|
+
console.log('Editor content:', value);
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
return (
|
|
47
|
-
<
|
|
46
|
+
<TooltipProvider>
|
|
47
|
+
<PlateEditor initialValue="Start typing here..." onChange={handleChange} />
|
|
48
|
+
</TooltipProvider>
|
|
48
49
|
);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export default App;
|
|
52
53
|
```
|
|
53
54
|
|
|
55
|
+
> **Note:** Wrap the editor in `TooltipProvider` so toolbar buttons and other controls display tooltips correctly.
|
|
56
|
+
|
|
54
57
|
## Advanced Usage
|
|
55
58
|
|
|
56
|
-
###
|
|
59
|
+
### With Media Picker
|
|
57
60
|
|
|
58
61
|
```tsx
|
|
59
|
-
import React from
|
|
60
|
-
import { PlateEditor,
|
|
61
|
-
|
|
62
|
-
function CustomEditor() {
|
|
63
|
-
// Create a custom plugin configuration
|
|
64
|
-
const customPlugins = [
|
|
65
|
-
...BasicMarksKit,
|
|
66
|
-
...AlignKit,
|
|
67
|
-
// Add your custom plugins here
|
|
68
|
-
];
|
|
62
|
+
import React from 'react';
|
|
63
|
+
import { PlateEditor, TooltipProvider } from '@oyat/editor';
|
|
69
64
|
|
|
65
|
+
function EditorWithMediaPicker() {
|
|
70
66
|
return (
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
<TooltipProvider>
|
|
68
|
+
<PlateEditor
|
|
69
|
+
initialValue="Start typing..."
|
|
70
|
+
onChange={(value) => console.log(value)}
|
|
71
|
+
mediaPicker={({ onSelect }) => (
|
|
72
|
+
<button onClick={() => onSelect({ url: 'https://example.com/image.jpg' })}>
|
|
73
|
+
Insert Image
|
|
74
|
+
</button>
|
|
75
|
+
)}
|
|
76
|
+
/>
|
|
77
|
+
</TooltipProvider>
|
|
76
78
|
);
|
|
77
79
|
}
|
|
78
80
|
```
|
|
@@ -80,18 +82,22 @@ function CustomEditor() {
|
|
|
80
82
|
### With TypeScript
|
|
81
83
|
|
|
82
84
|
```tsx
|
|
83
|
-
import React from
|
|
84
|
-
import { PlateEditor, type PlateEditorProps, type Value } from
|
|
85
|
+
import React from 'react';
|
|
86
|
+
import { PlateEditor, TooltipProvider, type PlateEditorProps, type Value } from '@oyat/editor';
|
|
85
87
|
|
|
86
88
|
function TypedEditor() {
|
|
87
89
|
const [value, setValue] = React.useState<Value | undefined>();
|
|
88
90
|
|
|
89
|
-
const handleChange: PlateEditorProps[
|
|
91
|
+
const handleChange: PlateEditorProps['onChange'] = (newValue) => {
|
|
90
92
|
setValue(newValue);
|
|
91
|
-
console.log(
|
|
93
|
+
console.log('Editor content:', newValue);
|
|
92
94
|
};
|
|
93
95
|
|
|
94
|
-
return
|
|
96
|
+
return (
|
|
97
|
+
<TooltipProvider>
|
|
98
|
+
<PlateEditor initialValue={value} onChange={handleChange} />
|
|
99
|
+
</TooltipProvider>
|
|
100
|
+
);
|
|
95
101
|
}
|
|
96
102
|
```
|
|
97
103
|
|
|
@@ -103,13 +109,17 @@ function TypedEditor() {
|
|
|
103
109
|
interface PlateEditorProps {
|
|
104
110
|
initialValue?: Value | string;
|
|
105
111
|
onChange?: (value: Value) => void;
|
|
112
|
+
mode?: 'draft' | 'full';
|
|
113
|
+
mediaPicker?: MediaPickerRenderProp;
|
|
106
114
|
}
|
|
107
115
|
```
|
|
108
116
|
|
|
109
|
-
| Prop | Type | Default | Description
|
|
110
|
-
| -------------- | ------------------------ | ----------- |
|
|
111
|
-
| `initialValue` | `Value \| string` | `undefined` | Initial content for the editor
|
|
112
|
-
| `onChange` | `(value: Value) => void`
|
|
117
|
+
| Prop | Type | Default | Description |
|
|
118
|
+
| -------------- | ------------------------ | ----------- | ---------------------------------------- |
|
|
119
|
+
| `initialValue` | `Value \| string` | `undefined` | Initial content for the editor |
|
|
120
|
+
| `onChange` | `(value: Value) => void` | `undefined` | Callback when content changes |
|
|
121
|
+
| `mode` | `'draft' \| 'full'` | `'draft'` | Draft mode shows suggestions; full accepts |
|
|
122
|
+
| `mediaPicker` | `MediaPickerRenderProp` | `undefined` | Custom media picker for image insertion |
|
|
113
123
|
|
|
114
124
|
### Available Plugin Kits
|
|
115
125
|
|
|
@@ -118,15 +128,22 @@ interface PlateEditorProps {
|
|
|
118
128
|
- `BasicBlocksKit` - Headings, paragraphs, blockquotes
|
|
119
129
|
- `BasicMarksKit` - Bold, italic, underline, etc.
|
|
120
130
|
- `BlockMenuKit` - Block-level menu controls
|
|
131
|
+
- `BlockPlaceholderKit` - Block placeholders
|
|
121
132
|
- `CalloutKit` - Callout/admonition blocks
|
|
122
133
|
- `CodeBlockKit` - Syntax-highlighted code blocks
|
|
134
|
+
- `ColumnKit` - Multi-column layouts
|
|
123
135
|
- `CommentKit` - Comment system
|
|
136
|
+
- `CursorOverlayKit` - Collaborative cursor overlay
|
|
124
137
|
- `DateKit` - Date picker integration
|
|
125
138
|
- `DndKit` - Drag and drop functionality
|
|
139
|
+
- `DocxKit` - DOCX import support
|
|
140
|
+
- `ExitBreakKit` - Soft/hard break handling
|
|
141
|
+
- `FixedToolbarKit` - Fixed toolbar UI
|
|
142
|
+
- `FloatingToolbarKit` - Floating toolbar UI
|
|
126
143
|
- `FontKit` - Font family and size controls
|
|
144
|
+
- `LineHeightKit` - Line height controls
|
|
127
145
|
- `LinkKit` - Link creation and management
|
|
128
146
|
- `ListKit` - Ordered and unordered lists
|
|
129
|
-
- `MarkdownKit` - Markdown import/export
|
|
130
147
|
- `MathKit` - Mathematical expressions
|
|
131
148
|
- `MediaKit` - Image and media handling
|
|
132
149
|
- `MentionKit` - User mentions
|
|
@@ -220,7 +237,7 @@ npm run build:lib
|
|
|
220
237
|
|
|
221
238
|
# 3. Verify the build output
|
|
222
239
|
ls -la dist/
|
|
223
|
-
# Should see: index.js, index.d.ts,
|
|
240
|
+
# Should see: index.js, index.d.ts, and component declarations
|
|
224
241
|
|
|
225
242
|
# 4. Bump version (choose one)
|
|
226
243
|
npm version patch # 1.0.0 → 1.0.1 (bug fixes)
|
|
@@ -232,6 +249,7 @@ npm login
|
|
|
232
249
|
|
|
233
250
|
# 6. Publish to npm
|
|
234
251
|
npm publish
|
|
252
|
+
# Note: First publish of a scoped package (@oyat/editor) requires: npm publish --access public
|
|
235
253
|
|
|
236
254
|
# 7. Verify publication
|
|
237
255
|
npm view @oyat/editor version
|
|
@@ -255,9 +273,8 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
255
273
|
## Support
|
|
256
274
|
|
|
257
275
|
- 📦 [NPM Package](https://www.npmjs.com/package/@oyat/editor)
|
|
258
|
-
- 📖 [Documentation](https://github.com/oyat/oyat-editor#readme)
|
|
259
|
-
- 🐛 [Issue Tracker](https://github.com/oyat/oyat-editor/issues)
|
|
260
|
-
- 💬 [Discussions](https://github.com/oyat/oyat-editor/discussions)
|
|
276
|
+
- 📖 [Documentation](https://github.com/oyat-app/oyat-editor#readme)
|
|
277
|
+
- 🐛 [Issue Tracker](https://github.com/oyat-app/oyat-editor/issues)
|
|
261
278
|
|
|
262
279
|
## Acknowledgments
|
|
263
280
|
|
|
@@ -1,2 +1,284 @@
|
|
|
1
|
-
export declare const BaseEditorKit:
|
|
1
|
+
export declare const BaseEditorKit: (import('platejs').SlatePlugin<import('platejs').PluginConfig<"p", {}, {}, {}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"comment", {}, {
|
|
2
|
+
comment: {
|
|
3
|
+
has: (options: {
|
|
4
|
+
id: string;
|
|
5
|
+
}) => boolean;
|
|
6
|
+
node: (options?: import('platejs').EditorNodesOptions & {
|
|
7
|
+
id?: string;
|
|
8
|
+
isDraft?: boolean;
|
|
9
|
+
}) => import('platejs').NodeEntry<import('platejs').TCommentText> | undefined;
|
|
10
|
+
nodeId: (leaf: import('platejs').TCommentText) => string | undefined;
|
|
11
|
+
nodes: (options?: import('platejs').EditorNodesOptions & {
|
|
12
|
+
id?: string;
|
|
13
|
+
isDraft?: boolean;
|
|
14
|
+
transient?: boolean;
|
|
15
|
+
}) => import('platejs').NodeEntry<import('platejs').TCommentText>[];
|
|
16
|
+
};
|
|
17
|
+
} & Record<"comment", {
|
|
18
|
+
has: (options: {
|
|
19
|
+
id: string;
|
|
20
|
+
}) => boolean;
|
|
21
|
+
node: (options?: import('platejs').EditorNodesOptions & {
|
|
22
|
+
id?: string;
|
|
23
|
+
isDraft?: boolean;
|
|
24
|
+
}) => import('platejs').NodeEntry<import('platejs').TCommentText> | undefined;
|
|
25
|
+
nodeId: (leaf: import('platejs').TCommentText) => string | undefined;
|
|
26
|
+
nodes: (options?: import('platejs').EditorNodesOptions & {
|
|
27
|
+
id?: string;
|
|
28
|
+
isDraft?: boolean;
|
|
29
|
+
transient?: boolean;
|
|
30
|
+
}) => import('platejs').NodeEntry<import('platejs').TCommentText>[];
|
|
31
|
+
}>, {
|
|
32
|
+
comment: {
|
|
33
|
+
removeMark: () => void;
|
|
34
|
+
setDraft: (options?: import('platejs').SetNodesOptions) => void;
|
|
35
|
+
unsetMark: (options: {
|
|
36
|
+
id?: string;
|
|
37
|
+
transient?: boolean;
|
|
38
|
+
}) => void;
|
|
39
|
+
};
|
|
40
|
+
} & Record<"comment", {
|
|
41
|
+
removeMark: () => void;
|
|
42
|
+
setDraft: (options?: import('platejs').SetNodesOptions) => void;
|
|
43
|
+
unsetMark: (options: {
|
|
44
|
+
id?: string;
|
|
45
|
+
transient?: boolean;
|
|
46
|
+
}) => void;
|
|
47
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"suggestion", {
|
|
48
|
+
currentUserId: string | null;
|
|
49
|
+
isSuggesting: boolean;
|
|
50
|
+
}, {
|
|
51
|
+
suggestion: {
|
|
52
|
+
dataList: (node: import('platejs').TSuggestionText) => import('platejs').TInlineSuggestionData[];
|
|
53
|
+
isBlockSuggestion: (node: import('platejs').TNode) => node is import('platejs').TSuggestionElement;
|
|
54
|
+
node: (options?: import('platejs').EditorNodesOptions & {
|
|
55
|
+
id?: string;
|
|
56
|
+
isText?: boolean;
|
|
57
|
+
}) => import('platejs').NodeEntry<import('platejs').TSuggestionElement | import('platejs').TSuggestionText> | undefined;
|
|
58
|
+
nodeId: (node: import('platejs').TElement | import('platejs').TSuggestionText) => string | undefined;
|
|
59
|
+
nodes: (options?: import('platejs').EditorNodesOptions & {
|
|
60
|
+
transient?: boolean;
|
|
61
|
+
}) => import('platejs').NodeEntry<import('platejs').TElement | import('platejs').TSuggestionText>[];
|
|
62
|
+
suggestionData: (node: import('platejs').TElement | import('platejs').TSuggestionText) => import('platejs').TInlineSuggestionData | import('platejs').TSuggestionElement["suggestion"] | undefined;
|
|
63
|
+
withoutSuggestions: (fn: () => void) => void;
|
|
64
|
+
};
|
|
65
|
+
} & Record<"suggestion", {
|
|
66
|
+
dataList: (node: import('platejs').TSuggestionText) => import('platejs').TInlineSuggestionData[];
|
|
67
|
+
isBlockSuggestion: (node: import('platejs').TNode) => node is import('platejs').TSuggestionElement;
|
|
68
|
+
node: (options?: import('platejs').EditorNodesOptions & {
|
|
69
|
+
id?: string;
|
|
70
|
+
isText?: boolean;
|
|
71
|
+
}) => import('platejs').NodeEntry<import('platejs').TSuggestionElement | import('platejs').TSuggestionText> | undefined;
|
|
72
|
+
nodeId: (node: import('platejs').TElement | import('platejs').TSuggestionText) => string | undefined;
|
|
73
|
+
nodes: (options?: import('platejs').EditorNodesOptions & {
|
|
74
|
+
transient?: boolean;
|
|
75
|
+
}) => import('platejs').NodeEntry<import('platejs').TElement | import('platejs').TSuggestionText>[];
|
|
76
|
+
suggestionData: (node: import('platejs').TElement | import('platejs').TSuggestionText) => import('platejs').TInlineSuggestionData | import('platejs').TSuggestionElement["suggestion"] | undefined;
|
|
77
|
+
withoutSuggestions: (fn: () => void) => void;
|
|
78
|
+
}>, {}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"textAlign", {}, {}, Record<"textAlign", {
|
|
79
|
+
setNodes: (value: import('@platejs/basic-styles').Alignment, setNodesOptions?: import('platejs').SetNodesOptions | undefined) => void;
|
|
80
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<any, {}, {}, {}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<any, {}, {}, Record<any, {
|
|
81
|
+
toggle: () => void;
|
|
82
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"blockquote", {}, {}, Record<"blockquote", {
|
|
83
|
+
toggle: () => void;
|
|
84
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"hr", {}, {}, {}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"bold", {}, {}, Record<"bold", {
|
|
85
|
+
toggle: () => void;
|
|
86
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"italic", {}, {}, Record<"italic", {
|
|
87
|
+
toggle: () => void;
|
|
88
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"underline", {}, {}, Record<"underline", {
|
|
89
|
+
toggle: () => void;
|
|
90
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"code", {}, {}, Record<"code", {
|
|
91
|
+
toggle: () => void;
|
|
92
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"strikethrough", {}, {}, Record<"strikethrough", {
|
|
93
|
+
toggle: () => void;
|
|
94
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"subscript", {}, {}, Record<"subscript", {
|
|
95
|
+
toggle: () => void;
|
|
96
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"superscript", {}, {}, Record<"superscript", {
|
|
97
|
+
toggle: () => void;
|
|
98
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"highlight", {}, {}, Record<"highlight", {
|
|
99
|
+
toggle: () => void;
|
|
100
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"kbd", {}, {}, Record<"kbd", {
|
|
101
|
+
toggle: () => void;
|
|
102
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"callout", {}, {}, {
|
|
103
|
+
insert: {
|
|
104
|
+
callout: (args_0?: ({
|
|
105
|
+
batchDirty?: boolean;
|
|
106
|
+
hanging?: boolean;
|
|
107
|
+
nextBlock?: boolean;
|
|
108
|
+
removeEmpty?: import('platejs').QueryNodeOptions | boolean;
|
|
109
|
+
select?: boolean;
|
|
110
|
+
} & {
|
|
111
|
+
id?: boolean | string;
|
|
112
|
+
block?: boolean;
|
|
113
|
+
empty?: boolean;
|
|
114
|
+
match?: import('platejs').Predicate<import('platejs').NodeIn<import('platejs').Value>> | undefined;
|
|
115
|
+
text?: boolean;
|
|
116
|
+
} & import('platejs').QueryAt & import('platejs').QueryMode & import('platejs').QueryVoids & {
|
|
117
|
+
icon?: string;
|
|
118
|
+
variant?: (string & {}) | import('platejs').TCalloutElement["variant"];
|
|
119
|
+
}) | undefined) => void;
|
|
120
|
+
};
|
|
121
|
+
}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"code_block", {
|
|
122
|
+
defaultLanguage?: string | null;
|
|
123
|
+
lowlight?: ReturnType<typeof import('lowlight').createLowlight> | null;
|
|
124
|
+
}, {}, Record<"code_block", {
|
|
125
|
+
toggle: () => void;
|
|
126
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"code_syntax", {}, {}, {}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"column_group", {}, {}, {}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"column", {}, {}, {}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"date", {}, {}, {
|
|
127
|
+
insert: {
|
|
128
|
+
date: (args_0?: ({
|
|
129
|
+
date?: string;
|
|
130
|
+
} & {
|
|
131
|
+
batchDirty?: boolean;
|
|
132
|
+
hanging?: boolean;
|
|
133
|
+
nextBlock?: boolean;
|
|
134
|
+
removeEmpty?: import('platejs').QueryNodeOptions | boolean;
|
|
135
|
+
select?: boolean;
|
|
136
|
+
} & {
|
|
137
|
+
id?: boolean | string;
|
|
138
|
+
block?: boolean;
|
|
139
|
+
empty?: boolean;
|
|
140
|
+
match?: import('platejs').Predicate<import('platejs').NodeIn<import('platejs').Value>> | undefined;
|
|
141
|
+
text?: boolean;
|
|
142
|
+
} & import('platejs').QueryAt & import('platejs').QueryMode & import('platejs').QueryVoids) | undefined) => void;
|
|
143
|
+
};
|
|
144
|
+
}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"color", {}, {}, Record<"color", {
|
|
145
|
+
addMark: (value: string) => void;
|
|
146
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"backgroundColor", {}, {}, Record<"backgroundColor", {
|
|
147
|
+
addMark: (value: string) => void;
|
|
148
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"fontSize", {}, {}, Record<"fontSize", {
|
|
149
|
+
addMark: (value: string) => void;
|
|
150
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"fontFamily", {}, {}, Record<"fontFamily", {
|
|
151
|
+
addMark: (value: string) => void;
|
|
152
|
+
}>, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"lineHeight", {}, {}, Record<"lineHeight", {
|
|
153
|
+
setNodes: (value: number, setNodesOptions?: import('platejs').SetNodesOptions | undefined) => void;
|
|
154
|
+
}>, {}>> | import('platejs').SlatePlugin<import('@platejs/link').BaseLinkConfig> | import('platejs').SlatePlugin<import('@platejs/indent').IndentConfig> | import('platejs').SlatePlugin<import('@platejs/list').BaseListConfig> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"inline_equation", {}, {}, {
|
|
155
|
+
insert: {
|
|
156
|
+
inlineEquation: (texExpression?: string | undefined, options?: import('platejs').InsertNodesOptions | undefined) => void;
|
|
157
|
+
};
|
|
158
|
+
}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"equation", {}, {}, {
|
|
159
|
+
insert: {
|
|
160
|
+
equation: (options?: import('platejs').InsertNodesOptions | undefined) => void;
|
|
161
|
+
};
|
|
162
|
+
}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"img", {
|
|
163
|
+
disableEmbedInsert?: boolean;
|
|
164
|
+
disableUploadInsert?: boolean;
|
|
165
|
+
uploadImage?: (dataUrl: ArrayBuffer | string) => ArrayBuffer | Promise<ArrayBuffer | string> | string;
|
|
166
|
+
} & import('@platejs/media').MediaPluginOptions, {}, {
|
|
167
|
+
insert: {
|
|
168
|
+
imageFromFiles: (files: FileList, options?: import('platejs').InsertNodesOptions | undefined) => void;
|
|
169
|
+
};
|
|
170
|
+
}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"audio", {}, {}, {}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"file", {}, {}, {}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"caption", {
|
|
171
|
+
focusEndPath: import('platejs').Path | null;
|
|
172
|
+
focusStartPath: import('platejs').Path | null;
|
|
173
|
+
query: {
|
|
174
|
+
allow: string[];
|
|
175
|
+
};
|
|
176
|
+
visibleId: string | null;
|
|
177
|
+
}, {}, {}, {
|
|
178
|
+
isVisible?: (elementId: string) => boolean;
|
|
179
|
+
}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"placeholder", import('@platejs/media').MediaPlaceholderOptions, {}, {
|
|
180
|
+
insert: {
|
|
181
|
+
audioPlaceholder: (options?: import('platejs').InsertNodesOptions | undefined) => void;
|
|
182
|
+
filePlaceholder: (options?: import('platejs').InsertNodesOptions | undefined) => void;
|
|
183
|
+
imagePlaceholder: (options?: import('platejs').InsertNodesOptions | undefined) => void;
|
|
184
|
+
videoPlaceholder: (options?: import('platejs').InsertNodesOptions | undefined) => void;
|
|
185
|
+
};
|
|
186
|
+
}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"mention", {
|
|
187
|
+
insertSpaceAfterMention?: boolean;
|
|
188
|
+
} & import('@platejs/combobox').TriggerComboboxPluginOptions, {}, {
|
|
189
|
+
insert: {
|
|
190
|
+
mention: (options: {
|
|
191
|
+
search: string;
|
|
192
|
+
value: any;
|
|
193
|
+
key?: any;
|
|
194
|
+
}) => void;
|
|
195
|
+
};
|
|
196
|
+
}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"table", {
|
|
197
|
+
_cellIndices: Record<string, {
|
|
198
|
+
col: number;
|
|
199
|
+
row: number;
|
|
200
|
+
}>;
|
|
201
|
+
selectedCells: import('platejs').TElement[] | null;
|
|
202
|
+
selectedTables: import('platejs').TElement[] | null;
|
|
203
|
+
disableExpandOnInsert?: boolean;
|
|
204
|
+
disableMarginLeft?: boolean;
|
|
205
|
+
disableMerge?: boolean;
|
|
206
|
+
enableUnsetSingleColSize?: boolean;
|
|
207
|
+
initialTableWidth?: number;
|
|
208
|
+
minColumnWidth?: number;
|
|
209
|
+
}, {
|
|
210
|
+
create: {
|
|
211
|
+
table: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor, { colCount, header, rowCount, ...cellOptions }?: import('@platejs/table').GetEmptyTableNodeOptions) => import('platejs').TTableElement>;
|
|
212
|
+
tableCell: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor, { children, header, row }?: import('@platejs/table').CreateCellOptions) => {
|
|
213
|
+
children: import('platejs').Descendant[];
|
|
214
|
+
type: string;
|
|
215
|
+
}>;
|
|
216
|
+
tableRow: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor, { colCount, ...cellOptions }?: import('@platejs/table').GetEmptyRowNodeOptions) => {
|
|
217
|
+
children: {
|
|
218
|
+
children: import('platejs').Descendant[];
|
|
219
|
+
type: string;
|
|
220
|
+
}[];
|
|
221
|
+
type: string;
|
|
222
|
+
}>;
|
|
223
|
+
};
|
|
224
|
+
table: {
|
|
225
|
+
getCellBorders: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor, { cellIndices, defaultBorder, element }: {
|
|
226
|
+
element: import('platejs').TTableCellElement;
|
|
227
|
+
cellIndices?: import('@platejs/table').CellIndices;
|
|
228
|
+
defaultBorder?: import('platejs').TTableCellBorder;
|
|
229
|
+
}) => import('@platejs/table').BorderStylesDefault>;
|
|
230
|
+
getCellSize: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor, { cellIndices, colSizes, element, rowSize }: {
|
|
231
|
+
element: import('platejs').TTableCellElement;
|
|
232
|
+
cellIndices?: import('@platejs/table').CellIndices;
|
|
233
|
+
colSizes?: number[];
|
|
234
|
+
rowSize?: number;
|
|
235
|
+
}) => {
|
|
236
|
+
minHeight: number | undefined;
|
|
237
|
+
width: number;
|
|
238
|
+
}>;
|
|
239
|
+
getColSpan: (cellElem: import('platejs').TTableCellElement) => number;
|
|
240
|
+
getRowSpan: (cellElem: import('platejs').TTableCellElement) => number;
|
|
241
|
+
getCellChildren: (cell: import('platejs').TTableCellElement) => import('platejs').Descendant[];
|
|
242
|
+
};
|
|
243
|
+
}, {
|
|
244
|
+
insert: {
|
|
245
|
+
table: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor, { colCount, header, rowCount }?: import('@platejs/table').GetEmptyTableNodeOptions, { select: shouldSelect, ...options }?: import('platejs').InsertNodesOptions) => void>;
|
|
246
|
+
tableColumn: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor, options?: {
|
|
247
|
+
at?: import('platejs').Path;
|
|
248
|
+
before?: boolean;
|
|
249
|
+
fromCell?: import('platejs').Path;
|
|
250
|
+
header?: boolean;
|
|
251
|
+
select?: boolean;
|
|
252
|
+
}) => void>;
|
|
253
|
+
tableRow: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor, options?: {
|
|
254
|
+
at?: import('platejs').Path;
|
|
255
|
+
before?: boolean;
|
|
256
|
+
fromRow?: import('platejs').Path;
|
|
257
|
+
header?: boolean;
|
|
258
|
+
select?: boolean;
|
|
259
|
+
}) => void>;
|
|
260
|
+
};
|
|
261
|
+
remove: {
|
|
262
|
+
table: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor) => void>;
|
|
263
|
+
tableColumn: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor) => void>;
|
|
264
|
+
tableRow: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor) => void>;
|
|
265
|
+
};
|
|
266
|
+
table: {
|
|
267
|
+
merge: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor) => void>;
|
|
268
|
+
split: import('platejs').OmitFirst<(editor: import('platejs').SlateEditor) => void>;
|
|
269
|
+
};
|
|
270
|
+
}, {
|
|
271
|
+
cellIndices?: (id: string) => import('@platejs/table').CellIndices;
|
|
272
|
+
}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"tr", {}, {}, {}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"td", {}, {}, {}, {}>> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"th", {}, {}, {}, {}>> | import('platejs').SlatePlugin<import('@platejs/toc').TocConfig> | import('platejs').SlatePlugin<import('platejs').PluginConfig<"toggle", {
|
|
273
|
+
openIds?: Set<string>;
|
|
274
|
+
}, {
|
|
275
|
+
toggle: {
|
|
276
|
+
toggleIds: (ids: string[], force?: boolean | null) => void;
|
|
277
|
+
};
|
|
278
|
+
} & Record<"toggle", {
|
|
279
|
+
toggleIds: (ids: string[], force?: boolean | null) => void;
|
|
280
|
+
}>, {}, {
|
|
281
|
+
isOpen?: (toggleId: string) => boolean;
|
|
282
|
+
someClosed?: (toggleIds: string[]) => boolean;
|
|
283
|
+
}>>)[];
|
|
2
284
|
//# sourceMappingURL=editor-base-kit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-base-kit.d.ts","sourceRoot":"","sources":["../../../src/components/editor/editor-base-kit.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor-base-kit.d.ts","sourceRoot":"","sources":["../../../src/components/editor/editor-base-kit.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,aAAa;;;;;sBAHJ,CAAC;cACpB,CAAC;mBAAuB,CAAC;;;uBAMzB,CAAC;cAEF,CAAD;mBACI,CAAC;qBACK,CAAC;;;;;;;kBAQV,CAAC;UACY,CAAC;eACH,CAAC;;;mBAG+E,CAAC;UAA+B,CAAC;eAAqB,CAAC;iBAAwB,CAAC;;;;;0BAAmH,CAAC;;cAA+D,CAAC;qBAAyB,CAAC;;;;;sBAAsG,CAAC;;UAA2D,CAAC;iBAAuB,CAAC;;;;;;;;;sBAHxiB,CAAC;cAGf,CAAC;kBAAsB,CAAC;;;uBAA2K,CAAC;qBAAwC,CAAC;;;;;;;;kBAAka,CAAC;UAA+B,CAAC;cAAoB,CAAC;;;mBAAqK,CAAC;iBAAsC,CAAC;;;;;gFAAzI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;wBArC9uB,CAAC;sBAAqB,CAAC;mBAC1C,CAAC;qBAA0B,CAAC;uBAC9B,CAAA;kBAAmD,CAAC;;cAC/B,CAAA;iBACxB,CAAC;iBAAuB,CAAA;iBAAsB,CAAC;gBAE9C,CAAC;;gBACsC,CAAC;mBAChC,CAAC;;;;;;;;;;qBARP,CAAA;gBAAe,CAAC;;sBAAoC,CAAC;mBAC1C,CAAC;qBAA0B,CAAC;uBAC/B,CAAC;kBACT,CAAA;;cAA6B,CAAC;iBACxB,CAAC;iBAAsB,CAAC;iBACjC,CAAC;gBACS,CAAC;;;;;;;;;;;;6CA+BL,CAAC;;;sCA/BkB,CAAC,6BAC1B,CAAC;;;;0BANoC,CAAC;;;;;;;;iDAoC2oC,CAAC;;;;;;;;;;;;;kCAAk1E,CAAC;iCAAiF,CAAC;kCAAkF,CAAC;kCAAkF,CAAC;;;;;;;;;eA3B/vH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA2BsqQ,CAAC;yBAA8B,CAAC;;;;uBAAyT,CAAC;oBAAyB,CAAC;mBAAqB,CAAC;;;;;;;;;;;;;cAAw4G,CAAC;kBAAsF,CAAC;oBAA0E,CAAC;kBAAgB,CAAC;kBAAmB,CAAC;;;cAA8S,CAAC;kBAAgF,CAAC;mBAAoB,CAAC;kBAAgB,CAAC;kBAAmB,CAAC;;;;;;;;;;;;;;;;;;wCAjCphZ,CAAC;;;oCAEjC,CAAA;;;;MA8BR,CAAC"}
|