@fde-desktop/fde-core 0.4.10 → 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 (221) hide show
  1. package/dist/AppEmptyState-Boej96TB.js +49 -0
  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-CWiP6zx-.js → ImageViewerApp-iojtyFEf.js} +18 -17
  23. package/dist/{ImageViewerMenuBar-BULkh_Ku.js → ImageViewerMenuBar-BIsUokxV.js} +15 -14
  24. package/dist/ImageViewerMenuBar-BgzgSF3v.cjs +1 -0
  25. package/dist/MenuEditApp-BHptoJbz.cjs +1 -0
  26. package/dist/MenuEditApp-CJUbJaqh.js +492 -0
  27. package/dist/MenuEditMenuBar-CCOSPAUe.cjs +1 -0
  28. package/dist/{MenuEditMenuBar-B94z4Umw.js → MenuEditMenuBar-DnCL-kaZ.js} +13 -12
  29. package/dist/NotesApp-BmQIBtJ2.cjs +1 -0
  30. package/dist/NotesApp-DJ2dGt4-.js +364 -0
  31. package/dist/NotesMenuBar-BzojwMtH.cjs +1 -0
  32. package/dist/{NotesMenuBar-BB4NkKGf.js → NotesMenuBar-DILZTjnT.js} +10 -9
  33. package/dist/PdfApp-IjY_GtnW.js +39 -0
  34. package/dist/PdfApp-krW8UI97.cjs +1 -0
  35. package/dist/PdfMenuBar-Bd5MTZcZ.js +39 -0
  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-ktC0viTd.js +42 -0
  41. package/dist/UploaderApp-CbypD538.js +263 -0
  42. package/dist/UploaderApp-D_qD3O70.cjs +1 -0
  43. package/dist/{VscIcon-DueRJVTe.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-B0R1-BeA.js → desktopStore-8cSZlj7s.js} +342 -549
  48. package/dist/desktopStore-C1jR6Fdb.cjs +1 -0
  49. package/dist/{imageViewerStore-CJMRXaQh.js → imageViewerStore-COrD02Zu.js} +1 -1
  50. package/dist/imageViewerStore-Dfylg59V.cjs +1 -0
  51. package/dist/index.cjs +1 -53
  52. package/dist/index.css +1 -1
  53. package/dist/index.d.ts +16 -6
  54. package/dist/index.js +3024 -7513
  55. package/dist/menuEditStore-CYwtfD6H.cjs +1 -0
  56. package/dist/{menuEditStore-C8S_EedM.js → menuEditStore-CxsgLiQu.js} +1 -1
  57. package/dist/notesStore-CrWTO6oB.cjs +1 -0
  58. package/dist/{notesStore-DKRgTTFn.js → notesStore-Dgah46U5.js} +1 -1
  59. package/dist/rolldown-runtime-CAFD8bLK.js +11 -0
  60. package/dist/{settingsAppStore-KOeWRO6h.js → settingsAppStore-DHZhi6Rl.js} +1 -1
  61. package/dist/settingsAppStore-DuYZNeFf.cjs +1 -0
  62. package/dist/useAdaptiveDimensions-3Lz4X0Tc.cjs +1 -0
  63. package/dist/{useAdaptiveDimensions-CunsU0mn.js → useAdaptiveDimensions-DxNLJ7R5.js} +1 -1
  64. package/dist/{useCloseInterceptor-CuKAAFnj.js → useCloseInterceptor-CIxhOZx1.js} +12 -12
  65. package/dist/useCloseInterceptor-CdX-09Ib.cjs +1 -0
  66. package/dist/useDynamicIcon-CK6SjEv5.cjs +1 -0
  67. package/dist/{useDynamicIcon-GJg3vWsJ.js → useDynamicIcon-_wGeWu-b.js} +1 -1
  68. package/dist/useOpenApp-D-FOY88T.cjs +1 -0
  69. package/dist/{useOpenApp-BVpSfNrG.js → useOpenApp-DkZLFFCH.js} +51 -67
  70. package/dist/{useResolvedUrl-DFKXq598.js → useResolvedUrl-B6x4xy0x.js} +1 -2
  71. package/dist/useResolvedUrl-Bb39DpVy.cjs +1 -0
  72. package/package.json +3 -4
  73. package/dist/AccordionChevron-CJXAq5o5.js +0 -26
  74. package/dist/AccordionChevron-DBXp38Lm.cjs +0 -1
  75. package/dist/ActionIcon-C_SfdBfx.cjs +0 -1
  76. package/dist/ActionIcon-CtVbYlGY.js +0 -145
  77. package/dist/AppEmptyState-BTujnL_b.js +0 -4962
  78. package/dist/AppEmptyState-Dc4GaDfu.cjs +0 -1
  79. package/dist/AppIcon--qzR4sgf.cjs +0 -1
  80. package/dist/AppIcon-DCDuaU-t.js +0 -80
  81. package/dist/AppMenuBar-BiHbNg9V.cjs +0 -9
  82. package/dist/AppMenuBar-CHJy8OF0.js +0 -2639
  83. package/dist/Box-DRm8EabO.js +0 -1593
  84. package/dist/Box-D_64wv6n.cjs +0 -1
  85. package/dist/Button-D0FXpkur.cjs +0 -1
  86. package/dist/Button-k7SxX1Xl.js +0 -178
  87. package/dist/CalendarApp-C1HvuJoa.cjs +0 -1
  88. package/dist/CalendarApp-DBEQqsS_.js +0 -1721
  89. package/dist/Center-CyryG5zn.js +0 -25
  90. package/dist/Center-T4No_FAa.cjs +0 -1
  91. package/dist/CheckIcon-C3WjIR2i.js +0 -25
  92. package/dist/CheckIcon-CBMLR6Gc.cjs +0 -1
  93. package/dist/CodeServerApp-B3l5QPuG.cjs +0 -1
  94. package/dist/CodeServerApp-BpeALSaX.js +0 -2
  95. package/dist/CodeServerApp-CRjCngFv.cjs +0 -1
  96. package/dist/CodeServerApp-DY94cy1a.js +0 -149
  97. package/dist/ColorPicker-BL4UbKCV.cjs +0 -1
  98. package/dist/ColorPicker-DvRR-wlQ.js +0 -997
  99. package/dist/CreateItemApp-BU9wmjKM.cjs +0 -1
  100. package/dist/CreateItemApp-CtdH1K1g.js +0 -400
  101. package/dist/CreateItemApp-t9F-a6wD.cjs +0 -1
  102. package/dist/DeviceInfoApp-C306YvtZ.js +0 -223
  103. package/dist/DeviceInfoApp-Cdju_LIB.cjs +0 -1
  104. package/dist/DeviceInfoApp-CyB01v4D.cjs +0 -1
  105. package/dist/DownloadProgress-IRw1dzLX.cjs +0 -1
  106. package/dist/DownloadProgress-hdupSUBT.js +0 -174
  107. package/dist/FileIcon-BCpGMI5U.js +0 -88
  108. package/dist/FileIcon-BCrsxmtt.cjs +0 -1
  109. package/dist/FilePickerApp-DMGuvahM.js +0 -409
  110. package/dist/FilePickerApp-Eu0cr2Cm.cjs +0 -1
  111. package/dist/FilesApp-BQFVHkEn.js +0 -225
  112. package/dist/FilesApp-BZ_dzZnF.cjs +0 -1
  113. package/dist/FilesApp-SIWXFPXt.cjs +0 -1
  114. package/dist/Group-BzwlMeob.js +0 -48
  115. package/dist/Group-DhwePB84.cjs +0 -1
  116. package/dist/ImageViewerApp-BOz59TGc.cjs +0 -1
  117. package/dist/ImageViewerApp-BeqY6voE.cjs +0 -1
  118. package/dist/ImageViewerApp-DBAfJPSo.js +0 -2
  119. package/dist/ImageViewerMenuBar-Cb0Nr5-M.js +0 -2
  120. package/dist/ImageViewerMenuBar-CoEp0RxK.cjs +0 -1
  121. package/dist/ImageViewerMenuBar-zOkJtqKo.cjs +0 -1
  122. package/dist/MenuEditApp-BoKtj2GH.js +0 -2
  123. package/dist/MenuEditApp-D21sEp86.js +0 -2615
  124. package/dist/MenuEditApp-k3cPfTG9.cjs +0 -1
  125. package/dist/MenuEditApp-sz9GlLVH.cjs +0 -5
  126. package/dist/MenuEditMenuBar-6QxlIDpl.cjs +0 -1
  127. package/dist/MenuEditMenuBar-Bv6R42lf.js +0 -2
  128. package/dist/MenuEditMenuBar-CBsmH_-T.cjs +0 -1
  129. package/dist/NotesApp-BtR55Hva.cjs +0 -207
  130. package/dist/NotesApp-C59exz_9.js +0 -16154
  131. package/dist/NotesApp-D47I5LS_.js +0 -2
  132. package/dist/NotesApp-lOwsi2sg.cjs +0 -1
  133. package/dist/NotesMenuBar-BZITC74y.cjs +0 -1
  134. package/dist/NotesMenuBar-Bp0sPqyR.cjs +0 -1
  135. package/dist/NotesMenuBar-xlfODmMA.js +0 -2
  136. package/dist/Paper-DtUYKmYn.js +0 -30
  137. package/dist/Paper-DwCpwWwH.cjs +0 -1
  138. package/dist/PdfApp-1XbFGfoY.cjs +0 -1
  139. package/dist/PdfApp-BhIoJWeK.cjs +0 -1
  140. package/dist/PdfApp-C5Rt1Zaw.js +0 -2
  141. package/dist/PdfApp-C8Hwxxqh.js +0 -38
  142. package/dist/PdfMenuBar-BA9rKuMP.cjs +0 -1
  143. package/dist/PdfMenuBar-JXHqwxhZ.cjs +0 -1
  144. package/dist/PdfMenuBar-R0fu7oYF.js +0 -2
  145. package/dist/PdfMenuBar-sd-9Vk3h.js +0 -38
  146. package/dist/SettingsApp-7EhpjzUE.cjs +0 -1
  147. package/dist/SettingsApp-ByiPAj1I.cjs +0 -1
  148. package/dist/SettingsApp-d6fmBHxR.js +0 -1829
  149. package/dist/SettingsApp-qKJmC0lj.js +0 -2
  150. package/dist/SettingsMenuBar-BPwv8JQK.js +0 -41
  151. package/dist/SettingsMenuBar-D8R7hOik.js +0 -2
  152. package/dist/SettingsMenuBar-DDrjZLmg.cjs +0 -1
  153. package/dist/SettingsMenuBar-DQjUa8g1.cjs +0 -1
  154. package/dist/Slider-BNO-vDFn.js +0 -1175
  155. package/dist/Slider-Bg_EIBg6.cjs +0 -1
  156. package/dist/Stack-BOaJgV3N.cjs +0 -1
  157. package/dist/Stack-CuDEaP7e.js +0 -34
  158. package/dist/StorybookApp-Bkr-7mXp.cjs +0 -1
  159. package/dist/StorybookApp-WYninkJo.js +0 -10
  160. package/dist/TerminalApp-8XbsKAWa.js +0 -10041
  161. package/dist/TerminalApp-Bq2e7QQu.cjs +0 -1
  162. package/dist/TerminalApp-CVu3Axc9.js +0 -2
  163. package/dist/TerminalApp-b7_d0jRO.cjs +0 -36
  164. package/dist/TerminalMenuBar-Cb8x9laS.js +0 -2
  165. package/dist/TerminalMenuBar-De-FH5AE.cjs +0 -1
  166. package/dist/TerminalMenuBar-iKLydNda.js +0 -112
  167. package/dist/TerminalMenuBar-yOaWd-hn.cjs +0 -1
  168. package/dist/TextInput-C3qfxxWI.js +0 -980
  169. package/dist/TextInput-DcYns3hz.cjs +0 -1
  170. package/dist/Tooltip-CAOO-qdx.js +0 -3185
  171. package/dist/Tooltip-DDh_x-CB.cjs +0 -1
  172. package/dist/UnstyledButton-CI3kyRck.js +0 -25
  173. package/dist/UnstyledButton-Cl5RuIid.cjs +0 -1
  174. package/dist/UploaderApp-C76ydsd8.js +0 -487
  175. package/dist/UploaderApp-CHACW8Yr.js +0 -2
  176. package/dist/UploaderApp-Q_a3mBik.cjs +0 -1
  177. package/dist/UploaderApp-htj59ppo.cjs +0 -1
  178. package/dist/VscIcon-CxEmqD80.cjs +0 -1
  179. package/dist/chunk-BQCxAhux.js +0 -23
  180. package/dist/chunk-CiTBaPhY.cjs +0 -1
  181. package/dist/create-safe-context-95P-Bfg3.cjs +0 -1
  182. package/dist/create-safe-context-XT2cxc14.js +0 -12
  183. package/dist/desktopStore-Cox-Og1z.cjs +0 -1
  184. package/dist/fc-DejOsQyD.cjs +0 -1
  185. package/dist/fc-kd8WzIER.js +0 -20536
  186. package/dist/fc-xJ_v2ayq.cjs +0 -184
  187. package/dist/fi-BahYsbim.js +0 -9993
  188. package/dist/fi-BkhyTcZo.cjs +0 -1
  189. package/dist/getRuntime-BLXyQZBB.cjs +0 -1
  190. package/dist/getRuntime-CCRXVzJH.js +0 -63
  191. package/dist/iconBase-B4UCuSvv.cjs +0 -1
  192. package/dist/iconBase-D7iPes7B.js +0 -108
  193. package/dist/imageViewerStore-CH1qW6md.cjs +0 -1
  194. package/dist/is-element-BocgicRg.cjs +0 -1
  195. package/dist/is-element-Bu_JY8Qy.js +0 -7
  196. package/dist/menuEditStore-CU7IAg3L.cjs +0 -1
  197. package/dist/notesStore-zKmChTfF.cjs +0 -1
  198. package/dist/react-DYmzHD0X.js +0 -27
  199. package/dist/react-Dldg32sN.cjs +0 -1
  200. package/dist/settingsAppStore-BrlImdAH.cjs +0 -1
  201. package/dist/terminalStore-LWWjCvCe.js +0 -30
  202. package/dist/terminalStore-fZe5t7Ty.cjs +0 -1
  203. package/dist/use-merged-ref-BI9n1hUK.cjs +0 -1
  204. package/dist/use-merged-ref-BT8_u6vW.js +0 -25
  205. package/dist/use-resolved-styles-api-AVDygMKo.cjs +0 -1
  206. package/dist/use-resolved-styles-api-pEOi2wiK.js +0 -21
  207. package/dist/use-uncontrolled-A4hm9ATM.js +0 -23
  208. package/dist/use-uncontrolled-BPrfGv0W.cjs +0 -1
  209. package/dist/useAdaptiveDimensions-Btp0m5Pm.cjs +0 -1
  210. package/dist/useCloseInterceptor-a_6Lcuqj.cjs +0 -1
  211. package/dist/useDynamicIcon-SytdL1Tu.cjs +0 -1
  212. package/dist/useOpenApp-Br0jo4-y.cjs +0 -1
  213. package/dist/useResolvedUrl-Be5ZlCX7.cjs +0 -1
  214. package/dist/useTranslation-DMRGdqZi.js +0 -279
  215. package/dist/useTranslation-D_O7S4RJ.cjs +0 -1
  216. package/dist/vsc-Ciibqbxo.cjs +0 -1
  217. package/dist/vsc-DGKSpOAR.js +0 -9574
  218. /package/dist/{Colors-BxX4G8kX.cjs → Colors-CNJbU7oq.cjs} +0 -0
  219. /package/dist/{Colors-hca6raEG.js → Colors-CuABn2W4.js} +0 -0
  220. /package/dist/{useMenuBarUtils-ChmpZjwu.js → useMenuBarUtils-ChAfI7OA.js} +0 -0
  221. /package/dist/{useMenuBarUtils-Bp5PiztD.cjs → useMenuBarUtils-DAap0ukp.cjs} +0 -0
@@ -0,0 +1,492 @@
1
+ import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
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";
10
+ import { useTranslation as w } from "react-i18next";
11
+ import { DndContext as T, DragOverlay as E, defaultDropAnimation as D, pointerWithin as O, useDraggable as k, useDroppable as A } from "@dnd-kit/core";
12
+ //#region src/hooks/useFolderName.ts
13
+ var j = {
14
+ "launcher-folder-social-links": "socialLinks",
15
+ "launcher-folder-office": "office",
16
+ "launcher-folder-programming": "programming",
17
+ "launcher-folder-games": "games",
18
+ "launcher-folder-custom-apps": "customApps"
19
+ };
20
+ function M(e) {
21
+ let { t } = w("apps");
22
+ if (!e.isPredefined) return e.name;
23
+ let n = j[e.id];
24
+ return n ? t(`folders.${n}`, e.name) : e.name;
25
+ }
26
+ //#endregion
27
+ //#region src/hooks/useDragDrop/DragDropStateContext.tsx
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) => {
30
+ let t = e.active.data.current;
31
+ t && i(t);
32
+ }, []), c = l((e) => {
33
+ if (e.over) {
34
+ let t = e.over.data.current;
35
+ t && o(t);
36
+ } else o(null);
37
+ }, []), u = l((e) => {
38
+ let { active: r, over: a } = e;
39
+ if (a && r.data.current) {
40
+ let e = r.data.current, n = a.data.current;
41
+ n.accepts.includes(e.type) && t(e, n);
42
+ } else !a && n && n();
43
+ i(null), o(null);
44
+ }, [t, n]), d = f(() => ({
45
+ activeItem: r,
46
+ overTarget: a
47
+ }), [r, a]);
48
+ return /* @__PURE__ */ h(N.Provider, {
49
+ value: d,
50
+ children: /* @__PURE__ */ h(T, {
51
+ onDragStart: s,
52
+ onDragOver: c,
53
+ onDragEnd: u,
54
+ collisionDetection: O,
55
+ children: e
56
+ })
57
+ });
58
+ };
59
+ //#endregion
60
+ //#region src/hooks/useDragDrop/useDraggableItem.ts
61
+ function F(e) {
62
+ let { item: t, disabled: n = !1 } = e, { attributes: r, listeners: i, setNodeRef: a, transform: o, isDragging: s } = k({
63
+ id: `${t.sourceId}-${t.id}`,
64
+ data: t,
65
+ disabled: n
66
+ }), c = {
67
+ opacity: s ? 0 : 1,
68
+ cursor: n ? "default" : "grab"
69
+ };
70
+ return {
71
+ attributes: r,
72
+ listeners: i,
73
+ setNodeRef: a,
74
+ isDragging: s,
75
+ transform: o ? {
76
+ x: o.x,
77
+ y: o.y
78
+ } : null,
79
+ style: c
80
+ };
81
+ }
82
+ //#endregion
83
+ //#region src/hooks/useDragDrop/useDroppableArea.ts
84
+ function I(e) {
85
+ let { target: t, disabled: n = !1 } = e, r = u(N), { setNodeRef: i, isOver: a } = A({
86
+ id: t.id,
87
+ data: t,
88
+ disabled: n
89
+ });
90
+ return {
91
+ setNodeRef: i,
92
+ isOver: a,
93
+ active: r?.activeItem ?? null
94
+ };
95
+ }
96
+ //#endregion
97
+ //#region src/hooks/useDragDrop/useDragDropState.ts
98
+ function L() {
99
+ let e = u(N);
100
+ if (!e) throw Error("useDragDropState must be used within a DragDropProvider");
101
+ return e;
102
+ }
103
+ //#endregion
104
+ //#region src/hooks/useDragDrop/modifiers/snapCenterToCursor.ts
105
+ var R = ({ activatorEvent: e, transform: t, draggingNodeRect: n }) => {
106
+ if (!e || !n) return t;
107
+ let r = e, i = 0, a = 0;
108
+ "touches" in r && r.touches.length > 0 ? (i = r.touches[0].clientX, a = r.touches[0].clientY) : "clientX" in r && (i = r.clientX, a = r.clientY);
109
+ let o = i - n.left - n.width / 2, s = a - n.top - n.height / 2;
110
+ return {
111
+ ...t,
112
+ x: t.x + o,
113
+ y: t.y + s
114
+ };
115
+ }, z = { dragOverlay: "_dragOverlay_myknw_1" }, B = () => {
116
+ let { activeItem: e } = L();
117
+ return e ? /* @__PURE__ */ h(E, {
118
+ dropAnimation: D,
119
+ modifiers: [R],
120
+ children: /* @__PURE__ */ g(v, {
121
+ className: z.dragOverlay,
122
+ children: [/* @__PURE__ */ h(i, {
123
+ fcIcon: e.metadata?.fcIcon,
124
+ iconUrl: e.metadata?.iconUrl,
125
+ fallback: e.metadata?.icon,
126
+ size: 20
127
+ }), /* @__PURE__ */ h(x, {
128
+ size: "xs",
129
+ children: e.name
130
+ })]
131
+ })
132
+ }) : null;
133
+ }, V = {
134
+ "launcher-folder": ["app"],
135
+ "filesystem-folder": ["file", "folder"],
136
+ desktop: [
137
+ "file",
138
+ "folder",
139
+ "app"
140
+ ],
141
+ "available-apps": ["app"]
142
+ }, H = {
143
+ container: "_container_y9c6e_1",
144
+ content: "_content_y9c6e_7",
145
+ folderList: "_folderList_y9c6e_13",
146
+ folderCard: "_folderCard_y9c6e_19",
147
+ folderHeader: "_folderHeader_y9c6e_28",
148
+ appList: "_appList_y9c6e_40",
149
+ availableApps: "_availableApps_y9c6e_49",
150
+ appGrid: "_appGrid_y9c6e_58",
151
+ appItem: "_appItem_y9c6e_64"
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: {
154
+ type: "launcher-folder",
155
+ id: e.id,
156
+ name: f,
157
+ accepts: V["launcher-folder"]
158
+ } });
159
+ return /* @__PURE__ */ g(y, {
160
+ ref: m,
161
+ className: H.folderCard,
162
+ shadow: "xs",
163
+ padding: "xs",
164
+ "data-is-over": C && p?.type === "app" ? "true" : void 0,
165
+ children: [/* @__PURE__ */ g(b, {
166
+ justify: "space-between",
167
+ mb: 4,
168
+ children: [t ? /* @__PURE__ */ h(S, {
169
+ value: r,
170
+ onChange: (e) => l(e.target.value),
171
+ onBlur: () => c(e.id),
172
+ onKeyDown: (t) => {
173
+ t.key === "Enter" && (t.preventDefault(), c(e.id));
174
+ },
175
+ autoFocus: !0,
176
+ size: "xs",
177
+ style: { flex: 1 }
178
+ }) : /* @__PURE__ */ g(b, {
179
+ gap: "xs",
180
+ children: [
181
+ /* @__PURE__ */ h(i, {
182
+ fcIcon: e.fcIcon,
183
+ size: 16
184
+ }),
185
+ /* @__PURE__ */ h(x, {
186
+ size: "sm",
187
+ fw: 500,
188
+ children: f
189
+ }),
190
+ e.isPredefined && /* @__PURE__ */ g(x, {
191
+ size: "xs",
192
+ c: "dimmed",
193
+ children: [
194
+ "(",
195
+ d("predefined"),
196
+ ")"
197
+ ]
198
+ })
199
+ ]
200
+ }), !e.isPredefined && !t && /* @__PURE__ */ g(b, {
201
+ gap: 4,
202
+ children: [/* @__PURE__ */ h(_, {
203
+ variant: "subtle",
204
+ size: "xs",
205
+ onClick: () => a(e.id),
206
+ "aria-label": d("rename"),
207
+ children: /* @__PURE__ */ h(o, {
208
+ name: "VscEdit",
209
+ size: 14
210
+ })
211
+ }), s && /* @__PURE__ */ h(_, {
212
+ variant: "subtle",
213
+ size: "xs",
214
+ color: "red",
215
+ onClick: () => s(e.id),
216
+ "aria-label": d("delete"),
217
+ children: /* @__PURE__ */ h(o, {
218
+ name: "VscTrash",
219
+ size: 14
220
+ })
221
+ })]
222
+ })]
223
+ }), /* @__PURE__ */ h(v, {
224
+ className: H.appList,
225
+ children: e.appIds.map((t) => {
226
+ let r = n.find((e) => e.id === t);
227
+ return r ? /* @__PURE__ */ h(G, {
228
+ app: r,
229
+ sourceId: e.id,
230
+ onContextMenu: (n) => {
231
+ n.preventDefault(), n.stopPropagation(), u(t, e.id);
232
+ }
233
+ }, t) : null;
234
+ })
235
+ })]
236
+ });
237
+ }, G = ({ app: e, sourceId: t, onContextMenu: n }) => {
238
+ let { attributes: r, listeners: a, setNodeRef: o, isDragging: s, style: c } = F({ item: {
239
+ type: "app",
240
+ id: e.id,
241
+ name: e.name,
242
+ sourceId: t,
243
+ sourceType: "launcher-folder",
244
+ metadata: {
245
+ fcIcon: e.fcIcon,
246
+ iconUrl: e.iconUrl,
247
+ icon: e.icon
248
+ }
249
+ } });
250
+ return /* @__PURE__ */ g(C, {
251
+ ref: o,
252
+ className: H.appItem,
253
+ style: {
254
+ ...c,
255
+ opacity: s ? .5 : 1
256
+ },
257
+ onContextMenu: n,
258
+ ...r,
259
+ ...a,
260
+ children: [/* @__PURE__ */ h(i, {
261
+ fcIcon: e.fcIcon,
262
+ iconUrl: e.iconUrl,
263
+ fallback: e.icon,
264
+ size: 16
265
+ }), /* @__PURE__ */ h(x, {
266
+ size: "xs",
267
+ children: e.name
268
+ })]
269
+ });
270
+ }, K = ({ customFolderId: e }) => {
271
+ let { t } = w("menuedit"), { activeItem: i } = L(), { setNodeRef: a, isOver: o } = I({ target: {
272
+ type: "available-apps",
273
+ id: "available-apps",
274
+ name: "Available Apps",
275
+ accepts: V["available-apps"]
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,
279
+ className: H.availableApps,
280
+ "data-is-over": o && i?.type === "app" ? "true" : void 0,
281
+ children: [
282
+ /* @__PURE__ */ h(x, {
283
+ size: "xs",
284
+ c: "dimmed",
285
+ mb: 8,
286
+ children: t("availableApps")
287
+ }),
288
+ e === null && /* @__PURE__ */ h(x, {
289
+ size: "xs",
290
+ c: "orange",
291
+ mb: 4,
292
+ children: t("canCreateNewFolder")
293
+ }),
294
+ /* @__PURE__ */ h(v, {
295
+ className: H.appGrid,
296
+ children: c.filter((e) => !s.has(e.id)).map((t) => /* @__PURE__ */ h(q, {
297
+ app: t,
298
+ targetFolderId: e,
299
+ onAdd: l
300
+ }, t.id))
301
+ })
302
+ ]
303
+ });
304
+ }, q = ({ app: e, targetFolderId: t, onAdd: n }) => {
305
+ let { attributes: r, listeners: a, setNodeRef: o, isDragging: s, style: c } = F({ item: {
306
+ type: "app",
307
+ id: e.id,
308
+ name: e.name,
309
+ sourceId: "available-apps",
310
+ sourceType: "available-apps",
311
+ metadata: {
312
+ fcIcon: e.fcIcon,
313
+ iconUrl: e.iconUrl,
314
+ icon: e.icon
315
+ }
316
+ } }), l = () => {
317
+ t && n(e.id, t);
318
+ };
319
+ return /* @__PURE__ */ g(C, {
320
+ ref: o,
321
+ className: H.appItem,
322
+ style: {
323
+ ...c,
324
+ opacity: s ? 0 : 1
325
+ },
326
+ onClick: l,
327
+ disabled: !t,
328
+ ...r,
329
+ ...a,
330
+ children: [/* @__PURE__ */ h(i, {
331
+ fcIcon: e.fcIcon,
332
+ iconUrl: e.iconUrl,
333
+ fallback: e.icon,
334
+ size: 16
335
+ }), /* @__PURE__ */ h(x, {
336
+ size: "xs",
337
+ children: e.name
338
+ })]
339
+ });
340
+ }, J = ({ window: e, notifyReady: n }) => {
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(() => {
345
+ if (!c) return;
346
+ let e = s.getState();
347
+ if (e.getSnapshot(c) === null) e.takeSnapshot(c, u);
348
+ else {
349
+ let t = e.getSnapshot(c);
350
+ if (t) {
351
+ let n = JSON.stringify(u) !== JSON.stringify(t);
352
+ e.setIsDirty(c, n);
353
+ }
354
+ }
355
+ }, [c, u]);
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(() => {
365
+ if (!c) return !1;
366
+ let e = s.getState().getSnapshot(c);
367
+ return JSON.stringify(u) !== JSON.stringify(e ?? []);
368
+ }, [c, u]),
369
+ windowId: e?.id,
370
+ onDiscard: M,
371
+ onSave: j
372
+ });
373
+ let N = l(() => {
374
+ let e = y({
375
+ name: i("newFolder"),
376
+ fcIcon: "VscFolder",
377
+ order: u.length
378
+ });
379
+ D(e.id), k(e.name);
380
+ }, [
381
+ y,
382
+ u.length,
383
+ i
384
+ ]);
385
+ d(() => {
386
+ n?.({
387
+ createFolder: N,
388
+ save: j,
389
+ discard: M
390
+ });
391
+ }, [
392
+ N,
393
+ j,
394
+ M,
395
+ n
396
+ ]);
397
+ let P = l((e) => {
398
+ let t = u.find((t) => t.id === e);
399
+ t && (D(t.id), k(t.name));
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, {
404
+ className: H.container,
405
+ "data-windowid": e?.id,
406
+ "data-menuedit-container": !0,
407
+ children: /* @__PURE__ */ g(v, {
408
+ className: H.content,
409
+ children: [
410
+ L.length > 0 && /* @__PURE__ */ g(v, {
411
+ mb: "md",
412
+ children: [/* @__PURE__ */ h(x, {
413
+ size: "xs",
414
+ c: "dimmed",
415
+ mb: 8,
416
+ children: i("predefinedFolders")
417
+ }), /* @__PURE__ */ h(v, {
418
+ className: H.folderList,
419
+ children: L.map((e) => /* @__PURE__ */ h(W, {
420
+ folder: e,
421
+ isEditing: !1,
422
+ editingName: "",
423
+ onEdit: () => {},
424
+ onRemoveApp: T,
425
+ onRename: () => {},
426
+ onSetEditingName: () => {}
427
+ }, e.id))
428
+ })]
429
+ }),
430
+ I && R.length > 0 && /* @__PURE__ */ g(v, {
431
+ mb: "md",
432
+ children: [/* @__PURE__ */ h(x, {
433
+ size: "xs",
434
+ c: "dimmed",
435
+ mb: 8,
436
+ children: i("customFolders")
437
+ }), /* @__PURE__ */ h(v, {
438
+ className: H.folderList,
439
+ children: R.map((e) => /* @__PURE__ */ h(W, {
440
+ folder: e,
441
+ isEditing: E === e.id,
442
+ editingName: O,
443
+ onEdit: P,
444
+ onDelete: C,
445
+ onRename: F,
446
+ onSetEditingName: k,
447
+ onRemoveApp: T
448
+ }, e.id))
449
+ })]
450
+ }),
451
+ /* @__PURE__ */ g(b, {
452
+ justify: "space-between",
453
+ mb: "md",
454
+ children: [
455
+ /* @__PURE__ */ h(K, { customFolderId: z }),
456
+ /* @__PURE__ */ h(x, {
457
+ size: "xs",
458
+ c: "dimmed",
459
+ mt: "md",
460
+ children: i("instructions")
461
+ }),
462
+ I && /* @__PURE__ */ h(_, {
463
+ variant: "light",
464
+ onClick: N,
465
+ "aria-label": i("addFolder"),
466
+ children: /* @__PURE__ */ h(o, {
467
+ name: "VscAdd",
468
+ size: 16
469
+ })
470
+ })
471
+ ]
472
+ })
473
+ ]
474
+ })
475
+ });
476
+ }, Y = (e) => {
477
+ let t = r((e) => e.addAppToFolder), n = r((e) => e.removeAppFromFolder);
478
+ return /* @__PURE__ */ g(P, {
479
+ onDrop: l((e, r) => {
480
+ if (e.type === "app") {
481
+ if (r.type === "available-apps") {
482
+ e.sourceType === "launcher-folder" && n(e.id, e.sourceId);
483
+ return;
484
+ }
485
+ r.type === "launcher-folder" && (e.sourceId !== r.id && e.sourceType === "launcher-folder" && n(e.id, e.sourceId), t(e.id, r.id));
486
+ }
487
+ }, [t, n]),
488
+ children: [/* @__PURE__ */ h(J, { ...e }), /* @__PURE__ */ h(B, {})]
489
+ });
490
+ };
491
+ //#endregion
492
+ export { F as a, I as i, U as n, P as o, L as r, M as s, Y as t };
@@ -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,12 +1,13 @@
1
- import { t as e } from "./AppMenuBar-CHJy8OF0.js";
2
- import { t } from "./useTranslation-DMRGdqZi.js";
3
- import { t as n } from "./menuEditStore-C8S_EedM.js";
4
- import { t as r } from "./useMenuBarUtils-ChmpZjwu.js";
1
+ import { t as e } from "./rolldown-runtime-CAFD8bLK.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
+ import { useTranslation as s } from "react-i18next";
7
8
  //#region src/components/Apps/MenuEditApp/useMenuEditMenuBar.ts
8
- var s = (e) => {
9
- let { windowId: i, contentData: o, onExit: s } = e, { t: c } = t("menuedit"), { t: l } = t("common"), u = n(i), d = o?.createFolder, f = o?.save, p = o?.discard;
9
+ var c = (e) => {
10
+ let { windowId: t, contentData: i, onExit: o } = e, { t: c } = s("menuedit"), { t: l } = s("common"), u = n(t), d = i?.createFolder, f = i?.save, p = i?.discard;
10
11
  return a(() => r([{
11
12
  type: "menu",
12
13
  label: l("menu.file"),
@@ -37,7 +38,7 @@ var s = (e) => {
37
38
  type: "item",
38
39
  label: l("actions.exit"),
39
40
  icon: "FcLeft",
40
- onClick: s
41
+ onClick: o
41
42
  }
42
43
  ]
43
44
  }], u), [
@@ -47,13 +48,13 @@ var s = (e) => {
47
48
  d,
48
49
  f,
49
50
  p,
50
- s
51
+ o
51
52
  ]);
52
- }, c = i(({ windowId: t, contentData: n, onExit: r }) => /* @__PURE__ */ o(e, { elements: s({
53
- windowId: t,
53
+ }, l = /* @__PURE__ */ e({ MenuEditMenuBar: () => u }), u = i(({ windowId: e, contentData: n, onExit: r }) => /* @__PURE__ */ o(t, { elements: c({
54
+ windowId: e,
54
55
  contentData: n,
55
56
  onExit: r
56
57
  }) }));
57
- c.displayName = "MenuEditMenuBar";
58
+ u.displayName = "MenuEditMenuBar";
58
59
  //#endregion
59
- export { c as t };
60
+ export { l as n, u as t };
@@ -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}});