@vizel/react 0.0.1-alpha.6 → 1.1.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 +41 -17
- package/dist/index.d.ts +331 -1
- package/dist/index.js +63 -47
- package/dist/index10.js +52 -45
- package/dist/index13.js +1 -1
- package/dist/index14.js +55 -51
- package/dist/index16.js +1 -1
- package/dist/index19.js +1 -1
- package/dist/index2.js +1 -1
- package/dist/index20.js +152 -8
- package/dist/index21.js +8 -10
- package/dist/index22.js +10 -78
- package/dist/index23.js +75 -112
- package/dist/index24.js +112 -32
- package/dist/index25.js +35 -5
- package/dist/index26.js +5 -68
- package/dist/index27.js +65 -88
- package/dist/index28.js +91 -4
- package/dist/index29.js +4 -36
- package/dist/index30.js +34 -51
- package/dist/index31.js +53 -33
- package/dist/index32.js +12 -50
- package/dist/index33.js +25 -29
- package/dist/index34.js +30 -7
- package/dist/index35.js +4 -52
- package/dist/index36.js +32 -10
- package/dist/index37.js +51 -15
- package/dist/index38.js +49 -3
- package/dist/index39.js +71 -20
- package/dist/index40.js +46 -2
- package/dist/index41.js +7 -9741
- package/dist/index42.js +52 -17015
- package/dist/index43.js +12 -2
- package/dist/index44.js +53 -7
- package/dist/index45.js +15 -2
- package/dist/index46.js +3 -2
- package/dist/index47.js +18 -219
- package/dist/index48.js +2 -225
- package/dist/index49.js +9742 -2
- package/dist/index50.js +17016 -2
- package/dist/index51.js +4 -0
- package/dist/index52.js +10 -0
- package/dist/index53.js +4 -0
- package/dist/index54.js +4 -0
- package/dist/index55.js +224 -0
- package/dist/index56.js +227 -0
- package/dist/index57.js +4 -0
- package/dist/index58.js +4 -0
- package/package.json +36 -16
package/dist/index10.js
CHANGED
|
@@ -1,57 +1,64 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useImperativeHandle as
|
|
3
|
-
import { useVizelEditor as
|
|
4
|
-
import { VizelBubbleMenu as
|
|
5
|
-
import { VizelEditor as
|
|
6
|
-
|
|
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({
|
|
7
8
|
ref: e,
|
|
8
|
-
initialContent:
|
|
9
|
-
initialMarkdown:
|
|
10
|
-
transformDiagramsOnImport:
|
|
11
|
-
placeholder:
|
|
12
|
-
editable:
|
|
13
|
-
autofocus:
|
|
14
|
-
features:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
initialContent: m,
|
|
10
|
+
initialMarkdown: o,
|
|
11
|
+
transformDiagramsOnImport: g = !0,
|
|
12
|
+
placeholder: f,
|
|
13
|
+
editable: h = !0,
|
|
14
|
+
autofocus: q = !1,
|
|
15
|
+
features: z,
|
|
16
|
+
extensions: p,
|
|
17
|
+
className: u,
|
|
18
|
+
showToolbar: V = !1,
|
|
19
|
+
toolbarContent: d,
|
|
20
|
+
showBubbleMenu: l = !0,
|
|
21
|
+
enableEmbed: s = !1,
|
|
22
|
+
bubbleMenuContent: v,
|
|
23
|
+
children: A,
|
|
24
|
+
onUpdate: c,
|
|
25
|
+
onCreate: j,
|
|
26
|
+
onDestroy: x,
|
|
27
|
+
onSelectionUpdate: E,
|
|
28
|
+
onFocus: H,
|
|
29
|
+
onBlur: I
|
|
26
30
|
}) {
|
|
27
|
-
const i =
|
|
28
|
-
...
|
|
29
|
-
...
|
|
30
|
-
transformDiagramsOnImport:
|
|
31
|
-
...
|
|
32
|
-
editable:
|
|
33
|
-
autofocus:
|
|
34
|
-
...
|
|
35
|
-
...
|
|
36
|
-
...
|
|
37
|
-
...
|
|
38
|
-
...
|
|
39
|
-
...
|
|
40
|
-
...
|
|
31
|
+
const i = K({
|
|
32
|
+
...m !== void 0 && { initialContent: m },
|
|
33
|
+
...o !== void 0 && { initialMarkdown: o },
|
|
34
|
+
transformDiagramsOnImport: g,
|
|
35
|
+
...f !== void 0 && { placeholder: f },
|
|
36
|
+
editable: h,
|
|
37
|
+
autofocus: q,
|
|
38
|
+
...z !== void 0 && { features: z },
|
|
39
|
+
...p !== void 0 && { extensions: p },
|
|
40
|
+
...c !== void 0 && { onUpdate: c },
|
|
41
|
+
...j !== void 0 && { onCreate: j },
|
|
42
|
+
...x !== void 0 && { onDestroy: x },
|
|
43
|
+
...E !== void 0 && { onSelectionUpdate: E },
|
|
44
|
+
...H !== void 0 && { onFocus: H },
|
|
45
|
+
...I !== void 0 && { onBlur: I }
|
|
41
46
|
});
|
|
42
|
-
return
|
|
47
|
+
return J(
|
|
43
48
|
e,
|
|
44
49
|
() => ({
|
|
45
50
|
editor: i
|
|
46
51
|
}),
|
|
47
52
|
[i]
|
|
48
|
-
), /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
53
60
|
] });
|
|
54
61
|
}
|
|
55
62
|
export {
|
|
56
|
-
|
|
63
|
+
X as Vizel
|
|
57
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 "./
|
|
5
|
+
import { VizelIcon as C } from "./index21.js";
|
|
6
6
|
function A({
|
|
7
7
|
editor: o,
|
|
8
8
|
type: e,
|
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 {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
import { useVizelState as h } from "./index43.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 "./index21.js";
|
|
8
|
+
import { VizelLinkEditor as f } from "./index23.js";
|
|
9
|
+
import { VizelNodeSelector as k } from "./index24.js";
|
|
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/index16.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as z, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { normalizeVizelHexColor as N, isVizelValidHexColor as I } from "@vizel/core";
|
|
3
3
|
import { useState as K, useRef as L, useMemo as $, useEffect as y, useCallback as b } from "react";
|
|
4
|
-
import { VizelIcon as w } from "./
|
|
4
|
+
import { VizelIcon as w } from "./index21.js";
|
|
5
5
|
const S = 4, j = ["transparent", "inherit"];
|
|
6
6
|
function q({
|
|
7
7
|
colors: f,
|
package/dist/index19.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as a, useEffect as v } from "react";
|
|
3
|
-
import { VizelIcon as p } from "./
|
|
3
|
+
import { VizelIcon as p } from "./index21.js";
|
|
4
4
|
const b = (r, e, n) => `vizel-embed ${r ? "is-loading" : ""} ${e ? "ProseMirror-selectednode" : ""} ${n ?? ""}`, h = (r, e) => /* @__PURE__ */ i("div", { className: r, "data-embed-type": "loading", "data-embed-provider": e, children: /* @__PURE__ */ s("div", { className: "vizel-embed-loading", children: [
|
|
5
5
|
/* @__PURE__ */ i("div", { className: "vizel-embed-loading-spinner" }),
|
|
6
6
|
/* @__PURE__ */ i("span", { children: "Loading embed..." })
|
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 "./index45.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/index20.js
CHANGED
|
@@ -1,11 +1,155 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsxs as o, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { getVizelFindReplaceState as D } from "@vizel/core";
|
|
3
|
+
import { useState as d, useRef as I, useEffect as C, useCallback as l } from "react";
|
|
4
|
+
function O({ editor: e, className: N, onClose: h }) {
|
|
5
|
+
const [p, v] = d(""), [s, b] = d(""), [R, z] = d(!1), [t, F] = d(null), r = I(null);
|
|
6
|
+
C(() => {
|
|
7
|
+
if (!e) return;
|
|
8
|
+
const n = () => {
|
|
9
|
+
const c = D(e.state);
|
|
10
|
+
F(c);
|
|
11
|
+
};
|
|
12
|
+
return n(), e.on("transaction", n), () => {
|
|
13
|
+
e.off("transaction", n);
|
|
14
|
+
};
|
|
15
|
+
}, [e]), C(() => {
|
|
16
|
+
t?.isOpen && (r.current?.focus(), r.current?.select());
|
|
17
|
+
}, [t?.isOpen]);
|
|
18
|
+
const y = l(
|
|
19
|
+
(n) => {
|
|
20
|
+
const c = n.target.value;
|
|
21
|
+
v(c), e && e.commands.find(c);
|
|
22
|
+
},
|
|
23
|
+
[e]
|
|
24
|
+
), u = l(() => {
|
|
25
|
+
e?.commands.findNext();
|
|
26
|
+
}, [e]), f = l(() => {
|
|
27
|
+
e?.commands.findPrevious();
|
|
28
|
+
}, [e]), k = l(() => {
|
|
29
|
+
e && (e.commands.replace(s), e.commands.findNext());
|
|
30
|
+
}, [e, s]), g = l(() => {
|
|
31
|
+
e && e.commands.replaceAll(s);
|
|
32
|
+
}, [e, s]), m = l(() => {
|
|
33
|
+
e && (e.commands.clearFind(), e.commands.closeFindReplace()), v(""), b(""), h?.();
|
|
34
|
+
}, [e, h]), S = l(
|
|
35
|
+
(n) => {
|
|
36
|
+
const c = n.target.checked;
|
|
37
|
+
z(c), e?.commands.setFindCaseSensitive(c), p && e?.commands.find(p);
|
|
38
|
+
},
|
|
39
|
+
[e, p]
|
|
40
|
+
), x = l(
|
|
41
|
+
(n) => {
|
|
42
|
+
n.key === "Enter" ? (n.preventDefault(), n.shiftKey ? f() : u()) : n.key === "Escape" && (n.preventDefault(), m());
|
|
43
|
+
},
|
|
44
|
+
[u, f, m]
|
|
45
|
+
);
|
|
46
|
+
if (!t?.isOpen)
|
|
47
|
+
return null;
|
|
48
|
+
const i = t.matches.length, w = t.activeIndex >= 0 ? t.activeIndex + 1 : 0, E = t.mode === "replace";
|
|
49
|
+
return /* @__PURE__ */ o(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: `vizel-find-replace-panel ${N || ""}`,
|
|
53
|
+
role: "dialog",
|
|
54
|
+
"aria-label": "Find and Replace",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ o("div", { className: "vizel-find-replace-row", children: [
|
|
57
|
+
/* @__PURE__ */ a(
|
|
58
|
+
"input",
|
|
59
|
+
{
|
|
60
|
+
ref: r,
|
|
61
|
+
type: "text",
|
|
62
|
+
className: "vizel-find-replace-input",
|
|
63
|
+
placeholder: "Find...",
|
|
64
|
+
value: p,
|
|
65
|
+
onChange: y,
|
|
66
|
+
onKeyDown: x,
|
|
67
|
+
"aria-label": "Find text"
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ a("span", { className: "vizel-find-replace-count", children: i > 0 ? `${w}/${i}` : "No results" }),
|
|
71
|
+
/* @__PURE__ */ a(
|
|
72
|
+
"button",
|
|
73
|
+
{
|
|
74
|
+
type: "button",
|
|
75
|
+
className: "vizel-find-replace-button",
|
|
76
|
+
onClick: f,
|
|
77
|
+
disabled: i === 0,
|
|
78
|
+
"aria-label": "Find previous",
|
|
79
|
+
title: "Find previous (Shift+Enter)",
|
|
80
|
+
children: "↑"
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ a(
|
|
84
|
+
"button",
|
|
85
|
+
{
|
|
86
|
+
type: "button",
|
|
87
|
+
className: "vizel-find-replace-button",
|
|
88
|
+
onClick: u,
|
|
89
|
+
disabled: i === 0,
|
|
90
|
+
"aria-label": "Find next",
|
|
91
|
+
title: "Find next (Enter)",
|
|
92
|
+
children: "↓"
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ a(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
type: "button",
|
|
99
|
+
className: "vizel-find-replace-button",
|
|
100
|
+
onClick: m,
|
|
101
|
+
"aria-label": "Close",
|
|
102
|
+
title: "Close (Escape)",
|
|
103
|
+
children: "✕"
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
] }),
|
|
107
|
+
E && /* @__PURE__ */ o("div", { className: "vizel-find-replace-row", children: [
|
|
108
|
+
/* @__PURE__ */ a(
|
|
109
|
+
"input",
|
|
110
|
+
{
|
|
111
|
+
type: "text",
|
|
112
|
+
className: "vizel-find-replace-input",
|
|
113
|
+
placeholder: "Replace with...",
|
|
114
|
+
value: s,
|
|
115
|
+
onChange: (n) => b(n.target.value),
|
|
116
|
+
onKeyDown: x,
|
|
117
|
+
"aria-label": "Replace text"
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ a(
|
|
121
|
+
"button",
|
|
122
|
+
{
|
|
123
|
+
type: "button",
|
|
124
|
+
className: "vizel-find-replace-button",
|
|
125
|
+
onClick: k,
|
|
126
|
+
disabled: i === 0,
|
|
127
|
+
"aria-label": "Replace",
|
|
128
|
+
title: "Replace current match",
|
|
129
|
+
children: "Replace"
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ a(
|
|
133
|
+
"button",
|
|
134
|
+
{
|
|
135
|
+
type: "button",
|
|
136
|
+
className: "vizel-find-replace-button vizel-find-replace-button--primary",
|
|
137
|
+
onClick: g,
|
|
138
|
+
disabled: i === 0,
|
|
139
|
+
"aria-label": "Replace all",
|
|
140
|
+
title: "Replace all matches",
|
|
141
|
+
children: "All"
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ a("div", { className: "vizel-find-replace-options", children: /* @__PURE__ */ o("label", { className: "vizel-find-replace-checkbox", children: [
|
|
146
|
+
/* @__PURE__ */ a("input", { type: "checkbox", checked: R, onChange: S }),
|
|
147
|
+
"Case sensitive"
|
|
148
|
+
] }) })
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
);
|
|
8
152
|
}
|
|
9
153
|
export {
|
|
10
|
-
|
|
154
|
+
O as VizelFindReplace
|
|
11
155
|
};
|
package/dist/index21.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return c(o);
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as s } from "@iconify/react";
|
|
3
|
+
import { vizelDefaultIconIds as I } from "@vizel/core";
|
|
4
|
+
import { useVizelIconContext as m } from "./index22.js";
|
|
5
|
+
function x({ name: o, customIcons: t, style: n, ...c }) {
|
|
6
|
+
const { customIcons: r } = m(), e = t?.[o] ?? r?.[o] ?? I[o];
|
|
7
|
+
return /* @__PURE__ */ i(s, { icon: e, style: { pointerEvents: "none", ...n }, ...c });
|
|
9
8
|
}
|
|
10
9
|
export {
|
|
11
|
-
|
|
12
|
-
x as useVizelIconContext
|
|
10
|
+
x as VizelIcon
|
|
13
11
|
};
|
package/dist/index22.js
CHANGED
|
@@ -1,81 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
enableEmbed: m = !1
|
|
10
|
-
}) {
|
|
11
|
-
const d = e.getAttributes("link").href || "", [s, z] = h(d), [l, L] = h(!1), u = k(null), f = k(null), o = v(() => m ? e.extensionManager.extensions.some((r) => r.name === "embed") : !1, [e, m]), x = v(() => s.trim() ? R(s.trim()) !== null : !1, [s]);
|
|
12
|
-
b(() => {
|
|
13
|
-
f.current?.focus();
|
|
14
|
-
}, []), b(() => {
|
|
15
|
-
const t = (c) => {
|
|
16
|
-
u.current && !u.current.contains(c.target) && n();
|
|
17
|
-
}, r = (c) => {
|
|
18
|
-
c.key === "Escape" && (c.preventDefault(), c.stopImmediatePropagation(), n());
|
|
19
|
-
}, N = setTimeout(() => {
|
|
20
|
-
document.addEventListener("mousedown", t);
|
|
21
|
-
}, 0);
|
|
22
|
-
return document.addEventListener("keydown", r, !0), () => {
|
|
23
|
-
clearTimeout(N), document.removeEventListener("mousedown", t), document.removeEventListener("keydown", r, !0);
|
|
24
|
-
};
|
|
25
|
-
}, [n]);
|
|
26
|
-
const y = p(
|
|
27
|
-
(t) => {
|
|
28
|
-
t.preventDefault();
|
|
29
|
-
const r = s.trim();
|
|
30
|
-
if (!r) {
|
|
31
|
-
e.chain().focus().unsetLink().run(), n();
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
l && o ? e.chain().focus().unsetLink().setEmbed({ url: r }).run() : e.chain().focus().setLink({ href: r }).run(), n();
|
|
35
|
-
},
|
|
36
|
-
[e, s, l, o, n]
|
|
37
|
-
), w = p(() => {
|
|
38
|
-
e.chain().focus().unsetLink().run(), n();
|
|
39
|
-
}, [e, n]);
|
|
40
|
-
return /* @__PURE__ */ a("form", { ref: u, onSubmit: y, className: `vizel-link-editor ${E ?? ""}`, children: [
|
|
41
|
-
/* @__PURE__ */ a("div", { className: "vizel-link-editor-row", children: [
|
|
42
|
-
/* @__PURE__ */ i(
|
|
43
|
-
"input",
|
|
44
|
-
{
|
|
45
|
-
ref: f,
|
|
46
|
-
type: "url",
|
|
47
|
-
value: s,
|
|
48
|
-
onChange: (t) => z(t.target.value),
|
|
49
|
-
placeholder: "Enter URL...",
|
|
50
|
-
className: "vizel-link-input"
|
|
51
|
-
}
|
|
52
|
-
),
|
|
53
|
-
/* @__PURE__ */ i("button", { type: "submit", className: "vizel-link-button", title: "Apply", children: /* @__PURE__ */ i(g, { name: "check" }) }),
|
|
54
|
-
d && /* @__PURE__ */ i(
|
|
55
|
-
"button",
|
|
56
|
-
{
|
|
57
|
-
type: "button",
|
|
58
|
-
onClick: w,
|
|
59
|
-
className: "vizel-link-button vizel-link-remove",
|
|
60
|
-
title: "Remove link",
|
|
61
|
-
children: /* @__PURE__ */ i(g, { name: "x" })
|
|
62
|
-
}
|
|
63
|
-
)
|
|
64
|
-
] }),
|
|
65
|
-
o && x && /* @__PURE__ */ a("div", { className: "vizel-link-editor-embed-toggle", children: [
|
|
66
|
-
/* @__PURE__ */ i(
|
|
67
|
-
"input",
|
|
68
|
-
{
|
|
69
|
-
type: "checkbox",
|
|
70
|
-
id: "vizel-embed-toggle",
|
|
71
|
-
checked: l,
|
|
72
|
-
onChange: (t) => L(t.target.checked)
|
|
73
|
-
}
|
|
74
|
-
),
|
|
75
|
-
/* @__PURE__ */ i("label", { htmlFor: "vizel-embed-toggle", children: "Embed as rich content" })
|
|
76
|
-
] })
|
|
77
|
-
] });
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as r, useContext as c } from "react";
|
|
3
|
+
const o = r({});
|
|
4
|
+
function s({ icons: t, children: e }) {
|
|
5
|
+
return /* @__PURE__ */ n(o.Provider, { value: { customIcons: t }, children: e });
|
|
6
|
+
}
|
|
7
|
+
function x() {
|
|
8
|
+
return c(o);
|
|
78
9
|
}
|
|
79
10
|
export {
|
|
80
|
-
|
|
11
|
+
s as VizelIconProvider,
|
|
12
|
+
x as useVizelIconContext
|
|
81
13
|
};
|