eddyter 1.4.17 → 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.
- package/dist/AIChatPlugin-r4Q1CC4S.js +1042 -0
- package/dist/CombinedAutocompletGrammarPlugin-BuAfoCfe.js +1829 -0
- package/dist/{CommentBubblePlugin-J3r4kNGK.js → CommentBubblePlugin-B8Q5ZxWY.js} +7 -7
- package/dist/CommentPlugin-BICzJnwy.js +197 -0
- package/dist/{LazySignatureCanvas-D1t8oQDK.js → LazySignatureCanvas-BtcxlSTW.js} +1 -1
- package/dist/{NotePanelPlugin-C16G36Jd.js → NotePanelPlugin-igN9zPi_.js} +1 -1
- package/dist/{TextEnhancePlugin-BShY1r5J.js → TextEnhancePlugin-q9i0TKCN.js} +14 -13
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/assets/style.css +1 -1
- package/dist/components/AnimatedPlaceholderText.d.ts +2 -0
- package/dist/components/CommentToggle/CommentToggle.d.ts +1 -0
- package/dist/components/ConfigurableEditorWithAuth.d.ts +2 -0
- package/dist/components/DividerPicker/DividerPicker.d.ts +17 -0
- package/dist/components/EditorialDivider/EditorialDividerView.d.ts +23 -0
- package/dist/components/EmojiPickerWidget/EmojiPickerWidget.d.ts +1 -1
- package/dist/components/LockedFeature/LockedFeature.d.ts +4 -0
- package/dist/components/Toolbar/styles.d.ts +19 -1
- package/dist/components/UnifiedColorPicker/UnifiedColorPicker.d.ts +1 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/separator.d.ts +4 -1
- package/dist/constants.d.ts +12 -1
- package/dist/editor/components/FloatingToolbarManager.d.ts +2 -1
- package/dist/editor/components/ToolbarMount.d.ts +2 -1
- package/dist/editorConfig.d.ts +7 -0
- package/dist/{generateDocxThumbnail-Ve0zlObJ.js → generateDocxThumbnail-wh4lnFAw.js} +7 -6
- package/dist/{generatePdfThumbnail-EuSjdwzm.js → generatePdfThumbnail-DQyYzjOS.js} +1 -1
- package/dist/{generateXlsxThumbnail-C10kl6qh.js → generateXlsxThumbnail-DqvyM6q9.js} +1 -1
- package/dist/hooks/useEditorToolbar.d.ts +1 -1
- package/dist/{html2pdf.bundle.min-BQaO0VTp.js → html2pdf.bundle.min-u-o_L5zA.js} +1 -1
- package/dist/{index-B8zPtmsK.js → index-BWs0p6X8.js} +14 -14
- package/dist/{index-ClsuXAKJ.js → index-Bzry1HiS.js} +13 -13
- package/dist/index-DEW_Wgag.js +1508 -0
- package/dist/{index-gPq4n7_a.js → index-DQah7JmS.js} +113 -116
- package/dist/{index-CxOOJD40.js → index-jEC_qTLD.js} +18727 -17647
- package/dist/{index-BSgLtgyt.js → index-m-NFtIUR.js} +21 -21
- package/dist/index-w_DzPr7S.js +796 -0
- package/dist/index.js +8 -8
- package/dist/nodes/AsterismNode.d.ts +22 -0
- package/dist/nodes/ButtonNode.d.ts +37 -0
- package/dist/nodes/ColumnNode.d.ts +44 -0
- package/dist/nodes/ColumnsNode.d.ts +45 -0
- package/dist/nodes/EditorialFieldNode.d.ts +32 -0
- package/dist/nodes/FaqNode.d.ts +28 -0
- package/dist/nodes/ImagePlaceholderNode.d.ts +15 -0
- package/dist/nodes/LabeledRuleNode.d.ts +33 -0
- package/dist/nodes/OrnamentDividerNode.d.ts +22 -0
- package/dist/nodes/PullQuoteRulesNode.d.ts +32 -0
- package/dist/nodes/SectionNumberHeadingNode.d.ts +42 -0
- package/dist/pages/ConfigurableEditor/ConfigurableEditor.d.ts +1 -0
- package/dist/plugins/BlockLayoutPlugin.d.ts +29 -0
- package/dist/plugins/ColumnAddButtonPlugin.d.ts +12 -0
- package/dist/plugins/CommentPlugin.commands.d.ts +1 -0
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRuleNode.d.ts +12 -2
- package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +2 -1
- package/dist/plugins/CustomHorizontalRulePlugin/styles.d.ts +38 -0
- package/dist/plugins/EditorialFloatingToolbarPlugin.d.ts +8 -0
- package/dist/plugins/EditorialTypographyPlugin.d.ts +18 -0
- package/dist/plugins/PatternsPlugin.d.ts +12 -0
- package/dist/plugins/WordCountPlugin.d.ts +1 -0
- package/dist/sparkles-N8q1Rg6P.js +17 -0
- package/dist/types.d.ts +12 -0
- package/dist/ui/Icons.d.ts +21 -7
- package/dist/{useVoiceToText-DCddJzYF.js → useVoiceToText-BSB1QOIb.js} +22 -22
- package/package.json +1 -1
- package/dist/AIChatPlugin-2pIKhzIw.js +0 -871
- package/dist/CommentPlugin-BbuE8_Aj.js +0 -154
- package/dist/index-CoLO4gm_.js +0 -719
- package/dist/index-D25uusM-.js +0 -1430
- package/dist/square-DrMKkLmP.js +0 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useLexicalComposerContext as
|
|
2
|
-
import { useRef as y, useEffect as
|
|
3
|
-
import {
|
|
1
|
+
import { useLexicalComposerContext as p } from "@lexical/react/LexicalComposerContext";
|
|
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] =
|
|
6
|
-
return
|
|
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");
|
|
@@ -12,8 +12,8 @@ const g = () => {
|
|
|
12
12
|
const d = l, { commentId: i, element: u } = d.detail, c = o(i);
|
|
13
13
|
if (!c)
|
|
14
14
|
return;
|
|
15
|
-
const
|
|
16
|
-
e.textContent =
|
|
15
|
+
const a = 1 + c.replies.length;
|
|
16
|
+
e.textContent = a.toString();
|
|
17
17
|
const s = u.getBoundingClientRect();
|
|
18
18
|
e.style.setProperty("display", "flex", "important"), e.style.setProperty("left", `${s.right + window.scrollX - 10}px`, "important"), e.style.setProperty("top", `${s.top + window.scrollY - 10}px`, "important");
|
|
19
19
|
}, m = () => {
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { jsx as j } from "react/jsx-runtime";
|
|
2
2
|
import A, { Component as q, forwardRef as I } from "react";
|
|
3
3
|
import { _ as V, a as $ } from "./objectWithoutPropertiesLoose-DiWPeE4c.js";
|
|
4
|
-
import {
|
|
4
|
+
import { g as N } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
5
5
|
function H(e, n) {
|
|
6
6
|
if (e == null) return {};
|
|
7
7
|
var r, t, o = V(e, n);
|
|
@@ -1,7 +1,7 @@
|
|
|
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 {
|
|
4
|
+
import { aC as N, aD as u, aE as d } from "./index-jEC_qTLD.js";
|
|
5
5
|
function p() {
|
|
6
6
|
const [e] = a();
|
|
7
7
|
return l(() => {
|
|
@@ -2,7 +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,
|
|
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";
|
|
6
7
|
const U = L("ArrowRight", [
|
|
7
8
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
8
9
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
@@ -39,7 +40,7 @@ const U = L("ArrowRight", [
|
|
|
39
40
|
return /* @__PURE__ */ t(_, { open: h, onOpenChange: x, children: /* @__PURE__ */ o(z, { className: "sm:cteditor-max-w-[500px] cteditor-max-h-[650px]", children: [
|
|
40
41
|
/* @__PURE__ */ o(j, { children: [
|
|
41
42
|
/* @__PURE__ */ o(W, { className: "cteditor-flex cteditor-items-center cteditor-gap-2", children: [
|
|
42
|
-
/* @__PURE__ */ t(
|
|
43
|
+
/* @__PURE__ */ t(E, { className: "cteditor-size-5" }),
|
|
43
44
|
"Enhance Text"
|
|
44
45
|
] }),
|
|
45
46
|
/* @__PURE__ */ t(B, { children: "Enhance your selected text with AI assistance." })
|
|
@@ -82,33 +83,33 @@ const U = L("ArrowRight", [
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
),
|
|
85
|
-
/* @__PURE__ */ t("div", { className: "cteditor-absolute cteditor-inset-0 cteditor-rounded-full cteditor-bg-background cteditor-flex cteditor-items-center cteditor-justify-center cteditor-m-[2px]", children: /* @__PURE__ */ t(
|
|
86
|
+
/* @__PURE__ */ t("div", { className: "cteditor-absolute cteditor-inset-0 cteditor-rounded-full cteditor-bg-background cteditor-flex cteditor-items-center cteditor-justify-center cteditor-m-[2px]", children: /* @__PURE__ */ t(E, { className: "cteditor-w-6 cteditor-h-6 cteditor-text-purple-500 cteditor-animate-pulse" }) })
|
|
86
87
|
] }),
|
|
87
88
|
/* @__PURE__ */ t("div", { className: "cteditor-text-center", children: /* @__PURE__ */ t("p", { className: "cteditor-text-sm cteditor-font-medium cteditor-text-foreground", children: "Enhancing text..." }) })
|
|
88
89
|
] }),
|
|
89
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: [
|
|
90
91
|
/* @__PURE__ */ o("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-1.5", children: [
|
|
91
|
-
/* @__PURE__ */ t(
|
|
92
|
+
/* @__PURE__ */ t(F, { className: "cteditor-w-3.5 cteditor-h-3.5 cteditor-text-green-500" }),
|
|
92
93
|
/* @__PURE__ */ t("label", { className: "cteditor-text-xs cteditor-font-medium cteditor-text-foreground", children: "Enhanced Text" })
|
|
93
94
|
] }),
|
|
94
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 }) })
|
|
95
96
|
] })
|
|
96
97
|
] }),
|
|
97
|
-
/* @__PURE__ */ o(
|
|
98
|
-
/* @__PURE__ */ t(
|
|
98
|
+
/* @__PURE__ */ o(K, { children: [
|
|
99
|
+
/* @__PURE__ */ t(b, { variant: "outline", onClick: x, children: "Cancel" }),
|
|
99
100
|
!g && /* @__PURE__ */ o(
|
|
100
|
-
|
|
101
|
+
b,
|
|
101
102
|
{
|
|
102
103
|
onClick: T,
|
|
103
104
|
disabled: !c.trim() || p,
|
|
104
105
|
className: "cteditor-gap-2",
|
|
105
106
|
children: [
|
|
106
|
-
/* @__PURE__ */ t(
|
|
107
|
+
/* @__PURE__ */ t(E, { className: "cteditor-size-5" }),
|
|
107
108
|
"Enhance"
|
|
108
109
|
]
|
|
109
110
|
}
|
|
110
111
|
),
|
|
111
|
-
g && /* @__PURE__ */ o(
|
|
112
|
+
g && /* @__PURE__ */ o(b, { onClick: S, className: "cteditor-gap-2", children: [
|
|
112
113
|
"Insert",
|
|
113
114
|
/* @__PURE__ */ t(U, { className: "cteditor-size-5" })
|
|
114
115
|
] })
|
|
@@ -116,7 +117,7 @@ const U = L("ArrowRight", [
|
|
|
116
117
|
] }) });
|
|
117
118
|
});
|
|
118
119
|
I.displayName = "TextEnhanceDialog";
|
|
119
|
-
const
|
|
120
|
+
const Z = ({ apiKey: f }) => {
|
|
120
121
|
const [s] = R(), h = D(null), r = D(void 0), m = async (c, n) => {
|
|
121
122
|
let i = null;
|
|
122
123
|
s.getEditorState().read(() => {
|
|
@@ -135,7 +136,7 @@ const V = ({ apiKey: f }) => {
|
|
|
135
136
|
});
|
|
136
137
|
});
|
|
137
138
|
try {
|
|
138
|
-
await
|
|
139
|
+
await q({
|
|
139
140
|
editor: s,
|
|
140
141
|
selectedText: c,
|
|
141
142
|
transformationType: "ENHANCE_WITH_AI",
|
|
@@ -182,7 +183,7 @@ const V = ({ apiKey: f }) => {
|
|
|
182
183
|
});
|
|
183
184
|
}), !0);
|
|
184
185
|
return H(() => s.registerCommand(
|
|
185
|
-
|
|
186
|
+
$,
|
|
186
187
|
(c) => (u(c), !0),
|
|
187
188
|
O
|
|
188
189
|
), [s, f]), /* @__PURE__ */ t(
|
|
@@ -194,5 +195,5 @@ const V = ({ apiKey: f }) => {
|
|
|
194
195
|
);
|
|
195
196
|
};
|
|
196
197
|
export {
|
|
197
|
-
|
|
198
|
+
Z as default
|
|
198
199
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
+
function l(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
o as c,
|
|
7
|
+
l as g
|
|
8
|
+
};
|