sykpcomposer 1.20.124 → 1.20.126
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/{ImageComponent-5923c11d.js → ImageComponent-462c3315.js} +261 -256
- package/dist/ImageComponent-462c3315.js.map +1 -0
- package/dist/{InlineImageComponent-8d91359d.js → InlineImageComponent-a02cb874.js} +3 -3
- package/dist/{InlineImageComponent-8d91359d.js.map → InlineImageComponent-a02cb874.js.map} +1 -1
- package/dist/{LexicalNestedComposer.prod-5fe44982.js → LexicalNestedComposer.prod-fd8d53c1.js} +2 -2
- package/dist/{LexicalNestedComposer.prod-5fe44982.js.map → LexicalNestedComposer.prod-fd8d53c1.js.map} +1 -1
- package/dist/{PollComponent-1a200ca9.js → PollComponent-cb35023a.js} +2 -2
- package/dist/{PollComponent-1a200ca9.js.map → PollComponent-cb35023a.js.map} +1 -1
- package/dist/{index-fde88807.js → index-c6d40f36.js} +4484 -4389
- package/dist/index-c6d40f36.js.map +1 -0
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +59 -59
- package/dist/index.umd.js.map +1 -1
- package/dist/src/lexical/plugins/NestedHeadings.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/ImageComponent-5923c11d.js.map +0 -1
- package/dist/index-fde88807.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { j as b, u as de, a as
|
|
2
|
-
import { d as Ee } from "./LexicalNestedComposer.prod-
|
|
3
|
-
import C, { useRef as
|
|
1
|
+
import { j as b, u as de, a as ae, x as T, $ as G, w as ee, d as q, b as ne, c as le, e as ge, f as ue, C as B, g as pe, k as me, h as we, I as fe, r as xe, i as ye, l as Ce, L as ve, P as De, m as be, t as Re } from "./index-c6d40f36.js";
|
|
2
|
+
import { d as Ee } from "./LexicalNestedComposer.prod-fd8d53c1.js";
|
|
3
|
+
import C, { useRef as j, PureComponent as Me, createRef as re, useState as V, useCallback as F, useEffect as J, Suspense as He } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
function
|
|
6
|
-
return Math.min(Math.max(
|
|
5
|
+
function te(g, t, e) {
|
|
6
|
+
return Math.min(Math.max(g, t), e);
|
|
7
7
|
}
|
|
8
8
|
const v = {
|
|
9
9
|
east: 1,
|
|
@@ -11,8 +11,8 @@ const v = {
|
|
|
11
11
|
south: 2,
|
|
12
12
|
west: 4
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
onResizeStart:
|
|
14
|
+
function Pe({
|
|
15
|
+
onResizeStart: g,
|
|
16
16
|
onResizeEnd: t,
|
|
17
17
|
buttonRef: e,
|
|
18
18
|
imageRef: o,
|
|
@@ -22,10 +22,10 @@ function ke({
|
|
|
22
22
|
setShowCaption: p,
|
|
23
23
|
enableCaptions: s
|
|
24
24
|
}) {
|
|
25
|
-
const i =
|
|
25
|
+
const i = j(null), l = j({
|
|
26
26
|
priority: "",
|
|
27
27
|
value: "default"
|
|
28
|
-
}), h =
|
|
28
|
+
}), h = j({
|
|
29
29
|
currentHeight: 0,
|
|
30
30
|
currentWidth: 0,
|
|
31
31
|
direction: 0,
|
|
@@ -35,15 +35,15 @@ function ke({
|
|
|
35
35
|
startWidth: 0,
|
|
36
36
|
startX: 0,
|
|
37
37
|
startY: 0
|
|
38
|
-
}), d = r.getRootElement(), c = d !== null ? d.getBoundingClientRect().width - 20 : 100, R = d !== null ? d.getBoundingClientRect().height - 20 : 100,
|
|
39
|
-
const
|
|
38
|
+
}), d = r.getRootElement(), c = d !== null ? d.getBoundingClientRect().width - 20 : 100, R = d !== null ? d.getBoundingClientRect().height - 20 : 100, H = 100, k = 100, m = (u) => {
|
|
39
|
+
const f = u === v.east || u === v.west, w = u === v.north || u === v.south, $ = u & v.north && u & v.west || u & v.south && u & v.east, P = f ? "ew" : w ? "ns" : $ ? "nwse" : "nesw";
|
|
40
40
|
d !== null && d.style.setProperty(
|
|
41
41
|
"cursor",
|
|
42
|
-
`${
|
|
42
|
+
`${P}-resize`,
|
|
43
43
|
"important"
|
|
44
44
|
), document.body !== null && (document.body.style.setProperty(
|
|
45
45
|
"cursor",
|
|
46
|
-
`${
|
|
46
|
+
`${P}-resize`,
|
|
47
47
|
"important"
|
|
48
48
|
), l.current.value = document.body.style.getPropertyValue(
|
|
49
49
|
"-webkit-user-select"
|
|
@@ -54,59 +54,64 @@ function ke({
|
|
|
54
54
|
"none",
|
|
55
55
|
"important"
|
|
56
56
|
));
|
|
57
|
-
},
|
|
57
|
+
}, A = () => {
|
|
58
58
|
d !== null && d.style.setProperty("cursor", "text"), document.body !== null && (document.body.style.setProperty("cursor", "default"), document.body.style.setProperty(
|
|
59
59
|
"-webkit-user-select",
|
|
60
60
|
l.current.value,
|
|
61
61
|
l.current.priority
|
|
62
62
|
));
|
|
63
|
-
}, N = (
|
|
63
|
+
}, N = (u, f) => {
|
|
64
64
|
if (!r.isEditable())
|
|
65
65
|
return;
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
const { width:
|
|
70
|
-
D.startWidth =
|
|
66
|
+
const w = o.current, $ = i.current;
|
|
67
|
+
if (w !== null && $ !== null) {
|
|
68
|
+
u.preventDefault();
|
|
69
|
+
const { width: P, height: y } = w.getBoundingClientRect(), D = h.current;
|
|
70
|
+
D.startWidth = P, D.startHeight = y, D.ratio = P / y, D.currentWidth = P, D.currentHeight = y, D.startX = u.clientX, D.startY = u.clientY, D.isResizing = !0, D.direction = f, m(f), g(), $.classList.add("image-control-wrapper--resizing"), w.style.height = `${y}px`, w.style.width = `${P}px`, document.addEventListener("pointermove", S), document.addEventListener("pointerup", E);
|
|
71
71
|
}
|
|
72
|
-
}, S = (
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
if ($ &&
|
|
76
|
-
let
|
|
77
|
-
|
|
78
|
-
const D =
|
|
79
|
-
|
|
80
|
-
M,
|
|
81
|
-
c
|
|
82
|
-
), A = D / f.ratio;
|
|
83
|
-
m.style.width = `${D}px`, m.style.height = `${A}px`, f.currentHeight = A, f.currentWidth = D;
|
|
84
|
-
} else if (k) {
|
|
85
|
-
let x = Math.floor(f.startY - g.clientY);
|
|
86
|
-
x = f.direction & v.south ? -x : x;
|
|
87
|
-
const D = ee(
|
|
88
|
-
f.startHeight + x,
|
|
72
|
+
}, S = (u) => {
|
|
73
|
+
const f = o.current, w = h.current, $ = w.direction & (v.east | v.west), P = w.direction & (v.south | v.north);
|
|
74
|
+
if (f !== null && w.isResizing) {
|
|
75
|
+
if ($ && P) {
|
|
76
|
+
let y = Math.floor(w.startX - u.clientX);
|
|
77
|
+
y = w.direction & v.east ? -y : y;
|
|
78
|
+
const D = te(
|
|
79
|
+
w.startWidth + y,
|
|
89
80
|
H,
|
|
90
|
-
|
|
91
|
-
);
|
|
92
|
-
|
|
81
|
+
c
|
|
82
|
+
), _ = D / w.ratio;
|
|
83
|
+
if (_ > 600) {
|
|
84
|
+
alert("Image height cannot be greater than 600px."), E();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
f.style.width = `${D}px`, f.style.height = `${_}px`, w.currentHeight = _, w.currentWidth = D;
|
|
88
|
+
} else if (P) {
|
|
89
|
+
let y = Math.floor(w.startY - u.clientY);
|
|
90
|
+
y = w.direction & v.south ? -y : y;
|
|
91
|
+
const D = w.startHeight + y;
|
|
92
|
+
if (D > w.startHeight && D > 600) {
|
|
93
|
+
alert("Image height cannot be greater than 600px."), E();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const U = te(D, k, R);
|
|
97
|
+
f.style.height = `${U}px`, f.style.maxHeight = `${U}px`, w.currentHeight = U;
|
|
93
98
|
} else {
|
|
94
|
-
let
|
|
95
|
-
|
|
96
|
-
const D =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
let y = Math.floor(w.startX - u.clientX);
|
|
100
|
+
y = w.direction & v.east ? -y : y;
|
|
101
|
+
const D = te(
|
|
102
|
+
w.startWidth + y,
|
|
103
|
+
H,
|
|
99
104
|
c
|
|
100
105
|
);
|
|
101
|
-
|
|
106
|
+
f.style.width = `${D}px`, f.style.maxWidth = `${D}px`, w.currentWidth = D;
|
|
102
107
|
}
|
|
103
|
-
|
|
108
|
+
f && (f.setAttribute("width", `${w.currentWidth}`), f.setAttribute("height", `${w.currentHeight}`));
|
|
104
109
|
}
|
|
105
|
-
},
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
const $ =
|
|
109
|
-
|
|
110
|
+
}, E = () => {
|
|
111
|
+
const u = o.current, f = h.current, w = i.current;
|
|
112
|
+
if (u !== null && w !== null && f.isResizing) {
|
|
113
|
+
const $ = f.currentWidth, P = f.currentHeight;
|
|
114
|
+
f.startWidth = 0, f.startHeight = 0, f.ratio = 0, f.startX = 0, f.startY = 0, f.currentWidth = 0, f.currentHeight = 0, f.isResizing = !1, w.classList.remove("image-control-wrapper--resizing"), A(), t($, P), document.removeEventListener("pointermove", S), document.removeEventListener("pointerup", E);
|
|
110
115
|
}
|
|
111
116
|
};
|
|
112
117
|
return /* @__PURE__ */ b.jsxs("div", { ref: i, children: [
|
|
@@ -114,8 +119,8 @@ function ke({
|
|
|
114
119
|
"div",
|
|
115
120
|
{
|
|
116
121
|
className: "image-resizer image-resizer-n",
|
|
117
|
-
onPointerDown: (
|
|
118
|
-
N(
|
|
122
|
+
onPointerDown: (u) => {
|
|
123
|
+
N(u, v.north);
|
|
119
124
|
}
|
|
120
125
|
}
|
|
121
126
|
),
|
|
@@ -123,8 +128,8 @@ function ke({
|
|
|
123
128
|
"div",
|
|
124
129
|
{
|
|
125
130
|
className: "image-resizer image-resizer-ne",
|
|
126
|
-
onPointerDown: (
|
|
127
|
-
N(
|
|
131
|
+
onPointerDown: (u) => {
|
|
132
|
+
N(u, v.north | v.east);
|
|
128
133
|
}
|
|
129
134
|
}
|
|
130
135
|
),
|
|
@@ -132,8 +137,8 @@ function ke({
|
|
|
132
137
|
"div",
|
|
133
138
|
{
|
|
134
139
|
className: "image-resizer image-resizer-e",
|
|
135
|
-
onPointerDown: (
|
|
136
|
-
N(
|
|
140
|
+
onPointerDown: (u) => {
|
|
141
|
+
N(u, v.east);
|
|
137
142
|
}
|
|
138
143
|
}
|
|
139
144
|
),
|
|
@@ -141,8 +146,8 @@ function ke({
|
|
|
141
146
|
"div",
|
|
142
147
|
{
|
|
143
148
|
className: "image-resizer image-resizer-se",
|
|
144
|
-
onPointerDown: (
|
|
145
|
-
N(
|
|
149
|
+
onPointerDown: (u) => {
|
|
150
|
+
N(u, v.south | v.east);
|
|
146
151
|
}
|
|
147
152
|
}
|
|
148
153
|
),
|
|
@@ -150,8 +155,8 @@ function ke({
|
|
|
150
155
|
"div",
|
|
151
156
|
{
|
|
152
157
|
className: "image-resizer image-resizer-s",
|
|
153
|
-
onPointerDown: (
|
|
154
|
-
N(
|
|
158
|
+
onPointerDown: (u) => {
|
|
159
|
+
N(u, v.south);
|
|
155
160
|
}
|
|
156
161
|
}
|
|
157
162
|
),
|
|
@@ -159,8 +164,8 @@ function ke({
|
|
|
159
164
|
"div",
|
|
160
165
|
{
|
|
161
166
|
className: "image-resizer image-resizer-sw",
|
|
162
|
-
onPointerDown: (
|
|
163
|
-
N(
|
|
167
|
+
onPointerDown: (u) => {
|
|
168
|
+
N(u, v.south | v.west);
|
|
164
169
|
}
|
|
165
170
|
}
|
|
166
171
|
),
|
|
@@ -168,8 +173,8 @@ function ke({
|
|
|
168
173
|
"div",
|
|
169
174
|
{
|
|
170
175
|
className: "image-resizer image-resizer-w",
|
|
171
|
-
onPointerDown: (
|
|
172
|
-
N(
|
|
176
|
+
onPointerDown: (u) => {
|
|
177
|
+
N(u, v.west);
|
|
173
178
|
}
|
|
174
179
|
}
|
|
175
180
|
),
|
|
@@ -177,64 +182,64 @@ function ke({
|
|
|
177
182
|
"div",
|
|
178
183
|
{
|
|
179
184
|
className: "image-resizer image-resizer-nw",
|
|
180
|
-
onPointerDown: (
|
|
181
|
-
N(
|
|
185
|
+
onPointerDown: (u) => {
|
|
186
|
+
N(u, v.north | v.west);
|
|
182
187
|
}
|
|
183
188
|
}
|
|
184
189
|
)
|
|
185
190
|
] });
|
|
186
191
|
}
|
|
187
|
-
const
|
|
192
|
+
const Q = {
|
|
188
193
|
x: 0,
|
|
189
194
|
y: 0,
|
|
190
195
|
width: 0,
|
|
191
196
|
height: 0,
|
|
192
197
|
unit: "px"
|
|
193
|
-
}, O = (
|
|
194
|
-
function W(
|
|
195
|
-
return
|
|
198
|
+
}, O = (g, t, e) => Math.min(Math.max(g, t), e), ke = (...g) => g.filter((t) => t && typeof t == "string").join(" "), ie = (g, t) => g === t || g.width === t.width && g.height === t.height && g.x === t.x && g.y === t.y && g.unit === t.unit;
|
|
199
|
+
function W(g, t, e) {
|
|
200
|
+
return g.unit === "%" ? { ...Q, ...g, unit: "%" } : {
|
|
196
201
|
unit: "%",
|
|
197
|
-
x:
|
|
198
|
-
y:
|
|
199
|
-
width:
|
|
200
|
-
height:
|
|
202
|
+
x: g.x ? g.x / t * 100 : 0,
|
|
203
|
+
y: g.y ? g.y / e * 100 : 0,
|
|
204
|
+
width: g.width ? g.width / t * 100 : 0,
|
|
205
|
+
height: g.height ? g.height / e * 100 : 0
|
|
201
206
|
};
|
|
202
207
|
}
|
|
203
|
-
function
|
|
204
|
-
return
|
|
208
|
+
function Y(g, t, e) {
|
|
209
|
+
return g.unit ? g.unit === "px" ? { ...Q, ...g, unit: "px" } : {
|
|
205
210
|
unit: "px",
|
|
206
|
-
x:
|
|
207
|
-
y:
|
|
208
|
-
width:
|
|
209
|
-
height:
|
|
210
|
-
} : { ...
|
|
211
|
+
x: g.x ? g.x * t / 100 : 0,
|
|
212
|
+
y: g.y ? g.y * e / 100 : 0,
|
|
213
|
+
width: g.width ? g.width * t / 100 : 0,
|
|
214
|
+
height: g.height ? g.height * e / 100 : 0
|
|
215
|
+
} : { ...Q, ...g, unit: "px" };
|
|
211
216
|
}
|
|
212
|
-
function
|
|
213
|
-
const i = { ...
|
|
217
|
+
function oe(g, t, e, o, n, r = 0, a = 0, p = o, s = n) {
|
|
218
|
+
const i = { ...g };
|
|
214
219
|
let l = Math.min(r, o), h = Math.min(a, n), d = Math.min(p, o), c = Math.min(s, n);
|
|
215
220
|
t && (t > 1 ? (l = a ? a * t : l, h = l / t, d = p * t) : (h = r ? r / t : h, l = h * t, c = s / t)), i.y < 0 && (i.height = Math.max(i.height + i.y, h), i.y = 0), i.x < 0 && (i.width = Math.max(i.width + i.x, l), i.x = 0);
|
|
216
221
|
const R = o - (i.x + i.width);
|
|
217
222
|
R < 0 && (i.x = Math.min(i.x, o - l), i.width += R);
|
|
218
|
-
const
|
|
219
|
-
if (
|
|
220
|
-
const
|
|
221
|
-
if (
|
|
222
|
-
const
|
|
223
|
-
(e === "nw" || e == "ne") && (i.y -=
|
|
224
|
-
} else if (
|
|
225
|
-
const
|
|
226
|
-
(e === "sw" || e == "nw") && (i.x -=
|
|
223
|
+
const H = n - (i.y + i.height);
|
|
224
|
+
if (H < 0 && (i.y = Math.min(i.y, n - h), i.height += H), i.width < l && ((e === "sw" || e == "nw") && (i.x -= l - i.width), i.width = l), i.height < h && ((e === "nw" || e == "ne") && (i.y -= h - i.height), i.height = h), i.width > d && ((e === "sw" || e == "nw") && (i.x -= d - i.width), i.width = d), i.height > c && ((e === "nw" || e == "ne") && (i.y -= c - i.height), i.height = c), t) {
|
|
225
|
+
const k = i.width / i.height;
|
|
226
|
+
if (k < t) {
|
|
227
|
+
const m = Math.max(i.width / t, h);
|
|
228
|
+
(e === "nw" || e == "ne") && (i.y -= m - i.height), i.height = m;
|
|
229
|
+
} else if (k > t) {
|
|
230
|
+
const m = Math.max(i.height * t, l);
|
|
231
|
+
(e === "sw" || e == "nw") && (i.x -= m - i.width), i.width = m;
|
|
227
232
|
}
|
|
228
233
|
}
|
|
229
234
|
return i;
|
|
230
235
|
}
|
|
231
|
-
function Ne(
|
|
232
|
-
const n = { ...
|
|
236
|
+
function Ne(g, t, e, o) {
|
|
237
|
+
const n = { ...g };
|
|
233
238
|
return t === "ArrowLeft" ? o === "nw" ? (n.x -= e, n.y -= e, n.width += e, n.height += e) : o === "w" ? (n.x -= e, n.width += e) : o === "sw" ? (n.x -= e, n.width += e, n.height += e) : o === "ne" ? (n.y += e, n.width -= e, n.height -= e) : o === "e" ? n.width -= e : o === "se" && (n.width -= e, n.height -= e) : t === "ArrowRight" && (o === "nw" ? (n.x += e, n.y += e, n.width -= e, n.height -= e) : o === "w" ? (n.x += e, n.width -= e) : o === "sw" ? (n.x += e, n.width -= e, n.height -= e) : o === "ne" ? (n.y -= e, n.width += e, n.height += e) : o === "e" ? n.width += e : o === "se" && (n.width += e, n.height += e)), t === "ArrowUp" ? o === "nw" ? (n.x -= e, n.y -= e, n.width += e, n.height += e) : o === "n" ? (n.y -= e, n.height += e) : o === "ne" ? (n.y -= e, n.width += e, n.height += e) : o === "sw" ? (n.x += e, n.width -= e, n.height -= e) : o === "s" ? n.height -= e : o === "se" && (n.width -= e, n.height -= e) : t === "ArrowDown" && (o === "nw" ? (n.x += e, n.y += e, n.width -= e, n.height -= e) : o === "n" ? (n.y += e, n.height -= e) : o === "ne" ? (n.y += e, n.width -= e, n.height -= e) : o === "sw" ? (n.x -= e, n.width += e, n.height += e) : o === "s" ? n.height += e : o === "se" && (n.width += e, n.height += e)), n;
|
|
234
239
|
}
|
|
235
240
|
const K = { capture: !0, passive: !1 };
|
|
236
241
|
let $e = 0;
|
|
237
|
-
const
|
|
242
|
+
const L = class I extends Me {
|
|
238
243
|
constructor() {
|
|
239
244
|
super(...arguments), this.docMoveBound = !1, this.mouseDownOnCrop = !1, this.dragStarted = !1, this.evData = {
|
|
240
245
|
startClientX: 0,
|
|
@@ -244,14 +249,14 @@ const Y = class _ extends Me {
|
|
|
244
249
|
clientX: 0,
|
|
245
250
|
clientY: 0,
|
|
246
251
|
isResize: !0
|
|
247
|
-
}, this.componentRef =
|
|
252
|
+
}, this.componentRef = re(), this.mediaRef = re(), this.initChangeCalled = !1, this.instanceId = `rc-${$e++}`, this.state = {
|
|
248
253
|
cropIsActive: !1,
|
|
249
254
|
newCropIsBeingDrawn: !1
|
|
250
255
|
}, this.onCropPointerDown = (t) => {
|
|
251
256
|
const { crop: e, disabled: o } = this.props, n = this.getBox();
|
|
252
257
|
if (!e)
|
|
253
258
|
return;
|
|
254
|
-
const r =
|
|
259
|
+
const r = Y(e, n.width, n.height);
|
|
255
260
|
if (o)
|
|
256
261
|
return;
|
|
257
262
|
t.cancelable && t.preventDefault(), this.bindDocMove(), this.componentRef.current.focus({ preventScroll: !0 });
|
|
@@ -259,8 +264,8 @@ const Y = class _ extends Me {
|
|
|
259
264
|
let s = t.clientX, i = t.clientY, l = r.x, h = r.y;
|
|
260
265
|
if (a) {
|
|
261
266
|
const d = t.clientX - n.x, c = t.clientY - n.y;
|
|
262
|
-
let R = 0,
|
|
263
|
-
a === "ne" || a == "e" ? (R = d - (r.x + r.width),
|
|
267
|
+
let R = 0, H = 0;
|
|
268
|
+
a === "ne" || a == "e" ? (R = d - (r.x + r.width), H = c - r.y, l = r.x, h = r.y + r.height) : a === "se" || a === "s" ? (R = d - (r.x + r.width), H = c - (r.y + r.height), l = r.x, h = r.y) : a === "sw" || a == "w" ? (R = d - r.x, H = c - (r.y + r.height), l = r.x + r.width, h = r.y) : (a === "nw" || a == "n") && (R = d - r.x, H = c - r.y, l = r.x + r.width, h = r.y + r.height), s = l + n.x + R, i = h + n.y + H;
|
|
264
269
|
}
|
|
265
270
|
this.evData = {
|
|
266
271
|
startClientX: s,
|
|
@@ -292,7 +297,7 @@ const Y = class _ extends Me {
|
|
|
292
297
|
clientX: t.clientX,
|
|
293
298
|
clientY: t.clientY,
|
|
294
299
|
isResize: !0
|
|
295
|
-
}, this.mouseDownOnCrop = !0, a(
|
|
300
|
+
}, this.mouseDownOnCrop = !0, a(Y(l, p.width, p.height), W(l, p.width, p.height)), this.setState({ cropIsActive: !0, newCropIsBeingDrawn: !0 });
|
|
296
301
|
}, this.onDocPointerMove = (t) => {
|
|
297
302
|
const { crop: e, disabled: o, onChange: n, onDragStart: r } = this.props, a = this.getBox();
|
|
298
303
|
if (o || !e || !this.mouseDownOnCrop)
|
|
@@ -301,8 +306,8 @@ const Y = class _ extends Me {
|
|
|
301
306
|
const { evData: p } = this;
|
|
302
307
|
p.clientX = t.clientX, p.clientY = t.clientY;
|
|
303
308
|
let s;
|
|
304
|
-
p.isResize ? s = this.resizeCrop() : s = this.dragCrop(),
|
|
305
|
-
|
|
309
|
+
p.isResize ? s = this.resizeCrop() : s = this.dragCrop(), ie(e, s) || n(
|
|
310
|
+
Y(s, a.width, a.height),
|
|
306
311
|
W(s, a.width, a.height)
|
|
307
312
|
);
|
|
308
313
|
}, this.onComponentKeyDown = (t) => {
|
|
@@ -313,10 +318,10 @@ const Y = class _ extends Me {
|
|
|
313
318
|
let p = !1;
|
|
314
319
|
if (!e)
|
|
315
320
|
return;
|
|
316
|
-
const s = this.getBox(), i = this.makePixelCrop(s), l = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ?
|
|
321
|
+
const s = this.getBox(), i = this.makePixelCrop(s), l = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ? I.nudgeStepLarge : t.shiftKey ? I.nudgeStepMedium : I.nudgeStep;
|
|
317
322
|
if (a === "ArrowLeft" ? (i.x -= l, p = !0) : a === "ArrowRight" ? (i.x += l, p = !0) : a === "ArrowUp" ? (i.y -= l, p = !0) : a === "ArrowDown" && (i.y += l, p = !0), p) {
|
|
318
323
|
t.cancelable && t.preventDefault(), i.x = O(i.x, 0, s.width - i.width), i.y = O(i.y, 0, s.height - i.height);
|
|
319
|
-
const h =
|
|
324
|
+
const h = Y(i, s.width, s.height), d = W(i, s.width, s.height);
|
|
320
325
|
n(h, d), r && r(h, d);
|
|
321
326
|
}
|
|
322
327
|
}, this.onHandlerKeyDown = (t, e) => {
|
|
@@ -337,8 +342,8 @@ const Y = class _ extends Me {
|
|
|
337
342
|
t.stopPropagation(), t.preventDefault();
|
|
338
343
|
else
|
|
339
344
|
return;
|
|
340
|
-
const c = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ?
|
|
341
|
-
|
|
345
|
+
const c = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ? I.nudgeStepLarge : t.shiftKey ? I.nudgeStepMedium : I.nudgeStep, R = Y(n, d.width, d.height), H = Ne(R, t.key, c, e), k = oe(
|
|
346
|
+
H,
|
|
342
347
|
o,
|
|
343
348
|
e,
|
|
344
349
|
d.width,
|
|
@@ -348,13 +353,13 @@ const Y = class _ extends Me {
|
|
|
348
353
|
s,
|
|
349
354
|
i
|
|
350
355
|
);
|
|
351
|
-
if (!
|
|
352
|
-
const
|
|
353
|
-
l(
|
|
356
|
+
if (!ie(n, k)) {
|
|
357
|
+
const m = W(k, d.width, d.height);
|
|
358
|
+
l(k, m), h && h(k, m);
|
|
354
359
|
}
|
|
355
360
|
}, this.onDocPointerDone = (t) => {
|
|
356
361
|
const { crop: e, disabled: o, onComplete: n, onDragEnd: r } = this.props, a = this.getBox();
|
|
357
|
-
this.unbindDocMove(), !(o || !e) && this.mouseDownOnCrop && (this.mouseDownOnCrop = !1, this.dragStarted = !1, r && r(t), n && n(
|
|
362
|
+
this.unbindDocMove(), !(o || !e) && this.mouseDownOnCrop && (this.mouseDownOnCrop = !1, this.dragStarted = !1, r && r(t), n && n(Y(e, a.width, a.height), W(e, a.width, a.height)), this.setState({ cropIsActive: !1, newCropIsBeingDrawn: !1 }));
|
|
358
363
|
}, this.onDragFocus = () => {
|
|
359
364
|
var t;
|
|
360
365
|
(t = this.componentRef.current) == null || t.scrollTo(0, 0);
|
|
@@ -376,7 +381,7 @@ const Y = class _ extends Me {
|
|
|
376
381
|
const { crop: e, onComplete: o } = this.props;
|
|
377
382
|
if (o && !t.crop && e) {
|
|
378
383
|
const { width: n, height: r } = this.getBox();
|
|
379
|
-
n && r && o(
|
|
384
|
+
n && r && o(Y(e, n, r), W(e, n, r));
|
|
380
385
|
}
|
|
381
386
|
}
|
|
382
387
|
componentWillUnmount() {
|
|
@@ -427,7 +432,7 @@ const Y = class _ extends Me {
|
|
|
427
432
|
height: 0
|
|
428
433
|
};
|
|
429
434
|
i === "ne" ? (c.x = t.startCropX, c.width = h, e ? (c.height = c.width / e, c.y = t.startCropY - c.height) : (c.height = Math.abs(d), c.y = t.startCropY - c.height)) : i === "se" ? (c.x = t.startCropX, c.y = t.startCropY, c.width = h, e ? c.height = c.width / e : c.height = d) : i === "sw" ? (c.x = t.startCropX + h, c.y = t.startCropY, c.width = Math.abs(h), e ? c.height = c.width / e : c.height = d) : i === "nw" && (c.x = t.startCropX + h, c.width = Math.abs(h), e ? (c.height = c.width / e, c.y = t.startCropY - c.height) : (c.height = Math.abs(d), c.y = t.startCropY + d));
|
|
430
|
-
const R =
|
|
435
|
+
const R = oe(
|
|
431
436
|
c,
|
|
432
437
|
e,
|
|
433
438
|
i,
|
|
@@ -438,11 +443,11 @@ const Y = class _ extends Me {
|
|
|
438
443
|
o,
|
|
439
444
|
n
|
|
440
445
|
);
|
|
441
|
-
return e ||
|
|
446
|
+
return e || I.xyOrds.indexOf(l) > -1 ? s = R : I.xOrds.indexOf(l) > -1 ? (s.x = R.x, s.width = R.width) : I.yOrds.indexOf(l) > -1 && (s.y = R.y, s.height = R.height), s.x = O(s.x, 0, r.width - s.width), s.y = O(s.y, 0, r.height - s.height), s;
|
|
442
447
|
}
|
|
443
448
|
renderCropSelection() {
|
|
444
449
|
const {
|
|
445
|
-
ariaLabels: t =
|
|
450
|
+
ariaLabels: t = I.defaultProps.ariaLabels,
|
|
446
451
|
disabled: e,
|
|
447
452
|
locked: o,
|
|
448
453
|
renderSelectionAddon: n,
|
|
@@ -547,11 +552,11 @@ const Y = class _ extends Me {
|
|
|
547
552
|
);
|
|
548
553
|
}
|
|
549
554
|
makePixelCrop(t) {
|
|
550
|
-
const e = { ...
|
|
551
|
-
return
|
|
555
|
+
const e = { ...Q, ...this.props.crop || {} };
|
|
556
|
+
return Y(e, t.width, t.height);
|
|
552
557
|
}
|
|
553
558
|
render() {
|
|
554
|
-
const { aspect: t, children: e, circularCrop: o, className: n, crop: r, disabled: a, locked: p, style: s, ruleOfThirds: i } = this.props, { cropIsActive: l, newCropIsBeingDrawn: h } = this.state, d = r ? this.renderCropSelection() : null, c =
|
|
559
|
+
const { aspect: t, children: e, circularCrop: o, className: n, crop: r, disabled: a, locked: p, style: s, ruleOfThirds: i } = this.props, { cropIsActive: l, newCropIsBeingDrawn: h } = this.state, d = r ? this.renderCropSelection() : null, c = ke(
|
|
555
560
|
"ReactCrop",
|
|
556
561
|
n,
|
|
557
562
|
l && "ReactCrop--active",
|
|
@@ -585,7 +590,7 @@ const Y = class _ extends Me {
|
|
|
585
590
|
))), /* @__PURE__ */ C.createElement("rect", { fill: "black", fillOpacity: 0.5, width: "100%", height: "100%", mask: `url(#hole-${this.instanceId})` })) : void 0, d);
|
|
586
591
|
}
|
|
587
592
|
};
|
|
588
|
-
|
|
593
|
+
L.xOrds = ["e", "w"], L.yOrds = ["n", "s"], L.xyOrds = ["nw", "ne", "se", "sw"], L.nudgeStep = 1, L.nudgeStepMedium = 10, L.nudgeStepLarge = 100, L.defaultProps = {
|
|
589
594
|
ariaLabels: {
|
|
590
595
|
cropArea: "Use the arrow keys to move the crop selection area",
|
|
591
596
|
nwDragHandle: "Use the arrow keys to move the north west drag handle to change the crop selection area",
|
|
@@ -598,10 +603,10 @@ Y.xOrds = ["e", "w"], Y.yOrds = ["n", "s"], Y.xyOrds = ["nw", "ne", "se", "sw"],
|
|
|
598
603
|
wDragHandle: "Use the up and down arrow keys to move the west drag handle to change the crop selection area"
|
|
599
604
|
}
|
|
600
605
|
};
|
|
601
|
-
let ze =
|
|
602
|
-
const
|
|
606
|
+
let ze = L;
|
|
607
|
+
const se = Re();
|
|
603
608
|
function Se({
|
|
604
|
-
altText:
|
|
609
|
+
altText: g,
|
|
605
610
|
className: t,
|
|
606
611
|
src: e,
|
|
607
612
|
width: o,
|
|
@@ -613,7 +618,7 @@ function Se({
|
|
|
613
618
|
isFocused: i,
|
|
614
619
|
nodeKey: l
|
|
615
620
|
}) {
|
|
616
|
-
const [h, d] =
|
|
621
|
+
const [h, d] = V(null), [c, R] = V({
|
|
617
622
|
//@ts-ignore
|
|
618
623
|
unit: "px",
|
|
619
624
|
// Can be 'px' or '%'
|
|
@@ -621,69 +626,69 @@ function Se({
|
|
|
621
626
|
y: 25,
|
|
622
627
|
width: 50,
|
|
623
628
|
height: 50
|
|
624
|
-
}), [
|
|
629
|
+
}), [H] = ae(), k = () => {
|
|
625
630
|
if (h) {
|
|
626
|
-
const
|
|
627
|
-
if (!
|
|
631
|
+
const E = a.current;
|
|
632
|
+
if (!E || !h)
|
|
628
633
|
return;
|
|
629
|
-
const
|
|
630
|
-
h.width *
|
|
631
|
-
h.height *
|
|
632
|
-
), $ =
|
|
634
|
+
const u = E.naturalWidth / E.width, f = E.naturalHeight / E.height, w = new OffscreenCanvas(
|
|
635
|
+
h.width * u,
|
|
636
|
+
h.height * f
|
|
637
|
+
), $ = w.getContext("2d");
|
|
633
638
|
if (!$)
|
|
634
639
|
throw new Error("No 2D context available");
|
|
635
640
|
$.drawImage(
|
|
636
|
-
|
|
637
|
-
h.x *
|
|
638
|
-
h.y *
|
|
639
|
-
h.width *
|
|
640
|
-
h.height *
|
|
641
|
+
E,
|
|
642
|
+
h.x * u,
|
|
643
|
+
h.y * f,
|
|
644
|
+
h.width * u,
|
|
645
|
+
h.height * f,
|
|
641
646
|
0,
|
|
642
647
|
0,
|
|
643
|
-
h.width *
|
|
644
|
-
h.height *
|
|
645
|
-
),
|
|
648
|
+
h.width * u,
|
|
649
|
+
h.height * f
|
|
650
|
+
), w.convertToBlob({ type: "image/png" }).then((P) => {
|
|
646
651
|
s(!1);
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
const D =
|
|
652
|
+
const y = new FileReader();
|
|
653
|
+
y.onload = () => {
|
|
654
|
+
const D = y.result;
|
|
650
655
|
setTimeout(() => {
|
|
651
|
-
|
|
656
|
+
H.update(
|
|
652
657
|
() => {
|
|
653
|
-
const
|
|
654
|
-
|
|
658
|
+
const _ = T(l);
|
|
659
|
+
G(_) && D && _.setSrc(D);
|
|
655
660
|
},
|
|
656
661
|
{ tag: "crop" }
|
|
657
662
|
);
|
|
658
663
|
}, 100);
|
|
659
|
-
},
|
|
664
|
+
}, y.onerror = () => {
|
|
660
665
|
console.error("Error reading the cropped image blob");
|
|
661
|
-
},
|
|
666
|
+
}, y.readAsDataURL(P);
|
|
662
667
|
});
|
|
663
668
|
}
|
|
664
|
-
},
|
|
665
|
-
p || s((
|
|
666
|
-
if (
|
|
667
|
-
const
|
|
669
|
+
}, m = () => {
|
|
670
|
+
p || s((E) => {
|
|
671
|
+
if (E === !1) {
|
|
672
|
+
const u = a.current;
|
|
668
673
|
R({
|
|
669
674
|
unit: "px",
|
|
670
675
|
// Can be 'px' or '%'
|
|
671
676
|
x: 0,
|
|
672
677
|
y: 0,
|
|
673
|
-
width:
|
|
674
|
-
height:
|
|
678
|
+
width: u.width,
|
|
679
|
+
height: u.height
|
|
675
680
|
});
|
|
676
681
|
}
|
|
677
|
-
return !
|
|
682
|
+
return !E;
|
|
678
683
|
});
|
|
679
|
-
},
|
|
680
|
-
|
|
681
|
-
h && (
|
|
684
|
+
}, A = j(null), N = j(null);
|
|
685
|
+
J(() => {
|
|
686
|
+
h && (A.current = h);
|
|
682
687
|
}, [h]);
|
|
683
|
-
const S = (
|
|
684
|
-
N.current && !N.current.contains(
|
|
688
|
+
const S = (E) => {
|
|
689
|
+
N.current && !N.current.contains(E.target) && s(!1);
|
|
685
690
|
};
|
|
686
|
-
return
|
|
691
|
+
return J(() => (document.addEventListener("mousedown", S), () => {
|
|
687
692
|
document.removeEventListener("mousedown", S);
|
|
688
693
|
}), []), /* @__PURE__ */ b.jsxs("div", { ref: N, children: [
|
|
689
694
|
i && /* @__PURE__ */ b.jsx(
|
|
@@ -691,7 +696,7 @@ function Se({
|
|
|
691
696
|
{
|
|
692
697
|
style: { zIndex: 999 },
|
|
693
698
|
className: "image-caption-button",
|
|
694
|
-
onClick: () =>
|
|
699
|
+
onClick: () => m(),
|
|
695
700
|
children: "Crop"
|
|
696
701
|
}
|
|
697
702
|
),
|
|
@@ -700,7 +705,7 @@ function Se({
|
|
|
700
705
|
{
|
|
701
706
|
style: { zIndex: 999 },
|
|
702
707
|
className: "image-caption-button",
|
|
703
|
-
onClick: () =>
|
|
708
|
+
onClick: () => k(),
|
|
704
709
|
children: "Apply Crop"
|
|
705
710
|
}
|
|
706
711
|
),
|
|
@@ -708,14 +713,14 @@ function Se({
|
|
|
708
713
|
ze,
|
|
709
714
|
{
|
|
710
715
|
crop: c,
|
|
711
|
-
onChange: (
|
|
712
|
-
onComplete: (
|
|
716
|
+
onChange: (E) => R(E),
|
|
717
|
+
onComplete: (E) => d(E),
|
|
713
718
|
children: /* @__PURE__ */ b.jsx(
|
|
714
719
|
"img",
|
|
715
720
|
{
|
|
716
721
|
className: t || void 0,
|
|
717
722
|
src: e,
|
|
718
|
-
alt:
|
|
723
|
+
alt: g,
|
|
719
724
|
ref: a,
|
|
720
725
|
width: typeof o == "number" ? o : void 0,
|
|
721
726
|
height: typeof n == "number" ? n : void 0,
|
|
@@ -736,7 +741,7 @@ function Se({
|
|
|
736
741
|
{
|
|
737
742
|
className: t || void 0,
|
|
738
743
|
src: e,
|
|
739
|
-
alt:
|
|
744
|
+
alt: g,
|
|
740
745
|
ref: a,
|
|
741
746
|
width: typeof o == "number" ? o : void 0,
|
|
742
747
|
height: typeof n == "number" ? n : void 0,
|
|
@@ -753,7 +758,7 @@ function Se({
|
|
|
753
758
|
] });
|
|
754
759
|
}
|
|
755
760
|
function Le({
|
|
756
|
-
src:
|
|
761
|
+
src: g,
|
|
757
762
|
altText: t,
|
|
758
763
|
nodeKey: e,
|
|
759
764
|
width: o,
|
|
@@ -764,140 +769,140 @@ function Le({
|
|
|
764
769
|
caption: s,
|
|
765
770
|
enableCaptions: i
|
|
766
771
|
}) {
|
|
767
|
-
const l =
|
|
768
|
-
const
|
|
769
|
-
|
|
770
|
-
}), !0) : !1, [d,
|
|
771
|
-
(
|
|
772
|
-
const
|
|
773
|
-
if (d &&
|
|
772
|
+
const l = j(null), h = j(null), [d, c, R] = de(e), [H, k] = V(!1), [m] = ae(), [A, N] = V(null), [S, E] = V(!1), u = j(null), f = F((M) => d ? (M.preventDefault(), m.update(() => {
|
|
773
|
+
const x = T(e);
|
|
774
|
+
G(x) && x.remove();
|
|
775
|
+
}), !0) : !1, [d, m, e]), w = F(
|
|
776
|
+
(M) => {
|
|
777
|
+
const x = ee(), z = h.current;
|
|
778
|
+
if (d && q(x) && x.getNodes().length === 1) {
|
|
774
779
|
if (p)
|
|
775
|
-
return
|
|
780
|
+
return ne(null), M.preventDefault(), s.focus(), !0;
|
|
776
781
|
if (z !== null && z !== document.activeElement)
|
|
777
|
-
return
|
|
782
|
+
return M.preventDefault(), z.focus(), !0;
|
|
778
783
|
}
|
|
779
784
|
return !1;
|
|
780
785
|
},
|
|
781
786
|
[s, d, p]
|
|
782
|
-
), $ =
|
|
783
|
-
(
|
|
787
|
+
), $ = F(
|
|
788
|
+
(M) => u.current === s || h.current === M.target ? (ne(null), m.update(() => {
|
|
784
789
|
c(!0);
|
|
785
|
-
const
|
|
786
|
-
|
|
790
|
+
const x = m.getRootElement();
|
|
791
|
+
x !== null && x.focus();
|
|
787
792
|
}), !0) : !1,
|
|
788
|
-
[s,
|
|
789
|
-
),
|
|
790
|
-
(
|
|
791
|
-
const
|
|
792
|
-
return
|
|
793
|
+
[s, m, c]
|
|
794
|
+
), P = F(
|
|
795
|
+
(M) => {
|
|
796
|
+
const x = M;
|
|
797
|
+
return H ? !0 : x.target === l.current ? (x.shiftKey ? c(!d) : (R(), c(!0)), !0) : !1;
|
|
793
798
|
},
|
|
794
|
-
[
|
|
795
|
-
),
|
|
796
|
-
(
|
|
797
|
-
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
799
|
+
[H, d, c, R]
|
|
800
|
+
), y = F(
|
|
801
|
+
(M) => {
|
|
802
|
+
m.getEditorState().read(() => {
|
|
803
|
+
const x = ee();
|
|
804
|
+
M.target.tagName === "IMG" && le(x) && x.getNodes().length === 1 && m.dispatchCommand(
|
|
805
|
+
se,
|
|
806
|
+
M
|
|
802
807
|
);
|
|
803
808
|
});
|
|
804
809
|
},
|
|
805
|
-
[
|
|
810
|
+
[m]
|
|
806
811
|
);
|
|
807
|
-
|
|
808
|
-
const
|
|
809
|
-
(z.key === "Delete" || z.key === "Backspace") && d && (z.stopPropagation(), z.preventDefault(),
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
+
J(() => {
|
|
813
|
+
const M = (z) => {
|
|
814
|
+
(z.key === "Delete" || z.key === "Backspace") && d && (z.stopPropagation(), z.preventDefault(), m.update(() => {
|
|
815
|
+
const X = T(e);
|
|
816
|
+
G(X) && X.remove();
|
|
812
817
|
}));
|
|
813
|
-
},
|
|
814
|
-
return
|
|
815
|
-
|
|
818
|
+
}, x = m.getRootElement();
|
|
819
|
+
return x == null || x.addEventListener("keydown", M), () => {
|
|
820
|
+
x == null || x.removeEventListener("keydown", M);
|
|
816
821
|
};
|
|
817
|
-
}, [d,
|
|
818
|
-
let
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
|
|
822
|
+
}, [d, m, e]), J(() => {
|
|
823
|
+
let M = !0;
|
|
824
|
+
const x = m.getRootElement(), z = ge(
|
|
825
|
+
m.registerUpdateListener(({ editorState: X }) => {
|
|
826
|
+
M && N(X.read(() => ee()));
|
|
822
827
|
}),
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
(
|
|
828
|
+
m.registerCommand(
|
|
829
|
+
ye,
|
|
830
|
+
(X, ce) => (u.current = ce, !1),
|
|
826
831
|
B
|
|
827
832
|
),
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
833
|
+
m.registerCommand(
|
|
834
|
+
xe,
|
|
835
|
+
P,
|
|
831
836
|
B
|
|
832
837
|
),
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
838
|
+
m.registerCommand(
|
|
839
|
+
se,
|
|
840
|
+
P,
|
|
836
841
|
B
|
|
837
842
|
),
|
|
838
|
-
|
|
843
|
+
m.registerCommand(
|
|
839
844
|
fe,
|
|
840
|
-
(
|
|
845
|
+
(X) => X.target === l.current ? (X.preventDefault(), !0) : !1,
|
|
841
846
|
B
|
|
842
847
|
),
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
848
|
+
m.registerCommand(
|
|
849
|
+
we,
|
|
850
|
+
f,
|
|
846
851
|
4
|
|
847
852
|
),
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
853
|
+
m.registerCommand(
|
|
854
|
+
me,
|
|
855
|
+
f,
|
|
851
856
|
4
|
|
852
857
|
),
|
|
853
|
-
|
|
854
|
-
|
|
858
|
+
m.registerCommand(pe, w, B),
|
|
859
|
+
m.registerCommand(ue, $, B)
|
|
855
860
|
);
|
|
856
|
-
return
|
|
857
|
-
|
|
861
|
+
return x == null || x.addEventListener("contextmenu", y), () => {
|
|
862
|
+
M = !1, z(), x == null || x.removeEventListener("contextmenu", y);
|
|
858
863
|
};
|
|
859
864
|
}, [
|
|
860
865
|
R,
|
|
861
|
-
|
|
862
|
-
|
|
866
|
+
m,
|
|
867
|
+
H,
|
|
863
868
|
d,
|
|
864
869
|
e,
|
|
865
870
|
// onDelete,
|
|
866
|
-
|
|
871
|
+
w,
|
|
867
872
|
$,
|
|
868
|
-
|
|
869
|
-
|
|
873
|
+
P,
|
|
874
|
+
y,
|
|
870
875
|
c
|
|
871
876
|
]);
|
|
872
877
|
const D = () => {
|
|
873
|
-
|
|
874
|
-
const
|
|
875
|
-
|
|
878
|
+
m.update(() => {
|
|
879
|
+
const M = T(e);
|
|
880
|
+
G(M) && M.setShowCaption(!0);
|
|
876
881
|
});
|
|
877
|
-
},
|
|
882
|
+
}, _ = (M, x) => {
|
|
878
883
|
setTimeout(() => {
|
|
879
|
-
|
|
880
|
-
}, 200),
|
|
881
|
-
const z =
|
|
882
|
-
|
|
884
|
+
k(!1);
|
|
885
|
+
}, 200), m.update(() => {
|
|
886
|
+
const z = T(e);
|
|
887
|
+
G(z) && z.setWidthAndHeight(M, x);
|
|
883
888
|
});
|
|
884
|
-
},
|
|
885
|
-
S ||
|
|
886
|
-
}, he = d &&
|
|
887
|
-
return /* @__PURE__ */ b.jsx(
|
|
889
|
+
}, U = () => {
|
|
890
|
+
S || k(!0);
|
|
891
|
+
}, he = d && q(A) && !H, Z = d || H;
|
|
892
|
+
return /* @__PURE__ */ b.jsx(He, { fallback: null, children: /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
|
|
888
893
|
/* @__PURE__ */ b.jsx("div", { draggable: he, children: /* @__PURE__ */ b.jsx(
|
|
889
894
|
Se,
|
|
890
895
|
{
|
|
891
|
-
className:
|
|
892
|
-
src:
|
|
896
|
+
className: Z ? `focused ${q(A) ? "draggable" : ""}` : null,
|
|
897
|
+
src: g,
|
|
893
898
|
altText: t,
|
|
894
899
|
width: o,
|
|
895
900
|
height: n,
|
|
896
901
|
maxWidth: r,
|
|
897
902
|
imageRef: l,
|
|
898
903
|
startCrop: S,
|
|
899
|
-
setStartCrop:
|
|
900
|
-
isFocused:
|
|
904
|
+
setStartCrop: E,
|
|
905
|
+
isFocused: Z,
|
|
901
906
|
nodeKey: e
|
|
902
907
|
}
|
|
903
908
|
) }),
|
|
@@ -909,18 +914,18 @@ function Le({
|
|
|
909
914
|
ErrorBoundary: be
|
|
910
915
|
}
|
|
911
916
|
) }) }),
|
|
912
|
-
!S && a &&
|
|
913
|
-
|
|
917
|
+
!S && a && q(A) && Z && /* @__PURE__ */ b.jsx(
|
|
918
|
+
Pe,
|
|
914
919
|
{
|
|
915
920
|
showCaption: p,
|
|
916
921
|
setShowCaption: D,
|
|
917
|
-
editor:
|
|
922
|
+
editor: m,
|
|
918
923
|
buttonRef: h,
|
|
919
924
|
maxWidth: r,
|
|
920
925
|
onResizeStart: S ? () => {
|
|
921
|
-
} :
|
|
926
|
+
} : U,
|
|
922
927
|
onResizeEnd: S ? () => {
|
|
923
|
-
} :
|
|
928
|
+
} : _,
|
|
924
929
|
enableCaptions: i,
|
|
925
930
|
imageRef: l
|
|
926
931
|
}
|
|
@@ -928,7 +933,7 @@ function Le({
|
|
|
928
933
|
] }) });
|
|
929
934
|
}
|
|
930
935
|
export {
|
|
931
|
-
|
|
936
|
+
se as RIGHT_CLICK_IMAGE_COMMAND,
|
|
932
937
|
Le as default
|
|
933
938
|
};
|
|
934
|
-
//# sourceMappingURL=ImageComponent-
|
|
939
|
+
//# sourceMappingURL=ImageComponent-462c3315.js.map
|