eddyter 1.3.75 → 1.3.76
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/LICENSE +24 -24
- package/README.md +478 -478
- package/dist/EddyterIcon.svg +24 -24
- package/dist/api/config/endpoints.d.ts +1 -0
- package/dist/assets/style.css +1 -1
- package/dist/{babel-B9hn44Wo.js → babel-CCPWkrf4.js} +1302 -726
- package/dist/components/EddyterLogo/EddyterLogo.d.ts +2 -1
- package/dist/components/HtmlCodeEditor.d.ts +9 -0
- package/dist/components/Placeholder/styles.d.ts +2 -0
- package/dist/components/Toast/EditorToast.d.ts +2 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/config/env.d.ts +8 -0
- package/dist/{estree-CocPn_Md.js → estree-CxUPh9wa.js} +917 -529
- package/dist/generateDocxThumbnail-BbSs-3CJ.js +5876 -0
- package/dist/generatePdfThumbnail-U8R2yu3J.js +53 -0
- package/dist/generateXlsxThumbnail-BUwuqsXR.js +21707 -0
- package/dist/hooks/useFeedbackEligibility.d.ts +2 -2
- package/dist/hooks/usePdfPreview.d.ts +6 -0
- package/dist/{html-CxCicOef.js → html-CmniStvG.js} +589 -350
- package/dist/html2canvas.esm-C2wu93Kq.js +4867 -0
- package/dist/{html2pdf.bundle.min-BxzIoi3T.js → html2pdf.bundle.min-Css6bHHm.js} +5223 -3407
- package/dist/{index-Cuv9ugJL.js → index-CCVZobcV.js} +3 -3
- package/dist/index-CVEa0GRe.js +131 -0
- package/dist/{index-CtPRZTab.js → index-DTkM3xiE.js} +12 -9
- package/dist/{index-DxEP36zG.js → index-DjD3NbU0.js} +14177 -13383
- package/dist/index.js +1 -1
- package/dist/lib/toast.d.ts +39 -0
- package/dist/{markdown-BUjgWFLu.js → markdown-B0mEGGfQ.js} +1015 -578
- package/dist/nodes/EmbedNode.d.ts +7 -2
- package/dist/nodes/FileNode.d.ts +3 -0
- package/dist/{postcss-CGIcwj_g.js → postcss-B0bxXf7u.js} +1065 -615
- package/dist/{standalone-C0qguT38.js → standalone-DmuJV5rn.js} +596 -350
- package/dist/store/tableFullWidthStore.d.ts +6 -0
- package/dist/types.d.ts +2 -0
- package/dist/{typescript-BM7wk6k-.js → typescript-DZlC_9M8.js} +1805 -1113
- package/dist/utils/editorStyleConverter.d.ts +3 -1
- package/dist/utils/generateDocxThumbnail.d.ts +5 -0
- package/dist/utils/generatePdfThumbnail.d.ts +1 -0
- package/dist/utils/generateXlsxThumbnail.d.ts +5 -0
- package/dist/utils/helper.d.ts +2 -0
- package/dist/utils/htmlFormat.d.ts +5 -0
- package/dist/utils/index.d.ts +4 -4
- package/package.json +147 -150
- package/dist/html2pdf.bundle-CVq-OpZt.js +0 -32961
- package/dist/index-eRyVFO7x.js +0 -83
|
@@ -15,7 +15,7 @@ import { useLexicalNodeSelection as ht } from "@lexical/react/useLexicalNodeSele
|
|
|
15
15
|
import { mergeRegister as pt } from "@lexical/utils";
|
|
16
16
|
import { $getSelection as L, $isNodeSelection as h, $setSelection as O, SELECTION_CHANGE_COMMAND as bt, COMMAND_PRIORITY_LOW as f, CLICK_COMMAND as Ct, DRAGSTART_COMMAND as xt, KEY_DELETE_COMMAND as Nt, KEY_BACKSPACE_COMMAND as vt, KEY_ENTER_COMMAND as Et, KEY_ESCAPE_COMMAND as Rt, RootNode as kt, TextNode as yt, LineBreakNode as At, ParagraphNode as St, $getNodeByKey as y, $isParagraphNode as T } from "lexical";
|
|
17
17
|
import { useRef as P, useState as j, useCallback as N, useEffect as Dt } from "react";
|
|
18
|
-
import { x as v, W as Lt, j as Pt, A as Mt, k as _t, l as $t, T as zt,
|
|
18
|
+
import { x as v, W as Lt, j as Pt, A as Mt, k as _t, l as $t, T as zt, s as It, L as Wt, i as Ot } from "./index-DjD3NbU0.js";
|
|
19
19
|
function ie({
|
|
20
20
|
src: w,
|
|
21
21
|
nodeKey: g,
|
|
@@ -179,7 +179,7 @@ function ie({
|
|
|
179
179
|
"div",
|
|
180
180
|
{
|
|
181
181
|
draggable: Q,
|
|
182
|
-
style: n === "left" || n === "right" ? {
|
|
182
|
+
style: (() => n === "left" || n === "right" ? {
|
|
183
183
|
position: "relative",
|
|
184
184
|
display: "block",
|
|
185
185
|
width: "100%"
|
|
@@ -206,7 +206,7 @@ function ie({
|
|
|
206
206
|
} : {
|
|
207
207
|
position: "relative",
|
|
208
208
|
display: "inline-block"
|
|
209
|
-
},
|
|
209
|
+
})(),
|
|
210
210
|
onClick: J,
|
|
211
211
|
children: [
|
|
212
212
|
/* @__PURE__ */ i(
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsx as i, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useLexicalComposerContext as U } from "@lexical/react/LexicalComposerContext";
|
|
3
|
+
import { $getNodeByKey as v } from "lexical";
|
|
4
|
+
import { useState as N, useEffect as k } from "react";
|
|
5
|
+
import { q as w, r as L, s as E, F as g, v as j, w as B } from "./index-DjD3NbU0.js";
|
|
6
|
+
function W(t, e) {
|
|
7
|
+
const l = t.split(".").pop()?.toLowerCase();
|
|
8
|
+
return l === "pdf" || e.startsWith("data:application/pdf") ? "pdf" : l === "docx" || e.startsWith("data:application/vnd.openxmlformats") && t.toLowerCase().endsWith(".docx") ? "docx" : l === "xlsx" || l === "xls" || e.startsWith("data:application/vnd.openxmlformats-officedocument.spreadsheetml") || e.startsWith("data:application/vnd.ms-excel") ? "xlsx" : null;
|
|
9
|
+
}
|
|
10
|
+
function $(t, e) {
|
|
11
|
+
const [l, d] = N(null);
|
|
12
|
+
return k(() => {
|
|
13
|
+
const s = t && e ? W(e, t) : null;
|
|
14
|
+
if (!t || !e || !s) {
|
|
15
|
+
d(null);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
let c = !1;
|
|
19
|
+
return s === "pdf" ? import("./generatePdfThumbnail-U8R2yu3J.js").then(({ generatePdfThumbnail: r }) => r(t)).then((r) => {
|
|
20
|
+
c || d(r);
|
|
21
|
+
}).catch(() => {
|
|
22
|
+
c || d(null);
|
|
23
|
+
}) : s === "docx" ? import("./generateDocxThumbnail-BbSs-3CJ.js").then(({ generateDocxThumbnail: r }) => r(t)).then((r) => {
|
|
24
|
+
c || d(r);
|
|
25
|
+
}).catch(() => {
|
|
26
|
+
c || d(null);
|
|
27
|
+
}) : s === "xlsx" && import("./generateXlsxThumbnail-BUwuqsXR.js").then(({ generateXlsxThumbnail: r }) => r(t)).then((r) => {
|
|
28
|
+
c || d(r);
|
|
29
|
+
}).catch(() => {
|
|
30
|
+
c || d(null);
|
|
31
|
+
}), () => {
|
|
32
|
+
c = !0, d(null);
|
|
33
|
+
};
|
|
34
|
+
}, [t, e]), l;
|
|
35
|
+
}
|
|
36
|
+
const R = (t) => t ? t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : t < 1024 * 1024 * 1024 ? `${(t / (1024 * 1024)).toFixed(1)} MB` : `${(t / (1024 * 1024 * 1024)).toFixed(1)} GB` : "", y = (t) => {
|
|
37
|
+
const e = t.split(".");
|
|
38
|
+
return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
|
|
39
|
+
}, b = (t) => {
|
|
40
|
+
const e = y(t);
|
|
41
|
+
return e === "pdf" || e === "docx" || e === "xlsx" || e === "xls";
|
|
42
|
+
}, T = (t) => {
|
|
43
|
+
const e = y(t);
|
|
44
|
+
return ["pdf", "doc", "docx", "txt", "odt"].includes(e) ? /* @__PURE__ */ i(g, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-blue-500" }) : ["xls", "xlsx", "csv"].includes(e) ? /* @__PURE__ */ i(g, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-green-600" }) : ["zip", "rar", "7z", "tar", "gz"].includes(e) ? /* @__PURE__ */ i(j, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-orange-500" }) : /* @__PURE__ */ i(B, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-gray-500" });
|
|
45
|
+
}, V = ({ src: t, fileName: e, fileSize: l, nodeKey: d }) => {
|
|
46
|
+
const [s] = U(), c = $(b(e) ? t : void 0, e);
|
|
47
|
+
if (k(() => {
|
|
48
|
+
c && s.update(() => {
|
|
49
|
+
const n = v(d);
|
|
50
|
+
w(n) && n.setPreviewDataUrl(c);
|
|
51
|
+
});
|
|
52
|
+
}, [s, d, c]), !t || !e)
|
|
53
|
+
return console.error("FileView: Missing required props", { src: t, fileName: e, fileSize: l, nodeKey: d }), /* @__PURE__ */ i("div", { className: "cteditor-inline-flex cteditor-items-center cteditor-gap-3 cteditor-px-4 cteditor-py-3 cteditor-my-2 cteditor-border cteditor-border-destructive cteditor-rounded-lg cteditor-bg-destructive/10", children: /* @__PURE__ */ i("div", { className: "cteditor-text-sm cteditor-text-destructive", children: "Error loading file" }) });
|
|
54
|
+
const r = (n) => {
|
|
55
|
+
n.preventDefault(), n.stopPropagation();
|
|
56
|
+
try {
|
|
57
|
+
if (t.startsWith("data:")) {
|
|
58
|
+
const o = t.split(","), f = o[0].match(/:(.*?);/), D = f ? f[1] : "application/octet-stream", m = atob(o[1]);
|
|
59
|
+
let u = m.length;
|
|
60
|
+
const x = new Uint8Array(u);
|
|
61
|
+
for (; u--; )
|
|
62
|
+
x[u] = m.charCodeAt(u);
|
|
63
|
+
const P = new Blob([x], { type: D }), h = URL.createObjectURL(P), a = document.createElement("a");
|
|
64
|
+
a.href = h, a.download = e, a.style.display = "none", document.body.appendChild(a), a.click(), document.body.removeChild(a), setTimeout(() => URL.revokeObjectURL(h), 100);
|
|
65
|
+
} else {
|
|
66
|
+
const o = document.createElement("a");
|
|
67
|
+
o.href = t, o.download = e, o.style.display = "none", o.target = "_blank", document.body.appendChild(o), o.click(), document.body.removeChild(o);
|
|
68
|
+
}
|
|
69
|
+
} catch (o) {
|
|
70
|
+
console.error("Error downloading file:", o), window.open(t, "_blank");
|
|
71
|
+
}
|
|
72
|
+
}, F = (n) => {
|
|
73
|
+
n.preventDefault(), n.stopPropagation(), s.update(() => {
|
|
74
|
+
const o = v(d);
|
|
75
|
+
w(o) && o.remove();
|
|
76
|
+
});
|
|
77
|
+
}, C = b(e) && c;
|
|
78
|
+
return /* @__PURE__ */ p(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
className: "cteditor-inline-flex cteditor-flex-col cteditor-gap-2 cteditor-py-2 cteditor-px-2 cteditor-my-2 cteditor-border cteditor-border-border cteditor-rounded-lg cteditor-bg-background hover:cteditor-bg-accent/50 cteditor-transition-colors cteditor-cursor-pointer cteditor-max-w-[240px]",
|
|
82
|
+
onClick: r,
|
|
83
|
+
role: "button",
|
|
84
|
+
tabIndex: 0,
|
|
85
|
+
onKeyDown: (n) => {
|
|
86
|
+
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), r(n));
|
|
87
|
+
},
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ i("div", { className: "cteditor-w-full cteditor-aspect-[120/88] cteditor-rounded cteditor-overflow-hidden cteditor-bg-muted cteditor-flex cteditor-items-center cteditor-justify-center", children: C ? /* @__PURE__ */ i(
|
|
90
|
+
"img",
|
|
91
|
+
{
|
|
92
|
+
src: c,
|
|
93
|
+
alt: "",
|
|
94
|
+
className: "cteditor-w-full cteditor-h-full cteditor-object-cover"
|
|
95
|
+
}
|
|
96
|
+
) : /* @__PURE__ */ i("div", { className: "*:cteditor-size-8", children: T(e) }) }),
|
|
97
|
+
/* @__PURE__ */ p("div", { className: "cteditor-flex cteditor-items-start cteditor-gap-2 cteditor-w-full", children: [
|
|
98
|
+
/* @__PURE__ */ p("div", { className: "cteditor-flex-1 cteditor-min-w-0", children: [
|
|
99
|
+
/* @__PURE__ */ i("div", { className: "cteditor-font-medium cteditor-text-xs cteditor-text-foreground cteditor-truncate", children: e }),
|
|
100
|
+
l && /* @__PURE__ */ i("div", { className: "cteditor-text-xs cteditor-text-muted-foreground", children: R(l) })
|
|
101
|
+
] }),
|
|
102
|
+
/* @__PURE__ */ p("div", { className: "cteditor-flex cteditor-gap-1 cteditor-flex-shrink-0", children: [
|
|
103
|
+
/* @__PURE__ */ i(
|
|
104
|
+
"button",
|
|
105
|
+
{
|
|
106
|
+
onClick: r,
|
|
107
|
+
className: "cteditor-p-1 cteditor-rounded-md hover:cteditor-bg-accent cteditor-transition-colors",
|
|
108
|
+
"aria-label": "Download file",
|
|
109
|
+
title: "Download file",
|
|
110
|
+
children: /* @__PURE__ */ i(L, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground" })
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ i(
|
|
114
|
+
"button",
|
|
115
|
+
{
|
|
116
|
+
onClick: F,
|
|
117
|
+
className: "cteditor-p-1 cteditor-rounded-md hover:cteditor-bg-destructive hover:cteditor-text-destructive-foreground cteditor-transition-colors",
|
|
118
|
+
"aria-label": "Delete file",
|
|
119
|
+
title: "Delete file",
|
|
120
|
+
children: /* @__PURE__ */ i(E, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground" })
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] })
|
|
124
|
+
] })
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
export {
|
|
130
|
+
V as default
|
|
131
|
+
};
|
|
@@ -16,7 +16,7 @@ import { useLexicalNodeSelection as lt } from "@lexical/react/useLexicalNodeSele
|
|
|
16
16
|
import { mergeRegister as mt } from "@lexical/utils";
|
|
17
17
|
import { RootNode as Re, TextNode as Pe, LineBreakNode as De, ParagraphNode as Se, $getSelection as O, $isNodeSelection as L, $isParagraphNode as Z, $setSelection as ee, $isRangeSelection as ut, SELECTION_CHANGE_COMMAND as gt, COMMAND_PRIORITY_LOW as v, CLICK_COMMAND as ft, DRAGSTART_COMMAND as pt, KEY_DELETE_COMMAND as ht, KEY_BACKSPACE_COMMAND as bt, KEY_ENTER_COMMAND as yt, KEY_ESCAPE_COMMAND as xt, createCommand as Ct, $getNodeByKey as _ } from "lexical";
|
|
18
18
|
import { useRef as z, useState as p, useEffect as te, useLayoutEffect as Nt, useCallback as x, Suspense as wt } from "react";
|
|
19
|
-
import { a as vt, D as Et, b as kt, d as It, e as Rt, f as Pt, h as Dt, B as be, L as Ae, i as Le, u as St, $ as M, W as At, j as Lt, A as Mt, k as $t, l as Ot, T as _t, m as zt, S as Wt, E as jt, n as Kt, t as E, o as Bt, p as Tt, C as Ft } from "./index-
|
|
19
|
+
import { a as vt, D as Et, b as kt, d as It, e as Rt, f as Pt, h as Dt, B as be, L as Ae, i as Le, u as St, $ as M, W as At, j as Lt, A as Mt, k as $t, l as Ot, T as _t, m as zt, S as Wt, E as jt, n as Kt, t as E, o as Bt, p as Tt, C as Ft } from "./index-DjD3NbU0.js";
|
|
20
20
|
const Gt = vt("Link2", [
|
|
21
21
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
22
22
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
@@ -419,7 +419,8 @@ function Nr({
|
|
|
419
419
|
S.current && clearTimeout(S.current);
|
|
420
420
|
}, []);
|
|
421
421
|
const fe = async () => {
|
|
422
|
-
if (!P.trim() || D)
|
|
422
|
+
if (!P.trim() || D)
|
|
423
|
+
return;
|
|
423
424
|
ae(!0);
|
|
424
425
|
const e = E.loading("Refining image...", {
|
|
425
426
|
description: "This may take 10-30 seconds. Please wait."
|
|
@@ -450,7 +451,8 @@ function Nr({
|
|
|
450
451
|
if (R && R.trim()) {
|
|
451
452
|
const G = R.trim();
|
|
452
453
|
a(G) && d && d !== "Generated image" && d.trim() ? b = d.trim() : b = G;
|
|
453
|
-
} else
|
|
454
|
+
} else
|
|
455
|
+
d && d !== "Generated image" && d.trim() && (b = d.trim());
|
|
454
456
|
b ? r = `${b} with ${n}` : r = n;
|
|
455
457
|
const he = (await Bt({
|
|
456
458
|
content: `Generate Image: ${r}`,
|
|
@@ -472,12 +474,13 @@ function Nr({
|
|
|
472
474
|
description: r.message,
|
|
473
475
|
duration: 8e3
|
|
474
476
|
});
|
|
475
|
-
} else
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
477
|
+
} else
|
|
478
|
+
r instanceof Ft ? E.error("Credits Issue", {
|
|
479
|
+
description: r.message,
|
|
480
|
+
duration: 8e3
|
|
481
|
+
}) : E.error("Failed to refine image", {
|
|
482
|
+
description: r instanceof Error ? r.message : "Unknown error. Please try again."
|
|
483
|
+
});
|
|
481
484
|
} finally {
|
|
482
485
|
ae(!1);
|
|
483
486
|
}
|