@fde-desktop/fde-core 0.4.13 → 0.4.20

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-Bboc4KZ1.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 +698 -650
  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-uguTLkyl.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-BRK2OqkQ.cjs +0 -1
  90. package/dist/FilesApp-BuoFP_KA.js +0 -212
  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-Dr1mF7oj.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-ChDhsL9h.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,344 @@
1
+ import { a as e, b as t, o as n } from "./desktopStore-xnNbYaYm.js";
2
+ import { i as r } from "./useCloseInterceptor-Bwm4I0O8.js";
3
+ import { t as i } from "./VscIcon-AEENjKOE.js";
4
+ import { n as a, r as o } from "./FilePickerApp-D7fERKbp.js";
5
+ import { t as s } from "./AppTempMemory-DgUW6GaF.js";
6
+ import { n as c } from "./notesStore-KZDXN6zx.js";
7
+ import { useCallback as l, useEffect as u, useRef as d, useState as f } from "react";
8
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
9
+ import { useTranslation as h } from "react-i18next";
10
+ import { EditorContent as ee, useEditor as g, useEditorState as _ } from "@tiptap/react";
11
+ import v from "@tiptap/starter-kit";
12
+ import { Markdown as y } from "@tiptap/markdown";
13
+ import { Extension as b } from "@tiptap/core";
14
+ var x = {
15
+ container: "_container_3xue5_1",
16
+ toolbar: "_toolbar_3xue5_11",
17
+ toolbarBtn: "_toolbarBtn_3xue5_22",
18
+ active: "_active_3xue5_57",
19
+ separator: "_separator_3xue5_63",
20
+ editorContent: "_editorContent_3xue5_71"
21
+ }, S = [...t], C = b.create({
22
+ name: "clearMarksOnEnter",
23
+ addKeyboardShortcuts() {
24
+ return { Enter: ({ editor: e }) => {
25
+ let { state: t, dispatch: n } = e.view, { selection: r, schema: i } = t, { $from: a, empty: o } = r;
26
+ return !o || a.parent.type !== i.nodes.paragraph ? !1 : (n(t.tr.split(a.pos).setStoredMarks([])), !0);
27
+ } };
28
+ }
29
+ }), w = "Desktop/NotesAppWelcome.md", T = ({ window: t, notifyReady: b }) => {
30
+ let { t: T } = h("notes"), E = t, D = E?.id, O = D ? `notesApp-${D}` : "notesApp", k = E?.contentData, [A, j] = f(k?.initialName ?? T("untitled")), [M, N] = f(!1), P = d("save"), [F, I] = f(k?.fileId ?? null), L = d(k?.initialContent ?? ""), [R, z] = f(!1), B = c((e) => e.states[D ?? ""]?.contentLoaded ?? !1), V = c((e) => e.setContentLoaded);
31
+ u(() => {
32
+ D && c.getState().reset(D);
33
+ }, [D]), u(() => {
34
+ D && c.getState().setIsDirty(D, R);
35
+ }, [D, R]);
36
+ let H = n((e) => e.createFile), U = n((e) => e.updateFile), W = n((e) => e.fsNodes), G = g({
37
+ extensions: [
38
+ v,
39
+ y,
40
+ C
41
+ ],
42
+ content: k?.initialContent ?? "",
43
+ contentType: "markdown",
44
+ shouldRerenderOnTransaction: !1,
45
+ onCreate: () => {
46
+ let e = G?.getMarkdown() ?? "";
47
+ L.current = e, O && s.getState().setSnapshot(O, e);
48
+ },
49
+ onUpdate: () => {
50
+ let e = G?.getMarkdown() ?? "", t = e !== (L.current ?? "");
51
+ z(t), !t && O && s.getState().setSnapshot(O, e);
52
+ }
53
+ });
54
+ u(() => {
55
+ if (!F || !G || B) return;
56
+ let e = W.find((e) => e.id === F);
57
+ if (!e || e.type !== "file") return;
58
+ let t = e;
59
+ t.content && t.content !== (L.current ?? "") && (L.current = t.content, O && s.getState().setSnapshot(O, t.content), G.commands.setContent(t.content, {
60
+ emitUpdate: !1,
61
+ contentType: "markdown"
62
+ }), V(D, !0));
63
+ }, [
64
+ F,
65
+ G,
66
+ O,
67
+ W,
68
+ B,
69
+ D,
70
+ V
71
+ ]), u(() => {
72
+ if (!G || !D || B) return;
73
+ let t = !1, n = new AbortController();
74
+ return (async () => {
75
+ try {
76
+ if (k?.initialContent) {
77
+ t || (G.commands.setContent(k.initialContent, {
78
+ emitUpdate: !1,
79
+ contentType: "markdown"
80
+ }), V(D, !0));
81
+ return;
82
+ }
83
+ if (k?.url) {
84
+ let r = await e(k.url, n.signal);
85
+ !t && r && (G.commands.setContent(r, {
86
+ emitUpdate: !1,
87
+ contentType: "markdown"
88
+ }), V(D, !0));
89
+ return;
90
+ }
91
+ if (k?.fileId) return;
92
+ let r = await fetch(`/${w}`, { signal: n.signal });
93
+ if (!t && r.ok) {
94
+ let e = await r.text();
95
+ G.commands.setContent(e, {
96
+ emitUpdate: !1,
97
+ contentType: "markdown"
98
+ }), V(D, !0);
99
+ }
100
+ } catch (e) {
101
+ !t && e instanceof Error && e.name !== "AbortError" && console.warn("Failed to load content:", e);
102
+ }
103
+ })(), () => {
104
+ t = !0, n.abort();
105
+ };
106
+ }, [
107
+ G,
108
+ k,
109
+ D,
110
+ B,
111
+ V
112
+ ]);
113
+ let K = l(() => G ? G.getMarkdown() : "", [G]), q = l(() => {
114
+ G?.commands.setContent("", {
115
+ emitUpdate: !1,
116
+ contentType: "markdown"
117
+ }), I(null), j("untitled.md"), L.current = "", z(!1), D && V(D, !0);
118
+ }, [
119
+ G,
120
+ D,
121
+ V
122
+ ]), J = l(() => {
123
+ G && (F ? (U(F, K()), L.current = K(), z(!1)) : (P.current = "save", N(!0)));
124
+ }, [
125
+ G,
126
+ K,
127
+ U,
128
+ F
129
+ ]), Y = l(() => {
130
+ G && (P.current = "saveAs", N(!0));
131
+ }, [G]), X = l(async ({ parentId: e, name: t }) => {
132
+ if (!G) return;
133
+ let n = K();
134
+ if (P.current === "saveAs" || !F) {
135
+ let r = await H(t, n, e);
136
+ I(r.id), j(r.name);
137
+ } else await U(F, n);
138
+ L.current = n, z(!1), N(!1);
139
+ }, [
140
+ G,
141
+ K,
142
+ H,
143
+ U,
144
+ F
145
+ ]), [te, Z] = f(!1), ne = l((t) => {
146
+ I(t.id), j(t.name), L.current = t.content ?? "", z(!1), Z(!1);
147
+ let n = t.url;
148
+ n ? e(n).then((e) => {
149
+ e && (G?.commands.setContent(e, {
150
+ emitUpdate: !1,
151
+ contentType: "markdown"
152
+ }), D && V(D, !0));
153
+ }) : t.content && (G?.commands.setContent(t.content, {
154
+ emitUpdate: !1,
155
+ contentType: "markdown"
156
+ }), D && V(D, !0));
157
+ }, [
158
+ G,
159
+ D,
160
+ V
161
+ ]), Q = l(() => Z(!0), []);
162
+ u(() => {
163
+ let e = {
164
+ new: q,
165
+ save: J,
166
+ saveAs: Y
167
+ };
168
+ b?.({
169
+ ...E?.contentData ?? {},
170
+ actions: e,
171
+ setPickerOpen: Q,
172
+ isDirty: R
173
+ });
174
+ }, [
175
+ q,
176
+ J,
177
+ Y,
178
+ E,
179
+ b,
180
+ Q,
181
+ R
182
+ ]), r({
183
+ isDirtyGetter: l(() => (G?.getMarkdown() ?? "") !== (L.current ?? ""), [G]),
184
+ windowId: D,
185
+ onDiscard: () => {
186
+ if (!G) return;
187
+ let e = L.current ?? "";
188
+ G.commands.setContent(e, {
189
+ emitUpdate: !1,
190
+ contentType: "markdown"
191
+ }), z(!1);
192
+ },
193
+ onSave: J
194
+ });
195
+ let $ = _({
196
+ editor: G,
197
+ selector: (e) => ({
198
+ canUndo: e.editor?.can().undo() ?? !1,
199
+ canRedo: e.editor?.can().redo() ?? !1,
200
+ isBold: e.editor?.isActive("bold") ?? !1,
201
+ isItalic: e.editor?.isActive("italic") ?? !1,
202
+ isStrike: e.editor?.isActive("strike") ?? !1,
203
+ isCode: e.editor?.isActive("code") ?? !1,
204
+ isH1: e.editor?.isActive("heading", { level: 1 }) ?? !1,
205
+ isH2: e.editor?.isActive("heading", { level: 2 }) ?? !1,
206
+ isBulletList: e.editor?.isActive("bulletList") ?? !1,
207
+ isOrderedList: e.editor?.isActive("orderedList") ?? !1,
208
+ isBlockquote: e.editor?.isActive("blockquote") ?? !1,
209
+ isCodeBlock: e.editor?.isActive("codeBlock") ?? !1
210
+ })
211
+ });
212
+ return /* @__PURE__ */ m("div", {
213
+ className: x.container,
214
+ "data-windowid": E?.id,
215
+ children: [
216
+ /* @__PURE__ */ m("div", {
217
+ className: x.toolbar,
218
+ role: "toolbar",
219
+ "aria-label": T("toolbar.formatting"),
220
+ children: [
221
+ /* @__PURE__ */ p("button", {
222
+ className: `${x.toolbarBtn} ${$?.isBold ? x.active : ""}`,
223
+ onClick: () => G?.chain().focus().toggleBold().run(),
224
+ disabled: !G?.can().chain().focus().toggleBold().run(),
225
+ title: T("toolbar.bold"),
226
+ "aria-label": T("toolbar.bold"),
227
+ children: /* @__PURE__ */ p(i, { name: "VscBold" })
228
+ }),
229
+ /* @__PURE__ */ p("button", {
230
+ className: `${x.toolbarBtn} ${$?.isItalic ? x.active : ""}`,
231
+ onClick: () => G?.chain().focus().toggleItalic().run(),
232
+ disabled: !G?.can().chain().focus().toggleItalic().run(),
233
+ title: T("toolbar.italic"),
234
+ "aria-label": T("toolbar.italic"),
235
+ children: /* @__PURE__ */ p(i, { name: "VscItalic" })
236
+ }),
237
+ /* @__PURE__ */ p("button", {
238
+ className: `${x.toolbarBtn} ${$?.isStrike ? x.active : ""}`,
239
+ onClick: () => G?.chain().focus().toggleStrike().run(),
240
+ disabled: !G?.can().chain().focus().toggleStrike().run(),
241
+ title: T("toolbar.strikethrough"),
242
+ "aria-label": T("toolbar.strikethrough"),
243
+ children: /* @__PURE__ */ p("s", { children: "S" })
244
+ }),
245
+ /* @__PURE__ */ p("button", {
246
+ className: `${x.toolbarBtn} ${$?.isCode ? x.active : ""}`,
247
+ onClick: () => G?.chain().focus().toggleCode().run(),
248
+ disabled: !G?.can().chain().focus().toggleCode().run(),
249
+ title: T("toolbar.inlineCode"),
250
+ "aria-label": T("toolbar.inlineCode"),
251
+ children: /* @__PURE__ */ p(i, { name: "VscCode" })
252
+ }),
253
+ /* @__PURE__ */ p("span", { className: x.separator }),
254
+ /* @__PURE__ */ p("button", {
255
+ className: `${x.toolbarBtn} ${$?.isH1 ? x.active : ""}`,
256
+ onClick: () => G?.chain().focus().toggleHeading({ level: 1 }).run(),
257
+ title: T("toolbar.heading1"),
258
+ "aria-label": T("toolbar.heading1"),
259
+ children: /* @__PURE__ */ p("strong", { children: "H1" })
260
+ }),
261
+ /* @__PURE__ */ p("button", {
262
+ className: `${x.toolbarBtn} ${$?.isH2 ? x.active : ""}`,
263
+ onClick: () => G?.chain().focus().toggleHeading({ level: 2 }).run(),
264
+ title: T("toolbar.heading2"),
265
+ "aria-label": T("toolbar.heading2"),
266
+ children: /* @__PURE__ */ p("strong", { children: "H2" })
267
+ }),
268
+ /* @__PURE__ */ p("span", { className: x.separator }),
269
+ /* @__PURE__ */ p("button", {
270
+ className: `${x.toolbarBtn} ${$?.isBulletList ? x.active : ""}`,
271
+ onClick: () => G?.chain().focus().toggleBulletList().run(),
272
+ title: T("toolbar.bulletList"),
273
+ "aria-label": T("toolbar.bulletList"),
274
+ children: /* @__PURE__ */ p(i, { name: "VscListUnordered" })
275
+ }),
276
+ /* @__PURE__ */ p("button", {
277
+ className: `${x.toolbarBtn} ${$?.isOrderedList ? x.active : ""}`,
278
+ onClick: () => G?.chain().focus().toggleOrderedList().run(),
279
+ title: T("toolbar.orderedList"),
280
+ "aria-label": T("toolbar.orderedList"),
281
+ children: /* @__PURE__ */ p(i, { name: "VscListOrdered" })
282
+ }),
283
+ /* @__PURE__ */ p("span", { className: x.separator }),
284
+ /* @__PURE__ */ p("button", {
285
+ className: `${x.toolbarBtn} ${$?.isBlockquote ? x.active : ""}`,
286
+ onClick: () => G?.chain().focus().toggleBlockquote().run(),
287
+ title: T("toolbar.blockquote"),
288
+ "aria-label": T("toolbar.blockquote"),
289
+ children: /* @__PURE__ */ p(i, { name: "VscQuote" })
290
+ }),
291
+ /* @__PURE__ */ p("button", {
292
+ className: `${x.toolbarBtn} ${$?.isCodeBlock ? x.active : ""}`,
293
+ onClick: () => G?.chain().focus().toggleCodeBlock().run(),
294
+ title: T("toolbar.codeBlock"),
295
+ "aria-label": T("toolbar.codeBlock"),
296
+ children: /* @__PURE__ */ p(i, { name: "VscTerminal" })
297
+ }),
298
+ /* @__PURE__ */ p("button", {
299
+ className: x.toolbarBtn,
300
+ onClick: () => G?.chain().focus().setHorizontalRule().run(),
301
+ title: T("toolbar.horizontalRule"),
302
+ "aria-label": T("toolbar.horizontalRule"),
303
+ children: /* @__PURE__ */ p(i, { name: "VscHorizontalRule" })
304
+ }),
305
+ /* @__PURE__ */ p("span", { className: x.separator }),
306
+ /* @__PURE__ */ p("button", {
307
+ className: x.toolbarBtn,
308
+ onClick: () => G?.chain().focus().undo().run(),
309
+ disabled: !$?.canUndo,
310
+ title: T("common:actions.undo"),
311
+ "aria-label": T("common:actions.undo"),
312
+ children: /* @__PURE__ */ p(i, { name: "VscDiscard" })
313
+ }),
314
+ /* @__PURE__ */ p("button", {
315
+ className: x.toolbarBtn,
316
+ onClick: () => G?.chain().focus().redo().run(),
317
+ disabled: !$?.canRedo,
318
+ title: T("common:actions.redo"),
319
+ "aria-label": T("common:actions.redo"),
320
+ children: /* @__PURE__ */ p(i, { name: "VscRedo" })
321
+ })
322
+ ]
323
+ }),
324
+ /* @__PURE__ */ p(ee, {
325
+ editor: G,
326
+ className: x.editorContent
327
+ }),
328
+ /* @__PURE__ */ p(a, {
329
+ opened: te,
330
+ acceptedMimeTypes: S,
331
+ onConfirm: ne,
332
+ onCancel: () => Z(!1)
333
+ }),
334
+ /* @__PURE__ */ p(o, {
335
+ opened: M,
336
+ initialName: A,
337
+ onConfirm: X,
338
+ onCancel: () => N(!1)
339
+ })
340
+ ]
341
+ });
342
+ };
343
+ //#endregion
344
+ export { T as default };
@@ -1,14 +1,13 @@
1
- import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { t } from "./AppMenuBar-DmSfQRXU.js";
3
- import { t as n } from "./notesStore-Dgah46U5.js";
4
- import { t as r } from "./useMenuBarUtils-ChAfI7OA.js";
5
- import { useMemo as i } from "react";
6
- import { jsx as a } from "react/jsx-runtime";
7
- import { useTranslation as o } from "react-i18next";
1
+ import { t as e } from "./AppMenuBar-DmSfQRXU.js";
2
+ import { t } from "./useMenuBarUtils-DTPFK0IN.js";
3
+ import { t as n } from "./notesStore-KZDXN6zx.js";
4
+ import { useMemo as r } from "react";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ import { useTranslation as a } from "react-i18next";
8
7
  //#region src/components/Apps/NotesApp/useNotesMenuBar.ts
9
- var s = (e) => {
10
- let { windowId: t, contentData: a, onExit: s } = e, { t: c } = o("common"), l = n(t), u = a?.actions, d = a?.setPickerOpen;
11
- return i(() => r([{
8
+ var o = (e) => {
9
+ let { windowId: i, contentData: o, onExit: s } = e, { t: c } = a("common"), l = n(i), u = o?.actions, d = o?.setPickerOpen;
10
+ return r(() => t([{
12
11
  type: "menu",
13
12
  label: c("menu.file"),
14
13
  items: [
@@ -53,10 +52,10 @@ var s = (e) => {
53
52
  l,
54
53
  s
55
54
  ]);
56
- }, c = /* @__PURE__ */ e({ NotesMenuBar: () => l }), l = ({ windowId: e, contentData: n, onExit: r }) => /* @__PURE__ */ a(t, { elements: s({
57
- windowId: e,
55
+ }, s = ({ windowId: t, contentData: n, onExit: r }) => /* @__PURE__ */ i(e, { elements: o({
56
+ windowId: t,
58
57
  contentData: n,
59
58
  onExit: r
60
59
  }) });
61
60
  //#endregion
62
- export { c as n, l as t };
61
+ export { s as NotesMenuBar };
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./AppMenuBar-38QtFTPk.cjs`),t=require(`./useMenuBarUtils-BOnQYtKU.cjs`),n=require(`./notesStore-BnMXBRaV.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`react-i18next`);var o=e=>{let{windowId:i,contentData:o,onExit:s}=e,{t:c}=(0,a.useTranslation)(`common`),l=n.t(i),u=o?.actions,d=o?.setPickerOpen;return(0,r.useMemo)(()=>t.t([{type:`menu`,label:c(`menu.file`),items:[{type:`item`,label:c(`actions.new`),icon:`FcEditImage`,onClick:()=>u?.new?.()},{type:`item`,label:c(`actions.open`),icon:`FcOpenedFolder`,onClick:()=>d?.()},{type:`divider`},{type:`item`,label:c(`actions.save`),icon:`FcInspection`,onClick:()=>u?.save?.(),disabled:!l},{type:`item`,label:c(`actions.saveAs`),icon:`FcDeployment`,onClick:()=>u?.saveAs?.()},{type:`divider`},{type:`item`,label:c(`actions.exit`),icon:`FcLeft`,onClick:s}]}],l),[c,u,d,l,s])},s=({windowId:t,contentData:n,onExit:r})=>(0,i.jsx)(e.t,{elements:o({windowId:t,contentData:n,onExit:r})});exports.NotesMenuBar=s;
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./useResolvedUrl-Dz2AhrDV.cjs`),t=require(`./AppEmptyState-Z8_Cviti.cjs`),n=require(`./FilePickerApp-ClmPw6lk.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`react-i18next`);var o={container:`_container_1hj4w_1`,frame:`_frame_1hj4w_7`},s=({window:s,notifyReady:c})=>{let{t:l}=(0,a.useTranslation)(`apps`),u=s,d=u?.contentData?.src,[f,p]=(0,r.useState)(d??void 0),[m,h]=(0,r.useState)(!1),g=e.t(f);(0,r.useEffect)(()=>{c?.({...u?.contentData??{},setPickerOpen:()=>h(!0)})},[u,c]);let _=(0,r.useCallback)(e=>{p(e.url??e.name),h(!1)},[]);return(0,i.jsxs)(`div`,{className:o.container,"data-windowid":u?.id,children:[g||f?(0,i.jsx)(`iframe`,{src:g??f,className:o.frame,title:l(`pdf.viewer`),"aria-label":l(`pdf.viewer`)}):(0,i.jsx)(t.t,{label:l(`pdf.noFile`,{defaultValue:`No PDF loaded`})}),(0,i.jsx)(n.n,{opened:m,acceptedMimeTypes:[`application/pdf`],onConfirm:_,onCancel:()=>h(!1)})]})};exports.default=s;
@@ -0,0 +1,38 @@
1
+ import { t as e } from "./useResolvedUrl-CgqjNxzw.js";
2
+ import { t } from "./AppEmptyState-BVfKZU-h.js";
3
+ import { n } from "./FilePickerApp-D7fERKbp.js";
4
+ import { useCallback as r, useEffect as i, useState as a } from "react";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { useTranslation as c } from "react-i18next";
7
+ var l = {
8
+ container: "_container_1hj4w_1",
9
+ frame: "_frame_1hj4w_7"
10
+ }, u = ({ window: u, notifyReady: d }) => {
11
+ let { t: f } = c("apps"), p = u, m = p?.contentData?.src, [h, g] = a(m ?? void 0), [_, v] = a(!1), y = e(h);
12
+ i(() => {
13
+ d?.({
14
+ ...p?.contentData ?? {},
15
+ setPickerOpen: () => v(!0)
16
+ });
17
+ }, [p, d]);
18
+ let b = r((e) => {
19
+ g(e.url ?? e.name), v(!1);
20
+ }, []);
21
+ return /* @__PURE__ */ s("div", {
22
+ className: l.container,
23
+ "data-windowid": p?.id,
24
+ children: [y || h ? /* @__PURE__ */ o("iframe", {
25
+ src: y ?? h,
26
+ className: l.frame,
27
+ title: f("pdf.viewer"),
28
+ "aria-label": f("pdf.viewer")
29
+ }) : /* @__PURE__ */ o(t, { label: f("pdf.noFile", { defaultValue: "No PDF loaded" }) }), /* @__PURE__ */ o(n, {
30
+ opened: _,
31
+ acceptedMimeTypes: ["application/pdf"],
32
+ onConfirm: b,
33
+ onCancel: () => v(!1)
34
+ })]
35
+ });
36
+ };
37
+ //#endregion
38
+ export { u as default };
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./AppMenuBar-38QtFTPk.cjs`);let t=require(`react`),n=require(`react/jsx-runtime`),r=require(`react-i18next`);var i=e=>{let{contentData:n,onExit:i}=e,{t:a}=(0,r.useTranslation)(`common`),o=n?.setPickerOpen;return(0,t.useMemo)(()=>[{type:`menu`,label:a(`menu.file`),items:[{type:`item`,label:a(`actions.open`),icon:`FcOpenedFolder`,onClick:()=>o?.()},{type:`divider`},{type:`item`,label:a(`actions.exit`),icon:`FcLeft`,onClick:i}]}],[a,o,i])},a=(0,t.memo)(({windowId:t,contentData:r,onExit:a})=>(0,n.jsx)(e.t,{elements:i({windowId:t,contentData:r,onExit:a})}));a.displayName=`PdfMenuBar`,exports.PdfMenuBar=a;
@@ -0,0 +1,38 @@
1
+ import { t as e } from "./AppMenuBar-DmSfQRXU.js";
2
+ import { memo as t, useMemo as n } from "react";
3
+ import { jsx as r } from "react/jsx-runtime";
4
+ import { useTranslation as i } from "react-i18next";
5
+ //#region src/components/Apps/PdfApp/usePdfMenuBar.ts
6
+ var a = (e) => {
7
+ let { contentData: t, onExit: r } = e, { t: a } = i("common"), o = t?.setPickerOpen;
8
+ return n(() => [{
9
+ type: "menu",
10
+ label: a("menu.file"),
11
+ items: [
12
+ {
13
+ type: "item",
14
+ label: a("actions.open"),
15
+ icon: "FcOpenedFolder",
16
+ onClick: () => o?.()
17
+ },
18
+ { type: "divider" },
19
+ {
20
+ type: "item",
21
+ label: a("actions.exit"),
22
+ icon: "FcLeft",
23
+ onClick: r
24
+ }
25
+ ]
26
+ }], [
27
+ a,
28
+ o,
29
+ r
30
+ ]);
31
+ }, o = t(({ windowId: t, contentData: n, onExit: i }) => /* @__PURE__ */ r(e, { elements: a({
32
+ windowId: t,
33
+ contentData: n,
34
+ onExit: i
35
+ }) }));
36
+ o.displayName = "PdfMenuBar";
37
+ //#endregion
38
+ export { o as PdfMenuBar };
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./i18nConstants-DgbKSBIK.cjs`),t=require(`./useResolvedUrl-Dz2AhrDV.cjs`),n=require(`./desktopStore-LSQweOqZ.cjs`),r=require(`./AppIcon-Czrtau6A.cjs`),i=require(`./useCloseInterceptor-AzfjUZgz.cjs`),a=require(`./Colors-PNt4eyR6.cjs`),o=require(`./ColorPicker-BZqsPh3X.cjs`),s=require(`./DownloadProgress-CpJguS8g.cjs`),c=require(`./FilePickerApp-ClmPw6lk.cjs`),l=require(`./settingsAppStore-CQ4JHd7Q.cjs`);let u=require(`react`),d=require(`react/jsx-runtime`),f=require(`@mantine/core`),p=require(`react-i18next`);var m=()=>{let{t:r}=(0,p.useTranslation)(`settings`),i=e._(e=>e.wallpaper),a=e._(e=>e.setWallpaper),o=e._(e=>e.setWallpaperModule),[s,l]=(0,u.useState)(``),[m,h]=(0,u.useState)(!1),g=(0,u.useRef)(null),_=t.t(i??void 0),v=i!==null&&t.u(i)?t.r:_??t.r,y=(0,u.useCallback)(async e=>{let t=e.target.files?.[0];if(t)try{a(await n.n.saveBlob(t)),o(`default`)}catch(e){console.error(`[StaticWallpaperModule] Failed to save wallpaper:`,e)}},[a,o]),b=(0,u.useCallback)(()=>{let e=s.trim();e&&(a(e),o(`default`))},[s,a,o]),x=(0,u.useCallback)(e=>{let t=e.url?e.url.startsWith(`idb://`)?e.url:`/${e.url}`:null;t&&(a(t),o(`default`)),h(!1)},[a,o]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`img`,{src:v,alt:r(`wallpaper.wallpaperPreview`),style:{width:`100%`,height:180,objectFit:`cover`,borderRadius:8}}),(0,d.jsxs)(f.Group,{children:[(0,d.jsx)(`input`,{ref:g,type:`file`,accept:`image/*`,style:{display:`none`},onChange:y,"aria-label":r(`wallpaper.uploadAria`,{defaultValue:`Upload wallpaper file`})}),(0,d.jsx)(f.Button,{variant:`light`,onClick:()=>h(!0),children:r(`wallpaper.chooseFromImages`)}),(0,d.jsx)(f.Button,{variant:`light`,onClick:()=>g.current?.click(),children:r(`wallpaper.uploadFromDisk`)})]}),(0,d.jsxs)(f.Group,{align:`flex-end`,children:[(0,d.jsx)(f.TextInput,{label:r(`wallpaper.orEnterUrl`),placeholder:`https://example.com/image.jpg`,value:s,onChange:e=>l(e.currentTarget.value),style:{flex:1}}),(0,d.jsx)(f.Button,{onClick:b,disabled:!s.trim(),children:r(`common:actions.apply`)})]}),(0,d.jsx)(c.n,{opened:m,acceptedMimeTypes:[`image/*`],onConfirm:x,onCancel:()=>h(!1)})]})},h=()=>{let t=e._(e=>e.wallpaper),n=e._(e=>e.wallpaperHasNoise),r=e._(e=>e.wallpaperNoiseOpacity),i=e._(e=>e.setWallpaper),a=e._(e=>e.setWallpaperHasNoise),o=e._(e=>e.setWallpaperNoiseOpacity),s=(0,u.useCallback)(e=>{i(e.wallpaperCSS),a(e.hasNoise),o(e.noiseOpacity)},[i,a,o]);return(0,d.jsx)(e.c,{value:t??``,onChange:s,hasNoiseInitial:n,noiseOpacityInitial:r})},g=()=>{let{t:n}=(0,p.useTranslation)(`settings`),r=e._(e=>e.wallpaperModule),i=e._(e=>e.wallpaper),a=e._(e=>e.setWallpaper),o=e._(e=>e.setWallpaperModule),s=(0,u.useRef)(``),c=(0,u.useCallback)(e=>{e===`gradient`?(t.u(i??``)||(s.current=i??``),a(t.n)):a(s.current||t.r),o(e)},[i,a,o]),l=(0,u.useCallback)(()=>{a(t.n),o(`gradient`)},[a,o]);return(0,d.jsxs)(e.s,{title:n(`wallpaper.title`),children:[(0,d.jsx)(`div`,{children:(0,d.jsx)(f.SegmentedControl,{value:r,onChange:c,data:[{value:`default`,label:n(`wallpaper.staticImage`)},{value:`gradient`,label:n(`wallpaper.gradient`)??`Gradient`}],fullWidth:!0})}),r===`gradient`?(0,d.jsx)(h,{}):(0,d.jsx)(m,{}),(0,d.jsx)(f.Button,{color:`red`,onClick:l,children:n(`wallpaper.resetToDefault`)})]})},_=()=>{let{t}=(0,p.useTranslation)(`settings`),n=e._(e=>e.theme.mode),r=e._(e=>e.themeSetManually),i=e._(e=>e.customThemeColors),a=e._(e=>e.animationDuration),s=e._(e=>e.setThemeMode),c=e._(e=>e.setThemeAutomatic),l=e._(e=>e.setCustomThemeColors),m=e._(e=>e.setAnimationDuration),h=i?`custom`:r?n:`system`,g=(0,u.useCallback)(e=>{e===`system`?(c(),l(null)):e===`custom`?l({taskbar:`#339af0`,window:`#ffffff`,accent:`#339af0`}):(s(e),l(null))},[s,c,l]),_=(0,u.useCallback)(e=>t=>{i&&l({...i,[e]:t})},[i,l]),v=(0,u.useCallback)(e=>{m(e)},[m]),y=h===`custom`;return(0,d.jsxs)(f.Stack,{gap:`md`,p:`md`,children:[(0,d.jsx)(f.Text,{fw:600,size:`lg`,children:t(`appearance.title`)}),(0,d.jsx)(f.Text,{size:`sm`,c:`dimmed`,children:t(`appearance.description`)}),(0,d.jsx)(f.SegmentedControl,{value:h,onChange:g,data:[{label:t(`common:theme.light`),value:`light`},{label:t(`common:theme.dark`),value:`dark`},{label:t(`common:theme.system`),value:`system`},{label:t(`common:theme.custom`),value:`custom`}],"aria-label":t(`appearance.themeMode`,{defaultValue:`Theme mode`})}),(0,d.jsxs)(f.Stack,{gap:`sm`,mt:`md`,children:[(0,d.jsxs)(f.Box,{children:[(0,d.jsx)(f.Text,{size:`sm`,fw:500,mb:`xs`,c:y?`dark`:void 0,children:t(`appearance.taskbar`)}),(0,d.jsx)(o.t,{value:i?.taskbar??`#339af0`,onChange:_(`taskbar`),disabled:!y})]}),(0,d.jsxs)(f.Box,{children:[(0,d.jsx)(f.Text,{size:`sm`,fw:500,mb:`xs`,c:y?`dark`:void 0,children:t(`appearance.window`)}),(0,d.jsx)(o.t,{value:i?.window??`#ffffff`,onChange:_(`window`),disabled:!y})]}),(0,d.jsxs)(f.Box,{children:[(0,d.jsx)(f.Text,{size:`sm`,fw:500,mb:`xs`,c:y?`dark`:void 0,children:t(`appearance.accent`)}),(0,d.jsx)(o.t,{value:i?.accent??`#339af0`,onChange:_(`accent`),disabled:!y})]})]}),(0,d.jsxs)(f.Box,{mt:`md`,children:[(0,d.jsx)(f.Text,{size:`sm`,fw:500,mb:`xs`,children:t(`appearance.animationDuration`)}),(0,d.jsx)(f.Text,{size:`xs`,c:`dimmed`,mb:`sm`,children:t(`appearance.animationDescription`)}),(0,d.jsxs)(f.Group,{align:`center`,gap:`md`,children:[(0,d.jsx)(f.Slider,{value:a,onChange:v,min:.1,max:1,step:.1,style:{flex:1},marks:[{value:.1,label:`0.1s`},{value:.5,label:`0.5s`},{value:1,label:`1.0s`}],"aria-label":t(`appearance.animationDuration`)}),(0,d.jsxs)(f.Text,{size:`sm`,fw:500,style:{minWidth:40},children:[a.toFixed(1),`s`]})]})]})]})},v=()=>{let t=e._(e=>e.launcherIcon),n=e._(e=>e.setLauncherIcon),[i,a]=(0,u.useState)([]),[o,s]=(0,u.useState)(``),c=(0,u.useDeferredValue)(o);(0,u.useEffect)(()=>{import(`react-icons/fc`).then(e=>{a(Object.keys(e).filter(e=>e.startsWith(`Fc`)).sort())})},[]);let l=c?i.filter(e=>e.toLowerCase().includes(c.toLowerCase())):i,p=(0,u.useCallback)(e=>{n(e)},[n]);return(0,d.jsxs)(e.s,{title:`Launcher Icon`,description:`Selected: ${t}`,children:[(0,d.jsx)(f.TextInput,{placeholder:`Search icons...`,value:o,onChange:e=>s(e.currentTarget.value),"aria-label":`Search icons`}),(0,d.jsx)(f.ScrollArea,{style:{flex:1,height:300},children:(0,d.jsx)(f.SimpleGrid,{cols:8,spacing:4,children:l.map(e=>(0,d.jsx)(f.Tooltip,{label:e,withArrow:!0,openDelay:400,children:(0,d.jsx)(f.UnstyledButton,{onClick:()=>p(e),"aria-label":e,"aria-pressed":e===t,style:{padding:6,borderRadius:6,background:e===t?`var(--mantine-primary-color-light)`:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,d.jsx)(r.t,{fcIcon:e,size:24})})},e))})})]})},y=a.t[1],b=({status:e,error:t,onDownload:n})=>{let{t:r}=(0,p.useTranslation)(`settings`);return t?(0,d.jsx)(f.Badge,{color:y,variant:`filled`,size:`sm`,"aria-label":`Download error: ${t}`,children:r(`common:status.error`)}):(0,d.jsx)(f.Button,{size:`xs`,variant:`light`,onClick:n,loading:e===`downloading`,"aria-label":r(`font.download`),children:r(`font.download`)})},x=()=>{let{t}=(0,p.useTranslation)(`settings`),n=e._(e=>e.font),r=e._(e=>e.setFont),i=e._(e=>e.fontSize),a=e._(e=>e.setFontSize),o=e._(e=>e.downloadedFonts),c=e._(e=>e.markFontDownloaded),[l,m]=(0,u.useState)(null),h=e.a(l);(0,u.useEffect)(()=>{h.isSuccess&&h.data?.success&&l&&(o.includes(l)||c(l))},[h.isSuccess,h.data,l,o,c]);let g=(0,u.useCallback)(e=>{m(e)},[]),_=e=>o.includes(e)?`done`:l===e?h.progress.status:`idle`,v=e=>l===e?h.progress.error:null,y=(0,u.useCallback)(t=>{let n=t.trim();n&&(e.f[n]=`https://fonts.googleapis.com/css2?family=${n.replace(/\s+/g,`+`)}&display=swap`,m(n))},[]),x=e.u.map(e=>e.value),C=o.filter(e=>!x.includes(e));return(0,d.jsxs)(f.Stack,{gap:`md`,p:`md`,children:[(0,d.jsx)(f.Text,{fw:600,size:`lg`,children:t(`font.title`)}),(0,d.jsx)(f.Text,{size:`sm`,c:`dimmed`,children:t(`font.description`)}),(0,d.jsx)(f.Radio.Group,{value:n,onChange:r,"aria-label":t(`font.selectionAria`,{defaultValue:`Font selection`}),children:(0,d.jsxs)(f.Stack,{gap:`xs`,children:[e.u.map(t=>{let n=!!e.f[t.value],r=o.includes(t.value),i=_(t.value),a=v(t.value),c=!n||r||i===`done`;return(0,d.jsx)(f.Paper,{p:`sm`,withBorder:!0,radius:`md`,children:(0,d.jsxs)(f.Stack,{gap:`xs`,children:[(0,d.jsxs)(f.Group,{justify:`space-between`,children:[(0,d.jsx)(f.Radio,{value:t.value,label:t.label,"aria-label":t.label,disabled:!c}),(0,d.jsxs)(f.Group,{gap:`xs`,align:`center`,children:[c&&(0,d.jsx)(f.Text,{size:`sm`,c:`dimmed`,style:{fontFamily:t.stack},children:`AaBbCcDd`}),n&&(0,d.jsx)(b,{fontLabel:t.label,status:i,error:a,onDownload:()=>g(t.value),isDownloaded:r})]})]}),n&&i===`downloading`&&(0,d.jsx)(s.t,{state:h.progress})]})},t.value)}),C.map(e=>(0,d.jsx)(f.Paper,{p:`sm`,withBorder:!0,radius:`md`,children:(0,d.jsxs)(f.Group,{justify:`space-between`,children:[(0,d.jsx)(f.Radio,{value:e,label:e,"aria-label":e}),(0,d.jsx)(f.Text,{size:`sm`,c:`dimmed`,style:{fontFamily:`"${e}"`},children:`AaBbCcDd`})]})},e))]})}),(0,d.jsx)(f.Paper,{p:`sm`,withBorder:!0,radius:`md`,children:(0,d.jsxs)(f.Stack,{gap:`xs`,children:[(0,d.jsxs)(f.Group,{justify:`space-between`,children:[(0,d.jsx)(f.Text,{size:`sm`,fw:500,children:t(`font.fontSize`)}),(0,d.jsxs)(f.Text,{size:`sm`,c:`dimmed`,children:[i,`px`]})]}),(0,d.jsx)(f.Slider,{value:i,onChange:a,min:10,max:24,step:1,marks:[{value:10},{value:14},{value:18},{value:20},{value:24}],"aria-label":t(`font.fontSizeAria`,{defaultValue:`Font size`})})]})}),(0,d.jsx)(S,{onDownload:y,activeDownload:l,fontDownload:h})]})},S=({onDownload:e,activeDownload:t,fontDownload:n})=>{let{t:r}=(0,p.useTranslation)(`settings`),[i,a]=(0,u.useState)(``),o=t===i.trim(),c=o?n.progress.status:`idle`,l=o&&n.progress.status===`error`,m=(0,u.useCallback)(e=>{a(e),l&&n.reset?.()},[l,n]),h=(0,u.useCallback)(()=>{e(i)},[i,e]),g=o&&c===`done`;return(0,d.jsx)(f.Paper,{p:`sm`,withBorder:!0,radius:`md`,children:(0,d.jsxs)(f.Stack,{gap:`xs`,children:[(0,d.jsxs)(f.Text,{size:`sm`,fw:500,children:[r(`font.downloadByName`),` `,(0,d.jsx)(`a`,{href:`https://fonts.google.com/`,target:`_blank`,rel:`noreferrer`,children:r(`font.fromGoogleFonts`)})]}),(0,d.jsxs)(f.Group,{gap:`xs`,align:`flex-start`,children:[(0,d.jsx)(f.TextInput,{placeholder:r(`font.namePlaceholder`,{defaultValue:`e.g. Open Sans`}),value:i,onChange:e=>m(e.currentTarget.value),style:{flex:1},"aria-label":r(`font.customNameAria`,{defaultValue:`Custom font name`}),error:l?r(`font.downloadError`):void 0}),(0,d.jsx)(f.Button,{onClick:h,disabled:!i.trim()||c===`downloading`,loading:c===`downloading`,"aria-label":r(`font.downloadCustomAria`,{defaultValue:`Download custom font`}),style:{marginTop:l?0:void 0},children:r(`font.download`)})]}),c===`downloading`&&(0,d.jsx)(s.t,{state:n.progress}),g&&(0,d.jsx)(f.Text,{size:`xs`,c:`dimmed`,children:r(`font.downloadSuccess`)})]})})},C={en:`English`,es:`Español`},w=()=>{let{t}=(0,p.useTranslation)(`settings`),n=e._(e=>e.language),r=e._(e=>e.setLanguage),i=(0,u.useCallback)(e=>{r(e)},[r]);return(0,d.jsx)(e.s,{title:t(`language.title`),description:t(`language.description`),children:(0,d.jsx)(f.Stack,{gap:`xs`,children:e.n.map(t=>(0,d.jsx)(f.UnstyledButton,{onClick:()=>i(t),"aria-label":C[t],"aria-pressed":t===n,style:{padding:`12px 16px`,borderRadius:8,width:`100%`,background:t===n?`var(--mantine-primary-color-light)`:`transparent`,border:t===n?`1px solid var(--mantine-primary-color-filled)`:`1px solid transparent`,transition:`all 0.15s ease`,cursor:`pointer`},children:(0,d.jsxs)(f.Group,{gap:`sm`,children:[(0,d.jsx)(e.p,{lang:t,size:24}),(0,d.jsx)(f.Text,{fw:t===n?600:400,children:C[t]})]})},t))})})};async function T(){n.G()&&(await fetch(`/api/fs/reset`,{method:`POST`}),await fetch(`/api/fs/seed`,{method:`POST`}))}var E=()=>{let{t}=(0,p.useTranslation)(`settings`),[n,r]=(0,u.useState)(!1),i=(0,u.useCallback)(()=>{r(!0)},[]),a=(0,u.useCallback)(()=>{r(!1)},[]),o=(0,u.useCallback)(async()=>{await T(),await e.i(),window.location.reload()},[]),s=(0,u.useCallback)(async()=>{await T(),await e.i({keepIndexedDB:!0}),window.location.reload()},[]);return(0,d.jsxs)(e.s,{title:t(`reset.title`),description:t(`reset.description`),children:[(0,d.jsx)(f.Button,{color:`red`,onClick:i,style:{alignSelf:`flex-start`},children:t(`reset.resetButton`)}),n&&(0,d.jsx)(f.Box,{style:{position:`fixed`,top:0,left:0,right:0,bottom:0,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3},role:`dialog`,"aria-label":`Confirm reset`,children:(0,d.jsx)(f.Box,{style:{background:`var(--mantine-color-default)`,borderRadius:8,padding:24,maxWidth:400,width:`100%`},children:(0,d.jsxs)(f.Stack,{gap:`md`,children:[(0,d.jsx)(f.Text,{fw:600,size:`lg`,ta:`center`,children:t(`reset.modalTitle`)}),(0,d.jsx)(f.Text,{size:`sm`,c:`dimmed`,ta:`center`,children:t(`reset.modalDescription`)}),(0,d.jsxs)(f.Group,{justify:`center`,gap:`xs`,mt:`md`,children:[(0,d.jsx)(f.Button,{variant:`default`,onClick:a,children:t(`reset.goBack`)}),(0,d.jsx)(f.Button,{color:`blue`,onClick:s,children:t(`reset.keepFiles`)}),(0,d.jsx)(f.Button,{color:`red`,onClick:o,children:t(`reset.burnEverything`)})]})]})})})]})},D={root:`_root_77epl_1`,sidebar:`_sidebar_77epl_8`,navItem:`_navItem_77epl_16`,content:`_content_77epl_41`,overviewPadding:`_overviewPadding_77epl_47`,sectionCard:`_sectionCard_77epl_51`,toolbar:`_toolbar_77epl_60`,dirtyIndicator:`_dirtyIndicator_77epl_70`,versionFooter:`_versionFooter_77epl_77`},O=`0.4.0`,k=()=>O,A={wallpaper:g,appearance:_,launcher:v,font:x,language:w,reset:E};function j(e,t,n,r,i,a,o,s){return{wallpaper:e,wallpaperModule:t,themeMode:n,font:r,fontSize:i,launcherIcon:a,customThemeColors:o,animationDuration:s}}var M=({window:t,notifyReady:a})=>{let{t:o}=(0,p.useTranslation)(`settings`),[s,c]=(0,u.useState)(null),[m,h]=(0,u.useState)(!1),g=n.o(e=>e.windows),_=t?.id??g.find(e=>e.content===`settings`)?.id,v=e._(e=>e.wallpaper),y=e._(e=>e.wallpaperModule),b=e._(e=>e.theme),x=e._(e=>e.font),S=e._(e=>e.fontSize),C=e._(e=>e.launcherIcon),w=e._(e=>e.customThemeColors),T=e._(e=>e.animationDuration),E=e._(e=>e.setWallpaper),O=e._(e=>e.setWallpaperModule),M=e._(e=>e.setFont),N=e._(e=>e.setFontSize),P=e._(e=>e.setLauncherIcon),F=e._(e=>e.setThemeMode),I=e._(e=>e.setCustomThemeColors),L=e._(e=>e.setThemeAutomatic),R=e._(e=>e.setAnimationDuration),z=(0,u.useRef)(null);(0,u.useEffect)(()=>{e.h()},[]),(0,u.useEffect)(()=>{z.current===null&&(z.current=j(v,y,b.mode,x,S,C,w,T))},[v,y,b.mode,x,S,C,w,T]),(0,u.useEffect)(()=>{if(!z.current)return;let e=j(v,y,b.mode,x,S,C,w,T);h(JSON.stringify(e)!==JSON.stringify(z.current))},[v,y,b.mode,x,S,C,w,T]);let B=(0,u.useCallback)(()=>{let t=z.current;t&&(E(t.wallpaper),O(t.wallpaperModule),M(t.font),N(t.fontSize),P(t.launcherIcon),R(t.animationDuration),t.customThemeColors?I(t.customThemeColors):(I(null),L()),F(t.themeMode),h(!1),e.g())},[E,O,M,N,P,R,F,I,L]);(0,u.useEffect)(()=>{_&&l.n.getState().reset(_)},[_]),(0,u.useEffect)(()=>{_&&l.n.getState().setIsDirty(_,m)},[_,m]),(0,u.useEffect)(()=>{a?.({...t?.contentData??{},discard:B})},[t,a,B]),i.i({isDirtyGetter:(0,u.useCallback)(()=>{if(!z.current)return!1;let t=e._.getState(),n=j(t.wallpaper,t.wallpaperModule,t.theme.mode,t.font,t.fontSize,t.launcherIcon,t.customThemeColors,t.animationDuration);return JSON.stringify(n)!==JSON.stringify(z.current)},[]),windowId:_,onDiscard:B,onSave:()=>{z.current=j(v,y,b.mode,x,S,C,w,T),h(!1),e.g()}});let V=(0,u.useCallback)(e=>{c(e)},[]),H=(0,u.useCallback)(()=>{c(null)},[]),U=(0,u.useCallback)(()=>{globalThis.location.href=`mailto:${e.r.email}`},[]),W=s?A[s]:null;return(0,d.jsxs)(`div`,{className:D.root,children:[(0,d.jsx)(`aside`,{className:D.sidebar,children:(0,d.jsxs)(`nav`,{"aria-label":`Settings sections`,children:[(0,d.jsxs)(`button`,{className:D.navItem,"data-active":s===null||void 0,onClick:H,"aria-label":`All Settings`,"aria-current":s===null?`page`:void 0,children:[(0,d.jsx)(r.t,{fcIcon:`FcList`,size:16}),(0,d.jsx)(f.Text,{size:`xs`,ml:6,truncate:!0,children:o(`all`)})]}),e.l.map(e=>(0,d.jsxs)(`button`,{className:D.navItem,"data-active":s===e.id||void 0,onClick:()=>V(e.id),"aria-label":e.label,"aria-current":s===e.id?`page`:void 0,children:[(0,d.jsx)(r.t,{fcIcon:e.fcIcon,size:16}),(0,d.jsx)(f.Text,{size:`xs`,ml:6,truncate:!0,children:o(`sections.${e.id}.label`)})]},e.id))]})}),(0,d.jsx)(`main`,{className:D.content,children:W?(0,d.jsx)(W,{}):(0,d.jsxs)(f.Stack,{className:D.overviewPadding,h:`100%`,justify:`space-between`,gap:0,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(f.Text,{fw:500,mb:`md`,size:`sm`,c:`dimmed`,children:o(`all`)}),(0,d.jsx)(f.SimpleGrid,{cols:2,spacing:`sm`,children:e.l.map(e=>(0,d.jsx)(f.Card,{withBorder:!0,padding:`md`,radius:`md`,className:D.sectionCard,onClick:()=>V(e.id),role:`button`,"aria-label":`Open ${e.label} settings`,children:(0,d.jsxs)(f.Stack,{gap:6,align:`flex-start`,children:[(0,d.jsx)(r.t,{fcIcon:e.fcIcon,size:28}),(0,d.jsx)(f.Text,{size:`sm`,fw:500,children:o(`sections.${e.id}.label`)}),(0,d.jsx)(f.Text,{size:`xs`,c:`dimmed`,children:o(`sections.${e.id}.description`)})]})},e.id))})]}),(0,d.jsx)(f.Button,{gradient:{from:`blue`,to:`cyan`,deg:90},onClick:U,children:`FDE: Fran Desktop Environment`}),(0,d.jsx)(f.Text,{size:`xs`,c:`dimmed`,ta:`center`,className:D.versionFooter,children:k()})]})})]})};exports.default=M;