eddyter 1.4.18 → 1.4.19

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-BUWq8ixX.js +1042 -0
  2. package/dist/{CombinedAutocompletGrammarPlugin-BXOz6IRb.js → CombinedAutocompletGrammarPlugin-Dq25w8tq.js} +388 -337
  3. package/dist/{CommentBubblePlugin-kiMehQkL.js → CommentBubblePlugin-B77d3Qq6.js} +4 -4
  4. package/dist/CommentPlugin-BJQyKmrN.js +212 -0
  5. package/dist/{NotePanelPlugin-FirMseLu.js → NotePanelPlugin-BqOdcg07.js} +3 -3
  6. package/dist/{TextEnhancePlugin-oXbL_F1i.js → TextEnhancePlugin-BnmdRgUu.js} +2 -2
  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-DBMxjZ83.js} +1 -1
  20. package/dist/{generatePdfThumbnail-CnldK2yE.js → generatePdfThumbnail-Cv2-ZCzh.js} +4 -4
  21. package/dist/{generateXlsxThumbnail-BpBB4ePK.js → generateXlsxThumbnail-UHmNc7Fa.js} +1 -1
  22. package/dist/hooks/useEditorToolbar.d.ts +1 -1
  23. package/dist/{index-CL0adQ5R.js → index-BaWQzoL2.js} +11 -11
  24. package/dist/{index-CXyZgoBl.js → index-Bex3G_eE.js} +18704 -15777
  25. package/dist/index-C_mjLQUF.js +796 -0
  26. package/dist/{index-C8ZUqYRj.js → index-ChSepytp.js} +26 -26
  27. package/dist/index-Cl_A9eof.js +1508 -0
  28. package/dist/{index-B4W_mfNI.js → index-DcHU8PlQ.js} +120 -123
  29. package/dist/{index-CKRp6axU.js → index-q_TW8dU1.js} +19 -19
  30. package/dist/index.js +7 -7
  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-C-XoMho5.js} +1 -1
  52. package/dist/types.d.ts +11 -0
  53. package/dist/ui/Icons.d.ts +34 -9
  54. package/dist/{useVoiceToText-U0yKgS5Q.js → useVoiceToText-BzaLSbRi.js} +17 -17
  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-Bex3G_eE.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,212 @@
1
+ import { jsx as t, jsxs as i } from "react/jsx-runtime";
2
+ import { useLexicalComposerContext as I } from "@lexical/react/LexicalComposerContext";
3
+ import { $getSelection as T, $isRangeSelection as S, $isTextNode as A, COMMAND_PRIORITY_LOW as D } from "lexical";
4
+ import { c as z, ab as E, ac as R, ad as L, ae as $, af as F, D as V, a as j, ag as P, a0 as B, Y as K, B as O } from "./index-Bex3G_eE.js";
5
+ import { useState as v, useCallback as f, useEffect as N, useRef as U } from "react";
6
+ import { u as H, M as Q } from "./useVoiceToText-BzaLSbRi.js";
7
+ const W = z("Quote", [
8
+ [
9
+ "path",
10
+ {
11
+ d: "M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z",
12
+ key: "4rm80e"
13
+ }
14
+ ],
15
+ [
16
+ "path",
17
+ {
18
+ d: "M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",
19
+ key: "10za9r"
20
+ }
21
+ ]
22
+ ]), Y = ({
23
+ isOpen: r,
24
+ onClose: d,
25
+ onSubmit: p,
26
+ selectedText: x
27
+ }) => {
28
+ const [a, s] = v(""), [b, m] = v(!1), { currentUser: _ } = E(), h = _?.name || "Anonymous", u = (e) => e.split(" ").map((C) => C[0]).join("").toUpperCase().slice(0, 2), {
29
+ isRecording: n,
30
+ error: w,
31
+ toggleRecording: o
32
+ } = H({
33
+ onTranscriptUpdate: (e) => {
34
+ s(e);
35
+ }
36
+ }), c = f(() => {
37
+ a.trim() && (p(a.trim()), s(""), d());
38
+ }, [a, p, d]), l = f(
39
+ (e) => {
40
+ e.key === "Enter" && (e.metaKey || e.ctrlKey) ? (e.preventDefault(), c()) : e.key === "Escape" && (e.preventDefault(), d());
41
+ },
42
+ [c, d]
43
+ );
44
+ N(() => {
45
+ r && s("");
46
+ }, [r]);
47
+ const g = U(null);
48
+ return N(() => {
49
+ if (!g.current) return;
50
+ const e = g.current;
51
+ e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
52
+ }, [a]), /* @__PURE__ */ t(V, { open: r, onOpenChange: d, children: /* @__PURE__ */ i(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: [
53
+ /* @__PURE__ */ i("div", { className: "cteditor-flex cteditor-items-center cteditor-justify-between cteditor-pt-3.5 cteditor-px-4 cteditor-pb-2.5", children: [
54
+ /* @__PURE__ */ i("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: [
55
+ /* @__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" }) }),
56
+ /* @__PURE__ */ t("span", { children: "Add comment" })
57
+ ] }),
58
+ /* @__PURE__ */ t(
59
+ "button",
60
+ {
61
+ onClick: d,
62
+ 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",
63
+ "aria-label": "Close",
64
+ children: /* @__PURE__ */ t(B, { className: "cteditor-size-[13px]" })
65
+ }
66
+ )
67
+ ] }),
68
+ x && /* @__PURE__ */ i("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: [
69
+ /* @__PURE__ */ i("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: [
70
+ /* @__PURE__ */ t(W, { className: "cteditor-size-2.5 cteditor-opacity-70" }),
71
+ "Selected · ",
72
+ x.length,
73
+ " chars"
74
+ ] }),
75
+ /* @__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 })
76
+ ] }),
77
+ /* @__PURE__ */ i("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: [
78
+ /* @__PURE__ */ i("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-2 cteditor-pt-2.5 cteditor-px-3 cteditor-pb-2 cteditor-text-xs", children: [
79
+ /* @__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) }),
80
+ /* @__PURE__ */ t("span", { className: "cteditor-text-black/80 dark:cteditor-text-white/[0.78] cteditor-font-medium", children: h })
81
+ ] }),
82
+ /* @__PURE__ */ i("div", { className: "cteditor-relative cteditor-px-3.5 cteditor-pb-3", children: [
83
+ /* @__PURE__ */ t(
84
+ "textarea",
85
+ {
86
+ ref: g,
87
+ value: a,
88
+ onChange: (e) => s(e.target.value),
89
+ onKeyDown: l,
90
+ onFocus: () => m(!0),
91
+ onBlur: () => m(!1),
92
+ 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",
93
+ placeholder: n ? "Listening..." : "Write your comment...",
94
+ autoFocus: !0,
95
+ disabled: n
96
+ }
97
+ ),
98
+ /* @__PURE__ */ t(
99
+ "button",
100
+ {
101
+ type: "button",
102
+ onClick: o,
103
+ 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"}`,
104
+ title: n ? "Stop recording" : "Start voice input",
105
+ children: n ? /* @__PURE__ */ t("span", { className: "cteditor-size-3.5 [&>svg]:cteditor-size-full", children: /* @__PURE__ */ t(K, {}) }) : /* @__PURE__ */ t(Q, { className: "cteditor-size-[13px]" })
106
+ }
107
+ )
108
+ ] })
109
+ ] }),
110
+ /* @__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" }),
111
+ /* @__PURE__ */ i("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: [
112
+ /* @__PURE__ */ t("div", { className: "cteditor-flex-grow", children: n ? /* @__PURE__ */ i("p", { className: "cteditor-text-xs cteditor-text-blue-600 dark:cteditor-text-blue-400 cteditor-flex cteditor-items-center cteditor-gap-1", children: [
113
+ /* @__PURE__ */ t("span", { className: "cteditor-inline-block cteditor-w-2 cteditor-h-2 cteditor-bg-red-500 cteditor-rounded-full cteditor-animate-pulse" }),
114
+ "Recording... speak clearly"
115
+ ] }) : w ? /* @__PURE__ */ t("p", { className: "cteditor-text-xs cteditor-text-destructive", children: w }) : null }),
116
+ /* @__PURE__ */ i("div", { className: "cteditor-inline-flex cteditor-items-center cteditor-gap-2", children: [
117
+ /* @__PURE__ */ t(
118
+ O,
119
+ {
120
+ variant: "ghost",
121
+ onClick: d,
122
+ className: "cteditor-text-[13px]",
123
+ children: "Cancel"
124
+ }
125
+ ),
126
+ /* @__PURE__ */ t(
127
+ O,
128
+ {
129
+ onClick: c,
130
+ disabled: !a.trim(),
131
+ className: "cteditor-text-[13px]",
132
+ children: "Add comment"
133
+ }
134
+ )
135
+ ] })
136
+ ] })
137
+ ] }) });
138
+ }, et = () => {
139
+ const [r] = I(), [d, p] = v(!1), [x, a] = v(""), { addComment: s, currentUser: b } = E(), m = b?.name || "Anonymous", _ = b?.id, h = b?.avatar, u = f(
140
+ (o) => {
141
+ r.update(() => {
142
+ const c = T();
143
+ if (S(c)) {
144
+ const l = c.getTextContent();
145
+ if (l.trim()) {
146
+ const g = s({
147
+ text: o,
148
+ author: m,
149
+ authorId: _,
150
+ authorAvatar: h,
151
+ selectedText: l
152
+ }), e = c.extract(), C = Date.now();
153
+ for (const k of e)
154
+ if (A(k)) {
155
+ const M = R(
156
+ k.getTextContent(),
157
+ g,
158
+ o,
159
+ m,
160
+ C
161
+ );
162
+ M.setFormat(k.getFormat());
163
+ const y = k.getStyle();
164
+ y && M.setStyle(y), k.replace(M);
165
+ }
166
+ }
167
+ }
168
+ });
169
+ },
170
+ [r, s, m, _, h]
171
+ ), n = f(() => {
172
+ r.getEditorState().read(() => {
173
+ const o = T();
174
+ if (S(o)) {
175
+ const c = o.getTextContent();
176
+ a(c);
177
+ }
178
+ }), p(!0);
179
+ }, [r]), w = f(() => {
180
+ p(!1), a("");
181
+ }, []);
182
+ return N(() => r.registerCommand(
183
+ L,
184
+ ({ text: o }) => (u(o), !0),
185
+ D
186
+ ), [r, u]), N(() => {
187
+ const o = () => (n(), !0);
188
+ return r.registerCommand(
189
+ $,
190
+ o,
191
+ D
192
+ );
193
+ }, [r, n]), N(() => {
194
+ return r.registerRootListener((c, l) => {
195
+ l !== null && l.removeEventListener("comment-click", o), c !== null && c.addEventListener("comment-click", o);
196
+ });
197
+ function o(c) {
198
+ r.dispatchCommand(F, void 0);
199
+ }
200
+ }, [r]), /* @__PURE__ */ t(
201
+ Y,
202
+ {
203
+ isOpen: d,
204
+ onClose: w,
205
+ onSubmit: u,
206
+ selectedText: x
207
+ }
208
+ );
209
+ };
210
+ export {
211
+ et as default
212
+ };
@@ -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 { aB as N, aC as u, aD as d } from "./index-Bex3G_eE.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 K, g as $, B as b, aE as q, t as d, p as F } from "./index-Bex3G_eE.js";
6
+ import { S as E } from "./sparkles-C-XoMho5.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" }]