@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
@@ -1,409 +0,0 @@
1
- import { t as e } from "./TextInput-C-JtGWn1.js";
2
- import { t } from "./UnstyledButton-DGaG-e_G.js";
3
- import { t as n } from "./Group-CtBJSfCo.js";
4
- import { o as r } from "./getRuntime-DAPqFH2W.js";
5
- import { i, r as a, t as o } from "./FileIcon-7JaSR3Gn.js";
6
- import { t as s } from "./Button-wTOTQKxF.js";
7
- import { F as c, o as l } from "./desktopStore-F8bgLqFl.js";
8
- import { memo as u, useCallback as d, useState as f } from "react";
9
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
10
- import { useTranslation as g } from "react-i18next";
11
- //#region src/utils/buildBreadcrumbs.ts
12
- var _ = (e, t) => {
13
- let n = [{
14
- id: null,
15
- name: "Home"
16
- }], r = e, i = [];
17
- for (; r !== null;) {
18
- let e = t.find((e) => e.id === r);
19
- if (!e) break;
20
- i.unshift({
21
- id: e.id,
22
- name: e.name
23
- }), r = e.parentId;
24
- }
25
- return [...n, ...i];
26
- }, v = {
27
- root: "_root_b2ks8_1",
28
- breadcrumbBar: "_breadcrumbBar_b2ks8_8",
29
- breadcrumbSep: "_breadcrumbSep_b2ks8_15",
30
- body: "_body_b2ks8_20",
31
- sidebar: "_sidebar_b2ks8_27",
32
- folderTree: "_folderTree_b2ks8_34",
33
- treeItem: "_treeItem_b2ks8_41",
34
- content: "_content_b2ks8_61",
35
- grid: "_grid_b2ks8_67",
36
- item: "_item_b2ks8_75",
37
- icon: "_icon_b2ks8_97",
38
- name: "_name_b2ks8_105",
39
- empty: "_empty_b2ks8_117",
40
- actionBar: "_actionBar_b2ks8_125",
41
- selectedLabel: "_selectedLabel_b2ks8_136",
42
- saveActionBar: "_saveActionBar_b2ks8_142",
43
- fileNameInput: "_fileNameInput_b2ks8_152",
44
- overlay: "_overlay_b2ks8_158",
45
- panel: "_panel_b2ks8_168"
46
- }, y = u(({ currentFolderId: e, fsNodes: t, onNavigate: n }) => {
47
- let o = _(e, t);
48
- return /* @__PURE__ */ m("div", {
49
- className: v.breadcrumbBar,
50
- children: /* @__PURE__ */ m(a, {
51
- separator: "›",
52
- classNames: { separator: v.breadcrumbSep },
53
- children: o.map((e, t) => t === o.length - 1 ? /* @__PURE__ */ m(r, {
54
- size: "xs",
55
- fw: 500,
56
- children: e.name
57
- }, e.id ?? "root") : /* @__PURE__ */ m(i, {
58
- size: "xs",
59
- onClick: () => n(e.id),
60
- children: e.name
61
- }, e.id ?? "root"))
62
- })
63
- });
64
- }), b = u(({ node: e, allNodes: n, currentFolderId: i, depth: a, onNavigate: s }) => {
65
- let c = n.filter((t) => t.parentId === e.id && t.type === "folder");
66
- return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h(t, {
67
- className: v.treeItem,
68
- "data-active": i === e.id || void 0,
69
- style: { paddingLeft: 8 + a * 14 },
70
- onClick: () => s(e.id),
71
- "aria-label": e.name,
72
- "aria-current": i === e.id ? "page" : void 0,
73
- children: [/* @__PURE__ */ m(o, {
74
- type: "folder",
75
- folderNode: e,
76
- size: 14
77
- }), /* @__PURE__ */ m(r, {
78
- size: "xs",
79
- ml: 6,
80
- truncate: !0,
81
- children: e.name
82
- })]
83
- }), c.map((e) => /* @__PURE__ */ m(b, {
84
- node: e,
85
- allNodes: n,
86
- currentFolderId: i,
87
- depth: a + 1,
88
- onNavigate: s
89
- }, e.id))] });
90
- }), x = u(({ currentFolderId: e, fsNodes: n, onNavigate: i }) => {
91
- let { t: a } = g("window"), s = n.filter((e) => e.parentId === null && e.type === "folder");
92
- return /* @__PURE__ */ m("aside", {
93
- className: v.sidebar,
94
- children: /* @__PURE__ */ h("nav", {
95
- className: v.folderTree,
96
- "aria-label": a("fileDialog.folderTreeAria", { ns: "common" }),
97
- children: [/* @__PURE__ */ h(t, {
98
- className: v.treeItem,
99
- "data-active": e === null || void 0,
100
- style: { paddingLeft: 8 },
101
- onClick: () => i(null),
102
- "aria-label": a("common:labels.home"),
103
- "aria-current": e === null ? "page" : void 0,
104
- children: [/* @__PURE__ */ m(o, {
105
- type: "folder",
106
- size: 14
107
- }), /* @__PURE__ */ m(r, {
108
- size: "xs",
109
- ml: 6,
110
- fw: 500,
111
- children: a("common:labels.home")
112
- })]
113
- }), s.map((t) => /* @__PURE__ */ m(b, {
114
- node: t,
115
- allNodes: n,
116
- currentFolderId: e,
117
- depth: 1,
118
- onNavigate: i
119
- }, t.id))]
120
- })
121
- });
122
- }), S = u(({ currentFolderId: e, fsNodes: n, onNavigate: i, onItemDoubleClick: a }) => {
123
- let { t: s } = g("window"), l = n.filter((t) => t.parentId === e && t.type === "folder");
124
- if (l.length === 0) return /* @__PURE__ */ m("div", {
125
- className: v.empty,
126
- children: /* @__PURE__ */ m(r, {
127
- size: "sm",
128
- c: "dimmed",
129
- children: s("common:messages.noSubfolders")
130
- })
131
- });
132
- let u = c(l);
133
- return /* @__PURE__ */ m("div", {
134
- className: v.grid,
135
- role: "listbox",
136
- "aria-label": s("fileDialog.foldersAria", { ns: "common" }),
137
- children: u.map((e) => /* @__PURE__ */ h(t, {
138
- className: v.item,
139
- onDoubleClick: () => {
140
- i(e.id), a?.(e);
141
- },
142
- "aria-label": s("fileDialog.openFolder", { name: e.name }),
143
- role: "option",
144
- children: [/* @__PURE__ */ m("div", {
145
- className: v.icon,
146
- children: /* @__PURE__ */ m(o, {
147
- type: "folder",
148
- name: e.name,
149
- folderNode: e,
150
- size: 32
151
- })
152
- }), /* @__PURE__ */ m(r, {
153
- size: "xs",
154
- className: v.name,
155
- truncate: !0,
156
- children: e.name
157
- })]
158
- }, e.id))
159
- });
160
- }), C = u(({ opened: e, children: t, ariaLabelKey: n, ariaLabelNs: r = "window" }) => {
161
- let { t: i } = g(r);
162
- return e ? /* @__PURE__ */ m("div", {
163
- className: v.overlay,
164
- role: "dialog",
165
- "aria-label": i(n),
166
- children: /* @__PURE__ */ m("div", {
167
- className: v.panel,
168
- children: t
169
- })
170
- }) : null;
171
- }), w = ({ acceptedMimeTypes: e, onConfirm: i, onCancel: a }) => {
172
- let { t: u } = g("window"), p = l((e) => e.fsNodes), [_, b] = f(null), [S, C] = f(null), w = _ === null ? p.filter((e) => e.parentId === null) : p.filter((e) => e.parentId === _), T = w.filter((t) => {
173
- if (t.type === "folder") return !0;
174
- let n = t;
175
- return !e || e.length === 0 ? !0 : e.some((e) => n.mimeType === e || e.endsWith("/*") && n.mimeType?.startsWith(e.slice(0, -1)));
176
- }), E = d((e) => {
177
- b(e), C(null);
178
- }, []), D = d((e) => {
179
- e.type === "file" && C(e);
180
- }, []), O = d((e) => {
181
- e.type === "folder" ? E(e.id) : i(e);
182
- }, [E, i]);
183
- return /* @__PURE__ */ h("div", {
184
- className: v.root,
185
- children: [
186
- /* @__PURE__ */ m(y, {
187
- currentFolderId: _,
188
- fsNodes: p,
189
- onNavigate: E
190
- }),
191
- /* @__PURE__ */ h("div", {
192
- className: v.body,
193
- children: [/* @__PURE__ */ m(x, {
194
- currentFolderId: _,
195
- fsNodes: p,
196
- onNavigate: E
197
- }), /* @__PURE__ */ m("main", {
198
- className: v.content,
199
- children: T.length === 0 ? /* @__PURE__ */ m("div", {
200
- className: v.empty,
201
- children: /* @__PURE__ */ m(r, {
202
- size: "sm",
203
- c: "dimmed",
204
- children: w.length === 0 ? u("common:messages.folderEmpty") : u("common:messages.noMatchingFiles")
205
- })
206
- }) : /* @__PURE__ */ m("div", {
207
- className: v.grid,
208
- role: "listbox",
209
- "aria-label": u("fileDialog.filesAria", { ns: "common" }),
210
- children: c(T).map((e) => {
211
- let n = S?.id === e.id;
212
- return /* @__PURE__ */ h(t, {
213
- className: v.item,
214
- "data-selected": n || void 0,
215
- "data-type": e.type,
216
- onClick: () => D(e),
217
- onDoubleClick: () => O(e),
218
- "aria-label": e.type === "folder" ? u("fileDialog.openFolder", {
219
- name: e.name,
220
- ns: "window"
221
- }) : u("fileDialog.selectFile", {
222
- name: e.name,
223
- ns: "window"
224
- }),
225
- "aria-selected": e.type === "file" ? n : void 0,
226
- role: "option",
227
- children: [/* @__PURE__ */ m("div", {
228
- className: v.icon,
229
- children: /* @__PURE__ */ m(o, {
230
- type: e.type,
231
- name: e.name,
232
- folderNode: e.type === "folder" ? e : void 0,
233
- size: 32
234
- })
235
- }), /* @__PURE__ */ m(r, {
236
- size: "xs",
237
- className: v.name,
238
- truncate: !0,
239
- children: e.name
240
- })]
241
- }, e.id);
242
- })
243
- })
244
- })]
245
- }),
246
- /* @__PURE__ */ h("div", {
247
- className: v.actionBar,
248
- children: [/* @__PURE__ */ m(r, {
249
- size: "xs",
250
- c: "dimmed",
251
- truncate: !0,
252
- className: v.selectedLabel,
253
- children: S ? S.name : u("common:messages.noFileSelected")
254
- }), /* @__PURE__ */ h(n, {
255
- gap: "xs",
256
- children: [/* @__PURE__ */ m(s, {
257
- variant: "default",
258
- size: "xs",
259
- onClick: a,
260
- "aria-label": u("filePicker.cancelAria", { ns: "common" }),
261
- children: u("common:actions.cancel")
262
- }), /* @__PURE__ */ m(s, {
263
- size: "xs",
264
- disabled: !S,
265
- onClick: () => S && i(S),
266
- "aria-label": u("filePicker.openSelectedAria", { ns: "common" }),
267
- children: u("common:actions.open")
268
- })]
269
- })]
270
- })
271
- ]
272
- });
273
- }, T = ({ opened: e, ...t }) => e ? /* @__PURE__ */ m(C, {
274
- opened: e,
275
- ariaLabelKey: "fileDialog.openFile",
276
- children: /* @__PURE__ */ m(w, { ...t })
277
- }) : null, E = ({ initialName: t = "untitled.md", onConfirm: r, onCancel: i }) => {
278
- let { t: a } = g("window"), o = l((e) => e.fsNodes), [c, u] = f(null), [p, _] = f(t), b = d((e) => {
279
- u(e);
280
- }, []), C = d(() => {
281
- let e = p.trim();
282
- e && r({
283
- parentId: c,
284
- name: e.endsWith(".md") ? e : `${e}.md`
285
- });
286
- }, [
287
- p,
288
- c,
289
- r
290
- ]);
291
- return /* @__PURE__ */ h("div", {
292
- className: v.root,
293
- children: [
294
- /* @__PURE__ */ m(y, {
295
- currentFolderId: c,
296
- fsNodes: o,
297
- onNavigate: b
298
- }),
299
- /* @__PURE__ */ h("div", {
300
- className: v.body,
301
- children: [/* @__PURE__ */ m(x, {
302
- currentFolderId: c,
303
- fsNodes: o,
304
- onNavigate: b
305
- }), /* @__PURE__ */ m("main", {
306
- className: v.content,
307
- children: /* @__PURE__ */ m(S, {
308
- currentFolderId: c,
309
- fsNodes: o,
310
- onNavigate: b
311
- })
312
- })]
313
- }),
314
- /* @__PURE__ */ h("div", {
315
- className: v.saveActionBar,
316
- children: [/* @__PURE__ */ m(e, {
317
- size: "xs",
318
- placeholder: a("fileDialog.filename"),
319
- value: p,
320
- onChange: (e) => _(e.currentTarget.value),
321
- onKeyDown: (e) => e.key === "Enter" && C(),
322
- "aria-label": a("filePicker.fileNameAria", { ns: "common" }),
323
- className: v.fileNameInput
324
- }), /* @__PURE__ */ h(n, {
325
- gap: "xs",
326
- style: { flexShrink: 0 },
327
- children: [/* @__PURE__ */ m(s, {
328
- variant: "default",
329
- size: "xs",
330
- onClick: i,
331
- "aria-label": a("filePicker.cancelAria", { ns: "common" }),
332
- children: a("common:actions.cancel")
333
- }), /* @__PURE__ */ m(s, {
334
- size: "xs",
335
- disabled: !p.trim(),
336
- onClick: C,
337
- "aria-label": a("fileDialog.saveFile"),
338
- children: a("common:actions.save")
339
- })]
340
- })]
341
- })
342
- ]
343
- });
344
- }, D = ({ opened: e, ...t }) => e ? /* @__PURE__ */ m(C, {
345
- opened: e,
346
- ariaLabelKey: "fileDialog.saveFile",
347
- children: /* @__PURE__ */ m(E, { ...t })
348
- }) : null, O = ({ onConfirm: e, onCancel: t }) => {
349
- let { t: i } = g("window"), a = l((e) => e.fsNodes), [o, c] = f(null), u = d((e) => {
350
- c(e);
351
- }, []), p = d(() => {
352
- e(o);
353
- }, [o, e]);
354
- return /* @__PURE__ */ h("div", {
355
- className: v.root,
356
- children: [
357
- /* @__PURE__ */ m(y, {
358
- currentFolderId: o,
359
- fsNodes: a,
360
- onNavigate: u
361
- }),
362
- /* @__PURE__ */ h("div", {
363
- className: v.body,
364
- children: [/* @__PURE__ */ m(x, {
365
- currentFolderId: o,
366
- fsNodes: a,
367
- onNavigate: u
368
- }), /* @__PURE__ */ m("main", {
369
- className: v.content,
370
- children: /* @__PURE__ */ m(S, {
371
- currentFolderId: o,
372
- fsNodes: a,
373
- onNavigate: u
374
- })
375
- })]
376
- }),
377
- /* @__PURE__ */ h("div", {
378
- className: v.actionBar,
379
- children: [/* @__PURE__ */ m(r, {
380
- size: "xs",
381
- c: "dimmed",
382
- truncate: !0,
383
- className: v.selectedLabel,
384
- children: o === null ? i("common:labels.home") : a.find((e) => e.id === o)?.name ?? ""
385
- }), /* @__PURE__ */ h(n, {
386
- gap: "xs",
387
- children: [/* @__PURE__ */ m(s, {
388
- variant: "default",
389
- size: "xs",
390
- onClick: t,
391
- "aria-label": i("filePicker.cancelAria", { ns: "common" }),
392
- children: i("common:actions.cancel")
393
- }), /* @__PURE__ */ m(s, {
394
- size: "xs",
395
- onClick: p,
396
- "aria-label": i("fileDialog.selectFolder"),
397
- children: i("common:actions.select")
398
- })]
399
- })]
400
- })
401
- ]
402
- });
403
- }, k = ({ opened: e, ...t }) => e ? /* @__PURE__ */ m(C, {
404
- opened: e,
405
- ariaLabelKey: "fileDialog.selectFolder",
406
- children: /* @__PURE__ */ m(O, { ...t })
407
- }) : null;
408
- //#endregion
409
- export { C as a, k as i, T as n, _ as o, D as r, w as t };
@@ -1 +0,0 @@
1
- require(`./Box-zW6Twge8.cjs`);const e=require(`./TextInput-CrsmcOip.cjs`),t=require(`./UnstyledButton-DX2pTahr.cjs`),n=require(`./Group-Dsrf6lEK.cjs`),r=require(`./getRuntime-BFK0-8R1.cjs`),i=require(`./FileIcon-CIXopWLv.cjs`),a=require(`./Button-DMlnrqyx.cjs`),o=require(`./desktopStore-CZoA9VHO.cjs`);let s=require(`react`),c=require(`react/jsx-runtime`),l=require(`react-i18next`);var u=(e,t)=>{let n=[{id:null,name:`Home`}],r=e,i=[];for(;r!==null;){let e=t.find(e=>e.id===r);if(!e)break;i.unshift({id:e.id,name:e.name}),r=e.parentId}return[...n,...i]},d={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`},f=(0,s.memo)(({currentFolderId:e,fsNodes:t,onNavigate:n})=>{let a=u(e,t);return(0,c.jsx)(`div`,{className:d.breadcrumbBar,children:(0,c.jsx)(i.r,{separator:`›`,classNames:{separator:d.breadcrumbSep},children:a.map((e,t)=>t===a.length-1?(0,c.jsx)(r.o,{size:`xs`,fw:500,children:e.name},e.id??`root`):(0,c.jsx)(i.i,{size:`xs`,onClick:()=>n(e.id),children:e.name},e.id??`root`))})})}),p=(0,s.memo)(({node:e,allNodes:n,currentFolderId:a,depth:o,onNavigate:s})=>{let l=n.filter(t=>t.parentId===e.id&&t.type===`folder`);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(t.t,{className:d.treeItem,"data-active":a===e.id||void 0,style:{paddingLeft:8+o*14},onClick:()=>s(e.id),"aria-label":e.name,"aria-current":a===e.id?`page`:void 0,children:[(0,c.jsx)(i.t,{type:`folder`,folderNode:e,size:14}),(0,c.jsx)(r.o,{size:`xs`,ml:6,truncate:!0,children:e.name})]}),l.map(e=>(0,c.jsx)(p,{node:e,allNodes:n,currentFolderId:a,depth:o+1,onNavigate:s},e.id))]})}),m=(0,s.memo)(({currentFolderId:e,fsNodes:n,onNavigate:a})=>{let{t:o}=(0,l.useTranslation)(`window`),s=n.filter(e=>e.parentId===null&&e.type===`folder`);return(0,c.jsx)(`aside`,{className:d.sidebar,children:(0,c.jsxs)(`nav`,{className:d.folderTree,"aria-label":o(`fileDialog.folderTreeAria`,{ns:`common`}),children:[(0,c.jsxs)(t.t,{className:d.treeItem,"data-active":e===null||void 0,style:{paddingLeft:8},onClick:()=>a(null),"aria-label":o(`common:labels.home`),"aria-current":e===null?`page`:void 0,children:[(0,c.jsx)(i.t,{type:`folder`,size:14}),(0,c.jsx)(r.o,{size:`xs`,ml:6,fw:500,children:o(`common:labels.home`)})]}),s.map(t=>(0,c.jsx)(p,{node:t,allNodes:n,currentFolderId:e,depth:1,onNavigate:a},t.id))]})})}),h=(0,s.memo)(({currentFolderId:e,fsNodes:n,onNavigate:a,onItemDoubleClick:s})=>{let{t:u}=(0,l.useTranslation)(`window`),f=n.filter(t=>t.parentId===e&&t.type===`folder`);if(f.length===0)return(0,c.jsx)(`div`,{className:d.empty,children:(0,c.jsx)(r.o,{size:`sm`,c:`dimmed`,children:u(`common:messages.noSubfolders`)})});let p=o.F(f);return(0,c.jsx)(`div`,{className:d.grid,role:`listbox`,"aria-label":u(`fileDialog.foldersAria`,{ns:`common`}),children:p.map(e=>(0,c.jsxs)(t.t,{className:d.item,onDoubleClick:()=>{a(e.id),s?.(e)},"aria-label":u(`fileDialog.openFolder`,{name:e.name}),role:`option`,children:[(0,c.jsx)(`div`,{className:d.icon,children:(0,c.jsx)(i.t,{type:`folder`,name:e.name,folderNode:e,size:32})}),(0,c.jsx)(r.o,{size:`xs`,className:d.name,truncate:!0,children:e.name})]},e.id))})}),g=(0,s.memo)(({opened:e,children:t,ariaLabelKey:n,ariaLabelNs:r=`window`})=>{let{t:i}=(0,l.useTranslation)(r);return e?(0,c.jsx)(`div`,{className:d.overlay,role:`dialog`,"aria-label":i(n),children:(0,c.jsx)(`div`,{className:d.panel,children:t})}):null}),_=({acceptedMimeTypes:e,onConfirm:u,onCancel:p})=>{let{t:h}=(0,l.useTranslation)(`window`),g=o.o(e=>e.fsNodes),[_,v]=(0,s.useState)(null),[y,b]=(0,s.useState)(null),x=_===null?g.filter(e=>e.parentId===null):g.filter(e=>e.parentId===_),S=x.filter(t=>{if(t.type===`folder`)return!0;let n=t;return!e||e.length===0?!0:e.some(e=>n.mimeType===e||e.endsWith(`/*`)&&n.mimeType?.startsWith(e.slice(0,-1)))}),C=(0,s.useCallback)(e=>{v(e),b(null)},[]),w=(0,s.useCallback)(e=>{e.type===`file`&&b(e)},[]),T=(0,s.useCallback)(e=>{e.type===`folder`?C(e.id):u(e)},[C,u]);return(0,c.jsxs)(`div`,{className:d.root,children:[(0,c.jsx)(f,{currentFolderId:_,fsNodes:g,onNavigate:C}),(0,c.jsxs)(`div`,{className:d.body,children:[(0,c.jsx)(m,{currentFolderId:_,fsNodes:g,onNavigate:C}),(0,c.jsx)(`main`,{className:d.content,children:S.length===0?(0,c.jsx)(`div`,{className:d.empty,children:(0,c.jsx)(r.o,{size:`sm`,c:`dimmed`,children:x.length===0?h(`common:messages.folderEmpty`):h(`common:messages.noMatchingFiles`)})}):(0,c.jsx)(`div`,{className:d.grid,role:`listbox`,"aria-label":h(`fileDialog.filesAria`,{ns:`common`}),children:o.F(S).map(e=>{let n=y?.id===e.id;return(0,c.jsxs)(t.t,{className:d.item,"data-selected":n||void 0,"data-type":e.type,onClick:()=>w(e),onDoubleClick:()=>T(e),"aria-label":e.type===`folder`?h(`fileDialog.openFolder`,{name:e.name,ns:`window`}):h(`fileDialog.selectFile`,{name:e.name,ns:`window`}),"aria-selected":e.type===`file`?n:void 0,role:`option`,children:[(0,c.jsx)(`div`,{className:d.icon,children:(0,c.jsx)(i.t,{type:e.type,name:e.name,folderNode:e.type===`folder`?e:void 0,size:32})}),(0,c.jsx)(r.o,{size:`xs`,className:d.name,truncate:!0,children:e.name})]},e.id)})})})]}),(0,c.jsxs)(`div`,{className:d.actionBar,children:[(0,c.jsx)(r.o,{size:`xs`,c:`dimmed`,truncate:!0,className:d.selectedLabel,children:y?y.name:h(`common:messages.noFileSelected`)}),(0,c.jsxs)(n.t,{gap:`xs`,children:[(0,c.jsx)(a.t,{variant:`default`,size:`xs`,onClick:p,"aria-label":h(`filePicker.cancelAria`,{ns:`common`}),children:h(`common:actions.cancel`)}),(0,c.jsx)(a.t,{size:`xs`,disabled:!y,onClick:()=>y&&u(y),"aria-label":h(`filePicker.openSelectedAria`,{ns:`common`}),children:h(`common:actions.open`)})]})]})]})},v=({opened:e,...t})=>e?(0,c.jsx)(g,{opened:e,ariaLabelKey:`fileDialog.openFile`,children:(0,c.jsx)(_,{...t})}):null,y=({initialName:t=`untitled.md`,onConfirm:r,onCancel:i})=>{let{t:u}=(0,l.useTranslation)(`window`),p=o.o(e=>e.fsNodes),[g,_]=(0,s.useState)(null),[v,y]=(0,s.useState)(t),b=(0,s.useCallback)(e=>{_(e)},[]),x=(0,s.useCallback)(()=>{let e=v.trim();e&&r({parentId:g,name:e.endsWith(`.md`)?e:`${e}.md`})},[v,g,r]);return(0,c.jsxs)(`div`,{className:d.root,children:[(0,c.jsx)(f,{currentFolderId:g,fsNodes:p,onNavigate:b}),(0,c.jsxs)(`div`,{className:d.body,children:[(0,c.jsx)(m,{currentFolderId:g,fsNodes:p,onNavigate:b}),(0,c.jsx)(`main`,{className:d.content,children:(0,c.jsx)(h,{currentFolderId:g,fsNodes:p,onNavigate:b})})]}),(0,c.jsxs)(`div`,{className:d.saveActionBar,children:[(0,c.jsx)(e.t,{size:`xs`,placeholder:u(`fileDialog.filename`),value:v,onChange:e=>y(e.currentTarget.value),onKeyDown:e=>e.key===`Enter`&&x(),"aria-label":u(`filePicker.fileNameAria`,{ns:`common`}),className:d.fileNameInput}),(0,c.jsxs)(n.t,{gap:`xs`,style:{flexShrink:0},children:[(0,c.jsx)(a.t,{variant:`default`,size:`xs`,onClick:i,"aria-label":u(`filePicker.cancelAria`,{ns:`common`}),children:u(`common:actions.cancel`)}),(0,c.jsx)(a.t,{size:`xs`,disabled:!v.trim(),onClick:x,"aria-label":u(`fileDialog.saveFile`),children:u(`common:actions.save`)})]})]})]})},b=({opened:e,...t})=>e?(0,c.jsx)(g,{opened:e,ariaLabelKey:`fileDialog.saveFile`,children:(0,c.jsx)(y,{...t})}):null,x=({onConfirm:e,onCancel:t})=>{let{t:i}=(0,l.useTranslation)(`window`),u=o.o(e=>e.fsNodes),[p,g]=(0,s.useState)(null),_=(0,s.useCallback)(e=>{g(e)},[]),v=(0,s.useCallback)(()=>{e(p)},[p,e]);return(0,c.jsxs)(`div`,{className:d.root,children:[(0,c.jsx)(f,{currentFolderId:p,fsNodes:u,onNavigate:_}),(0,c.jsxs)(`div`,{className:d.body,children:[(0,c.jsx)(m,{currentFolderId:p,fsNodes:u,onNavigate:_}),(0,c.jsx)(`main`,{className:d.content,children:(0,c.jsx)(h,{currentFolderId:p,fsNodes:u,onNavigate:_})})]}),(0,c.jsxs)(`div`,{className:d.actionBar,children:[(0,c.jsx)(r.o,{size:`xs`,c:`dimmed`,truncate:!0,className:d.selectedLabel,children:p===null?i(`common:labels.home`):u.find(e=>e.id===p)?.name??``}),(0,c.jsxs)(n.t,{gap:`xs`,children:[(0,c.jsx)(a.t,{variant:`default`,size:`xs`,onClick:t,"aria-label":i(`filePicker.cancelAria`,{ns:`common`}),children:i(`common:actions.cancel`)}),(0,c.jsx)(a.t,{size:`xs`,onClick:v,"aria-label":i(`fileDialog.selectFolder`),children:i(`common:actions.select`)})]})]})]})},S=({opened:e,...t})=>e?(0,c.jsx)(g,{opened:e,ariaLabelKey:`fileDialog.selectFolder`,children:(0,c.jsx)(x,{...t})}):null;Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return _}});
@@ -1 +0,0 @@
1
- const e=require(`./FilesApp-BpJJRKhi.cjs`);exports.default=e.t;
@@ -1 +0,0 @@
1
- require(`./Box-zW6Twge8.cjs`);const e=require(`./UnstyledButton-DX2pTahr.cjs`),t=require(`./getRuntime-BFK0-8R1.cjs`),n=require(`./FileIcon-CIXopWLv.cjs`),r=require(`./useOpenApp-DW4x79Zg.cjs`),i=require(`./desktopStore-CZoA9VHO.cjs`);let a=require(`react`),o=require(`react/jsx-runtime`);var s=()=>{let e=i.o(e=>e.notifications),t=i.o(e=>e.addNotification),n=i.o(e=>e.removeNotification);return{notifications:e,notify:(0,a.useCallback)((e,n,r)=>{let a={id:i.ut(),title:e,message:n,fcIcon:r?.fcIcon,onClose:r?.onClose};return t(a),a.id},[t]),dismiss:(0,a.useCallback)(e=>{n(e)},[n]),addNotification:t,removeNotification:n}},c={root:`_root_113j7_1`,item:`_item_113j7_9`},l=({node:r,allNodes:i,currentFolderId:a,depth:s,onNavigate:u})=>{let d=i.filter(e=>e.parentId===r.id&&e.type===`folder`);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(e.t,{className:c.item,"data-active":a===r.id||void 0,style:{paddingLeft:8+s*14},onClick:()=>u(r.id),"aria-label":r.name,"aria-current":a===r.id?`page`:void 0,children:[(0,o.jsx)(n.t,{type:`folder`,folderNode:r,size:14}),(0,o.jsx)(t.o,{size:`xs`,ml:6,truncate:!0,children:r.name})]}),d.map(e=>(0,o.jsx)(l,{node:e,allNodes:i,currentFolderId:a,depth:s+1,onNavigate:u},e.id))]})},u=({allNodes:r,currentFolderId:i,onNavigate:a})=>{let s=r.filter(e=>e.parentId===null&&e.type===`folder`);return(0,o.jsxs)(`nav`,{className:c.root,"aria-label":`Folder tree`,children:[(0,o.jsxs)(e.t,{className:c.item,"data-active":i===null||void 0,style:{paddingLeft:8},onClick:()=>a(null),"aria-label":`Home`,"aria-current":i===null?`page`:void 0,children:[(0,o.jsx)(n.t,{type:`folder`,size:14}),(0,o.jsx)(t.o,{size:`xs`,ml:6,fw:500,children:`Home`})]}),s.map(e=>(0,o.jsx)(l,{node:e,allNodes:r,currentFolderId:i,depth:1,onNavigate:a},e.id))]})},d={grid:`_grid_1cag6_1`,item:`_item_1cag6_9`,icon:`_icon_1cag6_26`,name:`_name_1cag6_34`,empty:`_empty_1cag6_46`},f=({node:r,onNavigate:i,onOpenFile:a,onContextMenu:s})=>{let c=()=>{r.type===`folder`?i(r.id):a(r)},l=r.type===`folder`?`Open folder ${r.name}`:`Open file ${r.name}`;return(0,o.jsxs)(e.t,{className:d.item,onDoubleClick:c,onContextMenu:e=>s(e,r.id),"aria-label":l,role:`option`,children:[(0,o.jsx)(`div`,{className:d.icon,children:(0,o.jsx)(n.t,{type:r.type,name:r.name,folderNode:r.type===`folder`?r:void 0,size:32})}),(0,o.jsx)(t.o,{size:`xs`,className:d.name,truncate:!0,children:r.name})]})},p=({nodes:e,onNavigate:n,onOpenFile:r,onNodeContextMenu:a})=>{let s=i.o(e=>e.filesSortMode);if(e.length===0)return(0,o.jsx)(`div`,{className:d.empty,children:(0,o.jsx)(t.o,{size:`sm`,c:`dimmed`,children:`This folder is empty`})});let c=i.I(e,s);return(0,o.jsx)(`div`,{className:d.grid,role:`listbox`,"aria-label":`Files`,children:c.map(e=>(0,o.jsx)(f,{node:e,onNavigate:n,onOpenFile:r,onContextMenu:a},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=({window:e})=>{let c=e?.contentData?.initialFolderId,l=i.o(e=>e.fsNodes),d=i.o(e=>e.openContextMenu),f=i.o(e=>e.setFilesCurrentFolderId),h=r.t(),{notify:g}=s(),[_,v]=(0,a.useState)(c??null),y=(0,a.useCallback)(e=>{v(e),f(e)},[f]);(0,a.useEffect)(()=>{f(c??null)},[c,f]);let b=_===null?l.filter(e=>e.parentId===null):l.filter(e=>e.parentId===_),x=()=>{let e=[{id:null,name:`Home`}],t=_,n=[];for(;t!==null;){let e=l.find(e=>e.id===t);if(!e)break;n.unshift({id:e.id,name:e.name}),t=e.parentId}return[...e,...n]},S=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),d(e.clientX,e.clientY,`files`)},[d]),C=(0,a.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),d(e.clientX,e.clientY,`files`,t)},[d]),w=(0,a.useCallback)(e=>{try{let t=i.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]),T=x();return(0,o.jsxs)(`div`,{className:m.root,onContextMenu:S,children:[(0,o.jsx)(`div`,{className:m.breadcrumbBar,children:(0,o.jsx)(n.r,{separator:`›`,classNames:{separator:m.breadcrumbSep},children:T.map((e,r)=>r===T.length-1?(0,o.jsx)(t.o,{size:`xs`,fw:500,children:e.name},e.id??`root`):(0,o.jsx)(n.i,{size:`xs`,onClick:()=>y(e.id),children:e.name},e.id??`root`))})}),(0,o.jsxs)(`div`,{className:m.body,children:[(0,o.jsx)(`aside`,{className:m.sidebar,children:(0,o.jsx)(u,{allNodes:l,currentFolderId:_,onNavigate:y})}),(0,o.jsx)(`main`,{className:m.content,children:(0,o.jsx)(p,{nodes:b,onNavigate:y,onOpenFile:w,onNodeContextMenu:C})})]})]})};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
@@ -1,225 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { t } from "./UnstyledButton-DGaG-e_G.js";
3
- import { o as n } from "./getRuntime-DAPqFH2W.js";
4
- import { i as r, r as i, t as a } from "./FileIcon-7JaSR3Gn.js";
5
- import { t as o } from "./useOpenApp-CBIm7Gzl.js";
6
- import { I as s, o as c, ut as l, x as u } from "./desktopStore-F8bgLqFl.js";
7
- import { useCallback as d, useEffect as f, useState as p } from "react";
8
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
9
- //#region src/hooks/useNotifications.ts
10
- var _ = () => {
11
- let e = c((e) => e.notifications), t = c((e) => e.addNotification), n = c((e) => e.removeNotification);
12
- return {
13
- notifications: e,
14
- notify: d((e, n, r) => {
15
- let i = {
16
- id: l(),
17
- title: e,
18
- message: n,
19
- fcIcon: r?.fcIcon,
20
- onClose: r?.onClose
21
- };
22
- return t(i), i.id;
23
- }, [t]),
24
- dismiss: d((e) => {
25
- n(e);
26
- }, [n]),
27
- addNotification: t,
28
- removeNotification: n
29
- };
30
- }, v = {
31
- root: "_root_113j7_1",
32
- item: "_item_113j7_9"
33
- }, y = ({ node: e, allNodes: r, currentFolderId: i, depth: o, onNavigate: s }) => {
34
- let c = r.filter((t) => t.parentId === e.id && t.type === "folder");
35
- return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g(t, {
36
- className: v.item,
37
- "data-active": i === e.id || void 0,
38
- style: { paddingLeft: 8 + o * 14 },
39
- onClick: () => s(e.id),
40
- "aria-label": e.name,
41
- "aria-current": i === e.id ? "page" : void 0,
42
- children: [/* @__PURE__ */ h(a, {
43
- type: "folder",
44
- folderNode: e,
45
- size: 14
46
- }), /* @__PURE__ */ h(n, {
47
- size: "xs",
48
- ml: 6,
49
- truncate: !0,
50
- children: e.name
51
- })]
52
- }), c.map((e) => /* @__PURE__ */ h(y, {
53
- node: e,
54
- allNodes: r,
55
- currentFolderId: i,
56
- depth: o + 1,
57
- onNavigate: s
58
- }, e.id))] });
59
- }, b = ({ allNodes: e, currentFolderId: r, onNavigate: i }) => {
60
- let o = e.filter((e) => e.parentId === null && e.type === "folder");
61
- return /* @__PURE__ */ g("nav", {
62
- className: v.root,
63
- "aria-label": "Folder tree",
64
- children: [/* @__PURE__ */ g(t, {
65
- className: v.item,
66
- "data-active": r === null || void 0,
67
- style: { paddingLeft: 8 },
68
- onClick: () => i(null),
69
- "aria-label": "Home",
70
- "aria-current": r === null ? "page" : void 0,
71
- children: [/* @__PURE__ */ h(a, {
72
- type: "folder",
73
- size: 14
74
- }), /* @__PURE__ */ h(n, {
75
- size: "xs",
76
- ml: 6,
77
- fw: 500,
78
- children: "Home"
79
- })]
80
- }), o.map((t) => /* @__PURE__ */ h(y, {
81
- node: t,
82
- allNodes: e,
83
- currentFolderId: r,
84
- depth: 1,
85
- onNavigate: i
86
- }, t.id))]
87
- });
88
- }, x = {
89
- grid: "_grid_1cag6_1",
90
- item: "_item_1cag6_9",
91
- icon: "_icon_1cag6_26",
92
- name: "_name_1cag6_34",
93
- empty: "_empty_1cag6_46"
94
- }, S = ({ node: e, onNavigate: r, onOpenFile: i, onContextMenu: o }) => {
95
- let s = () => {
96
- e.type === "folder" ? r(e.id) : i(e);
97
- }, c = e.type === "folder" ? `Open folder ${e.name}` : `Open file ${e.name}`;
98
- return /* @__PURE__ */ g(t, {
99
- className: x.item,
100
- onDoubleClick: s,
101
- onContextMenu: (t) => o(t, e.id),
102
- "aria-label": c,
103
- role: "option",
104
- children: [/* @__PURE__ */ h("div", {
105
- className: x.icon,
106
- children: /* @__PURE__ */ h(a, {
107
- type: e.type,
108
- name: e.name,
109
- folderNode: e.type === "folder" ? e : void 0,
110
- size: 32
111
- })
112
- }), /* @__PURE__ */ h(n, {
113
- size: "xs",
114
- className: x.name,
115
- truncate: !0,
116
- children: e.name
117
- })]
118
- });
119
- }, C = ({ nodes: e, onNavigate: t, onOpenFile: r, onNodeContextMenu: i }) => {
120
- let a = c((e) => e.filesSortMode);
121
- if (e.length === 0) return /* @__PURE__ */ h("div", {
122
- className: x.empty,
123
- children: /* @__PURE__ */ h(n, {
124
- size: "sm",
125
- c: "dimmed",
126
- children: "This folder is empty"
127
- })
128
- });
129
- let o = s(e, a);
130
- return /* @__PURE__ */ h("div", {
131
- className: x.grid,
132
- role: "listbox",
133
- "aria-label": "Files",
134
- children: o.map((e) => /* @__PURE__ */ h(S, {
135
- node: e,
136
- onNavigate: t,
137
- onOpenFile: r,
138
- onContextMenu: i
139
- }, e.id))
140
- });
141
- }, w = {
142
- root: "_root_13mxj_1",
143
- breadcrumbBar: "_breadcrumbBar_13mxj_9",
144
- breadcrumbSep: "_breadcrumbSep_13mxj_16",
145
- body: "_body_13mxj_21",
146
- sidebar: "_sidebar_13mxj_28",
147
- content: "_content_13mxj_35"
148
- }, T = /* @__PURE__ */ e({ default: () => E }), E = ({ window: e }) => {
149
- let t = e?.contentData?.initialFolderId, a = c((e) => e.fsNodes), s = c((e) => e.openContextMenu), l = c((e) => e.setFilesCurrentFolderId), m = o(), { notify: v } = _(), [y, x] = p(t ?? null), S = d((e) => {
150
- x(e), l(e);
151
- }, [l]);
152
- f(() => {
153
- l(t ?? null);
154
- }, [t, l]);
155
- let T = y === null ? a.filter((e) => e.parentId === null) : a.filter((e) => e.parentId === y), E = () => {
156
- let e = [{
157
- id: null,
158
- name: "Home"
159
- }], t = y, n = [];
160
- for (; t !== null;) {
161
- let e = a.find((e) => e.id === t);
162
- if (!e) break;
163
- n.unshift({
164
- id: e.id,
165
- name: e.name
166
- }), t = e.parentId;
167
- }
168
- return [...e, ...n];
169
- }, D = d((e) => {
170
- e.preventDefault(), e.stopPropagation(), s(e.clientX, e.clientY, "files");
171
- }, [s]), O = d((e, t) => {
172
- e.preventDefault(), e.stopPropagation(), s(e.clientX, e.clientY, "files", t);
173
- }, [s]), k = d((e) => {
174
- try {
175
- let t = u(e);
176
- if (t) m(t.appId, { contentData: t.contentData });
177
- else {
178
- let t = e.mimeType || "unknown";
179
- console.warn(`[FilesApp] Unsupported file type: ${e.name} (${t})`), v("Unsupported file type", `Cannot open "${e.name}". File type "${t}" is not supported.`, { fcIcon: "FcDeleteRow" });
180
- }
181
- } catch (t) {
182
- console.error("[FilesApp] Error opening file:", t), v("Error opening file", `An unexpected error occurred while opening "${e.name}".`, { fcIcon: "FcHighPriority" });
183
- }
184
- }, [m, v]), A = E();
185
- return /* @__PURE__ */ g("div", {
186
- className: w.root,
187
- onContextMenu: D,
188
- children: [/* @__PURE__ */ h("div", {
189
- className: w.breadcrumbBar,
190
- children: /* @__PURE__ */ h(i, {
191
- separator: "›",
192
- classNames: { separator: w.breadcrumbSep },
193
- children: A.map((e, t) => t === A.length - 1 ? /* @__PURE__ */ h(n, {
194
- size: "xs",
195
- fw: 500,
196
- children: e.name
197
- }, e.id ?? "root") : /* @__PURE__ */ h(r, {
198
- size: "xs",
199
- onClick: () => S(e.id),
200
- children: e.name
201
- }, e.id ?? "root"))
202
- })
203
- }), /* @__PURE__ */ g("div", {
204
- className: w.body,
205
- children: [/* @__PURE__ */ h("aside", {
206
- className: w.sidebar,
207
- children: /* @__PURE__ */ h(b, {
208
- allNodes: a,
209
- currentFolderId: y,
210
- onNavigate: S
211
- })
212
- }), /* @__PURE__ */ h("main", {
213
- className: w.content,
214
- children: /* @__PURE__ */ h(C, {
215
- nodes: T,
216
- onNavigate: S,
217
- onOpenFile: k,
218
- onNodeContextMenu: O
219
- })
220
- })]
221
- })]
222
- });
223
- };
224
- //#endregion
225
- export { T as n, _ as r, E as t };