@emailmaker/filemanager 1.1.69 → 1.1.70

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,12 +1,12 @@
1
- import { A as e, C as t, J as n, P as r, R as i, S as a, U as o, X as s, ct as c, et as l, f as u, h as d, j as f, x as p } from "./file-manager-hooks-aNT0w8kI.js";
2
- import { i as m, t as ee } from "./file-manager-urls-DN9gaYil.js";
3
- import h from "react";
4
- import { Button as g, Modal as te } from "antd";
5
- import { jsx as _, jsxs as ne } from "react/jsx-runtime";
6
- import { CloseOutlined as re, HistoryOutlined as ie } from "@ant-design/icons";
7
- import { Pixie as v } from "pixie";
1
+ import { B as e, C as t, G as n, I as r, M as i, N as a, Q as o, T as s, X as c, _ as l, f as u, nt as ee, ut as d, w as f } from "./file-manager-hooks-vqT-4jeg.js";
2
+ import { i as p, t as te } from "./file-manager-urls-DN9gaYil.js";
3
+ import m from "react";
4
+ import { Button as h, Modal as ne } from "antd";
5
+ import { jsx as g, jsxs as re } from "react/jsx-runtime";
6
+ import { CloseOutlined as ie, HistoryOutlined as ae } from "@ant-design/icons";
7
+ import { Pixie as _ } from "pixie";
8
8
  //#region packages/file-manager/src/components/PixieEditor/backgroundColor.ts
9
- function y(e, t, n, r, i, a) {
9
+ function v(e, t, n, r, i, a) {
10
10
  if (t.type === "linear") {
11
11
  let i = e.createLinearGradient(n + t.coords.x1, r + t.coords.y1, n + t.coords.x2, r + t.coords.y2);
12
12
  return t.colorStops.forEach((e) => i.addColorStop(e.offset, e.color)), i;
@@ -17,35 +17,35 @@ function y(e, t, n, r, i, a) {
17
17
  }
18
18
  throw Error("Unknown gradient type");
19
19
  }
20
- function b(e) {
20
+ function y(e) {
21
21
  if (!this.backgroundColor) return;
22
22
  let t = this._getNonTransformedDimensions(), n = -t.x / 2, r = -t.y / 2, i = t.x, a = t.y, o = this.backgroundColor;
23
23
  if (typeof o == "string" || o instanceof CanvasGradient || o instanceof CanvasPattern) e.fillStyle = o, e.fillRect(n, r, i, a);
24
- else if (typeof o == "object" && "type" in o && (o.type === "linear" || o.type === "radial")) e.fillStyle = y(e, o, n, r, i, a), e.fillRect(n, r, i, a);
24
+ else if (typeof o == "object" && "type" in o && (o.type === "linear" || o.type === "radial")) e.fillStyle = v(e, o, n, r, i, a), e.fillRect(n, r, i, a);
25
25
  else if ("source" in o && (o.source instanceof HTMLImageElement || o.source instanceof HTMLCanvasElement)) if (o.repeat) {
26
26
  let t = e.createPattern(o.source, o.repeat);
27
27
  t && (e.fillStyle = t, e.fillRect(n, r, i, a));
28
28
  } else e.drawImage(o.source, n, r, i, a);
29
29
  this._removeShadow(e);
30
30
  }
31
- function x(e) {
31
+ function b(e) {
32
32
  if (!e.fabric) {
33
33
  console.warn("Pixie fabric instance is not available");
34
34
  return;
35
35
  }
36
36
  e.fabric.on("object:added", (e) => {
37
37
  let t = e.target;
38
- t && t.name === "text" && (t._renderBackground = b);
38
+ t && t.name === "text" && (t._renderBackground = y);
39
39
  });
40
40
  }
41
41
  //#endregion
42
42
  //#region packages/file-manager/src/components/PixieEditor/PixieController.tsx
43
- var S = "fm-pixie-editor", C = new class {
43
+ var x = "fm-pixie-editor", S = new class {
44
44
  constructor() {
45
- this._container = document.createElement("div"), this._instance = null, this._container.classList.add(S), this._container.style.width = "100%", this._container.style.height = "85vh", this._container.style.minHeight = "400px";
45
+ this._container = document.createElement("div"), this._instance = null, this._container.classList.add(x), this._container.style.width = "100%", this._container.style.height = "85vh", this._container.style.minHeight = "400px";
46
46
  }
47
47
  get className() {
48
- return `.${S}`;
48
+ return `.${x}`;
49
49
  }
50
50
  get canvas() {
51
51
  return this._instance?.state.canvasRef?.current;
@@ -57,10 +57,10 @@ var S = "fm-pixie-editor", C = new class {
57
57
  return !!this._instance;
58
58
  }
59
59
  async _setConfig(e) {
60
- this._instance ? await this._instance.resetEditor(e) : this._instance = await v.init({
60
+ this._instance ? await this._instance.resetEditor(e) : this._instance = await _.init({
61
61
  ...e,
62
62
  selector: this.className
63
- }), x(this._instance);
63
+ }), b(this._instance);
64
64
  }
65
65
  async show(e, t, n = t.firstChild) {
66
66
  t.insertBefore(this._container, n), await this._setConfig(e), this._instance.open();
@@ -68,59 +68,59 @@ var S = "fm-pixie-editor", C = new class {
68
68
  close() {
69
69
  this._container.parentNode?.removeChild(this._container);
70
70
  }
71
- }(), w = (e, t = "image/png") => fetch(`data:${t};base64,${e}`).then((e) => e.blob());
72
- function ae(e, t) {
71
+ }(), C = (e, t = "image/png") => fetch(`data:${t};base64,${e}`).then((e) => e.blob());
72
+ function oe(e, t) {
73
73
  if (e === "json") return new Blob([t], { type: "application/json" });
74
74
  if (e === "svg") return new Blob([t], { type: "image/svg+xml" });
75
- let r = `image/${e}`;
75
+ let n = `image/${e}`;
76
76
  if (t.startsWith("data:")) {
77
- let e = n(t);
78
- return e && e.startsWith("image/") && (r = e), w(t.replace(/data:image\/[^;]+;base64,/, ""), s(r));
77
+ let e = c(t);
78
+ return e && e.startsWith("image/") && (n = e), C(t.replace(/data:image\/[^;]+;base64,/, ""), o(n));
79
79
  }
80
- return w(t, s(r));
80
+ return C(t, o(n));
81
81
  }
82
- function oe(e) {
82
+ function w(e) {
83
83
  return new Promise((t, n) => {
84
84
  let r = new FileReader();
85
85
  r.onload = () => t(r.result), r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to convert blob to data URL")), r.readAsDataURL(e);
86
86
  });
87
87
  }
88
- var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
89
- let { t: S } = o(), w = h.useRef(null), T = r(), se = u(), { options: E, actions: ce } = i(), { i18n: D } = o(), { config: O } = E, { setCurrentMenuFile: k } = ce, { getFileData: A, resolveFileForEditByUrl: j } = se, [M, N] = h.useState(!1), [P, F] = h.useState(null), [I, L] = h.useState(""), [R, z] = h.useState(!1), [B, V] = h.useState(!1), [H, U] = h.useState(null), W = h.useRef(!1), G = h.useRef(void 0), K = h.useRef(void 0), q = h.useRef("saveCopy"), J = h.useRef(void 0);
90
- G.current = b, K.current = x, h.useEffect(() => {
91
- y && !W.current && (async () => {
92
- if (J.current !== y) {
93
- if (typeof y == "object") {
94
- U(y);
88
+ var T = ({ visible: c, onClose: _, file: v, onSave: y, onSaveCopy: b }) => {
89
+ let { t: x } = n(), C = m.useRef(null), T = r(), se = u(), { options: E, actions: ce } = e(), { i18n: D } = n(), { config: O } = E, { setCurrentMenuFile: k } = ce, { getFileData: A, resolveFileForEditByUrl: j } = se, [M, N] = m.useState(!1), [P, F] = m.useState(null), [I, L] = m.useState(""), [R, z] = m.useState(!1), [B, V] = m.useState(!1), [H, U] = m.useState(null), W = m.useRef(!1), G = m.useRef(void 0), K = m.useRef(void 0), q = m.useRef("saveCopy"), J = m.useRef(void 0);
90
+ G.current = y, K.current = b, m.useEffect(() => {
91
+ v && !W.current && (async () => {
92
+ if (J.current !== v) {
93
+ if (typeof v == "object") {
94
+ U(v);
95
95
  return;
96
96
  }
97
- J.current = y, N(!0);
97
+ J.current = v, N(!0);
98
98
  try {
99
- if (y.startsWith("data:")) U({
100
- thumbnail: y,
99
+ if (v.startsWith("data:")) U({
100
+ thumbnail: v,
101
101
  saveWithoutFolder: !0
102
102
  });
103
103
  else {
104
- let e = await j(y);
105
- J.current === y && U(e);
104
+ let e = await j(v);
105
+ J.current === v && U(e);
106
106
  }
107
107
  } catch (e) {
108
- console.error("Failed to load file for editor:", e), J.current === y && (J.current = null), v?.();
108
+ console.error("Failed to load file for editor:", e), J.current === v && (J.current = null), _?.();
109
109
  } finally {
110
110
  N(!1);
111
111
  }
112
112
  }
113
113
  })();
114
114
  }, [
115
- y,
116
115
  v,
116
+ _,
117
117
  j
118
118
  ]);
119
- let Y = h.useCallback(async (e) => {
119
+ let Y = m.useCallback(async (e) => {
120
120
  try {
121
121
  if (typeof e.thumbnail == "string" && e.thumbnail.startsWith("data:")) return e.thumbnail;
122
122
  let t = await A(e.id, !0);
123
- if (!t) throw Error(S("Error loading image"));
123
+ if (!t) throw Error(x("Error loading image"));
124
124
  return new Promise((e) => {
125
125
  let n = new FileReader();
126
126
  n.onload = () => e(n.result), n.readAsDataURL(t);
@@ -128,9 +128,9 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
128
128
  } catch (e) {
129
129
  throw console.error("Error getting the image data:", e), e;
130
130
  }
131
- }, [A, S]);
132
- h.useEffect(() => {
133
- if (!P && n && H) {
131
+ }, [A, x]);
132
+ m.useEffect(() => {
133
+ if (!P && c && H) {
134
134
  let e = !1;
135
135
  return (async () => {
136
136
  N(!0);
@@ -146,14 +146,14 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
146
146
  if (!/^[A-Za-z0-9+/]+=*$/.test(i)) throw Error("Invalid image data: corrupted base64 content");
147
147
  if (!e) {
148
148
  F(t);
149
- let e = a(H, "image/png");
149
+ let e = f(H, "image/png");
150
150
  L(e.mimeType);
151
151
  }
152
152
  } catch (t) {
153
153
  e || (T.error({
154
154
  id: "IMAGE_DOWNLOAD_FAILED",
155
155
  innerException: t,
156
- message: S("Error loading image"),
156
+ message: x("Error loading image"),
157
157
  placement: "bottomRight",
158
158
  data: {
159
159
  itemId: H?.id ?? void 0,
@@ -161,7 +161,7 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
161
161
  folderId: H?.folderId ?? null,
162
162
  thumbnail: H?.thumbnail
163
163
  }
164
- }), v?.());
164
+ }), _?.());
165
165
  } finally {
166
166
  N(!1);
167
167
  }
@@ -173,71 +173,71 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
173
173
  H,
174
174
  Y,
175
175
  P,
176
- v,
177
- S,
178
- n
176
+ _,
177
+ x,
178
+ c
179
179
  ]);
180
- let X = h.useCallback(async (e, n, r) => {
181
- let i = await ae(r, e), a = s(i.type || `image/${r}`), o = O?.compessorUrl ?? O?.compressorUrl;
182
- if (a.startsWith("image/")) try {
183
- let e = await d(new File([i], n, { type: a }), {
180
+ let X = m.useCallback(async (e, t, n) => {
181
+ let r = await oe(n, e), i = o(r.type || `image/${n}`), a = O?.compessorUrl ?? O?.compressorUrl;
182
+ if (i.startsWith("image/")) try {
183
+ let e = await l(new File([r], t, { type: i }), {
184
184
  maxSizeMB: O?.compressMaxSize,
185
185
  maxWidthOrHeight: O?.compressMaxWidthOrHeight,
186
- mimeType: a,
187
- fileName: n,
188
- libURL: o,
189
- enableCompression: t(O, a)
186
+ mimeType: i,
187
+ fileName: t,
188
+ libURL: a,
189
+ enableCompression: s(O, i)
190
190
  });
191
- i = e, a = e.type;
191
+ r = e, i = e.type;
192
192
  } catch (e) {
193
193
  console.warn("Image preparation failed, using original:", e);
194
194
  }
195
195
  return {
196
- blob: i,
197
- mimeType: a,
198
- thumbnailDataUrl: await oe(i)
196
+ blob: r,
197
+ mimeType: i,
198
+ thumbnailDataUrl: await w(r)
199
199
  };
200
- }, [O]), Z = h.useCallback(async (t, n, r, i) => {
201
- let a = i === "save" ? G.current : K.current;
202
- if (!H || !a) return;
203
- let o = typeof H == "object" && H ? H : null, s = null;
200
+ }, [O]), Z = m.useCallback(async (e, t, n, r) => {
201
+ let o = r === "save" ? G.current : K.current;
202
+ if (!H || !o) return;
203
+ let s = typeof H == "object" && H ? H : null, c = null;
204
204
  try {
205
205
  N(!0);
206
- let { blob: e, mimeType: o, thumbnailDataUrl: c } = await X(t, n, r), l = {
206
+ let { blob: i, mimeType: a, thumbnailDataUrl: s } = await X(e, t, n), l = {
207
207
  ...H,
208
- thumbnail: c,
209
- size: e.size,
208
+ thumbnail: s,
209
+ size: i.size,
210
210
  date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
211
- type: o,
211
+ type: a,
212
212
  folderId: H.folderId || "",
213
- name: H.name || n,
214
- extension: H.extension || (H.name || n).split(".").pop()?.toLowerCase() || ""
213
+ name: H.name || t,
214
+ extension: H.extension || (H.name || t).split(".").pop()?.toLowerCase() || ""
215
215
  };
216
- s = l;
217
- let u = await a(l, {
218
- blob: e,
219
- mimeType: o,
220
- thumbnail: c,
221
- mode: i
216
+ c = l;
217
+ let u = await o(l, {
218
+ blob: i,
219
+ mimeType: a,
220
+ thumbnail: s,
221
+ mode: r
222
222
  });
223
223
  if (u) return N(!1), u;
224
- throw Error(S(i === "saveCopy" ? "Failed to save image copy" : "Failed to save changes"));
225
- } catch (t) {
226
- console.error("Error saving:", t);
227
- let r = s ?? o;
228
- if (!t?.notificationShown) {
229
- let a = e(t), o = f(a?.code, S) ?? a?.message ?? S(i === "saveCopy" ? "Failed to save image copy" : "Error saving image");
224
+ throw Error(x(r === "saveCopy" ? "Failed to save image copy" : "Failed to save changes"));
225
+ } catch (e) {
226
+ console.error("Error saving:", e);
227
+ let n = c ?? s;
228
+ if (!e?.notificationShown) {
229
+ let o = i(e), s = a(o?.code, x) ?? o?.message ?? x(r === "saveCopy" ? "Failed to save image copy" : "Error saving image");
230
230
  T.error({
231
- id: i === "saveCopy" ? "IMAGE_SAVE_COPY_FAILED" : "IMAGE_SAVE_FAILED",
232
- message: o,
231
+ id: r === "saveCopy" ? "IMAGE_SAVE_COPY_FAILED" : "IMAGE_SAVE_FAILED",
232
+ message: s,
233
233
  placement: "bottomRight",
234
234
  data: {
235
- itemId: r?.id ?? void 0,
236
- itemName: r?.name ?? n,
237
- folderId: r?.folderId ?? null,
238
- thumbnail: r?.thumbnail
235
+ itemId: n?.id ?? void 0,
236
+ itemName: n?.name ?? t,
237
+ folderId: n?.folderId ?? null,
238
+ thumbnail: n?.thumbnail
239
239
  },
240
- innerException: t
240
+ innerException: e
241
241
  });
242
242
  }
243
243
  N(!1);
@@ -246,21 +246,21 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
246
246
  H,
247
247
  T,
248
248
  X,
249
- S
250
- ]), Q = h.useCallback(async (e) => {
251
- if (!C.isLoaded() || !H) {
249
+ x
250
+ ]), Q = m.useCallback(async (e) => {
251
+ if (!S.isLoaded() || !H) {
252
252
  console.error("❌ Pixie instance or file is missing");
253
253
  return;
254
254
  }
255
255
  q.current = e;
256
- let t = H.name || "edited-image", n = a(H, I);
256
+ let n = H.name || "edited-image", r = f(H, I);
257
257
  try {
258
- await C.tools?.export.save(t.replace(/\.[^/.]+$/, ""), n.pixieFormat, p.QUALITY);
259
- } catch (r) {
260
- console.error("🎨 Error saving through the button:", r);
258
+ await S.tools?.export.save(n.replace(/\.[^/.]+$/, ""), r.pixieFormat, t.QUALITY);
259
+ } catch (t) {
260
+ console.error("🎨 Error saving through the button:", t);
261
261
  try {
262
- let r = C.canvas, i = r ? r.toDataURL(n.mimeType) : null;
263
- i && await Z(i, t, n.extension, e);
262
+ let t = S.canvas, i = t ? t.toDataURL(r.mimeType) : null;
263
+ i && await Z(i, n, r.extension, e);
264
264
  } catch (e) {
265
265
  console.error("🎨 Alternative method also did not work:", e);
266
266
  }
@@ -269,24 +269,24 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
269
269
  H,
270
270
  I,
271
271
  Z
272
- ]), $ = h.useCallback(async () => {
273
- if (!(!P || !n || !R || W.current)) try {
272
+ ]), $ = m.useCallback(async () => {
273
+ if (!(!P || !c || !R || W.current)) try {
274
274
  W.current = !0;
275
- let e = w.current, t = 0;
276
- for (; t < 20 && (e.clientWidth === 0 || e.clientHeight === 0);) await new Promise((e) => setTimeout(e, 50)), t++;
277
- let n = O?.locale ? O?.locale.replace("_", "-") : "en", r = matchMedia("(prefers-color-scheme: dark)").matches ? l : c, i = O?.theme === "system" ? r : O?.theme, o = (O?.locale || D.language || "en").split("-")[0].split("_")[0], s = (D.getResourceBundle(o, "translation") || {}).pixie || {}, u = (e) => e.split(" ").map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" "), d = {};
275
+ let e = C.current, n = 0;
276
+ for (; n < 20 && (e.clientWidth === 0 || e.clientHeight === 0);) await new Promise((e) => setTimeout(e, 50)), n++;
277
+ let r = O?.locale ? O?.locale.replace("_", "-") : "en", i = matchMedia("(prefers-color-scheme: dark)").matches ? ee : d, a = O?.theme === "system" ? i : O?.theme, o = (O?.locale || D.language || "en").split("-")[0].split("_")[0], s = (D.getResourceBundle(o, "translation") || {}).pixie || {}, c = (e) => e.split(" ").map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" "), l = {};
278
278
  Object.entries(s).forEach(([e, t]) => {
279
- let n = u(e);
280
- d[n] = t, d[e] = t;
279
+ let n = c(e);
280
+ l[n] = t, l[e] = t;
281
281
  });
282
- let f = { [n]: d }, m = a(H, I), h = {
282
+ let u = { [r]: l }, p = f(H, I), m = {
283
283
  selector: "#pixie-editor",
284
- baseUrl: ee(O?.baseUrl || "", O?.assetsUrl || "assets/image-editor"),
284
+ baseUrl: te(O?.baseUrl || "", O?.assetsUrl || "assets/image-editor"),
285
285
  image: P,
286
- activeLanguage: n,
287
- languages: f,
286
+ activeLanguage: r,
287
+ languages: u,
288
288
  ui: {
289
- activeTheme: i,
289
+ activeTheme: a,
290
290
  mode: "inline",
291
291
  forceOverlayModeOnMobile: !1,
292
292
  visible: !0,
@@ -307,17 +307,17 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
307
307
  type: "button",
308
308
  align: "right",
309
309
  desktopOnly: !0,
310
- icon: () => /* @__PURE__ */ _(ie, { style: { fontSize: 20 } }),
310
+ icon: () => /* @__PURE__ */ g(ae, { style: { fontSize: 20 } }),
311
311
  action: (e) => {
312
312
  e.togglePanel("history");
313
313
  }
314
314
  },
315
315
  {
316
316
  type: "button",
317
- icon: () => /* @__PURE__ */ _(re, { style: { fontSize: 20 } }),
317
+ icon: () => /* @__PURE__ */ g(ie, { style: { fontSize: 20 } }),
318
318
  align: "right",
319
319
  desktopOnly: !0,
320
- action: v
320
+ action: _
321
321
  }
322
322
  ]
323
323
  },
@@ -325,8 +325,8 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
325
325
  },
326
326
  tools: {
327
327
  export: {
328
- defaultFormat: m.pixieFormat,
329
- defaultQuality: p.QUALITY,
328
+ defaultFormat: p.pixieFormat,
329
+ defaultQuality: t.QUALITY,
330
330
  defaultName: H?.name?.replace(/\.[^/.]+$/, "") || "image"
331
331
  },
332
332
  text: {
@@ -457,8 +457,8 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
457
457
  }
458
458
  };
459
459
  try {
460
- V(!1), await C.show(h, w.current);
461
- let e = C.canvas;
460
+ V(!1), await S.show(m, C.current);
461
+ let e = S.canvas;
462
462
  e && e.focus(), V(!0), N(!1);
463
463
  } catch (e) {
464
464
  console.error("init pixie failed:", e);
@@ -466,38 +466,38 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
466
466
  } catch (e) {
467
467
  console.error("Error initializing Pixie:", e), T.error({
468
468
  id: "EDITOR_INIT_FAILED",
469
- message: S("Error initializing editor"),
469
+ message: x("Error initializing editor"),
470
470
  placement: "bottomRight",
471
471
  innerException: e
472
- }), W.current = !1, v?.();
472
+ }), W.current = !1, _?.();
473
473
  }
474
474
  }, [
475
475
  H,
476
476
  I,
477
477
  P,
478
- n,
478
+ c,
479
479
  R,
480
480
  O?.locale,
481
481
  O?.theme,
482
482
  O?.baseUrl,
483
483
  O?.assetsUrl,
484
- v,
484
+ _,
485
485
  Z,
486
486
  T,
487
487
  D,
488
- S
488
+ x
489
489
  ]);
490
- h.useEffect(() => {
491
- n && P && R && $();
490
+ m.useEffect(() => {
491
+ c && P && R && $();
492
492
  }, [
493
- n,
493
+ c,
494
494
  P,
495
495
  R,
496
496
  $
497
- ]), h.useEffect(() => {
498
- if (!n) {
497
+ ]), m.useEffect(() => {
498
+ if (!c) {
499
499
  try {
500
- C.close();
500
+ S.close();
501
501
  } catch (e) {
502
502
  console.warn("Error closing Pixie:", e);
503
503
  }
@@ -505,18 +505,18 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
505
505
  }
506
506
  return () => {
507
507
  try {
508
- C.close();
508
+ S.close();
509
509
  } catch (e) {
510
510
  console.warn("Error closing Pixie when unmounting:", e);
511
511
  }
512
512
  };
513
- }, [n]);
513
+ }, [c]);
514
514
  let le = !!H?.id && O?.features?.enableUpdateFile !== !1;
515
- return /* @__PURE__ */ _(te, {
516
- title: H?.name ? S("Editing: {{name}}", { name: H.name }) : S("Editing image"),
517
- open: n,
515
+ return /* @__PURE__ */ g(ne, {
516
+ title: H?.name ? x("Editing: {{name}}", { name: H.name }) : x("Editing image"),
517
+ open: c,
518
518
  closeIcon: null,
519
- onCancel: v,
519
+ onCancel: _,
520
520
  afterOpenChange: (e) => z(e),
521
521
  forceRender: !0,
522
522
  width: "100vw",
@@ -532,22 +532,22 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
532
532
  padding: 0
533
533
  } },
534
534
  footer: [
535
- /* @__PURE__ */ _(g, {
536
- onClick: v,
535
+ /* @__PURE__ */ g(h, {
536
+ onClick: _,
537
537
  disabled: !R || M,
538
- children: S("Cancel")
538
+ children: x("Cancel")
539
539
  }, "cancel"),
540
- /* @__PURE__ */ _(g, {
540
+ /* @__PURE__ */ g(h, {
541
541
  type: "primary",
542
542
  onClick: () => Q("saveCopy"),
543
543
  loading: M,
544
- children: S("Save as copy and choose")
544
+ children: x("Save as copy and choose")
545
545
  }, "save-copy"),
546
- ...le ? [/* @__PURE__ */ _(g, {
546
+ ...le ? [/* @__PURE__ */ g(h, {
547
547
  type: "primary",
548
548
  onClick: () => Q("save"),
549
549
  loading: M,
550
- children: S("Save and choose")
550
+ children: x("Save and choose")
551
551
  }, "save")] : []
552
552
  ],
553
553
  mask: { closable: !1 },
@@ -555,14 +555,14 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
555
555
  afterClose: () => {
556
556
  k && k("");
557
557
  },
558
- children: /* @__PURE__ */ ne("div", {
559
- ref: w,
558
+ children: /* @__PURE__ */ re("div", {
559
+ ref: C,
560
560
  style: {
561
561
  position: "relative",
562
562
  width: "100%",
563
563
  height: "100%"
564
564
  },
565
- children: [n && !B ? /* @__PURE__ */ _("div", {
565
+ children: [c && !B ? /* @__PURE__ */ g("div", {
566
566
  style: {
567
567
  position: "absolute",
568
568
  inset: 0,
@@ -574,14 +574,14 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
574
574
  pointerEvents: "all",
575
575
  zIndex: 10
576
576
  },
577
- children: /* @__PURE__ */ _("span", {
577
+ children: /* @__PURE__ */ g("span", {
578
578
  style: {
579
579
  fontSize: 14,
580
580
  color: "#555"
581
581
  },
582
- children: S("Loading editor...")
582
+ children: x("Loading editor...")
583
583
  })
584
- }) : null, M && B && /* @__PURE__ */ _(m, { style: {
584
+ }) : null, M && B && /* @__PURE__ */ g(p, { style: {
585
585
  position: "absolute",
586
586
  top: 0,
587
587
  background: "var(--em-colorBgLayout)",
@@ -594,4 +594,4 @@ var T = ({ visible: n, onClose: v, file: y, onSave: b, onSaveCopy: x }) => {
594
594
  //#endregion
595
595
  export { T as PixieEditor };
596
596
 
597
- //# sourceMappingURL=file-manager-PixieEditor-BRUKJkjp.js.map
597
+ //# sourceMappingURL=file-manager-PixieEditor-Doy__jUq.js.map