eddyter 1.4.16 → 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-DZQW1ibY.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-FKl1mD-T.js → LazySignatureCanvas-D1t8oQDK.js} +1 -1
- package/dist/NotePanelPlugin-C16G36Jd.js +31 -0
- package/dist/TextEnhancePlugin-BShY1r5J.js +198 -0
- package/dist/components/AiPlugin/commands.d.ts +4 -0
- package/dist/components/AiPlugin/index.d.ts +0 -4
- package/dist/{generateDocxThumbnail-DJlPLsdY.js → generateDocxThumbnail-Ve0zlObJ.js} +1 -1
- package/dist/{generatePdfThumbnail-CfDAh39b.js → generatePdfThumbnail-EuSjdwzm.js} +1 -1
- package/dist/{generateXlsxThumbnail-cRIT4Jyf.js → generateXlsxThumbnail-C10kl6qh.js} +1 -1
- package/dist/{html2pdf.bundle.min-BW3dolOS.js → html2pdf.bundle.min-BQaO0VTp.js} +1 -1
- package/dist/{index-W6_ogglw.js → index-B8zPtmsK.js} +24 -24
- package/dist/{index-gjz4wieB.js → index-BSgLtgyt.js} +36 -36
- package/dist/{index-BydXFu_2.js → index-ClsuXAKJ.js} +1 -1
- package/dist/index-CoLO4gm_.js +719 -0
- package/dist/{index-BDDjWwK4.js → index-CxOOJD40.js} +14869 -18049
- package/dist/{index-BmfQcIrc.js → index-D25uusM-.js} +127 -126
- package/dist/{index-BEepnYCf.js → index-gPq4n7_a.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/marked.esm-Tjr8Gfse.js +1114 -0
- 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/package.json +5 -2
- package/dist/LazyCodeMirror-C1bW4mVF.js +0 -44822
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LexicalCommand } from '../../node_modules/lexical';
|
|
2
|
+
import { AIProvider } from '../api/ai/aiAgentService';
|
|
3
|
+
export declare const TOGGLE_AI_CHAT_COMMAND: LexicalCommand<string | undefined>;
|
|
4
|
+
export declare const SHOW_INLINE_AI_PROMPT_COMMAND: LexicalCommand<{
|
|
5
|
+
provider?: AIProvider;
|
|
6
|
+
initialText?: string;
|
|
7
|
+
} | undefined>;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import { AIProvider } from '../api/ai/aiAgentService';
|
|
2
|
-
import { LexicalCommand } from '../../node_modules/lexical';
|
|
3
|
-
export declare const TOGGLE_AI_CHAT_COMMAND: LexicalCommand<string | undefined>;
|
|
4
|
-
export declare const SHOW_INLINE_AI_PROMPT_COMMAND: LexicalCommand<{
|
|
5
|
-
provider?: AIProvider;
|
|
6
|
-
initialText?: string;
|
|
7
|
-
} | undefined>;
|
|
8
1
|
export default function AIChatPlugin({ apiKey, }: {
|
|
9
2
|
apiKey?: string;
|
|
10
3
|
}): JSX.Element | null;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { LexicalCommand } from '../../node_modules/lexical';
|
|
2
1
|
import { default as React } from 'react';
|
|
3
|
-
export declare const INSERT_COMMENT_COMMAND: LexicalCommand<{
|
|
4
|
-
text: string;
|
|
5
|
-
}>;
|
|
6
|
-
export declare const OPEN_COMMENT_MODAL_COMMAND: LexicalCommand<unknown>;
|
|
7
2
|
declare const CommentPlugin: React.FC;
|
|
8
3
|
export default CommentPlugin;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NotePanelType } from '../nodes/NotePanelNode';
|
|
2
|
+
export interface InsertNotePanelPayload {
|
|
3
|
+
type: NotePanelType;
|
|
4
|
+
title?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const INSERT_NOTE_PANEL_COMMAND: import('../../node_modules/lexical').LexicalCommand<InsertNotePanelPayload>;
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
import { NotePanelType } from '../nodes/NotePanelNode';
|
|
2
|
-
export interface InsertNotePanelPayload {
|
|
3
|
-
type: NotePanelType;
|
|
4
|
-
title?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const INSERT_NOTE_PANEL_COMMAND: import('../../node_modules/lexical').LexicalCommand<InsertNotePanelPayload>;
|
|
7
1
|
export default function NotePanelPlugin(): JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TEXT_ENHANCE_COMMAND: import('../../node_modules/lexical').LexicalCommand<string | undefined>;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { c as K, _ as Q, a0 as X, t as O, a1 as Y, a2 as ee } from "./index-CxOOJD40.js";
|
|
2
|
+
import { useState as k, useRef as c, useEffect as re, useCallback as b } from "react";
|
|
3
|
+
const se = K("Mic", [
|
|
4
|
+
["path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z", key: "131961" }],
|
|
5
|
+
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
|
|
6
|
+
["line", { x1: "12", x2: "12", y1: "19", y2: "22", key: "x3vr5v" }]
|
|
7
|
+
]), ce = ({ onTranscriptUpdate: P, onSessionEnd: W, apiKey: C }) => {
|
|
8
|
+
const [u, x] = k(!1), [l, M] = k(!1), [z, D] = k(!1), [G, m] = k(null), [J, T] = k(!1), [R, N] = k(0), A = c(null), w = c(null), o = c(null), h = c(null), _ = c(-1), f = c(""), S = c(""), B = c(!1), a = c(null), g = c(0), I = c(0);
|
|
9
|
+
re(() => {
|
|
10
|
+
if (u && !l)
|
|
11
|
+
return g.current === 0 && (g.current = Date.now() - I.current), a.current = setInterval(() => {
|
|
12
|
+
const e = Math.floor((Date.now() - g.current) / 1e3);
|
|
13
|
+
N(e);
|
|
14
|
+
}, 1e3), () => {
|
|
15
|
+
a.current && (clearInterval(a.current), a.current = null);
|
|
16
|
+
};
|
|
17
|
+
l && (a.current && (clearInterval(a.current), a.current = null), I.current = R * 1e3);
|
|
18
|
+
}, [u, l, R]);
|
|
19
|
+
const V = b(async () => {
|
|
20
|
+
try {
|
|
21
|
+
m(null), D(!0), f.current = "", S.current = "", N(0), g.current = 0, I.current = 0, M(!1);
|
|
22
|
+
const e = await Q(C);
|
|
23
|
+
if (!e.token)
|
|
24
|
+
throw new Error(e.error || "Failed to get token");
|
|
25
|
+
const r = await navigator.mediaDevices.getUserMedia({
|
|
26
|
+
audio: {
|
|
27
|
+
sampleRate: { ideal: 16e3 },
|
|
28
|
+
channelCount: 1,
|
|
29
|
+
echoCancellation: !0,
|
|
30
|
+
noiseSuppression: !0,
|
|
31
|
+
autoGainControl: !0
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
A.current = r;
|
|
35
|
+
const E = `wss://streaming.assemblyai.com/v3/ws?token=${e.token}`, t = new WebSocket(E);
|
|
36
|
+
w.current = t, t.onopen = () => {
|
|
37
|
+
T(!0), D(!1);
|
|
38
|
+
}, t.onmessage = (i) => {
|
|
39
|
+
try {
|
|
40
|
+
const n = JSON.parse(i.data);
|
|
41
|
+
if (n.type === "Turn") {
|
|
42
|
+
if (n.transcript !== void 0) {
|
|
43
|
+
n.turn_order !== _.current && (_.current !== -1 && f.current && (S.current += f.current + " "), _.current = n.turn_order, f.current = ""), f.current = n.transcript;
|
|
44
|
+
const F = S.current + f.current;
|
|
45
|
+
if (P(F), n.end_of_turn) {
|
|
46
|
+
S.current += f.current + " ", f.current = "";
|
|
47
|
+
const v = S.current.trim();
|
|
48
|
+
P(v);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
} else n.type === "error" && m("Transcription error: " + (n.message || ""));
|
|
52
|
+
} catch (n) {
|
|
53
|
+
console.error("WebSocket message error:", n);
|
|
54
|
+
}
|
|
55
|
+
}, t.onerror = () => {
|
|
56
|
+
m("WebSocket connection error"), T(!1);
|
|
57
|
+
}, t.onclose = (i) => {
|
|
58
|
+
T(!1), i.code !== 1e3 && !B.current && m("Connection closed unexpectedly"), B.current = !1;
|
|
59
|
+
};
|
|
60
|
+
const s = new AudioContext({ sampleRate: 16e3 });
|
|
61
|
+
o.current = s;
|
|
62
|
+
const d = s.createMediaStreamSource(r);
|
|
63
|
+
if (s.audioWorklet)
|
|
64
|
+
try {
|
|
65
|
+
await s.audioWorklet.addModule("/pcm-processor.js");
|
|
66
|
+
const i = new window.AudioWorkletNode(
|
|
67
|
+
s,
|
|
68
|
+
"pcm-processor"
|
|
69
|
+
);
|
|
70
|
+
h.current = i, i.port.onmessage = (n) => {
|
|
71
|
+
t.readyState === WebSocket.OPEN && t.send(n.data);
|
|
72
|
+
}, d.connect(i);
|
|
73
|
+
} catch {
|
|
74
|
+
U(s, d, t);
|
|
75
|
+
}
|
|
76
|
+
else
|
|
77
|
+
U(s, d, t);
|
|
78
|
+
x(!0);
|
|
79
|
+
} catch (e) {
|
|
80
|
+
if (e instanceof X)
|
|
81
|
+
O.error("API Key Required", {
|
|
82
|
+
description: "Please upload your AssemblyAI key in License Section > Manage API keys > API Keys to configure your keys.",
|
|
83
|
+
duration: 5e3
|
|
84
|
+
}), m(e.message);
|
|
85
|
+
else {
|
|
86
|
+
const r = e && e.message ? e.message : "Unknown error";
|
|
87
|
+
O.error("Voice Recording Error", {
|
|
88
|
+
description: r,
|
|
89
|
+
duration: 5e3
|
|
90
|
+
}), m("Error starting recording: " + r);
|
|
91
|
+
}
|
|
92
|
+
D(!1), x(!1);
|
|
93
|
+
}
|
|
94
|
+
}, [P, C]), U = (e, r, E) => {
|
|
95
|
+
const t = e.createScriptProcessor(1024, 1, 1);
|
|
96
|
+
h.current = t;
|
|
97
|
+
let s = [], d = 0;
|
|
98
|
+
const i = 1600;
|
|
99
|
+
t.onaudioprocess = (n) => {
|
|
100
|
+
if (E.readyState === WebSocket.OPEN) {
|
|
101
|
+
const v = n.inputBuffer.getChannelData(0), L = new Int16Array(v.length);
|
|
102
|
+
for (let p = 0; p < v.length; p++) {
|
|
103
|
+
const y = Math.max(-1, Math.min(1, v[p]));
|
|
104
|
+
L[p] = y < 0 ? y * 32768 : y * 32767;
|
|
105
|
+
}
|
|
106
|
+
if (s.push(L), d += L.length, d >= i) {
|
|
107
|
+
const p = new Int16Array(d);
|
|
108
|
+
let y = 0;
|
|
109
|
+
for (const j of s)
|
|
110
|
+
p.set(j, y), y += j.length;
|
|
111
|
+
E.send(p.buffer), s = [], d = 0;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}, r.connect(t), t.connect(e.destination);
|
|
115
|
+
}, Z = b(() => {
|
|
116
|
+
!u || l || (M(!0), o.current && o.current.state === "running" && o.current.suspend());
|
|
117
|
+
}, [u, l]), $ = b(() => {
|
|
118
|
+
!u || !l || (M(!1), g.current = Date.now() - I.current, o.current && o.current.state === "suspended" && o.current.resume());
|
|
119
|
+
}, [u, l]), q = b(async () => {
|
|
120
|
+
B.current = !0;
|
|
121
|
+
const e = R;
|
|
122
|
+
if (x(!1), M(!1), N(0), g.current = 0, I.current = 0, a.current && (clearInterval(a.current), a.current = null), h.current && (h.current.disconnect(), h.current = null), o.current && (o.current.close(), o.current = null), A.current && (A.current.getTracks().forEach((r) => r.stop()), A.current = null), w.current && (w.current.readyState === WebSocket.OPEN && w.current.close(1e3, "Recording stopped"), w.current = null), T(!1), e > 0)
|
|
123
|
+
try {
|
|
124
|
+
const r = await Y(e, C);
|
|
125
|
+
W && r.credits && W({
|
|
126
|
+
creditsUsed: r.credits.creditsUsed,
|
|
127
|
+
totalCredits: r.credits.totalCredits
|
|
128
|
+
});
|
|
129
|
+
} catch (r) {
|
|
130
|
+
console.error("Failed to end voice session:", r), r instanceof ee && O.error("Credit Error", {
|
|
131
|
+
description: r.message,
|
|
132
|
+
duration: 5e3
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}, [R, W, C]), H = b(() => {
|
|
136
|
+
u ? q() : V();
|
|
137
|
+
}, [u, V, q]);
|
|
138
|
+
return {
|
|
139
|
+
isRecording: u,
|
|
140
|
+
isPaused: l,
|
|
141
|
+
isLoading: z,
|
|
142
|
+
error: G,
|
|
143
|
+
isConnected: J,
|
|
144
|
+
elapsedTime: R,
|
|
145
|
+
toggleRecording: H,
|
|
146
|
+
pauseRecording: Z,
|
|
147
|
+
resumeRecording: $
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
export {
|
|
151
|
+
se as M,
|
|
152
|
+
ce as u
|
|
153
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eddyter",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.17",
|
|
5
5
|
"description": "Plug and Play AI Rich Text Editor for any website, blog, CRM, ERP, or web app. Built on Lexical with AI writing assistance, dark mode, and real-time collaboration.",
|
|
6
6
|
"homepage": "https://www.eddyter.com",
|
|
7
7
|
"repository": {
|
|
@@ -68,6 +68,10 @@
|
|
|
68
68
|
"prepublishOnly": "pnpm build"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
+
"@codemirror/lang-css": "^6.3.1",
|
|
72
|
+
"@codemirror/lang-html": "^6.4.11",
|
|
73
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
74
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
71
75
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
72
76
|
"@lexical/clipboard": "^0.24.0",
|
|
73
77
|
"@lexical/code": "^0.24.0",
|
|
@@ -95,7 +99,6 @@
|
|
|
95
99
|
"@radix-ui/react-tabs": "^1.1.3",
|
|
96
100
|
"@radix-ui/react-tooltip": "^1.1.8",
|
|
97
101
|
"@types/react-signature-canvas": "^1.0.7",
|
|
98
|
-
"@uiw/codemirror-extensions-langs": "^4.25.7",
|
|
99
102
|
"@uiw/react-codemirror": "^4.25.7",
|
|
100
103
|
"axios": "^1.8.1",
|
|
101
104
|
"class-variance-authority": "^0.7.1",
|