eddyter 1.4.18 → 1.4.19-beta.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.
Files changed (60) hide show
  1. package/dist/AIChatPlugin-r4Q1CC4S.js +1042 -0
  2. package/dist/{CombinedAutocompletGrammarPlugin-BXOz6IRb.js → CombinedAutocompletGrammarPlugin-BuAfoCfe.js} +388 -337
  3. package/dist/{CommentBubblePlugin-kiMehQkL.js → CommentBubblePlugin-B8Q5ZxWY.js} +4 -4
  4. package/dist/CommentPlugin-BICzJnwy.js +197 -0
  5. package/dist/{NotePanelPlugin-FirMseLu.js → NotePanelPlugin-igN9zPi_.js} +3 -3
  6. package/dist/{TextEnhancePlugin-oXbL_F1i.js → TextEnhancePlugin-q9i0TKCN.js} +6 -6
  7. package/dist/assets/style.css +1 -1
  8. package/dist/components/AnimatedPlaceholderText.d.ts +2 -0
  9. package/dist/components/DividerPicker/DividerPicker.d.ts +17 -0
  10. package/dist/components/EditorialDivider/EditorialDividerView.d.ts +23 -0
  11. package/dist/components/EmojiPickerWidget/EmojiPickerWidget.d.ts +1 -1
  12. package/dist/components/LockedFeature/LockedFeature.d.ts +4 -0
  13. package/dist/components/Toolbar/styles.d.ts +19 -1
  14. package/dist/components/UnifiedColorPicker/UnifiedColorPicker.d.ts +1 -0
  15. package/dist/components/ui/button.d.ts +1 -1
  16. package/dist/components/ui/separator.d.ts +4 -1
  17. package/dist/constants.d.ts +12 -1
  18. package/dist/editorConfig.d.ts +7 -0
  19. package/dist/{generateDocxThumbnail-RE7yNAXP.js → generateDocxThumbnail-wh4lnFAw.js} +1 -1
  20. package/dist/{generatePdfThumbnail-CnldK2yE.js → generatePdfThumbnail-DQyYzjOS.js} +4 -4
  21. package/dist/{generateXlsxThumbnail-BpBB4ePK.js → generateXlsxThumbnail-DqvyM6q9.js} +1 -1
  22. package/dist/hooks/useEditorToolbar.d.ts +1 -1
  23. package/dist/{index-CKRp6axU.js → index-BWs0p6X8.js} +10 -10
  24. package/dist/{index-CL0adQ5R.js → index-Bzry1HiS.js} +13 -13
  25. package/dist/index-DEW_Wgag.js +1508 -0
  26. package/dist/{index-B4W_mfNI.js → index-DQah7JmS.js} +120 -123
  27. package/dist/{index-CXyZgoBl.js → index-jEC_qTLD.js} +18589 -15745
  28. package/dist/{index-C8ZUqYRj.js → index-m-NFtIUR.js} +27 -27
  29. package/dist/index-w_DzPr7S.js +796 -0
  30. package/dist/index.js +8 -8
  31. package/dist/nodes/AsterismNode.d.ts +22 -0
  32. package/dist/nodes/ButtonNode.d.ts +37 -0
  33. package/dist/nodes/ColumnNode.d.ts +44 -0
  34. package/dist/nodes/ColumnsNode.d.ts +45 -0
  35. package/dist/nodes/EditorialFieldNode.d.ts +32 -0
  36. package/dist/nodes/FaqNode.d.ts +28 -0
  37. package/dist/nodes/ImagePlaceholderNode.d.ts +15 -0
  38. package/dist/nodes/LabeledRuleNode.d.ts +33 -0
  39. package/dist/nodes/OrnamentDividerNode.d.ts +22 -0
  40. package/dist/nodes/PullQuoteRulesNode.d.ts +32 -0
  41. package/dist/nodes/SectionNumberHeadingNode.d.ts +42 -0
  42. package/dist/plugins/BlockLayoutPlugin.d.ts +29 -0
  43. package/dist/plugins/ColumnAddButtonPlugin.d.ts +12 -0
  44. package/dist/plugins/CommentPlugin.commands.d.ts +1 -0
  45. package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRuleNode.d.ts +12 -2
  46. package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +2 -1
  47. package/dist/plugins/CustomHorizontalRulePlugin/styles.d.ts +38 -0
  48. package/dist/plugins/EditorialFloatingToolbarPlugin.d.ts +8 -0
  49. package/dist/plugins/EditorialTypographyPlugin.d.ts +18 -0
  50. package/dist/plugins/PatternsPlugin.d.ts +12 -0
  51. package/dist/{sparkles-CTAYmQOE.js → sparkles-N8q1Rg6P.js} +1 -1
  52. package/dist/types.d.ts +11 -0
  53. package/dist/ui/Icons.d.ts +21 -7
  54. package/dist/{useVoiceToText-U0yKgS5Q.js → useVoiceToText-BSB1QOIb.js} +13 -13
  55. package/package.json +1 -1
  56. package/dist/AIChatPlugin-DsUPycjT.js +0 -872
  57. package/dist/CommentPlugin-DIuM-Jao.js +0 -154
  58. package/dist/index-DZAvLKar.js +0 -1431
  59. package/dist/index-F2-F96Nx.js +0 -720
  60. package/dist/square-CupR-YWR.js +0 -7
@@ -1,9 +1,9 @@
1
1
  import { useLexicalComposerContext as p } from "@lexical/react/LexicalComposerContext";
2
- import { useRef as y, useEffect as v } from "react";
3
- import { a1 as b } from "./index-CXyZgoBl.js";
2
+ import { useRef as y, useEffect as b } from "react";
3
+ import { ab as v } from "./index-jEC_qTLD.js";
4
4
  const g = () => {
5
- const [n] = p(), { getCommentById: o } = b(), t = y(null);
6
- return v(() => {
5
+ const [n] = p(), { getCommentById: o } = v(), t = y(null);
6
+ return b(() => {
7
7
  if (!n.getRootElement())
8
8
  return;
9
9
  const e = document.createElement("div");
@@ -0,0 +1,197 @@
1
+ import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
+ import { useLexicalComposerContext as A } from "@lexical/react/LexicalComposerContext";
3
+ import { $getSelection as T, $isRangeSelection as S, $isTextNode as I, COMMAND_PRIORITY_LOW as D } from "lexical";
4
+ import { ab as E, ac as R, ad as z, ae as L, af as $, D as F, a as j, ag as P, a0 as B, ah as K, Y as U, B as O } from "./index-jEC_qTLD.js";
5
+ import { useState as C, useCallback as f, useEffect as N, useRef as W } from "react";
6
+ import { u as Y, M as q } from "./useVoiceToText-BSB1QOIb.js";
7
+ const H = ({
8
+ isOpen: r,
9
+ onClose: d,
10
+ onSubmit: p,
11
+ selectedText: x
12
+ }) => {
13
+ const [a, s] = C(""), [b, m] = C(!1), { currentUser: _ } = E(), h = _?.name || "Anonymous", u = (e) => e.split(" ").map((v) => v[0]).join("").toUpperCase().slice(0, 2), {
14
+ isRecording: n,
15
+ error: w,
16
+ toggleRecording: o
17
+ } = Y({
18
+ onTranscriptUpdate: (e) => {
19
+ s(e);
20
+ }
21
+ }), i = f(() => {
22
+ a.trim() && (p(a.trim()), s(""), d());
23
+ }, [a, p, d]), l = f(
24
+ (e) => {
25
+ e.key === "Enter" && (e.metaKey || e.ctrlKey) ? (e.preventDefault(), i()) : e.key === "Escape" && (e.preventDefault(), d());
26
+ },
27
+ [i, d]
28
+ );
29
+ N(() => {
30
+ r && s("");
31
+ }, [r]);
32
+ const g = W(null);
33
+ return N(() => {
34
+ if (!g.current) return;
35
+ const e = g.current;
36
+ e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
37
+ }, [a]), /* @__PURE__ */ t(F, { open: r, onOpenChange: d, children: /* @__PURE__ */ c(j, { className: "cteditor-max-w-[460px] cteditor-gap-0 !cteditor-p-0 cteditor-border-black/[0.07] dark:cteditor-border-white/[0.07] cteditor-bg-white dark:cteditor-bg-[#18181b] cteditor-rounded-[14px] sm:cteditor-rounded-[14px] cteditor-overflow-hidden cteditor-shadow-[inset_0_1px_0_rgba(0,0,0,0.02),0_26px_60px_-18px_rgba(0,0,0,0.15),0_10px_22px_-10px_rgba(0,0,0,0.1)] dark:cteditor-shadow-[inset_0_1px_0_rgba(255,255,255,0.05),0_26px_60px_-18px_rgba(0,0,0,0.7),0_10px_22px_-10px_rgba(0,0,0,0.5)] [&>button.closeDialog]:cteditor-hidden", children: [
38
+ /* @__PURE__ */ c("div", { className: "cteditor-flex cteditor-items-center cteditor-justify-between cteditor-pt-3.5 cteditor-px-4 cteditor-pb-2.5", children: [
39
+ /* @__PURE__ */ c("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-2 cteditor-text-[13px] cteditor-font-semibold cteditor-text-black/90 dark:cteditor-text-white/[0.92] cteditor-tracking-[-0.005em]", children: [
40
+ /* @__PURE__ */ t("span", { className: "cteditor-w-5.5 cteditor-h-5.5 cteditor-bg-black/[0.03] dark:cteditor-bg-white/[0.05] cteditor-border cteditor-border-black/[0.05] dark:cteditor-border-white/[0.07] cteditor-rounded-md cteditor-grid cteditor-place-items-center cteditor-text-black/70 dark:cteditor-text-white/[0.78]", children: /* @__PURE__ */ t(P, { className: "cteditor-size-3" }) }),
41
+ /* @__PURE__ */ t("span", { children: "Add comment" })
42
+ ] }),
43
+ /* @__PURE__ */ t(
44
+ "button",
45
+ {
46
+ onClick: d,
47
+ className: "cteditor-w-6 cteditor-h-6 cteditor-rounded-md cteditor-grid cteditor-place-items-center cteditor-text-black/45 dark:cteditor-text-white/[0.46] hover:cteditor-bg-black/5 dark:hover:cteditor-bg-white/5 hover:cteditor-text-black/85 dark:hover:cteditor-text-white/[0.85] cteditor-transition-all",
48
+ "aria-label": "Close",
49
+ children: /* @__PURE__ */ t(B, { className: "cteditor-size-[13px]" })
50
+ }
51
+ )
52
+ ] }),
53
+ x && /* @__PURE__ */ c("div", { className: "cteditor-mx-4 cteditor-pt-3 cteditor-pr-3.5 cteditor-pb-3 cteditor-pl-4 cteditor-bg-black/[0.015] dark:cteditor-bg-white/[0.025] cteditor-border cteditor-border-black/[0.04] cteditor-border-l-2 cteditor-border-l-[#d9a558]/65 cteditor-rounded-r-lg cteditor-rounded-l-none cteditor-relative", children: [
54
+ /* @__PURE__ */ c("div", { className: "cteditor-uppercase cteditor-tracking-[0.14em] cteditor-text-[10px] cteditor-font-semibold cteditor-text-black/45 dark:cteditor-text-white/[0.42] cteditor-mb-1.5 cteditor-flex cteditor-items-center cteditor-gap-1.5", children: [
55
+ /* @__PURE__ */ t(K, { className: "cteditor-size-2.5 cteditor-opacity-70" }),
56
+ "Selected · ",
57
+ x.length,
58
+ " chars"
59
+ ] }),
60
+ /* @__PURE__ */ t("div", { className: "cteditor-font-serif cteditor-italic cteditor-text-sm cteditor-leading-normal cteditor-text-black/80 dark:cteditor-text-white/[0.82] cteditor-line-clamp-2", children: x })
61
+ ] }),
62
+ /* @__PURE__ */ c("div", { className: `cteditor-mx-4 cteditor-rounded-[10px] cteditor-border cteditor-transition-all ${b ? "cteditor-border-black/15 dark:cteditor-border-white/18 cteditor-bg-black/[0.02] dark:cteditor-bg-white/3 cteditor-shadow-[0_0_0_3px_rgba(0,0,0,0.02)] dark:cteditor-shadow-[0_0_0_3px_rgba(255,255,255,0.03)]" : "cteditor-border-black/[0.06] dark:cteditor-border-white/[0.08] cteditor-bg-black/[0.01] dark:cteditor-bg-white/[0.018]"}`, children: [
63
+ /* @__PURE__ */ c("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-2 cteditor-pt-2.5 cteditor-px-3 cteditor-pb-2 cteditor-text-xs", children: [
64
+ /* @__PURE__ */ t("span", { className: "cteditor-w-5 cteditor-h-5 cteditor-rounded-full cteditor-bg-gradient-to-br cteditor-from-[#d9a558] cteditor-to-[#8c5a1c] cteditor-text-[#1a1408] cteditor-grid cteditor-place-items-center cteditor-text-[10px] cteditor-font-bold cteditor-tracking-[0.02em]", children: u(h) }),
65
+ /* @__PURE__ */ t("span", { className: "cteditor-text-black/80 dark:cteditor-text-white/[0.78] cteditor-font-medium", children: h })
66
+ ] }),
67
+ /* @__PURE__ */ c("div", { className: "cteditor-relative cteditor-px-3.5 cteditor-pb-3", children: [
68
+ /* @__PURE__ */ t(
69
+ "textarea",
70
+ {
71
+ ref: g,
72
+ value: a,
73
+ onChange: (e) => s(e.target.value),
74
+ onKeyDown: l,
75
+ onFocus: () => m(!0),
76
+ onBlur: () => m(!1),
77
+ className: "cteditor-w-full cteditor-min-h-14 cteditor-bg-transparent cteditor-border-0 cteditor-outline-none cteditor-text-black dark:cteditor-text-white/[0.92] cteditor-font-sans cteditor-text-sm cteditor-leading-relaxed cteditor-pr-7 cteditor-resize-none",
78
+ placeholder: n ? "Listening..." : "Write your comment...",
79
+ autoFocus: !0,
80
+ disabled: n
81
+ }
82
+ ),
83
+ /* @__PURE__ */ t(
84
+ "button",
85
+ {
86
+ type: "button",
87
+ onClick: o,
88
+ className: `cteditor-absolute cteditor-right-3 cteditor-bottom-3 cteditor-w-[26px] cteditor-h-[26px] cteditor-rounded-md cteditor-grid cteditor-place-items-center cteditor-border cteditor-transition-all ${n ? "cteditor-text-red-500 cteditor-bg-red-500/10 cteditor-border-red-500/20 cteditor-animate-pulse" : "cteditor-text-black/45 dark:cteditor-text-white/50 cteditor-bg-black/[0.02] dark:cteditor-bg-white/[0.03] cteditor-border-black/[0.05] dark:cteditor-border-white/[0.06] hover:cteditor-text-black dark:hover:cteditor-text-white/90"}`,
89
+ title: n ? "Stop recording" : "Start voice input",
90
+ children: n ? /* @__PURE__ */ t("span", { className: "cteditor-size-3.5 [&>svg]:cteditor-size-full", children: /* @__PURE__ */ t(U, {}) }) : /* @__PURE__ */ t(q, { className: "cteditor-size-[13px]" })
91
+ }
92
+ )
93
+ ] })
94
+ ] }),
95
+ /* @__PURE__ */ t("p", { className: "cteditor-text-xs cteditor-text-foreground/50 cteditor-px-4 -cteditor-mt-1", children: "Press Ctrl/Cmd + Enter to submit or click the microphone to speak" }),
96
+ /* @__PURE__ */ c("div", { className: "cteditor-flex cteditor-items-center cteditor-justify-between cteditor-pt-2.5 cteditor-px-4 cteditor-pb-3.5 cteditor-border-t cteditor-border-black/5 dark:cteditor-border-white/[0.04]", children: [
97
+ /* @__PURE__ */ t("div", { className: "cteditor-flex-grow", children: n ? /* @__PURE__ */ c("p", { className: "cteditor-text-xs cteditor-text-blue-600 dark:cteditor-text-blue-400 cteditor-flex cteditor-items-center cteditor-gap-1", children: [
98
+ /* @__PURE__ */ t("span", { className: "cteditor-inline-block cteditor-w-2 cteditor-h-2 cteditor-bg-red-500 cteditor-rounded-full cteditor-animate-pulse" }),
99
+ "Recording... speak clearly"
100
+ ] }) : w ? /* @__PURE__ */ t("p", { className: "cteditor-text-xs cteditor-text-destructive", children: w }) : null }),
101
+ /* @__PURE__ */ c("div", { className: "cteditor-inline-flex cteditor-items-center cteditor-gap-2", children: [
102
+ /* @__PURE__ */ t(
103
+ O,
104
+ {
105
+ variant: "ghost",
106
+ onClick: d,
107
+ className: "cteditor-text-[13px]",
108
+ children: "Cancel"
109
+ }
110
+ ),
111
+ /* @__PURE__ */ t(
112
+ O,
113
+ {
114
+ onClick: i,
115
+ disabled: !a.trim(),
116
+ className: "cteditor-text-[13px]",
117
+ children: "Add comment"
118
+ }
119
+ )
120
+ ] })
121
+ ] })
122
+ ] }) });
123
+ }, tt = () => {
124
+ const [r] = A(), [d, p] = C(!1), [x, a] = C(""), { addComment: s, currentUser: b } = E(), m = b?.name || "Anonymous", _ = b?.id, h = b?.avatar, u = f(
125
+ (o) => {
126
+ r.update(() => {
127
+ const i = T();
128
+ if (S(i)) {
129
+ const l = i.getTextContent();
130
+ if (l.trim()) {
131
+ const g = s({
132
+ text: o,
133
+ author: m,
134
+ authorId: _,
135
+ authorAvatar: h,
136
+ selectedText: l
137
+ }), e = i.extract(), v = Date.now();
138
+ for (const k of e)
139
+ if (I(k)) {
140
+ const M = R(
141
+ k.getTextContent(),
142
+ g,
143
+ o,
144
+ m,
145
+ v
146
+ );
147
+ M.setFormat(k.getFormat());
148
+ const y = k.getStyle();
149
+ y && M.setStyle(y), k.replace(M);
150
+ }
151
+ }
152
+ }
153
+ });
154
+ },
155
+ [r, s, m, _, h]
156
+ ), n = f(() => {
157
+ r.getEditorState().read(() => {
158
+ const o = T();
159
+ if (S(o)) {
160
+ const i = o.getTextContent();
161
+ a(i);
162
+ }
163
+ }), p(!0);
164
+ }, [r]), w = f(() => {
165
+ p(!1), a("");
166
+ }, []);
167
+ return N(() => r.registerCommand(
168
+ z,
169
+ ({ text: o }) => (u(o), !0),
170
+ D
171
+ ), [r, u]), N(() => {
172
+ const o = () => (n(), !0);
173
+ return r.registerCommand(
174
+ L,
175
+ o,
176
+ D
177
+ );
178
+ }, [r, n]), N(() => {
179
+ return r.registerRootListener((i, l) => {
180
+ l !== null && l.removeEventListener("comment-click", o), i !== null && i.addEventListener("comment-click", o);
181
+ });
182
+ function o(i) {
183
+ r.dispatchCommand($, void 0);
184
+ }
185
+ }, [r]), /* @__PURE__ */ t(
186
+ H,
187
+ {
188
+ isOpen: d,
189
+ onClose: w,
190
+ onSubmit: u,
191
+ selectedText: x
192
+ }
193
+ );
194
+ };
195
+ export {
196
+ tt as default
197
+ };
@@ -1,8 +1,8 @@
1
1
  import { useLexicalComposerContext as a } from "@lexical/react/LexicalComposerContext";
2
2
  import { $insertNodes as s, COMMAND_PRIORITY_EDITOR as i } from "lexical";
3
3
  import { useEffect as l } from "react";
4
- import { ap as N, aq as u, ar as d } from "./index-CXyZgoBl.js";
5
- function g() {
4
+ import { aC as N, aD as u, aE as d } from "./index-jEC_qTLD.js";
5
+ function p() {
6
6
  const [e] = a();
7
7
  return l(() => {
8
8
  if (!e.hasNode(N))
@@ -27,5 +27,5 @@ function g() {
27
27
  }, [e]), null;
28
28
  }
29
29
  export {
30
- g as default
30
+ p as default
31
31
  };
@@ -2,8 +2,8 @@ import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
2
  import { useLexicalComposerContext as R } from "@lexical/react/LexicalComposerContext";
3
3
  import { COMMAND_PRIORITY_LOW as O, $getSelection as C, $isRangeSelection as w } from "lexical";
4
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, e as B, as as K, g as $, B as b, at as q, t as d, p as F } from "./index-CXyZgoBl.js";
6
- import { S as E } from "./sparkles-CTAYmQOE.js";
5
+ import { c as L, D as _, a as z, b as j, d as W, e as B, l as F, g as K, B as b, aF as $, t as d, p as q } from "./index-jEC_qTLD.js";
6
+ import { S as E } from "./sparkles-N8q1Rg6P.js";
7
7
  const U = L("ArrowRight", [
8
8
  ["path", { d: "M5 12h14", key: "1ays0h" }],
9
9
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
@@ -89,13 +89,13 @@ const U = L("ArrowRight", [
89
89
  ] }),
90
90
  g && !p && /* @__PURE__ */ o("div", { className: "cteditor-space-y-1.5 cteditor-animate-in cteditor-fade-in cteditor-slide-in-from-bottom-4", children: [
91
91
  /* @__PURE__ */ o("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-1.5", children: [
92
- /* @__PURE__ */ t(K, { className: "cteditor-w-3.5 cteditor-h-3.5 cteditor-text-green-500" }),
92
+ /* @__PURE__ */ t(F, { className: "cteditor-w-3.5 cteditor-h-3.5 cteditor-text-green-500" }),
93
93
  /* @__PURE__ */ t("label", { className: "cteditor-text-xs cteditor-font-medium cteditor-text-foreground", children: "Enhanced Text" })
94
94
  ] }),
95
95
  /* @__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 }) })
96
96
  ] })
97
97
  ] }),
98
- /* @__PURE__ */ o($, { children: [
98
+ /* @__PURE__ */ o(K, { children: [
99
99
  /* @__PURE__ */ t(b, { variant: "outline", onClick: x, children: "Cancel" }),
100
100
  !g && /* @__PURE__ */ o(
101
101
  b,
@@ -136,7 +136,7 @@ const Z = ({ apiKey: f }) => {
136
136
  });
137
137
  });
138
138
  try {
139
- await F({
139
+ await q({
140
140
  editor: s,
141
141
  selectedText: c,
142
142
  transformationType: "ENHANCE_WITH_AI",
@@ -183,7 +183,7 @@ const Z = ({ apiKey: f }) => {
183
183
  });
184
184
  }), !0);
185
185
  return H(() => s.registerCommand(
186
- q,
186
+ $,
187
187
  (c) => (u(c), !0),
188
188
  O
189
189
  ), [s, f]), /* @__PURE__ */ t(