eddyter 1.4.17 → 1.4.18

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 (32) hide show
  1. package/dist/{AIChatPlugin-2pIKhzIw.js → AIChatPlugin-DsUPycjT.js} +41 -40
  2. package/dist/CombinedAutocompletGrammarPlugin-BXOz6IRb.js +1778 -0
  3. package/dist/{CommentBubblePlugin-J3r4kNGK.js → CommentBubblePlugin-kiMehQkL.js} +5 -5
  4. package/dist/{CommentPlugin-BbuE8_Aj.js → CommentPlugin-DIuM-Jao.js} +24 -24
  5. package/dist/{LazySignatureCanvas-D1t8oQDK.js → LazySignatureCanvas-BtcxlSTW.js} +1 -1
  6. package/dist/{NotePanelPlugin-C16G36Jd.js → NotePanelPlugin-FirMseLu.js} +3 -3
  7. package/dist/{TextEnhancePlugin-BShY1r5J.js → TextEnhancePlugin-oXbL_F1i.js} +10 -9
  8. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  9. package/dist/assets/style.css +1 -1
  10. package/dist/components/CommentToggle/CommentToggle.d.ts +1 -0
  11. package/dist/components/ConfigurableEditorWithAuth.d.ts +2 -0
  12. package/dist/editor/components/FloatingToolbarManager.d.ts +2 -1
  13. package/dist/editor/components/ToolbarMount.d.ts +2 -1
  14. package/dist/{generateDocxThumbnail-Ve0zlObJ.js → generateDocxThumbnail-RE7yNAXP.js} +7 -6
  15. package/dist/{generatePdfThumbnail-EuSjdwzm.js → generatePdfThumbnail-CnldK2yE.js} +4 -4
  16. package/dist/{generateXlsxThumbnail-C10kl6qh.js → generateXlsxThumbnail-BpBB4ePK.js} +1 -1
  17. package/dist/{html2pdf.bundle.min-BQaO0VTp.js → html2pdf.bundle.min-u-o_L5zA.js} +1 -1
  18. package/dist/{index-gPq4n7_a.js → index-B4W_mfNI.js} +15 -15
  19. package/dist/{index-BSgLtgyt.js → index-C8ZUqYRj.js} +23 -23
  20. package/dist/{index-B8zPtmsK.js → index-CKRp6axU.js} +9 -9
  21. package/dist/{index-ClsuXAKJ.js → index-CL0adQ5R.js} +1 -1
  22. package/dist/{index-CxOOJD40.js → index-CXyZgoBl.js} +12941 -14705
  23. package/dist/{index-D25uusM-.js → index-DZAvLKar.js} +27 -26
  24. package/dist/{index-CoLO4gm_.js → index-F2-F96Nx.js} +11 -10
  25. package/dist/index.js +1 -1
  26. package/dist/pages/ConfigurableEditor/ConfigurableEditor.d.ts +1 -0
  27. package/dist/plugins/WordCountPlugin.d.ts +1 -0
  28. package/dist/sparkles-CTAYmQOE.js +17 -0
  29. package/dist/{square-DrMKkLmP.js → square-CupR-YWR.js} +1 -1
  30. package/dist/types.d.ts +1 -0
  31. package/dist/{useVoiceToText-DCddJzYF.js → useVoiceToText-U0yKgS5Q.js} +14 -14
  32. package/package.json +1 -1
@@ -1,10 +1,11 @@
1
1
  import { jsxs as e, Fragment as tt, jsx as t } from "react/jsx-runtime";
2
- import { c as kt, T as Gt, o as Dt, q as Nt, r as Ct, D as Ht, a as jt, b as Kt, d as qt, s as Vt, v as wt, w as St, x as It, y as At, z as q, L as Bt, C as _t, E as Ut, F as Wt, B as mt, G as Yt, S as Pt, P as Ft, H as Jt, J as Qt, K as Xt, X as gt, M as Zt, N as te, O as Tt, t as ht } from "./index-CxOOJD40.js";
2
+ import { c as kt, T as Ot, S as Dt, o as Nt, q as Ct, D as Ht, a as jt, b as Kt, d as qt, r as Vt, s as wt, v as St, w as It, x as At, y as q, L as Bt, z as _t, C as Ut, E as Wt, B as mt, F as Yt, P as Ft, G as Jt, H as Qt, J as Xt, X as gt, K as Zt, M as te, N as Pt, t as ht } from "./index-CXyZgoBl.js";
3
3
  import { useLexicalComposerContext as ee } from "@lexical/react/LexicalComposerContext";
4
4
  import { $getSelection as ct, COMMAND_PRIORITY_LOW as bt, $isRangeSelection as yt } from "lexical";
5
- import { useState as c, useRef as V, useCallback as H, useEffect as R, useMemo as Mt } from "react";
6
- import { u as re, M as oe } from "./useVoiceToText-DCddJzYF.js";
7
- import { S as vt } from "./square-DrMKkLmP.js";
5
+ import { useState as c, useRef as V, useCallback as H, useEffect as R, useMemo as Tt } from "react";
6
+ import { u as re, M as oe } from "./useVoiceToText-U0yKgS5Q.js";
7
+ import { S as Mt } from "./sparkles-CTAYmQOE.js";
8
+ import { S as vt } from "./square-CupR-YWR.js";
8
9
  const ie = kt("ArrowUpRight", [
9
10
  ["path", { d: "M7 7h10v10", key: "1tivn9" }],
10
11
  ["path", { d: "M7 17 17 7", key: "1vkiza" }]
@@ -25,7 +26,7 @@ function de({
25
26
  selectedTextForInline: et,
26
27
  savedSelection: A
27
28
  }) {
28
- const [a, p] = c(""), [i, f] = c(""), [n, P] = c(!1), [y, T] = c(null), [S, k] = c("chatgpt"), [W, Y] = c(0), [O, K] = c(0), [_, $] = c(!1), [F, x] = c(!0), [m, l] = c("idle"), [G, E] = c(!1), [g, J] = c([]), [Q, st] = c(!1), [rt, nt] = c(!1), X = V(A ?? null), U = V(null), o = Nt(), I = o?.isByokPlan ?? !1, h = o?.byokApiKeys, s = Mt(() => {
29
+ const [a, p] = c(""), [i, f] = c(""), [n, P] = c(!1), [y, T] = c(null), [S, k] = c("chatgpt"), [W, Y] = c(0), [$, K] = c(0), [_, G] = c(!1), [F, x] = c(!0), [m, l] = c("idle"), [O, E] = c(!1), [g, J] = c([]), [Q, st] = c(!1), [rt, nt] = c(!1), X = V(A ?? null), U = V(null), o = Nt(), I = o?.isByokPlan ?? !1, h = o?.byokApiKeys, s = Tt(() => {
29
30
  if (!I || !h)
30
31
  return ["chatgpt", "claude", "grok", "gemini"];
31
32
  const r = [];
@@ -62,9 +63,9 @@ function de({
62
63
  return (async () => {
63
64
  try {
64
65
  const M = await te({ apiKey: w });
65
- r && M && ($(!!M.unlimited), Y(Number(M.remainingCredits ?? 0)), K(Number(M.purchasedCredits ?? 0)));
66
+ r && M && (G(!!M.unlimited), Y(Number(M.remainingCredits ?? 0)), K(Number(M.purchasedCredits ?? 0)));
66
67
  } catch {
67
- r && ($(!1), Y(0), K(0));
68
+ r && (G(!1), Y(0), K(0));
68
69
  } finally {
69
70
  r && x(!1);
70
71
  }
@@ -93,7 +94,7 @@ function de({
93
94
  "design image",
94
95
  "produce image"
95
96
  ].some((it) => N.includes(it));
96
- }, Ot = H(() => {
97
+ }, $t = H(() => {
97
98
  U.current && (U.current.abort(), U.current = null);
98
99
  }, []), xt = async () => {
99
100
  if (!a.trim() || n) return;
@@ -106,7 +107,7 @@ function de({
106
107
  "${i}"
107
108
  ` : N = a;
108
109
  const it = new AbortController();
109
- U.current = it, await Tt({
110
+ U.current = it, await Pt({
110
111
  editor: dt,
111
112
  query: N,
112
113
  model: S,
@@ -131,11 +132,11 @@ function de({
131
132
  });
132
133
  }, ot = (r) => {
133
134
  if (n && !r) {
134
- Ot();
135
+ $t();
135
136
  return;
136
137
  }
137
138
  U.current = null, p(""), f(""), T(null), C(!1);
138
- }, $t = (r) => {
139
+ }, Gt = (r) => {
139
140
  switch (r) {
140
141
  case "chatgpt":
141
142
  return "OpenAI ChatGPT";
@@ -193,11 +194,11 @@ function de({
193
194
  ] }) }) : /* @__PURE__ */ e(tt, { children: [
194
195
  /* @__PURE__ */ e("div", { className: "cteditor-flex cteditor-flex-col cteditor-bg-accent/80 cteditor-rounded-md cteditor-px-3 cteditor-py-1.5 cteditor-min-w-[90px] cteditor-justify-center", children: [
195
196
  /* @__PURE__ */ t("span", { className: "cteditor-text-[11px] cteditor-font-medium cteditor-text-muted-foreground cteditor-mb-0.5", children: "Credits Left" }),
196
- /* @__PURE__ */ t("span", { className: "cteditor-text-xs cteditor-font-medium cteditor-text-foreground cteditor-leading-none", children: W + O })
197
+ /* @__PURE__ */ t("span", { className: "cteditor-text-xs cteditor-font-medium cteditor-text-foreground cteditor-leading-none", children: W + $ })
197
198
  ] }),
198
- O > 0 && /* @__PURE__ */ e("div", { className: "cteditor-flex cteditor-flex-col cteditor-bg-green-500/10 cteditor-border-l-2 cteditor-border-green-600 cteditor-rounded-r-md cteditor-rounded-l-sm cteditor-px-3 cteditor-py-1.5 cteditor-min-w-[90px] cteditor-justify-center", children: [
199
+ $ > 0 && /* @__PURE__ */ e("div", { className: "cteditor-flex cteditor-flex-col cteditor-bg-green-500/10 cteditor-border-l-2 cteditor-border-green-600 cteditor-rounded-r-md cteditor-rounded-l-sm cteditor-px-3 cteditor-py-1.5 cteditor-min-w-[90px] cteditor-justify-center", children: [
199
200
  /* @__PURE__ */ t("span", { className: "cteditor-text-[11px] cteditor-font-medium cteditor-text-muted-foreground cteditor-mb-0.5", children: "Purchased" }),
200
- /* @__PURE__ */ t("span", { className: "cteditor-text-xs cteditor-font-medium cteditor-text-green-500 cteditor-leading-none", children: O })
201
+ /* @__PURE__ */ t("span", { className: "cteditor-text-xs cteditor-font-medium cteditor-text-green-500 cteditor-leading-none", children: $ })
201
202
  ] })
202
203
  ] }) })
203
204
  ] }) })
@@ -275,7 +276,7 @@ function de({
275
276
  disabled: !a.trim() || u,
276
277
  className: "[&>svg]:!cteditor-size-3 !cteditor-px-3 cteditor-text-xs !cteditor-h-8 !gap-1",
277
278
  children: [
278
- /* @__PURE__ */ t(Pt, {}),
279
+ /* @__PURE__ */ t(Mt, {}),
279
280
  "Ask AI"
280
281
  ]
281
282
  }
@@ -497,7 +498,7 @@ function de({
497
498
  /* @__PURE__ */ t("div", { className: "cteditor-h-5 cteditor-w-5 cteditor-animate-spin cteditor-rounded-full cteditor-border-2 cteditor-border-gray-700 dark:cteditor-border-gray-300 cteditor-border-t-transparent" }),
498
499
  /* @__PURE__ */ e("div", { children: [
499
500
  /* @__PURE__ */ e("p", { className: "cteditor-text-sm cteditor-font-medium cteditor-text-gray-900 dark:cteditor-text-gray-100", children: [
500
- $t(S),
501
+ Gt(S),
501
502
  " is thinking..."
502
503
  ] }),
503
504
  /* @__PURE__ */ t("p", { className: "cteditor-text-xs cteditor-text-gray-600 dark:cteditor-text-gray-400 cteditor-mt-1", children: "This may take a few seconds. Please wait." })
@@ -518,12 +519,12 @@ function ne({
518
519
  onStopStreaming: et,
519
520
  onReopenModal: A
520
521
  }) {
521
- const [a, p] = c(dt), [i, f] = c(""), [n, P] = c(!1), [y, T] = c("idle"), [S, k] = c(!0), [W, Y] = c([]), [O, K] = c(!1), _ = V(null), $ = V(null), F = Nt(), x = F?.isByokPlan ?? !1, m = F?.byokApiKeys, l = Mt(() => {
522
+ const [a, p] = c(dt), [i, f] = c(""), [n, P] = c(!1), [y, T] = c("idle"), [S, k] = c(!0), [W, Y] = c([]), [$, K] = c(!1), _ = V(null), G = V(null), F = Nt(), x = F?.isByokPlan ?? !1, m = F?.byokApiKeys, l = Tt(() => {
522
523
  if (!x || !m)
523
524
  return ["chatgpt", "claude", "grok", "gemini"];
524
525
  const o = [];
525
526
  return m.hasOpenaiKey && o.push("chatgpt"), m.hasAnthropicKey && o.push("claude"), m.hasGrokKey && o.push("grok"), m.hasGeminiKey && o.push("gemini"), o;
526
- }, [x, m]), G = x && l.length === 0;
527
+ }, [x, m]), O = x && l.length === 0;
527
528
  R(() => {
528
529
  x && l.length > 0 && !l.includes(a) && p(l[0]);
529
530
  }, [x, l, a]);
@@ -550,10 +551,10 @@ function ne({
550
551
  _.current && _.current.focus(), C && Ct(C).then(Y).catch(() => {
551
552
  });
552
553
  }, [C]), R(() => {
553
- if (!O) return;
554
+ if (!$) return;
554
555
  const o = () => K(!1);
555
556
  return document.addEventListener("click", o), () => document.removeEventListener("click", o);
556
- }, [O]);
557
+ }, [$]);
557
558
  const Q = (o) => {
558
559
  const I = o.toLowerCase();
559
560
  return [
@@ -576,7 +577,7 @@ function ne({
576
577
  "produce image"
577
578
  ].some((s) => I.includes(s));
578
579
  }, st = H(() => {
579
- $.current && ($.current.abort(), $.current = null);
580
+ G.current && (G.current.abort(), G.current = null);
580
581
  }, []), rt = async () => {
581
582
  if (!i.trim() || n) return;
582
583
  d.getEditorState().read(() => {
@@ -584,7 +585,7 @@ function ne({
584
585
  u && yt(u) && (E.current = u.clone());
585
586
  });
586
587
  const o = new AbortController();
587
- $.current = o, P(!0);
588
+ G.current = o, P(!0);
588
589
  const I = Q(i) || g && Q(g), h = g && g.trim() !== "";
589
590
  i.length + (h ? g.length : 0);
590
591
  let s;
@@ -595,7 +596,7 @@ function ne({
595
596
  Text to transform:
596
597
  "${g}"` : s = i;
597
598
  try {
598
- await Tt({
599
+ await Pt({
599
600
  editor: d,
600
601
  query: s,
601
602
  model: a === "chatgpt" ? "chatgpt" : a,
@@ -682,7 +683,7 @@ function ne({
682
683
  {
683
684
  value: l.includes(a) ? a : l[0] ?? "chatgpt",
684
685
  onValueChange: (o) => p(o),
685
- disabled: G,
686
+ disabled: O,
686
687
  children: [
687
688
  /* @__PURE__ */ t(St, { className: "cteditor-max-w-[90px] !cteditor-h-8 cteditor-text-xs cteditor-font-medium cteditor-border-border cteditor-bg-muted cteditor-text-foreground !cteditor-px-2 !cteditor-py-1", children: /* @__PURE__ */ t(It, { placeholder: "Select provider" }) }),
688
689
  /* @__PURE__ */ e(At, { children: [
@@ -705,7 +706,7 @@ function ne({
705
706
  children: /* @__PURE__ */ t(Zt, { size: 14 })
706
707
  }
707
708
  ),
708
- O && /* @__PURE__ */ t("div", { className: "cteditor-absolute cteditor-bottom-full cteditor-left-0 cteditor-mb-1 cteditor-bg-popover cteditor-border cteditor-border-border cteditor-rounded-md cteditor-shadow-lg cteditor-z-20 cteditor-min-w-[200px] cteditor-max-w-[300px]", children: W.map((o) => /* @__PURE__ */ t(
709
+ $ && /* @__PURE__ */ t("div", { className: "cteditor-absolute cteditor-bottom-full cteditor-left-0 cteditor-mb-1 cteditor-bg-popover cteditor-border cteditor-border-border cteditor-rounded-md cteditor-shadow-lg cteditor-z-20 cteditor-min-w-[200px] cteditor-max-w-[300px]", children: W.map((o) => /* @__PURE__ */ t(
709
710
  "button",
710
711
  {
711
712
  type: "button",
@@ -729,8 +730,8 @@ function ne({
729
730
  f(o.target.value), y !== "idle" && T("idle");
730
731
  },
731
732
  onKeyDown: nt,
732
- placeholder: G ? "Add API keys in License > Manage API Keys to use AI..." : X ? "What do you want to do with this text?" : "Ask AI anything...",
733
- disabled: n || G,
733
+ placeholder: O ? "Add API keys in License > Manage API Keys to use AI..." : X ? "What do you want to do with this text?" : "Ask AI anything...",
734
+ disabled: n || O,
734
735
  className: "cteditor-h-8 cteditor-px-2 cteditor-text-xs cteditor-flex-1 cteditor-min-w-0 cteditor-border cteditor-border-border cteditor-rounded-md cteditor-outline-none cteditor-bg-muted cteditor-text-foreground"
735
736
  }
736
737
  ),
@@ -748,8 +749,8 @@ function ne({
748
749
  {
749
750
  type: "button",
750
751
  onClick: rt,
751
- disabled: !i.trim() || G,
752
- className: `cteditor-h-8 cteditor-w-8 cteditor-bg-primary cteditor-text-primary-foreground cteditor-rounded-md cteditor-border-none cteditor-flex cteditor-items-center cteditor-justify-center cteditor-shrink-0 cteditor-transition-colors cteditor-duration-200 ${!i.trim() || G ? "cteditor-cursor-not-allowed cteditor-opacity-50" : "cteditor-cursor-pointer cteditor-opacity-100"}`,
752
+ disabled: !i.trim() || O,
753
+ className: `cteditor-h-8 cteditor-w-8 cteditor-bg-primary cteditor-text-primary-foreground cteditor-rounded-md cteditor-border-none cteditor-flex cteditor-items-center cteditor-justify-center cteditor-shrink-0 cteditor-transition-colors cteditor-duration-200 ${!i.trim() || O ? "cteditor-cursor-not-allowed cteditor-opacity-50" : "cteditor-cursor-pointer cteditor-opacity-100"}`,
753
754
  children: /* @__PURE__ */ t(ce, { size: 16 })
754
755
  }
755
756
  ),
@@ -760,7 +761,7 @@ function ne({
760
761
  onClick: A,
761
762
  className: "cteditor-h-8 cteditor-w-8 cteditor-bg-muted cteditor-text-muted-foreground cteditor-flex cteditor-items-center cteditor-justify-center cteditor-cursor-pointer cteditor-shrink-0 cteditor-transition-colors cteditor-duration-200 hover:cteditor-text-foreground cteditor-rounded-md cteditor-border cteditor-border-border",
762
763
  title: "Open AI Chat",
763
- children: /* @__PURE__ */ t(Pt, { size: 14 })
764
+ children: /* @__PURE__ */ t(Mt, { size: 14 })
764
765
  }
765
766
  ),
766
767
  /* @__PURE__ */ t(
@@ -797,28 +798,28 @@ function se(d, C, dt) {
797
798
  n.current = x, y(!0), S(l ?? !1), p(m), f(""), A(!0);
798
799
  },
799
800
  []
800
- ), O = H(() => {
801
+ ), $ = H(() => {
801
802
  n.current = null, y(!1);
802
803
  }, []), K = H(() => {
803
804
  n.current && (n.current.abort(), n.current = null), y(!1);
804
805
  }, []), _ = H(() => {
805
806
  L(!0);
806
- }, []), $ = H(() => {
807
+ }, []), G = H(() => {
807
808
  n.current && (n.current.abort(), n.current = null), y(!1), A(!1), f("");
808
809
  }, []);
809
810
  R(() => {
810
811
  const x = d.registerCommand(
811
- Gt,
812
+ Ot,
812
813
  (l) => (k(l), !0),
813
814
  bt
814
815
  ), m = d.registerCommand(
815
816
  Dt,
816
817
  (l) => {
817
- let G = "";
818
+ let O = "";
818
819
  return d.getEditorState().read(() => {
819
820
  const E = ct();
820
- E && (G = E.getTextContent());
821
- }), p(l?.provider || "chatgpt"), f(l?.initialText || G), A(!0), !0;
821
+ E && (O = E.getTextContent());
822
+ }), p(l?.provider || "chatgpt"), f(l?.initialText || O), A(!0), !0;
822
823
  },
823
824
  bt
824
825
  );
@@ -839,7 +840,7 @@ function se(d, C, dt) {
839
840
  savedSelection: z.current,
840
841
  onShowInEditor: W,
841
842
  onStreamStart: Y,
842
- onStreamEnd: O,
843
+ onStreamEnd: $,
843
844
  selectedTextForInline: j
844
845
  }
845
846
  ),
@@ -850,7 +851,7 @@ function se(d, C, dt) {
850
851
  apiKey: C,
851
852
  initialProvider: a,
852
853
  selectedText: i,
853
- onClose: $,
854
+ onClose: G,
854
855
  anchorElem: F,
855
856
  isStreamingFromModal: P,
856
857
  isImageStreaming: T,
@@ -860,12 +861,12 @@ function se(d, C, dt) {
860
861
  )
861
862
  ] });
862
863
  }
863
- function fe({
864
+ function xe({
864
865
  apiKey: d
865
866
  }) {
866
867
  const [C] = ee();
867
868
  return se(C, d);
868
869
  }
869
870
  export {
870
- fe as default
871
+ xe as default
871
872
  };