eddyter 1.3.59 → 1.3.61
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/api/ai/aiAgentService.d.ts +44 -0
- package/dist/api/ai/index.d.ts +12 -12
- package/dist/assets/index.css +1 -0
- package/dist/babel-19rkKi7e.js +7157 -0
- package/dist/components/FileUpload/InsertFileDialog.d.ts +0 -1
- package/dist/components/LinkPreviewHover/index.d.ts +0 -1
- package/dist/components/ScopedEditor.d.ts +0 -1
- package/dist/components/TextEnhanceDialog/index.d.ts +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +3 -3
- package/dist/components/ui/skeleton.d.ts +0 -1
- package/dist/context/ToolbarContext.d.ts +6 -2
- package/dist/editorConfig.d.ts +1 -0
- package/dist/estree-DmlwiAu4.js +4453 -0
- package/dist/hooks/useModal.d.ts +0 -1
- package/dist/{html-3f297a3a.js → html-DtcgJGeD.js} +1097 -1358
- package/dist/html2pdf.bundle-BP8K5ERw.js +32961 -0
- package/dist/html2pdf.bundle.min-BrDn1HSi.js +20244 -0
- package/dist/{index-25fd6b76.js → index-CFq39nnT.js} +17746 -18306
- package/dist/{index-940faa12.js → index-CnBHpreC.js} +347 -377
- package/dist/{index-1da728d1.js → index-DnHnFalw.js} +8 -38
- package/dist/index.js +13 -46
- package/dist/{markdown-08edd93b.js → markdown-C2JcxpgA.js} +1374 -1836
- package/dist/plugins/AIChatPlugin.d.ts +1 -2
- package/dist/plugins/AutocompletePlugin.d.ts +0 -1
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRulePlugin.d.ts +0 -1
- package/dist/plugins/HtmlSyncPlugin.d.ts +0 -1
- package/dist/plugins/LinkPreviewPlugin/index.d.ts +0 -1
- package/dist/plugins/PasteOptionsPlugin/index.d.ts +0 -1
- package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasPlugin.d.ts +0 -1
- package/dist/plugins/SlashCommandPlugin/index.d.ts +0 -1
- package/dist/plugins/UsageTrackingPlugin.d.ts +0 -1
- package/dist/plugins/VoiceTranscriptPlugin.d.ts +1 -1
- package/dist/postcss-Banlrd6S.js +4703 -0
- package/dist/{standalone-83d5947a.js → standalone-JqHlnZSs.js} +975 -1274
- package/dist/types.d.ts +2 -0
- package/dist/typescript-D_phonMq.js +12929 -0
- package/package.json +7 -5
- package/dist/assets/style.css +0 -1
- package/dist/babel-2d5b260f.js +0 -7770
- package/dist/estree-28f5912a.js +0 -4920
- package/dist/html2pdf.bundle-eacf777f.js +0 -34001
- package/dist/html2pdf.bundle.min-d9ce156b.js +0 -21964
- package/dist/postcss-0e22bc25.js +0 -5187
- package/dist/typescript-0559ee85.js +0 -13660
|
@@ -1,65 +1,39 @@
|
|
|
1
|
-
import { jsx as t, jsxs as h, Fragment as
|
|
2
|
-
import { CodeNode as
|
|
1
|
+
import { jsx as t, jsxs as h, Fragment as ot } from "react/jsx-runtime";
|
|
2
|
+
import { CodeNode as Ee } from "@lexical/code";
|
|
3
3
|
import { LinkNode as ke } from "@lexical/link";
|
|
4
|
-
import { AutoFocusPlugin as
|
|
5
|
-
import { useCollaborationContext as
|
|
6
|
-
import { useLexicalComposerContext as
|
|
7
|
-
import { ContentEditable as
|
|
8
|
-
import { LexicalErrorBoundary as
|
|
9
|
-
import { HistoryPlugin as
|
|
10
|
-
import { LexicalNestedComposer as
|
|
11
|
-
import { OnChangePlugin as
|
|
12
|
-
import { RichTextPlugin as
|
|
13
|
-
import { useLexicalEditable as
|
|
14
|
-
import { useLexicalNodeSelection as
|
|
15
|
-
import { calculateZoomLevel as
|
|
16
|
-
import { RootNode as
|
|
17
|
-
import { useRef as
|
|
18
|
-
import { a as
|
|
19
|
-
|
|
20
|
-
import "react-dom";
|
|
21
|
-
import "@emotion/styled";
|
|
22
|
-
import "@lexical/html";
|
|
23
|
-
import "@lexical/react/LexicalCheckListPlugin";
|
|
24
|
-
import "@lexical/react/LexicalComposer";
|
|
25
|
-
import "@lexical/react/LexicalHorizontalRulePlugin";
|
|
26
|
-
import "@lexical/react/LexicalListPlugin";
|
|
27
|
-
import "@lexical/react/LexicalTablePlugin";
|
|
28
|
-
import "@lexical/table";
|
|
29
|
-
import "@lexical/list";
|
|
30
|
-
import "@lexical/rich-text";
|
|
31
|
-
import "@lexical/selection";
|
|
32
|
-
import "@lexical/react/LexicalHorizontalRuleNode";
|
|
33
|
-
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
34
|
-
import "emoji-picker-react";
|
|
35
|
-
import "@lexical/react/LexicalLinkPlugin";
|
|
36
|
-
import "@lexical/react/LexicalTypeaheadMenuPlugin";
|
|
37
|
-
import "@lexical/react/LexicalDraggableBlockPlugin";
|
|
38
|
-
/**
|
|
39
|
-
* @license lucide-react v0.344.0 - ISC
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the ISC license.
|
|
42
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/
|
|
44
|
-
const Tt = wt("Link2", [
|
|
4
|
+
import { AutoFocusPlugin as nt } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
5
|
+
import { useCollaborationContext as ct } from "@lexical/react/LexicalCollaborationContext";
|
|
6
|
+
import { useLexicalComposerContext as at } from "@lexical/react/LexicalComposerContext";
|
|
7
|
+
import { ContentEditable as Ie } from "@lexical/react/LexicalContentEditable";
|
|
8
|
+
import { LexicalErrorBoundary as Pe } from "@lexical/react/LexicalErrorBoundary";
|
|
9
|
+
import { HistoryPlugin as Re } from "@lexical/react/LexicalHistoryPlugin";
|
|
10
|
+
import { LexicalNestedComposer as De } from "@lexical/react/LexicalNestedComposer";
|
|
11
|
+
import { OnChangePlugin as ze } from "@lexical/react/LexicalOnChangePlugin";
|
|
12
|
+
import { RichTextPlugin as Se } from "@lexical/react/LexicalRichTextPlugin";
|
|
13
|
+
import { useLexicalEditable as st } from "@lexical/react/useLexicalEditable";
|
|
14
|
+
import { useLexicalNodeSelection as dt } from "@lexical/react/useLexicalNodeSelection";
|
|
15
|
+
import { calculateZoomLevel as we, mergeRegister as lt } from "@lexical/utils";
|
|
16
|
+
import { RootNode as Le, TextNode as We, LineBreakNode as Ae, ParagraphNode as Me, $getSelection as V, $isNodeSelection as K, $isParagraphNode as Ce, $setSelection as ae, $isRangeSelection as ut, SELECTION_CHANGE_COMMAND as mt, COMMAND_PRIORITY_LOW as $, CLICK_COMMAND as gt, DRAGSTART_COMMAND as ht, KEY_DELETE_COMMAND as ft, KEY_BACKSPACE_COMMAND as pt, KEY_ENTER_COMMAND as bt, KEY_ESCAPE_COMMAND as yt, createCommand as xt, $getNodeByKey as J } from "lexical";
|
|
17
|
+
import { useRef as H, useState as R, useEffect as se, useCallback as A, Suspense as wt } from "react";
|
|
18
|
+
import { a as Ct, D as Nt, b as vt, d as Et, e as kt, f as It, h as Pt, B as Ne, L as $e, i as _e, $ as X, W as Rt, j as Dt, A as zt, k as St, l as Lt, T as Wt, m as At, S as Mt, E as $t, n as _t, t as _, o as Ot, p as Ht, C as Tt } from "./index-CFq39nnT.js";
|
|
19
|
+
const jt = Ct("Link2", [
|
|
45
20
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
46
21
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
47
22
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
48
|
-
])
|
|
49
|
-
const jt = ({
|
|
23
|
+
]), Bt = ({
|
|
50
24
|
open: u,
|
|
51
|
-
onOpenChange:
|
|
25
|
+
onOpenChange: p,
|
|
52
26
|
oldImageUrl: b,
|
|
53
27
|
newImageUrl: N,
|
|
54
|
-
onReplace:
|
|
55
|
-
onCancel:
|
|
56
|
-
}) => /* @__PURE__ */ t(
|
|
57
|
-
/* @__PURE__ */ h(
|
|
28
|
+
onReplace: S,
|
|
29
|
+
onCancel: E
|
|
30
|
+
}) => /* @__PURE__ */ t(Nt, { open: u, onOpenChange: p, children: /* @__PURE__ */ h(vt, { className: "sm:max-w-[800px] max-h-[90vh] overflow-y-auto", children: [
|
|
31
|
+
/* @__PURE__ */ h(Et, { children: [
|
|
58
32
|
/* @__PURE__ */ h(kt, { className: "flex items-center gap-2 text-xl", children: [
|
|
59
33
|
/* @__PURE__ */ t("span", { className: "text-2xl", children: "🔄" }),
|
|
60
34
|
"Compare Images"
|
|
61
35
|
] }),
|
|
62
|
-
/* @__PURE__ */ t(
|
|
36
|
+
/* @__PURE__ */ t(It, { className: "text-sm pt-1", children: "Choose whether to replace the original image with the refined version." })
|
|
63
37
|
] }),
|
|
64
38
|
/* @__PURE__ */ h("div", { className: "space-y-4 py-4", children: [
|
|
65
39
|
/* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ h("div", { className: "space-y-2", children: [
|
|
@@ -81,19 +55,19 @@ const jt = ({
|
|
|
81
55
|
' Clicking "Replace" will update the image in your document. This action cannot be undone.'
|
|
82
56
|
] }) })
|
|
83
57
|
] }),
|
|
84
|
-
/* @__PURE__ */ h(
|
|
58
|
+
/* @__PURE__ */ h(Pt, { className: "gap-2", children: [
|
|
85
59
|
/* @__PURE__ */ t(
|
|
86
|
-
|
|
60
|
+
Ne,
|
|
87
61
|
{
|
|
88
62
|
variant: "outline",
|
|
89
|
-
onClick:
|
|
63
|
+
onClick: E,
|
|
90
64
|
children: "Keep Original"
|
|
91
65
|
}
|
|
92
66
|
),
|
|
93
67
|
/* @__PURE__ */ h(
|
|
94
|
-
|
|
68
|
+
Ne,
|
|
95
69
|
{
|
|
96
|
-
onClick:
|
|
70
|
+
onClick: S,
|
|
97
71
|
className: "bg-blue-500 hover:bg-blue-600 text-white",
|
|
98
72
|
children: [
|
|
99
73
|
/* @__PURE__ */ t("span", { className: "mr-2", children: "✓" }),
|
|
@@ -103,27 +77,27 @@ const jt = ({
|
|
|
103
77
|
)
|
|
104
78
|
] })
|
|
105
79
|
] }) });
|
|
106
|
-
function
|
|
80
|
+
function Yt({
|
|
107
81
|
caption: u
|
|
108
82
|
}) {
|
|
109
83
|
return /* @__PURE__ */ t("div", { className: "signature-caption-container", children: /* @__PURE__ */ h(
|
|
110
|
-
|
|
84
|
+
De,
|
|
111
85
|
{
|
|
112
86
|
initialEditor: u,
|
|
113
87
|
initialNodes: [
|
|
114
|
-
Se,
|
|
115
88
|
Le,
|
|
116
89
|
We,
|
|
117
90
|
Ae,
|
|
91
|
+
Me,
|
|
118
92
|
ke,
|
|
119
|
-
|
|
93
|
+
Ee
|
|
120
94
|
],
|
|
121
95
|
children: [
|
|
122
96
|
/* @__PURE__ */ t(
|
|
123
|
-
|
|
97
|
+
Se,
|
|
124
98
|
{
|
|
125
99
|
contentEditable: /* @__PURE__ */ t(
|
|
126
|
-
|
|
100
|
+
Ie,
|
|
127
101
|
{
|
|
128
102
|
"aria-placeholder": "Enter signature name...",
|
|
129
103
|
placeholder: /* @__PURE__ */ t("div", { style: {
|
|
@@ -139,41 +113,41 @@ function Bt({
|
|
|
139
113
|
className: "signature-caption-editable"
|
|
140
114
|
}
|
|
141
115
|
),
|
|
142
|
-
ErrorBoundary:
|
|
116
|
+
ErrorBoundary: Pe
|
|
143
117
|
}
|
|
144
118
|
),
|
|
145
|
-
/* @__PURE__ */ t(
|
|
119
|
+
/* @__PURE__ */ t(ze, { onChange: () => {
|
|
146
120
|
} }),
|
|
147
|
-
/* @__PURE__ */ t(
|
|
148
|
-
/* @__PURE__ */ t(
|
|
121
|
+
/* @__PURE__ */ t(Re, {}),
|
|
122
|
+
/* @__PURE__ */ t($e, { namespace: _e.namespace })
|
|
149
123
|
]
|
|
150
124
|
}
|
|
151
125
|
) });
|
|
152
126
|
}
|
|
153
|
-
function
|
|
154
|
-
return Math.min(Math.max(u,
|
|
127
|
+
function de(u, p, b) {
|
|
128
|
+
return Math.min(Math.max(u, p), b);
|
|
155
129
|
}
|
|
156
|
-
const
|
|
130
|
+
const c = {
|
|
157
131
|
east: 1,
|
|
158
132
|
north: 8,
|
|
159
133
|
south: 2,
|
|
160
134
|
west: 4
|
|
161
135
|
};
|
|
162
|
-
function
|
|
136
|
+
function Kt({
|
|
163
137
|
onResizeStart: u,
|
|
164
|
-
onResizeEnd:
|
|
138
|
+
onResizeEnd: p,
|
|
165
139
|
buttonRef: b,
|
|
166
140
|
imageRef: N,
|
|
167
|
-
maxWidth:
|
|
168
|
-
editor:
|
|
169
|
-
showCaption:
|
|
170
|
-
setShowCaption:
|
|
171
|
-
captionsEnabled:
|
|
141
|
+
maxWidth: S,
|
|
142
|
+
editor: E,
|
|
143
|
+
showCaption: F,
|
|
144
|
+
setShowCaption: M,
|
|
145
|
+
captionsEnabled: L
|
|
172
146
|
}) {
|
|
173
|
-
const
|
|
147
|
+
const T = H(null), k = H({
|
|
174
148
|
priority: "",
|
|
175
149
|
value: "default"
|
|
176
|
-
}), l =
|
|
150
|
+
}), l = H({
|
|
177
151
|
currentHeight: 0,
|
|
178
152
|
currentWidth: 0,
|
|
179
153
|
direction: 0,
|
|
@@ -183,9 +157,9 @@ function Yt({
|
|
|
183
157
|
startWidth: 0,
|
|
184
158
|
startX: 0,
|
|
185
159
|
startY: 0
|
|
186
|
-
}),
|
|
187
|
-
const
|
|
188
|
-
|
|
160
|
+
}), f = E.getRootElement(), x = f !== null ? f.getBoundingClientRect().width - 20 : 100, G = f !== null ? f.getBoundingClientRect().height - 20 : 100, m = 100, I = 100, O = (i) => {
|
|
161
|
+
const a = i === c.east || i === c.west, o = i === c.north || i === c.south, v = i & c.north && i & c.west || i & c.south && i & c.east, C = a ? "ew" : o ? "ns" : v ? "nwse" : "nesw";
|
|
162
|
+
f !== null && f.style.setProperty(
|
|
189
163
|
"cursor",
|
|
190
164
|
`${C}-resize`,
|
|
191
165
|
"important"
|
|
@@ -202,69 +176,69 @@ function Yt({
|
|
|
202
176
|
"none",
|
|
203
177
|
"important"
|
|
204
178
|
));
|
|
205
|
-
},
|
|
206
|
-
|
|
179
|
+
}, W = () => {
|
|
180
|
+
f !== null && f.style.setProperty("cursor", "text"), document.body !== null && (document.body.style.setProperty("cursor", "default"), document.body.style.setProperty(
|
|
207
181
|
"-webkit-user-select",
|
|
208
182
|
k.current.value,
|
|
209
183
|
k.current.priority
|
|
210
184
|
));
|
|
211
|
-
},
|
|
212
|
-
if (!
|
|
185
|
+
}, P = (i, a) => {
|
|
186
|
+
if (!E.isEditable())
|
|
213
187
|
return;
|
|
214
|
-
const o = N.current,
|
|
215
|
-
if (o !== null &&
|
|
188
|
+
const o = N.current, v = T.current;
|
|
189
|
+
if (o !== null && v !== null) {
|
|
216
190
|
i.preventDefault();
|
|
217
|
-
const { width: C, height:
|
|
218
|
-
|
|
191
|
+
const { width: C, height: D } = o.getBoundingClientRect(), g = we(o), d = l.current;
|
|
192
|
+
d.startWidth = C, d.startHeight = D, d.ratio = C / D, d.currentWidth = C, d.currentHeight = D, d.startX = i.clientX / g, d.startY = i.clientY / g, d.isResizing = !0, d.direction = a, O(a), u(), v.classList.add("image-control-wrapper--resizing"), o.style.height = `${D}px`, o.style.width = `${C}px`, document.addEventListener("pointermove", Q), document.addEventListener("pointerup", n);
|
|
219
193
|
}
|
|
220
|
-
},
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
let
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
o.startWidth +
|
|
229
|
-
|
|
194
|
+
}, Q = (i) => {
|
|
195
|
+
const a = N.current, o = l.current, v = o.direction & (c.east | c.west), C = o.direction & (c.south | c.north);
|
|
196
|
+
if (a !== null && o.isResizing) {
|
|
197
|
+
const D = we(a);
|
|
198
|
+
if (v && C) {
|
|
199
|
+
let g = Math.floor(o.startX - i.clientX / D);
|
|
200
|
+
g = o.direction & c.east ? -g : g;
|
|
201
|
+
const d = de(
|
|
202
|
+
o.startWidth + g,
|
|
203
|
+
m,
|
|
230
204
|
x
|
|
231
|
-
),
|
|
232
|
-
|
|
205
|
+
), z = d / o.ratio;
|
|
206
|
+
a.style.width = `${d}px`, a.style.height = `${z}px`, o.currentHeight = z, o.currentWidth = d;
|
|
233
207
|
} else if (C) {
|
|
234
|
-
let
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
o.startHeight +
|
|
238
|
-
|
|
239
|
-
|
|
208
|
+
let g = Math.floor(o.startY - i.clientY / D);
|
|
209
|
+
g = o.direction & c.south ? -g : g;
|
|
210
|
+
const d = de(
|
|
211
|
+
o.startHeight + g,
|
|
212
|
+
I,
|
|
213
|
+
G
|
|
240
214
|
);
|
|
241
|
-
|
|
215
|
+
a.style.height = `${d}px`, o.currentHeight = d;
|
|
242
216
|
} else {
|
|
243
|
-
let
|
|
244
|
-
|
|
245
|
-
const
|
|
246
|
-
o.startWidth +
|
|
247
|
-
|
|
217
|
+
let g = Math.floor(o.startX - i.clientX / D);
|
|
218
|
+
g = o.direction & c.east ? -g : g;
|
|
219
|
+
const d = de(
|
|
220
|
+
o.startWidth + g,
|
|
221
|
+
m,
|
|
248
222
|
x
|
|
249
223
|
);
|
|
250
|
-
|
|
224
|
+
a.style.width = `${d}px`, o.currentWidth = d;
|
|
251
225
|
}
|
|
252
226
|
}
|
|
253
|
-
},
|
|
254
|
-
const i = N.current,
|
|
255
|
-
if (i !== null && o !== null &&
|
|
256
|
-
const
|
|
257
|
-
|
|
227
|
+
}, n = () => {
|
|
228
|
+
const i = N.current, a = l.current, o = T.current;
|
|
229
|
+
if (i !== null && o !== null && a.isResizing) {
|
|
230
|
+
const v = a.currentWidth, C = a.currentHeight;
|
|
231
|
+
a.startWidth = 0, a.startHeight = 0, a.ratio = 0, a.startX = 0, a.startY = 0, a.currentWidth = 0, a.currentHeight = 0, a.isResizing = !1, o.classList.remove("image-control-wrapper--resizing"), W(), p(v, C), document.removeEventListener("pointermove", Q), document.removeEventListener("pointerup", n);
|
|
258
232
|
}
|
|
259
233
|
};
|
|
260
|
-
return /* @__PURE__ */ h("div", { ref:
|
|
261
|
-
!
|
|
234
|
+
return /* @__PURE__ */ h("div", { ref: T, children: [
|
|
235
|
+
!F && L && /* @__PURE__ */ t(
|
|
262
236
|
"button",
|
|
263
237
|
{
|
|
264
238
|
className: "image-caption-button",
|
|
265
239
|
ref: b,
|
|
266
240
|
onClick: () => {
|
|
267
|
-
|
|
241
|
+
M(!F);
|
|
268
242
|
},
|
|
269
243
|
children: "Add Caption"
|
|
270
244
|
}
|
|
@@ -274,7 +248,7 @@ function Yt({
|
|
|
274
248
|
{
|
|
275
249
|
className: "image-resizer image-resizer-n",
|
|
276
250
|
onPointerDown: (i) => {
|
|
277
|
-
|
|
251
|
+
P(i, c.north);
|
|
278
252
|
}
|
|
279
253
|
}
|
|
280
254
|
),
|
|
@@ -283,7 +257,7 @@ function Yt({
|
|
|
283
257
|
{
|
|
284
258
|
className: "image-resizer image-resizer-ne",
|
|
285
259
|
onPointerDown: (i) => {
|
|
286
|
-
|
|
260
|
+
P(i, c.north | c.east);
|
|
287
261
|
}
|
|
288
262
|
}
|
|
289
263
|
),
|
|
@@ -292,7 +266,7 @@ function Yt({
|
|
|
292
266
|
{
|
|
293
267
|
className: "image-resizer image-resizer-e",
|
|
294
268
|
onPointerDown: (i) => {
|
|
295
|
-
|
|
269
|
+
P(i, c.east);
|
|
296
270
|
}
|
|
297
271
|
}
|
|
298
272
|
),
|
|
@@ -301,7 +275,7 @@ function Yt({
|
|
|
301
275
|
{
|
|
302
276
|
className: "image-resizer image-resizer-se",
|
|
303
277
|
onPointerDown: (i) => {
|
|
304
|
-
|
|
278
|
+
P(i, c.south | c.east);
|
|
305
279
|
}
|
|
306
280
|
}
|
|
307
281
|
),
|
|
@@ -310,7 +284,7 @@ function Yt({
|
|
|
310
284
|
{
|
|
311
285
|
className: "image-resizer image-resizer-s",
|
|
312
286
|
onPointerDown: (i) => {
|
|
313
|
-
|
|
287
|
+
P(i, c.south);
|
|
314
288
|
}
|
|
315
289
|
}
|
|
316
290
|
),
|
|
@@ -319,7 +293,7 @@ function Yt({
|
|
|
319
293
|
{
|
|
320
294
|
className: "image-resizer image-resizer-sw",
|
|
321
295
|
onPointerDown: (i) => {
|
|
322
|
-
|
|
296
|
+
P(i, c.south | c.west);
|
|
323
297
|
}
|
|
324
298
|
}
|
|
325
299
|
),
|
|
@@ -328,7 +302,7 @@ function Yt({
|
|
|
328
302
|
{
|
|
329
303
|
className: "image-resizer image-resizer-w",
|
|
330
304
|
onPointerDown: (i) => {
|
|
331
|
-
|
|
305
|
+
P(i, c.west);
|
|
332
306
|
}
|
|
333
307
|
}
|
|
334
308
|
),
|
|
@@ -337,57 +311,57 @@ function Yt({
|
|
|
337
311
|
{
|
|
338
312
|
className: "image-resizer image-resizer-nw",
|
|
339
313
|
onPointerDown: (i) => {
|
|
340
|
-
|
|
314
|
+
P(i, c.north | c.west);
|
|
341
315
|
}
|
|
342
316
|
}
|
|
343
317
|
)
|
|
344
318
|
] });
|
|
345
319
|
}
|
|
346
|
-
const
|
|
347
|
-
function
|
|
348
|
-
if (!
|
|
349
|
-
throw new Promise((
|
|
320
|
+
const le = /* @__PURE__ */ new Set(), ve = xt("RIGHT_CLICK_IMAGE_COMMAND");
|
|
321
|
+
function Xt(u) {
|
|
322
|
+
if (!le.has(u))
|
|
323
|
+
throw new Promise((p) => {
|
|
350
324
|
const b = new Image();
|
|
351
325
|
b.src = u, b.onload = () => {
|
|
352
|
-
|
|
326
|
+
le.add(u), p(null);
|
|
353
327
|
}, b.onerror = () => {
|
|
354
|
-
|
|
328
|
+
le.add(u);
|
|
355
329
|
};
|
|
356
330
|
});
|
|
357
331
|
}
|
|
358
|
-
function
|
|
332
|
+
function Ft({
|
|
359
333
|
altText: u,
|
|
360
|
-
className:
|
|
334
|
+
className: p,
|
|
361
335
|
imageRef: b,
|
|
362
336
|
src: N,
|
|
363
|
-
width:
|
|
364
|
-
height:
|
|
365
|
-
maxWidth:
|
|
366
|
-
onError:
|
|
337
|
+
width: S,
|
|
338
|
+
height: E,
|
|
339
|
+
maxWidth: F,
|
|
340
|
+
onError: M
|
|
367
341
|
}) {
|
|
368
|
-
return
|
|
342
|
+
return Xt(N), /* @__PURE__ */ t(
|
|
369
343
|
"img",
|
|
370
344
|
{
|
|
371
|
-
className:
|
|
345
|
+
className: p || void 0,
|
|
372
346
|
src: N,
|
|
373
347
|
alt: u,
|
|
374
348
|
ref: b,
|
|
375
|
-
style: typeof
|
|
349
|
+
style: typeof S == "number" && typeof E == "number" ? {
|
|
376
350
|
// User has set a numeric size or original dimensions are provided
|
|
377
|
-
width: typeof
|
|
378
|
-
height: typeof
|
|
351
|
+
width: typeof S == "number" ? S : "auto",
|
|
352
|
+
height: typeof E == "number" ? E : "auto",
|
|
379
353
|
maxWidth: "100%"
|
|
380
354
|
} : {
|
|
381
355
|
// No dimensions specified - use original image size
|
|
382
356
|
maxWidth: "100%",
|
|
383
357
|
height: "auto"
|
|
384
358
|
},
|
|
385
|
-
onError:
|
|
359
|
+
onError: M,
|
|
386
360
|
draggable: "false"
|
|
387
361
|
}
|
|
388
362
|
);
|
|
389
363
|
}
|
|
390
|
-
function
|
|
364
|
+
function Gt() {
|
|
391
365
|
return /* @__PURE__ */ t(
|
|
392
366
|
"img",
|
|
393
367
|
{
|
|
@@ -401,173 +375,171 @@ function Ft() {
|
|
|
401
375
|
}
|
|
402
376
|
);
|
|
403
377
|
}
|
|
404
|
-
function
|
|
378
|
+
function gr({
|
|
405
379
|
src: u,
|
|
406
|
-
altText:
|
|
380
|
+
altText: p,
|
|
407
381
|
nodeKey: b,
|
|
408
382
|
width: N,
|
|
409
|
-
height:
|
|
410
|
-
maxWidth:
|
|
411
|
-
resizable:
|
|
412
|
-
showCaption:
|
|
413
|
-
caption:
|
|
414
|
-
captionsEnabled:
|
|
383
|
+
height: S,
|
|
384
|
+
maxWidth: E,
|
|
385
|
+
resizable: F,
|
|
386
|
+
showCaption: M,
|
|
387
|
+
caption: L,
|
|
388
|
+
captionsEnabled: T,
|
|
415
389
|
originalPrompt: k,
|
|
416
390
|
position: l = "none",
|
|
417
|
-
linkUrl:
|
|
391
|
+
linkUrl: f
|
|
418
392
|
}) {
|
|
419
|
-
const x =
|
|
420
|
-
|
|
421
|
-
const [n] = ct(), [O, i] = R(null), d = T(null), [o, D] = R(!1), C = at(), [P, m] = R(!1), [a, H] = R(""), [B, le] = R(!1), [_e, Z] = R(!1), [me, Q] = R(""), [Oe, ee] = R(""), [He, ue] = R(!1), Y = T(null), [ge, Te] = R(0), je = ge > 0 && ge < 350;
|
|
422
|
-
ae(() => {
|
|
393
|
+
const x = H(null), G = H(null), [m, I, O] = dt(b), [W, P] = R(!1), { isCollabActive: Q } = ct(), [n] = at(), [i, a] = R(null), o = H(null), [v, C] = R(!1), D = st(), [g, d] = R(!1), [z, U] = R(""), [j, ue] = R(!1), [Oe, Z] = R(!1), [me, ee] = R(""), [He, te] = R(""), [Te, ge] = R(!1), B = H(null), [he, je] = R(0), Be = he > 0 && he < 350;
|
|
394
|
+
se(() => {
|
|
423
395
|
if (x.current) {
|
|
424
396
|
const e = () => {
|
|
425
|
-
x.current &&
|
|
397
|
+
x.current && je(x.current.offsetWidth);
|
|
426
398
|
};
|
|
427
399
|
e();
|
|
428
400
|
const r = new ResizeObserver(e);
|
|
429
401
|
return r.observe(x.current), () => r.disconnect();
|
|
430
402
|
}
|
|
431
|
-
}, [N,
|
|
432
|
-
const
|
|
403
|
+
}, [N, S, m]);
|
|
404
|
+
const re = A(
|
|
433
405
|
(e) => {
|
|
434
|
-
const r =
|
|
435
|
-
return
|
|
406
|
+
const r = V();
|
|
407
|
+
return m && K(r) && (e.preventDefault(), n.update(() => {
|
|
436
408
|
r.getNodes().forEach((y) => {
|
|
437
|
-
if (
|
|
409
|
+
if (X(y)) {
|
|
438
410
|
const w = y.getParent();
|
|
439
|
-
y.remove(), w &&
|
|
411
|
+
y.remove(), w && Ce(w) && w.getChildrenSize() === 0 && w.setFormat("left");
|
|
440
412
|
}
|
|
441
413
|
});
|
|
442
414
|
})), !1;
|
|
443
415
|
},
|
|
444
|
-
[n,
|
|
445
|
-
),
|
|
416
|
+
[n, m]
|
|
417
|
+
), fe = A(
|
|
446
418
|
(e) => {
|
|
447
|
-
const r =
|
|
448
|
-
if (
|
|
449
|
-
if (
|
|
450
|
-
return
|
|
451
|
-
if (
|
|
452
|
-
return e.preventDefault(),
|
|
419
|
+
const r = V(), s = G.current;
|
|
420
|
+
if (m && K(r) && r.getNodes().length === 1) {
|
|
421
|
+
if (M)
|
|
422
|
+
return ae(null), e.preventDefault(), L.focus(), !0;
|
|
423
|
+
if (s !== null && s !== document.activeElement)
|
|
424
|
+
return e.preventDefault(), s.focus(), !0;
|
|
453
425
|
}
|
|
454
426
|
return !1;
|
|
455
427
|
},
|
|
456
|
-
[
|
|
457
|
-
), pe =
|
|
458
|
-
(e) =>
|
|
459
|
-
|
|
428
|
+
[L, m, M]
|
|
429
|
+
), pe = A(
|
|
430
|
+
(e) => o.current === L || G.current === e.target ? (ae(null), n.update(() => {
|
|
431
|
+
I(!0);
|
|
460
432
|
const r = n.getRootElement();
|
|
461
433
|
r !== null && r.focus();
|
|
462
434
|
}), !0) : !1,
|
|
463
|
-
[
|
|
464
|
-
),
|
|
435
|
+
[L, n, I]
|
|
436
|
+
), ie = A(
|
|
465
437
|
(e) => {
|
|
466
438
|
const r = e;
|
|
467
|
-
if (
|
|
439
|
+
if (W)
|
|
468
440
|
return !0;
|
|
469
441
|
const y = r.target === x.current;
|
|
470
442
|
let w = !1;
|
|
471
443
|
if (!y && x.current) {
|
|
472
|
-
const
|
|
473
|
-
w = r.clientX >=
|
|
444
|
+
const q = x.current.getBoundingClientRect();
|
|
445
|
+
w = r.clientX >= q.left && r.clientX <= q.right && r.clientY >= q.top && r.clientY <= q.bottom;
|
|
474
446
|
}
|
|
475
|
-
return y || w ? (r.shiftKey ?
|
|
447
|
+
return y || w ? (r.shiftKey ? I(!m) : (O(), I(!0)), !0) : !1;
|
|
476
448
|
},
|
|
477
|
-
[
|
|
478
|
-
),
|
|
449
|
+
[W, m, I, O]
|
|
450
|
+
), oe = A(
|
|
479
451
|
(e) => {
|
|
480
452
|
n.getEditorState().read(() => {
|
|
481
|
-
const r =
|
|
482
|
-
e.target.tagName === "IMG" &&
|
|
483
|
-
|
|
453
|
+
const r = V();
|
|
454
|
+
e.target.tagName === "IMG" && ut(r) && r.getNodes().length === 1 && n.dispatchCommand(
|
|
455
|
+
ve,
|
|
484
456
|
e
|
|
485
457
|
);
|
|
486
458
|
});
|
|
487
459
|
},
|
|
488
460
|
[n]
|
|
489
461
|
);
|
|
490
|
-
|
|
462
|
+
se(() => {
|
|
491
463
|
let e = !0;
|
|
492
|
-
const r = n.getRootElement(),
|
|
464
|
+
const r = n.getRootElement(), s = lt(
|
|
493
465
|
n.registerUpdateListener(({ editorState: y }) => {
|
|
494
|
-
e &&
|
|
466
|
+
e && a(y.read(() => V()));
|
|
495
467
|
}),
|
|
496
468
|
n.registerCommand(
|
|
497
469
|
mt,
|
|
498
|
-
(y, w) => (
|
|
499
|
-
|
|
470
|
+
(y, w) => (o.current = w, !1),
|
|
471
|
+
$
|
|
500
472
|
),
|
|
501
473
|
n.registerCommand(
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
474
|
+
gt,
|
|
475
|
+
ie,
|
|
476
|
+
$
|
|
505
477
|
),
|
|
506
478
|
n.registerCommand(
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
479
|
+
ve,
|
|
480
|
+
ie,
|
|
481
|
+
$
|
|
510
482
|
),
|
|
511
483
|
n.registerCommand(
|
|
512
|
-
|
|
484
|
+
ht,
|
|
513
485
|
(y) => y.target === x.current ? (y.preventDefault(), !0) : !1,
|
|
514
|
-
|
|
486
|
+
$
|
|
515
487
|
),
|
|
516
488
|
n.registerCommand(
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
489
|
+
ft,
|
|
490
|
+
re,
|
|
491
|
+
$
|
|
520
492
|
),
|
|
521
493
|
n.registerCommand(
|
|
522
494
|
pt,
|
|
523
|
-
|
|
524
|
-
|
|
495
|
+
re,
|
|
496
|
+
$
|
|
525
497
|
),
|
|
526
|
-
n.registerCommand(
|
|
498
|
+
n.registerCommand(bt, fe, $),
|
|
527
499
|
n.registerCommand(
|
|
528
|
-
|
|
500
|
+
yt,
|
|
529
501
|
pe,
|
|
530
|
-
|
|
502
|
+
$
|
|
531
503
|
)
|
|
532
504
|
);
|
|
533
|
-
return r
|
|
534
|
-
e = !1,
|
|
505
|
+
return r?.addEventListener("contextmenu", oe), () => {
|
|
506
|
+
e = !1, s(), r?.removeEventListener("contextmenu", oe);
|
|
535
507
|
};
|
|
536
508
|
}, [
|
|
537
|
-
|
|
509
|
+
O,
|
|
538
510
|
n,
|
|
539
|
-
|
|
540
|
-
|
|
511
|
+
W,
|
|
512
|
+
m,
|
|
541
513
|
b,
|
|
542
|
-
te,
|
|
543
|
-
he,
|
|
544
|
-
pe,
|
|
545
514
|
re,
|
|
515
|
+
fe,
|
|
516
|
+
pe,
|
|
546
517
|
ie,
|
|
547
|
-
|
|
518
|
+
oe,
|
|
519
|
+
I
|
|
548
520
|
]);
|
|
549
|
-
const
|
|
521
|
+
const Ye = () => {
|
|
550
522
|
n.update(() => {
|
|
551
|
-
const e =
|
|
552
|
-
|
|
523
|
+
const e = J(b);
|
|
524
|
+
X(e) && e.setShowCaption(!0);
|
|
553
525
|
});
|
|
554
|
-
},
|
|
526
|
+
}, Ke = (e, r) => {
|
|
555
527
|
setTimeout(() => {
|
|
556
|
-
|
|
528
|
+
P(!1);
|
|
557
529
|
}, 200), n.update(() => {
|
|
558
|
-
const
|
|
559
|
-
|
|
530
|
+
const s = J(b);
|
|
531
|
+
X(s) && s.setWidthAndHeight(e, r);
|
|
560
532
|
});
|
|
561
|
-
},
|
|
562
|
-
|
|
563
|
-
},
|
|
533
|
+
}, Xe = () => {
|
|
534
|
+
P(!0);
|
|
535
|
+
}, Fe = (e) => {
|
|
564
536
|
if (e.preventDefault(), e.stopPropagation(), u.startsWith("data:")) {
|
|
565
537
|
const r = window.open("", "_blank");
|
|
566
538
|
r && (r.document.write(`
|
|
567
539
|
<!DOCTYPE html>
|
|
568
540
|
<html>
|
|
569
541
|
<head>
|
|
570
|
-
<title>${
|
|
542
|
+
<title>${p || "Image"}</title>
|
|
571
543
|
<style>
|
|
572
544
|
body {
|
|
573
545
|
margin: 0;
|
|
@@ -585,98 +557,96 @@ function Sr({
|
|
|
585
557
|
</style>
|
|
586
558
|
</head>
|
|
587
559
|
<body>
|
|
588
|
-
<img src="${u}" alt="${
|
|
560
|
+
<img src="${u}" alt="${p || "Image"}" />
|
|
589
561
|
</body>
|
|
590
562
|
</html>
|
|
591
563
|
`), r.document.close());
|
|
592
564
|
} else
|
|
593
565
|
window.open(u, "_blank");
|
|
594
|
-
},
|
|
566
|
+
}, Ge = (e) => {
|
|
595
567
|
e.preventDefault(), e.stopPropagation(), n.update(() => {
|
|
596
|
-
const r =
|
|
597
|
-
if (
|
|
598
|
-
const
|
|
599
|
-
r.remove(),
|
|
568
|
+
const r = J(b);
|
|
569
|
+
if (X(r)) {
|
|
570
|
+
const s = r.getParent();
|
|
571
|
+
r.remove(), s && Ce(s) && s.getChildrenSize() === 0 && s.setFormat("left");
|
|
600
572
|
}
|
|
601
573
|
});
|
|
602
|
-
},
|
|
574
|
+
}, Y = (e, r) => {
|
|
603
575
|
e.preventDefault(), e.stopPropagation(), n.update(() => {
|
|
604
|
-
const
|
|
605
|
-
|
|
576
|
+
const s = J(b);
|
|
577
|
+
X(s) && s.setPosition(r);
|
|
606
578
|
});
|
|
607
|
-
},
|
|
608
|
-
e.preventDefault(), e.stopPropagation(),
|
|
609
|
-
},
|
|
610
|
-
|
|
611
|
-
|
|
579
|
+
}, qe = (e) => {
|
|
580
|
+
e.preventDefault(), e.stopPropagation(), d(!g);
|
|
581
|
+
}, Ve = A(() => {
|
|
582
|
+
f && !m && (B.current = setTimeout(() => {
|
|
583
|
+
ge(!0);
|
|
612
584
|
}, 300));
|
|
613
|
-
}, [
|
|
614
|
-
|
|
615
|
-
}, []),
|
|
616
|
-
e.preventDefault(), e.stopPropagation(),
|
|
617
|
-
}, [
|
|
618
|
-
|
|
619
|
-
|
|
585
|
+
}, [f, m]), Je = A(() => {
|
|
586
|
+
B.current && (clearTimeout(B.current), B.current = null), ge(!1);
|
|
587
|
+
}, []), be = A((e) => {
|
|
588
|
+
e.preventDefault(), e.stopPropagation(), f && window.open(f, "_blank", "noopener,noreferrer");
|
|
589
|
+
}, [f]);
|
|
590
|
+
se(() => () => {
|
|
591
|
+
B.current && clearTimeout(B.current);
|
|
620
592
|
}, []);
|
|
621
|
-
const
|
|
622
|
-
if (!
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
const e = $.loading("Refining image...", {
|
|
593
|
+
const ye = async () => {
|
|
594
|
+
if (!z.trim() || j) return;
|
|
595
|
+
ue(!0);
|
|
596
|
+
const e = _.loading("Refining image...", {
|
|
626
597
|
description: "This may take 10-30 seconds. Please wait."
|
|
627
598
|
});
|
|
628
599
|
try {
|
|
629
|
-
let r =
|
|
600
|
+
let r = z.trim();
|
|
630
601
|
if (k && k.trim()) {
|
|
631
|
-
const
|
|
632
|
-
r = `${
|
|
633
|
-
} else if (
|
|
634
|
-
const
|
|
635
|
-
r = `${
|
|
602
|
+
const ce = k.trim(), it = z.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
|
|
603
|
+
r = `${ce} with ${it}`;
|
|
604
|
+
} else if (p && p !== "Generated image" && p.trim()) {
|
|
605
|
+
const ce = z.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
|
|
606
|
+
r = `${p} with ${ce}`;
|
|
636
607
|
}
|
|
637
|
-
const
|
|
608
|
+
const y = (await Ot({
|
|
638
609
|
content: `Generate Image: ${r}`
|
|
639
|
-
})
|
|
610
|
+
}))?.data;
|
|
640
611
|
if (!y)
|
|
641
612
|
throw new Error("Failed to generate image - empty response");
|
|
642
|
-
const
|
|
643
|
-
if (!
|
|
613
|
+
const ne = new DOMParser().parseFromString(y, "text/html").querySelector("img");
|
|
614
|
+
if (!ne || !ne.src)
|
|
644
615
|
throw new Error("No image found in response");
|
|
645
|
-
const
|
|
646
|
-
|
|
616
|
+
const rt = ne.src;
|
|
617
|
+
_.dismiss(e), _.success("Image refined successfully!", {
|
|
647
618
|
description: "Compare the images and choose which to keep."
|
|
648
|
-
}),
|
|
619
|
+
}), ee(rt), te(r), Z(!0), U(""), d(!1);
|
|
649
620
|
} catch (r) {
|
|
650
|
-
if (
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
description: r.message,
|
|
654
|
-
duration: 8e3
|
|
655
|
-
});
|
|
656
|
-
} else
|
|
657
|
-
r instanceof Ht ? $.error("Credits Issue", {
|
|
621
|
+
if (_.dismiss(e), r instanceof Ht) {
|
|
622
|
+
const s = r.code === "API_KEYS_DISABLED" ? "API Keys Disabled" : "API Key Required";
|
|
623
|
+
_.error(s, {
|
|
658
624
|
description: r.message,
|
|
659
625
|
duration: 8e3
|
|
660
|
-
}) : $.error("Failed to refine image", {
|
|
661
|
-
description: r instanceof Error ? r.message : "Unknown error. Please try again."
|
|
662
626
|
});
|
|
627
|
+
} else r instanceof Tt ? _.error("Credits Issue", {
|
|
628
|
+
description: r.message,
|
|
629
|
+
duration: 8e3
|
|
630
|
+
}) : _.error("Failed to refine image", {
|
|
631
|
+
description: r instanceof Error ? r.message : "Unknown error. Please try again."
|
|
632
|
+
});
|
|
663
633
|
} finally {
|
|
664
|
-
|
|
634
|
+
ue(!1);
|
|
665
635
|
}
|
|
666
|
-
},
|
|
636
|
+
}, Ue = () => {
|
|
667
637
|
n.update(() => {
|
|
668
|
-
const e =
|
|
669
|
-
if (
|
|
670
|
-
e.setSrc(me), e.setOriginalPrompt(
|
|
671
|
-
const r =
|
|
672
|
-
r &&
|
|
638
|
+
const e = J(b);
|
|
639
|
+
if (X(e)) {
|
|
640
|
+
e.setSrc(me), e.setOriginalPrompt(He);
|
|
641
|
+
const r = V();
|
|
642
|
+
r && ae(r.clone());
|
|
673
643
|
}
|
|
674
|
-
}), Z(!1),
|
|
644
|
+
}), Z(!1), ee(""), te(""), _.success("Image replaced successfully!", {
|
|
675
645
|
description: "The image has been updated with the refined version."
|
|
676
646
|
});
|
|
677
|
-
},
|
|
678
|
-
Z(!1),
|
|
679
|
-
},
|
|
647
|
+
}, Ze = () => {
|
|
648
|
+
Z(!1), ee(""), te("");
|
|
649
|
+
}, Qe = m && K(i) && !W, xe = (m || W) && D, et = () => l === "left" || l === "right" ? {
|
|
680
650
|
position: "relative",
|
|
681
651
|
display: "block",
|
|
682
652
|
width: "100%"
|
|
@@ -692,55 +662,55 @@ function Sr({
|
|
|
692
662
|
} : {
|
|
693
663
|
position: "relative",
|
|
694
664
|
display: "inline-block"
|
|
695
|
-
},
|
|
665
|
+
}, tt = A(
|
|
696
666
|
(e) => {
|
|
697
|
-
if (
|
|
667
|
+
if (W || e.target.closest("button"))
|
|
698
668
|
return;
|
|
699
|
-
const
|
|
669
|
+
const s = e.target === x.current;
|
|
700
670
|
let y = !1;
|
|
701
|
-
if (!
|
|
671
|
+
if (!s && x.current) {
|
|
702
672
|
const w = x.current.getBoundingClientRect();
|
|
703
673
|
y = e.clientX >= w.left && e.clientX <= w.right && e.clientY >= w.top && e.clientY <= w.bottom;
|
|
704
674
|
}
|
|
705
|
-
!
|
|
675
|
+
!s && !y || (e.stopPropagation(), e.shiftKey ? I(!m) : (O(), I(!0)));
|
|
706
676
|
},
|
|
707
|
-
[
|
|
677
|
+
[W, m, I, O]
|
|
708
678
|
);
|
|
709
|
-
return /* @__PURE__ */ t(
|
|
679
|
+
return /* @__PURE__ */ t(wt, { fallback: null, children: /* @__PURE__ */ h(ot, { children: [
|
|
710
680
|
/* @__PURE__ */ h(
|
|
711
681
|
"div",
|
|
712
682
|
{
|
|
713
|
-
draggable:
|
|
714
|
-
style:
|
|
715
|
-
onClick:
|
|
716
|
-
onMouseEnter:
|
|
717
|
-
onMouseLeave:
|
|
683
|
+
draggable: Qe,
|
|
684
|
+
style: et(),
|
|
685
|
+
onClick: tt,
|
|
686
|
+
onMouseEnter: Ve,
|
|
687
|
+
onMouseLeave: Je,
|
|
718
688
|
children: [
|
|
719
|
-
|
|
720
|
-
|
|
689
|
+
v ? /* @__PURE__ */ t(Gt, {}) : /* @__PURE__ */ t(
|
|
690
|
+
Ft,
|
|
721
691
|
{
|
|
722
|
-
className:
|
|
692
|
+
className: xe ? `focused ${K(i) ? "draggable" : ""}` : f ? "cteditor-cursor-pointer" : null,
|
|
723
693
|
src: u,
|
|
724
|
-
altText:
|
|
694
|
+
altText: p,
|
|
725
695
|
imageRef: x,
|
|
726
696
|
width: N,
|
|
727
|
-
height:
|
|
728
|
-
maxWidth:
|
|
729
|
-
onError: () =>
|
|
697
|
+
height: S,
|
|
698
|
+
maxWidth: E,
|
|
699
|
+
onError: () => C(!0)
|
|
730
700
|
}
|
|
731
701
|
),
|
|
732
|
-
|
|
702
|
+
Te && f && !m && /* @__PURE__ */ h(
|
|
733
703
|
"div",
|
|
734
704
|
{
|
|
735
705
|
className: "cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background cteditor-rounded-lg cteditor-shadow-lg cteditor-border cteditor-border-border cteditor-p-2 cteditor-flex cteditor-items-center cteditor-gap-2",
|
|
736
706
|
style: { zIndex: 10 },
|
|
737
707
|
children: [
|
|
738
|
-
/* @__PURE__ */ t(
|
|
739
|
-
/* @__PURE__ */ t("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children:
|
|
708
|
+
/* @__PURE__ */ t(jt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground cteditor-flex-shrink-0" }),
|
|
709
|
+
/* @__PURE__ */ t("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children: f }),
|
|
740
710
|
/* @__PURE__ */ t(
|
|
741
711
|
"button",
|
|
742
712
|
{
|
|
743
|
-
onClick:
|
|
713
|
+
onClick: be,
|
|
744
714
|
className: "cteditor-px-2 cteditor-py-1.5 cteditor-text-xs cteditor-rounded cteditor-bg-primary cteditor-text-primary-foreground hover:cteditor-bg-primary/90 cteditor-transition-colors cteditor-flex-shrink-0",
|
|
745
715
|
children: "Open"
|
|
746
716
|
}
|
|
@@ -748,125 +718,125 @@ function Sr({
|
|
|
748
718
|
]
|
|
749
719
|
}
|
|
750
720
|
),
|
|
751
|
-
|
|
721
|
+
m && K(i) && !v && /* @__PURE__ */ h(
|
|
752
722
|
"div",
|
|
753
723
|
{
|
|
754
|
-
className: `cteditor-absolute cteditor-flex cteditor-gap-1 z-10 ${
|
|
724
|
+
className: `cteditor-absolute cteditor-flex cteditor-gap-1 z-10 ${Be ? "cteditor-left-1/2 cteditor--translate-x-1/2 cteditor-bottom-0 cteditor-translate-y-full cteditor-mt-1" : "cteditor-top-2 cteditor-right-2"}`,
|
|
755
725
|
children: [
|
|
756
726
|
/* @__PURE__ */ h("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-0.5 cteditor-bg-background/80 cteditor-rounded-md cteditor-shadow-md cteditor-border cteditor-border-border cteditor-p-0.5", children: [
|
|
757
727
|
/* @__PURE__ */ t(
|
|
758
728
|
"button",
|
|
759
729
|
{
|
|
760
|
-
onClick: (e) =>
|
|
730
|
+
onClick: (e) => Y(e, "left"),
|
|
761
731
|
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "left" ? "cteditor-bg-accent" : ""}`,
|
|
762
732
|
"aria-label": "Wrap text left",
|
|
763
733
|
title: "Wrap text left",
|
|
764
|
-
children: /* @__PURE__ */ t(
|
|
734
|
+
children: /* @__PURE__ */ t(Rt, {})
|
|
765
735
|
}
|
|
766
736
|
),
|
|
767
737
|
/* @__PURE__ */ t(
|
|
768
738
|
"button",
|
|
769
739
|
{
|
|
770
|
-
onClick: (e) =>
|
|
740
|
+
onClick: (e) => Y(e, "right"),
|
|
771
741
|
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "right" ? "cteditor-bg-accent" : ""}`,
|
|
772
742
|
"aria-label": "Wrap text right",
|
|
773
743
|
title: "Wrap text right",
|
|
774
|
-
children: /* @__PURE__ */ t(
|
|
744
|
+
children: /* @__PURE__ */ t(Dt, {})
|
|
775
745
|
}
|
|
776
746
|
),
|
|
777
747
|
/* @__PURE__ */ t("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
|
|
778
748
|
/* @__PURE__ */ t(
|
|
779
749
|
"button",
|
|
780
750
|
{
|
|
781
|
-
onClick: (e) =>
|
|
751
|
+
onClick: (e) => Y(e, "inline-left"),
|
|
782
752
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "inline-left" ? "cteditor-bg-accent" : ""}`,
|
|
783
753
|
"aria-label": "Align left",
|
|
784
754
|
title: "Align left (no text wrap)",
|
|
785
|
-
children: /* @__PURE__ */ t(
|
|
755
|
+
children: /* @__PURE__ */ t(zt, {})
|
|
786
756
|
}
|
|
787
757
|
),
|
|
788
758
|
/* @__PURE__ */ t(
|
|
789
759
|
"button",
|
|
790
760
|
{
|
|
791
|
-
onClick: (e) =>
|
|
761
|
+
onClick: (e) => Y(e, "inline-center"),
|
|
792
762
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "inline-center" || l === "full" ? "cteditor-bg-accent" : ""}`,
|
|
793
763
|
"aria-label": "Align center",
|
|
794
764
|
title: "Align center (no text wrap)",
|
|
795
|
-
children: /* @__PURE__ */ t(
|
|
765
|
+
children: /* @__PURE__ */ t(St, {})
|
|
796
766
|
}
|
|
797
767
|
),
|
|
798
768
|
/* @__PURE__ */ t(
|
|
799
769
|
"button",
|
|
800
770
|
{
|
|
801
|
-
onClick: (e) =>
|
|
771
|
+
onClick: (e) => Y(e, "inline-right"),
|
|
802
772
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "inline-right" ? "cteditor-bg-accent" : ""}`,
|
|
803
773
|
"aria-label": "Align right",
|
|
804
774
|
title: "Align right (no text wrap)",
|
|
805
|
-
children: /* @__PURE__ */ t(
|
|
775
|
+
children: /* @__PURE__ */ t(Lt, {})
|
|
806
776
|
}
|
|
807
777
|
),
|
|
808
778
|
/* @__PURE__ */ t("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
|
|
809
779
|
/* @__PURE__ */ t(
|
|
810
780
|
"button",
|
|
811
781
|
{
|
|
812
|
-
onClick: (e) =>
|
|
782
|
+
onClick: (e) => Y(e, "none"),
|
|
813
783
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "none" ? "cteditor-bg-accent" : ""}`,
|
|
814
784
|
"aria-label": "Inline",
|
|
815
785
|
title: "Inline with text",
|
|
816
|
-
children: /* @__PURE__ */ t(
|
|
786
|
+
children: /* @__PURE__ */ t(Wt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
817
787
|
}
|
|
818
788
|
)
|
|
819
789
|
] }),
|
|
820
|
-
|
|
790
|
+
f && /* @__PURE__ */ t(
|
|
821
791
|
"button",
|
|
822
792
|
{
|
|
823
|
-
onClick:
|
|
793
|
+
onClick: be,
|
|
824
794
|
className: " cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-accent cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
|
|
825
795
|
"aria-label": "Visit link",
|
|
826
|
-
title: `Visit: ${
|
|
827
|
-
children: /* @__PURE__ */ t(
|
|
796
|
+
title: `Visit: ${f}`,
|
|
797
|
+
children: /* @__PURE__ */ t(At, {})
|
|
828
798
|
}
|
|
829
799
|
),
|
|
830
800
|
k && /* @__PURE__ */ t(
|
|
831
801
|
"button",
|
|
832
802
|
{
|
|
833
803
|
onClick: (e) => {
|
|
834
|
-
e.stopPropagation(),
|
|
804
|
+
e.stopPropagation(), qe(e);
|
|
835
805
|
},
|
|
836
806
|
className: " cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-accent cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
|
|
837
807
|
"aria-label": "Refine image",
|
|
838
808
|
title: "Refine image",
|
|
839
|
-
children: /* @__PURE__ */ t(
|
|
809
|
+
children: /* @__PURE__ */ t(Mt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
840
810
|
}
|
|
841
811
|
),
|
|
842
812
|
/* @__PURE__ */ t(
|
|
843
813
|
"button",
|
|
844
814
|
{
|
|
845
815
|
onClick: (e) => {
|
|
846
|
-
e.stopPropagation(),
|
|
816
|
+
e.stopPropagation(), Fe(e);
|
|
847
817
|
},
|
|
848
818
|
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-accent cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
|
|
849
819
|
"aria-label": "Open image in new tab",
|
|
850
820
|
title: "Open in new tab",
|
|
851
|
-
children: /* @__PURE__ */ t(
|
|
821
|
+
children: /* @__PURE__ */ t($t, {})
|
|
852
822
|
}
|
|
853
823
|
),
|
|
854
824
|
/* @__PURE__ */ t(
|
|
855
825
|
"button",
|
|
856
826
|
{
|
|
857
827
|
onClick: (e) => {
|
|
858
|
-
e.stopPropagation(),
|
|
828
|
+
e.stopPropagation(), Ge(e);
|
|
859
829
|
},
|
|
860
830
|
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-destructive hover:cteditor-text-destructive-foreground cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
|
|
861
831
|
"aria-label": "Delete image",
|
|
862
832
|
title: "Delete image",
|
|
863
|
-
children: /* @__PURE__ */ t(
|
|
833
|
+
children: /* @__PURE__ */ t(_t, {})
|
|
864
834
|
}
|
|
865
835
|
)
|
|
866
836
|
]
|
|
867
837
|
}
|
|
868
838
|
),
|
|
869
|
-
|
|
839
|
+
g && m && !v && k && /* @__PURE__ */ t(
|
|
870
840
|
"div",
|
|
871
841
|
{
|
|
872
842
|
className: "cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background cteditor-rounded-lg cteditor-shadow-xl cteditor-border cteditor-border-border cteditor-p-3",
|
|
@@ -880,10 +850,10 @@ function Sr({
|
|
|
880
850
|
"input",
|
|
881
851
|
{
|
|
882
852
|
type: "text",
|
|
883
|
-
value:
|
|
884
|
-
onChange: (e) =>
|
|
853
|
+
value: z,
|
|
854
|
+
onChange: (e) => U(e.target.value),
|
|
885
855
|
onKeyDown: (e) => {
|
|
886
|
-
e.stopPropagation(), e.key === "Enter" &&
|
|
856
|
+
e.stopPropagation(), e.key === "Enter" && z.trim() && !j && ye(), e.key === "Escape" && (d(!1), U(""));
|
|
887
857
|
},
|
|
888
858
|
onKeyUp: (e) => {
|
|
889
859
|
e.stopPropagation();
|
|
@@ -893,7 +863,7 @@ function Sr({
|
|
|
893
863
|
},
|
|
894
864
|
placeholder: "e.g., flying birds, golden sunset, stormy clouds...",
|
|
895
865
|
className: "cteditor-w-full cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-border cteditor-border-border cteditor-rounded-md cteditor-bg-background cteditor-text-foreground focus:cteditor-outline-none focus:cteditor-ring-2 focus:cteditor-ring-blue-500",
|
|
896
|
-
disabled:
|
|
866
|
+
disabled: j,
|
|
897
867
|
autoFocus: !0
|
|
898
868
|
}
|
|
899
869
|
),
|
|
@@ -902,11 +872,11 @@ function Sr({
|
|
|
902
872
|
"button",
|
|
903
873
|
{
|
|
904
874
|
onClick: (e) => {
|
|
905
|
-
e.stopPropagation(),
|
|
875
|
+
e.stopPropagation(), ye();
|
|
906
876
|
},
|
|
907
|
-
disabled:
|
|
877
|
+
disabled: j || !z.trim(),
|
|
908
878
|
className: "cteditor-flex-1 cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-blue-500 cteditor-text-white hover:cteditor-bg-blue-600 disabled:cteditor-opacity-50 disabled:cteditor-cursor-not-allowed cteditor-transition-colors",
|
|
909
|
-
children:
|
|
879
|
+
children: j ? /* @__PURE__ */ h("span", { className: "cteditor-flex cteditor-items-center cteditor-justify-center cteditor-gap-2", children: [
|
|
910
880
|
/* @__PURE__ */ t("span", { className: "cteditor-inline-block cteditor-w-4 cteditor-h-4 cteditor-border-2 cteditor-border-white cteditor-border-t-transparent cteditor-rounded-full cteditor-animate-spin" }),
|
|
911
881
|
"Refining..."
|
|
912
882
|
] }) : "Refine Image"
|
|
@@ -916,9 +886,9 @@ function Sr({
|
|
|
916
886
|
"button",
|
|
917
887
|
{
|
|
918
888
|
onClick: (e) => {
|
|
919
|
-
e.stopPropagation(),
|
|
889
|
+
e.stopPropagation(), d(!1), U("");
|
|
920
890
|
},
|
|
921
|
-
disabled:
|
|
891
|
+
disabled: j,
|
|
922
892
|
className: "cteditor-px-3 cteditor-py-2 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",
|
|
923
893
|
children: "Cancel"
|
|
924
894
|
}
|
|
@@ -927,24 +897,24 @@ function Sr({
|
|
|
927
897
|
] })
|
|
928
898
|
}
|
|
929
899
|
),
|
|
930
|
-
|
|
931
|
-
|
|
900
|
+
F && K(i) && xe && /* @__PURE__ */ t(
|
|
901
|
+
Kt,
|
|
932
902
|
{
|
|
933
|
-
showCaption:
|
|
934
|
-
setShowCaption:
|
|
903
|
+
showCaption: M,
|
|
904
|
+
setShowCaption: Ye,
|
|
935
905
|
editor: n,
|
|
936
|
-
buttonRef:
|
|
906
|
+
buttonRef: G,
|
|
937
907
|
imageRef: x,
|
|
938
|
-
maxWidth:
|
|
939
|
-
onResizeStart:
|
|
940
|
-
onResizeEnd:
|
|
941
|
-
captionsEnabled: !
|
|
908
|
+
maxWidth: E,
|
|
909
|
+
onResizeStart: Xe,
|
|
910
|
+
onResizeEnd: Ke,
|
|
911
|
+
captionsEnabled: !v && T
|
|
942
912
|
}
|
|
943
913
|
)
|
|
944
914
|
]
|
|
945
915
|
}
|
|
946
916
|
),
|
|
947
|
-
|
|
917
|
+
M && (p.startsWith("Signature by") ? /* @__PURE__ */ t(Yt, { caption: L }) : /* @__PURE__ */ t(
|
|
948
918
|
"div",
|
|
949
919
|
{
|
|
950
920
|
className: "image-caption-container",
|
|
@@ -955,61 +925,61 @@ function Sr({
|
|
|
955
925
|
...l === "inline-center" || l === "full" ? { margin: "0 auto" } : l === "inline-right" ? { marginLeft: "auto" } : l === "left" ? { float: "left", clear: "left" } : l === "right" ? { float: "right", clear: "right" } : {}
|
|
956
926
|
},
|
|
957
927
|
children: /* @__PURE__ */ h(
|
|
958
|
-
|
|
928
|
+
De,
|
|
959
929
|
{
|
|
960
|
-
initialEditor:
|
|
930
|
+
initialEditor: L,
|
|
961
931
|
initialNodes: [
|
|
962
|
-
Se,
|
|
963
932
|
Le,
|
|
964
933
|
We,
|
|
965
934
|
Ae,
|
|
935
|
+
Me,
|
|
966
936
|
ke,
|
|
967
|
-
|
|
937
|
+
Ee
|
|
968
938
|
],
|
|
969
939
|
children: [
|
|
970
|
-
/* @__PURE__ */ t(
|
|
940
|
+
/* @__PURE__ */ t(nt, {}),
|
|
971
941
|
/* @__PURE__ */ t(
|
|
972
|
-
|
|
942
|
+
Se,
|
|
973
943
|
{
|
|
974
944
|
contentEditable: /* @__PURE__ */ t(
|
|
975
|
-
|
|
945
|
+
Ie,
|
|
976
946
|
{
|
|
977
947
|
"aria-placeholder": "Enter a caption...",
|
|
978
948
|
placeholder: () => /* @__PURE__ */ t("span", { className: "cteditor-text-xs", children: "Enter a caption..." }),
|
|
979
949
|
className: "ImageNode__contentEditable"
|
|
980
950
|
}
|
|
981
951
|
),
|
|
982
|
-
ErrorBoundary:
|
|
952
|
+
ErrorBoundary: Pe
|
|
983
953
|
}
|
|
984
954
|
),
|
|
985
955
|
/* @__PURE__ */ t(
|
|
986
|
-
|
|
956
|
+
ze,
|
|
987
957
|
{
|
|
988
958
|
onChange: () => {
|
|
989
959
|
}
|
|
990
960
|
}
|
|
991
961
|
),
|
|
992
|
-
/* @__PURE__ */ t(
|
|
993
|
-
/* @__PURE__ */ t(
|
|
962
|
+
/* @__PURE__ */ t(Re, {}),
|
|
963
|
+
/* @__PURE__ */ t($e, { namespace: _e.namespace })
|
|
994
964
|
]
|
|
995
965
|
}
|
|
996
966
|
)
|
|
997
967
|
}
|
|
998
968
|
)),
|
|
999
969
|
/* @__PURE__ */ t(
|
|
1000
|
-
|
|
970
|
+
Bt,
|
|
1001
971
|
{
|
|
1002
|
-
open:
|
|
972
|
+
open: Oe,
|
|
1003
973
|
onOpenChange: Z,
|
|
1004
974
|
oldImageUrl: u,
|
|
1005
975
|
newImageUrl: me,
|
|
1006
|
-
onReplace:
|
|
1007
|
-
onCancel:
|
|
976
|
+
onReplace: Ue,
|
|
977
|
+
onCancel: Ze
|
|
1008
978
|
}
|
|
1009
979
|
)
|
|
1010
980
|
] }) });
|
|
1011
981
|
}
|
|
1012
982
|
export {
|
|
1013
|
-
|
|
1014
|
-
|
|
983
|
+
ve as RIGHT_CLICK_IMAGE_COMMAND,
|
|
984
|
+
gr as default
|
|
1015
985
|
};
|