@vizel/react 0.0.1-alpha.6 → 1.0.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/README.md +5 -5
- package/dist/index.d.ts +107 -1
- package/dist/index.js +31 -23
- package/dist/index10.js +52 -47
- package/dist/index14.js +54 -50
- package/dist/index2.js +1 -1
- package/dist/index23.js +1 -1
- package/dist/index31.js +12 -33
- package/dist/index32.js +24 -49
- package/dist/index33.js +30 -29
- package/dist/index34.js +4 -7
- package/dist/index35.js +31 -50
- package/dist/index36.js +49 -10
- package/dist/index37.js +38 -15
- package/dist/index38.js +8 -3
- package/dist/index39.js +50 -18
- package/dist/index40.js +12 -2
- package/dist/index41.js +15 -9742
- package/dist/index42.js +3 -17016
- package/dist/index43.js +21 -2
- package/dist/index44.js +2 -8
- package/dist/index45.js +9742 -2
- package/dist/index46.js +17016 -2
- package/dist/index47.js +2 -222
- package/dist/index48.js +7 -224
- package/dist/index49.js +2 -2
- package/dist/index50.js +2 -2
- package/dist/index51.js +224 -0
- package/dist/index52.js +227 -0
- package/dist/index53.js +4 -0
- package/dist/index54.js +4 -0
- package/package.json +36 -16
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ React components for Vizel block-based Markdown editor.
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @vizel/react
|
|
8
|
+
npm install @vizel/react
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Requirements
|
|
@@ -37,8 +37,8 @@ function App() {
|
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<>
|
|
40
|
-
<VizelEditor editor={editor
|
|
41
|
-
<VizelBubbleMenu editor={editor
|
|
40
|
+
<VizelEditor editor={editor} />
|
|
41
|
+
<VizelBubbleMenu editor={editor} />
|
|
42
42
|
</>
|
|
43
43
|
);
|
|
44
44
|
}
|
|
@@ -51,14 +51,14 @@ import { useVizelEditor, useVizelMarkdown } from "@vizel/react";
|
|
|
51
51
|
|
|
52
52
|
function App() {
|
|
53
53
|
const editor = useVizelEditor();
|
|
54
|
-
const { getMarkdown, setMarkdown } = useVizelMarkdown(() => editor
|
|
54
|
+
const { getMarkdown, setMarkdown } = useVizelMarkdown(() => editor);
|
|
55
55
|
|
|
56
56
|
const handleExport = () => {
|
|
57
57
|
const markdown = getMarkdown();
|
|
58
58
|
console.log(markdown);
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
return <VizelEditor editor={editor
|
|
61
|
+
return <VizelEditor editor={editor} />;
|
|
62
62
|
}
|
|
63
63
|
```
|
|
64
64
|
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { VizelSlashCommandItem } from '@vizel/core';
|
|
|
24
24
|
import { VizelSlashMenuRendererOptions } from '@vizel/core';
|
|
25
25
|
import { VizelThemeProviderOptions } from '@vizel/core';
|
|
26
26
|
import { VizelThemeState } from '@vizel/core';
|
|
27
|
+
import { VizelToolbarAction } from '@vizel/core';
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Creates a suggestion render configuration for the SlashCommand extension.
|
|
@@ -333,7 +334,7 @@ export declare function useVizelThemeSafe(): VizelThemeState | null;
|
|
|
333
334
|
* }
|
|
334
335
|
* ```
|
|
335
336
|
*/
|
|
336
|
-
export declare function Vizel({ ref, initialContent, initialMarkdown, transformDiagramsOnImport, placeholder, editable, autofocus, features, className, showBubbleMenu, enableEmbed, bubbleMenuContent, children, onUpdate, onCreate, onDestroy, onSelectionUpdate, onFocus, onBlur, }: VizelProps): ReactNode;
|
|
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;
|
|
337
338
|
|
|
338
339
|
/**
|
|
339
340
|
* A floating menu that appears when text is selected.
|
|
@@ -766,6 +767,10 @@ export declare interface VizelProps {
|
|
|
766
767
|
features?: VizelFeatureOptions;
|
|
767
768
|
/** Custom class name for the editor container */
|
|
768
769
|
className?: string;
|
|
770
|
+
/** Whether to show the toolbar (default: false) */
|
|
771
|
+
showToolbar?: boolean;
|
|
772
|
+
/** Custom toolbar content */
|
|
773
|
+
toolbarContent?: ReactNode;
|
|
769
774
|
/** Whether to show the bubble menu (default: true) */
|
|
770
775
|
showBubbleMenu?: boolean;
|
|
771
776
|
/** Enable embed option in bubble menu link editor (requires Embed extension) */
|
|
@@ -962,4 +967,105 @@ export declare interface VizelThemeProviderProps extends VizelThemeProviderOptio
|
|
|
962
967
|
children: ReactNode;
|
|
963
968
|
}
|
|
964
969
|
|
|
970
|
+
/**
|
|
971
|
+
* Fixed toolbar component for the Vizel editor.
|
|
972
|
+
* Displays formatting buttons above the editor content area.
|
|
973
|
+
*
|
|
974
|
+
* @example
|
|
975
|
+
* ```tsx
|
|
976
|
+
* // Default toolbar with all formatting buttons
|
|
977
|
+
* <VizelToolbar editor={editor} />
|
|
978
|
+
*
|
|
979
|
+
* // Custom toolbar content
|
|
980
|
+
* <VizelToolbar editor={editor}>
|
|
981
|
+
* <VizelToolbarButton onClick={() => editor.chain().focus().toggleBold().run()}>
|
|
982
|
+
* <strong>B</strong>
|
|
983
|
+
* </VizelToolbarButton>
|
|
984
|
+
* </VizelToolbar>
|
|
985
|
+
* ```
|
|
986
|
+
*/
|
|
987
|
+
export declare function VizelToolbar({ editor: editorProp, className, showDefaultToolbar, children, }: VizelToolbarProps): JSX.Element | null;
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* A button component for use in the VizelToolbar.
|
|
991
|
+
*
|
|
992
|
+
* @example
|
|
993
|
+
* ```tsx
|
|
994
|
+
* <VizelToolbarButton
|
|
995
|
+
* onClick={() => editor.chain().focus().toggleBold().run()}
|
|
996
|
+
* isActive={editor.isActive("bold")}
|
|
997
|
+
* title="Bold (Cmd+B)"
|
|
998
|
+
* >
|
|
999
|
+
* <VizelIcon name="bold" />
|
|
1000
|
+
* </VizelToolbarButton>
|
|
1001
|
+
* ```
|
|
1002
|
+
*/
|
|
1003
|
+
export declare function VizelToolbarButton({ onClick, isActive, disabled, children, title, className, action, }: VizelToolbarButtonProps): JSX.Element;
|
|
1004
|
+
|
|
1005
|
+
export declare interface VizelToolbarButtonProps {
|
|
1006
|
+
/** Click handler */
|
|
1007
|
+
onClick?: () => void;
|
|
1008
|
+
/** Whether the action is currently active */
|
|
1009
|
+
isActive?: boolean;
|
|
1010
|
+
/** Whether the button is disabled */
|
|
1011
|
+
disabled?: boolean;
|
|
1012
|
+
/** Button content (typically an icon) */
|
|
1013
|
+
children: ReactNode;
|
|
1014
|
+
/** Tooltip text */
|
|
1015
|
+
title?: string;
|
|
1016
|
+
/** Additional CSS class name */
|
|
1017
|
+
className?: string;
|
|
1018
|
+
/** Action identifier for testing */
|
|
1019
|
+
action?: string;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
/**
|
|
1023
|
+
* The default toolbar content for VizelToolbar.
|
|
1024
|
+
* Provides formatting buttons grouped by category with dividers between groups.
|
|
1025
|
+
*
|
|
1026
|
+
* @example
|
|
1027
|
+
* ```tsx
|
|
1028
|
+
* <VizelToolbar>
|
|
1029
|
+
* <VizelToolbarDefault editor={editor} />
|
|
1030
|
+
* </VizelToolbar>
|
|
1031
|
+
* ```
|
|
1032
|
+
*/
|
|
1033
|
+
export declare function VizelToolbarDefault({ editor, className, actions, }: VizelToolbarDefaultProps): JSX.Element;
|
|
1034
|
+
|
|
1035
|
+
export declare interface VizelToolbarDefaultProps {
|
|
1036
|
+
editor: Editor;
|
|
1037
|
+
className?: string;
|
|
1038
|
+
/** Custom toolbar actions (defaults to vizelDefaultToolbarActions) */
|
|
1039
|
+
actions?: VizelToolbarAction[];
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* A divider component for separating groups of buttons in the VizelToolbar.
|
|
1044
|
+
*
|
|
1045
|
+
* @example
|
|
1046
|
+
* ```tsx
|
|
1047
|
+
* <VizelToolbar>
|
|
1048
|
+
* <VizelToolbarButton>B</VizelToolbarButton>
|
|
1049
|
+
* <VizelToolbarDivider />
|
|
1050
|
+
* <VizelToolbarButton>H1</VizelToolbarButton>
|
|
1051
|
+
* </VizelToolbar>
|
|
1052
|
+
* ```
|
|
1053
|
+
*/
|
|
1054
|
+
export declare function VizelToolbarDivider({ className }: VizelToolbarDividerProps): JSX.Element;
|
|
1055
|
+
|
|
1056
|
+
export declare interface VizelToolbarDividerProps {
|
|
1057
|
+
className?: string;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
export declare interface VizelToolbarProps {
|
|
1061
|
+
/** Editor instance. Falls back to context if not provided. */
|
|
1062
|
+
editor?: Editor | null;
|
|
1063
|
+
/** Additional CSS class name */
|
|
1064
|
+
className?: string;
|
|
1065
|
+
/** Whether to show the default toolbar (default: true). Set to false when using custom children. */
|
|
1066
|
+
showDefaultToolbar?: boolean;
|
|
1067
|
+
/** Custom toolbar content. When provided, replaces the default toolbar. */
|
|
1068
|
+
children?: ReactNode;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
965
1071
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -6,17 +6,17 @@ import "./index6.js";
|
|
|
6
6
|
import "./index7.js";
|
|
7
7
|
import "./index8.js";
|
|
8
8
|
import "./index9.js";
|
|
9
|
-
import { Vizel as
|
|
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
12
|
import { VizelBubbleMenuColorPicker as d } 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
|
|
17
|
-
import { VizelEditor as
|
|
18
|
-
import { VizelEmbedView as
|
|
19
|
-
import { VizelIcon as
|
|
16
|
+
import { useVizelContext as T, useVizelContextSafe as E } from "./index17.js";
|
|
17
|
+
import { VizelEditor as C } from "./index18.js";
|
|
18
|
+
import { VizelEmbedView as k } from "./index19.js";
|
|
19
|
+
import { VizelIcon as w } from "./index20.js";
|
|
20
20
|
import { VizelIconProvider as A, useVizelIconContext as L } from "./index21.js";
|
|
21
21
|
import { VizelLinkEditor as R } from "./index22.js";
|
|
22
22
|
import { VizelNodeSelector as j } from "./index23.js";
|
|
@@ -27,23 +27,27 @@ import { VizelSlashMenu as Q } from "./index27.js";
|
|
|
27
27
|
import { VizelSlashMenuEmpty as W } from "./index28.js";
|
|
28
28
|
import { VizelSlashMenuItem as Y } from "./index29.js";
|
|
29
29
|
import { VizelThemeProvider as _, useVizelTheme as $, useVizelThemeSafe as ee } from "./index30.js";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
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";
|
|
36
40
|
export {
|
|
37
|
-
|
|
41
|
+
z as Vizel,
|
|
38
42
|
u as VizelBubbleMenu,
|
|
39
43
|
a as VizelBubbleMenuButton,
|
|
40
44
|
d as VizelBubbleMenuColorPicker,
|
|
41
45
|
S as VizelBubbleMenuDefault,
|
|
42
46
|
c as VizelBubbleMenuDivider,
|
|
43
47
|
v as VizelColorPicker,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
C as VizelEditor,
|
|
49
|
+
k as VizelEmbedView,
|
|
50
|
+
w as VizelIcon,
|
|
47
51
|
A as VizelIconProvider,
|
|
48
52
|
R as VizelLinkEditor,
|
|
49
53
|
j as VizelNodeSelector,
|
|
@@ -54,15 +58,19 @@ export {
|
|
|
54
58
|
W as VizelSlashMenuEmpty,
|
|
55
59
|
Y as VizelSlashMenuItem,
|
|
56
60
|
_ as VizelThemeProvider,
|
|
57
|
-
re as
|
|
58
|
-
ie as
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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,
|
|
63
71
|
L as useVizelIconContext,
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
Se as useVizelMarkdown,
|
|
73
|
+
ce as useVizelState,
|
|
66
74
|
$ as useVizelTheme,
|
|
67
75
|
ee as useVizelThemeSafe
|
|
68
76
|
};
|
package/dist/index10.js
CHANGED
|
@@ -1,57 +1,62 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useImperativeHandle as
|
|
3
|
-
import { useVizelEditor as
|
|
4
|
-
import { VizelBubbleMenu as
|
|
5
|
-
import { VizelEditor as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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,
|
|
9
|
+
initialContent: m,
|
|
10
|
+
initialMarkdown: o,
|
|
11
|
+
transformDiagramsOnImport: $ = !0,
|
|
12
|
+
placeholder: f,
|
|
13
|
+
editable: g = !0,
|
|
14
|
+
autofocus: h = !1,
|
|
15
|
+
features: z,
|
|
16
|
+
className: q,
|
|
17
|
+
showToolbar: s = !1,
|
|
18
|
+
toolbarContent: d,
|
|
19
|
+
showBubbleMenu: p = !0,
|
|
20
|
+
enableEmbed: V = !1,
|
|
21
|
+
bubbleMenuContent: v,
|
|
22
|
+
children: t,
|
|
23
|
+
onUpdate: l,
|
|
24
|
+
onCreate: c,
|
|
25
|
+
onDestroy: x,
|
|
26
|
+
onSelectionUpdate: e,
|
|
27
|
+
onFocus: j,
|
|
28
|
+
onBlur: E
|
|
26
29
|
}) {
|
|
27
|
-
const i =
|
|
28
|
-
...
|
|
29
|
-
...
|
|
30
|
-
transformDiagramsOnImport:
|
|
31
|
-
...
|
|
32
|
-
editable:
|
|
33
|
-
autofocus:
|
|
34
|
-
...
|
|
35
|
-
...
|
|
36
|
-
...
|
|
37
|
-
...
|
|
38
|
-
...
|
|
39
|
-
...
|
|
40
|
-
...
|
|
30
|
+
const i = G({
|
|
31
|
+
...m !== void 0 && { initialContent: m },
|
|
32
|
+
...o !== void 0 && { initialMarkdown: o },
|
|
33
|
+
transformDiagramsOnImport: $,
|
|
34
|
+
...f !== void 0 && { placeholder: f },
|
|
35
|
+
editable: g,
|
|
36
|
+
autofocus: h,
|
|
37
|
+
...z !== void 0 && { features: z },
|
|
38
|
+
...l !== void 0 && { onUpdate: l },
|
|
39
|
+
...c !== void 0 && { onCreate: c },
|
|
40
|
+
...x !== void 0 && { onDestroy: x },
|
|
41
|
+
...e !== void 0 && { onSelectionUpdate: e },
|
|
42
|
+
...j !== void 0 && { onFocus: j },
|
|
43
|
+
...E !== void 0 && { onBlur: E }
|
|
41
44
|
});
|
|
42
|
-
return
|
|
43
|
-
|
|
45
|
+
return A(
|
|
46
|
+
N,
|
|
44
47
|
() => ({
|
|
45
48
|
editor: i
|
|
46
49
|
}),
|
|
47
50
|
[i]
|
|
48
|
-
), /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
s && i &&
|
|
51
|
-
|
|
52
|
-
|
|
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
58
|
] });
|
|
54
59
|
}
|
|
55
60
|
export {
|
|
56
|
-
|
|
61
|
+
T as Vizel
|
|
57
62
|
};
|
package/dist/index14.js
CHANGED
|
@@ -1,91 +1,95 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { useState as a } from "react";
|
|
3
|
-
import { useVizelState as
|
|
4
|
-
import { VizelBubbleMenuButton as
|
|
5
|
-
import { VizelBubbleMenuColorPicker as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { useVizelState as h } from "./index40.js";
|
|
4
|
+
import { VizelBubbleMenuButton as l } from "./index12.js";
|
|
5
|
+
import { VizelBubbleMenuColorPicker as r } from "./index13.js";
|
|
6
|
+
import { VizelBubbleMenuDivider as n } from "./index15.js";
|
|
7
|
+
import { VizelIcon as t } from "./index20.js";
|
|
8
|
+
import { VizelLinkEditor as f } from "./index22.js";
|
|
8
9
|
import { VizelNodeSelector as k } from "./index23.js";
|
|
9
|
-
function
|
|
10
|
-
editor:
|
|
11
|
-
className:
|
|
12
|
-
enableEmbed:
|
|
10
|
+
function V({
|
|
11
|
+
editor: e,
|
|
12
|
+
className: s,
|
|
13
|
+
enableEmbed: o
|
|
13
14
|
}) {
|
|
14
|
-
|
|
15
|
-
const [
|
|
16
|
-
return
|
|
17
|
-
|
|
15
|
+
h(() => e);
|
|
16
|
+
const [u, c] = a(!1);
|
|
17
|
+
return u ? /* @__PURE__ */ i(
|
|
18
|
+
f,
|
|
18
19
|
{
|
|
19
|
-
editor:
|
|
20
|
+
editor: e,
|
|
20
21
|
onClose: () => c(!1),
|
|
21
|
-
...
|
|
22
|
+
...o ? { enableEmbed: o } : {}
|
|
22
23
|
}
|
|
23
|
-
) : /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
24
|
+
) : /* @__PURE__ */ m("div", { className: `vizel-bubble-menu-toolbar ${s ?? ""}`, children: [
|
|
25
|
+
/* @__PURE__ */ i(k, { editor: e }),
|
|
26
|
+
/* @__PURE__ */ i(n, {}),
|
|
27
|
+
/* @__PURE__ */ i(
|
|
28
|
+
l,
|
|
27
29
|
{
|
|
28
30
|
action: "bold",
|
|
29
|
-
onClick: () =>
|
|
30
|
-
isActive:
|
|
31
|
+
onClick: () => e.chain().focus().toggleBold().run(),
|
|
32
|
+
isActive: e.isActive("bold"),
|
|
31
33
|
title: "Bold (Cmd+B)",
|
|
32
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ i(t, { name: "bold" })
|
|
33
35
|
}
|
|
34
36
|
),
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
37
|
+
/* @__PURE__ */ i(
|
|
38
|
+
l,
|
|
37
39
|
{
|
|
38
40
|
action: "italic",
|
|
39
|
-
onClick: () =>
|
|
40
|
-
isActive:
|
|
41
|
+
onClick: () => e.chain().focus().toggleItalic().run(),
|
|
42
|
+
isActive: e.isActive("italic"),
|
|
41
43
|
title: "Italic (Cmd+I)",
|
|
42
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ i(t, { name: "italic" })
|
|
43
45
|
}
|
|
44
46
|
),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
47
|
+
/* @__PURE__ */ i(
|
|
48
|
+
l,
|
|
47
49
|
{
|
|
48
50
|
action: "strike",
|
|
49
|
-
onClick: () =>
|
|
50
|
-
isActive:
|
|
51
|
+
onClick: () => e.chain().focus().toggleStrike().run(),
|
|
52
|
+
isActive: e.isActive("strike"),
|
|
51
53
|
title: "Strikethrough",
|
|
52
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ i(t, { name: "strikethrough" })
|
|
53
55
|
}
|
|
54
56
|
),
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
|
|
57
|
+
/* @__PURE__ */ i(
|
|
58
|
+
l,
|
|
57
59
|
{
|
|
58
60
|
action: "underline",
|
|
59
|
-
onClick: () =>
|
|
60
|
-
isActive:
|
|
61
|
+
onClick: () => e.chain().focus().toggleUnderline().run(),
|
|
62
|
+
isActive: e.isActive("underline"),
|
|
61
63
|
title: "Underline (Cmd+U)",
|
|
62
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ i(t, { name: "underline" })
|
|
63
65
|
}
|
|
64
66
|
),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
67
|
+
/* @__PURE__ */ i(
|
|
68
|
+
l,
|
|
67
69
|
{
|
|
68
70
|
action: "code",
|
|
69
|
-
onClick: () =>
|
|
70
|
-
isActive:
|
|
71
|
+
onClick: () => e.chain().focus().toggleCode().run(),
|
|
72
|
+
isActive: e.isActive("code"),
|
|
71
73
|
title: "Code (Cmd+E)",
|
|
72
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ i(t, { name: "code" })
|
|
73
75
|
}
|
|
74
76
|
),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
+
/* @__PURE__ */ i(n, {}),
|
|
78
|
+
/* @__PURE__ */ i(
|
|
79
|
+
l,
|
|
77
80
|
{
|
|
78
81
|
action: "link",
|
|
79
82
|
onClick: () => c(!0),
|
|
80
|
-
isActive:
|
|
83
|
+
isActive: e.isActive("link"),
|
|
81
84
|
title: "Link (Cmd+K)",
|
|
82
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ i(t, { name: "link" })
|
|
83
86
|
}
|
|
84
87
|
),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ i(n, {}),
|
|
89
|
+
/* @__PURE__ */ i(r, { editor: e, type: "textColor" }),
|
|
90
|
+
/* @__PURE__ */ i(r, { editor: e, type: "highlight" })
|
|
87
91
|
] });
|
|
88
92
|
}
|
|
89
93
|
export {
|
|
90
|
-
|
|
94
|
+
V as VizelBubbleMenuDefault
|
|
91
95
|
};
|
package/dist/index2.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Mark as a, markPasteRule as r, markInputRule as s, mergeAttributes as o } from "@tiptap/core";
|
|
2
|
-
import { createElement as n } from "./
|
|
2
|
+
import { createElement as n } from "./index41.js";
|
|
3
3
|
var d = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, i = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, l = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, u = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g;
|
|
4
4
|
a.create({
|
|
5
5
|
name: "bold",
|
package/dist/index23.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as p, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { getVizelActiveNodeType as x, vizelDefaultNodeTypes as E } from "@vizel/core";
|
|
3
3
|
import { useState as z, useRef as N, useEffect as w } from "react";
|
|
4
|
-
import { useVizelState as y } from "./
|
|
4
|
+
import { useVizelState as y } from "./index40.js";
|
|
5
5
|
import { VizelIcon as s } from "./index20.js";
|
|
6
6
|
function $({
|
|
7
7
|
editor: c,
|
package/dist/index31.js
CHANGED
|
@@ -1,36 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
items: o,
|
|
13
|
-
command: r,
|
|
14
|
-
...l.className !== void 0 && { className: l.className },
|
|
15
|
-
ref: i
|
|
16
|
-
})
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
return {
|
|
20
|
-
onStart: (e) => {
|
|
21
|
-
o = e.items, r = e.command, n = m(), t = s.createRoot(n.menuContainer), a(), n.updatePosition(e.clientRect);
|
|
22
|
-
},
|
|
23
|
-
onUpdate: (e) => {
|
|
24
|
-
o = e.items, r = e.command, a(), n?.updatePosition(e.clientRect);
|
|
25
|
-
},
|
|
26
|
-
onKeyDown: (e) => u(e.event) ? !0 : i.current?.onKeyDown(e) ?? !1,
|
|
27
|
-
onExit: () => {
|
|
28
|
-
t?.unmount(), n?.destroy(), t = null, n = null;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
};
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useVizelContextSafe as n } from "./index17.js";
|
|
3
|
+
import { VizelToolbarDefault as m } from "./index33.js";
|
|
4
|
+
function s({
|
|
5
|
+
editor: t,
|
|
6
|
+
className: e,
|
|
7
|
+
showDefaultToolbar: l = !0,
|
|
8
|
+
children: i
|
|
9
|
+
}) {
|
|
10
|
+
const a = n(), o = t ?? a?.editor ?? null;
|
|
11
|
+
return o ? /* @__PURE__ */ r("div", { className: `vizel-toolbar ${e ?? ""}`, role: "toolbar", "aria-label": "Formatting", children: i ?? (l && /* @__PURE__ */ r(m, { editor: o })) }) : null;
|
|
33
12
|
}
|
|
34
13
|
export {
|
|
35
|
-
|
|
14
|
+
s as VizelToolbar
|
|
36
15
|
};
|
package/dist/index32.js
CHANGED
|
@@ -1,53 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
onSave: (e) => r.current.onSave?.(e),
|
|
25
|
-
onError: (e) => r.current.onError?.(e),
|
|
26
|
-
onRestore: (e) => r.current.onRestore?.(e)
|
|
27
|
-
},
|
|
28
|
-
S
|
|
29
|
-
),
|
|
30
|
-
[n, d, l, v, S]
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
function u({
|
|
3
|
+
onClick: a,
|
|
4
|
+
isActive: t = !1,
|
|
5
|
+
disabled: o = !1,
|
|
6
|
+
children: e,
|
|
7
|
+
title: r,
|
|
8
|
+
className: n,
|
|
9
|
+
action: l
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ i(
|
|
12
|
+
"button",
|
|
13
|
+
{
|
|
14
|
+
type: "button",
|
|
15
|
+
onClick: a,
|
|
16
|
+
disabled: o,
|
|
17
|
+
"aria-pressed": t,
|
|
18
|
+
className: `vizel-toolbar-button ${t ? "is-active" : ""} ${n ?? ""}`,
|
|
19
|
+
title: r,
|
|
20
|
+
"data-active": t || void 0,
|
|
21
|
+
"data-action": l,
|
|
22
|
+
children: e
|
|
23
|
+
}
|
|
31
24
|
);
|
|
32
|
-
R(() => {
|
|
33
|
-
const e = s();
|
|
34
|
-
if (e && n)
|
|
35
|
-
return e.on("update", a.handleUpdate), () => {
|
|
36
|
-
e.off("update", a.handleUpdate), a.cancel();
|
|
37
|
-
};
|
|
38
|
-
}, [s, n, a]);
|
|
39
|
-
const U = u(async () => {
|
|
40
|
-
await a.saveNow();
|
|
41
|
-
}, [a]), g = u(async () => await a.restore(), [a]);
|
|
42
|
-
return {
|
|
43
|
-
status: o.status,
|
|
44
|
-
hasUnsavedChanges: o.hasUnsavedChanges,
|
|
45
|
-
lastSaved: o.lastSaved,
|
|
46
|
-
error: o.error,
|
|
47
|
-
save: U,
|
|
48
|
-
restore: g
|
|
49
|
-
};
|
|
50
25
|
}
|
|
51
26
|
export {
|
|
52
|
-
|
|
27
|
+
u as VizelToolbarButton
|
|
53
28
|
};
|