@emailmaker/emailmaker 1.1.65 → 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.
Files changed (195) hide show
  1. package/README.md +1 -1
  2. package/assets/images/project-settings-inbox-envelope.png +0 -0
  3. package/assets/images/project-settings-plugin-support-avatar.png +0 -0
  4. package/{emailmaker-core.ec746d58.js → emailmaker-core.ce3741e5.js} +8 -8
  5. package/emailmaker-esm.js +23 -20
  6. package/emailmaker-po.ce3741e5.js +5945 -0
  7. package/emailmaker.d.ts +36 -525
  8. package/emailmaker.js +3 -3
  9. package/fileManager.d.ts +519 -0
  10. package/iframe/css/sandbox-dark.css +1 -1
  11. package/iframe/css/sandbox-darktheme.css +1 -1
  12. package/iframe/css/sandbox-light.css +1 -1
  13. package/iframe/css/sandbox.css +112 -89
  14. package/iframe/js/amp.D4LpeCG3.js +1 -0
  15. package/iframe/js/iframe-eblock.js +1 -1
  16. package/iframe/js/iframe.js +1 -1
  17. package/iframe/js/rules.B-wCbIo7.js +1 -1
  18. package/npm-publish.manifest.json +15 -7
  19. package/package.json +4 -1
  20. package/runtime/THIRD_PARTY_LICENSES.txt +1 -1
  21. package/static/core/{8b25ab0f2.js → 0eb6825f2.js} +3 -3
  22. package/static/core/{14bac801.js → 10343d072.js} +32 -32
  23. package/static/core/{89a7f5e22.js → 11ecb3732.js} +3 -3
  24. package/static/core/13d868f1.js +2119 -0
  25. package/static/core/{e3282461.js → 14b57b51.js} +5 -5
  26. package/static/core/{d06b7a22.js → 1537984c.js} +5 -5
  27. package/static/core/{ff54d2c22.js → 15e90aa1.js} +3 -3
  28. package/static/core/18d7246c.js +11437 -0
  29. package/static/core/{2d89e8f32.js → 1b3a7794.js} +3 -3
  30. package/static/core/{f1c452562.js → 1b815379.js} +3 -3
  31. package/static/core/{51a22b29.js → 1cdcd63d.js} +8 -8
  32. package/static/core/{b67fcff12.js → 1f0f8d052.js} +3 -3
  33. package/static/core/{227f9a41.js → 20ecbcb12.js} +9 -9
  34. package/static/core/{f62e420c.js → 2181dfc12.js} +4965 -4753
  35. package/static/core/{cbf00549.js → 2242ba4c.js} +3 -3
  36. package/static/core/{668756522.js → 225aa8cf2.js} +3 -3
  37. package/static/core/{fde5b48c.js → 2289d149.js} +7 -7
  38. package/static/core/{5c2a668f.js → 2569b2ec.js} +3 -3
  39. package/static/core/{b3b3281c2.js → 267d83c02.js} +3 -3
  40. package/static/core/{d8e8c189.js → 28c04df32.js} +3 -3
  41. package/static/core/{7144829c2.js → 290a5a3e.js} +3 -3
  42. package/static/core/{c6c12a4c2.js → 2bb9001a2.js} +3 -3
  43. package/static/core/2dd8b882.js +583 -0
  44. package/static/core/{d4fae48f2.js → 2eba2c3d2.js} +7 -7
  45. package/static/core/{e3f7dda5.js → 2f940a6e.js} +3 -3
  46. package/static/core/{29d379ee.js → 3137210f.js} +3 -3
  47. package/static/core/{3e444726.js → 319cf5c8.js} +173 -173
  48. package/static/core/{2d52ee4e2.js → 331100cc2.js} +3 -3
  49. package/static/core/{996d1d512.js → 33c2762f2.js} +3 -3
  50. package/static/core/{371b11182.js → 33ed2f102.js} +5 -5
  51. package/static/core/{fabe8bf6.js → 36878d5e.js} +3 -3
  52. package/static/core/{4e33c418.js → 378d1eee.js} +4 -4
  53. package/static/core/{15d6b9c02.js → 3b4ea1e02.js} +4 -4
  54. package/static/core/{7200aced.js → 3c5b0572.js} +3 -3
  55. package/static/core/{1ad06ad4.js → 3ca00db5.js} +3 -3
  56. package/static/core/{1d1b8fee.js → 3cf11ac9.js} +1846 -1847
  57. package/static/core/{ee605dd2.js → 3fa35a4a.js} +3 -3
  58. package/static/core/{73d8bc22.js → 413788c12.js} +6 -6
  59. package/static/core/{bae89f052.js → 42608663.js} +3 -3
  60. package/static/core/{707c11bf2.js → 43386b222.js} +5 -5
  61. package/static/core/{72806c12.js → 449b0f092.js} +5 -5
  62. package/static/core/{cffc0d1c.js → 45a5a8c32.js} +3 -3
  63. package/static/core/{3f7f42ec2.js → 46ee74792.js} +3 -3
  64. package/static/core/{c0fde0fe.js → 4905ac72.js} +3 -3
  65. package/static/core/{4e7df2bb.js → 4930a7d4.js} +20 -20
  66. package/static/core/4a3fcabb2.js +8956 -0
  67. package/static/core/{e47b96042.js → 4b6cd5362.js} +3 -3
  68. package/static/core/4c113afa.js +33627 -0
  69. package/static/core/4ca47ce1.js +22 -0
  70. package/static/core/{ffd09066.js → 4cf4cef0.js} +3 -3
  71. package/static/core/{58062cfb.js → 4d14fed2.js} +15 -15
  72. package/static/core/{46e22b84.js → 53bc27c1.js} +3 -3
  73. package/static/core/{3c9b91ec.js → 53e1b147.js} +17 -17
  74. package/static/core/53fb6a84.js +468 -0
  75. package/static/core/{60dc03552.js → 5466b5932.js} +3 -3
  76. package/static/core/{88d5dd5c2.js → 563426652.js} +3 -3
  77. package/static/core/{80d7bfb8.js → 569bf67b.js} +3 -3
  78. package/static/core/{f577dd74.js → 58755545.js} +3 -3
  79. package/static/core/{34a063a22.js → 5ab6d1fe2.js} +3 -3
  80. package/static/core/{bcf642bb2.js → 5ddd3b2f2.js} +13 -13
  81. package/static/core/{6df8804e.js → 5f203ce92.js} +8 -8
  82. package/static/core/{271a49fb.js → 5f6bab5a.js} +3 -3
  83. package/static/core/{aae0d578.js → 611fb42b2.js} +4 -4
  84. package/static/core/{af6b87cb.js → 618600ac.js} +3 -3
  85. package/static/core/{caf4f82e2.js → 632e1fd02.js} +43 -43
  86. package/static/core/{cec04bb12.js → 67371af1.js} +3 -3
  87. package/static/core/{e0369425.js → 67830da5.js} +640 -638
  88. package/static/core/{17432659.js → 68472e1c.js} +3 -3
  89. package/static/core/{9106dd642.js → 69a225e42.js} +3 -3
  90. package/static/core/69ce726e2.js +3251 -0
  91. package/static/core/{9d20ebd5.js → 6ae41b98.js} +4 -4
  92. package/static/core/{57dfc32e2.js → 6e7d7f79.js} +3 -3
  93. package/static/core/{a9e90b632.js → 72e7bba12.js} +5 -5
  94. package/static/core/{67a4e05c.js → 7569a429.js} +3 -3
  95. package/static/core/{35d38b9a.js → 75e4001f.js} +3 -3
  96. package/static/core/{364eb3852.js → 76dad1b82.js} +3 -3
  97. package/static/core/{d40acbef2.js → 792eec912.js} +5 -5
  98. package/static/core/{d3d2bbf4.js → 793710d0.js} +387 -385
  99. package/static/core/{f88178782.js → 7a29f2ca2.js} +3 -3
  100. package/static/core/7df48ae1.js +56 -0
  101. package/static/core/{f341769b.js → 8129560f.js} +3 -3
  102. package/static/core/{1d8d16e5.js → 8280ec49.js} +13 -13
  103. package/static/core/828e59c3.js +683 -0
  104. package/static/core/{2cfb56bd2.js → 86892434.js} +3 -3
  105. package/static/core/{3ee18f2b.js → 8c0912ba.js} +3 -3
  106. package/static/core/{4b2be4062.js → 8c376d26.js} +3 -3
  107. package/static/core/{b1e55882.js → 8d7ebc6e.js} +6 -6
  108. package/static/core/{cb05db0a2.js → 8e1070c9.js} +519 -523
  109. package/static/core/{dc6c47462.js → 8eaf2a78.js} +3 -3
  110. package/static/core/{ff1278ae2.js → 9083dd91.js} +3 -3
  111. package/static/core/{4d1a6fda.js → 92f7fcaf.js} +41520 -45391
  112. package/static/core/{144da511.js → 95c1e180.js} +241 -260
  113. package/static/core/9883f8862.js +39 -0
  114. package/static/core/{310a7e6a2.js → 99909d1c2.js} +6 -6
  115. package/static/core/{d95c732e.js → 9db17827.js} +3 -3
  116. package/static/core/{c48ee4d52.js → 9e7380e4.js} +10 -10
  117. package/static/core/{1dcbf663.js → a1277731.js} +3 -3
  118. package/static/core/{adf38d4b.js → a2b7e614.js} +3 -3
  119. package/static/core/{9c8553be.js → a5a25e092.js} +200 -192
  120. package/static/core/{5b4bfdc0.js → a6231152.js} +9 -9
  121. package/static/core/{319db1a52.js → a6a389a6.js} +3 -3
  122. package/static/core/{abbb437b2.js → acb6a6e7.js} +3 -3
  123. package/static/core/{89779037.js → acb8d0f5.js} +3 -3
  124. package/static/core/{7463de00.js → b1addbc3.js} +3 -3
  125. package/static/core/{93f3e6dc.js → b1bb0b5b.js} +5 -5
  126. package/static/core/b33e034e.js +49 -0
  127. package/static/core/{1bfa4a862.js → be477222.js} +3 -3
  128. package/static/core/{5964c48f2.js → c2ff6632.js} +3 -3
  129. package/static/core/{537db3fa2.js → c4bc67442.js} +6 -6
  130. package/static/core/{cf4af6152.js → c889a63f.js} +3 -3
  131. package/static/core/{9c9dde252.js → ca51b8dc2.js} +10 -10
  132. package/static/core/{6f213c532.js → cbe4dd062.js} +11 -11
  133. package/static/core/{149f1be2.js → cbed29852.js} +3 -3
  134. package/static/core/{d5363339.js → cca304812.js} +5 -5
  135. package/static/core/{d4c4a927.js → d076c7272.js} +3 -3
  136. package/static/core/{a53e376b.js → d28e9842.js} +134 -134
  137. package/static/core/{710ad006.js → d2975cfe.js} +3050 -2914
  138. package/static/core/{dc3e2e44.js → d6ca53ee.js} +3 -3
  139. package/static/core/{ee84fb29.js → d7c64097.js} +3 -3
  140. package/static/core/{e2f5fcb1.js → db9eabde.js} +7 -7
  141. package/static/core/{613bcc0a.js → dd6d3ae42.js} +120 -120
  142. package/static/core/e1dddb82.js +126 -0
  143. package/static/core/{aebb34822.js → e2a0a5402.js} +3 -3
  144. package/static/core/{3156997d.js → e6b7a22c.js} +3 -3
  145. package/static/core/{27702468.js → e700a71a2.js} +2018 -1808
  146. package/static/core/{a11cd5642.js → e73371cf.js} +3 -3
  147. package/static/core/{d1e45451.js → e7d36446.js} +5 -5
  148. package/static/core/{29051452.js → e8ccbcef.js} +3 -3
  149. package/static/core/{3a580bd62.js → eb8cf6d62.js} +3 -3
  150. package/static/core/{92d3d1a9.js → eb9f4ec02.js} +3 -3
  151. package/static/core/{575c1be3.js → ee440378.js} +3 -3
  152. package/static/core/{f63cbc642.js → f419b36f2.js} +3 -3
  153. package/static/core/{25988409.js → f5b378e4.js} +3 -3
  154. package/static/core/{8eb0b7cd.js → f5f707b8.js} +54 -54
  155. package/static/core/{c6db3a31.js → f679001c.js} +3 -3
  156. package/static/core/{95fa393a2.js → f6f67a712.js} +3 -3
  157. package/static/core/{9fc67893.js → f740b7ec2.js} +3 -3
  158. package/static/core/{6076ed7e.js → f98c6ce2.js} +4 -4
  159. package/static/core/fc878f95.js +61 -0
  160. package/static/core/{434c7eda2.js → fdf372f4.js} +4 -4
  161. package/static/media/image-editor/fonts/Rubik-Black.woff2 +0 -0
  162. package/static/media/image-editor/fonts/Rubik-Bold.woff2 +0 -0
  163. package/static/media/image-editor/fonts/Rubik-Light.woff2 +0 -0
  164. package/static/media/image-editor/fonts/Rubik-Regular.woff2 +0 -0
  165. package/static/media/image-editor/fonts/caveat-v23-cyrillic_latin-regular.woff2 +0 -0
  166. package/static/media/image-editor/fonts/commissioner-v24-cyrillic_latin-regular.woff2 +0 -0
  167. package/static/media/image-editor/fonts/inter-v20-cyrillic_latin-regular.woff2 +0 -0
  168. package/static/media/image-editor/fonts/oswald-v57-cyrillic_latin-regular.woff2 +0 -0
  169. package/static/media/image-editor/fonts/pacifico-v23-cyrillic_latin-regular.woff2 +0 -0
  170. package/static/media/image-editor/fonts/playfair-display-v40-cyrillic_latin-regular.woff2 +0 -0
  171. package/static/umd-runtime/ui-kit.js +1638 -1416
  172. package/test-font.otf +0 -0
  173. package/test-font.ttf +0 -0
  174. package/test-font.woff2 +0 -0
  175. package/two_step_headless_plugin.html +1 -1
  176. package/ui-kit/index.js +1317 -1104
  177. package/vite/index.cjs +4 -4
  178. package/vite/index.d.ts +4 -4
  179. package/vite/index.js +4 -4
  180. package/vite/pluginDev/index.cjs +2 -2
  181. package/vite/pluginDev/index.d.ts +12 -12
  182. package/vite/pluginDev/index.js +2 -2
  183. package/webpack/pluginDev/index.d.ts +12 -12
  184. package/iframe/js/amp.V09Q6hy6.js +0 -1
  185. package/static/core/1704ac6f.js +0 -12281
  186. package/static/core/1c2ae249.js +0 -2089
  187. package/static/core/30cfda89.js +0 -465
  188. package/static/core/3d6ea013.js +0 -43109
  189. package/static/core/4031d739.js +0 -93052
  190. package/static/core/57b7148c.js +0 -666
  191. package/static/core/6e7c1c68.js +0 -124
  192. package/static/core/c64d880f.js +0 -68
  193. package/static/core/cc1c5d33.js +0 -27
  194. /package/iframe/{iframe-eblock.ec746d58.html → iframe-eblock.ce3741e5.html} +0 -0
  195. /package/iframe/{iframe.ec746d58.html → iframe.ce3741e5.html} +0 -0
@@ -0,0 +1,583 @@
1
+ __emailmaker__.define("static/core/2dd8b882.js", [
2
+ "require",
3
+ "exports",
4
+ "module",
5
+ "static/core/7df48ae1.js",
6
+ "static/core/2181dfc12.js",
7
+ "static/core/b33e034e.js",
8
+ "static/core/4c113afa.js",
9
+ "react",
10
+ "antd",
11
+ "react/jsx-runtime",
12
+ "@ant-design/icons"
13
+ ], function(R, le, ve) {
14
+ const se = R("./7df48ae1.js"), d = R("./2181dfc12.js"), W = R("./b33e034e.js"), ce = R("./4c113afa.js");
15
+ let l = R("react");
16
+ l = se.__toESM(l);
17
+ let U = R("antd"), w = R("react/jsx-runtime"), $ = R("@ant-design/icons");
18
+ function fe(t, e, a, c, x, s) {
19
+ if (e.type === "linear") {
20
+ let n = t.createLinearGradient(a + e.coords.x1, c + e.coords.y1, a + e.coords.x2, c + e.coords.y2);
21
+ return e.colorStops.forEach((h) => n.addColorStop(h.offset, h.color)), n;
22
+ }
23
+ if (e.type === "radial") {
24
+ let n = t.createRadialGradient(a + e.coords.x1, c + e.coords.y1, e.coords.r1 ?? 0, a + e.coords.x2, c + e.coords.y2, e.coords.r2 ?? 0);
25
+ return e.colorStops.forEach((h) => n.addColorStop(h.offset, h.color)), n;
26
+ }
27
+ throw Error("Unknown gradient type");
28
+ }
29
+ function de(t) {
30
+ if (!this.backgroundColor) return;
31
+ let e = this._getNonTransformedDimensions(), a = -e.x / 2, c = -e.y / 2, x = e.x, s = e.y, n = this.backgroundColor;
32
+ if (typeof n == "string" || n instanceof CanvasGradient || n instanceof CanvasPattern) t.fillStyle = n, t.fillRect(a, c, x, s);
33
+ else if (typeof n == "object" && "type" in n && (n.type === "linear" || n.type === "radial")) t.fillStyle = fe(t, n, a, c, x, s), t.fillRect(a, c, x, s);
34
+ else if ("source" in n && (n.source instanceof HTMLImageElement || n.source instanceof HTMLCanvasElement)) if (n.repeat) {
35
+ let h = t.createPattern(n.source, n.repeat);
36
+ h && (t.fillStyle = h, t.fillRect(a, c, x, s));
37
+ } else t.drawImage(n.source, a, c, x, s);
38
+ this._removeShadow(t);
39
+ }
40
+ function ue(t) {
41
+ t.fabric && t.fabric.on("object:added", (e) => {
42
+ let a = e.target;
43
+ a && a.name === "text" && (a._renderBackground = de);
44
+ });
45
+ }
46
+ var H = "fm-pixie-editor", L = new class {
47
+ constructor() {
48
+ this._container = document.createElement("div"), this._instance = null, this._container.classList.add(H), this._container.style.width = "100%", this._container.style.height = "85vh", this._container.style.minHeight = "400px";
49
+ }
50
+ get className() {
51
+ return `.${H}`;
52
+ }
53
+ get canvas() {
54
+ return this._instance?.state.canvasRef?.current;
55
+ }
56
+ get tools() {
57
+ return this._instance?.tools;
58
+ }
59
+ isLoaded() {
60
+ return !!this._instance;
61
+ }
62
+ async _setConfig(t) {
63
+ this._instance ? await this._instance.resetEditor(t) : this._instance = await ce.Tf.init({
64
+ ...t,
65
+ selector: this.className
66
+ }), ue(this._instance);
67
+ }
68
+ async show(t, e, a = e.firstChild) {
69
+ e.insertBefore(this._container, a), await this._setConfig(t), this._instance.open();
70
+ }
71
+ close() {
72
+ this._container.parentNode?.removeChild(this._container);
73
+ }
74
+ }(), G = (t, e = "image/png") => fetch(`data:${e};base64,${t}`).then((a) => a.blob());
75
+ function me(t, e) {
76
+ if (t === "json") return new Blob([e], { type: "application/json" });
77
+ if (t === "svg") return new Blob([e], { type: "image/svg+xml" });
78
+ let a = `image/${t}`;
79
+ if (e.startsWith("data:")) {
80
+ let c = d.ae(e);
81
+ return c && c.startsWith("image/") && (a = c), G(e.replace(/data:image\/[^;]+;base64,/, ""), d.ie(a));
82
+ }
83
+ return G(e, d.ie(a));
84
+ }
85
+ function ge(t) {
86
+ return new Promise((e, a) => {
87
+ let c = new FileReader();
88
+ c.onload = () => e(c.result), c.onerror = () => a(c.error ?? Error("Failed to convert blob to data URL")), c.readAsDataURL(t);
89
+ });
90
+ }
91
+ var he = ({ visible: t, onClose: e, file: a, onSave: c, onSaveCopy: x }) => {
92
+ let { t: s } = d.Nn(), n = l.default.useRef(null), h = d.cr(), ye = d.Bi(), { options: Y, actions: pe } = d.V(), { i18n: O } = d.Nn(), { config: u } = Y, { setCurrentMenuFile: Q } = pe, { getFileData: V, resolveFileForEditByUrl: X } = ye, [F, p] = l.default.useState(!1), [C, Z] = l.default.useState(null), [N, J] = l.default.useState(""), [S, K] = l.default.useState(!1), [q, A] = l.default.useState(!1), [i, P] = l.default.useState(null), j = l.default.useRef(!1), ee = l.default.useRef(void 0), te = l.default.useRef(void 0), ae = l.default.useRef("saveCopy"), M = l.default.useRef(void 0);
93
+ ee.current = c, te.current = x, l.default.useEffect(() => {
94
+ a && !j.current && (async () => {
95
+ if (M.current !== a) {
96
+ if (typeof a == "object") {
97
+ P(a);
98
+ return;
99
+ }
100
+ M.current = a, p(!0);
101
+ try {
102
+ if (a.startsWith("data:")) P({
103
+ thumbnail: a,
104
+ saveWithoutFolder: !0
105
+ });
106
+ else {
107
+ let o = await X(a);
108
+ M.current === a && P(o);
109
+ }
110
+ } catch {
111
+ M.current === a && (M.current = null), e?.();
112
+ } finally {
113
+ p(!1);
114
+ }
115
+ }
116
+ })();
117
+ }, [
118
+ a,
119
+ e,
120
+ X
121
+ ]);
122
+ let ie = l.default.useCallback(async (o) => {
123
+ try {
124
+ if (typeof o.thumbnail == "string" && o.thumbnail.startsWith("data:")) return o.thumbnail;
125
+ let r = await V(o.id, !0);
126
+ if (!r) throw Error(s("Error loading image"));
127
+ return new Promise((g) => {
128
+ let f = new FileReader();
129
+ f.onload = () => g(f.result), f.readAsDataURL(r);
130
+ });
131
+ } catch (r) {
132
+ throw r;
133
+ }
134
+ }, [V, s]);
135
+ l.default.useEffect(() => {
136
+ if (!C && t && i) {
137
+ let o = !1;
138
+ return (async () => {
139
+ p(!0);
140
+ try {
141
+ let r = await ie(i);
142
+ if (!r || typeof r != "string" || r.trim() === "") throw Error("Invalid image data: empty or null");
143
+ if (!r.startsWith("data:")) throw Error("Invalid image data: not a valid data URL");
144
+ let g = r.match(/^data:([^;]+);base64,(.+)$/);
145
+ if (!g) throw Error("Invalid image data: malformed data URL format");
146
+ let [, f, m] = g;
147
+ if (!f.startsWith("image/")) throw Error(`Invalid image data: unsupported MIME type ${f}`);
148
+ if (m.length < 10) throw Error("Invalid image data: base64 content too short");
149
+ if (!/^[A-Za-z0-9+/]+=*$/.test(m)) throw Error("Invalid image data: corrupted base64 content");
150
+ if (!o) {
151
+ Z(r);
152
+ let v = d.Rr(i, "image/png");
153
+ J(v.mimeType);
154
+ }
155
+ } catch (r) {
156
+ o || (h.error({
157
+ id: "IMAGE_DOWNLOAD_FAILED",
158
+ innerException: r,
159
+ message: s("Error loading image"),
160
+ placement: "bottomRight",
161
+ data: {
162
+ itemId: i?.id ?? void 0,
163
+ itemName: i?.name ?? void 0,
164
+ folderId: i?.folderId ?? null,
165
+ thumbnail: i?.thumbnail
166
+ }
167
+ }), e?.());
168
+ } finally {
169
+ p(!1);
170
+ }
171
+ })(), () => {
172
+ o = !0;
173
+ };
174
+ }
175
+ }, [
176
+ i,
177
+ ie,
178
+ C,
179
+ e,
180
+ s,
181
+ t
182
+ ]);
183
+ let oe = l.default.useCallback(async (o, r, g) => {
184
+ let f = await me(g, o), m = d.ie(f.type || `image/${g}`), v = u?.compessorUrl ?? u?.compressorUrl;
185
+ if (m.startsWith("image/")) try {
186
+ let _ = await d._i(new File([f], r, { type: m }), {
187
+ maxSizeMB: u?.compressMaxSize,
188
+ maxWidthOrHeight: u?.compressMaxWidthOrHeight,
189
+ mimeType: m,
190
+ fileName: r,
191
+ libURL: v,
192
+ enableCompression: d.Hr(u, m)
193
+ });
194
+ f = _, m = _.type;
195
+ } catch {}
196
+ return {
197
+ blob: f,
198
+ mimeType: m,
199
+ thumbnailDataUrl: await ge(f)
200
+ };
201
+ }, [u]), T = l.default.useCallback(async (o, r, g, f) => {
202
+ let m = f === "save" ? ee.current : te.current;
203
+ if (!i || !m) return;
204
+ let v = typeof i == "object" && i ? i : null, _ = null;
205
+ try {
206
+ p(!0);
207
+ let { blob: E, mimeType: b, thumbnailDataUrl: k } = await oe(o, r, g), I = {
208
+ ...i,
209
+ thumbnail: k,
210
+ size: E.size,
211
+ date: new Date().toISOString().split("T")[0],
212
+ type: b,
213
+ folderId: i.folderId || "",
214
+ name: i.name || r,
215
+ extension: i.extension || (i.name || r).split(".").pop()?.toLowerCase() || ""
216
+ };
217
+ _ = I;
218
+ let D = await m(I, {
219
+ blob: E,
220
+ mimeType: b,
221
+ thumbnail: k,
222
+ mode: f
223
+ });
224
+ if (D) return p(!1), D;
225
+ throw Error(s(f === "saveCopy" ? "Failed to save image copy" : "Failed to save changes"));
226
+ } catch (E) {
227
+ let b = _ ?? v;
228
+ if (!E?.notificationShown) {
229
+ let k = d.U(E), I = d.H(k?.code, s) ?? k?.message ?? s(f === "saveCopy" ? "Failed to save image copy" : "Error saving image");
230
+ h.error({
231
+ id: f === "saveCopy" ? "IMAGE_SAVE_COPY_FAILED" : "IMAGE_SAVE_FAILED",
232
+ message: I,
233
+ placement: "bottomRight",
234
+ data: {
235
+ itemId: b?.id ?? void 0,
236
+ itemName: b?.name ?? r,
237
+ folderId: b?.folderId ?? null,
238
+ thumbnail: b?.thumbnail
239
+ },
240
+ innerException: E
241
+ });
242
+ }
243
+ p(!1);
244
+ }
245
+ }, [
246
+ i,
247
+ h,
248
+ oe,
249
+ s
250
+ ]), re = l.default.useCallback(async (o) => {
251
+ if (!L.isLoaded() || !i) return;
252
+ ae.current = o;
253
+ let r = i.name || "edited-image", g = d.Rr(i, N);
254
+ try {
255
+ await L.tools?.export.save(r.replace(/\.[^/.]+$/, ""), g.pixieFormat, d.zr.QUALITY);
256
+ } catch {
257
+ try {
258
+ let m = L.canvas, v = m ? m.toDataURL(g.mimeType) : null;
259
+ v && await T(v, r, g.extension, o);
260
+ } catch {}
261
+ }
262
+ }, [
263
+ i,
264
+ N,
265
+ T
266
+ ]), ne = l.default.useCallback(async () => {
267
+ if (!(!C || !t || !S || j.current)) try {
268
+ j.current = !0;
269
+ let o = n.current, r = 0;
270
+ for (; r < 20 && (o.clientWidth === 0 || o.clientHeight === 0);) await new Promise((y) => setTimeout(y, 50)), r++;
271
+ let g = u?.locale ? u?.locale.replace("_", "-") : "en", f = matchMedia("(prefers-color-scheme: dark)").matches ? d.C : d.S, m = u?.theme === "system" ? f : u?.theme, v = (u?.locale || O.language || "en").split("-")[0].split("_")[0], _ = (O.getResourceBundle(v, "translation") || {}).pixie || {}, E = (y) => y.split(" ").map((B) => B.charAt(0).toUpperCase() + B.slice(1).toLowerCase()).join(" "), b = {};
272
+ Object.entries(_).forEach(([y, B]) => {
273
+ let z = E(y);
274
+ b[z] = B, b[y] = B;
275
+ });
276
+ let k = { [g]: b }, I = d.Rr(i, N), D = {
277
+ selector: "#pixie-editor",
278
+ baseUrl: W.o(u?.baseUrl || "", u?.assetsUrl || "assets/image-editor"),
279
+ image: C,
280
+ activeLanguage: g,
281
+ languages: k,
282
+ ui: {
283
+ activeTheme: m,
284
+ mode: "inline",
285
+ forceOverlayModeOnMobile: !1,
286
+ visible: !0,
287
+ menubar: {
288
+ replaceDefaultItems: !0,
289
+ position: "top",
290
+ items: [
291
+ {
292
+ type: "undoWidget",
293
+ align: "left"
294
+ },
295
+ {
296
+ type: "zoomWidget",
297
+ align: "center",
298
+ desktopOnly: !0
299
+ },
300
+ {
301
+ type: "button",
302
+ align: "right",
303
+ desktopOnly: !0,
304
+ icon: () => (0, w.jsx)($.HistoryOutlined, { style: { fontSize: 20 } }),
305
+ action: (y) => {
306
+ y.togglePanel("history");
307
+ }
308
+ },
309
+ {
310
+ type: "button",
311
+ icon: () => (0, w.jsx)($.CloseOutlined, { style: { fontSize: 20 } }),
312
+ align: "right",
313
+ desktopOnly: !0,
314
+ action: e
315
+ }
316
+ ]
317
+ },
318
+ nav: { position: "top" }
319
+ },
320
+ tools: {
321
+ export: {
322
+ defaultFormat: I.pixieFormat,
323
+ defaultQuality: d.zr.QUALITY,
324
+ defaultName: i?.name?.replace(/\.[^/.]+$/, "") || "image"
325
+ },
326
+ text: {
327
+ replaceDefaultItems: !0,
328
+ defaultText: "Handwriting",
329
+ items: [
330
+ {
331
+ family: "Inter",
332
+ src: "fonts/inter-v20-cyrillic_latin-regular.woff2"
333
+ },
334
+ {
335
+ family: "Commissioner",
336
+ src: "fonts/commissioner-v24-cyrillic_latin-regular.woff2"
337
+ },
338
+ {
339
+ family: "Montserrat Light",
340
+ src: "fonts/Montserrat-Light.woff2"
341
+ },
342
+ {
343
+ family: "Montserrat Regular",
344
+ src: "fonts/Montserrat-Regular.woff2"
345
+ },
346
+ {
347
+ family: "Montserrat Bold",
348
+ src: "fonts/Montserrat-Bold.woff2"
349
+ },
350
+ {
351
+ family: "Montserrat Black",
352
+ src: "fonts/Montserrat-Black.woff2"
353
+ },
354
+ {
355
+ family: "Roboto Light",
356
+ src: "fonts/Roboto-Light.woff2"
357
+ },
358
+ {
359
+ family: "Roboto Regular",
360
+ src: "fonts/Roboto-Regular.woff2"
361
+ },
362
+ {
363
+ family: "Roboto Bold",
364
+ src: "fonts/Roboto-Bold.woff2"
365
+ },
366
+ {
367
+ family: "Roboto Black",
368
+ src: "fonts/Roboto-Black.woff2"
369
+ },
370
+ {
371
+ family: "Lato Light",
372
+ src: "fonts/Lato-Light.woff2"
373
+ },
374
+ {
375
+ family: "Lato Regular",
376
+ src: "fonts/Lato-Regular.woff2"
377
+ },
378
+ {
379
+ family: "Lato Bold",
380
+ src: "fonts/Lato-Bold.woff2"
381
+ },
382
+ {
383
+ family: "Lato Black",
384
+ src: "fonts/Lato-Black.woff2"
385
+ },
386
+ {
387
+ family: "Rubik Light",
388
+ src: "fonts/Rubik-Light.woff2"
389
+ },
390
+ {
391
+ family: "Rubik Regular",
392
+ src: "fonts/Rubik-Regular.woff2"
393
+ },
394
+ {
395
+ family: "Rubik Bold",
396
+ src: "fonts/Rubik-Bold.woff2"
397
+ },
398
+ {
399
+ family: "Rubik Black",
400
+ src: "fonts/Rubik-Black.woff2"
401
+ },
402
+ {
403
+ family: "Bebas Neue Light",
404
+ src: "fonts/BebasNeueLight.woff2"
405
+ },
406
+ {
407
+ family: "Bebas Neue Regular",
408
+ src: "fonts/BebasNeueRegular.woff2"
409
+ },
410
+ {
411
+ family: "Bebas Neue Book",
412
+ src: "fonts/BebasNeueBook.woff2"
413
+ },
414
+ {
415
+ family: "Bebas Neue Bold",
416
+ src: "fonts/BebasNeueBold.woff2"
417
+ },
418
+ {
419
+ family: "Fira Sans",
420
+ src: "fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2"
421
+ },
422
+ {
423
+ family: "Lobster",
424
+ src: "fonts/Lobster.woff2"
425
+ },
426
+ {
427
+ family: "Pacifico",
428
+ src: "fonts/pacifico-v23-cyrillic_latin-regular.woff2"
429
+ },
430
+ {
431
+ family: "Playfair Display",
432
+ src: "fonts/playfair-display-v40-cyrillic_latin-regular.woff2"
433
+ },
434
+ {
435
+ family: "Oswald",
436
+ src: "fonts/oswald-v57-cyrillic_latin-regular.woff2"
437
+ },
438
+ {
439
+ family: "Caveat",
440
+ src: "fonts/caveat-v23-cyrillic_latin-regular.woff2"
441
+ }
442
+ ]
443
+ }
444
+ },
445
+ onSave: async function(y, B, z) {
446
+ try {
447
+ return p(!0), await T(y, B, z, ae.current);
448
+ } catch (we) {
449
+ throw p(!1), we;
450
+ }
451
+ }
452
+ };
453
+ try {
454
+ A(!1), await L.show(D, n.current);
455
+ let y = L.canvas;
456
+ y && y.focus(), A(!0), p(!1);
457
+ } catch {}
458
+ } catch (o) {
459
+ h.error({
460
+ id: "EDITOR_INIT_FAILED",
461
+ message: s("Error initializing editor"),
462
+ placement: "bottomRight",
463
+ innerException: o
464
+ }), j.current = !1, e?.();
465
+ }
466
+ }, [
467
+ i,
468
+ N,
469
+ C,
470
+ t,
471
+ S,
472
+ u?.locale,
473
+ u?.theme,
474
+ u?.baseUrl,
475
+ u?.assetsUrl,
476
+ e,
477
+ T,
478
+ h,
479
+ O,
480
+ s
481
+ ]);
482
+ l.default.useEffect(() => {
483
+ t && C && S && ne();
484
+ }, [
485
+ t,
486
+ C,
487
+ S,
488
+ ne
489
+ ]), l.default.useEffect(() => {
490
+ if (!t) {
491
+ try {
492
+ L.close();
493
+ } catch {}
494
+ p(!1), Z(null), J(""), j.current = !1, K(!1), A(!1);
495
+ }
496
+ return () => {
497
+ try {
498
+ L.close();
499
+ } catch {}
500
+ };
501
+ }, [t]);
502
+ let be = !!i?.id && u?.features?.enableUpdateFile !== !1;
503
+ return (0, w.jsx)(U.Modal, {
504
+ title: i?.name ? s("Editing: {{name}}", { name: i.name }) : s("Editing image"),
505
+ open: t,
506
+ closeIcon: null,
507
+ onCancel: e,
508
+ afterOpenChange: (o) => K(o),
509
+ forceRender: !0,
510
+ width: "100vw",
511
+ getContainer: Y.getModalContainer,
512
+ style: {
513
+ top: 0,
514
+ height: "100vh",
515
+ maxWidth: "none",
516
+ padding: 10
517
+ },
518
+ styles: { body: {
519
+ height: "85vh",
520
+ padding: 0
521
+ } },
522
+ footer: [
523
+ (0, w.jsx)(U.Button, {
524
+ onClick: e,
525
+ disabled: !S || F,
526
+ children: s("Cancel")
527
+ }, "cancel"),
528
+ (0, w.jsx)(U.Button, {
529
+ type: "primary",
530
+ onClick: () => re("saveCopy"),
531
+ loading: F,
532
+ children: s("Save as copy and choose")
533
+ }, "save-copy"),
534
+ ...be ? [(0, w.jsx)(U.Button, {
535
+ type: "primary",
536
+ onClick: () => re("save"),
537
+ loading: F,
538
+ children: s("Save and choose")
539
+ }, "save")] : []
540
+ ],
541
+ mask: { closable: !1 },
542
+ destroyOnHidden: !1,
543
+ afterClose: () => {
544
+ Q && Q("");
545
+ },
546
+ children: (0, w.jsxs)("div", {
547
+ ref: n,
548
+ style: {
549
+ position: "relative",
550
+ width: "100%",
551
+ height: "100%"
552
+ },
553
+ children: [t && !q ? (0, w.jsx)("div", {
554
+ style: {
555
+ position: "absolute",
556
+ inset: 0,
557
+ display: "flex",
558
+ alignItems: "center",
559
+ justifyContent: "center",
560
+ background: "rgba(255,255,255,0.45)",
561
+ backdropFilter: "blur(1px)",
562
+ pointerEvents: "all",
563
+ zIndex: 10
564
+ },
565
+ children: (0, w.jsx)("span", {
566
+ style: {
567
+ fontSize: 14,
568
+ color: "#555"
569
+ },
570
+ children: s("Loading editor...")
571
+ })
572
+ }) : null, F && q && (0, w.jsx)(W.r, { style: {
573
+ position: "absolute",
574
+ top: 0,
575
+ background: "var(--em-colorBgLayout)",
576
+ zIndex: 100,
577
+ opacity: .7
578
+ } })]
579
+ })
580
+ });
581
+ };
582
+ le.PixieEditor = he;
583
+ });
@@ -1,14 +1,14 @@
1
- __emailmaker__.define("static/core/d4fae48f2.js", [
1
+ __emailmaker__.define("static/core/2eba2c3d2.js", [
2
2
  "require",
3
3
  "exports",
4
4
  "module",
5
- "static/core/c64d880f.js",
6
- "static/core/15d6b9c02.js",
7
- "static/core/707c11bf2.js",
8
- "static/core/bcf642bb2.js"
5
+ "static/core/7df48ae1.js",
6
+ "static/core/3b4ea1e02.js",
7
+ "static/core/43386b222.js",
8
+ "static/core/5ddd3b2f2.js"
9
9
  ], function(g, t, w) {
10
- g("./c64d880f.js");
11
- const s = g("./15d6b9c02.js"), m = g("./707c11bf2.js"), e = g("./bcf642bb2.js");
10
+ g("./7df48ae1.js");
11
+ const s = g("./3b4ea1e02.js"), m = g("./43386b222.js"), e = g("./5ddd3b2f2.js");
12
12
  var p = 120 * 1e3, c = class {
13
13
  constructor(a) {
14
14
  this._defaults = a, this._worker = null, this._client = null, this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 30 * 1e3), this._lastUsedTime = 0, this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker());
@@ -1,10 +1,10 @@
1
- __emailmaker__.define("static/core/e3f7dda5.js", [
1
+ __emailmaker__.define("static/core/2f940a6e.js", [
2
2
  "require",
3
3
  "exports",
4
4
  "module",
5
- "static/core/c64d880f.js"
5
+ "static/core/7df48ae1.js"
6
6
  ], function(t, e, n) {
7
- t("./c64d880f.js");
7
+ t("./7df48ae1.js");
8
8
  e.conf = {
9
9
  wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
10
10
  comments: {
@@ -1,10 +1,10 @@
1
- __emailmaker__.define("static/core/29d379ee.js", [
1
+ __emailmaker__.define("static/core/3137210f.js", [
2
2
  "require",
3
3
  "exports",
4
4
  "module",
5
- "static/core/710ad006.js"
5
+ "static/core/d2975cfe.js"
6
6
  ], function(f, r, I) {
7
- const o = f("./710ad006.js");
7
+ const o = f("./d2975cfe.js");
8
8
  var n = o.createState({
9
9
  invalidateBlockId: null,
10
10
  isCodeMode: !1,