eddyter 1.4.6 → 1.4.7
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/{generateDocxThumbnail-BgIdOWg3.js → generateDocxThumbnail-CsyiVRDN.js} +1 -1
- package/dist/{generatePdfThumbnail-DZ8_E1lJ.js → generatePdfThumbnail-DCt8gJMy.js} +1 -1
- package/dist/{generateXlsxThumbnail-B_vFMM-q.js → generateXlsxThumbnail-DgeyjjM-.js} +1 -1
- package/dist/{html2pdf.bundle.min-CDLnol6o.js → html2pdf.bundle.min-Da_gEqE8.js} +1 -1
- package/dist/{index-B6FDh2NJ.js → index-Bq1EWxza.js} +4 -4
- package/dist/{index-DtbCbxgA.js → index-CoO1ZeVi.js} +105 -106
- package/dist/{index-CU78ju_h.js → index-Cs_v2OZr.js} +22524 -19444
- package/dist/{index-CVkebuOP.js → index-DAqL9TB6.js} +65 -66
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as Tt, w as Se, K as Ce, h as xe } from "./index-
|
|
1
|
+
import { v as Tt, w as Se, K as Ce, h as xe } from "./index-Cs_v2OZr.js";
|
|
2
2
|
import { h as Ee } from "./html2canvas.esm-C2wu93Kq.js";
|
|
3
3
|
function Ft(c) {
|
|
4
4
|
throw new Error('Could not dynamically require "' + c + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as Ci } from "./html2canvas.esm-C2wu93Kq.js";
|
|
2
|
-
import { K as yi, h as Di } from "./index-
|
|
2
|
+
import { K as yi, h as Di } from "./index-Cs_v2OZr.js";
|
|
3
3
|
var In = 1252, Oi = [874, 932, 936, 949, 950, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1e4], Zt = {
|
|
4
4
|
/*::[*/
|
|
5
5
|
0: 1252,
|
|
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
|
2
2
|
import { useLexicalComposerContext as B } from "@lexical/react/LexicalComposerContext";
|
|
3
3
|
import { $getNodeByKey as b } from "lexical";
|
|
4
4
|
import { useState as E, useEffect as N } from "react";
|
|
5
|
-
import { x as y, y as k, z as I, F as x, G as T, H as W } from "./index-
|
|
5
|
+
import { x as y, y as k, z as I, F as x, G as T, H as W } from "./index-Cs_v2OZr.js";
|
|
6
6
|
function $(e, t) {
|
|
7
7
|
const c = e.split(".").pop()?.toLowerCase();
|
|
8
8
|
return c === "pdf" || t.startsWith("data:application/pdf") ? "pdf" : c === "docx" || t.startsWith("data:application/vnd.openxmlformats") && e.toLowerCase().endsWith(".docx") ? "docx" : c === "xlsx" || c === "xls" || t.startsWith("data:application/vnd.openxmlformats-officedocument.spreadsheetml") || t.startsWith("data:application/vnd.ms-excel") ? "xlsx" : null;
|
|
@@ -16,15 +16,15 @@ function z(e, t) {
|
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
let l = !1;
|
|
19
|
-
return d === "pdf" ? import("./generatePdfThumbnail-
|
|
19
|
+
return d === "pdf" ? import("./generatePdfThumbnail-DCt8gJMy.js").then(({ generatePdfThumbnail: o }) => o(e)).then((o) => {
|
|
20
20
|
l || n(o);
|
|
21
21
|
}).catch(() => {
|
|
22
22
|
l || n(null);
|
|
23
|
-
}) : d === "docx" ? import("./generateDocxThumbnail-
|
|
23
|
+
}) : d === "docx" ? import("./generateDocxThumbnail-CsyiVRDN.js").then(({ generateDocxThumbnail: o }) => o(e)).then((o) => {
|
|
24
24
|
l || n(o);
|
|
25
25
|
}).catch(() => {
|
|
26
26
|
l || n(null);
|
|
27
|
-
}) : d === "xlsx" && import("./generateXlsxThumbnail-
|
|
27
|
+
}) : d === "xlsx" && import("./generateXlsxThumbnail-DgeyjjM-.js").then(({ generateXlsxThumbnail: o }) => o(e)).then((o) => {
|
|
28
28
|
l || n(o);
|
|
29
29
|
}).catch(() => {
|
|
30
30
|
l || n(null);
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { jsx as r, jsxs as h, Fragment as Kt } from "react/jsx-runtime";
|
|
2
2
|
import { I as _e } from "./ImageResizer-C5luyjPa.js";
|
|
3
|
-
import {
|
|
4
|
-
import { LinkNode as
|
|
5
|
-
import { AutoFocusPlugin as
|
|
6
|
-
import { useCollaborationContext as
|
|
7
|
-
import { useLexicalComposerContext as
|
|
8
|
-
import { ContentEditable as
|
|
9
|
-
import { LexicalErrorBoundary as
|
|
10
|
-
import { HistoryPlugin as
|
|
11
|
-
import { LexicalNestedComposer as
|
|
12
|
-
import { OnChangePlugin as
|
|
13
|
-
import { RichTextPlugin as
|
|
14
|
-
import { useLexicalEditable as
|
|
15
|
-
import { useLexicalNodeSelection as
|
|
16
|
-
import { mergeRegister as
|
|
17
|
-
import { RootNode as
|
|
18
|
-
import wt, { useState as I, useRef as V, useMemo as
|
|
19
|
-
import { c as vt, D as ge, a as fe, b as he, d as pe, e as be, f as ye, B as Vt, L as xe, i as we, C as It, I as or, S as ir, u as ar, $ as et, t as M, g as nr, h as sr, j as dr, W as cr, k as lr, A as ur, l as mr, m as gr, T as fr, n as hr, o as pr, E as br, p as yr, X as xr, q as wr, r as vr, s as Cr } from "./index-CU78ju_h.js";
|
|
3
|
+
import { c as vt, D as ee, a as re, b as oe, d as ie, e as ae, f as ne, B as Gt, M as se, L as de, i as ce, C as It, I as Oe, S as He, u as Fe, $ as tt, t as M, g as Xe, h as Be, j as Ue, W as Ke, k as Ge, A as qe, l as Ve, m as Je, T as Qe, n as Ze, o as tr, E as er, p as rr, X as or, q as ir, r as ar, s as nr } from "./index-Cs_v2OZr.js";
|
|
4
|
+
import { LinkNode as le } from "@lexical/link";
|
|
5
|
+
import { AutoFocusPlugin as sr } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
6
|
+
import { useCollaborationContext as dr } from "@lexical/react/LexicalCollaborationContext";
|
|
7
|
+
import { useLexicalComposerContext as cr } from "@lexical/react/LexicalComposerContext";
|
|
8
|
+
import { ContentEditable as ue } from "@lexical/react/LexicalContentEditable";
|
|
9
|
+
import { LexicalErrorBoundary as me } from "@lexical/react/LexicalErrorBoundary";
|
|
10
|
+
import { HistoryPlugin as ge } from "@lexical/react/LexicalHistoryPlugin";
|
|
11
|
+
import { LexicalNestedComposer as fe } from "@lexical/react/LexicalNestedComposer";
|
|
12
|
+
import { OnChangePlugin as he } from "@lexical/react/LexicalOnChangePlugin";
|
|
13
|
+
import { RichTextPlugin as pe } from "@lexical/react/LexicalRichTextPlugin";
|
|
14
|
+
import { useLexicalEditable as lr } from "@lexical/react/useLexicalEditable";
|
|
15
|
+
import { useLexicalNodeSelection as ur } from "@lexical/react/useLexicalNodeSelection";
|
|
16
|
+
import { mergeRegister as mr } from "@lexical/utils";
|
|
17
|
+
import { RootNode as be, TextNode as ye, LineBreakNode as xe, ParagraphNode as we, $isNodeSelection as st, $getSelection as dt, $isParagraphNode as Yt, $setSelection as xt, $isRangeSelection as gr, SELECTION_CHANGE_COMMAND as fr, COMMAND_PRIORITY_LOW as et, CLICK_COMMAND as hr, DRAGSTART_COMMAND as pr, KEY_DELETE_COMMAND as br, KEY_BACKSPACE_COMMAND as yr, KEY_ENTER_COMMAND as xr, KEY_ESCAPE_COMMAND as wr, $getNodeByKey as ct, createCommand as vr } from "lexical";
|
|
18
|
+
import wt, { useState as I, useRef as V, useMemo as qt, useCallback as S, useEffect as rt, useLayoutEffect as Vt, Suspense as Cr } from "react";
|
|
20
19
|
import "react-dom";
|
|
21
20
|
const ve = vt("Crop", [
|
|
22
21
|
["path", { d: "M6 2v14a2 2 0 0 0 2 2h14", key: "ron5a4" }],
|
|
@@ -43,13 +42,13 @@ const kr = vt("RotateCcw", [
|
|
|
43
42
|
newImageUrl: d,
|
|
44
43
|
onReplace: N,
|
|
45
44
|
onCancel: w
|
|
46
|
-
}) => /* @__PURE__ */ r(
|
|
47
|
-
/* @__PURE__ */ h(
|
|
48
|
-
/* @__PURE__ */ h(
|
|
45
|
+
}) => /* @__PURE__ */ r(ee, { open: i, onOpenChange: o, children: /* @__PURE__ */ h(re, { className: "sm:max-w-[800px] max-h-[90vh] overflow-y-auto", children: [
|
|
46
|
+
/* @__PURE__ */ h(oe, { children: [
|
|
47
|
+
/* @__PURE__ */ h(ie, { className: "flex items-center gap-2 text-xl", children: [
|
|
49
48
|
/* @__PURE__ */ r("span", { className: "text-2xl", children: "🔄" }),
|
|
50
49
|
"Compare Images"
|
|
51
50
|
] }),
|
|
52
|
-
/* @__PURE__ */ r(
|
|
51
|
+
/* @__PURE__ */ r(ae, { className: "text-sm pt-1", children: "Choose whether to replace the original image with the refined version." })
|
|
53
52
|
] }),
|
|
54
53
|
/* @__PURE__ */ h("div", { className: "space-y-4 py-4", children: [
|
|
55
54
|
/* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ h("div", { className: "space-y-2", children: [
|
|
@@ -71,9 +70,9 @@ const kr = vt("RotateCcw", [
|
|
|
71
70
|
' Clicking "Replace" will update the image in your document. This action cannot be undone.'
|
|
72
71
|
] }) })
|
|
73
72
|
] }),
|
|
74
|
-
/* @__PURE__ */ h(
|
|
73
|
+
/* @__PURE__ */ h(ne, { className: "gap-2", children: [
|
|
75
74
|
/* @__PURE__ */ r(
|
|
76
|
-
|
|
75
|
+
Gt,
|
|
77
76
|
{
|
|
78
77
|
variant: "outline",
|
|
79
78
|
onClick: w,
|
|
@@ -81,7 +80,7 @@ const kr = vt("RotateCcw", [
|
|
|
81
80
|
}
|
|
82
81
|
),
|
|
83
82
|
/* @__PURE__ */ h(
|
|
84
|
-
|
|
83
|
+
Gt,
|
|
85
84
|
{
|
|
86
85
|
onClick: N,
|
|
87
86
|
className: "bg-blue-500 hover:bg-blue-600 text-white",
|
|
@@ -97,23 +96,23 @@ function Er({
|
|
|
97
96
|
caption: i
|
|
98
97
|
}) {
|
|
99
98
|
return /* @__PURE__ */ r("div", { className: "signature-caption-container", children: /* @__PURE__ */ h(
|
|
100
|
-
|
|
99
|
+
fe,
|
|
101
100
|
{
|
|
102
101
|
initialEditor: i,
|
|
103
102
|
initialNodes: [
|
|
104
|
-
|
|
103
|
+
be,
|
|
104
|
+
ye,
|
|
105
|
+
xe,
|
|
106
|
+
we,
|
|
105
107
|
le,
|
|
106
|
-
|
|
107
|
-
me,
|
|
108
|
-
re,
|
|
109
|
-
ee
|
|
108
|
+
se
|
|
110
109
|
],
|
|
111
110
|
children: [
|
|
112
111
|
/* @__PURE__ */ r(
|
|
113
|
-
|
|
112
|
+
pe,
|
|
114
113
|
{
|
|
115
114
|
contentEditable: /* @__PURE__ */ r(
|
|
116
|
-
|
|
115
|
+
ue,
|
|
117
116
|
{
|
|
118
117
|
"aria-placeholder": "Enter signature name...",
|
|
119
118
|
placeholder: /* @__PURE__ */ r("div", { style: {
|
|
@@ -129,13 +128,13 @@ function Er({
|
|
|
129
128
|
className: "signature-caption-editable"
|
|
130
129
|
}
|
|
131
130
|
),
|
|
132
|
-
ErrorBoundary:
|
|
131
|
+
ErrorBoundary: me
|
|
133
132
|
}
|
|
134
133
|
),
|
|
135
|
-
/* @__PURE__ */ r(
|
|
134
|
+
/* @__PURE__ */ r(he, { onChange: () => {
|
|
136
135
|
} }),
|
|
137
|
-
/* @__PURE__ */ r(
|
|
138
|
-
/* @__PURE__ */ r(
|
|
136
|
+
/* @__PURE__ */ r(ge, {}),
|
|
137
|
+
/* @__PURE__ */ r(de, { namespace: ce.namespace })
|
|
139
138
|
]
|
|
140
139
|
}
|
|
141
140
|
) });
|
|
@@ -379,7 +378,7 @@ function Wr({
|
|
|
379
378
|
height: w,
|
|
380
379
|
onCropApply: L
|
|
381
380
|
}) {
|
|
382
|
-
const [P, k] = I("freeform"), [v, E] = I(e), [c, C] = I(!1), y = V(null), D = V(null), [n, W] = I({ x: 0, y: 0, width: 0, height: 0 }), [R, $] = I({ x: 0, y: 0, width: 0, height: 0 }), ot = V(null), lt =
|
|
381
|
+
const [P, k] = I("freeform"), [v, E] = I(e), [c, C] = I(!1), y = V(null), D = V(null), [n, W] = I({ x: 0, y: 0, width: 0, height: 0 }), [R, $] = I({ x: 0, y: 0, width: 0, height: 0 }), ot = V(null), lt = qt(() => typeof N == "number" && typeof w == "number" && w > 0 ? N / w : n.width > 0 && n.height > 0 ? n.width / n.height : null, [n.height, n.width, w, N]), pt = qt(() => {
|
|
383
382
|
switch (P) {
|
|
384
383
|
case "original":
|
|
385
384
|
return lt;
|
|
@@ -537,8 +536,8 @@ function Wr({
|
|
|
537
536
|
j
|
|
538
537
|
]), rt(() => {
|
|
539
538
|
i && bt(pt);
|
|
540
|
-
}, [i, pt, n, bt]), /* @__PURE__ */ r(
|
|
541
|
-
|
|
539
|
+
}, [i, pt, n, bt]), /* @__PURE__ */ r(ee, { open: i, onOpenChange: o, children: /* @__PURE__ */ r(
|
|
540
|
+
re,
|
|
542
541
|
{
|
|
543
542
|
className: "sm:cteditor-max-w-[860px] cteditor-max-w-[calc(100%-2rem)] cteditor-rounded-xl cteditor-overflow-hidden cteditor-p-0",
|
|
544
543
|
onClick: (s) => s.stopPropagation(),
|
|
@@ -624,17 +623,17 @@ function Wr({
|
|
|
624
623
|
}
|
|
625
624
|
) }),
|
|
626
625
|
/* @__PURE__ */ h("div", { className: "cteditor-p-4 md:cteditor-p-5 cteditor-border-l cteditor-border-border cteditor-bg-background", children: [
|
|
627
|
-
/* @__PURE__ */ h(
|
|
628
|
-
/* @__PURE__ */ r(
|
|
629
|
-
/* @__PURE__ */ r(
|
|
626
|
+
/* @__PURE__ */ h(oe, { className: "cteditor-mb-4 cteditor-space-y-1", children: [
|
|
627
|
+
/* @__PURE__ */ r(ie, { children: "Crop" }),
|
|
628
|
+
/* @__PURE__ */ r(ae, { children: "Choose an aspect ratio and adjust the crop area, then click Apply." })
|
|
630
629
|
] }),
|
|
631
630
|
/* @__PURE__ */ h("div", { className: "cteditor-space-y-4", children: [
|
|
632
631
|
/* @__PURE__ */ h("div", { children: [
|
|
633
632
|
/* @__PURE__ */ r("p", { className: "cteditor-text-sm cteditor-font-medium cteditor-mb-2", children: "Aspect ratio" }),
|
|
634
633
|
/* @__PURE__ */ r("div", { className: "cteditor-grid cteditor-grid-cols-3 cteditor-gap-2", children: [
|
|
635
634
|
{ id: "freeform", label: "Freeform", icon: ve },
|
|
636
|
-
{ id: "original", label: "Original", icon:
|
|
637
|
-
{ id: "1:1", label: "1:1", icon:
|
|
635
|
+
{ id: "original", label: "Original", icon: Oe },
|
|
636
|
+
{ id: "1:1", label: "1:1", icon: He },
|
|
638
637
|
{ id: "4:3", label: "4:3", icon: Jt },
|
|
639
638
|
{ id: "16:9", label: "16:9", icon: Jt },
|
|
640
639
|
{ id: "3:4", label: "3:4", icon: Qt },
|
|
@@ -674,7 +673,7 @@ function Wr({
|
|
|
674
673
|
] })
|
|
675
674
|
] })
|
|
676
675
|
] }),
|
|
677
|
-
/* @__PURE__ */ h(
|
|
676
|
+
/* @__PURE__ */ h(ne, { className: "cteditor-gap-2 cteditor-mt-4", children: [
|
|
678
677
|
/* @__PURE__ */ r(
|
|
679
678
|
"button",
|
|
680
679
|
{
|
|
@@ -710,7 +709,7 @@ function Wr({
|
|
|
710
709
|
}
|
|
711
710
|
) });
|
|
712
711
|
}
|
|
713
|
-
const Et = /* @__PURE__ */ new Set(), te =
|
|
712
|
+
const Et = /* @__PURE__ */ new Set(), te = vr("RIGHT_CLICK_IMAGE_COMMAND");
|
|
714
713
|
function jr(i) {
|
|
715
714
|
if (!Et.has(i))
|
|
716
715
|
throw new Promise((o) => {
|
|
@@ -782,7 +781,7 @@ function _r() {
|
|
|
782
781
|
}
|
|
783
782
|
);
|
|
784
783
|
}
|
|
785
|
-
function
|
|
784
|
+
function so({
|
|
786
785
|
src: i,
|
|
787
786
|
altText: o,
|
|
788
787
|
nodeKey: e,
|
|
@@ -797,8 +796,8 @@ function co({
|
|
|
797
796
|
position: c = "none",
|
|
798
797
|
linkUrl: C
|
|
799
798
|
}) {
|
|
800
|
-
const y = V(null), D = V(null), [n, W, R] =
|
|
801
|
-
|
|
799
|
+
const y = V(null), D = V(null), [n, W, R] = ur(e), [$, ot] = I(!1), lt = V(!1), { isCollabActive: pt } = dr(), [m] = cr(), [j, bt] = I(null), it = V(null), [J, Pt] = I(!1), St = lr(), [s, p] = I(!1), [b, g] = I(""), [x, F] = I(!1), [ut, mt] = I(!1), [Q, K] = I(""), [at, _] = I(""), [G, A] = I(!1), O = V(null), [Z, X] = I(0), [B, gt] = I(!1), Ct = V(null), [Ne, yt] = I(null), [zt, Mt] = I(!1), Nt = Fe()?.apiKey, At = Z > 0 && Z < 350;
|
|
800
|
+
Vt(() => {
|
|
802
801
|
if (!n || !st(j) || J) {
|
|
803
802
|
yt(null);
|
|
804
803
|
return;
|
|
@@ -838,7 +837,7 @@ function co({
|
|
|
838
837
|
const a = new ResizeObserver(t);
|
|
839
838
|
return a.observe(y.current), () => a.disconnect();
|
|
840
839
|
}
|
|
841
|
-
}, [d, N, n]),
|
|
840
|
+
}, [d, N, n]), Vt(() => {
|
|
842
841
|
if ((c === "left" || c === "right") && typeof d == "number" && y.current) {
|
|
843
842
|
const t = y.current.closest(".editor-image"), a = t?.parentElement, l = m.getRootElement(), u = l ? l.getBoundingClientRect().width : d + 32, f = `${Math.min(d + 32, u)}px`;
|
|
844
843
|
return t && (t.style.removeProperty("display"), t.style.setProperty("max-width", f, "important")), a && a.style.setProperty("max-width", f, "important"), () => {
|
|
@@ -851,7 +850,7 @@ function co({
|
|
|
851
850
|
const a = dt();
|
|
852
851
|
return n && st(a) && (t.preventDefault(), m.update(() => {
|
|
853
852
|
a.getNodes().forEach((u) => {
|
|
854
|
-
if (
|
|
853
|
+
if (tt(u)) {
|
|
855
854
|
const f = u.getParent();
|
|
856
855
|
u.remove(), f && Yt(f) && f.getChildrenSize() === 0 && f.setFormat("left");
|
|
857
856
|
}
|
|
@@ -899,7 +898,7 @@ function co({
|
|
|
899
898
|
(t) => {
|
|
900
899
|
m.getEditorState().read(() => {
|
|
901
900
|
const a = dt();
|
|
902
|
-
t.target.tagName === "IMG" &&
|
|
901
|
+
t.target.tagName === "IMG" && gr(a) && a.getNodes().length === 1 && m.dispatchCommand(
|
|
903
902
|
te,
|
|
904
903
|
t
|
|
905
904
|
);
|
|
@@ -909,45 +908,45 @@ function co({
|
|
|
909
908
|
);
|
|
910
909
|
rt(() => {
|
|
911
910
|
let t = !0;
|
|
912
|
-
const a = m.getRootElement(), l =
|
|
911
|
+
const a = m.getRootElement(), l = mr(
|
|
913
912
|
m.registerUpdateListener(({ editorState: u }) => {
|
|
914
913
|
t && bt(u.read(() => dt()));
|
|
915
914
|
}),
|
|
916
915
|
m.registerCommand(
|
|
917
|
-
|
|
916
|
+
fr,
|
|
918
917
|
(u, f) => (it.current = f, !1),
|
|
919
|
-
|
|
918
|
+
et
|
|
920
919
|
),
|
|
921
920
|
m.registerCommand(
|
|
922
|
-
|
|
921
|
+
hr,
|
|
923
922
|
Lt,
|
|
924
|
-
|
|
923
|
+
et
|
|
925
924
|
),
|
|
926
925
|
m.registerCommand(
|
|
927
926
|
te,
|
|
928
927
|
Lt,
|
|
929
|
-
|
|
928
|
+
et
|
|
930
929
|
),
|
|
931
930
|
m.registerCommand(
|
|
932
|
-
|
|
931
|
+
pr,
|
|
933
932
|
(u) => u.target === y.current ? (u.preventDefault(), !0) : !1,
|
|
934
|
-
|
|
933
|
+
et
|
|
935
934
|
),
|
|
936
935
|
m.registerCommand(
|
|
937
|
-
|
|
936
|
+
br,
|
|
938
937
|
Dt,
|
|
939
|
-
|
|
938
|
+
et
|
|
940
939
|
),
|
|
941
940
|
m.registerCommand(
|
|
942
|
-
|
|
941
|
+
yr,
|
|
943
942
|
Dt,
|
|
944
|
-
|
|
943
|
+
et
|
|
945
944
|
),
|
|
946
|
-
m.registerCommand(
|
|
945
|
+
m.registerCommand(xr, Ot, et),
|
|
947
946
|
m.registerCommand(
|
|
948
|
-
|
|
947
|
+
wr,
|
|
949
948
|
Ht,
|
|
950
|
-
|
|
949
|
+
et
|
|
951
950
|
)
|
|
952
951
|
);
|
|
953
952
|
return a?.addEventListener("contextmenu", $t), () => {
|
|
@@ -969,14 +968,14 @@ function co({
|
|
|
969
968
|
const ke = () => {
|
|
970
969
|
m.update(() => {
|
|
971
970
|
const t = ct(e);
|
|
972
|
-
|
|
971
|
+
tt(t) && t.setShowCaption(!0);
|
|
973
972
|
});
|
|
974
973
|
}, Re = (t, a) => {
|
|
975
974
|
lt.current = !1, setTimeout(() => {
|
|
976
975
|
ot(!1);
|
|
977
976
|
}, 200), m.update(() => {
|
|
978
977
|
const l = ct(e);
|
|
979
|
-
|
|
978
|
+
tt(l) && l.setWidthAndHeight(t, a);
|
|
980
979
|
});
|
|
981
980
|
}, Ee = () => {
|
|
982
981
|
lt.current = !0, ot(!0);
|
|
@@ -1014,7 +1013,7 @@ function co({
|
|
|
1014
1013
|
}, Pe = (t) => {
|
|
1015
1014
|
t.preventDefault(), t.stopPropagation(), m.update(() => {
|
|
1016
1015
|
const a = ct(e);
|
|
1017
|
-
if (
|
|
1016
|
+
if (tt(a)) {
|
|
1018
1017
|
const l = a.getParent();
|
|
1019
1018
|
a.remove(), l && Yt(l) && l.getChildrenSize() === 0 && l.setFormat("left");
|
|
1020
1019
|
}
|
|
@@ -1022,7 +1021,7 @@ function co({
|
|
|
1022
1021
|
}, ft = (t, a) => {
|
|
1023
1022
|
t.preventDefault(), t.stopPropagation(), m.update(() => {
|
|
1024
1023
|
const l = ct(e);
|
|
1025
|
-
if (
|
|
1024
|
+
if (tt(l)) {
|
|
1026
1025
|
l.setPosition(a);
|
|
1027
1026
|
const u = l.getParent();
|
|
1028
1027
|
u && Yt(u) && (a === "left" ? u.setFormat("left") : a === "right" ? u.setFormat("right") : u.setFormat(""));
|
|
@@ -1041,7 +1040,7 @@ function co({
|
|
|
1041
1040
|
m.update(
|
|
1042
1041
|
() => {
|
|
1043
1042
|
const z = ct(e);
|
|
1044
|
-
if (!
|
|
1043
|
+
if (!tt(z))
|
|
1045
1044
|
return;
|
|
1046
1045
|
z.setSrc(a), z.setWidthAndHeight("inherit", "inherit");
|
|
1047
1046
|
const T = dt();
|
|
@@ -1067,8 +1066,8 @@ function co({
|
|
|
1067
1066
|
}
|
|
1068
1067
|
const u = M.loading("Uploading image…");
|
|
1069
1068
|
try {
|
|
1070
|
-
a = (await
|
|
1071
|
-
|
|
1069
|
+
a = (await Xe.post(
|
|
1070
|
+
Be.project.fileUploadFromUrl,
|
|
1072
1071
|
{ url: i, prefix: "uploads" },
|
|
1073
1072
|
{ headers: { "x-api-key": Nt } }
|
|
1074
1073
|
)).data.fileUrl, M.dismiss(u);
|
|
@@ -1084,7 +1083,7 @@ function co({
|
|
|
1084
1083
|
}
|
|
1085
1084
|
Mt(!0), m.update(() => {
|
|
1086
1085
|
const u = ct(e);
|
|
1087
|
-
if (!
|
|
1086
|
+
if (!tt(u))
|
|
1088
1087
|
return;
|
|
1089
1088
|
u.setSrc(l), u.setWidthAndHeight(t.width, t.height);
|
|
1090
1089
|
const f = dt();
|
|
@@ -1142,7 +1141,7 @@ function co({
|
|
|
1142
1141
|
} else
|
|
1143
1142
|
o && o !== "Generated image" && o.trim() && (z = o.trim());
|
|
1144
1143
|
z ? a = `${z} with ${u}` : a = u;
|
|
1145
|
-
const T = await fetch(`${
|
|
1144
|
+
const T = await fetch(`${ir}/agent/stream`, {
|
|
1146
1145
|
method: "POST",
|
|
1147
1146
|
headers: { "Content-Type": "application/json" },
|
|
1148
1147
|
body: JSON.stringify({
|
|
@@ -1194,14 +1193,14 @@ function co({
|
|
|
1194
1193
|
description: "Compare the images and choose which to keep."
|
|
1195
1194
|
}), K(nt), _(a), mt(!0), g(""), p(!1);
|
|
1196
1195
|
} catch (a) {
|
|
1197
|
-
if (M.dismiss(t), a instanceof
|
|
1196
|
+
if (M.dismiss(t), a instanceof ar) {
|
|
1198
1197
|
const l = a.code === "API_KEYS_DISABLED" ? "API Keys Disabled" : "API Key Required";
|
|
1199
1198
|
M.error(l, {
|
|
1200
1199
|
description: a.message,
|
|
1201
1200
|
duration: 8e3
|
|
1202
1201
|
});
|
|
1203
1202
|
} else
|
|
1204
|
-
a instanceof
|
|
1203
|
+
a instanceof nr ? M.error("Credits Issue", {
|
|
1205
1204
|
description: a.message,
|
|
1206
1205
|
duration: 8e3
|
|
1207
1206
|
}) : M.error("Failed to refine image", {
|
|
@@ -1213,7 +1212,7 @@ function co({
|
|
|
1213
1212
|
}, $e = () => {
|
|
1214
1213
|
m.update(() => {
|
|
1215
1214
|
const t = ct(e);
|
|
1216
|
-
if (
|
|
1215
|
+
if (tt(t)) {
|
|
1217
1216
|
t.setSrc(Q), t.setOriginalPrompt(at);
|
|
1218
1217
|
const a = dt();
|
|
1219
1218
|
a && xt(a.clone());
|
|
@@ -1265,7 +1264,7 @@ function co({
|
|
|
1265
1264
|
},
|
|
1266
1265
|
[$, n, W, R]
|
|
1267
1266
|
);
|
|
1268
|
-
return /* @__PURE__ */ r(
|
|
1267
|
+
return /* @__PURE__ */ r(Cr, { fallback: null, children: /* @__PURE__ */ h(Kt, { children: [
|
|
1269
1268
|
/* @__PURE__ */ h(
|
|
1270
1269
|
"div",
|
|
1271
1270
|
{
|
|
@@ -1296,7 +1295,7 @@ function co({
|
|
|
1296
1295
|
}
|
|
1297
1296
|
),
|
|
1298
1297
|
/* @__PURE__ */ h("div", { className: "cteditor-absolute cteditor-inset-0 cteditor-flex cteditor-flex-col cteditor-items-center cteditor-justify-center cteditor-rounded-lg cteditor-bg-muted", children: [
|
|
1299
|
-
/* @__PURE__ */ r(
|
|
1298
|
+
/* @__PURE__ */ r(Ue, { className: "cteditor-w-10 cteditor-h-10 cteditor-text-muted-foreground cteditor-animate-spin cteditor-mb-2", "aria-hidden": !0 }),
|
|
1300
1299
|
/* @__PURE__ */ r("span", { className: "cteditor-text-sm cteditor-font-medium cteditor-text-muted-foreground", children: "Applying crop…" })
|
|
1301
1300
|
] })
|
|
1302
1301
|
]
|
|
@@ -1348,7 +1347,7 @@ function co({
|
|
|
1348
1347
|
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "left" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1349
1348
|
"aria-label": "Wrap text left",
|
|
1350
1349
|
title: "Wrap text left",
|
|
1351
|
-
children: /* @__PURE__ */ r(
|
|
1350
|
+
children: /* @__PURE__ */ r(Ke, {})
|
|
1352
1351
|
}
|
|
1353
1352
|
),
|
|
1354
1353
|
/* @__PURE__ */ r(
|
|
@@ -1358,7 +1357,7 @@ function co({
|
|
|
1358
1357
|
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "right" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1359
1358
|
"aria-label": "Wrap text right",
|
|
1360
1359
|
title: "Wrap text right",
|
|
1361
|
-
children: /* @__PURE__ */ r(
|
|
1360
|
+
children: /* @__PURE__ */ r(Ge, {})
|
|
1362
1361
|
}
|
|
1363
1362
|
),
|
|
1364
1363
|
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-foreground/10 cteditor-mx-0.5" }),
|
|
@@ -1369,7 +1368,7 @@ function co({
|
|
|
1369
1368
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "inline-left" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1370
1369
|
"aria-label": "Align left",
|
|
1371
1370
|
title: "Align left (no text wrap)",
|
|
1372
|
-
children: /* @__PURE__ */ r(
|
|
1371
|
+
children: /* @__PURE__ */ r(qe, {})
|
|
1373
1372
|
}
|
|
1374
1373
|
),
|
|
1375
1374
|
/* @__PURE__ */ r(
|
|
@@ -1379,7 +1378,7 @@ function co({
|
|
|
1379
1378
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "inline-center" || c === "full" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1380
1379
|
"aria-label": "Align center",
|
|
1381
1380
|
title: "Align center (no text wrap)",
|
|
1382
|
-
children: /* @__PURE__ */ r(
|
|
1381
|
+
children: /* @__PURE__ */ r(Ve, {})
|
|
1383
1382
|
}
|
|
1384
1383
|
),
|
|
1385
1384
|
/* @__PURE__ */ r(
|
|
@@ -1389,7 +1388,7 @@ function co({
|
|
|
1389
1388
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "inline-right" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1390
1389
|
"aria-label": "Align right",
|
|
1391
1390
|
title: "Align right (no text wrap)",
|
|
1392
|
-
children: /* @__PURE__ */ r(
|
|
1391
|
+
children: /* @__PURE__ */ r(Je, {})
|
|
1393
1392
|
}
|
|
1394
1393
|
),
|
|
1395
1394
|
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-foreground/10 cteditor-mx-0.5" }),
|
|
@@ -1400,7 +1399,7 @@ function co({
|
|
|
1400
1399
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "none" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1401
1400
|
"aria-label": "Inline",
|
|
1402
1401
|
title: "Inline with text",
|
|
1403
|
-
children: /* @__PURE__ */ r(
|
|
1402
|
+
children: /* @__PURE__ */ r(Qe, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
1404
1403
|
}
|
|
1405
1404
|
),
|
|
1406
1405
|
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-foreground/10 cteditor-mx-0.5" }),
|
|
@@ -1434,7 +1433,7 @@ function co({
|
|
|
1434
1433
|
className: " cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-accent/95 cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1435
1434
|
"aria-label": "Visit link",
|
|
1436
1435
|
title: `Visit: ${C}`,
|
|
1437
|
-
children: /* @__PURE__ */ r(
|
|
1436
|
+
children: /* @__PURE__ */ r(Ze, {})
|
|
1438
1437
|
}
|
|
1439
1438
|
),
|
|
1440
1439
|
E && /* @__PURE__ */ r(
|
|
@@ -1446,7 +1445,7 @@ function co({
|
|
|
1446
1445
|
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-accent/90 cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1447
1446
|
"aria-label": "Refine image",
|
|
1448
1447
|
title: "Refine image",
|
|
1449
|
-
children: /* @__PURE__ */ r(
|
|
1448
|
+
children: /* @__PURE__ */ r(tr, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
1450
1449
|
}
|
|
1451
1450
|
),
|
|
1452
1451
|
/* @__PURE__ */ r(
|
|
@@ -1458,7 +1457,7 @@ function co({
|
|
|
1458
1457
|
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-accent/90 cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1459
1458
|
"aria-label": "Open image in new tab",
|
|
1460
1459
|
title: "Open in new tab",
|
|
1461
|
-
children: /* @__PURE__ */ r(
|
|
1460
|
+
children: /* @__PURE__ */ r(er, {})
|
|
1462
1461
|
}
|
|
1463
1462
|
),
|
|
1464
1463
|
/* @__PURE__ */ r(
|
|
@@ -1470,7 +1469,7 @@ function co({
|
|
|
1470
1469
|
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-destructive hover:cteditor-text-destructive-foreground cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1471
1470
|
"aria-label": "Delete image",
|
|
1472
1471
|
title: "Delete image",
|
|
1473
|
-
children: /* @__PURE__ */ r(
|
|
1472
|
+
children: /* @__PURE__ */ r(rr, {})
|
|
1474
1473
|
}
|
|
1475
1474
|
)
|
|
1476
1475
|
]
|
|
@@ -1530,7 +1529,7 @@ function co({
|
|
|
1530
1529
|
},
|
|
1531
1530
|
disabled: x,
|
|
1532
1531
|
className: "cteditor-size-9 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-text-sm cteditor-rounded-md cteditor-bg-background cteditor-border cteditor-border-border cteditor-text-foreground hover:cteditor-bg-accent disabled:cteditor-opacity-50 disabled:cteditor-cursor-not-allowed cteditor-transition-colors",
|
|
1533
|
-
children: /* @__PURE__ */ r(
|
|
1532
|
+
children: /* @__PURE__ */ r(or, { size: 16 })
|
|
1534
1533
|
}
|
|
1535
1534
|
)
|
|
1536
1535
|
] })
|
|
@@ -1565,42 +1564,42 @@ function co({
|
|
|
1565
1564
|
...c === "inline-center" || c === "full" ? { margin: "0 auto" } : c === "inline-right" ? { marginLeft: "auto" } : c === "left" ? { float: "left", clear: "left" } : c === "right" ? { float: "right", clear: "right" } : {}
|
|
1566
1565
|
},
|
|
1567
1566
|
children: /* @__PURE__ */ h(
|
|
1568
|
-
|
|
1567
|
+
fe,
|
|
1569
1568
|
{
|
|
1570
1569
|
initialEditor: k,
|
|
1571
1570
|
initialNodes: [
|
|
1572
|
-
|
|
1571
|
+
be,
|
|
1572
|
+
ye,
|
|
1573
|
+
xe,
|
|
1574
|
+
we,
|
|
1573
1575
|
le,
|
|
1574
|
-
|
|
1575
|
-
me,
|
|
1576
|
-
re,
|
|
1577
|
-
ee
|
|
1576
|
+
se
|
|
1578
1577
|
],
|
|
1579
1578
|
children: [
|
|
1580
|
-
/* @__PURE__ */ r(
|
|
1579
|
+
/* @__PURE__ */ r(sr, {}),
|
|
1581
1580
|
/* @__PURE__ */ r(
|
|
1582
|
-
|
|
1581
|
+
pe,
|
|
1583
1582
|
{
|
|
1584
1583
|
contentEditable: /* @__PURE__ */ r(
|
|
1585
|
-
|
|
1584
|
+
ue,
|
|
1586
1585
|
{
|
|
1587
1586
|
"aria-placeholder": "Enter a caption...",
|
|
1588
1587
|
placeholder: () => /* @__PURE__ */ r("span", { className: "cteditor-text-xs cteditor-absolute cteditor-left-2 cteditor-top-[7px]", children: "Enter a caption..." }),
|
|
1589
1588
|
className: " cteditor-outline-none !cteditor-shadow-none cteditor-bg-foreground/10 cteditor-border !cteditor-border-foreground/15 cteditor-py-1 cteditor-px-2 cteditor-rounded-sm cteditor-text-xs cteditor-relative"
|
|
1590
1589
|
}
|
|
1591
1590
|
),
|
|
1592
|
-
ErrorBoundary:
|
|
1591
|
+
ErrorBoundary: me
|
|
1593
1592
|
}
|
|
1594
1593
|
),
|
|
1595
1594
|
/* @__PURE__ */ r(
|
|
1596
|
-
|
|
1595
|
+
he,
|
|
1597
1596
|
{
|
|
1598
1597
|
onChange: () => {
|
|
1599
1598
|
}
|
|
1600
1599
|
}
|
|
1601
1600
|
),
|
|
1602
|
-
/* @__PURE__ */ r(
|
|
1603
|
-
/* @__PURE__ */ r(
|
|
1601
|
+
/* @__PURE__ */ r(ge, {}),
|
|
1602
|
+
/* @__PURE__ */ r(de, { namespace: ce.namespace })
|
|
1604
1603
|
]
|
|
1605
1604
|
}
|
|
1606
1605
|
)
|
|
@@ -1633,5 +1632,5 @@ function co({
|
|
|
1633
1632
|
}
|
|
1634
1633
|
export {
|
|
1635
1634
|
te as RIGHT_CLICK_IMAGE_COMMAND,
|
|
1636
|
-
|
|
1635
|
+
so as default
|
|
1637
1636
|
};
|