@fde-desktop/fde-core 0.4.9 → 0.4.11

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 (186) hide show
  1. package/dist/{AppEmptyState-Bxpit0JV.js → AppEmptyState-Boej96TB.js} +1 -1
  2. package/dist/AppEmptyState-CLc00OOG.cjs +1 -0
  3. package/dist/AppIcon-C8vHUVcb.cjs +1 -0
  4. package/dist/AppIcon-mtEoyzOb.js +22 -0
  5. package/dist/AppMenuBar-CAlkNHjj.cjs +1 -0
  6. package/dist/AppMenuBar-DmSfQRXU.js +197 -0
  7. package/dist/CalendarApp-DOmjWbpl.js +10 -0
  8. package/dist/CalendarApp-Z0bCCYsK.cjs +1 -0
  9. package/dist/ColorPicker-CQRRwY-y.cjs +1 -0
  10. package/dist/ColorPicker-WCeD3Wjf.js +35 -0
  11. package/dist/CreateItemApp-BkFFFdX1.cjs +1 -0
  12. package/dist/CreateItemApp-DR8Y4bwo.js +202 -0
  13. package/dist/DeviceInfoApp-BXQ9uOwF.cjs +1 -0
  14. package/dist/DeviceInfoApp-I63mJRWy.js +195 -0
  15. package/dist/DownloadProgress-CkTGTf0z.cjs +1 -0
  16. package/dist/DownloadProgress-DnVASsv5.js +39 -0
  17. package/dist/FilePickerApp-By6-vbag.cjs +1 -0
  18. package/dist/FilePickerApp-ClHuhm6Z.js +390 -0
  19. package/dist/FilesApp-BC4UPNuw.cjs +1 -0
  20. package/dist/FilesApp-D8MqvC5X.js +210 -0
  21. package/dist/ImageViewerApp-B1niWF75.cjs +1 -0
  22. package/dist/{ImageViewerApp-BaLP3gkO.js → ImageViewerApp-iojtyFEf.js} +5 -5
  23. package/dist/{ImageViewerMenuBar-CabGSi9r.js → ImageViewerMenuBar-BIsUokxV.js} +2 -2
  24. package/dist/ImageViewerMenuBar-BgzgSF3v.cjs +1 -0
  25. package/dist/MenuEditApp-BHptoJbz.cjs +1 -0
  26. package/dist/{MenuEditApp-BTRppYnD.js → MenuEditApp-CJUbJaqh.js} +138 -143
  27. package/dist/MenuEditMenuBar-CCOSPAUe.cjs +1 -0
  28. package/dist/{MenuEditMenuBar-x1IQrHP2.js → MenuEditMenuBar-DnCL-kaZ.js} +3 -3
  29. package/dist/NotesApp-BmQIBtJ2.cjs +1 -0
  30. package/dist/{NotesApp-CQe7UfBC.js → NotesApp-DJ2dGt4-.js} +5 -5
  31. package/dist/NotesMenuBar-BzojwMtH.cjs +1 -0
  32. package/dist/{NotesMenuBar-VhpIe68v.js → NotesMenuBar-DILZTjnT.js} +3 -3
  33. package/dist/{PdfApp-DL_R9-Nc.js → PdfApp-IjY_GtnW.js} +3 -3
  34. package/dist/PdfApp-krW8UI97.cjs +1 -0
  35. package/dist/{PdfMenuBar-DZCLSOpR.js → PdfMenuBar-Bd5MTZcZ.js} +1 -1
  36. package/dist/PdfMenuBar-DWD0Qa3F.cjs +1 -0
  37. package/dist/SettingsApp-BE22l5UP.cjs +1 -0
  38. package/dist/SettingsApp-BTFtTFY_.js +1228 -0
  39. package/dist/SettingsMenuBar-CZE2evG2.cjs +1 -0
  40. package/dist/{SettingsMenuBar-YWiJHaxq.js → SettingsMenuBar-ktC0viTd.js} +3 -3
  41. package/dist/UploaderApp-CbypD538.js +263 -0
  42. package/dist/UploaderApp-D_qD3O70.cjs +1 -0
  43. package/dist/{VscIcon-DBfVnArE.js → VscIcon-AEENjKOE.js} +1 -1
  44. package/dist/VscIcon-BYb_Soyy.cjs +1 -0
  45. package/dist/buildBreadcrumbs-Ccd8i11b.cjs +1 -0
  46. package/dist/buildBreadcrumbs-noWhu8os.js +45 -0
  47. package/dist/{desktopStore-F8bgLqFl.js → desktopStore-8cSZlj7s.js} +407 -477
  48. package/dist/desktopStore-C1jR6Fdb.cjs +1 -0
  49. package/dist/imageViewerStore-Dfylg59V.cjs +1 -0
  50. package/dist/index.cjs +1 -1
  51. package/dist/index.css +1 -1
  52. package/dist/index.d.ts +16 -6
  53. package/dist/index.js +1646 -1960
  54. package/dist/menuEditStore-CYwtfD6H.cjs +1 -0
  55. package/dist/notesStore-CrWTO6oB.cjs +1 -0
  56. package/dist/settingsAppStore-DuYZNeFf.cjs +1 -0
  57. package/dist/useAdaptiveDimensions-3Lz4X0Tc.cjs +1 -0
  58. package/dist/{useAdaptiveDimensions-AVDc_qPa.js → useAdaptiveDimensions-DxNLJ7R5.js} +1 -1
  59. package/dist/{useCloseInterceptor-BZd3VILp.js → useCloseInterceptor-CIxhOZx1.js} +1 -1
  60. package/dist/useCloseInterceptor-CdX-09Ib.cjs +1 -0
  61. package/dist/useDynamicIcon-CK6SjEv5.cjs +1 -0
  62. package/dist/useOpenApp-D-FOY88T.cjs +1 -0
  63. package/dist/{useOpenApp-CBIm7Gzl.js → useOpenApp-DkZLFFCH.js} +51 -67
  64. package/dist/{useResolvedUrl-DQpLqOoL.js → useResolvedUrl-B6x4xy0x.js} +1 -2
  65. package/dist/useResolvedUrl-Bb39DpVy.cjs +1 -0
  66. package/package.json +2 -1
  67. package/dist/AccordionChevron-DxpOyInK.js +0 -26
  68. package/dist/AccordionChevron-kn5kSrEc.cjs +0 -1
  69. package/dist/ActionIcon-Drh4p6Fv.js +0 -145
  70. package/dist/ActionIcon-alk2zZD6.cjs +0 -1
  71. package/dist/AppEmptyState-BWCUbf-B.cjs +0 -1
  72. package/dist/AppIcon-BU7a3ZNH.cjs +0 -1
  73. package/dist/AppIcon-XumS3bIG.js +0 -80
  74. package/dist/AppMenuBar-B9U0n1Vv.cjs +0 -1
  75. package/dist/AppMenuBar-CnIEVjr8.js +0 -2049
  76. package/dist/Box-DSKR_qaa.js +0 -1579
  77. package/dist/Box-zW6Twge8.cjs +0 -1
  78. package/dist/Button-DMlnrqyx.cjs +0 -1
  79. package/dist/Button-wTOTQKxF.js +0 -178
  80. package/dist/CalendarApp-B_e1B1Yn.cjs +0 -1
  81. package/dist/CalendarApp-C-l9D6nd.cjs +0 -1
  82. package/dist/CalendarApp-D0ftTCTG.js +0 -1399
  83. package/dist/Center-CmxXB9ql.js +0 -25
  84. package/dist/Center-DKUE2pER.cjs +0 -1
  85. package/dist/CheckIcon-CZhtJD1O.cjs +0 -1
  86. package/dist/CheckIcon-N5qBqXQJ.js +0 -25
  87. package/dist/CodeServerApp-BOoGwZ7r.cjs +0 -1
  88. package/dist/CodeServerApp-Be3I5EGg.cjs +0 -1
  89. package/dist/CodeServerApp-DW18EZxa.js +0 -150
  90. package/dist/ColorPicker-BCNqi02x.js +0 -997
  91. package/dist/ColorPicker-BrDE7tMO.cjs +0 -1
  92. package/dist/CreateItemApp-B12M1E_1.cjs +0 -1
  93. package/dist/CreateItemApp-TAAprby3.js +0 -400
  94. package/dist/CreateItemApp-ePB6ujNl.cjs +0 -1
  95. package/dist/DeviceInfoApp-BMF18BGo.cjs +0 -1
  96. package/dist/DeviceInfoApp-DRy0H3aT.cjs +0 -1
  97. package/dist/DeviceInfoApp-lgpwkeRR.js +0 -223
  98. package/dist/DownloadProgress-EoyCaD5O.js +0 -174
  99. package/dist/DownloadProgress-VNdj22U8.cjs +0 -1
  100. package/dist/FileIcon-7JaSR3Gn.js +0 -89
  101. package/dist/FileIcon-CIXopWLv.cjs +0 -1
  102. package/dist/FilePickerApp-DaMgEqKh.js +0 -409
  103. package/dist/FilePickerApp-DjmuSFqa.cjs +0 -1
  104. package/dist/FilesApp-Bp7wfrBZ.cjs +0 -1
  105. package/dist/FilesApp-BpJJRKhi.cjs +0 -1
  106. package/dist/FilesApp-Cj94QG5o.js +0 -225
  107. package/dist/Group-CtBJSfCo.js +0 -48
  108. package/dist/Group-Dsrf6lEK.cjs +0 -1
  109. package/dist/ImageViewerApp-DlHGeB3S.cjs +0 -1
  110. package/dist/ImageViewerApp-DoXd_Swu.cjs +0 -1
  111. package/dist/ImageViewerMenuBar-SAI7UNz7.cjs +0 -1
  112. package/dist/ImageViewerMenuBar-_Jr29gii.cjs +0 -1
  113. package/dist/MenuEditApp-BJjlPTOa.cjs +0 -1
  114. package/dist/MenuEditApp-JPsGT-S3.cjs +0 -1
  115. package/dist/MenuEditMenuBar-BydGkqMw.cjs +0 -1
  116. package/dist/MenuEditMenuBar-DptlwVPQ.cjs +0 -1
  117. package/dist/NotesApp-BOcRGO7w.cjs +0 -1
  118. package/dist/NotesApp-OL07JXRE.cjs +0 -1
  119. package/dist/NotesMenuBar-BSI_2Y7p.cjs +0 -1
  120. package/dist/NotesMenuBar-Df6aW85J.cjs +0 -1
  121. package/dist/Paper-BX_9odR6.js +0 -30
  122. package/dist/Paper-D8-BaBx2.cjs +0 -1
  123. package/dist/PdfApp-CNEbty5v.cjs +0 -1
  124. package/dist/PdfApp-CVv3ZCaM.cjs +0 -1
  125. package/dist/PdfMenuBar--E6kDyrT.cjs +0 -1
  126. package/dist/PdfMenuBar-Dj5cJUkg.cjs +0 -1
  127. package/dist/SettingsApp-BlmHuAjT.js +0 -1831
  128. package/dist/SettingsApp-CNvIgf5B.cjs +0 -1
  129. package/dist/SettingsApp-DWxanNE4.cjs +0 -1
  130. package/dist/SettingsMenuBar-CBoOBCfx.cjs +0 -1
  131. package/dist/SettingsMenuBar-DQooFkZN.cjs +0 -1
  132. package/dist/Slider-BUiHxjKO.cjs +0 -1
  133. package/dist/Slider-t-NcD60t.js +0 -1176
  134. package/dist/Stack-Bp1Ek2Gp.js +0 -34
  135. package/dist/Stack-D4jAiRfc.cjs +0 -1
  136. package/dist/StorybookApp-CDLV_kja.cjs +0 -1
  137. package/dist/StorybookApp-DKwlPCmo.js +0 -10
  138. package/dist/TerminalApp-BCB7i1lR.cjs +0 -1
  139. package/dist/TerminalApp-BYc_gHLe.js +0 -326
  140. package/dist/TerminalApp-Dviz6aP2.cjs +0 -1
  141. package/dist/TerminalMenuBar-D5tPmgR_.js +0 -113
  142. package/dist/TerminalMenuBar-DNshPmCa.cjs +0 -1
  143. package/dist/TerminalMenuBar-HzMSR7XP.cjs +0 -1
  144. package/dist/TextInput-C-JtGWn1.js +0 -981
  145. package/dist/TextInput-CrsmcOip.cjs +0 -1
  146. package/dist/Tooltip-D5Cd9wtz.cjs +0 -1
  147. package/dist/Tooltip-DOeIvhrO.js +0 -1142
  148. package/dist/UnstyledButton-DGaG-e_G.js +0 -25
  149. package/dist/UnstyledButton-DX2pTahr.cjs +0 -1
  150. package/dist/UploaderApp-C6xA5Rrf2.cjs +0 -1
  151. package/dist/UploaderApp-DnHIRxB_.cjs +0 -1
  152. package/dist/UploaderApp-qBfpukR_.js +0 -488
  153. package/dist/VscIcon-CcMdrFoJ.cjs +0 -1
  154. package/dist/create-safe-context-Bboj0GWC.cjs +0 -1
  155. package/dist/create-safe-context-XT2cxc14.js +0 -12
  156. package/dist/desktopStore-CZoA9VHO.cjs +0 -1
  157. package/dist/getRuntime-BFK0-8R1.cjs +0 -1
  158. package/dist/getRuntime-DAPqFH2W.js +0 -63
  159. package/dist/imageViewerStore-BB_tssZR.cjs +0 -1
  160. package/dist/is-element-Bu_JY8Qy.js +0 -7
  161. package/dist/is-element-CdV0xajp.cjs +0 -1
  162. package/dist/menuEditStore-CTeM_dns.cjs +0 -1
  163. package/dist/notesStore-BCEl1D_v.cjs +0 -1
  164. package/dist/settingsAppStore-CMBc13VU.cjs +0 -1
  165. package/dist/terminalStore-IWdf4Mm6.js +0 -30
  166. package/dist/terminalStore-iIuyodfK.cjs +0 -1
  167. package/dist/use-merged-ref-BT8_u6vW.js +0 -25
  168. package/dist/use-merged-ref-n9Gw9LNn.cjs +0 -1
  169. package/dist/use-resolved-styles-api-8OXE2oRq.cjs +0 -1
  170. package/dist/use-resolved-styles-api-DNUlJJZf.js +0 -21
  171. package/dist/use-uncontrolled-A4hm9ATM.js +0 -23
  172. package/dist/use-uncontrolled-DDJVQiM_.cjs +0 -1
  173. package/dist/useAdaptiveDimensions-CfITBJ_m.cjs +0 -1
  174. package/dist/useCloseInterceptor-yntBEzNc.cjs +0 -1
  175. package/dist/useDynamicIcon-DJ_il30E.cjs +0 -1
  176. package/dist/useOpenApp-DW4x79Zg.cjs +0 -1
  177. package/dist/useResolvedUrl-BkMPM1fM.cjs +0 -1
  178. /package/dist/{Colors-zP2AFgU3.cjs → Colors-CNJbU7oq.cjs} +0 -0
  179. /package/dist/{Colors-ClnDxnyA.js → Colors-CuABn2W4.js} +0 -0
  180. /package/dist/{imageViewerStore-C5kWz0o7.js → imageViewerStore-COrD02Zu.js} +0 -0
  181. /package/dist/{menuEditStore-Cj1zAwxQ.js → menuEditStore-CxsgLiQu.js} +0 -0
  182. /package/dist/{notesStore-BPyRTHEc.js → notesStore-Dgah46U5.js} +0 -0
  183. /package/dist/{settingsAppStore-BDQ3ts1y.js → settingsAppStore-DHZhi6Rl.js} +0 -0
  184. /package/dist/{useDynamicIcon-Bf0t2foA.js → useDynamicIcon-_wGeWu-b.js} +0 -0
  185. /package/dist/{useMenuBarUtils-nmu9yehT.js → useMenuBarUtils-ChAfI7OA.js} +0 -0
  186. /package/dist/{useMenuBarUtils-nJIPJGIQ.cjs → useMenuBarUtils-DAap0ukp.cjs} +0 -0
@@ -0,0 +1,195 @@
1
+ import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
+ import { G as t, W as n, o as r, p as i } from "./desktopStore-8cSZlj7s.js";
3
+ import { t as a } from "./useAdaptiveDimensions-DxNLJ7R5.js";
4
+ import { useCallback as o, useEffect as s, useState as c } from "react";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ import { Code as d, Paper as f, Stack as p, Text as m } from "@mantine/core";
7
+ //#region src/hooks/useDeviceDetection.ts
8
+ var h = () => {
9
+ let e = window.innerWidth, t = window.matchMedia("(pointer: coarse)").matches;
10
+ return e < i.MOBILE || t;
11
+ }, g = () => {
12
+ let e = window.innerWidth;
13
+ return e >= i.MOBILE && e < i.TABLET;
14
+ }, _ = () => window.innerWidth >= i.TABLET, v = () => screen.orientation ? screen.orientation.type.includes("portrait") : window.innerHeight > window.innerWidth;
15
+ function y() {
16
+ let [e, t] = c(() => ({
17
+ isMobile: h(),
18
+ isTablet: g(),
19
+ isDesktop: _(),
20
+ isPortrait: v(),
21
+ shouldShowWarning: h() && v(),
22
+ screenWidth: window.innerWidth,
23
+ screenHeight: window.innerHeight
24
+ })), n = o(() => {
25
+ let e = h(), n = v();
26
+ t({
27
+ isMobile: e,
28
+ isTablet: g(),
29
+ isDesktop: _(),
30
+ isPortrait: n,
31
+ shouldShowWarning: e && n,
32
+ screenWidth: window.innerWidth,
33
+ screenHeight: window.innerHeight
34
+ });
35
+ }, []);
36
+ return s(() => (window.addEventListener("resize", n), screen.orientation?.addEventListener?.("change", n), () => {
37
+ window.removeEventListener("resize", n), screen.orientation?.removeEventListener?.("change", n);
38
+ }), [n]), e;
39
+ }
40
+ var b = { container: "_container_1o4i3_1" }, x = /* @__PURE__ */ e({ default: () => S }), S = ({ window: e, notifyReady: i }) => {
41
+ let o = y(), c = a(), h = r((e) => e.viewportWidth), g = r((e) => e.viewportHeight), _ = r((e) => e.setViewportSize);
42
+ return s(() => {
43
+ i?.({});
44
+ }, [i]), s(() => {
45
+ let e = () => {
46
+ _(window.innerWidth, window.innerHeight);
47
+ };
48
+ return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
49
+ }, [_]), /* @__PURE__ */ u("div", {
50
+ className: b.container,
51
+ "data-windowid": e?.id,
52
+ children: [/* @__PURE__ */ l(f, {
53
+ p: "sm",
54
+ shadow: "sm",
55
+ withBorder: !0,
56
+ children: /* @__PURE__ */ u(p, {
57
+ gap: "xs",
58
+ children: [
59
+ /* @__PURE__ */ l(m, {
60
+ fw: "bold",
61
+ size: "sm",
62
+ children: "Runtime Environment"
63
+ }),
64
+ /* @__PURE__ */ u(m, {
65
+ size: "xs",
66
+ children: [
67
+ /* @__PURE__ */ l(d, { children: "isDocker:" }),
68
+ " ",
69
+ String(t())
70
+ ]
71
+ }),
72
+ /* @__PURE__ */ u(m, {
73
+ size: "xs",
74
+ children: [
75
+ /* @__PURE__ */ l(d, { children: "isDev:" }),
76
+ " ",
77
+ String(n())
78
+ ]
79
+ })
80
+ ]
81
+ })
82
+ }), /* @__PURE__ */ l(f, {
83
+ p: "sm",
84
+ shadow: "sm",
85
+ withBorder: !0,
86
+ mt: "sm",
87
+ children: /* @__PURE__ */ u(p, {
88
+ gap: "xs",
89
+ children: [
90
+ /* @__PURE__ */ l(m, {
91
+ fw: "bold",
92
+ size: "sm",
93
+ children: "Device Detection"
94
+ }),
95
+ /* @__PURE__ */ u(m, {
96
+ size: "xs",
97
+ children: [
98
+ /* @__PURE__ */ l(d, { children: "isMobile:" }),
99
+ " ",
100
+ String(o.isMobile)
101
+ ]
102
+ }),
103
+ /* @__PURE__ */ u(m, {
104
+ size: "xs",
105
+ children: [
106
+ /* @__PURE__ */ l(d, { children: "isTablet:" }),
107
+ " ",
108
+ String(o.isTablet)
109
+ ]
110
+ }),
111
+ /* @__PURE__ */ u(m, {
112
+ size: "xs",
113
+ children: [
114
+ /* @__PURE__ */ l(d, { children: "isDesktop:" }),
115
+ " ",
116
+ String(o.isDesktop)
117
+ ]
118
+ }),
119
+ /* @__PURE__ */ u(m, {
120
+ size: "xs",
121
+ children: [
122
+ /* @__PURE__ */ l(d, { children: "isPortrait:" }),
123
+ " ",
124
+ String(o.isPortrait)
125
+ ]
126
+ }),
127
+ /* @__PURE__ */ u(m, {
128
+ size: "xs",
129
+ children: [
130
+ /* @__PURE__ */ l(d, { children: "shouldShowWarning:" }),
131
+ " ",
132
+ String(o.shouldShowWarning)
133
+ ]
134
+ }),
135
+ /* @__PURE__ */ u(m, {
136
+ size: "xs",
137
+ children: [
138
+ /* @__PURE__ */ l(d, { children: "viewportWidth:" }),
139
+ " ",
140
+ h,
141
+ "px"
142
+ ]
143
+ }),
144
+ /* @__PURE__ */ u(m, {
145
+ size: "xs",
146
+ children: [
147
+ /* @__PURE__ */ l(d, { children: "viewportHeight:" }),
148
+ " ",
149
+ g,
150
+ "px"
151
+ ]
152
+ }),
153
+ /* @__PURE__ */ u(m, {
154
+ size: "xs",
155
+ children: [
156
+ /* @__PURE__ */ l(d, { children: "defaultWidth:" }),
157
+ " ",
158
+ c.defaultWidth,
159
+ "px"
160
+ ]
161
+ }),
162
+ /* @__PURE__ */ u(m, {
163
+ size: "xs",
164
+ children: [
165
+ /* @__PURE__ */ l(d, { children: "defaultHeight:" }),
166
+ " ",
167
+ c.defaultHeight,
168
+ "px"
169
+ ]
170
+ }),
171
+ /* @__PURE__ */ u(m, {
172
+ size: "xs",
173
+ children: [
174
+ /* @__PURE__ */ l(d, { children: "minWidth:" }),
175
+ " ",
176
+ c.minWidth,
177
+ "px"
178
+ ]
179
+ }),
180
+ /* @__PURE__ */ u(m, {
181
+ size: "xs",
182
+ children: [
183
+ /* @__PURE__ */ l(d, { children: "minHeight:" }),
184
+ " ",
185
+ c.minHeight,
186
+ "px"
187
+ ]
188
+ })
189
+ ]
190
+ })
191
+ })]
192
+ });
193
+ };
194
+ //#endregion
195
+ export { x as n, y as r, S as t };
@@ -0,0 +1 @@
1
+ require(`./NotesApp-BmQIBtJ2.cjs`);const e=require(`./useDynamicIcon-CK6SjEv5.cjs`);let t=require(`react`),n=require(`react/jsx-runtime`),r=require(`@mantine/core`);var i={spinner:`_spinner_yguq4_1`,spin:`_spin_yguq4_1`},a=e=>(e/1024).toFixed(1),o=({state:o,ariaLabel:s=`Download progress`,minDisplayTime:c=1e3})=>{let{status:l,loaded:u,total:d}=o,f=e.i(`FcProcess`,{size:24}),[p,m]=(0,t.useState)(null);if((0,t.useEffect)(()=>{if(l!==`done`&&l!==`error`)return;let e=Date.now(),t=setTimeout(()=>{m(e)},c);return()=>clearTimeout(t)},[l,c]),l===`idle`)return null;let h=d===null?`${a(u)} KB`:`${a(u)} / ${a(d)} KB`;return p?(0,n.jsx)(r.Progress,{value:100,size:`sm`,"aria-label":s,children:(0,n.jsxs)(r.Progress.Label,{children:[a(u),` KB`]})}):(0,n.jsxs)(r.Group,{gap:`sm`,align:`center`,justify:`center`,style:{minHeight:40},children:[(0,n.jsx)(r.Box,{className:i.spinner,"data-testid":`process-icon`,children:f}),(0,n.jsx)(r.Text,{size:`sm`,children:h})]})};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
@@ -0,0 +1,39 @@
1
+ import { i as e } from "./useDynamicIcon-_wGeWu-b.js";
2
+ import { useEffect as t, useState as n } from "react";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ import { Box as a, Group as o, Progress as s, Text as c } from "@mantine/core";
5
+ var l = {
6
+ spinner: "_spinner_yguq4_1",
7
+ spin: "_spin_yguq4_1"
8
+ }, u = (e) => (e / 1024).toFixed(1), d = ({ state: d, ariaLabel: f = "Download progress", minDisplayTime: p = 1e3 }) => {
9
+ let { status: m, loaded: h, total: g } = d, _ = e("FcProcess", { size: 24 }), [v, y] = n(null);
10
+ if (t(() => {
11
+ if (m !== "done" && m !== "error") return;
12
+ let e = Date.now(), t = setTimeout(() => {
13
+ y(e);
14
+ }, p);
15
+ return () => clearTimeout(t);
16
+ }, [m, p]), m === "idle") return null;
17
+ let b = g === null ? `${u(h)} KB` : `${u(h)} / ${u(g)} KB`;
18
+ return v ? /* @__PURE__ */ r(s, {
19
+ value: 100,
20
+ size: "sm",
21
+ "aria-label": f,
22
+ children: /* @__PURE__ */ i(s.Label, { children: [u(h), " KB"] })
23
+ }) : /* @__PURE__ */ i(o, {
24
+ gap: "sm",
25
+ align: "center",
26
+ justify: "center",
27
+ style: { minHeight: 40 },
28
+ children: [/* @__PURE__ */ r(a, {
29
+ className: l.spinner,
30
+ "data-testid": "process-icon",
31
+ children: _
32
+ }), /* @__PURE__ */ r(c, {
33
+ size: "sm",
34
+ children: b
35
+ })]
36
+ });
37
+ };
38
+ //#endregion
39
+ export { d as t };
@@ -0,0 +1 @@
1
+ require(`./NotesApp-BmQIBtJ2.cjs`);const e=require(`./desktopStore-C1jR6Fdb.cjs`),t=require(`./buildBreadcrumbs-Ccd8i11b.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`),i=require(`@mantine/core`),a=require(`react-i18next`);var o={root:`_root_b2ks8_1`,breadcrumbBar:`_breadcrumbBar_b2ks8_8`,breadcrumbSep:`_breadcrumbSep_b2ks8_15`,body:`_body_b2ks8_20`,sidebar:`_sidebar_b2ks8_27`,folderTree:`_folderTree_b2ks8_34`,treeItem:`_treeItem_b2ks8_41`,content:`_content_b2ks8_61`,grid:`_grid_b2ks8_67`,item:`_item_b2ks8_75`,icon:`_icon_b2ks8_97`,name:`_name_b2ks8_105`,empty:`_empty_b2ks8_117`,actionBar:`_actionBar_b2ks8_125`,selectedLabel:`_selectedLabel_b2ks8_136`,saveActionBar:`_saveActionBar_b2ks8_142`,fileNameInput:`_fileNameInput_b2ks8_152`,overlay:`_overlay_b2ks8_158`,panel:`_panel_b2ks8_168`},s=(0,n.memo)(({currentFolderId:e,fsNodes:n,onNavigate:a})=>{let s=t.t(e,n);return(0,r.jsx)(`div`,{className:o.breadcrumbBar,children:(0,r.jsx)(i.Breadcrumbs,{separator:`›`,classNames:{separator:o.breadcrumbSep},children:s.map((e,t)=>t===s.length-1?(0,r.jsx)(i.Text,{size:`xs`,fw:500,children:e.name},e.id??`root`):(0,r.jsx)(i.Anchor,{size:`xs`,onClick:()=>a(e.id),children:e.name},e.id??`root`))})})}),c=(0,n.memo)(({node:e,allNodes:n,currentFolderId:a,depth:s,onNavigate:l})=>{let u=n.filter(t=>t.parentId===e.id&&t.type===`folder`);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.UnstyledButton,{className:o.treeItem,"data-active":a===e.id||void 0,style:{paddingLeft:8+s*14},onClick:()=>l(e.id),"aria-label":e.name,"aria-current":a===e.id?`page`:void 0,children:[(0,r.jsx)(t.n,{type:`folder`,folderNode:e,size:14}),(0,r.jsx)(i.Text,{size:`xs`,ml:6,truncate:!0,children:e.name})]}),u.map(e=>(0,r.jsx)(c,{node:e,allNodes:n,currentFolderId:a,depth:s+1,onNavigate:l},e.id))]})}),l=(0,n.memo)(({currentFolderId:e,fsNodes:n,onNavigate:s})=>{let{t:l}=(0,a.useTranslation)(`window`),u=n.filter(e=>e.parentId===null&&e.type===`folder`);return(0,r.jsx)(`aside`,{className:o.sidebar,children:(0,r.jsxs)(`nav`,{className:o.folderTree,"aria-label":l(`fileDialog.folderTreeAria`,{ns:`common`}),children:[(0,r.jsxs)(i.UnstyledButton,{className:o.treeItem,"data-active":e===null||void 0,style:{paddingLeft:8},onClick:()=>s(null),"aria-label":l(`common:labels.home`),"aria-current":e===null?`page`:void 0,children:[(0,r.jsx)(t.n,{type:`folder`,size:14}),(0,r.jsx)(i.Text,{size:`xs`,ml:6,fw:500,children:l(`common:labels.home`)})]}),u.map(t=>(0,r.jsx)(c,{node:t,allNodes:n,currentFolderId:e,depth:1,onNavigate:s},t.id))]})})}),u=(0,n.memo)(({currentFolderId:n,fsNodes:s,onNavigate:c,onItemDoubleClick:l})=>{let{t:u}=(0,a.useTranslation)(`window`),d=s.filter(e=>e.parentId===n&&e.type===`folder`);if(d.length===0)return(0,r.jsx)(`div`,{className:o.empty,children:(0,r.jsx)(i.Text,{size:`sm`,c:`dimmed`,children:u(`common:messages.noSubfolders`)})});let f=e.E(d);return(0,r.jsx)(`div`,{className:o.grid,role:`listbox`,"aria-label":u(`fileDialog.foldersAria`,{ns:`common`}),children:f.map(e=>(0,r.jsxs)(i.UnstyledButton,{className:o.item,onDoubleClick:()=>{c(e.id),l?.(e)},"aria-label":u(`fileDialog.openFolder`,{name:e.name}),role:`option`,children:[(0,r.jsx)(`div`,{className:o.icon,children:(0,r.jsx)(t.n,{type:`folder`,name:e.name,folderNode:e,size:32})}),(0,r.jsx)(i.Text,{size:`xs`,className:o.name,truncate:!0,children:e.name})]},e.id))})}),d=(0,n.memo)(({opened:e,children:t,ariaLabelKey:n,ariaLabelNs:i=`window`})=>{let{t:s}=(0,a.useTranslation)(i);return e?(0,r.jsx)(`div`,{className:o.overlay,role:`dialog`,"aria-label":s(n),children:(0,r.jsx)(`div`,{className:o.panel,children:t})}):null}),f=({acceptedMimeTypes:c,onConfirm:u,onCancel:d})=>{let{t:f}=(0,a.useTranslation)(`window`),p=e.o(e=>e.fsNodes),[m,h]=(0,n.useState)(null),[g,_]=(0,n.useState)(null),v=m===null?p.filter(e=>e.parentId===null):p.filter(e=>e.parentId===m),y=v.filter(e=>{if(e.type===`folder`)return!0;let t=e;return!c||c.length===0?!0:c.some(e=>t.mimeType===e||e.endsWith(`/*`)&&t.mimeType?.startsWith(e.slice(0,-1)))}),b=(0,n.useCallback)(e=>{h(e),_(null)},[]),x=(0,n.useCallback)(e=>{e.type===`file`&&_(e)},[]),S=(0,n.useCallback)(e=>{e.type===`folder`?b(e.id):u(e)},[b,u]);return(0,r.jsxs)(`div`,{className:o.root,children:[(0,r.jsx)(s,{currentFolderId:m,fsNodes:p,onNavigate:b}),(0,r.jsxs)(`div`,{className:o.body,children:[(0,r.jsx)(l,{currentFolderId:m,fsNodes:p,onNavigate:b}),(0,r.jsx)(`main`,{className:o.content,children:y.length===0?(0,r.jsx)(`div`,{className:o.empty,children:(0,r.jsx)(i.Text,{size:`sm`,c:`dimmed`,children:v.length===0?f(`common:messages.folderEmpty`):f(`common:messages.noMatchingFiles`)})}):(0,r.jsx)(`div`,{className:o.grid,role:`listbox`,"aria-label":f(`fileDialog.filesAria`,{ns:`common`}),children:e.E(y).map(e=>{let n=g?.id===e.id;return(0,r.jsxs)(i.UnstyledButton,{className:o.item,"data-selected":n||void 0,"data-type":e.type,onClick:()=>x(e),onDoubleClick:()=>S(e),"aria-label":e.type===`folder`?f(`fileDialog.openFolder`,{name:e.name,ns:`window`}):f(`fileDialog.selectFile`,{name:e.name,ns:`window`}),"aria-selected":e.type===`file`?n:void 0,role:`option`,children:[(0,r.jsx)(`div`,{className:o.icon,children:(0,r.jsx)(t.n,{type:e.type,name:e.name,folderNode:e.type===`folder`?e:void 0,size:32})}),(0,r.jsx)(i.Text,{size:`xs`,className:o.name,truncate:!0,children:e.name})]},e.id)})})})]}),(0,r.jsxs)(`div`,{className:o.actionBar,children:[(0,r.jsx)(i.Text,{size:`xs`,c:`dimmed`,truncate:!0,className:o.selectedLabel,children:g?g.name:f(`common:messages.noFileSelected`)}),(0,r.jsxs)(i.Group,{gap:`xs`,children:[(0,r.jsx)(i.Button,{variant:`default`,size:`xs`,onClick:d,"aria-label":f(`filePicker.cancelAria`,{ns:`common`}),children:f(`common:actions.cancel`)}),(0,r.jsx)(i.Button,{size:`xs`,disabled:!g,onClick:()=>g&&u(g),"aria-label":f(`filePicker.openSelectedAria`,{ns:`common`}),children:f(`common:actions.open`)})]})]})]})},p=({opened:e,...t})=>e?(0,r.jsx)(d,{opened:e,ariaLabelKey:`fileDialog.openFile`,children:(0,r.jsx)(f,{...t})}):null,m=({initialName:t=`untitled.md`,onConfirm:c,onCancel:d})=>{let{t:f}=(0,a.useTranslation)(`window`),p=e.o(e=>e.fsNodes),[m,h]=(0,n.useState)(null),[g,_]=(0,n.useState)(t),v=(0,n.useCallback)(e=>{h(e)},[]),y=(0,n.useCallback)(()=>{let e=g.trim();e&&c({parentId:m,name:e.endsWith(`.md`)?e:`${e}.md`})},[g,m,c]);return(0,r.jsxs)(`div`,{className:o.root,children:[(0,r.jsx)(s,{currentFolderId:m,fsNodes:p,onNavigate:v}),(0,r.jsxs)(`div`,{className:o.body,children:[(0,r.jsx)(l,{currentFolderId:m,fsNodes:p,onNavigate:v}),(0,r.jsx)(`main`,{className:o.content,children:(0,r.jsx)(u,{currentFolderId:m,fsNodes:p,onNavigate:v})})]}),(0,r.jsxs)(`div`,{className:o.saveActionBar,children:[(0,r.jsx)(i.TextInput,{size:`xs`,placeholder:f(`fileDialog.filename`),value:g,onChange:e=>_(e.currentTarget.value),onKeyDown:e=>e.key===`Enter`&&y(),"aria-label":f(`filePicker.fileNameAria`,{ns:`common`}),className:o.fileNameInput}),(0,r.jsxs)(i.Group,{gap:`xs`,style:{flexShrink:0},children:[(0,r.jsx)(i.Button,{variant:`default`,size:`xs`,onClick:d,"aria-label":f(`filePicker.cancelAria`,{ns:`common`}),children:f(`common:actions.cancel`)}),(0,r.jsx)(i.Button,{size:`xs`,disabled:!g.trim(),onClick:y,"aria-label":f(`fileDialog.saveFile`),children:f(`common:actions.save`)})]})]})]})},h=({opened:e,...t})=>e?(0,r.jsx)(d,{opened:e,ariaLabelKey:`fileDialog.saveFile`,children:(0,r.jsx)(m,{...t})}):null,g=({onConfirm:t,onCancel:c})=>{let{t:d}=(0,a.useTranslation)(`window`),f=e.o(e=>e.fsNodes),[p,m]=(0,n.useState)(null),h=(0,n.useCallback)(e=>{m(e)},[]),g=(0,n.useCallback)(()=>{t(p)},[p,t]);return(0,r.jsxs)(`div`,{className:o.root,children:[(0,r.jsx)(s,{currentFolderId:p,fsNodes:f,onNavigate:h}),(0,r.jsxs)(`div`,{className:o.body,children:[(0,r.jsx)(l,{currentFolderId:p,fsNodes:f,onNavigate:h}),(0,r.jsx)(`main`,{className:o.content,children:(0,r.jsx)(u,{currentFolderId:p,fsNodes:f,onNavigate:h})})]}),(0,r.jsxs)(`div`,{className:o.actionBar,children:[(0,r.jsx)(i.Text,{size:`xs`,c:`dimmed`,truncate:!0,className:o.selectedLabel,children:p===null?d(`common:labels.home`):f.find(e=>e.id===p)?.name??``}),(0,r.jsxs)(i.Group,{gap:`xs`,children:[(0,r.jsx)(i.Button,{variant:`default`,size:`xs`,onClick:c,"aria-label":d(`filePicker.cancelAria`,{ns:`common`}),children:d(`common:actions.cancel`)}),(0,r.jsx)(i.Button,{size:`xs`,onClick:g,"aria-label":d(`fileDialog.selectFolder`),children:d(`common:actions.select`)})]})]})]})},_=({opened:e,...t})=>e?(0,r.jsx)(d,{opened:e,ariaLabelKey:`fileDialog.selectFolder`,children:(0,r.jsx)(g,{...t})}):null;Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
@@ -0,0 +1,390 @@
1
+ import { E as e, o as t } from "./desktopStore-8cSZlj7s.js";
2
+ import { n, t as r } from "./buildBreadcrumbs-noWhu8os.js";
3
+ import { memo as i, useCallback as a, useState as o } from "react";
4
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
5
+ import { Anchor as u, Breadcrumbs as d, Button as f, Group as p, Text as m, TextInput as h, UnstyledButton as g } from "@mantine/core";
6
+ import { useTranslation as _ } from "react-i18next";
7
+ var v = {
8
+ root: "_root_b2ks8_1",
9
+ breadcrumbBar: "_breadcrumbBar_b2ks8_8",
10
+ breadcrumbSep: "_breadcrumbSep_b2ks8_15",
11
+ body: "_body_b2ks8_20",
12
+ sidebar: "_sidebar_b2ks8_27",
13
+ folderTree: "_folderTree_b2ks8_34",
14
+ treeItem: "_treeItem_b2ks8_41",
15
+ content: "_content_b2ks8_61",
16
+ grid: "_grid_b2ks8_67",
17
+ item: "_item_b2ks8_75",
18
+ icon: "_icon_b2ks8_97",
19
+ name: "_name_b2ks8_105",
20
+ empty: "_empty_b2ks8_117",
21
+ actionBar: "_actionBar_b2ks8_125",
22
+ selectedLabel: "_selectedLabel_b2ks8_136",
23
+ saveActionBar: "_saveActionBar_b2ks8_142",
24
+ fileNameInput: "_fileNameInput_b2ks8_152",
25
+ overlay: "_overlay_b2ks8_158",
26
+ panel: "_panel_b2ks8_168"
27
+ }, y = i(({ currentFolderId: e, fsNodes: t, onNavigate: n }) => {
28
+ let i = r(e, t);
29
+ return /* @__PURE__ */ c("div", {
30
+ className: v.breadcrumbBar,
31
+ children: /* @__PURE__ */ c(d, {
32
+ separator: "›",
33
+ classNames: { separator: v.breadcrumbSep },
34
+ children: i.map((e, t) => t === i.length - 1 ? /* @__PURE__ */ c(m, {
35
+ size: "xs",
36
+ fw: 500,
37
+ children: e.name
38
+ }, e.id ?? "root") : /* @__PURE__ */ c(u, {
39
+ size: "xs",
40
+ onClick: () => n(e.id),
41
+ children: e.name
42
+ }, e.id ?? "root"))
43
+ })
44
+ });
45
+ }), b = i(({ node: e, allNodes: t, currentFolderId: r, depth: i, onNavigate: a }) => {
46
+ let o = t.filter((t) => t.parentId === e.id && t.type === "folder");
47
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l(g, {
48
+ className: v.treeItem,
49
+ "data-active": r === e.id || void 0,
50
+ style: { paddingLeft: 8 + i * 14 },
51
+ onClick: () => a(e.id),
52
+ "aria-label": e.name,
53
+ "aria-current": r === e.id ? "page" : void 0,
54
+ children: [/* @__PURE__ */ c(n, {
55
+ type: "folder",
56
+ folderNode: e,
57
+ size: 14
58
+ }), /* @__PURE__ */ c(m, {
59
+ size: "xs",
60
+ ml: 6,
61
+ truncate: !0,
62
+ children: e.name
63
+ })]
64
+ }), o.map((e) => /* @__PURE__ */ c(b, {
65
+ node: e,
66
+ allNodes: t,
67
+ currentFolderId: r,
68
+ depth: i + 1,
69
+ onNavigate: a
70
+ }, e.id))] });
71
+ }), x = i(({ currentFolderId: e, fsNodes: t, onNavigate: r }) => {
72
+ let { t: i } = _("window"), a = t.filter((e) => e.parentId === null && e.type === "folder");
73
+ return /* @__PURE__ */ c("aside", {
74
+ className: v.sidebar,
75
+ children: /* @__PURE__ */ l("nav", {
76
+ className: v.folderTree,
77
+ "aria-label": i("fileDialog.folderTreeAria", { ns: "common" }),
78
+ children: [/* @__PURE__ */ l(g, {
79
+ className: v.treeItem,
80
+ "data-active": e === null || void 0,
81
+ style: { paddingLeft: 8 },
82
+ onClick: () => r(null),
83
+ "aria-label": i("common:labels.home"),
84
+ "aria-current": e === null ? "page" : void 0,
85
+ children: [/* @__PURE__ */ c(n, {
86
+ type: "folder",
87
+ size: 14
88
+ }), /* @__PURE__ */ c(m, {
89
+ size: "xs",
90
+ ml: 6,
91
+ fw: 500,
92
+ children: i("common:labels.home")
93
+ })]
94
+ }), a.map((n) => /* @__PURE__ */ c(b, {
95
+ node: n,
96
+ allNodes: t,
97
+ currentFolderId: e,
98
+ depth: 1,
99
+ onNavigate: r
100
+ }, n.id))]
101
+ })
102
+ });
103
+ }), S = i(({ currentFolderId: t, fsNodes: r, onNavigate: i, onItemDoubleClick: a }) => {
104
+ let { t: o } = _("window"), s = r.filter((e) => e.parentId === t && e.type === "folder");
105
+ if (s.length === 0) return /* @__PURE__ */ c("div", {
106
+ className: v.empty,
107
+ children: /* @__PURE__ */ c(m, {
108
+ size: "sm",
109
+ c: "dimmed",
110
+ children: o("common:messages.noSubfolders")
111
+ })
112
+ });
113
+ let u = e(s);
114
+ return /* @__PURE__ */ c("div", {
115
+ className: v.grid,
116
+ role: "listbox",
117
+ "aria-label": o("fileDialog.foldersAria", { ns: "common" }),
118
+ children: u.map((e) => /* @__PURE__ */ l(g, {
119
+ className: v.item,
120
+ onDoubleClick: () => {
121
+ i(e.id), a?.(e);
122
+ },
123
+ "aria-label": o("fileDialog.openFolder", { name: e.name }),
124
+ role: "option",
125
+ children: [/* @__PURE__ */ c("div", {
126
+ className: v.icon,
127
+ children: /* @__PURE__ */ c(n, {
128
+ type: "folder",
129
+ name: e.name,
130
+ folderNode: e,
131
+ size: 32
132
+ })
133
+ }), /* @__PURE__ */ c(m, {
134
+ size: "xs",
135
+ className: v.name,
136
+ truncate: !0,
137
+ children: e.name
138
+ })]
139
+ }, e.id))
140
+ });
141
+ }), C = i(({ opened: e, children: t, ariaLabelKey: n, ariaLabelNs: r = "window" }) => {
142
+ let { t: i } = _(r);
143
+ return e ? /* @__PURE__ */ c("div", {
144
+ className: v.overlay,
145
+ role: "dialog",
146
+ "aria-label": i(n),
147
+ children: /* @__PURE__ */ c("div", {
148
+ className: v.panel,
149
+ children: t
150
+ })
151
+ }) : null;
152
+ }), w = ({ acceptedMimeTypes: r, onConfirm: i, onCancel: s }) => {
153
+ let { t: u } = _("window"), d = t((e) => e.fsNodes), [h, b] = o(null), [S, C] = o(null), w = h === null ? d.filter((e) => e.parentId === null) : d.filter((e) => e.parentId === h), T = w.filter((e) => {
154
+ if (e.type === "folder") return !0;
155
+ let t = e;
156
+ return !r || r.length === 0 ? !0 : r.some((e) => t.mimeType === e || e.endsWith("/*") && t.mimeType?.startsWith(e.slice(0, -1)));
157
+ }), E = a((e) => {
158
+ b(e), C(null);
159
+ }, []), D = a((e) => {
160
+ e.type === "file" && C(e);
161
+ }, []), O = a((e) => {
162
+ e.type === "folder" ? E(e.id) : i(e);
163
+ }, [E, i]);
164
+ return /* @__PURE__ */ l("div", {
165
+ className: v.root,
166
+ children: [
167
+ /* @__PURE__ */ c(y, {
168
+ currentFolderId: h,
169
+ fsNodes: d,
170
+ onNavigate: E
171
+ }),
172
+ /* @__PURE__ */ l("div", {
173
+ className: v.body,
174
+ children: [/* @__PURE__ */ c(x, {
175
+ currentFolderId: h,
176
+ fsNodes: d,
177
+ onNavigate: E
178
+ }), /* @__PURE__ */ c("main", {
179
+ className: v.content,
180
+ children: T.length === 0 ? /* @__PURE__ */ c("div", {
181
+ className: v.empty,
182
+ children: /* @__PURE__ */ c(m, {
183
+ size: "sm",
184
+ c: "dimmed",
185
+ children: w.length === 0 ? u("common:messages.folderEmpty") : u("common:messages.noMatchingFiles")
186
+ })
187
+ }) : /* @__PURE__ */ c("div", {
188
+ className: v.grid,
189
+ role: "listbox",
190
+ "aria-label": u("fileDialog.filesAria", { ns: "common" }),
191
+ children: e(T).map((e) => {
192
+ let t = S?.id === e.id;
193
+ return /* @__PURE__ */ l(g, {
194
+ className: v.item,
195
+ "data-selected": t || void 0,
196
+ "data-type": e.type,
197
+ onClick: () => D(e),
198
+ onDoubleClick: () => O(e),
199
+ "aria-label": e.type === "folder" ? u("fileDialog.openFolder", {
200
+ name: e.name,
201
+ ns: "window"
202
+ }) : u("fileDialog.selectFile", {
203
+ name: e.name,
204
+ ns: "window"
205
+ }),
206
+ "aria-selected": e.type === "file" ? t : void 0,
207
+ role: "option",
208
+ children: [/* @__PURE__ */ c("div", {
209
+ className: v.icon,
210
+ children: /* @__PURE__ */ c(n, {
211
+ type: e.type,
212
+ name: e.name,
213
+ folderNode: e.type === "folder" ? e : void 0,
214
+ size: 32
215
+ })
216
+ }), /* @__PURE__ */ c(m, {
217
+ size: "xs",
218
+ className: v.name,
219
+ truncate: !0,
220
+ children: e.name
221
+ })]
222
+ }, e.id);
223
+ })
224
+ })
225
+ })]
226
+ }),
227
+ /* @__PURE__ */ l("div", {
228
+ className: v.actionBar,
229
+ children: [/* @__PURE__ */ c(m, {
230
+ size: "xs",
231
+ c: "dimmed",
232
+ truncate: !0,
233
+ className: v.selectedLabel,
234
+ children: S ? S.name : u("common:messages.noFileSelected")
235
+ }), /* @__PURE__ */ l(p, {
236
+ gap: "xs",
237
+ children: [/* @__PURE__ */ c(f, {
238
+ variant: "default",
239
+ size: "xs",
240
+ onClick: s,
241
+ "aria-label": u("filePicker.cancelAria", { ns: "common" }),
242
+ children: u("common:actions.cancel")
243
+ }), /* @__PURE__ */ c(f, {
244
+ size: "xs",
245
+ disabled: !S,
246
+ onClick: () => S && i(S),
247
+ "aria-label": u("filePicker.openSelectedAria", { ns: "common" }),
248
+ children: u("common:actions.open")
249
+ })]
250
+ })]
251
+ })
252
+ ]
253
+ });
254
+ }, T = ({ opened: e, ...t }) => e ? /* @__PURE__ */ c(C, {
255
+ opened: e,
256
+ ariaLabelKey: "fileDialog.openFile",
257
+ children: /* @__PURE__ */ c(w, { ...t })
258
+ }) : null, E = ({ initialName: e = "untitled.md", onConfirm: n, onCancel: r }) => {
259
+ let { t: i } = _("window"), s = t((e) => e.fsNodes), [u, d] = o(null), [m, g] = o(e), b = a((e) => {
260
+ d(e);
261
+ }, []), C = a(() => {
262
+ let e = m.trim();
263
+ e && n({
264
+ parentId: u,
265
+ name: e.endsWith(".md") ? e : `${e}.md`
266
+ });
267
+ }, [
268
+ m,
269
+ u,
270
+ n
271
+ ]);
272
+ return /* @__PURE__ */ l("div", {
273
+ className: v.root,
274
+ children: [
275
+ /* @__PURE__ */ c(y, {
276
+ currentFolderId: u,
277
+ fsNodes: s,
278
+ onNavigate: b
279
+ }),
280
+ /* @__PURE__ */ l("div", {
281
+ className: v.body,
282
+ children: [/* @__PURE__ */ c(x, {
283
+ currentFolderId: u,
284
+ fsNodes: s,
285
+ onNavigate: b
286
+ }), /* @__PURE__ */ c("main", {
287
+ className: v.content,
288
+ children: /* @__PURE__ */ c(S, {
289
+ currentFolderId: u,
290
+ fsNodes: s,
291
+ onNavigate: b
292
+ })
293
+ })]
294
+ }),
295
+ /* @__PURE__ */ l("div", {
296
+ className: v.saveActionBar,
297
+ children: [/* @__PURE__ */ c(h, {
298
+ size: "xs",
299
+ placeholder: i("fileDialog.filename"),
300
+ value: m,
301
+ onChange: (e) => g(e.currentTarget.value),
302
+ onKeyDown: (e) => e.key === "Enter" && C(),
303
+ "aria-label": i("filePicker.fileNameAria", { ns: "common" }),
304
+ className: v.fileNameInput
305
+ }), /* @__PURE__ */ l(p, {
306
+ gap: "xs",
307
+ style: { flexShrink: 0 },
308
+ children: [/* @__PURE__ */ c(f, {
309
+ variant: "default",
310
+ size: "xs",
311
+ onClick: r,
312
+ "aria-label": i("filePicker.cancelAria", { ns: "common" }),
313
+ children: i("common:actions.cancel")
314
+ }), /* @__PURE__ */ c(f, {
315
+ size: "xs",
316
+ disabled: !m.trim(),
317
+ onClick: C,
318
+ "aria-label": i("fileDialog.saveFile"),
319
+ children: i("common:actions.save")
320
+ })]
321
+ })]
322
+ })
323
+ ]
324
+ });
325
+ }, D = ({ opened: e, ...t }) => e ? /* @__PURE__ */ c(C, {
326
+ opened: e,
327
+ ariaLabelKey: "fileDialog.saveFile",
328
+ children: /* @__PURE__ */ c(E, { ...t })
329
+ }) : null, O = ({ onConfirm: e, onCancel: n }) => {
330
+ let { t: r } = _("window"), i = t((e) => e.fsNodes), [s, u] = o(null), d = a((e) => {
331
+ u(e);
332
+ }, []), h = a(() => {
333
+ e(s);
334
+ }, [s, e]);
335
+ return /* @__PURE__ */ l("div", {
336
+ className: v.root,
337
+ children: [
338
+ /* @__PURE__ */ c(y, {
339
+ currentFolderId: s,
340
+ fsNodes: i,
341
+ onNavigate: d
342
+ }),
343
+ /* @__PURE__ */ l("div", {
344
+ className: v.body,
345
+ children: [/* @__PURE__ */ c(x, {
346
+ currentFolderId: s,
347
+ fsNodes: i,
348
+ onNavigate: d
349
+ }), /* @__PURE__ */ c("main", {
350
+ className: v.content,
351
+ children: /* @__PURE__ */ c(S, {
352
+ currentFolderId: s,
353
+ fsNodes: i,
354
+ onNavigate: d
355
+ })
356
+ })]
357
+ }),
358
+ /* @__PURE__ */ l("div", {
359
+ className: v.actionBar,
360
+ children: [/* @__PURE__ */ c(m, {
361
+ size: "xs",
362
+ c: "dimmed",
363
+ truncate: !0,
364
+ className: v.selectedLabel,
365
+ children: s === null ? r("common:labels.home") : i.find((e) => e.id === s)?.name ?? ""
366
+ }), /* @__PURE__ */ l(p, {
367
+ gap: "xs",
368
+ children: [/* @__PURE__ */ c(f, {
369
+ variant: "default",
370
+ size: "xs",
371
+ onClick: n,
372
+ "aria-label": r("filePicker.cancelAria", { ns: "common" }),
373
+ children: r("common:actions.cancel")
374
+ }), /* @__PURE__ */ c(f, {
375
+ size: "xs",
376
+ onClick: h,
377
+ "aria-label": r("fileDialog.selectFolder"),
378
+ children: r("common:actions.select")
379
+ })]
380
+ })]
381
+ })
382
+ ]
383
+ });
384
+ }, k = ({ opened: e, ...t }) => e ? /* @__PURE__ */ c(C, {
385
+ opened: e,
386
+ ariaLabelKey: "fileDialog.selectFolder",
387
+ children: /* @__PURE__ */ c(O, { ...t })
388
+ }) : null;
389
+ //#endregion
390
+ export { C as a, k as i, T as n, D as r, w as t };
@@ -0,0 +1 @@
1
+ const e=require(`./NotesApp-BmQIBtJ2.cjs`),t=require(`./useOpenApp-D-FOY88T.cjs`),n=require(`./desktopStore-C1jR6Fdb.cjs`),r=require(`./buildBreadcrumbs-Ccd8i11b.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`),o=require(`@mantine/core`);var s=()=>{let e=n.o(e=>e.notifications),t=n.o(e=>e.addNotification),r=n.o(e=>e.removeNotification);return{notifications:e,notify:(0,i.useCallback)((e,r,i)=>{let a={id:n.ot(),title:e,message:r,fcIcon:i?.fcIcon,onClose:i?.onClose};return t(a),a.id},[t]),dismiss:(0,i.useCallback)(e=>{r(e)},[r]),addNotification:t,removeNotification:r}},c={root:`_root_113j7_1`,item:`_item_113j7_9`},l=({node:e,allNodes:t,currentFolderId:n,depth:i,onNavigate:s})=>{let u=t.filter(t=>t.parentId===e.id&&t.type===`folder`);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(o.UnstyledButton,{className:c.item,"data-active":n===e.id||void 0,style:{paddingLeft:8+i*14},onClick:()=>s(e.id),"aria-label":e.name,"aria-current":n===e.id?`page`:void 0,children:[(0,a.jsx)(r.n,{type:`folder`,folderNode:e,size:14}),(0,a.jsx)(o.Text,{size:`xs`,ml:6,truncate:!0,children:e.name})]}),u.map(e=>(0,a.jsx)(l,{node:e,allNodes:t,currentFolderId:n,depth:i+1,onNavigate:s},e.id))]})},u=({allNodes:e,currentFolderId:t,onNavigate:n})=>{let i=e.filter(e=>e.parentId===null&&e.type===`folder`);return(0,a.jsxs)(`nav`,{className:c.root,"aria-label":`Folder tree`,children:[(0,a.jsxs)(o.UnstyledButton,{className:c.item,"data-active":t===null||void 0,style:{paddingLeft:8},onClick:()=>n(null),"aria-label":`Home`,"aria-current":t===null?`page`:void 0,children:[(0,a.jsx)(r.n,{type:`folder`,size:14}),(0,a.jsx)(o.Text,{size:`xs`,ml:6,fw:500,children:`Home`})]}),i.map(r=>(0,a.jsx)(l,{node:r,allNodes:e,currentFolderId:t,depth:1,onNavigate:n},r.id))]})},d={grid:`_grid_1cag6_1`,item:`_item_1cag6_9`,icon:`_icon_1cag6_26`,name:`_name_1cag6_34`,empty:`_empty_1cag6_46`},f=({node:e,onNavigate:t,onOpenFile:n,onContextMenu:i})=>{let s=()=>{e.type===`folder`?t(e.id):n(e)},c=e.type===`folder`?`Open folder ${e.name}`:`Open file ${e.name}`;return(0,a.jsxs)(o.UnstyledButton,{className:d.item,onDoubleClick:s,onContextMenu:t=>i(t,e.id),"aria-label":c,role:`option`,children:[(0,a.jsx)(`div`,{className:d.icon,children:(0,a.jsx)(r.n,{type:e.type,name:e.name,folderNode:e.type===`folder`?e:void 0,size:32})}),(0,a.jsx)(o.Text,{size:`xs`,className:d.name,truncate:!0,children:e.name})]})},p=({nodes:e,onNavigate:t,onOpenFile:r,onNodeContextMenu:i})=>{let s=n.o(e=>e.filesSortMode);if(e.length===0)return(0,a.jsx)(`div`,{className:d.empty,children:(0,a.jsx)(o.Text,{size:`sm`,c:`dimmed`,children:`This folder is empty`})});let c=n.D(e,s);return(0,a.jsx)(`div`,{className:d.grid,role:`listbox`,"aria-label":`Files`,children:c.map(e=>(0,a.jsx)(f,{node:e,onNavigate:t,onOpenFile:r,onContextMenu:i},e.id))})},m={root:`_root_13mxj_1`,breadcrumbBar:`_breadcrumbBar_13mxj_9`,breadcrumbSep:`_breadcrumbSep_13mxj_16`,body:`_body_13mxj_21`,sidebar:`_sidebar_13mxj_28`,content:`_content_13mxj_35`},h=e.i({default:()=>g}),g=({window:e})=>{let c=e?.contentData?.initialFolderId,l=n.o(e=>e.fsNodes),d=n.o(e=>e.openContextMenu),f=n.o(e=>e.setFilesCurrentFolderId),h=t.t(),{notify:g}=s(),[_,v]=(0,i.useState)(c??null),y=(0,i.useCallback)(e=>{v(e),f(e)},[f]);(0,i.useEffect)(()=>{f(c??null)},[c,f]);let b=_===null?l.filter(e=>e.parentId===null):l.filter(e=>e.parentId===_),x=(0,i.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),d(e.clientX,e.clientY,`files`)},[d]),S=(0,i.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),d(e.clientX,e.clientY,`files`,t)},[d]),C=(0,i.useCallback)(e=>{try{let t=n.x(e);if(t)h(t.appId,{contentData:t.contentData});else{let t=e.mimeType||`unknown`;console.warn(`[FilesApp] Unsupported file type: ${e.name} (${t})`),g(`Unsupported file type`,`Cannot open "${e.name}". File type "${t}" is not supported.`,{fcIcon:`FcDeleteRow`})}}catch(t){console.error(`[FilesApp] Error opening file:`,t),g(`Error opening file`,`An unexpected error occurred while opening "${e.name}".`,{fcIcon:`FcHighPriority`})}},[h,g]),w=r.t(_,l);return(0,a.jsxs)(`div`,{className:m.root,onContextMenu:x,children:[(0,a.jsx)(`div`,{className:m.breadcrumbBar,children:(0,a.jsx)(o.Breadcrumbs,{separator:`›`,classNames:{separator:m.breadcrumbSep},children:w.map((e,t)=>t===w.length-1?(0,a.jsx)(o.Text,{size:`xs`,fw:500,children:e.name},e.id??`root`):(0,a.jsx)(o.Anchor,{size:`xs`,onClick:()=>y(e.id),children:e.name},e.id??`root`))})}),(0,a.jsxs)(`div`,{className:m.body,children:[(0,a.jsx)(`aside`,{className:m.sidebar,children:(0,a.jsx)(u,{allNodes:l,currentFolderId:_,onNavigate:y})}),(0,a.jsx)(`main`,{className:m.content,children:(0,a.jsx)(p,{nodes:b,onNavigate:y,onOpenFile:C,onNodeContextMenu:S})})]})]})};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}});