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.
Files changed (34) hide show
  1. package/dist/AIChatPlugin-2pIKhzIw.js +871 -0
  2. package/dist/{CommentBubblePlugin-DZQW1ibY.js → CommentBubblePlugin-J3r4kNGK.js} +1 -1
  3. package/dist/CommentPlugin-BbuE8_Aj.js +154 -0
  4. package/dist/LazyCodeMirror-DdCIk-83.js +21374 -0
  5. package/dist/{LazySignatureCanvas-FKl1mD-T.js → LazySignatureCanvas-D1t8oQDK.js} +1 -1
  6. package/dist/NotePanelPlugin-C16G36Jd.js +31 -0
  7. package/dist/TextEnhancePlugin-BShY1r5J.js +198 -0
  8. package/dist/components/AiPlugin/commands.d.ts +4 -0
  9. package/dist/components/AiPlugin/index.d.ts +0 -4
  10. package/dist/{generateDocxThumbnail-DJlPLsdY.js → generateDocxThumbnail-Ve0zlObJ.js} +1 -1
  11. package/dist/{generatePdfThumbnail-CfDAh39b.js → generatePdfThumbnail-EuSjdwzm.js} +1 -1
  12. package/dist/{generateXlsxThumbnail-cRIT4Jyf.js → generateXlsxThumbnail-C10kl6qh.js} +1 -1
  13. package/dist/{html2pdf.bundle.min-BW3dolOS.js → html2pdf.bundle.min-BQaO0VTp.js} +1 -1
  14. package/dist/{index-W6_ogglw.js → index-B8zPtmsK.js} +24 -24
  15. package/dist/{index-gjz4wieB.js → index-BSgLtgyt.js} +36 -36
  16. package/dist/{index-BydXFu_2.js → index-ClsuXAKJ.js} +1 -1
  17. package/dist/index-CoLO4gm_.js +719 -0
  18. package/dist/{index-BDDjWwK4.js → index-CxOOJD40.js} +14869 -18049
  19. package/dist/{index-BmfQcIrc.js → index-D25uusM-.js} +127 -126
  20. package/dist/{index-BEepnYCf.js → index-gPq4n7_a.js} +1 -1
  21. package/dist/index.js +3 -3
  22. package/dist/marked.esm-Tjr8Gfse.js +1114 -0
  23. package/dist/plugins/AIChatPlugin.commands.d.ts +7 -0
  24. package/dist/plugins/AIChatPlugin.d.ts +0 -7
  25. package/dist/plugins/CommentPlugin.commands.d.ts +5 -0
  26. package/dist/plugins/CommentPlugin.d.ts +0 -5
  27. package/dist/plugins/NotePanelPlugin.commands.d.ts +6 -0
  28. package/dist/plugins/NotePanelPlugin.d.ts +0 -6
  29. package/dist/plugins/TextEnhancePlugin.commands.d.ts +1 -0
  30. package/dist/plugins/TextEnhancePlugin.d.ts +0 -1
  31. package/dist/square-DrMKkLmP.js +7 -0
  32. package/dist/useVoiceToText-DCddJzYF.js +153 -0
  33. package/package.json +5 -2
  34. package/dist/LazyCodeMirror-C1bW4mVF.js +0 -44822
@@ -1,6 +1,6 @@
1
1
  import { useLexicalComposerContext as a } from "@lexical/react/LexicalComposerContext";
2
2
  import { useRef as y, useEffect as v } from "react";
3
- import { u as b } from "./index-BDDjWwK4.js";
3
+ import { Q as b } from "./index-CxOOJD40.js";
4
4
  const g = () => {
5
5
  const [n] = a(), { getCommentById: o } = b(), t = y(null);
6
6
  return v(() => {
@@ -0,0 +1,154 @@
1
+ import { jsx as t, jsxs as d } from "react/jsx-runtime";
2
+ import { useLexicalComposerContext as w } from "@lexical/react/LexicalComposerContext";
3
+ import { $getSelection as b, $isRangeSelection as D, $isTextNode as A, COMMAND_PRIORITY_LOW as S } from "lexical";
4
+ import { Q as I, R as _, U as $, V as j, D as F, a as K, b as L, d as P, W as U, Y as W, Z as z, J as B, g as H, B as O } from "./index-CxOOJD40.js";
5
+ import { useState as M, useCallback as f, useEffect as N, useRef as V } from "react";
6
+ import { u as Y, M as J } from "./useVoiceToText-DCddJzYF.js";
7
+ const Q = ({
8
+ isOpen: o,
9
+ onClose: n,
10
+ onSubmit: u,
11
+ selectedText: g
12
+ }) => {
13
+ const [c, a] = M(""), {
14
+ isRecording: r,
15
+ error: s,
16
+ toggleRecording: C
17
+ } = Y({
18
+ onTranscriptUpdate: (e) => {
19
+ a(e);
20
+ }
21
+ }), l = f(() => {
22
+ c.trim() && (u(c.trim()), a(""), n());
23
+ }, [c, u, n]), p = f(
24
+ (e) => {
25
+ e.key === "Enter" && (e.metaKey || e.ctrlKey) ? (e.preventDefault(), l()) : e.key === "Escape" && (e.preventDefault(), n());
26
+ },
27
+ [l, n]
28
+ );
29
+ N(() => {
30
+ o && a("");
31
+ }, [o]);
32
+ const m = V(null);
33
+ return N(() => {
34
+ if (!m.current) return;
35
+ const e = m.current;
36
+ e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
37
+ }, [c]), /* @__PURE__ */ t(F, { open: o, onOpenChange: n, children: /* @__PURE__ */ d(K, { className: "sm:cteditor-max-w-xl", children: [
38
+ /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(P, { className: "cteditor-flex cteditor-items-center cteditor-gap-3", children: "Add Comment" }) }),
39
+ /* @__PURE__ */ d("div", { className: "cteditor-space-y-4", children: [
40
+ g && /* @__PURE__ */ t(U, { className: "cteditor-bg-primary/5 cteditor-border-primary/20 cteditor-rounded-md pt-6", children: /* @__PURE__ */ t(W, { className: "md:cteditor-p-2 cteditor-p-2 cteditor-px-4 md:cteditor-pt-3 cteditor-pt-2", children: /* @__PURE__ */ d("div", { className: "cteditor-space-y-1", children: [
41
+ /* @__PURE__ */ t("p", { className: "cteditor-text-sm cteditor-font-medium", children: "Selected text:" }),
42
+ /* @__PURE__ */ d("p", { className: "cteditor-text-sm cteditor-italic cteditor-text-muted-foreground cteditor-leading-relaxed", children: [
43
+ "“",
44
+ g,
45
+ "”"
46
+ ] })
47
+ ] }) }) }),
48
+ /* @__PURE__ */ d("div", { className: "cteditor-space-y-2", children: [
49
+ /* @__PURE__ */ d("div", { className: "cteditor-relative", children: [
50
+ /* @__PURE__ */ t(
51
+ z,
52
+ {
53
+ ref: m,
54
+ value: c,
55
+ onChange: (e) => a(e.target.value),
56
+ onKeyDown: p,
57
+ className: "cteditor-min-h-[120px] cteditor-resize-none cteditor-pr-11 cteditor-overflow-clip",
58
+ placeholder: r ? "Listening..." : "Write your comment here...",
59
+ autoFocus: !0,
60
+ disabled: r
61
+ }
62
+ ),
63
+ /* @__PURE__ */ t(
64
+ "button",
65
+ {
66
+ type: "button",
67
+ onClick: C,
68
+ className: `cteditor-absolute cteditor-right-1 cteditor-top-1/2 -cteditor-translate-y-1/2 cteditor-h-8 cteditor-w-8 [&>svg]:cteditor-size-5 cteditor-flex cteditor-justify-center cteditor-items-center ${r ? "cteditor-text-red-500 cteditor-animate-pulse" : ""}`,
69
+ title: r ? "Stop recording" : "Start voice input",
70
+ children: r ? /* @__PURE__ */ t(B, {}) : /* @__PURE__ */ t(J, {})
71
+ }
72
+ )
73
+ ] }),
74
+ r && /* @__PURE__ */ d("p", { className: "cteditor-text-xs cteditor-text-blue-600 dark:cteditor-text-blue-400 cteditor-flex cteditor-items-center cteditor-gap-1", children: [
75
+ /* @__PURE__ */ t("span", { className: "cteditor-inline-block cteditor-w-2 cteditor-h-2 cteditor-bg-red-500 cteditor-rounded-full cteditor-animate-pulse" }),
76
+ "Recording... Speak your comment clearly"
77
+ ] }),
78
+ s && /* @__PURE__ */ t("p", { className: "cteditor-text-xs cteditor-text-destructive", children: s }),
79
+ !r && !s && /* @__PURE__ */ t("p", { className: "cteditor-text-xs cteditor-text-muted-foreground", children: "Press Ctrl/Cmd + Enter to submit or click the microphone to speak" })
80
+ ] })
81
+ ] }),
82
+ /* @__PURE__ */ t(H, { className: "cteditor-flex cteditor-justify-between cteditor-items-center", children: /* @__PURE__ */ d("div", { className: "cteditor-flex cteditor-gap-2", children: [
83
+ /* @__PURE__ */ t(O, { variant: "outline", onClick: n, children: "Cancel" }),
84
+ /* @__PURE__ */ t(O, { onClick: l, disabled: !c.trim(), children: "Add Comment" })
85
+ ] }) })
86
+ ] }) });
87
+ }, ot = () => {
88
+ const [o] = w(), [n, u] = M(!1), [g, c] = M(""), { addComment: a, currentUser: r } = I(), s = r?.name || "Anonymous", C = r?.id, l = r?.avatar, p = f(
89
+ (i) => {
90
+ o.update(() => {
91
+ const x = b();
92
+ if (D(x)) {
93
+ const T = x.getTextContent();
94
+ if (T.trim()) {
95
+ const k = a({
96
+ text: i,
97
+ author: s,
98
+ authorId: C,
99
+ authorAvatar: l,
100
+ selectedText: T
101
+ }), E = x.extract(), R = Date.now();
102
+ for (const h of E)
103
+ if (A(h)) {
104
+ const y = _(
105
+ h.getTextContent(),
106
+ k,
107
+ i,
108
+ s,
109
+ R
110
+ );
111
+ y.setFormat(h.getFormat());
112
+ const v = h.getStyle();
113
+ v && y.setStyle(v), h.replace(y);
114
+ }
115
+ }
116
+ }
117
+ });
118
+ },
119
+ [o, a, s, C, l]
120
+ ), m = f(() => {
121
+ o.getEditorState().read(() => {
122
+ const i = b();
123
+ if (D(i)) {
124
+ const x = i.getTextContent();
125
+ c(x);
126
+ }
127
+ }), u(!0);
128
+ }, [o]), e = f(() => {
129
+ u(!1), c("");
130
+ }, []);
131
+ return N(() => o.registerCommand(
132
+ $,
133
+ ({ text: i }) => (p(i), !0),
134
+ S
135
+ ), [o, p]), N(() => {
136
+ const i = () => (m(), !0);
137
+ return o.registerCommand(
138
+ j,
139
+ i,
140
+ S
141
+ );
142
+ }, [o, m]), /* @__PURE__ */ t(
143
+ Q,
144
+ {
145
+ isOpen: n,
146
+ onClose: e,
147
+ onSubmit: p,
148
+ selectedText: g
149
+ }
150
+ );
151
+ };
152
+ export {
153
+ ot as default
154
+ };