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