eddyter 1.4.15 → 1.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AIChatPlugin-2pIKhzIw.js +871 -0
- package/dist/{CommentBubblePlugin-VCZgBJUi.js → CommentBubblePlugin-J3r4kNGK.js} +1 -1
- package/dist/CommentPlugin-BbuE8_Aj.js +154 -0
- package/dist/LazyCodeMirror-DdCIk-83.js +21374 -0
- package/dist/{LazySignatureCanvas-RMigH9yY.js → LazySignatureCanvas-D1t8oQDK.js} +1 -1
- package/dist/NotePanelPlugin-C16G36Jd.js +31 -0
- package/dist/TextEnhancePlugin-BShY1r5J.js +198 -0
- package/dist/assets/style.css +1 -1
- package/dist/components/AiPlugin/commands.d.ts +4 -0
- package/dist/components/AiPlugin/index.d.ts +0 -4
- package/dist/components/NotePanelView/NotePanelView.d.ts +2 -1
- package/dist/{generateDocxThumbnail-fv5LNJIq.js → generateDocxThumbnail-Ve0zlObJ.js} +1 -1
- package/dist/{generatePdfThumbnail-C0rDYo5e.js → generatePdfThumbnail-EuSjdwzm.js} +1 -1
- package/dist/{generateXlsxThumbnail-C_vobxPD.js → generateXlsxThumbnail-C10kl6qh.js} +1 -1
- package/dist/{html2pdf.bundle.min-CFWvTTWI.js → html2pdf.bundle.min-BQaO0VTp.js} +1 -1
- package/dist/{index-MXcGtHZr.js → index-B8zPtmsK.js} +20 -20
- package/dist/{index-DKRhyxUF.js → index-BSgLtgyt.js} +26 -26
- package/dist/{index-o_C9Vw0n.js → index-ClsuXAKJ.js} +1 -1
- package/dist/index-CoLO4gm_.js +719 -0
- package/dist/{index-D5W6pnOr.js → index-CxOOJD40.js} +16224 -19078
- package/dist/index-D25uusM-.js +1430 -0
- package/dist/{index-Dhc1wcFH.js → index-gPq4n7_a.js} +34 -33
- package/dist/index.js +3 -3
- package/dist/marked.esm-Tjr8Gfse.js +1114 -0
- package/dist/nodes/NotePanelNode.d.ts +7 -2
- package/dist/plugins/AIChatPlugin.commands.d.ts +7 -0
- package/dist/plugins/AIChatPlugin.d.ts +0 -7
- package/dist/plugins/CommentPlugin.commands.d.ts +5 -0
- package/dist/plugins/CommentPlugin.d.ts +0 -5
- package/dist/plugins/NotePanelPlugin.commands.d.ts +6 -0
- package/dist/plugins/NotePanelPlugin.d.ts +0 -6
- package/dist/plugins/TextEnhancePlugin.commands.d.ts +1 -0
- package/dist/plugins/TextEnhancePlugin.d.ts +0 -1
- package/dist/square-DrMKkLmP.js +7 -0
- package/dist/useVoiceToText-DCddJzYF.js +153 -0
- package/dist/utils/notePanelExport.d.ts +11 -0
- package/dist/utils/notePanelPaste.d.ts +7 -0
- package/package.json +5 -2
- package/dist/LazyCodeMirror-C1bW4mVF.js +0 -44822
- package/dist/index-Ct2Ouofi.js +0 -1613
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as j } from "react/jsx-runtime";
|
|
2
2
|
import A, { Component as q, forwardRef as I } from "react";
|
|
3
3
|
import { _ as V, a as $ } from "./objectWithoutPropertiesLoose-DiWPeE4c.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ao as N } from "./index-CxOOJD40.js";
|
|
5
5
|
function H(e, n) {
|
|
6
6
|
if (e == null) return {};
|
|
7
7
|
var r, t, o = V(e, n);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useLexicalComposerContext as a } from "@lexical/react/LexicalComposerContext";
|
|
2
|
+
import { $insertNodes as s, COMMAND_PRIORITY_EDITOR as i } from "lexical";
|
|
3
|
+
import { useEffect as l } from "react";
|
|
4
|
+
import { aj as N, ak as u, al as d } from "./index-CxOOJD40.js";
|
|
5
|
+
function p() {
|
|
6
|
+
const [e] = a();
|
|
7
|
+
return l(() => {
|
|
8
|
+
if (!e.hasNode(N))
|
|
9
|
+
throw console.error("NotePanelPlugin: NotePanelNode not registered on editor"), new Error(
|
|
10
|
+
"NotePanelPlugin: NotePanelNode not registered on editor"
|
|
11
|
+
);
|
|
12
|
+
return e.registerCommand(
|
|
13
|
+
u,
|
|
14
|
+
(o) => {
|
|
15
|
+
try {
|
|
16
|
+
e.update(() => {
|
|
17
|
+
const { type: r, title: t = "" } = o, n = d({ type: r, title: t });
|
|
18
|
+
s([n]);
|
|
19
|
+
});
|
|
20
|
+
} catch (r) {
|
|
21
|
+
return console.error("Error inserting note panel:", r), !1;
|
|
22
|
+
}
|
|
23
|
+
return !0;
|
|
24
|
+
},
|
|
25
|
+
i
|
|
26
|
+
);
|
|
27
|
+
}, [e]), null;
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
p as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { useLexicalComposerContext as R } from "@lexical/react/LexicalComposerContext";
|
|
3
|
+
import { COMMAND_PRIORITY_LOW as O, $getSelection as C, $isRangeSelection as w } from "lexical";
|
|
4
|
+
import { forwardRef as M, useState as l, useImperativeHandle as P, useRef as D, useEffect as H } from "react";
|
|
5
|
+
import { c as L, D as _, a as z, b as j, d as W, S as b, e as B, am as K, g as $, B as E, an as q, t as d, p as F } from "./index-CxOOJD40.js";
|
|
6
|
+
const U = L("ArrowRight", [
|
|
7
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
8
|
+
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
9
|
+
]), I = M(({ onEnhance: f }, s) => {
|
|
10
|
+
const [h, r] = l(!1), [m, u] = l(""), [c, n] = l(""), [i, e] = l(""), [p, v] = l(!1), [g, y] = l(!1), [k, N] = l(null);
|
|
11
|
+
P(s, () => ({
|
|
12
|
+
openDialog: (a, A) => {
|
|
13
|
+
u(a), n(""), e(""), y(!1), N(() => A), r(!0);
|
|
14
|
+
},
|
|
15
|
+
closeDialog: () => {
|
|
16
|
+
r(!1), setTimeout(() => {
|
|
17
|
+
u(""), n(""), e(""), y(!1), N(null);
|
|
18
|
+
}, 300);
|
|
19
|
+
}
|
|
20
|
+
}));
|
|
21
|
+
const x = () => {
|
|
22
|
+
r(!1), setTimeout(() => {
|
|
23
|
+
u(""), n(""), e(""), y(!1), N(null);
|
|
24
|
+
}, 300);
|
|
25
|
+
}, T = async () => {
|
|
26
|
+
if (c.trim()) {
|
|
27
|
+
v(!0);
|
|
28
|
+
try {
|
|
29
|
+
await f(m, c), x();
|
|
30
|
+
} catch (a) {
|
|
31
|
+
console.error("Enhancement error:", a);
|
|
32
|
+
} finally {
|
|
33
|
+
v(!1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}, S = () => {
|
|
37
|
+
k && i && k(i), x();
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ t(_, { open: h, onOpenChange: x, children: /* @__PURE__ */ o(z, { className: "sm:cteditor-max-w-[500px] cteditor-max-h-[650px]", children: [
|
|
40
|
+
/* @__PURE__ */ o(j, { children: [
|
|
41
|
+
/* @__PURE__ */ o(W, { className: "cteditor-flex cteditor-items-center cteditor-gap-2", children: [
|
|
42
|
+
/* @__PURE__ */ t(b, { className: "cteditor-size-5" }),
|
|
43
|
+
"Enhance Text"
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ t(B, { children: "Enhance your selected text with AI assistance." })
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ o("div", { className: "cteditor-space-y-4 cteditor-overflow-y-auto cteditor-max-h-[400px] cteditor-pr-2", children: [
|
|
48
|
+
/* @__PURE__ */ o("div", { className: "cteditor-space-y-1.5", children: [
|
|
49
|
+
/* @__PURE__ */ t("label", { className: "cteditor-text-xs cteditor-font-medium cteditor-text-foreground", children: "Selected Text" }),
|
|
50
|
+
/* @__PURE__ */ t("div", { className: "cteditor-p-3 cteditor-bg-accent/50 cteditor-rounded-lg cteditor-border cteditor-border-border cteditor-max-h-24 cteditor-overflow-y-auto", children: /* @__PURE__ */ t("p", { className: "cteditor-text-sm cteditor-text-foreground cteditor-leading-relaxed", children: m }) })
|
|
51
|
+
] }),
|
|
52
|
+
!g && /* @__PURE__ */ o("div", { className: "cteditor-space-y-1.5", children: [
|
|
53
|
+
/* @__PURE__ */ t("label", { className: "cteditor-text-xs cteditor-font-medium cteditor-text-foreground", children: "How to enhance?" }),
|
|
54
|
+
/* @__PURE__ */ t(
|
|
55
|
+
"textarea",
|
|
56
|
+
{
|
|
57
|
+
value: c,
|
|
58
|
+
onChange: (a) => n(a.target.value),
|
|
59
|
+
placeholder: "E.g., Make it professional, Add details, Simplify...",
|
|
60
|
+
className: "cteditor-w-full cteditor-h-20 cteditor-p-3 cteditor-bg-background cteditor-rounded-lg cteditor-border cteditor-border-border focus:cteditor-border-foreground cteditor-outline-none cteditor-text-sm cteditor-text-foreground cteditor-placeholder-muted-foreground cteditor-resize-none",
|
|
61
|
+
disabled: p,
|
|
62
|
+
onKeyDown: (a) => {
|
|
63
|
+
a.key === "Enter" && (a.ctrlKey || a.metaKey) && T();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ t("p", { className: "cteditor-text-xs cteditor-text-muted-foreground", children: "Ctrl+Enter to enhance" })
|
|
68
|
+
] }),
|
|
69
|
+
p && /* @__PURE__ */ o("div", { className: "cteditor-flex cteditor-flex-col cteditor-items-center cteditor-justify-center cteditor-py-0 cteditor-space-y-3", children: [
|
|
70
|
+
/* @__PURE__ */ o("div", { className: "cteditor-relative cteditor-w-14 cteditor-h-14", children: [
|
|
71
|
+
/* @__PURE__ */ t(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: "cteditor-absolute cteditor-inset-0 cteditor-rounded-full cteditor-opacity-75",
|
|
75
|
+
style: {
|
|
76
|
+
background: "linear-gradient(to right, #a855f7, #ec4899, #a855f7)",
|
|
77
|
+
animation: "spin 2s linear infinite",
|
|
78
|
+
padding: "2px",
|
|
79
|
+
WebkitMask: "linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)",
|
|
80
|
+
WebkitMaskComposite: "xor",
|
|
81
|
+
maskComposite: "exclude"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ t("div", { className: "cteditor-absolute cteditor-inset-0 cteditor-rounded-full cteditor-bg-background cteditor-flex cteditor-items-center cteditor-justify-center cteditor-m-[2px]", children: /* @__PURE__ */ t(b, { className: "cteditor-w-6 cteditor-h-6 cteditor-text-purple-500 cteditor-animate-pulse" }) })
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ t("div", { className: "cteditor-text-center", children: /* @__PURE__ */ t("p", { className: "cteditor-text-sm cteditor-font-medium cteditor-text-foreground", children: "Enhancing text..." }) })
|
|
88
|
+
] }),
|
|
89
|
+
g && !p && /* @__PURE__ */ o("div", { className: "cteditor-space-y-1.5 cteditor-animate-in cteditor-fade-in cteditor-slide-in-from-bottom-4", children: [
|
|
90
|
+
/* @__PURE__ */ o("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-1.5", children: [
|
|
91
|
+
/* @__PURE__ */ t(K, { className: "cteditor-w-3.5 cteditor-h-3.5 cteditor-text-green-500" }),
|
|
92
|
+
/* @__PURE__ */ t("label", { className: "cteditor-text-xs cteditor-font-medium cteditor-text-foreground", children: "Enhanced Text" })
|
|
93
|
+
] }),
|
|
94
|
+
/* @__PURE__ */ t("div", { className: "cteditor-p-3 cteditor-bg-gradient-to-br cteditor-from-purple-500/5 cteditor-to-pink-500/5 cteditor-rounded-lg cteditor-border cteditor-border-purple-500/20 cteditor-max-h-48 cteditor-overflow-y-auto", children: /* @__PURE__ */ t("p", { className: "cteditor-text-sm cteditor-text-foreground cteditor-leading-relaxed", children: i }) })
|
|
95
|
+
] })
|
|
96
|
+
] }),
|
|
97
|
+
/* @__PURE__ */ o($, { children: [
|
|
98
|
+
/* @__PURE__ */ t(E, { variant: "outline", onClick: x, children: "Cancel" }),
|
|
99
|
+
!g && /* @__PURE__ */ o(
|
|
100
|
+
E,
|
|
101
|
+
{
|
|
102
|
+
onClick: T,
|
|
103
|
+
disabled: !c.trim() || p,
|
|
104
|
+
className: "cteditor-gap-2",
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ t(b, { className: "cteditor-size-5" }),
|
|
107
|
+
"Enhance"
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
g && /* @__PURE__ */ o(E, { onClick: S, className: "cteditor-gap-2", children: [
|
|
112
|
+
"Insert",
|
|
113
|
+
/* @__PURE__ */ t(U, { className: "cteditor-size-5" })
|
|
114
|
+
] })
|
|
115
|
+
] })
|
|
116
|
+
] }) });
|
|
117
|
+
});
|
|
118
|
+
I.displayName = "TextEnhanceDialog";
|
|
119
|
+
const V = ({ apiKey: f }) => {
|
|
120
|
+
const [s] = R(), h = D(null), r = D(void 0), m = async (c, n) => {
|
|
121
|
+
let i = null;
|
|
122
|
+
s.getEditorState().read(() => {
|
|
123
|
+
const e = C();
|
|
124
|
+
w(e) && (i = {
|
|
125
|
+
anchor: {
|
|
126
|
+
key: e.anchor.key,
|
|
127
|
+
offset: e.anchor.offset,
|
|
128
|
+
type: e.anchor.type
|
|
129
|
+
},
|
|
130
|
+
focus: {
|
|
131
|
+
key: e.focus.key,
|
|
132
|
+
offset: e.focus.offset,
|
|
133
|
+
type: e.focus.type
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
try {
|
|
138
|
+
await F({
|
|
139
|
+
editor: s,
|
|
140
|
+
selectedText: c,
|
|
141
|
+
transformationType: "ENHANCE_WITH_AI",
|
|
142
|
+
apiKey: f,
|
|
143
|
+
savedSelection: i,
|
|
144
|
+
secondaryPrompt: n,
|
|
145
|
+
// User's instruction
|
|
146
|
+
onLoadingChange: (e) => {
|
|
147
|
+
if (e) {
|
|
148
|
+
if (r.current) return;
|
|
149
|
+
r.current = d.loading("Enhancing your text...", {
|
|
150
|
+
description: "This may take a few seconds. Please wait.",
|
|
151
|
+
duration: 1 / 0
|
|
152
|
+
});
|
|
153
|
+
} else
|
|
154
|
+
r.current && (d.dismiss(r.current), r.current = void 0);
|
|
155
|
+
},
|
|
156
|
+
onSuccess: (e) => {
|
|
157
|
+
r.current && (d.dismiss(r.current), r.current = void 0), d.success("Text enhanced successfully!");
|
|
158
|
+
},
|
|
159
|
+
onError: (e) => {
|
|
160
|
+
r.current && (d.dismiss(r.current), r.current = void 0), d.error("Enhancement failed", {
|
|
161
|
+
description: e
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
} catch (e) {
|
|
166
|
+
r.current && (d.dismiss(r.current), r.current = void 0), console.error("Error enhancing text:", e), d.error("Enhancement failed", {
|
|
167
|
+
description: e instanceof Error ? e.message : "An error occurred"
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}, u = (c) => (s.getEditorState().read(() => {
|
|
171
|
+
const n = C();
|
|
172
|
+
if (!w(n)) return;
|
|
173
|
+
const i = c || n.getTextContent().trim();
|
|
174
|
+
if (!i) {
|
|
175
|
+
d.error("No text selected", {
|
|
176
|
+
description: "Please select some text to enhance"
|
|
177
|
+
});
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
h.current?.openDialog(i, async (e) => {
|
|
181
|
+
await m(i, e);
|
|
182
|
+
});
|
|
183
|
+
}), !0);
|
|
184
|
+
return H(() => s.registerCommand(
|
|
185
|
+
q,
|
|
186
|
+
(c) => (u(c), !0),
|
|
187
|
+
O
|
|
188
|
+
), [s, f]), /* @__PURE__ */ t(
|
|
189
|
+
I,
|
|
190
|
+
{
|
|
191
|
+
ref: h,
|
|
192
|
+
onEnhance: m
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
export {
|
|
197
|
+
V as default
|
|
198
|
+
};
|