eddyter 1.3.51 → 1.3.53
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/assets/style.css +1 -1
- package/dist/babel-2d5b260f.js +7770 -0
- package/dist/estree-28f5912a.js +4920 -0
- package/dist/html-3f297a3a.js +3021 -0
- package/dist/{html2pdf.bundle-09e49a74.js → html2pdf.bundle-fbac7142.js} +1 -1
- package/dist/{html2pdf.bundle.min-5c629a1a.js → html2pdf.bundle.min-13392d4b.js} +1 -1
- package/dist/{index-269df0bf.js → index-006b2aae.js} +15159 -13547
- package/dist/{index-1cd4fd49.js → index-a38293b8.js} +209 -197
- package/dist/{index-28f8506d.js → index-ace45f64.js} +8 -8
- package/dist/index.js +1 -1
- package/dist/markdown-08edd93b.js +3625 -0
- package/dist/postcss-0e22bc25.js +5187 -0
- package/dist/standalone-83d5947a.js +2728 -0
- package/dist/types.d.ts +2 -0
- package/dist/typescript-0559ee85.js +13660 -0
- package/dist/ui/Icons.d.ts +5 -1
- package/package.json +2 -2
- package/dist/babel-44680aef.js +0 -7744
- package/dist/estree-a7dc9ac5.js +0 -4647
- package/dist/html-f2fcab26.js +0 -2882
- 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,4 +1,4 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as h, Fragment as it } from "react/jsx-runtime";
|
|
2
2
|
import { CodeNode as ve } from "@lexical/code";
|
|
3
3
|
import { LinkNode as ke } from "@lexical/link";
|
|
4
4
|
import { AutoFocusPlugin as ot } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
@@ -12,10 +12,10 @@ import { OnChangePlugin as De } from "@lexical/react/LexicalOnChangePlugin";
|
|
|
12
12
|
import { RichTextPlugin as ze } from "@lexical/react/LexicalRichTextPlugin";
|
|
13
13
|
import { useLexicalEditable as at } from "@lexical/react/useLexicalEditable";
|
|
14
14
|
import { useLexicalNodeSelection as st } from "@lexical/react/useLexicalNodeSelection";
|
|
15
|
-
import { calculateZoomLevel as
|
|
16
|
-
import { RootNode as Se, TextNode as Le, LineBreakNode as We, ParagraphNode as Ae, $getSelection as J, $isNodeSelection as X, $isParagraphNode as
|
|
17
|
-
import { useRef as
|
|
18
|
-
import {
|
|
15
|
+
import { calculateZoomLevel as xe, mergeRegister as dt } from "@lexical/utils";
|
|
16
|
+
import { RootNode as Se, TextNode as Le, LineBreakNode as We, ParagraphNode as Ae, $getSelection as J, $isNodeSelection as X, $isParagraphNode as we, $setSelection as ce, $isRangeSelection as lt, SELECTION_CHANGE_COMMAND as ut, COMMAND_PRIORITY_LOW as M, CLICK_COMMAND as mt, DRAGSTART_COMMAND as gt, KEY_DELETE_COMMAND as ht, KEY_BACKSPACE_COMMAND as pt, KEY_ENTER_COMMAND as ft, KEY_ESCAPE_COMMAND as bt, createCommand as yt, $getNodeByKey as U } from "lexical";
|
|
17
|
+
import { useRef as T, useState as R, useEffect as ae, useCallback as W, Suspense as xt } from "react";
|
|
18
|
+
import { a as wt, D as Ct, b as Nt, d as vt, e as kt, f as Et, h as It, B as Ce, L as Me, i as $e, $ as F, W as Pt, j as Rt, A as Dt, k as zt, l as St, T as Lt, m as Wt, S as At, E as Mt, n as $t, t as $, o as _t, p as Ot, C as Ht } from "./index-006b2aae.js";
|
|
19
19
|
import "axios";
|
|
20
20
|
import "react-dom";
|
|
21
21
|
import "@emotion/styled";
|
|
@@ -40,29 +40,29 @@ import "@lexical/react/LexicalTypeaheadMenuPlugin";
|
|
|
40
40
|
* This source code is licensed under the ISC license.
|
|
41
41
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
42
|
*/
|
|
43
|
-
const
|
|
43
|
+
const Tt = wt("Link2", [
|
|
44
44
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
45
45
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
46
46
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
47
47
|
]);
|
|
48
|
-
const
|
|
49
|
-
open:
|
|
50
|
-
onOpenChange:
|
|
51
|
-
oldImageUrl:
|
|
48
|
+
const jt = ({
|
|
49
|
+
open: m,
|
|
50
|
+
onOpenChange: f,
|
|
51
|
+
oldImageUrl: b,
|
|
52
52
|
newImageUrl: N,
|
|
53
53
|
onReplace: z,
|
|
54
54
|
onCancel: v
|
|
55
|
-
}) => /* @__PURE__ */ t(Ct, { open:
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
55
|
+
}) => /* @__PURE__ */ t(Ct, { open: m, onOpenChange: f, children: /* @__PURE__ */ h(Nt, { className: "sm:max-w-[800px] max-h-[90vh] overflow-y-auto", children: [
|
|
56
|
+
/* @__PURE__ */ h(vt, { children: [
|
|
57
|
+
/* @__PURE__ */ h(kt, { className: "flex items-center gap-2 text-xl", children: [
|
|
58
58
|
/* @__PURE__ */ t("span", { className: "text-2xl", children: "🔄" }),
|
|
59
59
|
"Compare Images"
|
|
60
60
|
] }),
|
|
61
61
|
/* @__PURE__ */ t(Et, { className: "text-sm pt-1", children: "Choose whether to replace the original image with the refined version." })
|
|
62
62
|
] }),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ h("div", { className: "space-y-4 py-4", children: [
|
|
64
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ h("div", { className: "space-y-2", children: [
|
|
65
|
+
/* @__PURE__ */ h("div", { className: "flex items-center justify-between", children: [
|
|
66
66
|
/* @__PURE__ */ t("span", { className: "text-sm font-semibold text-gray-700 dark:text-gray-300", children: "Refined Image" }),
|
|
67
67
|
/* @__PURE__ */ t("span", { className: "text-xs px-2 py-1 rounded-full bg-blue-100 dark:bg-blue-950/30 text-blue-600 dark:text-blue-400", children: "New" })
|
|
68
68
|
] }),
|
|
@@ -75,12 +75,12 @@ const Tt = ({
|
|
|
75
75
|
}
|
|
76
76
|
) })
|
|
77
77
|
] }) }),
|
|
78
|
-
/* @__PURE__ */ t("div", { className: "p-3 rounded-lg bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800", children: /* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ t("div", { className: "p-3 rounded-lg bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800", children: /* @__PURE__ */ h("p", { className: "text-sm text-blue-800 dark:text-blue-200", children: [
|
|
79
79
|
/* @__PURE__ */ t("span", { className: "font-semibold", children: "Note:" }),
|
|
80
80
|
' Clicking "Replace" will update the image in your document. This action cannot be undone.'
|
|
81
81
|
] }) })
|
|
82
82
|
] }),
|
|
83
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ h(It, { className: "gap-2", children: [
|
|
84
84
|
/* @__PURE__ */ t(
|
|
85
85
|
Ce,
|
|
86
86
|
{
|
|
@@ -89,7 +89,7 @@ const Tt = ({
|
|
|
89
89
|
children: "Keep Original"
|
|
90
90
|
}
|
|
91
91
|
),
|
|
92
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ h(
|
|
93
93
|
Ce,
|
|
94
94
|
{
|
|
95
95
|
onClick: z,
|
|
@@ -103,12 +103,12 @@ const Tt = ({
|
|
|
103
103
|
] })
|
|
104
104
|
] }) });
|
|
105
105
|
function Bt({
|
|
106
|
-
caption:
|
|
106
|
+
caption: m
|
|
107
107
|
}) {
|
|
108
|
-
return /* @__PURE__ */ t("div", { className: "signature-caption-container", children: /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ t("div", { className: "signature-caption-container", children: /* @__PURE__ */ h(
|
|
109
109
|
Re,
|
|
110
110
|
{
|
|
111
|
-
initialEditor:
|
|
111
|
+
initialEditor: m,
|
|
112
112
|
initialNodes: [
|
|
113
113
|
Se,
|
|
114
114
|
Le,
|
|
@@ -149,8 +149,8 @@ function Bt({
|
|
|
149
149
|
}
|
|
150
150
|
) });
|
|
151
151
|
}
|
|
152
|
-
function se(
|
|
153
|
-
return Math.min(Math.max(
|
|
152
|
+
function se(m, f, b) {
|
|
153
|
+
return Math.min(Math.max(m, f), b);
|
|
154
154
|
}
|
|
155
155
|
const s = {
|
|
156
156
|
east: 1,
|
|
@@ -159,9 +159,9 @@ const s = {
|
|
|
159
159
|
west: 4
|
|
160
160
|
};
|
|
161
161
|
function Yt({
|
|
162
|
-
onResizeStart:
|
|
163
|
-
onResizeEnd:
|
|
164
|
-
buttonRef:
|
|
162
|
+
onResizeStart: m,
|
|
163
|
+
onResizeEnd: f,
|
|
164
|
+
buttonRef: b,
|
|
165
165
|
imageRef: N,
|
|
166
166
|
maxWidth: z,
|
|
167
167
|
editor: v,
|
|
@@ -169,10 +169,10 @@ function Yt({
|
|
|
169
169
|
setShowCaption: A,
|
|
170
170
|
captionsEnabled: S
|
|
171
171
|
}) {
|
|
172
|
-
const
|
|
172
|
+
const j = T(null), k = T({
|
|
173
173
|
priority: "",
|
|
174
174
|
value: "default"
|
|
175
|
-
}),
|
|
175
|
+
}), l = T({
|
|
176
176
|
currentHeight: 0,
|
|
177
177
|
currentWidth: 0,
|
|
178
178
|
direction: 0,
|
|
@@ -182,9 +182,9 @@ function Yt({
|
|
|
182
182
|
startWidth: 0,
|
|
183
183
|
startX: 0,
|
|
184
184
|
startY: 0
|
|
185
|
-
}),
|
|
185
|
+
}), p = v.getRootElement(), x = p !== null ? p.getBoundingClientRect().width - 20 : 100, q = p !== null ? p.getBoundingClientRect().height - 20 : 100, g = 100, E = 100, _ = (i) => {
|
|
186
186
|
const d = i === s.east || i === s.west, o = i === s.north || i === s.south, D = i & s.north && i & s.west || i & s.south && i & s.east, C = d ? "ew" : o ? "ns" : D ? "nwse" : "nesw";
|
|
187
|
-
|
|
187
|
+
p !== null && p.style.setProperty(
|
|
188
188
|
"cursor",
|
|
189
189
|
`${C}-resize`,
|
|
190
190
|
"important"
|
|
@@ -202,7 +202,7 @@ function Yt({
|
|
|
202
202
|
"important"
|
|
203
203
|
));
|
|
204
204
|
}, L = () => {
|
|
205
|
-
|
|
205
|
+
p !== null && p.style.setProperty("cursor", "text"), document.body !== null && (document.body.style.setProperty("cursor", "default"), document.body.style.setProperty(
|
|
206
206
|
"-webkit-user-select",
|
|
207
207
|
k.current.value,
|
|
208
208
|
k.current.priority
|
|
@@ -210,58 +210,58 @@ function Yt({
|
|
|
210
210
|
}, I = (i, d) => {
|
|
211
211
|
if (!v.isEditable())
|
|
212
212
|
return;
|
|
213
|
-
const o = N.current, D =
|
|
213
|
+
const o = N.current, D = j.current;
|
|
214
214
|
if (o !== null && D !== null) {
|
|
215
215
|
i.preventDefault();
|
|
216
|
-
const { width: C, height: P } = o.getBoundingClientRect(),
|
|
217
|
-
a.startWidth = C, a.startHeight = P, a.ratio = C / P, a.currentWidth = C, a.currentHeight = P, a.startX = i.clientX /
|
|
216
|
+
const { width: C, height: P } = o.getBoundingClientRect(), u = xe(o), a = l.current;
|
|
217
|
+
a.startWidth = C, a.startHeight = P, a.ratio = C / P, a.currentWidth = C, a.currentHeight = P, a.startX = i.clientX / u, a.startY = i.clientY / u, a.isResizing = !0, a.direction = d, _(d), m(), D.classList.add("image-control-wrapper--resizing"), o.style.height = `${P}px`, o.style.width = `${C}px`, document.addEventListener("pointermove", n), document.addEventListener("pointerup", O);
|
|
218
218
|
}
|
|
219
219
|
}, n = (i) => {
|
|
220
|
-
const d = N.current, o =
|
|
220
|
+
const d = N.current, o = l.current, D = o.direction & (s.east | s.west), C = o.direction & (s.south | s.north);
|
|
221
221
|
if (d !== null && o.isResizing) {
|
|
222
|
-
const P =
|
|
222
|
+
const P = xe(d);
|
|
223
223
|
if (D && C) {
|
|
224
|
-
let
|
|
225
|
-
|
|
224
|
+
let u = Math.floor(o.startX - i.clientX / P);
|
|
225
|
+
u = o.direction & s.east ? -u : u;
|
|
226
226
|
const a = se(
|
|
227
|
-
o.startWidth +
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
o.startWidth + u,
|
|
228
|
+
g,
|
|
229
|
+
x
|
|
230
230
|
), H = a / o.ratio;
|
|
231
231
|
d.style.width = `${a}px`, d.style.height = `${H}px`, o.currentHeight = H, o.currentWidth = a;
|
|
232
232
|
} else if (C) {
|
|
233
|
-
let
|
|
234
|
-
|
|
233
|
+
let u = Math.floor(o.startY - i.clientY / P);
|
|
234
|
+
u = o.direction & s.south ? -u : u;
|
|
235
235
|
const a = se(
|
|
236
|
-
o.startHeight +
|
|
236
|
+
o.startHeight + u,
|
|
237
237
|
E,
|
|
238
238
|
q
|
|
239
239
|
);
|
|
240
240
|
d.style.height = `${a}px`, o.currentHeight = a;
|
|
241
241
|
} else {
|
|
242
|
-
let
|
|
243
|
-
|
|
242
|
+
let u = Math.floor(o.startX - i.clientX / P);
|
|
243
|
+
u = o.direction & s.east ? -u : u;
|
|
244
244
|
const a = se(
|
|
245
|
-
o.startWidth +
|
|
246
|
-
|
|
247
|
-
|
|
245
|
+
o.startWidth + u,
|
|
246
|
+
g,
|
|
247
|
+
x
|
|
248
248
|
);
|
|
249
249
|
d.style.width = `${a}px`, o.currentWidth = a;
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
}, O = () => {
|
|
253
|
-
const i = N.current, d =
|
|
253
|
+
const i = N.current, d = l.current, o = j.current;
|
|
254
254
|
if (i !== null && o !== null && d.isResizing) {
|
|
255
255
|
const D = d.currentWidth, C = d.currentHeight;
|
|
256
|
-
d.startWidth = 0, d.startHeight = 0, d.ratio = 0, d.startX = 0, d.startY = 0, d.currentWidth = 0, d.currentHeight = 0, d.isResizing = !1, o.classList.remove("image-control-wrapper--resizing"), L(),
|
|
256
|
+
d.startWidth = 0, d.startHeight = 0, d.ratio = 0, d.startX = 0, d.startY = 0, d.currentWidth = 0, d.currentHeight = 0, d.isResizing = !1, o.classList.remove("image-control-wrapper--resizing"), L(), f(D, C), document.removeEventListener("pointermove", n), document.removeEventListener("pointerup", O);
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
return /* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ h("div", { ref: j, children: [
|
|
260
260
|
!G && S && /* @__PURE__ */ t(
|
|
261
261
|
"button",
|
|
262
262
|
{
|
|
263
263
|
className: "image-caption-button",
|
|
264
|
-
ref:
|
|
264
|
+
ref: b,
|
|
265
265
|
onClick: () => {
|
|
266
266
|
A(!G);
|
|
267
267
|
},
|
|
@@ -343,21 +343,21 @@ function Yt({
|
|
|
343
343
|
] });
|
|
344
344
|
}
|
|
345
345
|
const de = /* @__PURE__ */ new Set(), Ne = yt("RIGHT_CLICK_IMAGE_COMMAND");
|
|
346
|
-
function Kt(
|
|
347
|
-
if (!de.has(
|
|
348
|
-
throw new Promise((
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
de.add(
|
|
352
|
-
},
|
|
353
|
-
de.add(
|
|
346
|
+
function Kt(m) {
|
|
347
|
+
if (!de.has(m))
|
|
348
|
+
throw new Promise((f) => {
|
|
349
|
+
const b = new Image();
|
|
350
|
+
b.src = m, b.onload = () => {
|
|
351
|
+
de.add(m), f(null);
|
|
352
|
+
}, b.onerror = () => {
|
|
353
|
+
de.add(m);
|
|
354
354
|
};
|
|
355
355
|
});
|
|
356
356
|
}
|
|
357
357
|
function Xt({
|
|
358
|
-
altText:
|
|
359
|
-
className:
|
|
360
|
-
imageRef:
|
|
358
|
+
altText: m,
|
|
359
|
+
className: f,
|
|
360
|
+
imageRef: b,
|
|
361
361
|
src: N,
|
|
362
362
|
width: z,
|
|
363
363
|
height: v,
|
|
@@ -367,10 +367,10 @@ function Xt({
|
|
|
367
367
|
return Kt(N), /* @__PURE__ */ t(
|
|
368
368
|
"img",
|
|
369
369
|
{
|
|
370
|
-
className:
|
|
370
|
+
className: f || void 0,
|
|
371
371
|
src: N,
|
|
372
|
-
alt:
|
|
373
|
-
ref:
|
|
372
|
+
alt: m,
|
|
373
|
+
ref: b,
|
|
374
374
|
style: typeof z == "number" && typeof v == "number" ? {
|
|
375
375
|
// User has set a numeric size or original dimensions are provided
|
|
376
376
|
width: typeof z == "number" ? z : "auto",
|
|
@@ -401,50 +401,50 @@ function Ft() {
|
|
|
401
401
|
);
|
|
402
402
|
}
|
|
403
403
|
function zr({
|
|
404
|
-
src:
|
|
405
|
-
altText:
|
|
406
|
-
nodeKey:
|
|
404
|
+
src: m,
|
|
405
|
+
altText: f,
|
|
406
|
+
nodeKey: b,
|
|
407
407
|
width: N,
|
|
408
408
|
height: z,
|
|
409
409
|
maxWidth: v,
|
|
410
410
|
resizable: G,
|
|
411
411
|
showCaption: A,
|
|
412
412
|
caption: S,
|
|
413
|
-
captionsEnabled:
|
|
413
|
+
captionsEnabled: j,
|
|
414
414
|
originalPrompt: k,
|
|
415
|
-
position:
|
|
416
|
-
linkUrl:
|
|
415
|
+
position: l = "none",
|
|
416
|
+
linkUrl: p
|
|
417
417
|
}) {
|
|
418
|
-
const
|
|
418
|
+
const x = T(null), q = T(null), [g, E, _] = st(b), [L, I] = R(!1);
|
|
419
419
|
nt();
|
|
420
|
-
const [n] = ct(), [O, i] = R(null), d =
|
|
420
|
+
const [n] = ct(), [O, i] = R(null), d = T(null), [o, D] = R(!1), C = at(), [P, u] = R(!1), [a, H] = R(""), [B, le] = R(!1), [_e, Z] = R(!1), [ue, Q] = R(""), [Oe, ee] = R(""), [He, me] = R(!1), Y = T(null), [ge, Te] = R(0), je = ge > 0 && ge < 350;
|
|
421
421
|
ae(() => {
|
|
422
|
-
if (
|
|
422
|
+
if (x.current) {
|
|
423
423
|
const e = () => {
|
|
424
|
-
|
|
424
|
+
x.current && Te(x.current.offsetWidth);
|
|
425
425
|
};
|
|
426
426
|
e();
|
|
427
427
|
const r = new ResizeObserver(e);
|
|
428
|
-
return r.observe(
|
|
428
|
+
return r.observe(x.current), () => r.disconnect();
|
|
429
429
|
}
|
|
430
|
-
}, [N, z,
|
|
430
|
+
}, [N, z, g]);
|
|
431
431
|
const te = W(
|
|
432
432
|
(e) => {
|
|
433
433
|
const r = J();
|
|
434
|
-
return
|
|
435
|
-
r.getNodes().forEach((
|
|
436
|
-
if (F(
|
|
437
|
-
const
|
|
438
|
-
|
|
434
|
+
return g && X(r) && (e.preventDefault(), n.update(() => {
|
|
435
|
+
r.getNodes().forEach((y) => {
|
|
436
|
+
if (F(y)) {
|
|
437
|
+
const w = y.getParent();
|
|
438
|
+
y.remove(), w && we(w) && w.getChildrenSize() === 0 && w.setFormat("left");
|
|
439
439
|
}
|
|
440
440
|
});
|
|
441
441
|
})), !1;
|
|
442
442
|
},
|
|
443
|
-
[n,
|
|
443
|
+
[n, g]
|
|
444
444
|
), he = W(
|
|
445
445
|
(e) => {
|
|
446
446
|
const r = J(), c = q.current;
|
|
447
|
-
if (
|
|
447
|
+
if (g && X(r) && r.getNodes().length === 1) {
|
|
448
448
|
if (A)
|
|
449
449
|
return ce(null), e.preventDefault(), S.focus(), !0;
|
|
450
450
|
if (c !== null && c !== document.activeElement)
|
|
@@ -452,7 +452,7 @@ function zr({
|
|
|
452
452
|
}
|
|
453
453
|
return !1;
|
|
454
454
|
},
|
|
455
|
-
[S,
|
|
455
|
+
[S, g, A]
|
|
456
456
|
), pe = W(
|
|
457
457
|
(e) => d.current === S || q.current === e.target ? (ce(null), n.update(() => {
|
|
458
458
|
E(!0);
|
|
@@ -465,15 +465,15 @@ function zr({
|
|
|
465
465
|
const r = e;
|
|
466
466
|
if (L)
|
|
467
467
|
return !0;
|
|
468
|
-
const
|
|
469
|
-
let
|
|
470
|
-
if (!
|
|
471
|
-
const V =
|
|
472
|
-
|
|
468
|
+
const y = r.target === x.current;
|
|
469
|
+
let w = !1;
|
|
470
|
+
if (!y && x.current) {
|
|
471
|
+
const V = x.current.getBoundingClientRect();
|
|
472
|
+
w = r.clientX >= V.left && r.clientX <= V.right && r.clientY >= V.top && r.clientY <= V.bottom;
|
|
473
473
|
}
|
|
474
|
-
return
|
|
474
|
+
return y || w ? (r.shiftKey ? E(!g) : (_(), E(!0)), !0) : !1;
|
|
475
475
|
},
|
|
476
|
-
[L,
|
|
476
|
+
[L, g, E, _]
|
|
477
477
|
), ie = W(
|
|
478
478
|
(e) => {
|
|
479
479
|
n.getEditorState().read(() => {
|
|
@@ -489,12 +489,12 @@ function zr({
|
|
|
489
489
|
ae(() => {
|
|
490
490
|
let e = !0;
|
|
491
491
|
const r = n.getRootElement(), c = dt(
|
|
492
|
-
n.registerUpdateListener(({ editorState:
|
|
493
|
-
e && i(
|
|
492
|
+
n.registerUpdateListener(({ editorState: y }) => {
|
|
493
|
+
e && i(y.read(() => J()));
|
|
494
494
|
}),
|
|
495
495
|
n.registerCommand(
|
|
496
496
|
ut,
|
|
497
|
-
(
|
|
497
|
+
(y, w) => (d.current = w, !1),
|
|
498
498
|
M
|
|
499
499
|
),
|
|
500
500
|
n.registerCommand(
|
|
@@ -509,7 +509,7 @@ function zr({
|
|
|
509
509
|
),
|
|
510
510
|
n.registerCommand(
|
|
511
511
|
gt,
|
|
512
|
-
(
|
|
512
|
+
(y) => y.target === x.current ? (y.preventDefault(), !0) : !1,
|
|
513
513
|
M
|
|
514
514
|
),
|
|
515
515
|
n.registerCommand(
|
|
@@ -536,8 +536,8 @@ function zr({
|
|
|
536
536
|
_,
|
|
537
537
|
n,
|
|
538
538
|
L,
|
|
539
|
-
|
|
540
|
-
|
|
539
|
+
g,
|
|
540
|
+
b,
|
|
541
541
|
te,
|
|
542
542
|
he,
|
|
543
543
|
pe,
|
|
@@ -547,26 +547,26 @@ function zr({
|
|
|
547
547
|
]);
|
|
548
548
|
const Be = () => {
|
|
549
549
|
n.update(() => {
|
|
550
|
-
const e = U(
|
|
550
|
+
const e = U(b);
|
|
551
551
|
F(e) && e.setShowCaption(!0);
|
|
552
552
|
});
|
|
553
553
|
}, Ye = (e, r) => {
|
|
554
554
|
setTimeout(() => {
|
|
555
555
|
I(!1);
|
|
556
556
|
}, 200), n.update(() => {
|
|
557
|
-
const c = U(
|
|
557
|
+
const c = U(b);
|
|
558
558
|
F(c) && c.setWidthAndHeight(e, r);
|
|
559
559
|
});
|
|
560
560
|
}, Ke = () => {
|
|
561
561
|
I(!0);
|
|
562
562
|
}, Xe = (e) => {
|
|
563
|
-
if (e.preventDefault(), e.stopPropagation(),
|
|
563
|
+
if (e.preventDefault(), e.stopPropagation(), m.startsWith("data:")) {
|
|
564
564
|
const r = window.open("", "_blank");
|
|
565
565
|
r && (r.document.write(`
|
|
566
566
|
<!DOCTYPE html>
|
|
567
567
|
<html>
|
|
568
568
|
<head>
|
|
569
|
-
<title>${
|
|
569
|
+
<title>${f || "Image"}</title>
|
|
570
570
|
<style>
|
|
571
571
|
body {
|
|
572
572
|
margin: 0;
|
|
@@ -584,36 +584,36 @@ function zr({
|
|
|
584
584
|
</style>
|
|
585
585
|
</head>
|
|
586
586
|
<body>
|
|
587
|
-
<img src="${
|
|
587
|
+
<img src="${m}" alt="${f || "Image"}" />
|
|
588
588
|
</body>
|
|
589
589
|
</html>
|
|
590
590
|
`), r.document.close());
|
|
591
591
|
} else
|
|
592
|
-
window.open(
|
|
592
|
+
window.open(m, "_blank");
|
|
593
593
|
}, Fe = (e) => {
|
|
594
594
|
e.preventDefault(), e.stopPropagation(), n.update(() => {
|
|
595
|
-
const r = U(
|
|
595
|
+
const r = U(b);
|
|
596
596
|
if (F(r)) {
|
|
597
597
|
const c = r.getParent();
|
|
598
|
-
r.remove(), c &&
|
|
598
|
+
r.remove(), c && we(c) && c.getChildrenSize() === 0 && c.setFormat("left");
|
|
599
599
|
}
|
|
600
600
|
});
|
|
601
601
|
}, K = (e, r) => {
|
|
602
602
|
e.preventDefault(), e.stopPropagation(), n.update(() => {
|
|
603
|
-
const c = U(
|
|
603
|
+
const c = U(b);
|
|
604
604
|
F(c) && c.setPosition(r);
|
|
605
605
|
});
|
|
606
606
|
}, Ge = (e) => {
|
|
607
|
-
e.preventDefault(), e.stopPropagation(),
|
|
607
|
+
e.preventDefault(), e.stopPropagation(), u(!P);
|
|
608
608
|
}, qe = W(() => {
|
|
609
|
-
|
|
609
|
+
p && !g && (Y.current = setTimeout(() => {
|
|
610
610
|
me(!0);
|
|
611
611
|
}, 300));
|
|
612
|
-
}, [
|
|
612
|
+
}, [p, g]), Ve = W(() => {
|
|
613
613
|
Y.current && (clearTimeout(Y.current), Y.current = null), me(!1);
|
|
614
614
|
}, []), fe = W((e) => {
|
|
615
|
-
e.preventDefault(), e.stopPropagation(),
|
|
616
|
-
}, [
|
|
615
|
+
e.preventDefault(), e.stopPropagation(), p && window.open(p, "_blank", "noopener,noreferrer");
|
|
616
|
+
}, [p]);
|
|
617
617
|
ae(() => () => {
|
|
618
618
|
Y.current && clearTimeout(Y.current);
|
|
619
619
|
}, []);
|
|
@@ -629,22 +629,22 @@ function zr({
|
|
|
629
629
|
if (k && k.trim()) {
|
|
630
630
|
const ne = k.trim(), rt = a.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
|
|
631
631
|
r = `${ne} with ${rt}`;
|
|
632
|
-
} else if (
|
|
632
|
+
} else if (f && f !== "Generated image" && f.trim()) {
|
|
633
633
|
const ne = a.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
|
|
634
|
-
r = `${
|
|
634
|
+
r = `${f} with ${ne}`;
|
|
635
635
|
}
|
|
636
636
|
const c = await _t({
|
|
637
637
|
content: `Generate Image: ${r}`
|
|
638
|
-
}),
|
|
639
|
-
if (!
|
|
638
|
+
}), y = c == null ? void 0 : c.data;
|
|
639
|
+
if (!y)
|
|
640
640
|
throw new Error("Failed to generate image - empty response");
|
|
641
|
-
const oe = new DOMParser().parseFromString(
|
|
641
|
+
const oe = new DOMParser().parseFromString(y, "text/html").querySelector("img");
|
|
642
642
|
if (!oe || !oe.src)
|
|
643
643
|
throw new Error("No image found in response");
|
|
644
644
|
const tt = oe.src;
|
|
645
645
|
$.dismiss(e), $.success("Image refined successfully!", {
|
|
646
646
|
description: "Compare the images and choose which to keep."
|
|
647
|
-
}), Q(tt), ee(r), Z(!0), H(""),
|
|
647
|
+
}), Q(tt), ee(r), Z(!0), H(""), u(!1);
|
|
648
648
|
} catch (r) {
|
|
649
649
|
if ($.dismiss(e), r instanceof Ot) {
|
|
650
650
|
const c = r.code === "API_KEYS_DISABLED" ? "API Keys Disabled" : "API Key Required";
|
|
@@ -664,7 +664,7 @@ function zr({
|
|
|
664
664
|
}
|
|
665
665
|
}, Je = () => {
|
|
666
666
|
n.update(() => {
|
|
667
|
-
const e = U(
|
|
667
|
+
const e = U(b);
|
|
668
668
|
if (F(e)) {
|
|
669
669
|
e.setSrc(ue), e.setOriginalPrompt(Oe);
|
|
670
670
|
const r = J();
|
|
@@ -675,16 +675,16 @@ function zr({
|
|
|
675
675
|
});
|
|
676
676
|
}, Ue = () => {
|
|
677
677
|
Z(!1), Q(""), ee("");
|
|
678
|
-
}, Ze =
|
|
678
|
+
}, Ze = g && X(O) && !L, ye = (g || L) && C, Qe = () => l === "left" || l === "right" ? {
|
|
679
679
|
position: "relative",
|
|
680
680
|
display: "block",
|
|
681
681
|
width: "100%"
|
|
682
682
|
// Fill the floated container
|
|
683
|
-
} :
|
|
683
|
+
} : l === "full" ? {
|
|
684
684
|
position: "relative",
|
|
685
685
|
display: "inline-block"
|
|
686
686
|
// Use inline-block to respect text-align: center from parent
|
|
687
|
-
} :
|
|
687
|
+
} : l === "inline-left" || l === "inline-center" || l === "inline-right" ? {
|
|
688
688
|
position: "relative",
|
|
689
689
|
display: "inline-block"
|
|
690
690
|
// Use inline-block to respect text-align from parent
|
|
@@ -695,18 +695,18 @@ function zr({
|
|
|
695
695
|
(e) => {
|
|
696
696
|
if (L || e.target.closest("button"))
|
|
697
697
|
return;
|
|
698
|
-
const c = e.target ===
|
|
699
|
-
let
|
|
700
|
-
if (!c &&
|
|
701
|
-
const
|
|
702
|
-
|
|
698
|
+
const c = e.target === x.current;
|
|
699
|
+
let y = !1;
|
|
700
|
+
if (!c && x.current) {
|
|
701
|
+
const w = x.current.getBoundingClientRect();
|
|
702
|
+
y = e.clientX >= w.left && e.clientX <= w.right && e.clientY >= w.top && e.clientY <= w.bottom;
|
|
703
703
|
}
|
|
704
|
-
!c && !
|
|
704
|
+
!c && !y || (e.stopPropagation(), e.shiftKey ? E(!g) : (_(), E(!0)));
|
|
705
705
|
},
|
|
706
|
-
[L,
|
|
706
|
+
[L, g, E, _]
|
|
707
707
|
);
|
|
708
|
-
return /* @__PURE__ */ t(
|
|
709
|
-
/* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ t(xt, { fallback: null, children: /* @__PURE__ */ h(it, { children: [
|
|
709
|
+
/* @__PURE__ */ h(
|
|
710
710
|
"div",
|
|
711
711
|
{
|
|
712
712
|
draggable: Ze,
|
|
@@ -718,24 +718,24 @@ function zr({
|
|
|
718
718
|
o ? /* @__PURE__ */ t(Ft, {}) : /* @__PURE__ */ t(
|
|
719
719
|
Xt,
|
|
720
720
|
{
|
|
721
|
-
className: ye ? `focused ${X(O) ? "draggable" : ""}` :
|
|
722
|
-
src:
|
|
723
|
-
altText:
|
|
724
|
-
imageRef:
|
|
721
|
+
className: ye ? `focused ${X(O) ? "draggable" : ""}` : p ? "cteditor-cursor-pointer" : null,
|
|
722
|
+
src: m,
|
|
723
|
+
altText: f,
|
|
724
|
+
imageRef: x,
|
|
725
725
|
width: N,
|
|
726
726
|
height: z,
|
|
727
727
|
maxWidth: v,
|
|
728
728
|
onError: () => D(!0)
|
|
729
729
|
}
|
|
730
730
|
),
|
|
731
|
-
He &&
|
|
731
|
+
He && p && !g && /* @__PURE__ */ h(
|
|
732
732
|
"div",
|
|
733
733
|
{
|
|
734
734
|
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",
|
|
735
735
|
style: { zIndex: 10 },
|
|
736
736
|
children: [
|
|
737
|
-
/* @__PURE__ */ t(
|
|
738
|
-
/* @__PURE__ */ t("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children:
|
|
737
|
+
/* @__PURE__ */ t(Tt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground cteditor-flex-shrink-0" }),
|
|
738
|
+
/* @__PURE__ */ t("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children: p }),
|
|
739
739
|
/* @__PURE__ */ t(
|
|
740
740
|
"button",
|
|
741
741
|
{
|
|
@@ -747,17 +747,17 @@ function zr({
|
|
|
747
747
|
]
|
|
748
748
|
}
|
|
749
749
|
),
|
|
750
|
-
|
|
750
|
+
g && X(O) && !o && /* @__PURE__ */ h(
|
|
751
751
|
"div",
|
|
752
752
|
{
|
|
753
|
-
className: `cteditor-absolute cteditor-flex cteditor-gap-1 z-10 ${
|
|
753
|
+
className: `cteditor-absolute cteditor-flex cteditor-gap-1 z-10 ${je ? "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"}`,
|
|
754
754
|
children: [
|
|
755
|
-
/* @__PURE__ */
|
|
755
|
+
/* @__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: [
|
|
756
756
|
/* @__PURE__ */ t(
|
|
757
757
|
"button",
|
|
758
758
|
{
|
|
759
759
|
onClick: (e) => K(e, "left"),
|
|
760
|
-
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${
|
|
760
|
+
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" : ""}`,
|
|
761
761
|
"aria-label": "Wrap text left",
|
|
762
762
|
title: "Wrap text left",
|
|
763
763
|
children: /* @__PURE__ */ t(Pt, {})
|
|
@@ -767,7 +767,7 @@ function zr({
|
|
|
767
767
|
"button",
|
|
768
768
|
{
|
|
769
769
|
onClick: (e) => K(e, "right"),
|
|
770
|
-
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${
|
|
770
|
+
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" : ""}`,
|
|
771
771
|
"aria-label": "Wrap text right",
|
|
772
772
|
title: "Wrap text right",
|
|
773
773
|
children: /* @__PURE__ */ t(Rt, {})
|
|
@@ -778,7 +778,7 @@ function zr({
|
|
|
778
778
|
"button",
|
|
779
779
|
{
|
|
780
780
|
onClick: (e) => K(e, "inline-left"),
|
|
781
|
-
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${
|
|
781
|
+
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" : ""}`,
|
|
782
782
|
"aria-label": "Align left",
|
|
783
783
|
title: "Align left (no text wrap)",
|
|
784
784
|
children: /* @__PURE__ */ t(Dt, {})
|
|
@@ -788,7 +788,7 @@ function zr({
|
|
|
788
788
|
"button",
|
|
789
789
|
{
|
|
790
790
|
onClick: (e) => K(e, "inline-center"),
|
|
791
|
-
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${
|
|
791
|
+
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" : ""}`,
|
|
792
792
|
"aria-label": "Align center",
|
|
793
793
|
title: "Align center (no text wrap)",
|
|
794
794
|
children: /* @__PURE__ */ t(zt, {})
|
|
@@ -798,7 +798,7 @@ function zr({
|
|
|
798
798
|
"button",
|
|
799
799
|
{
|
|
800
800
|
onClick: (e) => K(e, "inline-right"),
|
|
801
|
-
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${
|
|
801
|
+
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" : ""}`,
|
|
802
802
|
"aria-label": "Align right",
|
|
803
803
|
title: "Align right (no text wrap)",
|
|
804
804
|
children: /* @__PURE__ */ t(St, {})
|
|
@@ -809,20 +809,20 @@ function zr({
|
|
|
809
809
|
"button",
|
|
810
810
|
{
|
|
811
811
|
onClick: (e) => K(e, "none"),
|
|
812
|
-
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${
|
|
812
|
+
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" : ""}`,
|
|
813
813
|
"aria-label": "Inline",
|
|
814
814
|
title: "Inline with text",
|
|
815
815
|
children: /* @__PURE__ */ t(Lt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
816
816
|
}
|
|
817
817
|
)
|
|
818
818
|
] }),
|
|
819
|
-
|
|
819
|
+
p && /* @__PURE__ */ t(
|
|
820
820
|
"button",
|
|
821
821
|
{
|
|
822
822
|
onClick: fe,
|
|
823
823
|
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",
|
|
824
824
|
"aria-label": "Visit link",
|
|
825
|
-
title: `Visit: ${
|
|
825
|
+
title: `Visit: ${p}`,
|
|
826
826
|
children: /* @__PURE__ */ t(Wt, {})
|
|
827
827
|
}
|
|
828
828
|
),
|
|
@@ -865,7 +865,7 @@ function zr({
|
|
|
865
865
|
]
|
|
866
866
|
}
|
|
867
867
|
),
|
|
868
|
-
P &&
|
|
868
|
+
P && g && !o && k && /* @__PURE__ */ t(
|
|
869
869
|
"div",
|
|
870
870
|
{
|
|
871
871
|
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",
|
|
@@ -873,7 +873,7 @@ function zr({
|
|
|
873
873
|
onClick: (e) => e.stopPropagation(),
|
|
874
874
|
onKeyDown: (e) => e.stopPropagation(),
|
|
875
875
|
onKeyUp: (e) => e.stopPropagation(),
|
|
876
|
-
children: /* @__PURE__ */
|
|
876
|
+
children: /* @__PURE__ */ h("div", { className: "cteditor-flex cteditor-flex-col cteditor-gap-2", children: [
|
|
877
877
|
/* @__PURE__ */ t("label", { className: "cteditor-text-xs cteditor-font-medium cteditor-text-foreground", children: "What else do you want in this scene?" }),
|
|
878
878
|
/* @__PURE__ */ t(
|
|
879
879
|
"input",
|
|
@@ -882,7 +882,7 @@ function zr({
|
|
|
882
882
|
value: a,
|
|
883
883
|
onChange: (e) => H(e.target.value),
|
|
884
884
|
onKeyDown: (e) => {
|
|
885
|
-
e.stopPropagation(), e.key === "Enter" && a.trim() && !B && be(), e.key === "Escape" && (
|
|
885
|
+
e.stopPropagation(), e.key === "Enter" && a.trim() && !B && be(), e.key === "Escape" && (u(!1), H(""));
|
|
886
886
|
},
|
|
887
887
|
onKeyUp: (e) => {
|
|
888
888
|
e.stopPropagation();
|
|
@@ -896,7 +896,7 @@ function zr({
|
|
|
896
896
|
autoFocus: !0
|
|
897
897
|
}
|
|
898
898
|
),
|
|
899
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ h("div", { className: "cteditor-flex cteditor-gap-2", children: [
|
|
900
900
|
/* @__PURE__ */ t(
|
|
901
901
|
"button",
|
|
902
902
|
{
|
|
@@ -905,7 +905,7 @@ function zr({
|
|
|
905
905
|
},
|
|
906
906
|
disabled: B || !a.trim(),
|
|
907
907
|
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",
|
|
908
|
-
children: B ? /* @__PURE__ */
|
|
908
|
+
children: B ? /* @__PURE__ */ h("span", { className: "cteditor-flex cteditor-items-center cteditor-justify-center cteditor-gap-2", children: [
|
|
909
909
|
/* @__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" }),
|
|
910
910
|
"Refining..."
|
|
911
911
|
] }) : "Refine Image"
|
|
@@ -915,7 +915,7 @@ function zr({
|
|
|
915
915
|
"button",
|
|
916
916
|
{
|
|
917
917
|
onClick: (e) => {
|
|
918
|
-
e.stopPropagation(),
|
|
918
|
+
e.stopPropagation(), u(!1), H("");
|
|
919
919
|
},
|
|
920
920
|
disabled: B,
|
|
921
921
|
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",
|
|
@@ -933,62 +933,74 @@ function zr({
|
|
|
933
933
|
setShowCaption: Be,
|
|
934
934
|
editor: n,
|
|
935
935
|
buttonRef: q,
|
|
936
|
-
imageRef:
|
|
936
|
+
imageRef: x,
|
|
937
937
|
maxWidth: v,
|
|
938
938
|
onResizeStart: Ke,
|
|
939
939
|
onResizeEnd: Ye,
|
|
940
|
-
captionsEnabled: !o &&
|
|
940
|
+
captionsEnabled: !o && j
|
|
941
941
|
}
|
|
942
942
|
)
|
|
943
943
|
]
|
|
944
944
|
}
|
|
945
945
|
),
|
|
946
|
-
A && (
|
|
947
|
-
|
|
946
|
+
A && (f.startsWith("Signature by") ? /* @__PURE__ */ t(Bt, { caption: S }) : /* @__PURE__ */ t(
|
|
947
|
+
"div",
|
|
948
948
|
{
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
949
|
+
className: "image-caption-container",
|
|
950
|
+
style: {
|
|
951
|
+
width: typeof N == "number" ? `${N}px` : "100%",
|
|
952
|
+
maxWidth: "100%",
|
|
953
|
+
// Match the image's alignment
|
|
954
|
+
...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" } : {}
|
|
955
|
+
},
|
|
956
|
+
children: /* @__PURE__ */ h(
|
|
957
|
+
Re,
|
|
958
|
+
{
|
|
959
|
+
initialEditor: S,
|
|
960
|
+
initialNodes: [
|
|
961
|
+
Se,
|
|
962
|
+
Le,
|
|
963
|
+
We,
|
|
964
|
+
Ae,
|
|
965
|
+
ke,
|
|
966
|
+
ve
|
|
967
|
+
],
|
|
968
|
+
children: [
|
|
969
|
+
/* @__PURE__ */ t(ot, {}),
|
|
970
|
+
/* @__PURE__ */ t(
|
|
971
|
+
ze,
|
|
965
972
|
{
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
973
|
+
contentEditable: /* @__PURE__ */ t(
|
|
974
|
+
Ee,
|
|
975
|
+
{
|
|
976
|
+
"aria-placeholder": "Enter a caption...",
|
|
977
|
+
placeholder: () => /* @__PURE__ */ t("span", { className: "cteditor-text-xs", children: "Enter a caption..." }),
|
|
978
|
+
className: "ImageNode__contentEditable"
|
|
979
|
+
}
|
|
980
|
+
),
|
|
981
|
+
ErrorBoundary: Ie
|
|
969
982
|
}
|
|
970
983
|
),
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
]
|
|
984
|
+
/* @__PURE__ */ t(
|
|
985
|
+
De,
|
|
986
|
+
{
|
|
987
|
+
onChange: () => {
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
),
|
|
991
|
+
/* @__PURE__ */ t(Pe, {}),
|
|
992
|
+
/* @__PURE__ */ t(Me, { namespace: $e.namespace })
|
|
993
|
+
]
|
|
994
|
+
}
|
|
995
|
+
)
|
|
984
996
|
}
|
|
985
|
-
)
|
|
997
|
+
)),
|
|
986
998
|
/* @__PURE__ */ t(
|
|
987
|
-
|
|
999
|
+
jt,
|
|
988
1000
|
{
|
|
989
1001
|
open: _e,
|
|
990
1002
|
onOpenChange: Z,
|
|
991
|
-
oldImageUrl:
|
|
1003
|
+
oldImageUrl: m,
|
|
992
1004
|
newImageUrl: ue,
|
|
993
1005
|
onReplace: Je,
|
|
994
1006
|
onCancel: Ue
|