@vizel/react 1.0.0 → 1.1.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.
Files changed (49) hide show
  1. package/README.md +38 -14
  2. package/dist/index.d.ts +246 -22
  3. package/dist/index.js +59 -51
  4. package/dist/index10.js +42 -40
  5. package/dist/index13.js +1 -1
  6. package/dist/index14.js +4 -4
  7. package/dist/index16.js +1 -1
  8. package/dist/index19.js +1 -1
  9. package/dist/index2.js +1 -1
  10. package/dist/index20.js +152 -8
  11. package/dist/index21.js +8 -10
  12. package/dist/index22.js +10 -78
  13. package/dist/index23.js +75 -112
  14. package/dist/index24.js +112 -32
  15. package/dist/index25.js +35 -5
  16. package/dist/index26.js +5 -68
  17. package/dist/index27.js +65 -88
  18. package/dist/index28.js +91 -4
  19. package/dist/index29.js +4 -36
  20. package/dist/index30.js +34 -51
  21. package/dist/index31.js +52 -11
  22. package/dist/index32.js +11 -24
  23. package/dist/index33.js +24 -29
  24. package/dist/index34.js +30 -4
  25. package/dist/index35.js +4 -33
  26. package/dist/index36.js +31 -48
  27. package/dist/index37.js +50 -37
  28. package/dist/index38.js +48 -7
  29. package/dist/index39.js +69 -50
  30. package/dist/index40.js +45 -11
  31. package/dist/index41.js +8 -15
  32. package/dist/index42.js +53 -3
  33. package/dist/index43.js +11 -20
  34. package/dist/index44.js +54 -2
  35. package/dist/index45.js +15 -9742
  36. package/dist/index46.js +3 -17016
  37. package/dist/index47.js +21 -2
  38. package/dist/index48.js +2 -8
  39. package/dist/index49.js +9742 -2
  40. package/dist/index50.js +17016 -2
  41. package/dist/index51.js +2 -222
  42. package/dist/index52.js +7 -224
  43. package/dist/index53.js +2 -2
  44. package/dist/index54.js +2 -2
  45. package/dist/index55.js +224 -0
  46. package/dist/index56.js +227 -0
  47. package/dist/index57.js +4 -0
  48. package/dist/index58.js +4 -0
  49. package/package.json +16 -26
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @vizel/react
2
2
 
3
- React components for Vizel block-based Markdown editor.
3
+ React 19 components and hooks for Vizel block-based Markdown editor.
4
4
 
5
5
  ## Installation
6
6
 
@@ -22,7 +22,7 @@ import { Vizel } from "@vizel/react";
22
22
  import "@vizel/core/styles.css";
23
23
 
24
24
  function App() {
25
- return <Vizel />;
25
+ return <Vizel placeholder="Type '/' for commands..." />;
26
26
  }
27
27
  ```
28
28
 
@@ -33,12 +33,16 @@ import { VizelEditor, VizelBubbleMenu, useVizelEditor } from "@vizel/react";
33
33
  import "@vizel/core/styles.css";
34
34
 
35
35
  function App() {
36
- const editor = useVizelEditor();
36
+ const editor = useVizelEditor({
37
+ features: {
38
+ image: { onUpload: async (file) => "https://example.com/image.png" },
39
+ },
40
+ });
37
41
 
38
42
  return (
39
43
  <>
40
44
  <VizelEditor editor={editor} />
41
- <VizelBubbleMenu editor={editor} />
45
+ {editor && <VizelBubbleMenu editor={editor} />}
42
46
  </>
43
47
  );
44
48
  }
@@ -51,12 +55,7 @@ import { useVizelEditor, useVizelMarkdown } from "@vizel/react";
51
55
 
52
56
  function App() {
53
57
  const editor = useVizelEditor();
54
- const { getMarkdown, setMarkdown } = useVizelMarkdown(() => editor);
55
-
56
- const handleExport = () => {
57
- const markdown = getMarkdown();
58
- console.log(markdown);
59
- };
58
+ const { markdown, setMarkdown } = useVizelMarkdown(() => editor);
60
59
 
61
60
  return <VizelEditor editor={editor} />;
62
61
  }
@@ -66,20 +65,45 @@ function App() {
66
65
 
67
66
  | Component | Description |
68
67
  |-----------|-------------|
69
- | `Vizel` | All-in-one editor with bubble menu |
68
+ | `Vizel` | All-in-one editor with bubble menu and optional toolbar |
70
69
  | `VizelEditor` | Editor component |
71
70
  | `VizelBubbleMenu` | Floating formatting toolbar |
71
+ | `VizelBubbleMenuDefault` | Default bubble menu layout |
72
+ | `VizelBubbleMenuButton` | Bubble menu button |
73
+ | `VizelBubbleMenuDivider` | Bubble menu divider |
74
+ | `VizelBubbleMenuColorPicker` | Bubble menu color picker |
72
75
  | `VizelSlashMenu` | Slash command menu |
76
+ | `VizelSlashMenuItem` | Slash command menu item |
77
+ | `VizelSlashMenuEmpty` | Slash command empty state |
78
+ | `VizelToolbar` | Fixed toolbar |
79
+ | `VizelToolbarDefault` | Default toolbar layout |
80
+ | `VizelToolbarButton` | Toolbar button |
81
+ | `VizelToolbarDivider` | Toolbar divider |
82
+ | `VizelLinkEditor` | Link editing popover |
83
+ | `VizelNodeSelector` | Node type selector |
84
+ | `VizelColorPicker` | Color picker |
85
+ | `VizelFindReplace` | Find and replace panel |
86
+ | `VizelSaveIndicator` | Auto-save status indicator |
87
+ | `VizelEmbedView` | Embed content viewer |
73
88
  | `VizelIconProvider` | Custom icon provider |
89
+ | `VizelThemeProvider` | Theme provider |
90
+ | `VizelProvider` | Editor context provider |
91
+ | `VizelPortal` | Portal component |
74
92
 
75
93
  ## Hooks
76
94
 
77
95
  | Hook | Description |
78
96
  |------|-------------|
79
97
  | `useVizelEditor` | Create and manage editor instance |
80
- | `useVizelMarkdown` | Markdown import/export |
81
- | `useVizelAutoSave` | Auto-save functionality |
82
- | `useVizelState` | Editor state management |
98
+ | `useVizelEditorState` | Track editor state changes |
99
+ | `useVizelState` | Trigger re-renders on editor updates |
100
+ | `useVizelMarkdown` | Two-way Markdown synchronization |
101
+ | `useVizelAutoSave` | Auto-save to localStorage or custom backend |
102
+ | `useVizelCollaboration` | Real-time collaboration management |
103
+ | `useVizelComment` | Comment and annotation management |
104
+ | `useVizelVersionHistory` | Document version history |
105
+ | `useVizelContext` | Access editor from context |
106
+ | `useVizelTheme` | Access theme from context |
83
107
 
84
108
  ## Documentation
85
109
 
package/dist/index.d.ts CHANGED
@@ -1,30 +1,39 @@
1
1
  import { ComponentProps } from 'react';
2
- import { CustomIconMap } from '@vizel/core';
2
+ import { CustomIconMap } from '../../packages/core/src/index.ts';
3
3
  import { default as default_2 } from 'react';
4
- import { Editor } from '@vizel/core';
4
+ import { Editor } from '../../packages/core/src/index.ts';
5
+ import { Extensions } from '../../packages/core/src/index.ts';
5
6
  import { Icon } from '@iconify/react';
6
- import { JSONContent } from '@vizel/core';
7
+ import { JSONContent } from '../../packages/core/src/index.ts';
7
8
  import { JSX } from 'react/jsx-runtime';
8
9
  import { ReactNode } from 'react';
9
10
  import { Ref } from 'react';
10
- import { SuggestionOptions } from '@vizel/core';
11
- import { VizelAutoSaveOptions } from '@vizel/core';
12
- import { VizelColorDefinition } from '@vizel/core';
13
- import { VizelCreateEditorOptions } from '@vizel/core';
14
- import { VizelEditorState } from '@vizel/core';
15
- import { VizelEmbedData } from '@vizel/core';
16
- import { VizelFeatureOptions } from '@vizel/core';
17
- import { VizelIconContextValue } from '@vizel/core';
18
- import { VizelIconName } from '@vizel/core';
19
- import { VizelMarkdownSyncOptions } from '@vizel/core';
20
- import { VizelNodeTypeOption } from '@vizel/core';
21
- import { VizelPortalLayer } from '@vizel/core';
22
- import { VizelSaveStatus } from '@vizel/core';
23
- import { VizelSlashCommandItem } from '@vizel/core';
24
- import { VizelSlashMenuRendererOptions } from '@vizel/core';
25
- import { VizelThemeProviderOptions } from '@vizel/core';
26
- import { VizelThemeState } from '@vizel/core';
27
- import { VizelToolbarAction } from '@vizel/core';
11
+ import { SuggestionOptions } from '../../packages/core/src/index.ts';
12
+ import { VizelAutoSaveOptions } from '../../packages/core/src/index.ts';
13
+ import { VizelCollaborationOptions } from '../../packages/core/src/index.ts';
14
+ import { VizelCollaborationUser } from '../../packages/core/src/index.ts';
15
+ import { VizelColorDefinition } from '../../packages/core/src/index.ts';
16
+ import { VizelComment } from '../../packages/core/src/index.ts';
17
+ import { VizelCommentOptions } from '../../packages/core/src/index.ts';
18
+ import { VizelCommentReply } from '../../packages/core/src/index.ts';
19
+ import { VizelCreateEditorOptions } from '../../packages/core/src/index.ts';
20
+ import { VizelEditorState } from '../../packages/core/src/index.ts';
21
+ import { VizelEmbedData } from '../../packages/core/src/index.ts';
22
+ import { VizelFeatureOptions } from '../../packages/core/src/index.ts';
23
+ import { VizelIconContextValue } from '../../packages/core/src/index.ts';
24
+ import { VizelIconName } from '../../packages/core/src/index.ts';
25
+ import { VizelMarkdownSyncOptions } from '../../packages/core/src/index.ts';
26
+ import { VizelNodeTypeOption } from '../../packages/core/src/index.ts';
27
+ import { VizelPortalLayer } from '../../packages/core/src/index.ts';
28
+ import { VizelSaveStatus } from '../../packages/core/src/index.ts';
29
+ import { VizelSlashCommandItem } from '../../packages/core/src/index.ts';
30
+ import { VizelSlashMenuRendererOptions } from '../../packages/core/src/index.ts';
31
+ import { VizelThemeProviderOptions } from '../../packages/core/src/index.ts';
32
+ import { VizelThemeState } from '../../packages/core/src/index.ts';
33
+ import { VizelToolbarAction } from '../../packages/core/src/index.ts';
34
+ import { VizelVersionHistoryOptions } from '../../packages/core/src/index.ts';
35
+ import { VizelVersionSnapshot } from '../../packages/core/src/index.ts';
36
+ import { VizelYjsProvider } from '../../packages/core/src/index.ts';
28
37
 
29
38
  /**
30
39
  * Creates a suggestion render configuration for the SlashCommand extension.
@@ -92,6 +101,148 @@ export declare interface UseVizelAutoSaveResult {
92
101
  restore: () => Promise<JSONContent | null>;
93
102
  }
94
103
 
104
+ /**
105
+ * Hook for tracking real-time collaboration state with a Yjs provider.
106
+ *
107
+ * This hook manages event listeners on the provider to track connection status,
108
+ * sync state, and peer count. It does NOT create the Yjs document or provider —
109
+ * users must create those themselves and pass them in.
110
+ *
111
+ * @param getProvider - Function that returns the Yjs provider instance
112
+ * @param options - Collaboration options including user info and callbacks
113
+ * @returns Collaboration state and controls
114
+ *
115
+ * @example
116
+ * ```tsx
117
+ * import * as Y from "yjs";
118
+ * import { WebsocketProvider } from "y-websocket";
119
+ * import Collaboration from "@tiptap/extension-collaboration";
120
+ * import CollaborationCursor from "@tiptap/extension-collaboration-cursor";
121
+ * import { useVizelEditor, useVizelCollaboration } from "@vizel/react";
122
+ *
123
+ * function CollaborativeEditor() {
124
+ * const [doc] = useState(() => new Y.Doc());
125
+ * const [provider] = useState(
126
+ * () => new WebsocketProvider("ws://localhost:1234", "my-doc", doc)
127
+ * );
128
+ *
129
+ * const { isConnected, peerCount } = useVizelCollaboration(
130
+ * () => provider,
131
+ * { user: { name: "Alice", color: "#ff0000" } }
132
+ * );
133
+ *
134
+ * const editor = useVizelEditor({
135
+ * features: { collaboration: true },
136
+ * extensions: [
137
+ * Collaboration.configure({ document: doc }),
138
+ * CollaborationCursor.configure({
139
+ * provider,
140
+ * user: { name: "Alice", color: "#ff0000" },
141
+ * }),
142
+ * ],
143
+ * });
144
+ *
145
+ * return (
146
+ * <div>
147
+ * <span>{isConnected ? "Connected" : "Disconnected"} ({peerCount} peers)</span>
148
+ * <VizelEditor editor={editor} />
149
+ * </div>
150
+ * );
151
+ * }
152
+ * ```
153
+ */
154
+ export declare function useVizelCollaboration(getProvider: () => VizelYjsProvider | null | undefined, options?: VizelCollaborationOptions): UseVizelCollaborationResult;
155
+
156
+ /**
157
+ * Collaboration hook result
158
+ */
159
+ export declare interface UseVizelCollaborationResult {
160
+ /** Whether connected to the collaboration server */
161
+ isConnected: boolean;
162
+ /** Whether the initial document sync is complete */
163
+ isSynced: boolean;
164
+ /** Number of currently connected peers (including self) */
165
+ peerCount: number;
166
+ /** Last error that occurred */
167
+ error: Error | null;
168
+ /** Connect to the collaboration server */
169
+ connect: () => void;
170
+ /** Disconnect from the collaboration server */
171
+ disconnect: () => void;
172
+ /** Update the current user's cursor information */
173
+ updateUser: (user: VizelCollaborationUser) => void;
174
+ }
175
+
176
+ /**
177
+ * Hook for managing document comments and annotations.
178
+ *
179
+ * @param getEditor - Function that returns the editor instance
180
+ * @param options - Comment configuration options
181
+ * @returns Comment state and controls
182
+ *
183
+ * @example
184
+ * ```tsx
185
+ * function Editor() {
186
+ * const editor = useVizelEditor({
187
+ * features: { comment: true },
188
+ * });
189
+ * const { comments, addComment, resolveComment, setActiveComment } =
190
+ * useVizelComment(() => editor, { key: "my-comments" });
191
+ *
192
+ * const handleAddComment = () => {
193
+ * const text = prompt("Enter comment:");
194
+ * if (text) addComment(text, "Author");
195
+ * };
196
+ *
197
+ * return (
198
+ * <div>
199
+ * <VizelEditor editor={editor} />
200
+ * <button onClick={handleAddComment}>Add Comment</button>
201
+ * <ul>
202
+ * {comments.map((c) => (
203
+ * <li key={c.id} onClick={() => setActiveComment(c.id)}>
204
+ * {c.text} {c.resolved ? "(resolved)" : ""}
205
+ * <button onClick={() => resolveComment(c.id)}>Resolve</button>
206
+ * </li>
207
+ * ))}
208
+ * </ul>
209
+ * </div>
210
+ * );
211
+ * }
212
+ * ```
213
+ */
214
+ export declare function useVizelComment(getEditor: () => Editor | null | undefined, options?: VizelCommentOptions): UseVizelCommentResult;
215
+
216
+ /**
217
+ * Comment hook result
218
+ */
219
+ export declare interface UseVizelCommentResult {
220
+ /** All stored comments (newest first) */
221
+ comments: VizelComment[];
222
+ /** Currently active comment ID */
223
+ activeCommentId: string | null;
224
+ /** Whether comments are loading */
225
+ isLoading: boolean;
226
+ /** Last error that occurred */
227
+ error: Error | null;
228
+ /** Add a comment to the current selection */
229
+ addComment: (text: string, author?: string) => Promise<VizelComment | null>;
230
+ /** Remove a comment and its mark */
231
+ removeComment: (commentId: string) => Promise<void>;
232
+ /** Mark a comment as resolved */
233
+ resolveComment: (commentId: string) => Promise<boolean>;
234
+ /** Reopen a resolved comment */
235
+ reopenComment: (commentId: string) => Promise<boolean>;
236
+ /** Add a reply to a comment */
237
+ replyToComment: (commentId: string, text: string, author?: string) => Promise<VizelCommentReply | null>;
238
+ /** Set the active comment */
239
+ setActiveComment: (commentId: string | null) => void;
240
+ /** Load all comments from storage */
241
+ loadComments: () => Promise<VizelComment[]>;
242
+ /** Get a comment by its ID */
243
+ getCommentById: (commentId: string) => VizelComment | undefined;
244
+ }
245
+
95
246
  /**
96
247
  * Hook to access the editor instance from context.
97
248
  *
@@ -297,6 +448,63 @@ export declare function useVizelTheme(): VizelThemeState;
297
448
  */
298
449
  export declare function useVizelThemeSafe(): VizelThemeState | null;
299
450
 
451
+ /**
452
+ * Hook for managing document version history.
453
+ *
454
+ * @param getEditor - Function that returns the editor instance
455
+ * @param options - Version history configuration options
456
+ * @returns Version history state and controls
457
+ *
458
+ * @example
459
+ * ```tsx
460
+ * function Editor() {
461
+ * const editor = useVizelEditor({ ... });
462
+ * const { snapshots, saveVersion, restoreVersion } = useVizelVersionHistory(
463
+ * () => editor,
464
+ * { maxVersions: 20, key: 'my-doc-versions' }
465
+ * );
466
+ *
467
+ * return (
468
+ * <div>
469
+ * <VizelEditor editor={editor} />
470
+ * <button onClick={() => saveVersion("Manual save")}>Save Version</button>
471
+ * <ul>
472
+ * {snapshots.map(s => (
473
+ * <li key={s.id}>
474
+ * {s.description} - {new Date(s.timestamp).toLocaleString()}
475
+ * <button onClick={() => restoreVersion(s.id)}>Restore</button>
476
+ * </li>
477
+ * ))}
478
+ * </ul>
479
+ * </div>
480
+ * );
481
+ * }
482
+ * ```
483
+ */
484
+ export declare function useVizelVersionHistory(getEditor: () => Editor | null | undefined, options?: VizelVersionHistoryOptions): UseVizelVersionHistoryResult;
485
+
486
+ /**
487
+ * Version history hook result
488
+ */
489
+ export declare interface UseVizelVersionHistoryResult {
490
+ /** All stored snapshots (newest first) */
491
+ snapshots: VizelVersionSnapshot[];
492
+ /** Whether history is loading */
493
+ isLoading: boolean;
494
+ /** Last error that occurred */
495
+ error: Error | null;
496
+ /** Save current document as a new version */
497
+ saveVersion: (description?: string, author?: string) => Promise<VizelVersionSnapshot | null>;
498
+ /** Restore document to a specific version */
499
+ restoreVersion: (versionId: string) => Promise<boolean>;
500
+ /** Load all versions from storage */
501
+ loadVersions: () => Promise<VizelVersionSnapshot[]>;
502
+ /** Delete a specific version */
503
+ deleteVersion: (versionId: string) => Promise<void>;
504
+ /** Delete all versions */
505
+ clearVersions: () => Promise<void>;
506
+ }
507
+
300
508
  /**
301
509
  * Vizel - All-in-one editor component
302
510
  *
@@ -334,7 +542,7 @@ export declare function useVizelThemeSafe(): VizelThemeState | null;
334
542
  * }
335
543
  * ```
336
544
  */
337
- export declare function Vizel({ ref, initialContent, initialMarkdown, transformDiagramsOnImport, placeholder, editable, autofocus, features, className, showToolbar, toolbarContent, showBubbleMenu, enableEmbed, bubbleMenuContent, children, onUpdate, onCreate, onDestroy, onSelectionUpdate, onFocus, onBlur, }: VizelProps): ReactNode;
545
+ export declare function Vizel({ ref, initialContent, initialMarkdown, transformDiagramsOnImport, placeholder, editable, autofocus, features, extensions, className, showToolbar, toolbarContent, showBubbleMenu, enableEmbed, bubbleMenuContent, children, onUpdate, onCreate, onDestroy, onSelectionUpdate, onFocus, onBlur, }: VizelProps): ReactNode;
338
546
 
339
547
  /**
340
548
  * A floating menu that appears when text is selected.
@@ -557,6 +765,20 @@ export declare interface VizelExposed {
557
765
  container: HTMLDivElement | null;
558
766
  }
559
767
 
768
+ /**
769
+ * Find & Replace panel component for React
770
+ */
771
+ export declare function VizelFindReplace({ editor, className, onClose }: VizelFindReplaceProps): JSX.Element | null;
772
+
773
+ export declare interface VizelFindReplaceProps {
774
+ /** The Tiptap editor instance */
775
+ editor: Editor | null;
776
+ /** Custom class name */
777
+ className?: string;
778
+ /** Callback when the panel is closed */
779
+ onClose?: () => void;
780
+ }
781
+
560
782
  /**
561
783
  * Icon component that renders Iconify icons based on semantic icon names.
562
784
  * Uses Lucide icons by default, but can be customized via:
@@ -765,6 +987,8 @@ export declare interface VizelProps {
765
987
  autofocus?: boolean | "start" | "end" | "all" | number;
766
988
  /** Feature configuration */
767
989
  features?: VizelFeatureOptions;
990
+ /** Additional Tiptap extensions */
991
+ extensions?: Extensions;
768
992
  /** Custom class name for the editor container */
769
993
  className?: string;
770
994
  /** Whether to show the toolbar (default: false) */
package/dist/index.js CHANGED
@@ -9,68 +9,76 @@ import "./index9.js";
9
9
  import { Vizel as z } from "./index10.js";
10
10
  import { VizelBubbleMenu as u } from "./index11.js";
11
11
  import { VizelBubbleMenuButton as a } from "./index12.js";
12
- import { VizelBubbleMenuColorPicker as d } from "./index13.js";
12
+ import { VizelBubbleMenuColorPicker as b } from "./index13.js";
13
13
  import { VizelBubbleMenuDefault as S } from "./index14.js";
14
14
  import { VizelBubbleMenuDivider as c } from "./index15.js";
15
15
  import { VizelColorPicker as v } from "./index16.js";
16
- import { useVizelContext as T, useVizelContextSafe as E } from "./index17.js";
17
- import { VizelEditor as C } from "./index18.js";
16
+ import { useVizelContext as C, useVizelContextSafe as T } from "./index17.js";
17
+ import { VizelEditor as P } from "./index18.js";
18
18
  import { VizelEmbedView as k } from "./index19.js";
19
- import { VizelIcon as w } from "./index20.js";
20
- import { VizelIconProvider as A, useVizelIconContext as L } from "./index21.js";
21
- import { VizelLinkEditor as R } from "./index22.js";
22
- import { VizelNodeSelector as j } from "./index23.js";
23
- import { VizelPortal as F } from "./index24.js";
24
- import { VizelProvider as H } from "./index25.js";
25
- import { VizelSaveIndicator as K } from "./index26.js";
26
- import { VizelSlashMenu as Q } from "./index27.js";
27
- import { VizelSlashMenuEmpty as W } from "./index28.js";
28
- import { VizelSlashMenuItem as Y } from "./index29.js";
29
- import { VizelThemeProvider as _, useVizelTheme as $, useVizelThemeSafe as ee } from "./index30.js";
30
- import { VizelToolbar as re } from "./index31.js";
31
- import { VizelToolbarButton as ie } from "./index32.js";
32
- import { VizelToolbarDefault as me } from "./index33.js";
33
- import { VizelToolbarDivider as Ve } from "./index34.js";
34
- import { createVizelSlashMenuRenderer as ze } from "./index35.js";
35
- import { useVizelAutoSave as ue } from "./index36.js";
36
- import { useVizelEditor as ae } from "./index37.js";
37
- import { useVizelEditorState as de } from "./index38.js";
38
- import { useVizelMarkdown as Se } from "./index39.js";
39
- import { useVizelState as ce } from "./index40.js";
19
+ import { VizelFindReplace as w } from "./index20.js";
20
+ import { VizelIcon as R } from "./index21.js";
21
+ import { VizelIconProvider as F, useVizelIconContext as H } from "./index22.js";
22
+ import { VizelLinkEditor as N } from "./index23.js";
23
+ import { VizelNodeSelector as j } from "./index24.js";
24
+ import { VizelPortal as G } from "./index25.js";
25
+ import { VizelProvider as K } from "./index26.js";
26
+ import { VizelSaveIndicator as Q } from "./index27.js";
27
+ import { VizelSlashMenu as W } from "./index28.js";
28
+ import { VizelSlashMenuEmpty as Y } from "./index29.js";
29
+ import { VizelSlashMenuItem as _ } from "./index30.js";
30
+ import { VizelThemeProvider as ee, useVizelTheme as oe, useVizelThemeSafe as re } from "./index31.js";
31
+ import { VizelToolbar as ie } from "./index32.js";
32
+ import { VizelToolbarButton as me } from "./index33.js";
33
+ import { VizelToolbarDefault as Ve } from "./index34.js";
34
+ import { VizelToolbarDivider as ze } from "./index35.js";
35
+ import { createVizelSlashMenuRenderer as ue } from "./index36.js";
36
+ import { useVizelAutoSave as ae } from "./index37.js";
37
+ import { useVizelCollaboration as be } from "./index38.js";
38
+ import { useVizelComment as Se } from "./index39.js";
39
+ import { useVizelEditor as ce } from "./index40.js";
40
+ import { useVizelEditorState as ve } from "./index41.js";
41
+ import { useVizelMarkdown as Ce } from "./index42.js";
42
+ import { useVizelState as Ee } from "./index43.js";
43
+ import { useVizelVersionHistory as Ie } from "./index44.js";
40
44
  export {
41
45
  z as Vizel,
42
46
  u as VizelBubbleMenu,
43
47
  a as VizelBubbleMenuButton,
44
- d as VizelBubbleMenuColorPicker,
48
+ b as VizelBubbleMenuColorPicker,
45
49
  S as VizelBubbleMenuDefault,
46
50
  c as VizelBubbleMenuDivider,
47
51
  v as VizelColorPicker,
48
- C as VizelEditor,
52
+ P as VizelEditor,
49
53
  k as VizelEmbedView,
50
- w as VizelIcon,
51
- A as VizelIconProvider,
52
- R as VizelLinkEditor,
54
+ w as VizelFindReplace,
55
+ R as VizelIcon,
56
+ F as VizelIconProvider,
57
+ N as VizelLinkEditor,
53
58
  j as VizelNodeSelector,
54
- F as VizelPortal,
55
- H as VizelProvider,
56
- K as VizelSaveIndicator,
57
- Q as VizelSlashMenu,
58
- W as VizelSlashMenuEmpty,
59
- Y as VizelSlashMenuItem,
60
- _ as VizelThemeProvider,
61
- re as VizelToolbar,
62
- ie as VizelToolbarButton,
63
- me as VizelToolbarDefault,
64
- Ve as VizelToolbarDivider,
65
- ze as createVizelSlashMenuRenderer,
66
- ue as useVizelAutoSave,
67
- T as useVizelContext,
68
- E as useVizelContextSafe,
69
- ae as useVizelEditor,
70
- de as useVizelEditorState,
71
- L as useVizelIconContext,
72
- Se as useVizelMarkdown,
73
- ce as useVizelState,
74
- $ as useVizelTheme,
75
- ee as useVizelThemeSafe
59
+ G as VizelPortal,
60
+ K as VizelProvider,
61
+ Q as VizelSaveIndicator,
62
+ W as VizelSlashMenu,
63
+ Y as VizelSlashMenuEmpty,
64
+ _ as VizelSlashMenuItem,
65
+ ee as VizelThemeProvider,
66
+ ie as VizelToolbar,
67
+ me as VizelToolbarButton,
68
+ Ve as VizelToolbarDefault,
69
+ ze as VizelToolbarDivider,
70
+ ue as createVizelSlashMenuRenderer,
71
+ ae as useVizelAutoSave,
72
+ be as useVizelCollaboration,
73
+ Se as useVizelComment,
74
+ C as useVizelContext,
75
+ T as useVizelContextSafe,
76
+ ce as useVizelEditor,
77
+ ve as useVizelEditorState,
78
+ H as useVizelIconContext,
79
+ Ce as useVizelMarkdown,
80
+ Ee as useVizelState,
81
+ oe as useVizelTheme,
82
+ re as useVizelThemeSafe,
83
+ Ie as useVizelVersionHistory
76
84
  };
package/dist/index10.js CHANGED
@@ -1,62 +1,64 @@
1
- import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
- import { useImperativeHandle as A } from "react";
3
- import { useVizelEditor as G } from "./index37.js";
4
- import { VizelBubbleMenu as H } from "./index11.js";
5
- import { VizelEditor as J } from "./index18.js";
6
- import { VizelToolbar as I } from "./index31.js";
7
- function T({
8
- ref: N,
1
+ import { jsxs as G, jsx as r } from "react/jsx-runtime";
2
+ import { useImperativeHandle as J } from "react";
3
+ import { useVizelEditor as K } from "./index40.js";
4
+ import { VizelBubbleMenu as N } from "./index11.js";
5
+ import { VizelEditor as L } from "./index18.js";
6
+ import { VizelToolbar as $ } from "./index32.js";
7
+ function X({
8
+ ref: e,
9
9
  initialContent: m,
10
10
  initialMarkdown: o,
11
- transformDiagramsOnImport: $ = !0,
11
+ transformDiagramsOnImport: g = !0,
12
12
  placeholder: f,
13
- editable: g = !0,
14
- autofocus: h = !1,
13
+ editable: h = !0,
14
+ autofocus: q = !1,
15
15
  features: z,
16
- className: q,
17
- showToolbar: s = !1,
16
+ extensions: p,
17
+ className: u,
18
+ showToolbar: V = !1,
18
19
  toolbarContent: d,
19
- showBubbleMenu: p = !0,
20
- enableEmbed: V = !1,
20
+ showBubbleMenu: l = !0,
21
+ enableEmbed: s = !1,
21
22
  bubbleMenuContent: v,
22
- children: t,
23
- onUpdate: l,
24
- onCreate: c,
23
+ children: A,
24
+ onUpdate: c,
25
+ onCreate: j,
25
26
  onDestroy: x,
26
- onSelectionUpdate: e,
27
- onFocus: j,
28
- onBlur: E
27
+ onSelectionUpdate: E,
28
+ onFocus: H,
29
+ onBlur: I
29
30
  }) {
30
- const i = G({
31
+ const i = K({
31
32
  ...m !== void 0 && { initialContent: m },
32
33
  ...o !== void 0 && { initialMarkdown: o },
33
- transformDiagramsOnImport: $,
34
+ transformDiagramsOnImport: g,
34
35
  ...f !== void 0 && { placeholder: f },
35
- editable: g,
36
- autofocus: h,
36
+ editable: h,
37
+ autofocus: q,
37
38
  ...z !== void 0 && { features: z },
38
- ...l !== void 0 && { onUpdate: l },
39
- ...c !== void 0 && { onCreate: c },
39
+ ...p !== void 0 && { extensions: p },
40
+ ...c !== void 0 && { onUpdate: c },
41
+ ...j !== void 0 && { onCreate: j },
40
42
  ...x !== void 0 && { onDestroy: x },
41
- ...e !== void 0 && { onSelectionUpdate: e },
42
- ...j !== void 0 && { onFocus: j },
43
- ...E !== void 0 && { onBlur: E }
43
+ ...E !== void 0 && { onSelectionUpdate: E },
44
+ ...H !== void 0 && { onFocus: H },
45
+ ...I !== void 0 && { onBlur: I }
44
46
  });
45
- return A(
46
- N,
47
+ return J(
48
+ e,
47
49
  () => ({
48
50
  editor: i
49
51
  }),
50
52
  [i]
51
- ), /* @__PURE__ */ u("div", { className: `vizel-root ${q ?? ""}`, "data-vizel-root": "", children: [
52
- s && i && d && /* @__PURE__ */ r(I, { editor: i, children: d }),
53
- s && i && !d && /* @__PURE__ */ r(I, { editor: i }),
54
- /* @__PURE__ */ r(J, { editor: i }),
55
- p && i && v && /* @__PURE__ */ r(H, { editor: i, enableEmbed: V, children: v }),
56
- p && i && !v && /* @__PURE__ */ r(H, { editor: i, enableEmbed: V }),
57
- t
53
+ ), /* @__PURE__ */ G("div", { className: `vizel-root ${u ?? ""}`, "data-vizel-root": "", children: [
54
+ V && i && d && /* @__PURE__ */ r($, { editor: i, children: d }),
55
+ V && i && !d && /* @__PURE__ */ r($, { editor: i }),
56
+ /* @__PURE__ */ r(L, { editor: i }),
57
+ l && i && v && /* @__PURE__ */ r(N, { editor: i, enableEmbed: s, children: v }),
58
+ l && i && !v && /* @__PURE__ */ r(N, { editor: i, enableEmbed: s }),
59
+ A
58
60
  ] });
59
61
  }
60
62
  export {
61
- T as Vizel
63
+ X as Vizel
62
64
  };
package/dist/index13.js CHANGED
@@ -2,7 +2,7 @@ import { jsxs as V, jsx as l } from "react/jsx-runtime";
2
2
  import { getVizelRecentColors as H, addVizelRecentColor as u, VIZEL_TEXT_COLORS as L, VIZEL_HIGHLIGHT_COLORS as O } from "@vizel/core";
3
3
  import { useState as h, useRef as E, useEffect as g, useCallback as I } from "react";
4
4
  import { VizelColorPicker as T } from "./index16.js";
5
- import { VizelIcon as C } from "./index20.js";
5
+ import { VizelIcon as C } from "./index21.js";
6
6
  function A({
7
7
  editor: o,
8
8
  type: e,