@fde-desktop/fde-core 0.4.11 → 0.4.19

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 (132) hide show
  1. package/dist/{AppEmptyState-Boej96TB.js → AppEmptyState-BVfKZU-h.js} +1 -1
  2. package/dist/AppEmptyState-Z8_Cviti.cjs +1 -0
  3. package/dist/AppIcon-Czrtau6A.cjs +1 -0
  4. package/dist/{AppIcon-mtEoyzOb.js → AppIcon-aFNw89J2.js} +1 -1
  5. package/dist/AppMenuBar-38QtFTPk.cjs +1 -0
  6. package/dist/AppTempMemory-DAC62jiS.cjs +1 -0
  7. package/dist/AppTempMemory-DgUW6GaF.js +23 -0
  8. package/dist/CalendarApp-BYTyu089.js +9 -0
  9. package/dist/CalendarApp-DPOK4mqg.cjs +1 -0
  10. package/dist/{ColorPicker-WCeD3Wjf.js → ColorPicker-B76rCS2H.js} +1 -1
  11. package/dist/ColorPicker-BZqsPh3X.cjs +1 -0
  12. package/dist/CreateItemApp-B0IHL16b.cjs +1 -0
  13. package/dist/CreateItemApp-UUP2HAu2.js +149 -0
  14. package/dist/DeviceInfoApp-BPQyeVSd.js +162 -0
  15. package/dist/DeviceInfoApp-D2mS2OT-.cjs +1 -0
  16. package/dist/DownloadProgress-CpJguS8g.cjs +1 -0
  17. package/dist/FilePickerApp-ClmPw6lk.cjs +1 -0
  18. package/dist/{FilePickerApp-ClHuhm6Z.js → FilePickerApp-D7fERKbp.js} +1 -1
  19. package/dist/FilesApp-DhJbO8wg.js +191 -0
  20. package/dist/FilesApp-LbwRRR1i.cjs +1 -0
  21. package/dist/IconColorPicker-7rWNAiNQ.cjs +1 -0
  22. package/dist/IconColorPicker-DUIXSb5E.js +58 -0
  23. package/dist/ImageViewerApp-9T-V8uP5.cjs +1 -0
  24. package/dist/ImageViewerApp-ihqIwJ-L.js +68 -0
  25. package/dist/ImageViewerMenuBar-DmvZoZ03.cjs +1 -0
  26. package/dist/{ImageViewerMenuBar-BIsUokxV.js → ImageViewerMenuBar-ZeIKHdA-.js} +18 -19
  27. package/dist/MenuEditApp-DRKfmSIZ.js +361 -0
  28. package/dist/MenuEditApp-U7EqB5Rl.cjs +1 -0
  29. package/dist/MenuEditMenuBar-BE_cXaoG.cjs +1 -0
  30. package/dist/MenuEditMenuBar-Df1je7F6.js +59 -0
  31. package/dist/NotesApp-DZfNQ8mN.cjs +1 -0
  32. package/dist/NotesApp-rwAeXyJy.js +344 -0
  33. package/dist/{NotesMenuBar-DILZTjnT.js → NotesMenuBar-C503t5pu.js} +12 -13
  34. package/dist/NotesMenuBar-CwgZ9dHy.cjs +1 -0
  35. package/dist/PdfApp-DNZaSXbF.cjs +1 -0
  36. package/dist/PdfApp-K1Z612o3.js +38 -0
  37. package/dist/PdfMenuBar-BPzP_JUO.cjs +1 -0
  38. package/dist/PdfMenuBar-DEUKgKTE.js +38 -0
  39. package/dist/SettingsApp-DdWqiYFE.cjs +1 -0
  40. package/dist/SettingsApp-ghc3RaMv.js +875 -0
  41. package/dist/SettingsMenuBar-C4KAPoBs.js +41 -0
  42. package/dist/SettingsMenuBar-CgmaF9_B.cjs +1 -0
  43. package/dist/{UploaderApp-CbypD538.js → UploaderApp-D9vfOR0S.js} +28 -40
  44. package/dist/UploaderApp-omSY-NSn.cjs +1 -0
  45. package/dist/VscIcon-CeELixwP.cjs +1 -0
  46. package/dist/buildBreadcrumbs-C2c2a4R3.cjs +1 -0
  47. package/dist/desktopStore-LSQweOqZ.cjs +1 -0
  48. package/dist/{desktopStore-8cSZlj7s.js → desktopStore-xnNbYaYm.js} +263 -263
  49. package/dist/formatBytes-Bv1bQPKQ.cjs +1 -0
  50. package/dist/formatBytes-CaP80WnM.js +14 -0
  51. package/dist/i18nConstants-DgbKSBIK.cjs +1 -0
  52. package/dist/i18nConstants-Nzpf2IFp.js +611 -0
  53. package/dist/imageViewerStore-CYt4R4e4.cjs +1 -0
  54. package/dist/index.cjs +1 -1
  55. package/dist/index.css +1 -1
  56. package/dist/index.d.ts +50 -29
  57. package/dist/index.js +715 -658
  58. package/dist/menuEditStore-sU6qaF2j.cjs +1 -0
  59. package/dist/notesStore-BnMXBRaV.cjs +1 -0
  60. package/dist/settingsAppStore-CQ4JHd7Q.cjs +1 -0
  61. package/dist/useAdaptiveDimensions-BDZxP4E3.cjs +1 -0
  62. package/dist/{useAdaptiveDimensions-DxNLJ7R5.js → useAdaptiveDimensions-sv9lwqF_.js} +1 -1
  63. package/dist/useCloseInterceptor-AzfjUZgz.cjs +1 -0
  64. package/dist/{useCloseInterceptor-CIxhOZx1.js → useCloseInterceptor-Bwm4I0O8.js} +1 -1
  65. package/dist/useDeviceDetection-B9jjlate.js +37 -0
  66. package/dist/useDeviceDetection-CnxnQWIq.cjs +1 -0
  67. package/dist/useDragDrop-Bdwzk6VO.cjs +1 -0
  68. package/dist/useDragDrop-D2LtOEYC.js +139 -0
  69. package/dist/useDynamicIcon-Cg3B_Aeq.cjs +1 -0
  70. package/dist/useNotifications-CR9JLjtC.js +26 -0
  71. package/dist/useNotifications-rwLmJ7fI.cjs +1 -0
  72. package/dist/useOpenApp-BBZ_B7Pr.cjs +1 -0
  73. package/dist/{useOpenApp-DkZLFFCH.js → useOpenApp-DdEbOVby.js} +3 -3
  74. package/dist/useResolvedUrl-CgqjNxzw.js +389 -0
  75. package/dist/useResolvedUrl-Dz2AhrDV.cjs +1 -0
  76. package/package.json +1 -1
  77. package/dist/AppEmptyState-CLc00OOG.cjs +0 -1
  78. package/dist/AppIcon-C8vHUVcb.cjs +0 -1
  79. package/dist/AppMenuBar-CAlkNHjj.cjs +0 -1
  80. package/dist/CalendarApp-DOmjWbpl.js +0 -10
  81. package/dist/CalendarApp-Z0bCCYsK.cjs +0 -1
  82. package/dist/ColorPicker-CQRRwY-y.cjs +0 -1
  83. package/dist/CreateItemApp-BkFFFdX1.cjs +0 -1
  84. package/dist/CreateItemApp-DR8Y4bwo.js +0 -202
  85. package/dist/DeviceInfoApp-BXQ9uOwF.cjs +0 -1
  86. package/dist/DeviceInfoApp-I63mJRWy.js +0 -195
  87. package/dist/DownloadProgress-CkTGTf0z.cjs +0 -1
  88. package/dist/FilePickerApp-By6-vbag.cjs +0 -1
  89. package/dist/FilesApp-BC4UPNuw.cjs +0 -1
  90. package/dist/FilesApp-D8MqvC5X.js +0 -210
  91. package/dist/ImageViewerApp-B1niWF75.cjs +0 -1
  92. package/dist/ImageViewerApp-iojtyFEf.js +0 -69
  93. package/dist/ImageViewerMenuBar-BgzgSF3v.cjs +0 -1
  94. package/dist/MenuEditApp-BHptoJbz.cjs +0 -1
  95. package/dist/MenuEditApp-CJUbJaqh.js +0 -492
  96. package/dist/MenuEditMenuBar-CCOSPAUe.cjs +0 -1
  97. package/dist/MenuEditMenuBar-DnCL-kaZ.js +0 -60
  98. package/dist/NotesApp-BmQIBtJ2.cjs +0 -1
  99. package/dist/NotesApp-DJ2dGt4-.js +0 -364
  100. package/dist/NotesMenuBar-BzojwMtH.cjs +0 -1
  101. package/dist/PdfApp-IjY_GtnW.js +0 -39
  102. package/dist/PdfApp-krW8UI97.cjs +0 -1
  103. package/dist/PdfMenuBar-Bd5MTZcZ.js +0 -39
  104. package/dist/PdfMenuBar-DWD0Qa3F.cjs +0 -1
  105. package/dist/SettingsApp-BE22l5UP.cjs +0 -1
  106. package/dist/SettingsApp-BTFtTFY_.js +0 -1228
  107. package/dist/SettingsMenuBar-CZE2evG2.cjs +0 -1
  108. package/dist/SettingsMenuBar-ktC0viTd.js +0 -42
  109. package/dist/UploaderApp-D_qD3O70.cjs +0 -1
  110. package/dist/VscIcon-BYb_Soyy.cjs +0 -1
  111. package/dist/buildBreadcrumbs-Ccd8i11b.cjs +0 -1
  112. package/dist/desktopStore-C1jR6Fdb.cjs +0 -1
  113. package/dist/imageViewerStore-Dfylg59V.cjs +0 -1
  114. package/dist/menuEditStore-CYwtfD6H.cjs +0 -1
  115. package/dist/notesStore-CrWTO6oB.cjs +0 -1
  116. package/dist/rolldown-runtime-CAFD8bLK.js +0 -11
  117. package/dist/settingsAppStore-DuYZNeFf.cjs +0 -1
  118. package/dist/useAdaptiveDimensions-3Lz4X0Tc.cjs +0 -1
  119. package/dist/useCloseInterceptor-CdX-09Ib.cjs +0 -1
  120. package/dist/useDynamicIcon-CK6SjEv5.cjs +0 -1
  121. package/dist/useOpenApp-D-FOY88T.cjs +0 -1
  122. package/dist/useResolvedUrl-B6x4xy0x.js +0 -29
  123. package/dist/useResolvedUrl-Bb39DpVy.cjs +0 -1
  124. /package/dist/{Colors-CuABn2W4.js → Colors-BIj4g0eH.js} +0 -0
  125. /package/dist/{Colors-CNJbU7oq.cjs → Colors-PNt4eyR6.cjs} +0 -0
  126. /package/dist/{DownloadProgress-DnVASsv5.js → DownloadProgress-DBFA58C5.js} +0 -0
  127. /package/dist/{imageViewerStore-COrD02Zu.js → imageViewerStore-C6UgceP-.js} +0 -0
  128. /package/dist/{menuEditStore-CxsgLiQu.js → menuEditStore-DPqViGva.js} +0 -0
  129. /package/dist/{notesStore-Dgah46U5.js → notesStore-KZDXN6zx.js} +0 -0
  130. /package/dist/{settingsAppStore-DHZhi6Rl.js → settingsAppStore-Y7x3r6pV.js} +0 -0
  131. /package/dist/{useMenuBarUtils-DAap0ukp.cjs → useMenuBarUtils-BOnQYtKU.cjs} +0 -0
  132. /package/dist/{useMenuBarUtils-ChAfI7OA.js → useMenuBarUtils-DTPFK0IN.js} +0 -0
@@ -0,0 +1,875 @@
1
+ import { _ as e, a as t, c as n, f as r, g as i, h as a, i as o, l as s, n as c, p as l, r as u, s as d, u as f } from "./i18nConstants-Nzpf2IFp.js";
2
+ import { n as p, r as m, t as h, u as g } from "./useResolvedUrl-CgqjNxzw.js";
3
+ import { G as _, n as v, o as y } from "./desktopStore-xnNbYaYm.js";
4
+ import { t as b } from "./AppIcon-aFNw89J2.js";
5
+ import { i as ee } from "./useCloseInterceptor-Bwm4I0O8.js";
6
+ import { t as x } from "./Colors-BIj4g0eH.js";
7
+ import { t as S } from "./ColorPicker-B76rCS2H.js";
8
+ import { t as C } from "./DownloadProgress-DBFA58C5.js";
9
+ import { n as w } from "./FilePickerApp-D7fERKbp.js";
10
+ import { n as T } from "./settingsAppStore-Y7x3r6pV.js";
11
+ import { useCallback as E, useDeferredValue as D, useEffect as O, useRef as k, useState as A } from "react";
12
+ import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
13
+ import { Badge as P, Box as F, Button as I, Card as te, Group as L, Paper as R, Radio as z, ScrollArea as B, SegmentedControl as V, SimpleGrid as H, Slider as U, Stack as W, Text as G, TextInput as K, Tooltip as q, UnstyledButton as J } from "@mantine/core";
14
+ import { useTranslation as Y } from "react-i18next";
15
+ //#region src/components/Apps/SettingsApp/sections/WPModule/StaticWallpaperModule.tsx
16
+ var X = () => {
17
+ let { t } = Y("settings"), n = e((e) => e.wallpaper), r = e((e) => e.setWallpaper), i = e((e) => e.setWallpaperModule), [a, o] = A(""), [s, c] = A(!1), l = k(null), u = h(n ?? void 0), d = n !== null && g(n) ? m : u ?? m, f = E(async (e) => {
18
+ let t = e.target.files?.[0];
19
+ if (t) try {
20
+ r(await v.saveBlob(t)), i("default");
21
+ } catch (e) {
22
+ console.error("[StaticWallpaperModule] Failed to save wallpaper:", e);
23
+ }
24
+ }, [r, i]), p = E(() => {
25
+ let e = a.trim();
26
+ e && (r(e), i("default"));
27
+ }, [
28
+ a,
29
+ r,
30
+ i
31
+ ]), _ = E((e) => {
32
+ let t = e.url ? e.url.startsWith("idb://") ? e.url : `/${e.url}` : null;
33
+ t && (r(t), i("default")), c(!1);
34
+ }, [r, i]);
35
+ return /* @__PURE__ */ N(j, { children: [
36
+ /* @__PURE__ */ M("img", {
37
+ src: d,
38
+ alt: t("wallpaper.wallpaperPreview"),
39
+ style: {
40
+ width: "100%",
41
+ height: 180,
42
+ objectFit: "cover",
43
+ borderRadius: 8
44
+ }
45
+ }),
46
+ /* @__PURE__ */ N(L, { children: [
47
+ /* @__PURE__ */ M("input", {
48
+ ref: l,
49
+ type: "file",
50
+ accept: "image/*",
51
+ style: { display: "none" },
52
+ onChange: f,
53
+ "aria-label": t("wallpaper.uploadAria", { defaultValue: "Upload wallpaper file" })
54
+ }),
55
+ /* @__PURE__ */ M(I, {
56
+ variant: "light",
57
+ onClick: () => c(!0),
58
+ children: t("wallpaper.chooseFromImages")
59
+ }),
60
+ /* @__PURE__ */ M(I, {
61
+ variant: "light",
62
+ onClick: () => l.current?.click(),
63
+ children: t("wallpaper.uploadFromDisk")
64
+ })
65
+ ] }),
66
+ /* @__PURE__ */ N(L, {
67
+ align: "flex-end",
68
+ children: [/* @__PURE__ */ M(K, {
69
+ label: t("wallpaper.orEnterUrl"),
70
+ placeholder: "https://example.com/image.jpg",
71
+ value: a,
72
+ onChange: (e) => o(e.currentTarget.value),
73
+ style: { flex: 1 }
74
+ }), /* @__PURE__ */ M(I, {
75
+ onClick: p,
76
+ disabled: !a.trim(),
77
+ children: t("common:actions.apply")
78
+ })]
79
+ }),
80
+ /* @__PURE__ */ M(w, {
81
+ opened: s,
82
+ acceptedMimeTypes: ["image/*"],
83
+ onConfirm: _,
84
+ onCancel: () => c(!1)
85
+ })
86
+ ] });
87
+ }, ne = () => {
88
+ let t = e((e) => e.wallpaper), r = e((e) => e.wallpaperHasNoise), i = e((e) => e.wallpaperNoiseOpacity), a = e((e) => e.setWallpaper), o = e((e) => e.setWallpaperHasNoise), s = e((e) => e.setWallpaperNoiseOpacity), c = E((e) => {
89
+ a(e.wallpaperCSS), o(e.hasNoise), s(e.noiseOpacity);
90
+ }, [
91
+ a,
92
+ o,
93
+ s
94
+ ]);
95
+ return /* @__PURE__ */ M(n, {
96
+ value: t ?? "",
97
+ onChange: c,
98
+ hasNoiseInitial: r,
99
+ noiseOpacityInitial: i
100
+ });
101
+ }, re = () => {
102
+ let { t } = Y("settings"), n = e((e) => e.wallpaperModule), r = e((e) => e.wallpaper), i = e((e) => e.setWallpaper), a = e((e) => e.setWallpaperModule), o = k(""), s = E((e) => {
103
+ e === "gradient" ? (g(r ?? "") || (o.current = r ?? ""), i(p)) : i(o.current || m), a(e);
104
+ }, [
105
+ r,
106
+ i,
107
+ a
108
+ ]), c = E(() => {
109
+ i(p), a("gradient");
110
+ }, [i, a]);
111
+ return /* @__PURE__ */ N(d, {
112
+ title: t("wallpaper.title"),
113
+ children: [
114
+ /* @__PURE__ */ M("div", { children: /* @__PURE__ */ M(V, {
115
+ value: n,
116
+ onChange: s,
117
+ data: [{
118
+ value: "default",
119
+ label: t("wallpaper.staticImage")
120
+ }, {
121
+ value: "gradient",
122
+ label: t("wallpaper.gradient") ?? "Gradient"
123
+ }],
124
+ fullWidth: !0
125
+ }) }),
126
+ M(n === "gradient" ? ne : X, {}),
127
+ /* @__PURE__ */ M(I, {
128
+ color: "red",
129
+ onClick: c,
130
+ children: t("wallpaper.resetToDefault")
131
+ })
132
+ ]
133
+ });
134
+ }, ie = () => {
135
+ let { t } = Y("settings"), n = e((e) => e.theme.mode), r = e((e) => e.themeSetManually), i = e((e) => e.customThemeColors), a = e((e) => e.animationDuration), o = e((e) => e.setThemeMode), s = e((e) => e.setThemeAutomatic), c = e((e) => e.setCustomThemeColors), l = e((e) => e.setAnimationDuration), u = i ? "custom" : r ? n : "system", d = E((e) => {
136
+ e === "system" ? (s(), c(null)) : e === "custom" ? c({
137
+ taskbar: "#339af0",
138
+ window: "#ffffff",
139
+ accent: "#339af0"
140
+ }) : (o(e), c(null));
141
+ }, [
142
+ o,
143
+ s,
144
+ c
145
+ ]), f = E((e) => (t) => {
146
+ i && c({
147
+ ...i,
148
+ [e]: t
149
+ });
150
+ }, [i, c]), p = E((e) => {
151
+ l(e);
152
+ }, [l]), m = u === "custom";
153
+ return /* @__PURE__ */ N(W, {
154
+ gap: "md",
155
+ p: "md",
156
+ children: [
157
+ /* @__PURE__ */ M(G, {
158
+ fw: 600,
159
+ size: "lg",
160
+ children: t("appearance.title")
161
+ }),
162
+ /* @__PURE__ */ M(G, {
163
+ size: "sm",
164
+ c: "dimmed",
165
+ children: t("appearance.description")
166
+ }),
167
+ /* @__PURE__ */ M(V, {
168
+ value: u,
169
+ onChange: d,
170
+ data: [
171
+ {
172
+ label: t("common:theme.light"),
173
+ value: "light"
174
+ },
175
+ {
176
+ label: t("common:theme.dark"),
177
+ value: "dark"
178
+ },
179
+ {
180
+ label: t("common:theme.system"),
181
+ value: "system"
182
+ },
183
+ {
184
+ label: t("common:theme.custom"),
185
+ value: "custom"
186
+ }
187
+ ],
188
+ "aria-label": t("appearance.themeMode", { defaultValue: "Theme mode" })
189
+ }),
190
+ /* @__PURE__ */ N(W, {
191
+ gap: "sm",
192
+ mt: "md",
193
+ children: [
194
+ /* @__PURE__ */ N(F, { children: [/* @__PURE__ */ M(G, {
195
+ size: "sm",
196
+ fw: 500,
197
+ mb: "xs",
198
+ c: m ? "dark" : void 0,
199
+ children: t("appearance.taskbar")
200
+ }), /* @__PURE__ */ M(S, {
201
+ value: i?.taskbar ?? "#339af0",
202
+ onChange: f("taskbar"),
203
+ disabled: !m
204
+ })] }),
205
+ /* @__PURE__ */ N(F, { children: [/* @__PURE__ */ M(G, {
206
+ size: "sm",
207
+ fw: 500,
208
+ mb: "xs",
209
+ c: m ? "dark" : void 0,
210
+ children: t("appearance.window")
211
+ }), /* @__PURE__ */ M(S, {
212
+ value: i?.window ?? "#ffffff",
213
+ onChange: f("window"),
214
+ disabled: !m
215
+ })] }),
216
+ /* @__PURE__ */ N(F, { children: [/* @__PURE__ */ M(G, {
217
+ size: "sm",
218
+ fw: 500,
219
+ mb: "xs",
220
+ c: m ? "dark" : void 0,
221
+ children: t("appearance.accent")
222
+ }), /* @__PURE__ */ M(S, {
223
+ value: i?.accent ?? "#339af0",
224
+ onChange: f("accent"),
225
+ disabled: !m
226
+ })] })
227
+ ]
228
+ }),
229
+ /* @__PURE__ */ N(F, {
230
+ mt: "md",
231
+ children: [
232
+ /* @__PURE__ */ M(G, {
233
+ size: "sm",
234
+ fw: 500,
235
+ mb: "xs",
236
+ children: t("appearance.animationDuration")
237
+ }),
238
+ /* @__PURE__ */ M(G, {
239
+ size: "xs",
240
+ c: "dimmed",
241
+ mb: "sm",
242
+ children: t("appearance.animationDescription")
243
+ }),
244
+ /* @__PURE__ */ N(L, {
245
+ align: "center",
246
+ gap: "md",
247
+ children: [/* @__PURE__ */ M(U, {
248
+ value: a,
249
+ onChange: p,
250
+ min: .1,
251
+ max: 1,
252
+ step: .1,
253
+ style: { flex: 1 },
254
+ marks: [
255
+ {
256
+ value: .1,
257
+ label: "0.1s"
258
+ },
259
+ {
260
+ value: .5,
261
+ label: "0.5s"
262
+ },
263
+ {
264
+ value: 1,
265
+ label: "1.0s"
266
+ }
267
+ ],
268
+ "aria-label": t("appearance.animationDuration")
269
+ }), /* @__PURE__ */ N(G, {
270
+ size: "sm",
271
+ fw: 500,
272
+ style: { minWidth: 40 },
273
+ children: [a.toFixed(1), "s"]
274
+ })]
275
+ })
276
+ ]
277
+ })
278
+ ]
279
+ });
280
+ }, ae = () => {
281
+ let t = e((e) => e.launcherIcon), n = e((e) => e.setLauncherIcon), [r, i] = A([]), [a, o] = A(""), s = D(a);
282
+ O(() => {
283
+ import("react-icons/fc").then((e) => {
284
+ i(Object.keys(e).filter((e) => e.startsWith("Fc")).sort());
285
+ });
286
+ }, []);
287
+ let c = s ? r.filter((e) => e.toLowerCase().includes(s.toLowerCase())) : r, l = E((e) => {
288
+ n(e);
289
+ }, [n]);
290
+ return /* @__PURE__ */ N(d, {
291
+ title: "Launcher Icon",
292
+ description: `Selected: ${t}`,
293
+ children: [/* @__PURE__ */ M(K, {
294
+ placeholder: "Search icons...",
295
+ value: a,
296
+ onChange: (e) => o(e.currentTarget.value),
297
+ "aria-label": "Search icons"
298
+ }), /* @__PURE__ */ M(B, {
299
+ style: {
300
+ flex: 1,
301
+ height: 300
302
+ },
303
+ children: /* @__PURE__ */ M(H, {
304
+ cols: 8,
305
+ spacing: 4,
306
+ children: c.map((e) => /* @__PURE__ */ M(q, {
307
+ label: e,
308
+ withArrow: !0,
309
+ openDelay: 400,
310
+ children: /* @__PURE__ */ M(J, {
311
+ onClick: () => l(e),
312
+ "aria-label": e,
313
+ "aria-pressed": e === t,
314
+ style: {
315
+ padding: 6,
316
+ borderRadius: 6,
317
+ background: e === t ? "var(--mantine-primary-color-light)" : "transparent",
318
+ display: "flex",
319
+ alignItems: "center",
320
+ justifyContent: "center"
321
+ },
322
+ children: /* @__PURE__ */ M(b, {
323
+ fcIcon: e,
324
+ size: 24
325
+ })
326
+ })
327
+ }, e))
328
+ })
329
+ })]
330
+ });
331
+ }, oe = x[1], se = ({ status: e, error: t, onDownload: n }) => {
332
+ let { t: r } = Y("settings");
333
+ return t ? /* @__PURE__ */ M(P, {
334
+ color: oe,
335
+ variant: "filled",
336
+ size: "sm",
337
+ "aria-label": `Download error: ${t}`,
338
+ children: r("common:status.error")
339
+ }) : /* @__PURE__ */ M(I, {
340
+ size: "xs",
341
+ variant: "light",
342
+ onClick: n,
343
+ loading: e === "downloading",
344
+ "aria-label": r("font.download"),
345
+ children: r("font.download")
346
+ });
347
+ }, ce = () => {
348
+ let { t: n } = Y("settings"), i = e((e) => e.font), a = e((e) => e.setFont), o = e((e) => e.fontSize), s = e((e) => e.setFontSize), c = e((e) => e.downloadedFonts), l = e((e) => e.markFontDownloaded), [u, d] = A(null), p = t(u);
349
+ O(() => {
350
+ p.isSuccess && p.data?.success && u && (c.includes(u) || l(u));
351
+ }, [
352
+ p.isSuccess,
353
+ p.data,
354
+ u,
355
+ c,
356
+ l
357
+ ]);
358
+ let m = E((e) => {
359
+ d(e);
360
+ }, []), h = (e) => c.includes(e) ? "done" : u === e ? p.progress.status : "idle", g = (e) => u === e ? p.progress.error : null, _ = E((e) => {
361
+ let t = e.trim();
362
+ t && (r[t] = `https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g, "+")}&display=swap`, d(t));
363
+ }, []), v = f.map((e) => e.value), y = c.filter((e) => !v.includes(e));
364
+ return /* @__PURE__ */ N(W, {
365
+ gap: "md",
366
+ p: "md",
367
+ children: [
368
+ /* @__PURE__ */ M(G, {
369
+ fw: 600,
370
+ size: "lg",
371
+ children: n("font.title")
372
+ }),
373
+ /* @__PURE__ */ M(G, {
374
+ size: "sm",
375
+ c: "dimmed",
376
+ children: n("font.description")
377
+ }),
378
+ /* @__PURE__ */ M(z.Group, {
379
+ value: i,
380
+ onChange: a,
381
+ "aria-label": n("font.selectionAria", { defaultValue: "Font selection" }),
382
+ children: /* @__PURE__ */ N(W, {
383
+ gap: "xs",
384
+ children: [f.map((e) => {
385
+ let t = !!r[e.value], n = c.includes(e.value), i = h(e.value), a = g(e.value), o = !t || n || i === "done";
386
+ return /* @__PURE__ */ M(R, {
387
+ p: "sm",
388
+ withBorder: !0,
389
+ radius: "md",
390
+ children: /* @__PURE__ */ N(W, {
391
+ gap: "xs",
392
+ children: [/* @__PURE__ */ N(L, {
393
+ justify: "space-between",
394
+ children: [/* @__PURE__ */ M(z, {
395
+ value: e.value,
396
+ label: e.label,
397
+ "aria-label": e.label,
398
+ disabled: !o
399
+ }), /* @__PURE__ */ N(L, {
400
+ gap: "xs",
401
+ align: "center",
402
+ children: [o && /* @__PURE__ */ M(G, {
403
+ size: "sm",
404
+ c: "dimmed",
405
+ style: { fontFamily: e.stack },
406
+ children: "AaBbCcDd"
407
+ }), t && /* @__PURE__ */ M(se, {
408
+ fontLabel: e.label,
409
+ status: i,
410
+ error: a,
411
+ onDownload: () => m(e.value),
412
+ isDownloaded: n
413
+ })]
414
+ })]
415
+ }), t && i === "downloading" && /* @__PURE__ */ M(C, { state: p.progress })]
416
+ })
417
+ }, e.value);
418
+ }), y.map((e) => /* @__PURE__ */ M(R, {
419
+ p: "sm",
420
+ withBorder: !0,
421
+ radius: "md",
422
+ children: /* @__PURE__ */ N(L, {
423
+ justify: "space-between",
424
+ children: [/* @__PURE__ */ M(z, {
425
+ value: e,
426
+ label: e,
427
+ "aria-label": e
428
+ }), /* @__PURE__ */ M(G, {
429
+ size: "sm",
430
+ c: "dimmed",
431
+ style: { fontFamily: `"${e}"` },
432
+ children: "AaBbCcDd"
433
+ })]
434
+ })
435
+ }, e))]
436
+ })
437
+ }),
438
+ /* @__PURE__ */ M(R, {
439
+ p: "sm",
440
+ withBorder: !0,
441
+ radius: "md",
442
+ children: /* @__PURE__ */ N(W, {
443
+ gap: "xs",
444
+ children: [/* @__PURE__ */ N(L, {
445
+ justify: "space-between",
446
+ children: [/* @__PURE__ */ M(G, {
447
+ size: "sm",
448
+ fw: 500,
449
+ children: n("font.fontSize")
450
+ }), /* @__PURE__ */ N(G, {
451
+ size: "sm",
452
+ c: "dimmed",
453
+ children: [o, "px"]
454
+ })]
455
+ }), /* @__PURE__ */ M(U, {
456
+ value: o,
457
+ onChange: s,
458
+ min: 10,
459
+ max: 24,
460
+ step: 1,
461
+ marks: [
462
+ { value: 10 },
463
+ { value: 14 },
464
+ { value: 18 },
465
+ { value: 20 },
466
+ { value: 24 }
467
+ ],
468
+ "aria-label": n("font.fontSizeAria", { defaultValue: "Font size" })
469
+ })]
470
+ })
471
+ }),
472
+ /* @__PURE__ */ M(le, {
473
+ onDownload: _,
474
+ activeDownload: u,
475
+ fontDownload: p
476
+ })
477
+ ]
478
+ });
479
+ }, le = ({ onDownload: e, activeDownload: t, fontDownload: n }) => {
480
+ let { t: r } = Y("settings"), [i, a] = A(""), o = t === i.trim(), s = o ? n.progress.status : "idle", c = o && n.progress.status === "error", l = E((e) => {
481
+ a(e), c && n.reset?.();
482
+ }, [c, n]), u = E(() => {
483
+ e(i);
484
+ }, [i, e]), d = o && s === "done";
485
+ return /* @__PURE__ */ M(R, {
486
+ p: "sm",
487
+ withBorder: !0,
488
+ radius: "md",
489
+ children: /* @__PURE__ */ N(W, {
490
+ gap: "xs",
491
+ children: [
492
+ /* @__PURE__ */ N(G, {
493
+ size: "sm",
494
+ fw: 500,
495
+ children: [
496
+ r("font.downloadByName"),
497
+ " ",
498
+ /* @__PURE__ */ M("a", {
499
+ href: "https://fonts.google.com/",
500
+ target: "_blank",
501
+ rel: "noreferrer",
502
+ children: r("font.fromGoogleFonts")
503
+ })
504
+ ]
505
+ }),
506
+ /* @__PURE__ */ N(L, {
507
+ gap: "xs",
508
+ align: "flex-start",
509
+ children: [/* @__PURE__ */ M(K, {
510
+ placeholder: r("font.namePlaceholder", { defaultValue: "e.g. Open Sans" }),
511
+ value: i,
512
+ onChange: (e) => l(e.currentTarget.value),
513
+ style: { flex: 1 },
514
+ "aria-label": r("font.customNameAria", { defaultValue: "Custom font name" }),
515
+ error: c ? r("font.downloadError") : void 0
516
+ }), /* @__PURE__ */ M(I, {
517
+ onClick: u,
518
+ disabled: !i.trim() || s === "downloading",
519
+ loading: s === "downloading",
520
+ "aria-label": r("font.downloadCustomAria", { defaultValue: "Download custom font" }),
521
+ style: { marginTop: c ? 0 : void 0 },
522
+ children: r("font.download")
523
+ })]
524
+ }),
525
+ s === "downloading" && /* @__PURE__ */ M(C, { state: n.progress }),
526
+ d && /* @__PURE__ */ M(G, {
527
+ size: "xs",
528
+ c: "dimmed",
529
+ children: r("font.downloadSuccess")
530
+ })
531
+ ]
532
+ })
533
+ });
534
+ }, Z = {
535
+ en: "English",
536
+ es: "Español"
537
+ }, ue = () => {
538
+ let { t } = Y("settings"), n = e((e) => e.language), r = e((e) => e.setLanguage), i = E((e) => {
539
+ r(e);
540
+ }, [r]);
541
+ return /* @__PURE__ */ M(d, {
542
+ title: t("language.title"),
543
+ description: t("language.description"),
544
+ children: /* @__PURE__ */ M(W, {
545
+ gap: "xs",
546
+ children: c.map((e) => /* @__PURE__ */ M(J, {
547
+ onClick: () => i(e),
548
+ "aria-label": Z[e],
549
+ "aria-pressed": e === n,
550
+ style: {
551
+ padding: "12px 16px",
552
+ borderRadius: 8,
553
+ width: "100%",
554
+ background: e === n ? "var(--mantine-primary-color-light)" : "transparent",
555
+ border: e === n ? "1px solid var(--mantine-primary-color-filled)" : "1px solid transparent",
556
+ transition: "all 0.15s ease",
557
+ cursor: "pointer"
558
+ },
559
+ children: /* @__PURE__ */ N(L, {
560
+ gap: "sm",
561
+ children: [/* @__PURE__ */ M(l, {
562
+ lang: e,
563
+ size: 24
564
+ }), /* @__PURE__ */ M(G, {
565
+ fw: e === n ? 600 : 400,
566
+ children: Z[e]
567
+ })]
568
+ })
569
+ }, e))
570
+ })
571
+ });
572
+ };
573
+ //#endregion
574
+ //#region src/utils/resetDockerWorkspace.ts
575
+ async function de() {
576
+ _() && (await fetch("/api/fs/reset", { method: "POST" }), await fetch("/api/fs/seed", { method: "POST" }));
577
+ }
578
+ //#endregion
579
+ //#region src/components/Apps/SettingsApp/sections/ResetSettings.tsx
580
+ var fe = () => {
581
+ let { t: e } = Y("settings"), [t, n] = A(!1), r = E(() => {
582
+ n(!0);
583
+ }, []), i = E(() => {
584
+ n(!1);
585
+ }, []), a = E(async () => {
586
+ await de(), await o(), window.location.reload();
587
+ }, []), s = E(async () => {
588
+ await de(), await o({ keepIndexedDB: !0 }), window.location.reload();
589
+ }, []);
590
+ return /* @__PURE__ */ N(d, {
591
+ title: e("reset.title"),
592
+ description: e("reset.description"),
593
+ children: [/* @__PURE__ */ M(I, {
594
+ color: "red",
595
+ onClick: r,
596
+ style: { alignSelf: "flex-start" },
597
+ children: e("reset.resetButton")
598
+ }), t && /* @__PURE__ */ M(F, {
599
+ style: {
600
+ position: "fixed",
601
+ top: 0,
602
+ left: 0,
603
+ right: 0,
604
+ bottom: 0,
605
+ background: "rgba(0,0,0,0.5)",
606
+ display: "flex",
607
+ alignItems: "center",
608
+ justifyContent: "center",
609
+ zIndex: 1e3
610
+ },
611
+ role: "dialog",
612
+ "aria-label": "Confirm reset",
613
+ children: /* @__PURE__ */ M(F, {
614
+ style: {
615
+ background: "var(--mantine-color-default)",
616
+ borderRadius: 8,
617
+ padding: 24,
618
+ maxWidth: 400,
619
+ width: "100%"
620
+ },
621
+ children: /* @__PURE__ */ N(W, {
622
+ gap: "md",
623
+ children: [
624
+ /* @__PURE__ */ M(G, {
625
+ fw: 600,
626
+ size: "lg",
627
+ ta: "center",
628
+ children: e("reset.modalTitle")
629
+ }),
630
+ /* @__PURE__ */ M(G, {
631
+ size: "sm",
632
+ c: "dimmed",
633
+ ta: "center",
634
+ children: e("reset.modalDescription")
635
+ }),
636
+ /* @__PURE__ */ N(L, {
637
+ justify: "center",
638
+ gap: "xs",
639
+ mt: "md",
640
+ children: [
641
+ /* @__PURE__ */ M(I, {
642
+ variant: "default",
643
+ onClick: i,
644
+ children: e("reset.goBack")
645
+ }),
646
+ /* @__PURE__ */ M(I, {
647
+ color: "blue",
648
+ onClick: s,
649
+ children: e("reset.keepFiles")
650
+ }),
651
+ /* @__PURE__ */ M(I, {
652
+ color: "red",
653
+ onClick: a,
654
+ children: e("reset.burnEverything")
655
+ })
656
+ ]
657
+ })
658
+ ]
659
+ })
660
+ })
661
+ })]
662
+ });
663
+ }, Q = {
664
+ root: "_root_77epl_1",
665
+ sidebar: "_sidebar_77epl_8",
666
+ navItem: "_navItem_77epl_16",
667
+ content: "_content_77epl_41",
668
+ overviewPadding: "_overviewPadding_77epl_47",
669
+ sectionCard: "_sectionCard_77epl_51",
670
+ toolbar: "_toolbar_77epl_60",
671
+ dirtyIndicator: "_dirtyIndicator_77epl_70",
672
+ versionFooter: "_versionFooter_77epl_77"
673
+ }, pe = "0.4.0", me = () => pe, he = {
674
+ wallpaper: re,
675
+ appearance: ie,
676
+ launcher: ae,
677
+ font: ce,
678
+ language: ue,
679
+ reset: fe
680
+ };
681
+ function $(e, t, n, r, i, a, o, s) {
682
+ return {
683
+ wallpaper: e,
684
+ wallpaperModule: t,
685
+ themeMode: n,
686
+ font: r,
687
+ fontSize: i,
688
+ launcherIcon: a,
689
+ customThemeColors: o,
690
+ animationDuration: s
691
+ };
692
+ }
693
+ var ge = ({ window: t, notifyReady: n }) => {
694
+ let { t: r } = Y("settings"), [o, c] = A(null), [l, d] = A(!1), f = y((e) => e.windows), p = t?.id ?? f.find((e) => e.content === "settings")?.id, m = e((e) => e.wallpaper), h = e((e) => e.wallpaperModule), g = e((e) => e.theme), _ = e((e) => e.font), v = e((e) => e.fontSize), x = e((e) => e.launcherIcon), S = e((e) => e.customThemeColors), C = e((e) => e.animationDuration), w = e((e) => e.setWallpaper), D = e((e) => e.setWallpaperModule), j = e((e) => e.setFont), P = e((e) => e.setFontSize), F = e((e) => e.setLauncherIcon), L = e((e) => e.setThemeMode), R = e((e) => e.setCustomThemeColors), z = e((e) => e.setThemeAutomatic), B = e((e) => e.setAnimationDuration), V = k(null);
695
+ O(() => {
696
+ a();
697
+ }, []), O(() => {
698
+ V.current === null && (V.current = $(m, h, g.mode, _, v, x, S, C));
699
+ }, [
700
+ m,
701
+ h,
702
+ g.mode,
703
+ _,
704
+ v,
705
+ x,
706
+ S,
707
+ C
708
+ ]), O(() => {
709
+ if (!V.current) return;
710
+ let e = $(m, h, g.mode, _, v, x, S, C);
711
+ d(JSON.stringify(e) !== JSON.stringify(V.current));
712
+ }, [
713
+ m,
714
+ h,
715
+ g.mode,
716
+ _,
717
+ v,
718
+ x,
719
+ S,
720
+ C
721
+ ]);
722
+ let U = E(() => {
723
+ let e = V.current;
724
+ e && (w(e.wallpaper), D(e.wallpaperModule), j(e.font), P(e.fontSize), F(e.launcherIcon), B(e.animationDuration), e.customThemeColors ? R(e.customThemeColors) : (R(null), z()), L(e.themeMode), d(!1), i());
725
+ }, [
726
+ w,
727
+ D,
728
+ j,
729
+ P,
730
+ F,
731
+ B,
732
+ L,
733
+ R,
734
+ z
735
+ ]);
736
+ O(() => {
737
+ p && T.getState().reset(p);
738
+ }, [p]), O(() => {
739
+ p && T.getState().setIsDirty(p, l);
740
+ }, [p, l]), O(() => {
741
+ n?.({
742
+ ...t?.contentData ?? {},
743
+ discard: U
744
+ });
745
+ }, [
746
+ t,
747
+ n,
748
+ U
749
+ ]), ee({
750
+ isDirtyGetter: E(() => {
751
+ if (!V.current) return !1;
752
+ let t = e.getState(), n = $(t.wallpaper, t.wallpaperModule, t.theme.mode, t.font, t.fontSize, t.launcherIcon, t.customThemeColors, t.animationDuration);
753
+ return JSON.stringify(n) !== JSON.stringify(V.current);
754
+ }, []),
755
+ windowId: p,
756
+ onDiscard: U,
757
+ onSave: () => {
758
+ V.current = $(m, h, g.mode, _, v, x, S, C), d(!1), i();
759
+ }
760
+ });
761
+ let K = E((e) => {
762
+ c(e);
763
+ }, []), q = E(() => {
764
+ c(null);
765
+ }, []), J = E(() => {
766
+ globalThis.location.href = `mailto:${u.email}`;
767
+ }, []), X = o ? he[o] : null;
768
+ return /* @__PURE__ */ N("div", {
769
+ className: Q.root,
770
+ children: [/* @__PURE__ */ M("aside", {
771
+ className: Q.sidebar,
772
+ children: /* @__PURE__ */ N("nav", {
773
+ "aria-label": "Settings sections",
774
+ children: [/* @__PURE__ */ N("button", {
775
+ className: Q.navItem,
776
+ "data-active": o === null || void 0,
777
+ onClick: q,
778
+ "aria-label": "All Settings",
779
+ "aria-current": o === null ? "page" : void 0,
780
+ children: [/* @__PURE__ */ M(b, {
781
+ fcIcon: "FcList",
782
+ size: 16
783
+ }), /* @__PURE__ */ M(G, {
784
+ size: "xs",
785
+ ml: 6,
786
+ truncate: !0,
787
+ children: r("all")
788
+ })]
789
+ }), s.map((e) => /* @__PURE__ */ N("button", {
790
+ className: Q.navItem,
791
+ "data-active": o === e.id || void 0,
792
+ onClick: () => K(e.id),
793
+ "aria-label": e.label,
794
+ "aria-current": o === e.id ? "page" : void 0,
795
+ children: [/* @__PURE__ */ M(b, {
796
+ fcIcon: e.fcIcon,
797
+ size: 16
798
+ }), /* @__PURE__ */ M(G, {
799
+ size: "xs",
800
+ ml: 6,
801
+ truncate: !0,
802
+ children: r(`sections.${e.id}.label`)
803
+ })]
804
+ }, e.id))]
805
+ })
806
+ }), /* @__PURE__ */ M("main", {
807
+ className: Q.content,
808
+ children: X ? /* @__PURE__ */ M(X, {}) : /* @__PURE__ */ N(W, {
809
+ className: Q.overviewPadding,
810
+ h: "100%",
811
+ justify: "space-between",
812
+ gap: 0,
813
+ children: [
814
+ /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M(G, {
815
+ fw: 500,
816
+ mb: "md",
817
+ size: "sm",
818
+ c: "dimmed",
819
+ children: r("all")
820
+ }), /* @__PURE__ */ M(H, {
821
+ cols: 2,
822
+ spacing: "sm",
823
+ children: s.map((e) => /* @__PURE__ */ M(te, {
824
+ withBorder: !0,
825
+ padding: "md",
826
+ radius: "md",
827
+ className: Q.sectionCard,
828
+ onClick: () => K(e.id),
829
+ role: "button",
830
+ "aria-label": `Open ${e.label} settings`,
831
+ children: /* @__PURE__ */ N(W, {
832
+ gap: 6,
833
+ align: "flex-start",
834
+ children: [
835
+ /* @__PURE__ */ M(b, {
836
+ fcIcon: e.fcIcon,
837
+ size: 28
838
+ }),
839
+ /* @__PURE__ */ M(G, {
840
+ size: "sm",
841
+ fw: 500,
842
+ children: r(`sections.${e.id}.label`)
843
+ }),
844
+ /* @__PURE__ */ M(G, {
845
+ size: "xs",
846
+ c: "dimmed",
847
+ children: r(`sections.${e.id}.description`)
848
+ })
849
+ ]
850
+ })
851
+ }, e.id))
852
+ })] }),
853
+ /* @__PURE__ */ M(I, {
854
+ gradient: {
855
+ from: "blue",
856
+ to: "cyan",
857
+ deg: 90
858
+ },
859
+ onClick: J,
860
+ children: "FDE: Fran Desktop Environment"
861
+ }),
862
+ /* @__PURE__ */ M(G, {
863
+ size: "xs",
864
+ c: "dimmed",
865
+ ta: "center",
866
+ className: Q.versionFooter,
867
+ children: me()
868
+ })
869
+ ]
870
+ })
871
+ })]
872
+ });
873
+ };
874
+ //#endregion
875
+ export { ge as default };