@emailmaker/filemanager 0.10.103 → 1.1.69
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/.build-meta.json +5 -0
- package/assets/image-editor/fonts/Rubik-Black.woff2 +0 -0
- package/assets/image-editor/fonts/Rubik-Bold.woff2 +0 -0
- package/assets/image-editor/fonts/Rubik-Light.woff2 +0 -0
- package/assets/image-editor/fonts/Rubik-Regular.woff2 +0 -0
- package/assets/image-editor/fonts/caveat-v23-cyrillic_latin-regular.woff2 +0 -0
- package/assets/image-editor/fonts/commissioner-v24-cyrillic_latin-regular.woff2 +0 -0
- package/assets/image-editor/fonts/inter-v20-cyrillic_latin-regular.woff2 +0 -0
- package/assets/image-editor/fonts/oswald-v57-cyrillic_latin-regular.woff2 +0 -0
- package/assets/image-editor/fonts/pacifico-v23-cyrillic_latin-regular.woff2 +0 -0
- package/assets/image-editor/fonts/playfair-display-v40-cyrillic_latin-regular.woff2 +0 -0
- package/components/PixieEditor/PixieEditor.d.ts +1 -2
- package/components/PixieEditor/index.d.ts +4 -1
- package/core.d.ts +21 -0
- package/core.esm.js +2690 -0
- package/core.js +2 -0
- package/{file-manager-IconsTab-Cv51TWYV.js → file-manager-IconsTab-BPDaI1rw.js} +526 -518
- package/{file-manager-ImageCodeGenerator-DroVucLL.js → file-manager-ImageCodeGenerator-Bfcf-n-G.js} +14 -14
- package/{file-manager-JsBarcode-Cji_rnaG.js → file-manager-JsBarcode-CyaffT5b.js} +28 -29
- package/file-manager-PixieEditor-BRUKJkjp.js +597 -0
- package/{file-manager-browser-CweGvoKm.js → file-manager-browser-DDyRNDQk.js} +4 -4
- package/{file-manager-hooks-Dg-OcR_x.js → file-manager-hooks-aNT0w8kI.js} +2527 -2364
- package/{file-manager-rolldown-runtime-DtPi1Y-2.js → file-manager-rolldown-runtime-DAVfCfog.js} +11 -4
- package/file-manager-urls-DN9gaYil.js +37 -0
- package/{file-manager-useMediaListEngine-ByGmaaib.js → file-manager-useMediaListEngine-zkDk3m1H.js} +6 -6
- package/file-manager.css +1 -1
- package/file-manager.esm.js +2930 -3609
- package/file-manager.js +11 -11
- package/package.json +24 -1
- package/utils/iconCssVars.d.ts +12 -0
- package/utils/svgToPng.test.d.ts +1 -0
|
@@ -0,0 +1,597 @@
|
|
|
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";
|
|
8
|
+
//#region packages/file-manager/src/components/PixieEditor/backgroundColor.ts
|
|
9
|
+
function y(e, t, n, r, i, a) {
|
|
10
|
+
if (t.type === "linear") {
|
|
11
|
+
let i = e.createLinearGradient(n + t.coords.x1, r + t.coords.y1, n + t.coords.x2, r + t.coords.y2);
|
|
12
|
+
return t.colorStops.forEach((e) => i.addColorStop(e.offset, e.color)), i;
|
|
13
|
+
}
|
|
14
|
+
if (t.type === "radial") {
|
|
15
|
+
let i = e.createRadialGradient(n + t.coords.x1, r + t.coords.y1, t.coords.r1 ?? 0, n + t.coords.x2, r + t.coords.y2, t.coords.r2 ?? 0);
|
|
16
|
+
return t.colorStops.forEach((e) => i.addColorStop(e.offset, e.color)), i;
|
|
17
|
+
}
|
|
18
|
+
throw Error("Unknown gradient type");
|
|
19
|
+
}
|
|
20
|
+
function b(e) {
|
|
21
|
+
if (!this.backgroundColor) return;
|
|
22
|
+
let t = this._getNonTransformedDimensions(), n = -t.x / 2, r = -t.y / 2, i = t.x, a = t.y, o = this.backgroundColor;
|
|
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);
|
|
25
|
+
else if ("source" in o && (o.source instanceof HTMLImageElement || o.source instanceof HTMLCanvasElement)) if (o.repeat) {
|
|
26
|
+
let t = e.createPattern(o.source, o.repeat);
|
|
27
|
+
t && (e.fillStyle = t, e.fillRect(n, r, i, a));
|
|
28
|
+
} else e.drawImage(o.source, n, r, i, a);
|
|
29
|
+
this._removeShadow(e);
|
|
30
|
+
}
|
|
31
|
+
function x(e) {
|
|
32
|
+
if (!e.fabric) {
|
|
33
|
+
console.warn("Pixie fabric instance is not available");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
e.fabric.on("object:added", (e) => {
|
|
37
|
+
let t = e.target;
|
|
38
|
+
t && t.name === "text" && (t._renderBackground = b);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region packages/file-manager/src/components/PixieEditor/PixieController.tsx
|
|
43
|
+
var S = "fm-pixie-editor", C = new class {
|
|
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";
|
|
46
|
+
}
|
|
47
|
+
get className() {
|
|
48
|
+
return `.${S}`;
|
|
49
|
+
}
|
|
50
|
+
get canvas() {
|
|
51
|
+
return this._instance?.state.canvasRef?.current;
|
|
52
|
+
}
|
|
53
|
+
get tools() {
|
|
54
|
+
return this._instance?.tools;
|
|
55
|
+
}
|
|
56
|
+
isLoaded() {
|
|
57
|
+
return !!this._instance;
|
|
58
|
+
}
|
|
59
|
+
async _setConfig(e) {
|
|
60
|
+
this._instance ? await this._instance.resetEditor(e) : this._instance = await v.init({
|
|
61
|
+
...e,
|
|
62
|
+
selector: this.className
|
|
63
|
+
}), x(this._instance);
|
|
64
|
+
}
|
|
65
|
+
async show(e, t, n = t.firstChild) {
|
|
66
|
+
t.insertBefore(this._container, n), await this._setConfig(e), this._instance.open();
|
|
67
|
+
}
|
|
68
|
+
close() {
|
|
69
|
+
this._container.parentNode?.removeChild(this._container);
|
|
70
|
+
}
|
|
71
|
+
}(), w = (e, t = "image/png") => fetch(`data:${t};base64,${e}`).then((e) => e.blob());
|
|
72
|
+
function ae(e, t) {
|
|
73
|
+
if (e === "json") return new Blob([t], { type: "application/json" });
|
|
74
|
+
if (e === "svg") return new Blob([t], { type: "image/svg+xml" });
|
|
75
|
+
let r = `image/${e}`;
|
|
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));
|
|
79
|
+
}
|
|
80
|
+
return w(t, s(r));
|
|
81
|
+
}
|
|
82
|
+
function oe(e) {
|
|
83
|
+
return new Promise((t, n) => {
|
|
84
|
+
let r = new FileReader();
|
|
85
|
+
r.onload = () => t(r.result), r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to convert blob to data URL")), r.readAsDataURL(e);
|
|
86
|
+
});
|
|
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);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
J.current = y, N(!0);
|
|
98
|
+
try {
|
|
99
|
+
if (y.startsWith("data:")) U({
|
|
100
|
+
thumbnail: y,
|
|
101
|
+
saveWithoutFolder: !0
|
|
102
|
+
});
|
|
103
|
+
else {
|
|
104
|
+
let e = await j(y);
|
|
105
|
+
J.current === y && U(e);
|
|
106
|
+
}
|
|
107
|
+
} catch (e) {
|
|
108
|
+
console.error("Failed to load file for editor:", e), J.current === y && (J.current = null), v?.();
|
|
109
|
+
} finally {
|
|
110
|
+
N(!1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
})();
|
|
114
|
+
}, [
|
|
115
|
+
y,
|
|
116
|
+
v,
|
|
117
|
+
j
|
|
118
|
+
]);
|
|
119
|
+
let Y = h.useCallback(async (e) => {
|
|
120
|
+
try {
|
|
121
|
+
if (typeof e.thumbnail == "string" && e.thumbnail.startsWith("data:")) return e.thumbnail;
|
|
122
|
+
let t = await A(e.id, !0);
|
|
123
|
+
if (!t) throw Error(S("Error loading image"));
|
|
124
|
+
return new Promise((e) => {
|
|
125
|
+
let n = new FileReader();
|
|
126
|
+
n.onload = () => e(n.result), n.readAsDataURL(t);
|
|
127
|
+
});
|
|
128
|
+
} catch (e) {
|
|
129
|
+
throw console.error("Error getting the image data:", e), e;
|
|
130
|
+
}
|
|
131
|
+
}, [A, S]);
|
|
132
|
+
h.useEffect(() => {
|
|
133
|
+
if (!P && n && H) {
|
|
134
|
+
let e = !1;
|
|
135
|
+
return (async () => {
|
|
136
|
+
N(!0);
|
|
137
|
+
try {
|
|
138
|
+
let t = await Y(H);
|
|
139
|
+
if (!t || typeof t != "string" || t.trim() === "") throw Error("Invalid image data: empty or null");
|
|
140
|
+
if (!t.startsWith("data:")) throw Error("Invalid image data: not a valid data URL");
|
|
141
|
+
let n = t.match(/^data:([^;]+);base64,(.+)$/);
|
|
142
|
+
if (!n) throw Error("Invalid image data: malformed data URL format");
|
|
143
|
+
let [, r, i] = n;
|
|
144
|
+
if (!r.startsWith("image/")) throw Error(`Invalid image data: unsupported MIME type ${r}`);
|
|
145
|
+
if (i.length < 10) throw Error("Invalid image data: base64 content too short");
|
|
146
|
+
if (!/^[A-Za-z0-9+/]+=*$/.test(i)) throw Error("Invalid image data: corrupted base64 content");
|
|
147
|
+
if (!e) {
|
|
148
|
+
F(t);
|
|
149
|
+
let e = a(H, "image/png");
|
|
150
|
+
L(e.mimeType);
|
|
151
|
+
}
|
|
152
|
+
} catch (t) {
|
|
153
|
+
e || (T.error({
|
|
154
|
+
id: "IMAGE_DOWNLOAD_FAILED",
|
|
155
|
+
innerException: t,
|
|
156
|
+
message: S("Error loading image"),
|
|
157
|
+
placement: "bottomRight",
|
|
158
|
+
data: {
|
|
159
|
+
itemId: H?.id ?? void 0,
|
|
160
|
+
itemName: H?.name ?? void 0,
|
|
161
|
+
folderId: H?.folderId ?? null,
|
|
162
|
+
thumbnail: H?.thumbnail
|
|
163
|
+
}
|
|
164
|
+
}), v?.());
|
|
165
|
+
} finally {
|
|
166
|
+
N(!1);
|
|
167
|
+
}
|
|
168
|
+
})(), () => {
|
|
169
|
+
e = !0;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
}, [
|
|
173
|
+
H,
|
|
174
|
+
Y,
|
|
175
|
+
P,
|
|
176
|
+
v,
|
|
177
|
+
S,
|
|
178
|
+
n
|
|
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 }), {
|
|
184
|
+
maxSizeMB: O?.compressMaxSize,
|
|
185
|
+
maxWidthOrHeight: O?.compressMaxWidthOrHeight,
|
|
186
|
+
mimeType: a,
|
|
187
|
+
fileName: n,
|
|
188
|
+
libURL: o,
|
|
189
|
+
enableCompression: t(O, a)
|
|
190
|
+
});
|
|
191
|
+
i = e, a = e.type;
|
|
192
|
+
} catch (e) {
|
|
193
|
+
console.warn("Image preparation failed, using original:", e);
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
blob: i,
|
|
197
|
+
mimeType: a,
|
|
198
|
+
thumbnailDataUrl: await oe(i)
|
|
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;
|
|
204
|
+
try {
|
|
205
|
+
N(!0);
|
|
206
|
+
let { blob: e, mimeType: o, thumbnailDataUrl: c } = await X(t, n, r), l = {
|
|
207
|
+
...H,
|
|
208
|
+
thumbnail: c,
|
|
209
|
+
size: e.size,
|
|
210
|
+
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
211
|
+
type: o,
|
|
212
|
+
folderId: H.folderId || "",
|
|
213
|
+
name: H.name || n,
|
|
214
|
+
extension: H.extension || (H.name || n).split(".").pop()?.toLowerCase() || ""
|
|
215
|
+
};
|
|
216
|
+
s = l;
|
|
217
|
+
let u = await a(l, {
|
|
218
|
+
blob: e,
|
|
219
|
+
mimeType: o,
|
|
220
|
+
thumbnail: c,
|
|
221
|
+
mode: i
|
|
222
|
+
});
|
|
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");
|
|
230
|
+
T.error({
|
|
231
|
+
id: i === "saveCopy" ? "IMAGE_SAVE_COPY_FAILED" : "IMAGE_SAVE_FAILED",
|
|
232
|
+
message: o,
|
|
233
|
+
placement: "bottomRight",
|
|
234
|
+
data: {
|
|
235
|
+
itemId: r?.id ?? void 0,
|
|
236
|
+
itemName: r?.name ?? n,
|
|
237
|
+
folderId: r?.folderId ?? null,
|
|
238
|
+
thumbnail: r?.thumbnail
|
|
239
|
+
},
|
|
240
|
+
innerException: t
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
N(!1);
|
|
244
|
+
}
|
|
245
|
+
}, [
|
|
246
|
+
H,
|
|
247
|
+
T,
|
|
248
|
+
X,
|
|
249
|
+
S
|
|
250
|
+
]), Q = h.useCallback(async (e) => {
|
|
251
|
+
if (!C.isLoaded() || !H) {
|
|
252
|
+
console.error("❌ Pixie instance or file is missing");
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
q.current = e;
|
|
256
|
+
let t = H.name || "edited-image", n = a(H, I);
|
|
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);
|
|
261
|
+
try {
|
|
262
|
+
let r = C.canvas, i = r ? r.toDataURL(n.mimeType) : null;
|
|
263
|
+
i && await Z(i, t, n.extension, e);
|
|
264
|
+
} catch (e) {
|
|
265
|
+
console.error("🎨 Alternative method also did not work:", e);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}, [
|
|
269
|
+
H,
|
|
270
|
+
I,
|
|
271
|
+
Z
|
|
272
|
+
]), $ = h.useCallback(async () => {
|
|
273
|
+
if (!(!P || !n || !R || W.current)) try {
|
|
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 = {};
|
|
278
|
+
Object.entries(s).forEach(([e, t]) => {
|
|
279
|
+
let n = u(e);
|
|
280
|
+
d[n] = t, d[e] = t;
|
|
281
|
+
});
|
|
282
|
+
let f = { [n]: d }, m = a(H, I), h = {
|
|
283
|
+
selector: "#pixie-editor",
|
|
284
|
+
baseUrl: ee(O?.baseUrl || "", O?.assetsUrl || "assets/image-editor"),
|
|
285
|
+
image: P,
|
|
286
|
+
activeLanguage: n,
|
|
287
|
+
languages: f,
|
|
288
|
+
ui: {
|
|
289
|
+
activeTheme: i,
|
|
290
|
+
mode: "inline",
|
|
291
|
+
forceOverlayModeOnMobile: !1,
|
|
292
|
+
visible: !0,
|
|
293
|
+
menubar: {
|
|
294
|
+
replaceDefaultItems: !0,
|
|
295
|
+
position: "top",
|
|
296
|
+
items: [
|
|
297
|
+
{
|
|
298
|
+
type: "undoWidget",
|
|
299
|
+
align: "left"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
type: "zoomWidget",
|
|
303
|
+
align: "center",
|
|
304
|
+
desktopOnly: !0
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
type: "button",
|
|
308
|
+
align: "right",
|
|
309
|
+
desktopOnly: !0,
|
|
310
|
+
icon: () => /* @__PURE__ */ _(ie, { style: { fontSize: 20 } }),
|
|
311
|
+
action: (e) => {
|
|
312
|
+
e.togglePanel("history");
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
type: "button",
|
|
317
|
+
icon: () => /* @__PURE__ */ _(re, { style: { fontSize: 20 } }),
|
|
318
|
+
align: "right",
|
|
319
|
+
desktopOnly: !0,
|
|
320
|
+
action: v
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
},
|
|
324
|
+
nav: { position: "top" }
|
|
325
|
+
},
|
|
326
|
+
tools: {
|
|
327
|
+
export: {
|
|
328
|
+
defaultFormat: m.pixieFormat,
|
|
329
|
+
defaultQuality: p.QUALITY,
|
|
330
|
+
defaultName: H?.name?.replace(/\.[^/.]+$/, "") || "image"
|
|
331
|
+
},
|
|
332
|
+
text: {
|
|
333
|
+
replaceDefaultItems: !0,
|
|
334
|
+
defaultText: "Handwriting",
|
|
335
|
+
items: [
|
|
336
|
+
{
|
|
337
|
+
family: "Inter",
|
|
338
|
+
src: "fonts/inter-v20-cyrillic_latin-regular.woff2"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
family: "Commissioner",
|
|
342
|
+
src: "fonts/commissioner-v24-cyrillic_latin-regular.woff2"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
family: "Montserrat Light",
|
|
346
|
+
src: "fonts/Montserrat-Light.woff2"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
family: "Montserrat Regular",
|
|
350
|
+
src: "fonts/Montserrat-Regular.woff2"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
family: "Montserrat Bold",
|
|
354
|
+
src: "fonts/Montserrat-Bold.woff2"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
family: "Montserrat Black",
|
|
358
|
+
src: "fonts/Montserrat-Black.woff2"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
family: "Roboto Light",
|
|
362
|
+
src: "fonts/Roboto-Light.woff2"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
family: "Roboto Regular",
|
|
366
|
+
src: "fonts/Roboto-Regular.woff2"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
family: "Roboto Bold",
|
|
370
|
+
src: "fonts/Roboto-Bold.woff2"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
family: "Roboto Black",
|
|
374
|
+
src: "fonts/Roboto-Black.woff2"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
family: "Lato Light",
|
|
378
|
+
src: "fonts/Lato-Light.woff2"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
family: "Lato Regular",
|
|
382
|
+
src: "fonts/Lato-Regular.woff2"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
family: "Lato Bold",
|
|
386
|
+
src: "fonts/Lato-Bold.woff2"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
family: "Lato Black",
|
|
390
|
+
src: "fonts/Lato-Black.woff2"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
family: "Rubik Light",
|
|
394
|
+
src: "fonts/Rubik-Light.woff2"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
family: "Rubik Regular",
|
|
398
|
+
src: "fonts/Rubik-Regular.woff2"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
family: "Rubik Bold",
|
|
402
|
+
src: "fonts/Rubik-Bold.woff2"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
family: "Rubik Black",
|
|
406
|
+
src: "fonts/Rubik-Black.woff2"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
family: "Bebas Neue Light",
|
|
410
|
+
src: "fonts/BebasNeueLight.woff2"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
family: "Bebas Neue Regular",
|
|
414
|
+
src: "fonts/BebasNeueRegular.woff2"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
family: "Bebas Neue Book",
|
|
418
|
+
src: "fonts/BebasNeueBook.woff2"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
family: "Bebas Neue Bold",
|
|
422
|
+
src: "fonts/BebasNeueBold.woff2"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
family: "Fira Sans",
|
|
426
|
+
src: "fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
family: "Lobster",
|
|
430
|
+
src: "fonts/Lobster.woff2"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
family: "Pacifico",
|
|
434
|
+
src: "fonts/pacifico-v23-cyrillic_latin-regular.woff2"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
family: "Playfair Display",
|
|
438
|
+
src: "fonts/playfair-display-v40-cyrillic_latin-regular.woff2"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
family: "Oswald",
|
|
442
|
+
src: "fonts/oswald-v57-cyrillic_latin-regular.woff2"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
family: "Caveat",
|
|
446
|
+
src: "fonts/caveat-v23-cyrillic_latin-regular.woff2"
|
|
447
|
+
}
|
|
448
|
+
]
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
onSave: async function(e, t, n) {
|
|
452
|
+
try {
|
|
453
|
+
return N(!0), await Z(e, t, n, q.current);
|
|
454
|
+
} catch (e) {
|
|
455
|
+
throw console.error("🎨 PIXIE onSave ERROR:", e), N(!1), e;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
try {
|
|
460
|
+
V(!1), await C.show(h, w.current);
|
|
461
|
+
let e = C.canvas;
|
|
462
|
+
e && e.focus(), V(!0), N(!1);
|
|
463
|
+
} catch (e) {
|
|
464
|
+
console.error("init pixie failed:", e);
|
|
465
|
+
}
|
|
466
|
+
} catch (e) {
|
|
467
|
+
console.error("Error initializing Pixie:", e), T.error({
|
|
468
|
+
id: "EDITOR_INIT_FAILED",
|
|
469
|
+
message: S("Error initializing editor"),
|
|
470
|
+
placement: "bottomRight",
|
|
471
|
+
innerException: e
|
|
472
|
+
}), W.current = !1, v?.();
|
|
473
|
+
}
|
|
474
|
+
}, [
|
|
475
|
+
H,
|
|
476
|
+
I,
|
|
477
|
+
P,
|
|
478
|
+
n,
|
|
479
|
+
R,
|
|
480
|
+
O?.locale,
|
|
481
|
+
O?.theme,
|
|
482
|
+
O?.baseUrl,
|
|
483
|
+
O?.assetsUrl,
|
|
484
|
+
v,
|
|
485
|
+
Z,
|
|
486
|
+
T,
|
|
487
|
+
D,
|
|
488
|
+
S
|
|
489
|
+
]);
|
|
490
|
+
h.useEffect(() => {
|
|
491
|
+
n && P && R && $();
|
|
492
|
+
}, [
|
|
493
|
+
n,
|
|
494
|
+
P,
|
|
495
|
+
R,
|
|
496
|
+
$
|
|
497
|
+
]), h.useEffect(() => {
|
|
498
|
+
if (!n) {
|
|
499
|
+
try {
|
|
500
|
+
C.close();
|
|
501
|
+
} catch (e) {
|
|
502
|
+
console.warn("Error closing Pixie:", e);
|
|
503
|
+
}
|
|
504
|
+
N(!1), F(null), L(""), W.current = !1, z(!1), V(!1);
|
|
505
|
+
}
|
|
506
|
+
return () => {
|
|
507
|
+
try {
|
|
508
|
+
C.close();
|
|
509
|
+
} catch (e) {
|
|
510
|
+
console.warn("Error closing Pixie when unmounting:", e);
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
}, [n]);
|
|
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,
|
|
518
|
+
closeIcon: null,
|
|
519
|
+
onCancel: v,
|
|
520
|
+
afterOpenChange: (e) => z(e),
|
|
521
|
+
forceRender: !0,
|
|
522
|
+
width: "100vw",
|
|
523
|
+
getContainer: E.getModalContainer,
|
|
524
|
+
style: {
|
|
525
|
+
top: 0,
|
|
526
|
+
height: "100vh",
|
|
527
|
+
maxWidth: "none",
|
|
528
|
+
padding: 10
|
|
529
|
+
},
|
|
530
|
+
styles: { body: {
|
|
531
|
+
height: "85vh",
|
|
532
|
+
padding: 0
|
|
533
|
+
} },
|
|
534
|
+
footer: [
|
|
535
|
+
/* @__PURE__ */ _(g, {
|
|
536
|
+
onClick: v,
|
|
537
|
+
disabled: !R || M,
|
|
538
|
+
children: S("Cancel")
|
|
539
|
+
}, "cancel"),
|
|
540
|
+
/* @__PURE__ */ _(g, {
|
|
541
|
+
type: "primary",
|
|
542
|
+
onClick: () => Q("saveCopy"),
|
|
543
|
+
loading: M,
|
|
544
|
+
children: S("Save as copy and choose")
|
|
545
|
+
}, "save-copy"),
|
|
546
|
+
...le ? [/* @__PURE__ */ _(g, {
|
|
547
|
+
type: "primary",
|
|
548
|
+
onClick: () => Q("save"),
|
|
549
|
+
loading: M,
|
|
550
|
+
children: S("Save and choose")
|
|
551
|
+
}, "save")] : []
|
|
552
|
+
],
|
|
553
|
+
mask: { closable: !1 },
|
|
554
|
+
destroyOnHidden: !1,
|
|
555
|
+
afterClose: () => {
|
|
556
|
+
k && k("");
|
|
557
|
+
},
|
|
558
|
+
children: /* @__PURE__ */ ne("div", {
|
|
559
|
+
ref: w,
|
|
560
|
+
style: {
|
|
561
|
+
position: "relative",
|
|
562
|
+
width: "100%",
|
|
563
|
+
height: "100%"
|
|
564
|
+
},
|
|
565
|
+
children: [n && !B ? /* @__PURE__ */ _("div", {
|
|
566
|
+
style: {
|
|
567
|
+
position: "absolute",
|
|
568
|
+
inset: 0,
|
|
569
|
+
display: "flex",
|
|
570
|
+
alignItems: "center",
|
|
571
|
+
justifyContent: "center",
|
|
572
|
+
background: "rgba(255,255,255,0.45)",
|
|
573
|
+
backdropFilter: "blur(1px)",
|
|
574
|
+
pointerEvents: "all",
|
|
575
|
+
zIndex: 10
|
|
576
|
+
},
|
|
577
|
+
children: /* @__PURE__ */ _("span", {
|
|
578
|
+
style: {
|
|
579
|
+
fontSize: 14,
|
|
580
|
+
color: "#555"
|
|
581
|
+
},
|
|
582
|
+
children: S("Loading editor...")
|
|
583
|
+
})
|
|
584
|
+
}) : null, M && B && /* @__PURE__ */ _(m, { style: {
|
|
585
|
+
position: "absolute",
|
|
586
|
+
top: 0,
|
|
587
|
+
background: "var(--em-colorBgLayout)",
|
|
588
|
+
zIndex: 100,
|
|
589
|
+
opacity: .7
|
|
590
|
+
} })]
|
|
591
|
+
})
|
|
592
|
+
});
|
|
593
|
+
};
|
|
594
|
+
//#endregion
|
|
595
|
+
export { T as PixieEditor };
|
|
596
|
+
|
|
597
|
+
//# sourceMappingURL=file-manager-PixieEditor-BRUKJkjp.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./file-manager-rolldown-runtime-
|
|
1
|
+
import { t as e } from "./file-manager-rolldown-runtime-DAVfCfog.js";
|
|
2
2
|
//#region node_modules/qrcode/lib/can-promise.js
|
|
3
3
|
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
4
|
t.exports = function() {
|
|
@@ -793,7 +793,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
793
793
|
})), b = /* @__PURE__ */ e(((e, t) => {
|
|
794
794
|
var n = h();
|
|
795
795
|
function r(e) {
|
|
796
|
-
this.mode = n.BYTE,
|
|
796
|
+
this.mode = n.BYTE, typeof e == "string" ? this.data = new TextEncoder().encode(e) : this.data = new Uint8Array(e);
|
|
797
797
|
}
|
|
798
798
|
r.getBitsLength = function(e) {
|
|
799
799
|
return e * 8;
|
|
@@ -1120,7 +1120,7 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
1120
1120
|
};
|
|
1121
1121
|
}
|
|
1122
1122
|
e.getOptions = function(e) {
|
|
1123
|
-
e ||= {}, e.color
|
|
1123
|
+
e ||= {}, e.color ||= {};
|
|
1124
1124
|
let n = e.margin === void 0 || e.margin === null || e.margin < 0 ? 4 : e.margin, r = e.width && e.width >= 21 ? e.width : void 0, i = e.scale || 4;
|
|
1125
1125
|
return {
|
|
1126
1126
|
width: r,
|
|
@@ -1226,4 +1226,4 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
1226
1226
|
//#endregion
|
|
1227
1227
|
export default O();
|
|
1228
1228
|
|
|
1229
|
-
//# sourceMappingURL=file-manager-browser-
|
|
1229
|
+
//# sourceMappingURL=file-manager-browser-DDyRNDQk.js.map
|