sykpcomposer 0.0.224 → 0.0.227

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.
@@ -1,9 +1,9 @@
1
- import { j as v, u as he, a as ce, d as U, w as G, x as J, $ as Q, b as te, c as de, e as le, f as ge, C as I, g as ue, k as pe, h as we, I as me, r as xe, i as fe, l as ye, m as Ce, t as ve } from "./index-0da8bb7a.js";
2
- import { d as De, L as be, P as Re } from "./Placeholder-4d1c4dfe.js";
3
- import f, { useRef as Y, PureComponent as Ee, createRef as ne, useState as O, useCallback as F, useEffect as ee, Suspense as Me } from "react";
1
+ import { j as v, u as ce, a as ae, d as F, w as V, x as q, $ as J, b as ne, c as de, e as le, f as ge, C as I, g as ue, k as pe, h as we, I as me, r as xe, i as fe, l as ye, m as Ce, t as ve } from "./index-d16127ae.js";
2
+ import { d as De, L as be, P as Re } from "./Placeholder-c6ce6df8.js";
3
+ import f, { useRef as Y, PureComponent as Ee, createRef as ie, useState as W, useCallback as T, useEffect as te, Suspense as Me } from "react";
4
4
  import "react-dom";
5
- function Z(g, t, e) {
6
- return Math.min(Math.max(g, t), e);
5
+ function ee(l, t, e) {
6
+ return Math.min(Math.max(l, t), e);
7
7
  }
8
8
  const y = {
9
9
  east: 1,
@@ -12,7 +12,7 @@ const y = {
12
12
  west: 4
13
13
  };
14
14
  function Pe({
15
- onResizeStart: g,
15
+ onResizeStart: l,
16
16
  onResizeEnd: t,
17
17
  buttonRef: e,
18
18
  imageRef: o,
@@ -22,10 +22,10 @@ function Pe({
22
22
  setShowCaption: p,
23
23
  captionsEnabled: s
24
24
  }) {
25
- const r = Y(null), a = Y({
25
+ const r = Y(null), d = Y({
26
26
  priority: "",
27
27
  value: "default"
28
- }), d = Y({
28
+ }), a = Y({
29
29
  currentHeight: 0,
30
30
  currentWidth: 0,
31
31
  direction: 0,
@@ -35,78 +35,78 @@ function Pe({
35
35
  startWidth: 0,
36
36
  startX: 0,
37
37
  startY: 0
38
- }), l = i.getRootElement(), c = l !== null ? l.getBoundingClientRect().width - 20 : 100, C = l !== null ? l.getBoundingClientRect().height - 20 : 100, M = 100, x = 100, z = (u) => {
39
- const w = u === y.east || u === y.west, m = u === y.north || u === y.south, N = u & y.north && u & y.west || u & y.south && u & y.east, $ = w ? "ew" : m ? "ns" : N ? "nwse" : "nesw";
40
- l !== null && l.style.setProperty(
38
+ }), g = i.getRootElement(), c = g !== null ? g.getBoundingClientRect().width - 20 : 100, C = g !== null ? g.getBoundingClientRect().height - 20 : 100, P = 100, x = 100, $ = (w) => {
39
+ const u = w === y.east || w === y.west, m = w === y.north || w === y.south, H = w & y.north && w & y.west || w & y.south && w & y.east, E = u ? "ew" : m ? "ns" : H ? "nwse" : "nesw";
40
+ g !== null && g.style.setProperty(
41
41
  "cursor",
42
- `${$}-resize`,
42
+ `${E}-resize`,
43
43
  "important"
44
44
  ), document.body !== null && (document.body.style.setProperty(
45
45
  "cursor",
46
- `${$}-resize`,
46
+ `${E}-resize`,
47
47
  "important"
48
- ), a.current.value = document.body.style.getPropertyValue(
48
+ ), d.current.value = document.body.style.getPropertyValue(
49
49
  "-webkit-user-select"
50
- ), a.current.priority = document.body.style.getPropertyPriority(
50
+ ), d.current.priority = document.body.style.getPropertyPriority(
51
51
  "-webkit-user-select"
52
52
  ), document.body.style.setProperty(
53
53
  "-webkit-user-select",
54
54
  "none",
55
55
  "important"
56
56
  ));
57
- }, W = () => {
58
- l !== null && l.style.setProperty("cursor", "text"), document.body !== null && (document.body.style.setProperty("cursor", "default"), document.body.style.setProperty(
57
+ }, K = () => {
58
+ g !== null && g.style.setProperty("cursor", "text"), document.body !== null && (document.body.style.setProperty("cursor", "default"), document.body.style.setProperty(
59
59
  "-webkit-user-select",
60
- a.current.value,
61
- a.current.priority
60
+ d.current.value,
61
+ d.current.priority
62
62
  ));
63
- }, H = (u, w) => {
63
+ }, z = (w, u) => {
64
64
  if (!i.isEditable())
65
65
  return;
66
- const m = o.current, N = r.current;
67
- if (m !== null && N !== null) {
68
- u.preventDefault();
69
- const { width: $, height: D } = m.getBoundingClientRect(), b = d.current;
70
- b.startWidth = $, b.startHeight = D, b.ratio = $ / D, b.currentWidth = $, b.currentHeight = D, b.startX = u.clientX, b.startY = u.clientY, b.isResizing = !0, b.direction = w, z(w), g(), N.classList.add("image-control-wrapper--resizing"), m.style.height = `${D}px`, m.style.width = `${$}px`, document.addEventListener("pointermove", L), document.addEventListener("pointerup", R);
66
+ const m = o.current, H = r.current;
67
+ if (m !== null && H !== null) {
68
+ w.preventDefault();
69
+ const { width: E, height: b } = m.getBoundingClientRect(), D = a.current;
70
+ D.startWidth = E, D.startHeight = b, D.ratio = E / b, D.currentWidth = E, D.currentHeight = b, D.startX = w.clientX, D.startY = w.clientY, D.isResizing = !0, D.direction = u, $(u), l(), H.classList.add("image-control-wrapper--resizing"), m.style.height = `${b}px`, m.style.width = `${E}px`, document.addEventListener("pointermove", j), document.addEventListener("pointerup", k);
71
71
  }
72
- }, L = (u) => {
73
- const w = o.current, m = d.current, N = m.direction & (y.east | y.west), $ = m.direction & (y.south | y.north);
74
- if (w !== null && m.isResizing) {
75
- if (N && $) {
76
- let D = Math.floor(m.startX - u.clientX);
77
- D = m.direction & y.east ? -D : D;
78
- const b = Z(
79
- m.startWidth + D,
80
- M,
72
+ }, j = (w) => {
73
+ const u = o.current, m = a.current, H = m.direction & (y.east | y.west), E = m.direction & (y.south | y.north);
74
+ if (u !== null && m.isResizing) {
75
+ if (H && E) {
76
+ let b = Math.floor(m.startX - w.clientX);
77
+ b = m.direction & y.east ? -b : b;
78
+ const D = ee(
79
+ m.startWidth + b,
80
+ P,
81
81
  c
82
- ), T = b / m.ratio;
83
- w.style.width = `${b}px`, w.style.height = `${T}px`, m.currentHeight = T, m.currentWidth = b;
84
- } else if ($) {
85
- let D = Math.floor(m.startY - u.clientY);
86
- D = m.direction & y.south ? -D : D;
87
- const b = Z(
88
- m.startHeight + D,
82
+ ), L = D / m.ratio;
83
+ u.style.width = `${D}px`, u.style.height = `${L}px`, m.currentHeight = L, m.currentWidth = D;
84
+ } else if (E) {
85
+ let b = Math.floor(m.startY - w.clientY);
86
+ b = m.direction & y.south ? -b : b;
87
+ const D = ee(
88
+ m.startHeight + b,
89
89
  x,
90
90
  C
91
91
  );
92
- w.style.height = `${b}px`, w.style.maxHeight = `${b}px`, m.currentHeight = b;
92
+ u.style.height = `${D}px`, u.style.maxHeight = `${D}px`, m.currentHeight = D;
93
93
  } else {
94
- let D = Math.floor(m.startX - u.clientX);
95
- D = m.direction & y.east ? -D : D;
96
- const b = Z(
97
- m.startWidth + D,
98
- M,
94
+ let b = Math.floor(m.startX - w.clientX);
95
+ b = m.direction & y.east ? -b : b;
96
+ const D = ee(
97
+ m.startWidth + b,
98
+ P,
99
99
  c
100
100
  );
101
- w.style.width = `${b}px`, w.style.maxWidth = `${b}px`, m.currentWidth = b;
101
+ u.style.width = `${D}px`, u.style.maxWidth = `${D}px`, m.currentWidth = D;
102
102
  }
103
- w && (w.setAttribute("width", `${m.currentWidth}`), w.setAttribute("height", `${m.currentHeight}`));
103
+ u && (u.setAttribute("width", `${m.currentWidth}`), u.setAttribute("height", `${m.currentHeight}`));
104
104
  }
105
- }, R = () => {
106
- const u = o.current, w = d.current, m = r.current;
107
- if (u !== null && m !== null && w.isResizing) {
108
- const N = w.currentWidth, $ = w.currentHeight;
109
- w.startWidth = 0, w.startHeight = 0, w.ratio = 0, w.startX = 0, w.startY = 0, w.currentWidth = 0, w.currentHeight = 0, w.isResizing = !1, m.classList.remove("image-control-wrapper--resizing"), W(), t(N, $), document.removeEventListener("pointermove", L), document.removeEventListener("pointerup", R);
105
+ }, k = () => {
106
+ const w = o.current, u = a.current, m = r.current;
107
+ if (w !== null && m !== null && u.isResizing) {
108
+ const H = u.currentWidth, E = u.currentHeight;
109
+ u.startWidth = 0, u.startHeight = 0, u.ratio = 0, u.startX = 0, u.startY = 0, u.currentWidth = 0, u.currentHeight = 0, u.isResizing = !1, m.classList.remove("image-control-wrapper--resizing"), K(), t(H, E), document.removeEventListener("pointermove", j), document.removeEventListener("pointerup", k);
110
110
  }
111
111
  };
112
112
  return /* @__PURE__ */ v.jsxs("div", { ref: r, children: [
@@ -114,8 +114,8 @@ function Pe({
114
114
  "div",
115
115
  {
116
116
  className: "image-resizer image-resizer-n",
117
- onPointerDown: (u) => {
118
- H(u, y.north);
117
+ onPointerDown: (w) => {
118
+ z(w, y.north);
119
119
  }
120
120
  }
121
121
  ),
@@ -123,8 +123,8 @@ function Pe({
123
123
  "div",
124
124
  {
125
125
  className: "image-resizer image-resizer-ne",
126
- onPointerDown: (u) => {
127
- H(u, y.north | y.east);
126
+ onPointerDown: (w) => {
127
+ z(w, y.north | y.east);
128
128
  }
129
129
  }
130
130
  ),
@@ -132,8 +132,8 @@ function Pe({
132
132
  "div",
133
133
  {
134
134
  className: "image-resizer image-resizer-e",
135
- onPointerDown: (u) => {
136
- H(u, y.east);
135
+ onPointerDown: (w) => {
136
+ z(w, y.east);
137
137
  }
138
138
  }
139
139
  ),
@@ -141,8 +141,8 @@ function Pe({
141
141
  "div",
142
142
  {
143
143
  className: "image-resizer image-resizer-se",
144
- onPointerDown: (u) => {
145
- H(u, y.south | y.east);
144
+ onPointerDown: (w) => {
145
+ z(w, y.south | y.east);
146
146
  }
147
147
  }
148
148
  ),
@@ -150,8 +150,8 @@ function Pe({
150
150
  "div",
151
151
  {
152
152
  className: "image-resizer image-resizer-s",
153
- onPointerDown: (u) => {
154
- H(u, y.south);
153
+ onPointerDown: (w) => {
154
+ z(w, y.south);
155
155
  }
156
156
  }
157
157
  ),
@@ -159,8 +159,8 @@ function Pe({
159
159
  "div",
160
160
  {
161
161
  className: "image-resizer image-resizer-sw",
162
- onPointerDown: (u) => {
163
- H(u, y.south | y.west);
162
+ onPointerDown: (w) => {
163
+ z(w, y.south | y.west);
164
164
  }
165
165
  }
166
166
  ),
@@ -168,8 +168,8 @@ function Pe({
168
168
  "div",
169
169
  {
170
170
  className: "image-resizer image-resizer-w",
171
- onPointerDown: (u) => {
172
- H(u, y.west);
171
+ onPointerDown: (w) => {
172
+ z(w, y.west);
173
173
  }
174
174
  }
175
175
  ),
@@ -177,62 +177,62 @@ function Pe({
177
177
  "div",
178
178
  {
179
179
  className: "image-resizer image-resizer-nw",
180
- onPointerDown: (u) => {
181
- H(u, y.north | y.west);
180
+ onPointerDown: (w) => {
181
+ z(w, y.north | y.west);
182
182
  }
183
183
  }
184
184
  )
185
185
  ] });
186
186
  }
187
- const V = {
187
+ const Q = {
188
188
  x: 0,
189
189
  y: 0,
190
190
  width: 0,
191
191
  height: 0,
192
192
  unit: "px"
193
- }, j = (g, t, e) => Math.min(Math.max(g, t), e), He = (...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;
194
- function A(g, t, e) {
195
- return g.unit === "%" ? { ...V, ...g, unit: "%" } : {
193
+ }, A = (l, t, e) => Math.min(Math.max(l, t), e), He = (...l) => l.filter((t) => t && typeof t == "string").join(" "), re = (l, t) => l === t || l.width === t.width && l.height === t.height && l.x === t.x && l.y === t.y && l.unit === t.unit;
194
+ function B(l, t, e) {
195
+ return l.unit === "%" ? { ...Q, ...l, unit: "%" } : {
196
196
  unit: "%",
197
- x: g.x ? g.x / t * 100 : 0,
198
- y: g.y ? g.y / e * 100 : 0,
199
- width: g.width ? g.width / t * 100 : 0,
200
- height: g.height ? g.height / e * 100 : 0
197
+ x: l.x ? l.x / t * 100 : 0,
198
+ y: l.y ? l.y / e * 100 : 0,
199
+ width: l.width ? l.width / t * 100 : 0,
200
+ height: l.height ? l.height / e * 100 : 0
201
201
  };
202
202
  }
203
- function _(g, t, e) {
204
- return g.unit ? g.unit === "px" ? { ...V, ...g, unit: "px" } : {
203
+ function _(l, t, e) {
204
+ return l.unit ? l.unit === "px" ? { ...Q, ...l, unit: "px" } : {
205
205
  unit: "px",
206
- x: g.x ? g.x * t / 100 : 0,
207
- y: g.y ? g.y * e / 100 : 0,
208
- width: g.width ? g.width * t / 100 : 0,
209
- height: g.height ? g.height * e / 100 : 0
210
- } : { ...V, ...g, unit: "px" };
206
+ x: l.x ? l.x * t / 100 : 0,
207
+ y: l.y ? l.y * e / 100 : 0,
208
+ width: l.width ? l.width * t / 100 : 0,
209
+ height: l.height ? l.height * e / 100 : 0
210
+ } : { ...Q, ...l, unit: "px" };
211
211
  }
212
- function re(g, t, e, o, n, i = 0, h = 0, p = o, s = n) {
213
- const r = { ...g };
214
- let a = Math.min(i, o), d = Math.min(h, n), l = Math.min(p, o), c = Math.min(s, n);
215
- t && (t > 1 ? (a = h ? h * t : a, d = a / t, l = p * t) : (d = i ? i / t : d, a = d * t, c = s / t)), r.y < 0 && (r.height = Math.max(r.height + r.y, d), r.y = 0), r.x < 0 && (r.width = Math.max(r.width + r.x, a), r.x = 0);
212
+ function oe(l, t, e, o, n, i = 0, h = 0, p = o, s = n) {
213
+ const r = { ...l };
214
+ let d = Math.min(i, o), a = Math.min(h, n), g = Math.min(p, o), c = Math.min(s, n);
215
+ t && (t > 1 ? (d = h ? h * t : d, a = d / t, g = p * t) : (a = i ? i / t : a, d = a * t, c = s / t)), r.y < 0 && (r.height = Math.max(r.height + r.y, a), r.y = 0), r.x < 0 && (r.width = Math.max(r.width + r.x, d), r.x = 0);
216
216
  const C = o - (r.x + r.width);
217
- C < 0 && (r.x = Math.min(r.x, o - a), r.width += C);
218
- const M = n - (r.y + r.height);
219
- if (M < 0 && (r.y = Math.min(r.y, n - d), r.height += M), r.width < a && ((e === "sw" || e == "nw") && (r.x -= a - r.width), r.width = a), r.height < d && ((e === "nw" || e == "ne") && (r.y -= d - r.height), r.height = d), r.width > l && ((e === "sw" || e == "nw") && (r.x -= l - r.width), r.width = l), r.height > c && ((e === "nw" || e == "ne") && (r.y -= c - r.height), r.height = c), t) {
217
+ C < 0 && (r.x = Math.min(r.x, o - d), r.width += C);
218
+ const P = n - (r.y + r.height);
219
+ if (P < 0 && (r.y = Math.min(r.y, n - a), r.height += P), r.width < d && ((e === "sw" || e == "nw") && (r.x -= d - r.width), r.width = d), r.height < a && ((e === "nw" || e == "ne") && (r.y -= a - r.height), r.height = a), r.width > g && ((e === "sw" || e == "nw") && (r.x -= g - r.width), r.width = g), r.height > c && ((e === "nw" || e == "ne") && (r.y -= c - r.height), r.height = c), t) {
220
220
  const x = r.width / r.height;
221
221
  if (x < t) {
222
- const z = Math.max(r.width / t, d);
223
- (e === "nw" || e == "ne") && (r.y -= z - r.height), r.height = z;
222
+ const $ = Math.max(r.width / t, a);
223
+ (e === "nw" || e == "ne") && (r.y -= $ - r.height), r.height = $;
224
224
  } else if (x > t) {
225
- const z = Math.max(r.height * t, a);
226
- (e === "sw" || e == "nw") && (r.x -= z - r.width), r.width = z;
225
+ const $ = Math.max(r.height * t, d);
226
+ (e === "sw" || e == "nw") && (r.x -= $ - r.width), r.width = $;
227
227
  }
228
228
  }
229
229
  return r;
230
230
  }
231
- function $e(g, t, e, o) {
232
- const n = { ...g };
231
+ function $e(l, t, e, o) {
232
+ const n = { ...l };
233
233
  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
234
  }
235
- const B = { capture: !0, passive: !1 };
235
+ const O = { capture: !0, passive: !1 };
236
236
  let ze = 0;
237
237
  const X = class S extends Ee {
238
238
  constructor() {
@@ -244,7 +244,7 @@ const X = class S extends Ee {
244
244
  clientX: 0,
245
245
  clientY: 0,
246
246
  isResize: !0
247
- }, this.componentRef = ne(), this.mediaRef = ne(), this.initChangeCalled = !1, this.instanceId = `rc-${ze++}`, this.state = {
247
+ }, this.componentRef = ie(), this.mediaRef = ie(), this.initChangeCalled = !1, this.instanceId = `rc-${ze++}`, this.state = {
248
248
  cropIsActive: !1,
249
249
  newCropIsBeingDrawn: !1
250
250
  }, this.onCropPointerDown = (t) => {
@@ -256,17 +256,17 @@ const X = class S extends Ee {
256
256
  return;
257
257
  t.cancelable && t.preventDefault(), this.bindDocMove(), this.componentRef.current.focus({ preventScroll: !0 });
258
258
  const h = t.target.dataset.ord, p = !!h;
259
- let s = t.clientX, r = t.clientY, a = i.x, d = i.y;
259
+ let s = t.clientX, r = t.clientY, d = i.x, a = i.y;
260
260
  if (h) {
261
- const l = t.clientX - n.x, c = t.clientY - n.y;
262
- let C = 0, M = 0;
263
- h === "ne" || h == "e" ? (C = l - (i.x + i.width), M = c - i.y, a = i.x, d = i.y + i.height) : h === "se" || h === "s" ? (C = l - (i.x + i.width), M = c - (i.y + i.height), a = i.x, d = i.y) : h === "sw" || h == "w" ? (C = l - i.x, M = c - (i.y + i.height), a = i.x + i.width, d = i.y) : (h === "nw" || h == "n") && (C = l - i.x, M = c - i.y, a = i.x + i.width, d = i.y + i.height), s = a + n.x + C, r = d + n.y + M;
261
+ const g = t.clientX - n.x, c = t.clientY - n.y;
262
+ let C = 0, P = 0;
263
+ h === "ne" || h == "e" ? (C = g - (i.x + i.width), P = c - i.y, d = i.x, a = i.y + i.height) : h === "se" || h === "s" ? (C = g - (i.x + i.width), P = c - (i.y + i.height), d = i.x, a = i.y) : h === "sw" || h == "w" ? (C = g - i.x, P = c - (i.y + i.height), d = i.x + i.width, a = i.y) : (h === "nw" || h == "n") && (C = g - i.x, P = c - i.y, d = i.x + i.width, a = i.y + i.height), s = d + n.x + C, r = a + n.y + P;
264
264
  }
265
265
  this.evData = {
266
266
  startClientX: s,
267
267
  startClientY: r,
268
- startCropX: a,
269
- startCropY: d,
268
+ startCropX: d,
269
+ startCropY: a,
270
270
  clientX: t.clientX,
271
271
  clientY: t.clientY,
272
272
  isResize: p,
@@ -277,7 +277,7 @@ const X = class S extends Ee {
277
277
  if (o || n || i && e)
278
278
  return;
279
279
  t.cancelable && t.preventDefault(), this.bindDocMove(), this.componentRef.current.focus({ preventScroll: !0 });
280
- const s = t.clientX - p.x, r = t.clientY - p.y, a = {
280
+ const s = t.clientX - p.x, r = t.clientY - p.y, d = {
281
281
  unit: "px",
282
282
  x: s,
283
283
  y: r,
@@ -292,7 +292,7 @@ const X = class S extends Ee {
292
292
  clientX: t.clientX,
293
293
  clientY: t.clientY,
294
294
  isResize: !0
295
- }, this.mouseDownOnCrop = !0, h(_(a, p.width, p.height), A(a, p.width, p.height)), this.setState({ cropIsActive: !0, newCropIsBeingDrawn: !0 });
295
+ }, this.mouseDownOnCrop = !0, h(_(d, p.width, p.height), B(d, p.width, p.height)), this.setState({ cropIsActive: !0, newCropIsBeingDrawn: !0 });
296
296
  }, this.onDocPointerMove = (t) => {
297
297
  const { crop: e, disabled: o, onChange: n, onDragStart: i } = this.props, h = this.getBox();
298
298
  if (o || !e || !this.mouseDownOnCrop)
@@ -301,9 +301,9 @@ const X = class S extends Ee {
301
301
  const { evData: p } = this;
302
302
  p.clientX = t.clientX, p.clientY = t.clientY;
303
303
  let s;
304
- p.isResize ? s = this.resizeCrop() : s = this.dragCrop(), ie(e, s) || n(
304
+ p.isResize ? s = this.resizeCrop() : s = this.dragCrop(), re(e, s) || n(
305
305
  _(s, h.width, h.height),
306
- A(s, h.width, h.height)
306
+ B(s, h.width, h.height)
307
307
  );
308
308
  }, this.onComponentKeyDown = (t) => {
309
309
  const { crop: e, disabled: o, onChange: n, onComplete: i } = this.props;
@@ -313,11 +313,11 @@ const X = class S extends Ee {
313
313
  let p = !1;
314
314
  if (!e)
315
315
  return;
316
- const s = this.getBox(), r = this.makePixelCrop(s), a = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ? S.nudgeStepLarge : t.shiftKey ? S.nudgeStepMedium : S.nudgeStep;
317
- if (h === "ArrowLeft" ? (r.x -= a, p = !0) : h === "ArrowRight" ? (r.x += a, p = !0) : h === "ArrowUp" ? (r.y -= a, p = !0) : h === "ArrowDown" && (r.y += a, p = !0), p) {
318
- t.cancelable && t.preventDefault(), r.x = j(r.x, 0, s.width - r.width), r.y = j(r.y, 0, s.height - r.height);
319
- const d = _(r, s.width, s.height), l = A(r, s.width, s.height);
320
- n(d, l), i && i(d, l);
316
+ const s = this.getBox(), r = this.makePixelCrop(s), d = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ? S.nudgeStepLarge : t.shiftKey ? S.nudgeStepMedium : S.nudgeStep;
317
+ if (h === "ArrowLeft" ? (r.x -= d, p = !0) : h === "ArrowRight" ? (r.x += d, p = !0) : h === "ArrowUp" ? (r.y -= d, p = !0) : h === "ArrowDown" && (r.y += d, p = !0), p) {
318
+ t.cancelable && t.preventDefault(), r.x = A(r.x, 0, s.width - r.width), r.y = A(r.y, 0, s.height - r.height);
319
+ const a = _(r, s.width, s.height), g = B(r, s.width, s.height);
320
+ n(a, g), i && i(a, g);
321
321
  }
322
322
  }, this.onHandlerKeyDown = (t, e) => {
323
323
  const {
@@ -328,33 +328,33 @@ const X = class S extends Ee {
328
328
  minHeight: p = 0,
329
329
  maxWidth: s,
330
330
  maxHeight: r,
331
- onChange: a,
332
- onComplete: d
333
- } = this.props, l = this.getBox();
331
+ onChange: d,
332
+ onComplete: a
333
+ } = this.props, g = this.getBox();
334
334
  if (i || !n)
335
335
  return;
336
336
  if (t.key === "ArrowUp" || t.key === "ArrowDown" || t.key === "ArrowLeft" || t.key === "ArrowRight")
337
337
  t.stopPropagation(), t.preventDefault();
338
338
  else
339
339
  return;
340
- const c = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ? S.nudgeStepLarge : t.shiftKey ? S.nudgeStepMedium : S.nudgeStep, C = _(n, l.width, l.height), M = $e(C, t.key, c, e), x = re(
341
- M,
340
+ const c = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ? S.nudgeStepLarge : t.shiftKey ? S.nudgeStepMedium : S.nudgeStep, C = _(n, g.width, g.height), P = $e(C, t.key, c, e), x = oe(
341
+ P,
342
342
  o,
343
343
  e,
344
- l.width,
345
- l.height,
344
+ g.width,
345
+ g.height,
346
346
  h,
347
347
  p,
348
348
  s,
349
349
  r
350
350
  );
351
- if (!ie(n, x)) {
352
- const z = A(x, l.width, l.height);
353
- a(x, z), d && d(x, z);
351
+ if (!re(n, x)) {
352
+ const $ = B(x, g.width, g.height);
353
+ d(x, $), a && a(x, $);
354
354
  }
355
355
  }, this.onDocPointerDone = (t) => {
356
356
  const { crop: e, disabled: o, onComplete: n, onDragEnd: i } = this.props, h = this.getBox();
357
- this.unbindDocMove(), !(o || !e) && this.mouseDownOnCrop && (this.mouseDownOnCrop = !1, this.dragStarted = !1, i && i(t), n && n(_(e, h.width, h.height), A(e, h.width, h.height)), this.setState({ cropIsActive: !1, newCropIsBeingDrawn: !1 }));
357
+ this.unbindDocMove(), !(o || !e) && this.mouseDownOnCrop && (this.mouseDownOnCrop = !1, this.dragStarted = !1, i && i(t), n && n(_(e, h.width, h.height), B(e, h.width, h.height)), this.setState({ cropIsActive: !1, newCropIsBeingDrawn: !1 }));
358
358
  }, this.onDragFocus = () => {
359
359
  var t;
360
360
  (t = this.componentRef.current) == null || t.scrollTo(0, 0);
@@ -376,17 +376,17 @@ const X = class S extends Ee {
376
376
  const { crop: e, onComplete: o } = this.props;
377
377
  if (o && !t.crop && e) {
378
378
  const { width: n, height: i } = this.getBox();
379
- n && i && o(_(e, n, i), A(e, n, i));
379
+ n && i && o(_(e, n, i), B(e, n, i));
380
380
  }
381
381
  }
382
382
  componentWillUnmount() {
383
383
  this.resizeObserver && this.resizeObserver.disconnect(), this.unbindDocMove();
384
384
  }
385
385
  bindDocMove() {
386
- this.docMoveBound || (this.document.addEventListener("pointermove", this.onDocPointerMove, B), this.document.addEventListener("pointerup", this.onDocPointerDone, B), this.document.addEventListener("pointercancel", this.onDocPointerDone, B), this.docMoveBound = !0);
386
+ this.docMoveBound || (this.document.addEventListener("pointermove", this.onDocPointerMove, O), this.document.addEventListener("pointerup", this.onDocPointerDone, O), this.document.addEventListener("pointercancel", this.onDocPointerDone, O), this.docMoveBound = !0);
387
387
  }
388
388
  unbindDocMove() {
389
- this.docMoveBound && (this.document.removeEventListener("pointermove", this.onDocPointerMove, B), this.document.removeEventListener("pointerup", this.onDocPointerDone, B), this.document.removeEventListener("pointercancel", this.onDocPointerDone, B), this.docMoveBound = !1);
389
+ this.docMoveBound && (this.document.removeEventListener("pointermove", this.onDocPointerMove, O), this.document.removeEventListener("pointerup", this.onDocPointerDone, O), this.document.removeEventListener("pointercancel", this.onDocPointerDone, O), this.docMoveBound = !1);
390
390
  }
391
391
  getCropStyle() {
392
392
  const { crop: t } = this.props;
@@ -400,7 +400,7 @@ const X = class S extends Ee {
400
400
  }
401
401
  dragCrop() {
402
402
  const { evData: t } = this, e = this.getBox(), o = this.makePixelCrop(e), n = t.clientX - t.startClientX, i = t.clientY - t.startClientY;
403
- return o.x = j(t.startCropX + n, 0, e.width - o.width), o.y = j(t.startCropY + i, 0, e.height - o.height), o;
403
+ return o.x = A(t.startCropX + n, 0, e.width - o.width), o.y = A(t.startCropY + i, 0, e.height - o.height), o;
404
404
  }
405
405
  getPointRegion(t, e, o, n) {
406
406
  const { evData: i } = this, h = i.clientX - t.x, p = i.clientY - t.y;
@@ -416,9 +416,9 @@ const X = class S extends Ee {
416
416
  resizeCrop() {
417
417
  const { evData: t } = this, { aspect: e = 0, maxWidth: o, maxHeight: n } = this.props, i = this.getBox(), [h, p] = this.resolveMinDimensions(i, e, this.props.minWidth, this.props.minHeight);
418
418
  let s = this.makePixelCrop(i);
419
- const r = this.getPointRegion(i, t.ord, h, p), a = t.ord || r;
420
- let d = t.clientX - t.startClientX, l = t.clientY - t.startClientY;
421
- (h && a === "nw" || a === "w" || a === "sw") && (d = Math.min(d, -h)), (p && a === "nw" || a === "n" || a === "ne") && (l = Math.min(l, -p));
419
+ const r = this.getPointRegion(i, t.ord, h, p), d = t.ord || r;
420
+ let a = t.clientX - t.startClientX, g = t.clientY - t.startClientY;
421
+ (h && d === "nw" || d === "w" || d === "sw") && (a = Math.min(a, -h)), (p && d === "nw" || d === "n" || d === "ne") && (g = Math.min(g, -p));
422
422
  const c = {
423
423
  unit: "px",
424
424
  x: 0,
@@ -426,8 +426,8 @@ const X = class S extends Ee {
426
426
  width: 0,
427
427
  height: 0
428
428
  };
429
- r === "ne" ? (c.x = t.startCropX, c.width = d, e ? (c.height = c.width / e, c.y = t.startCropY - c.height) : (c.height = Math.abs(l), c.y = t.startCropY - c.height)) : r === "se" ? (c.x = t.startCropX, c.y = t.startCropY, c.width = d, e ? c.height = c.width / e : c.height = l) : r === "sw" ? (c.x = t.startCropX + d, c.y = t.startCropY, c.width = Math.abs(d), e ? c.height = c.width / e : c.height = l) : r === "nw" && (c.x = t.startCropX + d, c.width = Math.abs(d), e ? (c.height = c.width / e, c.y = t.startCropY - c.height) : (c.height = Math.abs(l), c.y = t.startCropY + l));
430
- const C = re(
429
+ r === "ne" ? (c.x = t.startCropX, c.width = a, e ? (c.height = c.width / e, c.y = t.startCropY - c.height) : (c.height = Math.abs(g), c.y = t.startCropY - c.height)) : r === "se" ? (c.x = t.startCropX, c.y = t.startCropY, c.width = a, e ? c.height = c.width / e : c.height = g) : r === "sw" ? (c.x = t.startCropX + a, c.y = t.startCropY, c.width = Math.abs(a), e ? c.height = c.width / e : c.height = g) : r === "nw" && (c.x = t.startCropX + a, c.width = Math.abs(a), e ? (c.height = c.width / e, c.y = t.startCropY - c.height) : (c.height = Math.abs(g), c.y = t.startCropY + g));
430
+ const C = oe(
431
431
  c,
432
432
  e,
433
433
  r,
@@ -438,7 +438,7 @@ const X = class S extends Ee {
438
438
  o,
439
439
  n
440
440
  );
441
- return e || S.xyOrds.indexOf(a) > -1 ? s = C : S.xOrds.indexOf(a) > -1 ? (s.x = C.x, s.width = C.width) : S.yOrds.indexOf(a) > -1 && (s.y = C.y, s.height = C.height), s.x = j(s.x, 0, i.width - s.width), s.y = j(s.y, 0, i.height - s.height), s;
441
+ return e || S.xyOrds.indexOf(d) > -1 ? s = C : S.xOrds.indexOf(d) > -1 ? (s.x = C.x, s.width = C.width) : S.yOrds.indexOf(d) > -1 && (s.y = C.y, s.height = C.height), s.x = A(s.x, 0, i.width - s.width), s.y = A(s.y, 0, i.height - s.height), s;
442
442
  }
443
443
  renderCropSelection() {
444
444
  const {
@@ -547,17 +547,17 @@ const X = class S extends Ee {
547
547
  );
548
548
  }
549
549
  makePixelCrop(t) {
550
- const e = { ...V, ...this.props.crop || {} };
550
+ const e = { ...Q, ...this.props.crop || {} };
551
551
  return _(e, t.width, t.height);
552
552
  }
553
553
  render() {
554
- const { aspect: t, children: e, circularCrop: o, className: n, crop: i, disabled: h, locked: p, style: s, ruleOfThirds: r } = this.props, { cropIsActive: a, newCropIsBeingDrawn: d } = this.state, l = i ? this.renderCropSelection() : null, c = He(
554
+ const { aspect: t, children: e, circularCrop: o, className: n, crop: i, disabled: h, locked: p, style: s, ruleOfThirds: r } = this.props, { cropIsActive: d, newCropIsBeingDrawn: a } = this.state, g = i ? this.renderCropSelection() : null, c = He(
555
555
  "ReactCrop",
556
556
  n,
557
- a && "ReactCrop--active",
557
+ d && "ReactCrop--active",
558
558
  h && "ReactCrop--disabled",
559
559
  p && "ReactCrop--locked",
560
- d && "ReactCrop--new-crop",
560
+ a && "ReactCrop--new-crop",
561
561
  i && t && "ReactCrop--fixed-aspect",
562
562
  i && o && "ReactCrop--circular-crop",
563
563
  i && r && "ReactCrop--rule-of-thirds",
@@ -582,7 +582,7 @@ const X = class S extends Ee {
582
582
  height: `${i.height}${i.unit}`,
583
583
  fill: "black"
584
584
  }
585
- ))), /* @__PURE__ */ f.createElement("rect", { fill: "black", fillOpacity: 0.5, width: "100%", height: "100%", mask: `url(#hole-${this.instanceId})` })) : void 0, l);
585
+ ))), /* @__PURE__ */ f.createElement("rect", { fill: "black", fillOpacity: 0.5, width: "100%", height: "100%", mask: `url(#hole-${this.instanceId})` })) : void 0, g);
586
586
  }
587
587
  };
588
588
  X.xOrds = ["e", "w"], X.yOrds = ["n", "s"], X.xyOrds = ["nw", "ne", "se", "sw"], X.nudgeStep = 1, X.nudgeStepMedium = 10, X.nudgeStepLarge = 100, X.defaultProps = {
@@ -599,9 +599,9 @@ X.xOrds = ["e", "w"], X.yOrds = ["n", "s"], X.xyOrds = ["nw", "ne", "se", "sw"],
599
599
  }
600
600
  };
601
601
  let Ne = X;
602
- const oe = ve();
603
- function ke({
604
- altText: g,
602
+ const se = ve();
603
+ function Se({
604
+ altText: l,
605
605
  className: t,
606
606
  src: e,
607
607
  width: o,
@@ -610,9 +610,10 @@ function ke({
610
610
  imageRef: h,
611
611
  startCrop: p,
612
612
  setStartCrop: s,
613
- isFocused: r
613
+ isFocused: r,
614
+ nodeKey: d
614
615
  }) {
615
- const [a, d] = O(null), [l, c] = O(null), [C, M] = O({
616
+ const [a, g] = W(null), [c, C] = W(null), [P, x] = W({
616
617
  //@ts-ignore
617
618
  unit: "px",
618
619
  // Can be 'px' or '%'
@@ -620,57 +621,60 @@ function ke({
620
621
  y: 25,
621
622
  width: 50,
622
623
  height: 50
623
- }), x = () => {
624
+ }), [$] = ae(), K = () => {
624
625
  if (a) {
625
- const R = h.current;
626
- if (!R || !a)
626
+ const u = h.current;
627
+ if (!u || !a)
627
628
  return;
628
- const u = R.naturalWidth / R.width, w = R.naturalHeight / R.height, m = new OffscreenCanvas(
629
- a.width * u,
630
- a.height * w
631
- ), N = m.getContext("2d");
632
- if (!N)
629
+ const m = u.naturalWidth / u.width, H = u.naturalHeight / u.height, E = new OffscreenCanvas(
630
+ a.width * m,
631
+ a.height * H
632
+ ), b = E.getContext("2d");
633
+ if (!b)
633
634
  throw new Error("No 2D context available");
634
- N.drawImage(
635
- R,
636
- a.x * u,
637
- a.y * w,
638
- a.width * u,
639
- a.height * w,
635
+ b.drawImage(
636
+ u,
637
+ a.x * m,
638
+ a.y * H,
639
+ a.width * m,
640
+ a.height * H,
640
641
  0,
641
642
  0,
642
- a.width * u,
643
- a.height * w
644
- ), m.convertToBlob({ type: "image/png" }).then(($) => {
645
- const D = URL.createObjectURL($);
646
- c(D), s(!1);
643
+ a.width * m,
644
+ a.height * H
645
+ ), E.convertToBlob({ type: "image/png" }).then((D) => {
646
+ const L = URL.createObjectURL(D);
647
+ C(L), s(!1), $.update(() => {
648
+ const G = q(d);
649
+ J(G) && G.setSrc(L);
650
+ });
647
651
  });
648
652
  }
649
653
  }, z = () => {
650
- p || s((R) => {
651
- if (R === !1) {
652
- const u = h.current;
653
- M({
654
+ p || s((u) => {
655
+ if (u === !1) {
656
+ const m = h.current;
657
+ x({
654
658
  unit: "px",
655
659
  // Can be 'px' or '%'
656
660
  x: 0,
657
661
  y: 0,
658
- width: u.width,
659
- height: u.height
662
+ width: m.width,
663
+ height: m.height
660
664
  });
661
665
  }
662
- return !R;
666
+ return !u;
663
667
  });
664
- }, W = Y(null), H = Y(null);
665
- ee(() => {
666
- a && (W.current = a);
668
+ }, j = Y(null), k = Y(null);
669
+ te(() => {
670
+ a && (j.current = a);
667
671
  }, [a]);
668
- const L = (R) => {
669
- H.current && !H.current.contains(R.target) && s(!1);
672
+ const w = (u) => {
673
+ k.current && !k.current.contains(u.target) && s(!1);
670
674
  };
671
- return ee(() => (document.addEventListener("mousedown", L), () => {
672
- document.removeEventListener("mousedown", L);
673
- }), []), /* @__PURE__ */ v.jsxs("div", { ref: H, children: [
675
+ return te(() => (document.addEventListener("mousedown", w), () => {
676
+ document.removeEventListener("mousedown", w);
677
+ }), []), /* @__PURE__ */ v.jsxs("div", { ref: k, children: [
674
678
  r && /* @__PURE__ */ v.jsx(
675
679
  "button",
676
680
  {
@@ -685,22 +689,22 @@ function ke({
685
689
  {
686
690
  style: { zIndex: 999 },
687
691
  className: "image-caption-button",
688
- onClick: () => x(),
692
+ onClick: () => K(),
689
693
  children: "Apply Crop"
690
694
  }
691
695
  ),
692
696
  p ? /* @__PURE__ */ v.jsx(
693
697
  Ne,
694
698
  {
695
- crop: C,
696
- onChange: (R) => M(R),
697
- onComplete: (R) => d(R),
699
+ crop: P,
700
+ onChange: (u) => x(u),
701
+ onComplete: (u) => g(u),
698
702
  children: /* @__PURE__ */ v.jsx(
699
703
  "img",
700
704
  {
701
705
  className: t || void 0,
702
- src: l || e,
703
- alt: g,
706
+ src: c || e,
707
+ alt: l,
704
708
  ref: h,
705
709
  style: {
706
710
  height: n,
@@ -717,8 +721,8 @@ function ke({
717
721
  "img",
718
722
  {
719
723
  className: t || void 0,
720
- src: l || e,
721
- alt: g,
724
+ src: c || e,
725
+ alt: l,
722
726
  ref: h,
723
727
  style: {
724
728
  height: n,
@@ -732,7 +736,7 @@ function ke({
732
736
  ] });
733
737
  }
734
738
  function Ye({
735
- src: g,
739
+ src: l,
736
740
  altText: t,
737
741
  nodeKey: e,
738
742
  width: o,
@@ -742,138 +746,139 @@ function Ye({
742
746
  showCaption: p,
743
747
  caption: s
744
748
  }) {
745
- const r = Y(null), a = Y(null), [d, l, c] = he(e), [C, M] = O(!1), [x] = ce(), [z, W] = O(null), [H, L] = O(!1), R = Y(null), u = F(
746
- (P) => {
747
- if (d && U(G())) {
748
- P.preventDefault();
749
- const k = J(e);
750
- if (Q(k))
751
- return k.remove(), !0;
749
+ const r = Y(null), d = Y(null), [a, g, c] = ce(e), [C, P] = W(!1), [x] = ae(), [$, K] = W(null), [z, j] = W(!1), k = Y(null), w = T(
750
+ (M) => {
751
+ if (a && F(V())) {
752
+ M.preventDefault();
753
+ const N = q(e);
754
+ if (J(N))
755
+ return N.remove(), !0;
752
756
  }
753
757
  return !1;
754
758
  },
755
- [d, e]
756
- ), w = F(
757
- (P) => {
758
- const E = G(), k = a.current;
759
- if (d && U(E) && E.getNodes().length === 1) {
759
+ [a, e]
760
+ ), u = T(
761
+ (M) => {
762
+ const R = V(), N = d.current;
763
+ if (a && F(R) && R.getNodes().length === 1) {
760
764
  if (p)
761
- return te(null), P.preventDefault(), s.focus(), !0;
762
- if (k !== null && k !== document.activeElement)
763
- return P.preventDefault(), k.focus(), !0;
765
+ return ne(null), M.preventDefault(), s.focus(), !0;
766
+ if (N !== null && N !== document.activeElement)
767
+ return M.preventDefault(), N.focus(), !0;
764
768
  }
765
769
  return !1;
766
770
  },
767
- [s, d, p]
768
- ), m = F(
769
- (P) => R.current === s || a.current === P.target ? (te(null), x.update(() => {
770
- l(!0);
771
- const E = x.getRootElement();
772
- E !== null && E.focus();
771
+ [s, a, p]
772
+ ), m = T(
773
+ (M) => k.current === s || d.current === M.target ? (ne(null), x.update(() => {
774
+ g(!0);
775
+ const R = x.getRootElement();
776
+ R !== null && R.focus();
773
777
  }), !0) : !1,
774
- [s, x, l]
775
- ), N = F(
776
- (P) => {
777
- const E = P;
778
- return C ? !0 : E.target === r.current ? (E.shiftKey ? l(!d) : (c(), l(!0)), !0) : !1;
778
+ [s, x, g]
779
+ ), H = T(
780
+ (M) => {
781
+ const R = M;
782
+ return C ? !0 : R.target === r.current ? (R.shiftKey ? g(!a) : (c(), g(!0)), !0) : !1;
779
783
  },
780
- [C, d, l, c]
781
- ), $ = F(
782
- (P) => {
784
+ [C, a, g, c]
785
+ ), E = T(
786
+ (M) => {
783
787
  x.getEditorState().read(() => {
784
- const E = G();
785
- P.target.tagName === "IMG" && de(E) && E.getNodes().length === 1 && x.dispatchCommand(
786
- oe,
787
- P
788
+ const R = V();
789
+ M.target.tagName === "IMG" && de(R) && R.getNodes().length === 1 && x.dispatchCommand(
790
+ se,
791
+ M
788
792
  );
789
793
  });
790
794
  },
791
795
  [x]
792
796
  );
793
- ee(() => {
794
- let P = !0;
795
- const E = x.getRootElement(), k = le(
796
- x.registerUpdateListener(({ editorState: K }) => {
797
- P && W(K.read(() => G()));
797
+ te(() => {
798
+ let M = !0;
799
+ const R = x.getRootElement(), N = le(
800
+ x.registerUpdateListener(({ editorState: U }) => {
801
+ M && K(U.read(() => V()));
798
802
  }),
799
803
  x.registerCommand(
800
804
  fe,
801
- (K, ae) => (R.current = ae, !1),
805
+ (U, he) => (k.current = he, !1),
802
806
  I
803
807
  ),
804
808
  x.registerCommand(
805
809
  xe,
806
- N,
810
+ H,
807
811
  I
808
812
  ),
809
813
  x.registerCommand(
810
- oe,
811
- N,
814
+ se,
815
+ H,
812
816
  I
813
817
  ),
814
818
  x.registerCommand(
815
819
  me,
816
- (K) => K.target === r.current ? (K.preventDefault(), !0) : !1,
820
+ (U) => U.target === r.current ? (U.preventDefault(), !0) : !1,
817
821
  I
818
822
  ),
819
823
  x.registerCommand(
820
824
  we,
821
- u,
825
+ w,
822
826
  I
823
827
  ),
824
828
  x.registerCommand(
825
829
  pe,
826
- u,
830
+ w,
827
831
  I
828
832
  ),
829
- x.registerCommand(ue, w, I),
833
+ x.registerCommand(ue, u, I),
830
834
  x.registerCommand(ge, m, I)
831
835
  );
832
- return E == null || E.addEventListener("contextmenu", $), () => {
833
- P = !1, k(), E == null || E.removeEventListener("contextmenu", $);
836
+ return R == null || R.addEventListener("contextmenu", E), () => {
837
+ M = !1, N(), R == null || R.removeEventListener("contextmenu", E);
834
838
  };
835
839
  }, [
836
840
  c,
837
841
  x,
838
842
  C,
839
- d,
843
+ a,
840
844
  e,
841
- u,
842
845
  w,
846
+ u,
843
847
  m,
844
- N,
845
- $,
846
- l
848
+ H,
849
+ E,
850
+ g
847
851
  ]);
848
- const D = () => {
852
+ const b = () => {
849
853
  x.update(() => {
850
- const P = J(e);
851
- Q(P) && P.setShowCaption(!0);
854
+ const M = q(e);
855
+ J(M) && M.setShowCaption(!0);
852
856
  });
853
- }, b = (P, E) => {
857
+ }, D = (M, R) => {
854
858
  setTimeout(() => {
855
- M(!1);
859
+ P(!1);
856
860
  }, 200), x.update(() => {
857
- const k = J(e);
858
- Q(k) && k.setWidthAndHeight(P, E);
861
+ const N = q(e);
862
+ console.log(N, "node"), J(N) && N.setWidthAndHeight(M, R);
859
863
  });
860
- }, T = () => {
861
- H || M(!0);
862
- }, se = d && U(z) && !C, q = d || C;
864
+ }, L = () => {
865
+ z || P(!0);
866
+ }, G = a && F($) && !C, Z = a || C;
863
867
  return /* @__PURE__ */ v.jsx(Me, { fallback: null, children: /* @__PURE__ */ v.jsxs(v.Fragment, { children: [
864
- /* @__PURE__ */ v.jsx("div", { draggable: se, children: /* @__PURE__ */ v.jsx(
865
- ke,
868
+ /* @__PURE__ */ v.jsx("div", { draggable: G, children: /* @__PURE__ */ v.jsx(
869
+ Se,
866
870
  {
867
- className: q ? `focused ${U(z) ? "draggable" : ""}` : null,
868
- src: g,
871
+ className: Z ? `focused ${F($) ? "draggable" : ""}` : null,
872
+ src: l,
869
873
  altText: t,
870
874
  width: o,
871
875
  height: n,
872
876
  maxWidth: i,
873
877
  imageRef: r,
874
- startCrop: H,
875
- setStartCrop: L,
876
- isFocused: q
878
+ startCrop: z,
879
+ setStartCrop: j,
880
+ isFocused: Z,
881
+ nodeKey: e
877
882
  }
878
883
  ) }),
879
884
  p && /* @__PURE__ */ v.jsx("div", { className: "image-caption-container", children: /* @__PURE__ */ v.jsx(De, { initialEditor: s, children: /* @__PURE__ */ v.jsx(
@@ -884,18 +889,18 @@ function Ye({
884
889
  ErrorBoundary: Ce
885
890
  }
886
891
  ) }) }),
887
- !H && h && U(z) && q && /* @__PURE__ */ v.jsx(
892
+ !z && h && F($) && Z && /* @__PURE__ */ v.jsx(
888
893
  Pe,
889
894
  {
890
895
  showCaption: p,
891
- setShowCaption: D,
896
+ setShowCaption: b,
892
897
  editor: x,
893
- buttonRef: a,
898
+ buttonRef: d,
894
899
  maxWidth: i,
895
- onResizeStart: H ? () => {
896
- } : T,
897
- onResizeEnd: H ? () => {
898
- } : b,
900
+ onResizeStart: z ? () => {
901
+ } : L,
902
+ onResizeEnd: z ? () => {
903
+ } : D,
899
904
  captionsEnabled: !1,
900
905
  imageRef: r
901
906
  }
@@ -903,7 +908,7 @@ function Ye({
903
908
  ] }) });
904
909
  }
905
910
  export {
906
- oe as RIGHT_CLICK_IMAGE_COMMAND,
911
+ se as RIGHT_CLICK_IMAGE_COMMAND,
907
912
  Ye as default
908
913
  };
909
- //# sourceMappingURL=ImageComponent-4548d923.js.map
914
+ //# sourceMappingURL=ImageComponent-93482354.js.map