@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,17 +1,12 @@
1
1
  import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { t } from "./Box-DSKR_qaa.js";
3
- import { t as n } from "./TextInput-C-JtGWn1.js";
4
- import { t as r } from "./UnstyledButton-DGaG-e_G.js";
5
- import { t as i } from "./ActionIcon-Drh4p6Fv.js";
6
- import { t as a } from "./Group-CtBJSfCo.js";
7
- import { i as o, o as s } from "./getRuntime-DAPqFH2W.js";
8
- import { n as c, t as l } from "./AppIcon-XumS3bIG.js";
9
- import { C as u, o as d } from "./desktopStore-F8bgLqFl.js";
10
- import { i as f } from "./useCloseInterceptor-BZd3VILp.js";
11
- import { t as p } from "./VscIcon-DBfVnArE.js";
12
- import { n as m } from "./menuEditStore-Cj1zAwxQ.js";
13
- import { createContext as h, useCallback as g, useContext as _, useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
14
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
2
+ import { G as t, ct as n, o as r } from "./desktopStore-8cSZlj7s.js";
3
+ import { t as i } from "./AppIcon-mtEoyzOb.js";
4
+ import { i as a } from "./useCloseInterceptor-CIxhOZx1.js";
5
+ import { t as o } from "./VscIcon-AEENjKOE.js";
6
+ import { n as s } from "./menuEditStore-CxsgLiQu.js";
7
+ import { createContext as c, useCallback as l, useContext as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
8
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
9
+ import { ActionIcon as _, Box as v, Card as y, Group as b, Text as x, TextInput as S, UnstyledButton as C } from "@mantine/core";
15
10
  import { useTranslation as w } from "react-i18next";
16
11
  import { DndContext as T, DragOverlay as E, defaultDropAnimation as D, pointerWithin as O, useDraggable as k, useDroppable as A } from "@dnd-kit/core";
17
12
  //#region src/hooks/useFolderName.ts
@@ -30,32 +25,32 @@ function M(e) {
30
25
  }
31
26
  //#endregion
32
27
  //#region src/hooks/useDragDrop/DragDropStateContext.tsx
33
- var N = h(null), P = ({ children: e, onDrop: t, onCancel: n }) => {
34
- let [r, i] = x(null), [a, o] = x(null), s = g((e) => {
28
+ var N = c(null), P = ({ children: e, onDrop: t, onCancel: n }) => {
29
+ let [r, i] = m(null), [a, o] = m(null), s = l((e) => {
35
30
  let t = e.active.data.current;
36
31
  t && i(t);
37
- }, []), c = g((e) => {
32
+ }, []), c = l((e) => {
38
33
  if (e.over) {
39
34
  let t = e.over.data.current;
40
35
  t && o(t);
41
36
  } else o(null);
42
- }, []), l = g((e) => {
37
+ }, []), u = l((e) => {
43
38
  let { active: r, over: a } = e;
44
39
  if (a && r.data.current) {
45
40
  let e = r.data.current, n = a.data.current;
46
41
  n.accepts.includes(e.type) && t(e, n);
47
42
  } else !a && n && n();
48
43
  i(null), o(null);
49
- }, [t, n]), u = y(() => ({
44
+ }, [t, n]), d = f(() => ({
50
45
  activeItem: r,
51
46
  overTarget: a
52
47
  }), [r, a]);
53
- return /* @__PURE__ */ S(N.Provider, {
54
- value: u,
55
- children: /* @__PURE__ */ S(T, {
48
+ return /* @__PURE__ */ h(N.Provider, {
49
+ value: d,
50
+ children: /* @__PURE__ */ h(T, {
56
51
  onDragStart: s,
57
52
  onDragOver: c,
58
- onDragEnd: l,
53
+ onDragEnd: u,
59
54
  collisionDetection: O,
60
55
  children: e
61
56
  })
@@ -87,7 +82,7 @@ function F(e) {
87
82
  //#endregion
88
83
  //#region src/hooks/useDragDrop/useDroppableArea.ts
89
84
  function I(e) {
90
- let { target: t, disabled: n = !1 } = e, r = _(N), { setNodeRef: i, isOver: a } = A({
85
+ let { target: t, disabled: n = !1 } = e, r = u(N), { setNodeRef: i, isOver: a } = A({
91
86
  id: t.id,
92
87
  data: t,
93
88
  disabled: n
@@ -101,7 +96,7 @@ function I(e) {
101
96
  //#endregion
102
97
  //#region src/hooks/useDragDrop/useDragDropState.ts
103
98
  function L() {
104
- let e = _(N);
99
+ let e = u(N);
105
100
  if (!e) throw Error("useDragDropState must be used within a DragDropProvider");
106
101
  return e;
107
102
  }
@@ -119,17 +114,17 @@ var R = ({ activatorEvent: e, transform: t, draggingNodeRect: n }) => {
119
114
  };
120
115
  }, z = { dragOverlay: "_dragOverlay_myknw_1" }, B = () => {
121
116
  let { activeItem: e } = L();
122
- return e ? /* @__PURE__ */ S(E, {
117
+ return e ? /* @__PURE__ */ h(E, {
123
118
  dropAnimation: D,
124
119
  modifiers: [R],
125
- children: /* @__PURE__ */ C(t, {
120
+ children: /* @__PURE__ */ g(v, {
126
121
  className: z.dragOverlay,
127
- children: [/* @__PURE__ */ S(l, {
122
+ children: [/* @__PURE__ */ h(i, {
128
123
  fcIcon: e.metadata?.fcIcon,
129
124
  iconUrl: e.metadata?.iconUrl,
130
125
  fallback: e.metadata?.icon,
131
126
  size: 20
132
- }), /* @__PURE__ */ S(s, {
127
+ }), /* @__PURE__ */ h(x, {
133
128
  size: "xs",
134
129
  children: e.name
135
130
  })]
@@ -154,93 +149,93 @@ var R = ({ activatorEvent: e, transform: t, draggingNodeRect: n }) => {
154
149
  availableApps: "_availableApps_y9c6e_49",
155
150
  appGrid: "_appGrid_y9c6e_58",
156
151
  appItem: "_appItem_y9c6e_64"
157
- }, U = /* @__PURE__ */ e({ default: () => Y }), W = ({ folder: e, isEditing: r, editingName: o, onEdit: d, onDelete: f, onRename: m, onSetEditingName: h, onRemoveApp: g }) => {
158
- let { t: _ } = w("menuedit"), v = M(e), { activeItem: y } = L(), { setNodeRef: b, isOver: x } = I({ target: {
152
+ }, U = /* @__PURE__ */ e({ default: () => Y }), W = ({ folder: e, isEditing: t, editingName: r, onEdit: a, onDelete: s, onRename: c, onSetEditingName: l, onRemoveApp: u }) => {
153
+ let { t: d } = w("menuedit"), f = M(e), { activeItem: p } = L(), { setNodeRef: m, isOver: C } = I({ target: {
159
154
  type: "launcher-folder",
160
155
  id: e.id,
161
- name: v,
156
+ name: f,
162
157
  accepts: V["launcher-folder"]
163
158
  } });
164
- return /* @__PURE__ */ C(c, {
165
- ref: b,
159
+ return /* @__PURE__ */ g(y, {
160
+ ref: m,
166
161
  className: H.folderCard,
167
162
  shadow: "xs",
168
163
  padding: "xs",
169
- "data-is-over": x && y?.type === "app" ? "true" : void 0,
170
- children: [/* @__PURE__ */ C(a, {
164
+ "data-is-over": C && p?.type === "app" ? "true" : void 0,
165
+ children: [/* @__PURE__ */ g(b, {
171
166
  justify: "space-between",
172
167
  mb: 4,
173
- children: [r ? /* @__PURE__ */ S(n, {
174
- value: o,
175
- onChange: (e) => h(e.target.value),
176
- onBlur: () => m(e.id),
168
+ children: [t ? /* @__PURE__ */ h(S, {
169
+ value: r,
170
+ onChange: (e) => l(e.target.value),
171
+ onBlur: () => c(e.id),
177
172
  onKeyDown: (t) => {
178
- t.key === "Enter" && (t.preventDefault(), m(e.id));
173
+ t.key === "Enter" && (t.preventDefault(), c(e.id));
179
174
  },
180
175
  autoFocus: !0,
181
176
  size: "xs",
182
177
  style: { flex: 1 }
183
- }) : /* @__PURE__ */ C(a, {
178
+ }) : /* @__PURE__ */ g(b, {
184
179
  gap: "xs",
185
180
  children: [
186
- /* @__PURE__ */ S(l, {
181
+ /* @__PURE__ */ h(i, {
187
182
  fcIcon: e.fcIcon,
188
183
  size: 16
189
184
  }),
190
- /* @__PURE__ */ S(s, {
185
+ /* @__PURE__ */ h(x, {
191
186
  size: "sm",
192
187
  fw: 500,
193
- children: v
188
+ children: f
194
189
  }),
195
- e.isPredefined && /* @__PURE__ */ C(s, {
190
+ e.isPredefined && /* @__PURE__ */ g(x, {
196
191
  size: "xs",
197
192
  c: "dimmed",
198
193
  children: [
199
194
  "(",
200
- _("predefined"),
195
+ d("predefined"),
201
196
  ")"
202
197
  ]
203
198
  })
204
199
  ]
205
- }), !e.isPredefined && !r && /* @__PURE__ */ C(a, {
200
+ }), !e.isPredefined && !t && /* @__PURE__ */ g(b, {
206
201
  gap: 4,
207
- children: [/* @__PURE__ */ S(i, {
202
+ children: [/* @__PURE__ */ h(_, {
208
203
  variant: "subtle",
209
204
  size: "xs",
210
- onClick: () => d(e.id),
211
- "aria-label": _("rename"),
212
- children: /* @__PURE__ */ S(p, {
205
+ onClick: () => a(e.id),
206
+ "aria-label": d("rename"),
207
+ children: /* @__PURE__ */ h(o, {
213
208
  name: "VscEdit",
214
209
  size: 14
215
210
  })
216
- }), f && /* @__PURE__ */ S(i, {
211
+ }), s && /* @__PURE__ */ h(_, {
217
212
  variant: "subtle",
218
213
  size: "xs",
219
214
  color: "red",
220
- onClick: () => f(e.id),
221
- "aria-label": _("delete"),
222
- children: /* @__PURE__ */ S(p, {
215
+ onClick: () => s(e.id),
216
+ "aria-label": d("delete"),
217
+ children: /* @__PURE__ */ h(o, {
223
218
  name: "VscTrash",
224
219
  size: 14
225
220
  })
226
221
  })]
227
222
  })]
228
- }), /* @__PURE__ */ S(t, {
223
+ }), /* @__PURE__ */ h(v, {
229
224
  className: H.appList,
230
225
  children: e.appIds.map((t) => {
231
- let n = u.find((e) => e.id === t);
232
- return n ? /* @__PURE__ */ S(G, {
233
- app: n,
226
+ let r = n.find((e) => e.id === t);
227
+ return r ? /* @__PURE__ */ h(G, {
228
+ app: r,
234
229
  sourceId: e.id,
235
230
  onContextMenu: (n) => {
236
- n.preventDefault(), n.stopPropagation(), g(t, e.id);
231
+ n.preventDefault(), n.stopPropagation(), u(t, e.id);
237
232
  }
238
233
  }, t) : null;
239
234
  })
240
235
  })]
241
236
  });
242
237
  }, G = ({ app: e, sourceId: t, onContextMenu: n }) => {
243
- let { attributes: i, listeners: a, setNodeRef: o, isDragging: c, style: u } = F({ item: {
238
+ let { attributes: r, listeners: a, setNodeRef: o, isDragging: s, style: c } = F({ item: {
244
239
  type: "app",
245
240
  id: e.id,
246
241
  name: e.name,
@@ -252,53 +247,53 @@ var R = ({ activatorEvent: e, transform: t, draggingNodeRect: n }) => {
252
247
  icon: e.icon
253
248
  }
254
249
  } });
255
- return /* @__PURE__ */ C(r, {
250
+ return /* @__PURE__ */ g(C, {
256
251
  ref: o,
257
252
  className: H.appItem,
258
253
  style: {
259
- ...u,
260
- opacity: c ? .5 : 1
254
+ ...c,
255
+ opacity: s ? .5 : 1
261
256
  },
262
257
  onContextMenu: n,
263
- ...i,
258
+ ...r,
264
259
  ...a,
265
- children: [/* @__PURE__ */ S(l, {
260
+ children: [/* @__PURE__ */ h(i, {
266
261
  fcIcon: e.fcIcon,
267
262
  iconUrl: e.iconUrl,
268
263
  fallback: e.icon,
269
264
  size: 16
270
- }), /* @__PURE__ */ S(s, {
265
+ }), /* @__PURE__ */ h(x, {
271
266
  size: "xs",
272
267
  children: e.name
273
268
  })]
274
269
  });
275
270
  }, K = ({ customFolderId: e }) => {
276
- let { t: n } = w("menuedit"), { activeItem: r } = L(), { setNodeRef: i, isOver: a } = I({ target: {
271
+ let { t } = w("menuedit"), { activeItem: i } = L(), { setNodeRef: a, isOver: o } = I({ target: {
277
272
  type: "available-apps",
278
273
  id: "available-apps",
279
274
  name: "Available Apps",
280
275
  accepts: V["available-apps"]
281
- } }), o = new Set(d.getState().launcherFolders.flatMap((e) => e.appIds)), c = u.filter((e) => e.id !== "settings" && e.id !== "menuedit"), l = d((e) => e.addAppToFolder);
282
- return /* @__PURE__ */ C(t, {
283
- ref: i,
276
+ } }), s = new Set(r.getState().launcherFolders.flatMap((e) => e.appIds)), c = n.filter((e) => e.id !== "settings" && e.id !== "menuedit"), l = r((e) => e.addAppToFolder);
277
+ return /* @__PURE__ */ g(v, {
278
+ ref: a,
284
279
  className: H.availableApps,
285
- "data-is-over": a && r?.type === "app" ? "true" : void 0,
280
+ "data-is-over": o && i?.type === "app" ? "true" : void 0,
286
281
  children: [
287
- /* @__PURE__ */ S(s, {
282
+ /* @__PURE__ */ h(x, {
288
283
  size: "xs",
289
284
  c: "dimmed",
290
285
  mb: 8,
291
- children: n("availableApps")
286
+ children: t("availableApps")
292
287
  }),
293
- e === null && /* @__PURE__ */ S(s, {
288
+ e === null && /* @__PURE__ */ h(x, {
294
289
  size: "xs",
295
290
  c: "orange",
296
291
  mb: 4,
297
- children: n("canCreateNewFolder")
292
+ children: t("canCreateNewFolder")
298
293
  }),
299
- /* @__PURE__ */ S(t, {
294
+ /* @__PURE__ */ h(v, {
300
295
  className: H.appGrid,
301
- children: c.filter((e) => !o.has(e.id)).map((t) => /* @__PURE__ */ S(q, {
296
+ children: c.filter((e) => !s.has(e.id)).map((t) => /* @__PURE__ */ h(q, {
302
297
  app: t,
303
298
  targetFolderId: e,
304
299
  onAdd: l
@@ -307,7 +302,7 @@ var R = ({ activatorEvent: e, transform: t, draggingNodeRect: n }) => {
307
302
  ]
308
303
  });
309
304
  }, q = ({ app: e, targetFolderId: t, onAdd: n }) => {
310
- let { attributes: i, listeners: a, setNodeRef: o, isDragging: c, style: u } = F({ item: {
305
+ let { attributes: r, listeners: a, setNodeRef: o, isDragging: s, style: c } = F({ item: {
311
306
  type: "app",
312
307
  id: e.id,
313
308
  name: e.name,
@@ -318,76 +313,76 @@ var R = ({ activatorEvent: e, transform: t, draggingNodeRect: n }) => {
318
313
  iconUrl: e.iconUrl,
319
314
  icon: e.icon
320
315
  }
321
- } }), d = () => {
316
+ } }), l = () => {
322
317
  t && n(e.id, t);
323
318
  };
324
- return /* @__PURE__ */ C(r, {
319
+ return /* @__PURE__ */ g(C, {
325
320
  ref: o,
326
321
  className: H.appItem,
327
322
  style: {
328
- ...u,
329
- opacity: c ? 0 : 1
323
+ ...c,
324
+ opacity: s ? 0 : 1
330
325
  },
331
- onClick: d,
326
+ onClick: l,
332
327
  disabled: !t,
333
- ...i,
328
+ ...r,
334
329
  ...a,
335
- children: [/* @__PURE__ */ S(l, {
330
+ children: [/* @__PURE__ */ h(i, {
336
331
  fcIcon: e.fcIcon,
337
332
  iconUrl: e.iconUrl,
338
333
  fallback: e.icon,
339
334
  size: 16
340
- }), /* @__PURE__ */ S(s, {
335
+ }), /* @__PURE__ */ h(x, {
341
336
  size: "xs",
342
337
  children: e.name
343
338
  })]
344
339
  });
345
340
  }, J = ({ window: e, notifyReady: n }) => {
346
- let { t: r } = w("menuedit"), c = e?.id, l = d((e) => e.launcherFolders), u = d((e) => e.setLauncherFolders), h = d((e) => e.createLauncherFolder), _ = d((e) => e.updateLauncherFolder), y = d((e) => e.deleteLauncherFolder), T = d((e) => e.removeAppFromFolder), [E, D] = x(null), [O, k] = x(""), A = b(!1);
347
- v(() => {
348
- c && (A.current || (A.current = !0, m.getState().reset(c)));
349
- }, [c]), v(() => {
341
+ let { t: i } = w("menuedit"), c = e?.id, u = r((e) => e.launcherFolders), f = r((e) => e.setLauncherFolders), y = r((e) => e.createLauncherFolder), S = r((e) => e.updateLauncherFolder), C = r((e) => e.deleteLauncherFolder), T = r((e) => e.removeAppFromFolder), [E, D] = m(null), [O, k] = m(""), A = p(!1);
342
+ d(() => {
343
+ c && (A.current || (A.current = !0, s.getState().reset(c)));
344
+ }, [c]), d(() => {
350
345
  if (!c) return;
351
- let e = m.getState();
352
- if (e.getSnapshot(c) === null) e.takeSnapshot(c, l);
346
+ let e = s.getState();
347
+ if (e.getSnapshot(c) === null) e.takeSnapshot(c, u);
353
348
  else {
354
349
  let t = e.getSnapshot(c);
355
350
  if (t) {
356
- let n = JSON.stringify(l) !== JSON.stringify(t);
351
+ let n = JSON.stringify(u) !== JSON.stringify(t);
357
352
  e.setIsDirty(c, n);
358
353
  }
359
354
  }
360
- }, [c, l]);
361
- let j = g(() => {
362
- c && m.getState().takeSnapshot(c, l);
363
- }, [c, l]), M = g(() => {
364
- if (!c) return;
365
- let e = m.getState().getSnapshot(c);
366
- e && u(e);
367
355
  }, [c, u]);
368
- f({
369
- isDirtyGetter: g(() => {
356
+ let j = l(() => {
357
+ c && s.getState().takeSnapshot(c, u);
358
+ }, [c, u]), M = l(() => {
359
+ if (!c) return;
360
+ let e = s.getState().getSnapshot(c);
361
+ e && f(e);
362
+ }, [c, f]);
363
+ a({
364
+ isDirtyGetter: l(() => {
370
365
  if (!c) return !1;
371
- let e = m.getState().getSnapshot(c);
372
- return JSON.stringify(l) !== JSON.stringify(e ?? []);
373
- }, [c, l]),
366
+ let e = s.getState().getSnapshot(c);
367
+ return JSON.stringify(u) !== JSON.stringify(e ?? []);
368
+ }, [c, u]),
374
369
  windowId: e?.id,
375
370
  onDiscard: M,
376
371
  onSave: j
377
372
  });
378
- let N = g(() => {
379
- let e = h({
380
- name: r("newFolder"),
373
+ let N = l(() => {
374
+ let e = y({
375
+ name: i("newFolder"),
381
376
  fcIcon: "VscFolder",
382
- order: l.length
377
+ order: u.length
383
378
  });
384
379
  D(e.id), k(e.name);
385
380
  }, [
386
- h,
387
- l.length,
388
- r
381
+ y,
382
+ u.length,
383
+ i
389
384
  ]);
390
- v(() => {
385
+ d(() => {
391
386
  n?.({
392
387
  createFolder: N,
393
388
  save: j,
@@ -399,29 +394,29 @@ var R = ({ activatorEvent: e, transform: t, draggingNodeRect: n }) => {
399
394
  M,
400
395
  n
401
396
  ]);
402
- let P = g((e) => {
403
- let t = l.find((t) => t.id === e);
397
+ let P = l((e) => {
398
+ let t = u.find((t) => t.id === e);
404
399
  t && (D(t.id), k(t.name));
405
- }, [l]), F = g((e) => {
406
- O.trim() && _(e, { name: O.trim() }), D(null);
407
- }, [O, _]), I = o(), L = l.filter((e) => e.isPredefined), R = l.filter((e) => !e.isPredefined), z = R.length > 0 ? R[0].id : null;
408
- return /* @__PURE__ */ S(t, {
400
+ }, [u]), F = l((e) => {
401
+ O.trim() && S(e, { name: O.trim() }), D(null);
402
+ }, [O, S]), I = t(), L = u.filter((e) => e.isPredefined), R = u.filter((e) => !e.isPredefined), z = R.length > 0 ? R[0].id : null;
403
+ return /* @__PURE__ */ h(v, {
409
404
  className: H.container,
410
405
  "data-windowid": e?.id,
411
406
  "data-menuedit-container": !0,
412
- children: /* @__PURE__ */ C(t, {
407
+ children: /* @__PURE__ */ g(v, {
413
408
  className: H.content,
414
409
  children: [
415
- L.length > 0 && /* @__PURE__ */ C(t, {
410
+ L.length > 0 && /* @__PURE__ */ g(v, {
416
411
  mb: "md",
417
- children: [/* @__PURE__ */ S(s, {
412
+ children: [/* @__PURE__ */ h(x, {
418
413
  size: "xs",
419
414
  c: "dimmed",
420
415
  mb: 8,
421
- children: r("predefinedFolders")
422
- }), /* @__PURE__ */ S(t, {
416
+ children: i("predefinedFolders")
417
+ }), /* @__PURE__ */ h(v, {
423
418
  className: H.folderList,
424
- children: L.map((e) => /* @__PURE__ */ S(W, {
419
+ children: L.map((e) => /* @__PURE__ */ h(W, {
425
420
  folder: e,
426
421
  isEditing: !1,
427
422
  editingName: "",
@@ -432,43 +427,43 @@ var R = ({ activatorEvent: e, transform: t, draggingNodeRect: n }) => {
432
427
  }, e.id))
433
428
  })]
434
429
  }),
435
- I && R.length > 0 && /* @__PURE__ */ C(t, {
430
+ I && R.length > 0 && /* @__PURE__ */ g(v, {
436
431
  mb: "md",
437
- children: [/* @__PURE__ */ S(s, {
432
+ children: [/* @__PURE__ */ h(x, {
438
433
  size: "xs",
439
434
  c: "dimmed",
440
435
  mb: 8,
441
- children: r("customFolders")
442
- }), /* @__PURE__ */ S(t, {
436
+ children: i("customFolders")
437
+ }), /* @__PURE__ */ h(v, {
443
438
  className: H.folderList,
444
- children: R.map((e) => /* @__PURE__ */ S(W, {
439
+ children: R.map((e) => /* @__PURE__ */ h(W, {
445
440
  folder: e,
446
441
  isEditing: E === e.id,
447
442
  editingName: O,
448
443
  onEdit: P,
449
- onDelete: y,
444
+ onDelete: C,
450
445
  onRename: F,
451
446
  onSetEditingName: k,
452
447
  onRemoveApp: T
453
448
  }, e.id))
454
449
  })]
455
450
  }),
456
- /* @__PURE__ */ C(a, {
451
+ /* @__PURE__ */ g(b, {
457
452
  justify: "space-between",
458
453
  mb: "md",
459
454
  children: [
460
- /* @__PURE__ */ S(K, { customFolderId: z }),
461
- /* @__PURE__ */ S(s, {
455
+ /* @__PURE__ */ h(K, { customFolderId: z }),
456
+ /* @__PURE__ */ h(x, {
462
457
  size: "xs",
463
458
  c: "dimmed",
464
459
  mt: "md",
465
- children: r("instructions")
460
+ children: i("instructions")
466
461
  }),
467
- I && /* @__PURE__ */ S(i, {
462
+ I && /* @__PURE__ */ h(_, {
468
463
  variant: "light",
469
464
  onClick: N,
470
- "aria-label": r("addFolder"),
471
- children: /* @__PURE__ */ S(p, {
465
+ "aria-label": i("addFolder"),
466
+ children: /* @__PURE__ */ h(o, {
472
467
  name: "VscAdd",
473
468
  size: 16
474
469
  })
@@ -479,9 +474,9 @@ var R = ({ activatorEvent: e, transform: t, draggingNodeRect: n }) => {
479
474
  })
480
475
  });
481
476
  }, Y = (e) => {
482
- let t = d((e) => e.addAppToFolder), n = d((e) => e.removeAppFromFolder);
483
- return /* @__PURE__ */ C(P, {
484
- onDrop: g((e, r) => {
477
+ let t = r((e) => e.addAppToFolder), n = r((e) => e.removeAppFromFolder);
478
+ return /* @__PURE__ */ g(P, {
479
+ onDrop: l((e, r) => {
485
480
  if (e.type === "app") {
486
481
  if (r.type === "available-apps") {
487
482
  e.sourceType === "launcher-folder" && n(e.id, e.sourceId);
@@ -490,7 +485,7 @@ var R = ({ activatorEvent: e, transform: t, draggingNodeRect: n }) => {
490
485
  r.type === "launcher-folder" && (e.sourceId !== r.id && e.sourceType === "launcher-folder" && n(e.id, e.sourceId), t(e.id, r.id));
491
486
  }
492
487
  }, [t, n]),
493
- children: [/* @__PURE__ */ S(J, { ...e }), /* @__PURE__ */ S(B, {})]
488
+ children: [/* @__PURE__ */ h(J, { ...e }), /* @__PURE__ */ h(B, {})]
494
489
  });
495
490
  };
496
491
  //#endregion
@@ -0,0 +1 @@
1
+ const e=require(`./NotesApp-BmQIBtJ2.cjs`),t=require(`./AppMenuBar-CAlkNHjj.cjs`),n=require(`./menuEditStore-CYwtfD6H.cjs`),r=require(`./useMenuBarUtils-DAap0ukp.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`),o=require(`react-i18next`);var s=e=>{let{windowId:t,contentData:a,onExit:s}=e,{t:c}=(0,o.useTranslation)(`menuedit`),{t:l}=(0,o.useTranslation)(`common`),u=n.t(t),d=a?.createFolder,f=a?.save,p=a?.discard;return(0,i.useMemo)(()=>r.t([{type:`menu`,label:l(`menu.file`),items:[{type:`item`,label:c(`newFolder`),icon:`FcPlus`,onClick:()=>d?.()},{type:`divider`},{type:`item`,label:l(`actions.save`),icon:`FcInspection`,onClick:()=>f?.(),disabled:!u},{type:`item`,label:l(`actions.discard`),icon:`FcCancel`,onClick:()=>p?.(),disabled:!u},{type:`divider`},{type:`item`,label:l(`actions.exit`),icon:`FcLeft`,onClick:s}]}],u),[c,l,u,d,f,p,s])},c=e.i({MenuEditMenuBar:()=>l}),l=(0,i.memo)(({windowId:e,contentData:n,onExit:r})=>(0,a.jsx)(t.t,{elements:s({windowId:e,contentData:n,onExit:r})}));l.displayName=`MenuEditMenuBar`,Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { t } from "./AppMenuBar-CnIEVjr8.js";
3
- import { t as n } from "./menuEditStore-Cj1zAwxQ.js";
4
- import { t as r } from "./useMenuBarUtils-nmu9yehT.js";
2
+ import { t } from "./AppMenuBar-DmSfQRXU.js";
3
+ import { t as n } from "./menuEditStore-CxsgLiQu.js";
4
+ import { t as r } from "./useMenuBarUtils-ChAfI7OA.js";
5
5
  import { memo as i, useMemo as a } from "react";
6
6
  import { jsx as o } from "react/jsx-runtime";
7
7
  import { useTranslation as s } from "react-i18next";
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const l=require(`./desktopStore-C1jR6Fdb.cjs`),u=require(`./useCloseInterceptor-CdX-09Ib.cjs`),d=require(`./VscIcon-BYb_Soyy.cjs`),f=require(`./FilePickerApp-By6-vbag.cjs`),p=require(`./notesStore-CrWTO6oB.cjs`);let m=require(`react`),h=require(`react/jsx-runtime`),g=require(`zustand`),_=require(`zustand/middleware`),v=require(`react-i18next`),y=require(`@tiptap/react`),b=require(`@tiptap/starter-kit`);b=c(b);let x=require(`@tiptap/markdown`),S=require(`@tiptap/core`);var C=(0,g.create)()((0,_.persist)((e,t)=>({snapshots:{},setSnapshot:(t,n)=>e(e=>({snapshots:{...e.snapshots,[t]:n}})),getSnapshot:e=>{let{snapshots:n}=t();return n[e]??null},clearSnapshot:t=>e(e=>{let n={...e.snapshots};return delete n[t],{snapshots:n}})}),{name:`fde-desktop:appTempMemory`,storage:(0,_.createJSONStorage)(()=>localStorage)})),w={container:`_container_3xue5_1`,toolbar:`_toolbar_3xue5_11`,toolbarBtn:`_toolbarBtn_3xue5_22`,active:`_active_3xue5_57`,separator:`_separator_3xue5_63`,editorContent:`_editorContent_3xue5_71`},T=o({default:()=>k}),E=[...l.b],D=S.Extension.create({name:`clearMarksOnEnter`,addKeyboardShortcuts(){return{Enter:({editor:e})=>{let{state:t,dispatch:n}=e.view,{selection:r,schema:i}=t,{$from:a,empty:o}=r;return!o||a.parent.type!==i.nodes.paragraph?!1:(n(t.tr.split(a.pos).setStoredMarks([])),!0)}}}}),O=`Desktop/NotesAppWelcome.md`,k=({window:e,notifyReady:t})=>{let{t:n}=(0,v.useTranslation)(`notes`),r=e,i=r?.id,a=i?`notesApp-${i}`:`notesApp`,o=r?.contentData,[s,c]=(0,m.useState)(o?.initialName??n(`untitled`)),[g,_]=(0,m.useState)(!1),S=(0,m.useRef)(`save`),[T,k]=(0,m.useState)(o?.fileId??null),A=(0,m.useRef)(o?.initialContent??``),[j,M]=(0,m.useState)(!1),N=p.n(e=>e.states[i??``]?.contentLoaded??!1),P=p.n(e=>e.setContentLoaded);(0,m.useEffect)(()=>{i&&p.n.getState().reset(i)},[i]),(0,m.useEffect)(()=>{i&&p.n.getState().setIsDirty(i,j)},[i,j]);let F=l.o(e=>e.createFile),I=l.o(e=>e.updateFile),L=l.o(e=>e.fsNodes),R=(0,y.useEditor)({extensions:[b.default,x.Markdown,D],content:o?.initialContent??``,contentType:`markdown`,shouldRerenderOnTransaction:!1,onCreate:()=>{let e=R?.getMarkdown()??``;A.current=e,a&&C.getState().setSnapshot(a,e)},onUpdate:()=>{let e=R?.getMarkdown()??``,t=e!==(A.current??``);M(t),!t&&a&&C.getState().setSnapshot(a,e)}});(0,m.useEffect)(()=>{if(!T||!R||N)return;let e=L.find(e=>e.id===T);if(!e||e.type!==`file`)return;let t=e;t.content&&t.content!==(A.current??``)&&(A.current=t.content,a&&C.getState().setSnapshot(a,t.content),R.commands.setContent(t.content,{emitUpdate:!1,contentType:`markdown`}),P(i,!0))},[T,R,a,L,N,i,P]),(0,m.useEffect)(()=>{if(!R||!i||N)return;let e=!1,t=new AbortController;return(async()=>{try{if(o?.initialContent){e||(R.commands.setContent(o.initialContent,{emitUpdate:!1,contentType:`markdown`}),P(i,!0));return}if(o?.url){let n=await l.a(o.url,t.signal);!e&&n&&(R.commands.setContent(n,{emitUpdate:!1,contentType:`markdown`}),P(i,!0));return}if(o?.fileId)return;let n=await fetch(`/${O}`,{signal:t.signal});if(!e&&n.ok){let e=await n.text();R.commands.setContent(e,{emitUpdate:!1,contentType:`markdown`}),P(i,!0)}}catch(t){!e&&t instanceof Error&&t.name!==`AbortError`&&console.warn(`Failed to load content:`,t)}})(),()=>{e=!0,t.abort()}},[R,o,i,N,P]);let z=(0,m.useCallback)(()=>R?R.getMarkdown():``,[R]),B=(0,m.useCallback)(()=>{R?.commands.setContent(``,{emitUpdate:!1,contentType:`markdown`}),k(null),c(`untitled.md`),A.current=``,M(!1),i&&P(i,!0)},[R,i,P]),V=(0,m.useCallback)(()=>{R&&(T?(I(T,z()),A.current=z(),M(!1)):(S.current=`save`,_(!0)))},[R,z,I,T]),H=(0,m.useCallback)(()=>{R&&(S.current=`saveAs`,_(!0))},[R]),U=(0,m.useCallback)(async({parentId:e,name:t})=>{if(!R)return;let n=z();if(S.current===`saveAs`||!T){let r=await F(t,n,e);k(r.id),c(r.name)}else await I(T,n);A.current=n,M(!1),_(!1)},[R,z,F,I,T]),[W,G]=(0,m.useState)(!1),K=(0,m.useCallback)(e=>{k(e.id),c(e.name),A.current=e.content??``,M(!1),G(!1);let t=e.url;t?l.a(t).then(e=>{e&&(R?.commands.setContent(e,{emitUpdate:!1,contentType:`markdown`}),i&&P(i,!0))}):e.content&&(R?.commands.setContent(e.content,{emitUpdate:!1,contentType:`markdown`}),i&&P(i,!0))},[R,i,P]),q=(0,m.useCallback)(()=>G(!0),[]);(0,m.useEffect)(()=>{let e={new:B,save:V,saveAs:H};t?.({...r?.contentData??{},actions:e,setPickerOpen:q,isDirty:j})},[B,V,H,r,t,q,j]),u.i({isDirtyGetter:(0,m.useCallback)(()=>(R?.getMarkdown()??``)!==(A.current??``),[R]),windowId:i,onDiscard:()=>{if(!R)return;let e=A.current??``;R.commands.setContent(e,{emitUpdate:!1,contentType:`markdown`}),M(!1)},onSave:V});let J=(0,y.useEditorState)({editor:R,selector:e=>({canUndo:e.editor?.can().undo()??!1,canRedo:e.editor?.can().redo()??!1,isBold:e.editor?.isActive(`bold`)??!1,isItalic:e.editor?.isActive(`italic`)??!1,isStrike:e.editor?.isActive(`strike`)??!1,isCode:e.editor?.isActive(`code`)??!1,isH1:e.editor?.isActive(`heading`,{level:1})??!1,isH2:e.editor?.isActive(`heading`,{level:2})??!1,isBulletList:e.editor?.isActive(`bulletList`)??!1,isOrderedList:e.editor?.isActive(`orderedList`)??!1,isBlockquote:e.editor?.isActive(`blockquote`)??!1,isCodeBlock:e.editor?.isActive(`codeBlock`)??!1})});return(0,h.jsxs)(`div`,{className:w.container,"data-windowid":r?.id,children:[(0,h.jsxs)(`div`,{className:w.toolbar,role:`toolbar`,"aria-label":n(`toolbar.formatting`),children:[(0,h.jsx)(`button`,{className:`${w.toolbarBtn} ${J?.isBold?w.active:``}`,onClick:()=>R?.chain().focus().toggleBold().run(),disabled:!R?.can().chain().focus().toggleBold().run(),title:n(`toolbar.bold`),"aria-label":n(`toolbar.bold`),children:(0,h.jsx)(d.t,{name:`VscBold`})}),(0,h.jsx)(`button`,{className:`${w.toolbarBtn} ${J?.isItalic?w.active:``}`,onClick:()=>R?.chain().focus().toggleItalic().run(),disabled:!R?.can().chain().focus().toggleItalic().run(),title:n(`toolbar.italic`),"aria-label":n(`toolbar.italic`),children:(0,h.jsx)(d.t,{name:`VscItalic`})}),(0,h.jsx)(`button`,{className:`${w.toolbarBtn} ${J?.isStrike?w.active:``}`,onClick:()=>R?.chain().focus().toggleStrike().run(),disabled:!R?.can().chain().focus().toggleStrike().run(),title:n(`toolbar.strikethrough`),"aria-label":n(`toolbar.strikethrough`),children:(0,h.jsx)(`s`,{children:`S`})}),(0,h.jsx)(`button`,{className:`${w.toolbarBtn} ${J?.isCode?w.active:``}`,onClick:()=>R?.chain().focus().toggleCode().run(),disabled:!R?.can().chain().focus().toggleCode().run(),title:n(`toolbar.inlineCode`),"aria-label":n(`toolbar.inlineCode`),children:(0,h.jsx)(d.t,{name:`VscCode`})}),(0,h.jsx)(`span`,{className:w.separator}),(0,h.jsx)(`button`,{className:`${w.toolbarBtn} ${J?.isH1?w.active:``}`,onClick:()=>R?.chain().focus().toggleHeading({level:1}).run(),title:n(`toolbar.heading1`),"aria-label":n(`toolbar.heading1`),children:(0,h.jsx)(`strong`,{children:`H1`})}),(0,h.jsx)(`button`,{className:`${w.toolbarBtn} ${J?.isH2?w.active:``}`,onClick:()=>R?.chain().focus().toggleHeading({level:2}).run(),title:n(`toolbar.heading2`),"aria-label":n(`toolbar.heading2`),children:(0,h.jsx)(`strong`,{children:`H2`})}),(0,h.jsx)(`span`,{className:w.separator}),(0,h.jsx)(`button`,{className:`${w.toolbarBtn} ${J?.isBulletList?w.active:``}`,onClick:()=>R?.chain().focus().toggleBulletList().run(),title:n(`toolbar.bulletList`),"aria-label":n(`toolbar.bulletList`),children:(0,h.jsx)(d.t,{name:`VscListUnordered`})}),(0,h.jsx)(`button`,{className:`${w.toolbarBtn} ${J?.isOrderedList?w.active:``}`,onClick:()=>R?.chain().focus().toggleOrderedList().run(),title:n(`toolbar.orderedList`),"aria-label":n(`toolbar.orderedList`),children:(0,h.jsx)(d.t,{name:`VscListOrdered`})}),(0,h.jsx)(`span`,{className:w.separator}),(0,h.jsx)(`button`,{className:`${w.toolbarBtn} ${J?.isBlockquote?w.active:``}`,onClick:()=>R?.chain().focus().toggleBlockquote().run(),title:n(`toolbar.blockquote`),"aria-label":n(`toolbar.blockquote`),children:(0,h.jsx)(d.t,{name:`VscQuote`})}),(0,h.jsx)(`button`,{className:`${w.toolbarBtn} ${J?.isCodeBlock?w.active:``}`,onClick:()=>R?.chain().focus().toggleCodeBlock().run(),title:n(`toolbar.codeBlock`),"aria-label":n(`toolbar.codeBlock`),children:(0,h.jsx)(d.t,{name:`VscTerminal`})}),(0,h.jsx)(`button`,{className:w.toolbarBtn,onClick:()=>R?.chain().focus().setHorizontalRule().run(),title:n(`toolbar.horizontalRule`),"aria-label":n(`toolbar.horizontalRule`),children:(0,h.jsx)(d.t,{name:`VscHorizontalRule`})}),(0,h.jsx)(`span`,{className:w.separator}),(0,h.jsx)(`button`,{className:w.toolbarBtn,onClick:()=>R?.chain().focus().undo().run(),disabled:!J?.canUndo,title:n(`common:actions.undo`),"aria-label":n(`common:actions.undo`),children:(0,h.jsx)(d.t,{name:`VscDiscard`})}),(0,h.jsx)(`button`,{className:w.toolbarBtn,onClick:()=>R?.chain().focus().redo().run(),disabled:!J?.canRedo,title:n(`common:actions.redo`),"aria-label":n(`common:actions.redo`),children:(0,h.jsx)(d.t,{name:`VscRedo`})})]}),(0,h.jsx)(y.EditorContent,{editor:R,className:w.editorContent}),(0,h.jsx)(f.n,{opened:W,acceptedMimeTypes:E,onConfirm:K,onCancel:()=>G(!1)}),(0,h.jsx)(f.r,{opened:g,initialName:s,onConfirm:U,onCancel:()=>_(!1)})]})};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return k}});
@@ -1,9 +1,9 @@
1
1
  import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { a as t, b as n, o as r } from "./desktopStore-F8bgLqFl.js";
3
- import { i } from "./useCloseInterceptor-BZd3VILp.js";
4
- import { t as a } from "./VscIcon-DBfVnArE.js";
5
- import { n as o, r as s } from "./FilePickerApp-DaMgEqKh.js";
6
- import { n as c } from "./notesStore-BPyRTHEc.js";
2
+ import { a as t, b as n, o as r } from "./desktopStore-8cSZlj7s.js";
3
+ import { i } from "./useCloseInterceptor-CIxhOZx1.js";
4
+ import { t as a } from "./VscIcon-AEENjKOE.js";
5
+ import { n as o, r as s } from "./FilePickerApp-ClHuhm6Z.js";
6
+ import { n as c } from "./notesStore-Dgah46U5.js";
7
7
  import { useCallback as l, useEffect as u, useRef as d, useState as f } from "react";
8
8
  import { jsx as p, jsxs as m } from "react/jsx-runtime";
9
9
  import { create as h } from "zustand";
@@ -0,0 +1 @@
1
+ const e=require(`./NotesApp-BmQIBtJ2.cjs`),t=require(`./AppMenuBar-CAlkNHjj.cjs`),n=require(`./notesStore-CrWTO6oB.cjs`),r=require(`./useMenuBarUtils-DAap0ukp.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`),o=require(`react-i18next`);var s=e=>{let{windowId:t,contentData:a,onExit:s}=e,{t:c}=(0,o.useTranslation)(`common`),l=n.t(t),u=a?.actions,d=a?.setPickerOpen;return(0,i.useMemo)(()=>r.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])},c=e.i({NotesMenuBar:()=>l}),l=({windowId:e,contentData:n,onExit:r})=>(0,a.jsx)(t.t,{elements:s({windowId:e,contentData:n,onExit:r})});Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { t } from "./AppMenuBar-CnIEVjr8.js";
3
- import { t as n } from "./notesStore-BPyRTHEc.js";
4
- import { t as r } from "./useMenuBarUtils-nmu9yehT.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
5
  import { useMemo as i } from "react";
6
6
  import { jsx as a } from "react/jsx-runtime";
7
7
  import { useTranslation as o } from "react-i18next";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { t } from "./useResolvedUrl-DQpLqOoL.js";
3
- import { n } from "./FilePickerApp-DaMgEqKh.js";
4
- import { t as r } from "./AppEmptyState-Bxpit0JV.js";
2
+ import { t } from "./useResolvedUrl-B6x4xy0x.js";
3
+ import { n } from "./FilePickerApp-ClHuhm6Z.js";
4
+ import { t as r } from "./AppEmptyState-Boej96TB.js";
5
5
  import { useCallback as i, useEffect as a, useState as o } from "react";
6
6
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
7
  import { useTranslation as l } from "react-i18next";
@@ -0,0 +1 @@
1
+ const e=require(`./NotesApp-BmQIBtJ2.cjs`),t=require(`./useResolvedUrl-Bb39DpVy.cjs`),n=require(`./FilePickerApp-By6-vbag.cjs`),r=require(`./AppEmptyState-CLc00OOG.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`),o=require(`react-i18next`);var s={container:`_container_1hj4w_1`,frame:`_frame_1hj4w_7`},c=e.i({default:()=>l}),l=({window:e,notifyReady:c})=>{let{t:l}=(0,o.useTranslation)(`apps`),u=e,d=u?.contentData?.src,[f,p]=(0,i.useState)(d??void 0),[m,h]=(0,i.useState)(!1),g=t.t(f);(0,i.useEffect)(()=>{c?.({...u?.contentData??{},setPickerOpen:()=>h(!0)})},[u,c]);let _=(0,i.useCallback)(e=>{p(e.url??e.name),h(!1)},[]);return(0,a.jsxs)(`div`,{className:s.container,"data-windowid":u?.id,children:[g||f?(0,a.jsx)(`iframe`,{src:g??f,className:s.frame,title:l(`pdf.viewer`),"aria-label":l(`pdf.viewer`)}):(0,a.jsx)(r.t,{label:l(`pdf.noFile`,{defaultValue:`No PDF loaded`})}),(0,a.jsx)(n.n,{opened:m,acceptedMimeTypes:[`application/pdf`],onConfirm:_,onCancel:()=>h(!1)})]})};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { t } from "./AppMenuBar-CnIEVjr8.js";
2
+ import { t } from "./AppMenuBar-DmSfQRXU.js";
3
3
  import { memo as n, useMemo as r } from "react";
4
4
  import { jsx as i } from "react/jsx-runtime";
5
5
  import { useTranslation as a } from "react-i18next";
@@ -0,0 +1 @@
1
+ const e=require(`./NotesApp-BmQIBtJ2.cjs`),t=require(`./AppMenuBar-CAlkNHjj.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`),i=require(`react-i18next`);var a=e=>{let{contentData:t,onExit:r}=e,{t:a}=(0,i.useTranslation)(`common`),o=t?.setPickerOpen;return(0,n.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:r}]}],[a,o,r])},o=e.i({PdfMenuBar:()=>s}),s=(0,n.memo)(({windowId:e,contentData:n,onExit:i})=>(0,r.jsx)(t.t,{elements:a({windowId:e,contentData:n,onExit:i})}));s.displayName=`PdfMenuBar`,Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});