@fde-desktop/fde-core 0.4.11 → 0.4.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/{AppEmptyState-Boej96TB.js → AppEmptyState-BVfKZU-h.js} +1 -1
  2. package/dist/AppEmptyState-Z8_Cviti.cjs +1 -0
  3. package/dist/AppIcon-Czrtau6A.cjs +1 -0
  4. package/dist/{AppIcon-mtEoyzOb.js → AppIcon-aFNw89J2.js} +1 -1
  5. package/dist/AppMenuBar-38QtFTPk.cjs +1 -0
  6. package/dist/AppTempMemory-DAC62jiS.cjs +1 -0
  7. package/dist/AppTempMemory-DgUW6GaF.js +23 -0
  8. package/dist/CalendarApp-BYTyu089.js +9 -0
  9. package/dist/CalendarApp-DPOK4mqg.cjs +1 -0
  10. package/dist/{ColorPicker-WCeD3Wjf.js → ColorPicker-B76rCS2H.js} +1 -1
  11. package/dist/ColorPicker-BZqsPh3X.cjs +1 -0
  12. package/dist/CreateItemApp-B0IHL16b.cjs +1 -0
  13. package/dist/CreateItemApp-UUP2HAu2.js +149 -0
  14. package/dist/DeviceInfoApp-BPQyeVSd.js +162 -0
  15. package/dist/DeviceInfoApp-D2mS2OT-.cjs +1 -0
  16. package/dist/DownloadProgress-CpJguS8g.cjs +1 -0
  17. package/dist/FilePickerApp-ClmPw6lk.cjs +1 -0
  18. package/dist/{FilePickerApp-ClHuhm6Z.js → FilePickerApp-D7fERKbp.js} +1 -1
  19. package/dist/FilesApp-DhJbO8wg.js +191 -0
  20. package/dist/FilesApp-LbwRRR1i.cjs +1 -0
  21. package/dist/IconColorPicker-7rWNAiNQ.cjs +1 -0
  22. package/dist/IconColorPicker-DUIXSb5E.js +58 -0
  23. package/dist/ImageViewerApp-9T-V8uP5.cjs +1 -0
  24. package/dist/ImageViewerApp-ihqIwJ-L.js +68 -0
  25. package/dist/ImageViewerMenuBar-DmvZoZ03.cjs +1 -0
  26. package/dist/{ImageViewerMenuBar-BIsUokxV.js → ImageViewerMenuBar-ZeIKHdA-.js} +18 -19
  27. package/dist/MenuEditApp-DRKfmSIZ.js +361 -0
  28. package/dist/MenuEditApp-U7EqB5Rl.cjs +1 -0
  29. package/dist/MenuEditMenuBar-BE_cXaoG.cjs +1 -0
  30. package/dist/MenuEditMenuBar-Df1je7F6.js +59 -0
  31. package/dist/NotesApp-DZfNQ8mN.cjs +1 -0
  32. package/dist/NotesApp-rwAeXyJy.js +344 -0
  33. package/dist/{NotesMenuBar-DILZTjnT.js → NotesMenuBar-C503t5pu.js} +12 -13
  34. package/dist/NotesMenuBar-CwgZ9dHy.cjs +1 -0
  35. package/dist/PdfApp-DNZaSXbF.cjs +1 -0
  36. package/dist/PdfApp-K1Z612o3.js +38 -0
  37. package/dist/PdfMenuBar-BPzP_JUO.cjs +1 -0
  38. package/dist/PdfMenuBar-DEUKgKTE.js +38 -0
  39. package/dist/SettingsApp-DdWqiYFE.cjs +1 -0
  40. package/dist/SettingsApp-ghc3RaMv.js +875 -0
  41. package/dist/SettingsMenuBar-C4KAPoBs.js +41 -0
  42. package/dist/SettingsMenuBar-CgmaF9_B.cjs +1 -0
  43. package/dist/{UploaderApp-CbypD538.js → UploaderApp-D9vfOR0S.js} +28 -40
  44. package/dist/UploaderApp-omSY-NSn.cjs +1 -0
  45. package/dist/VscIcon-CeELixwP.cjs +1 -0
  46. package/dist/buildBreadcrumbs-C2c2a4R3.cjs +1 -0
  47. package/dist/desktopStore-LSQweOqZ.cjs +1 -0
  48. package/dist/{desktopStore-8cSZlj7s.js → desktopStore-xnNbYaYm.js} +263 -263
  49. package/dist/formatBytes-Bv1bQPKQ.cjs +1 -0
  50. package/dist/formatBytes-CaP80WnM.js +14 -0
  51. package/dist/i18nConstants-DgbKSBIK.cjs +1 -0
  52. package/dist/i18nConstants-Nzpf2IFp.js +611 -0
  53. package/dist/imageViewerStore-CYt4R4e4.cjs +1 -0
  54. package/dist/index.cjs +1 -1
  55. package/dist/index.css +1 -1
  56. package/dist/index.d.ts +50 -29
  57. package/dist/index.js +715 -658
  58. package/dist/menuEditStore-sU6qaF2j.cjs +1 -0
  59. package/dist/notesStore-BnMXBRaV.cjs +1 -0
  60. package/dist/settingsAppStore-CQ4JHd7Q.cjs +1 -0
  61. package/dist/useAdaptiveDimensions-BDZxP4E3.cjs +1 -0
  62. package/dist/{useAdaptiveDimensions-DxNLJ7R5.js → useAdaptiveDimensions-sv9lwqF_.js} +1 -1
  63. package/dist/useCloseInterceptor-AzfjUZgz.cjs +1 -0
  64. package/dist/{useCloseInterceptor-CIxhOZx1.js → useCloseInterceptor-Bwm4I0O8.js} +1 -1
  65. package/dist/useDeviceDetection-B9jjlate.js +37 -0
  66. package/dist/useDeviceDetection-CnxnQWIq.cjs +1 -0
  67. package/dist/useDragDrop-Bdwzk6VO.cjs +1 -0
  68. package/dist/useDragDrop-D2LtOEYC.js +139 -0
  69. package/dist/useDynamicIcon-Cg3B_Aeq.cjs +1 -0
  70. package/dist/useNotifications-CR9JLjtC.js +26 -0
  71. package/dist/useNotifications-rwLmJ7fI.cjs +1 -0
  72. package/dist/useOpenApp-BBZ_B7Pr.cjs +1 -0
  73. package/dist/{useOpenApp-DkZLFFCH.js → useOpenApp-DdEbOVby.js} +3 -3
  74. package/dist/useResolvedUrl-CgqjNxzw.js +389 -0
  75. package/dist/useResolvedUrl-Dz2AhrDV.cjs +1 -0
  76. package/package.json +1 -1
  77. package/dist/AppEmptyState-CLc00OOG.cjs +0 -1
  78. package/dist/AppIcon-C8vHUVcb.cjs +0 -1
  79. package/dist/AppMenuBar-CAlkNHjj.cjs +0 -1
  80. package/dist/CalendarApp-DOmjWbpl.js +0 -10
  81. package/dist/CalendarApp-Z0bCCYsK.cjs +0 -1
  82. package/dist/ColorPicker-CQRRwY-y.cjs +0 -1
  83. package/dist/CreateItemApp-BkFFFdX1.cjs +0 -1
  84. package/dist/CreateItemApp-DR8Y4bwo.js +0 -202
  85. package/dist/DeviceInfoApp-BXQ9uOwF.cjs +0 -1
  86. package/dist/DeviceInfoApp-I63mJRWy.js +0 -195
  87. package/dist/DownloadProgress-CkTGTf0z.cjs +0 -1
  88. package/dist/FilePickerApp-By6-vbag.cjs +0 -1
  89. package/dist/FilesApp-BC4UPNuw.cjs +0 -1
  90. package/dist/FilesApp-D8MqvC5X.js +0 -210
  91. package/dist/ImageViewerApp-B1niWF75.cjs +0 -1
  92. package/dist/ImageViewerApp-iojtyFEf.js +0 -69
  93. package/dist/ImageViewerMenuBar-BgzgSF3v.cjs +0 -1
  94. package/dist/MenuEditApp-BHptoJbz.cjs +0 -1
  95. package/dist/MenuEditApp-CJUbJaqh.js +0 -492
  96. package/dist/MenuEditMenuBar-CCOSPAUe.cjs +0 -1
  97. package/dist/MenuEditMenuBar-DnCL-kaZ.js +0 -60
  98. package/dist/NotesApp-BmQIBtJ2.cjs +0 -1
  99. package/dist/NotesApp-DJ2dGt4-.js +0 -364
  100. package/dist/NotesMenuBar-BzojwMtH.cjs +0 -1
  101. package/dist/PdfApp-IjY_GtnW.js +0 -39
  102. package/dist/PdfApp-krW8UI97.cjs +0 -1
  103. package/dist/PdfMenuBar-Bd5MTZcZ.js +0 -39
  104. package/dist/PdfMenuBar-DWD0Qa3F.cjs +0 -1
  105. package/dist/SettingsApp-BE22l5UP.cjs +0 -1
  106. package/dist/SettingsApp-BTFtTFY_.js +0 -1228
  107. package/dist/SettingsMenuBar-CZE2evG2.cjs +0 -1
  108. package/dist/SettingsMenuBar-ktC0viTd.js +0 -42
  109. package/dist/UploaderApp-D_qD3O70.cjs +0 -1
  110. package/dist/VscIcon-BYb_Soyy.cjs +0 -1
  111. package/dist/buildBreadcrumbs-Ccd8i11b.cjs +0 -1
  112. package/dist/desktopStore-C1jR6Fdb.cjs +0 -1
  113. package/dist/imageViewerStore-Dfylg59V.cjs +0 -1
  114. package/dist/menuEditStore-CYwtfD6H.cjs +0 -1
  115. package/dist/notesStore-CrWTO6oB.cjs +0 -1
  116. package/dist/rolldown-runtime-CAFD8bLK.js +0 -11
  117. package/dist/settingsAppStore-DuYZNeFf.cjs +0 -1
  118. package/dist/useAdaptiveDimensions-3Lz4X0Tc.cjs +0 -1
  119. package/dist/useCloseInterceptor-CdX-09Ib.cjs +0 -1
  120. package/dist/useDynamicIcon-CK6SjEv5.cjs +0 -1
  121. package/dist/useOpenApp-D-FOY88T.cjs +0 -1
  122. package/dist/useResolvedUrl-B6x4xy0x.js +0 -29
  123. package/dist/useResolvedUrl-Bb39DpVy.cjs +0 -1
  124. /package/dist/{Colors-CuABn2W4.js → Colors-BIj4g0eH.js} +0 -0
  125. /package/dist/{Colors-CNJbU7oq.cjs → Colors-PNt4eyR6.cjs} +0 -0
  126. /package/dist/{DownloadProgress-DnVASsv5.js → DownloadProgress-DBFA58C5.js} +0 -0
  127. /package/dist/{imageViewerStore-COrD02Zu.js → imageViewerStore-C6UgceP-.js} +0 -0
  128. /package/dist/{menuEditStore-CxsgLiQu.js → menuEditStore-DPqViGva.js} +0 -0
  129. /package/dist/{notesStore-Dgah46U5.js → notesStore-KZDXN6zx.js} +0 -0
  130. /package/dist/{settingsAppStore-DHZhi6Rl.js → settingsAppStore-Y7x3r6pV.js} +0 -0
  131. /package/dist/{useMenuBarUtils-DAap0ukp.cjs → useMenuBarUtils-BOnQYtKU.cjs} +0 -0
  132. /package/dist/{useMenuBarUtils-ChAfI7OA.js → useMenuBarUtils-DTPFK0IN.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { t as e } from "./Colors-CuABn2W4.js";
1
+ import { t as e } from "./Colors-BIj4g0eH.js";
2
2
  import { useEffect as t, useState as n } from "react";
3
3
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
4
  import { motion as a } from "framer-motion";
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./Colors-PNt4eyR6.cjs`);let t=require(`react`),n=require(`react/jsx-runtime`),r=require(`framer-motion`);var i={root:`_root_19u7b_1`,container:`_container_19u7b_10`,item:`_item_19u7b_23`,label:`_label_19u7b_29`};function a(t=4){return[...e.t].sort(()=>Math.random()-.5).slice(0,t)}var o=a(),s={type:`spring`,damping:20,stiffness:300};function c(e){return[...e].sort(()=>Math.random()-.5)}var l=({label:e=`Work In Progress`})=>{let[a,l]=(0,t.useState)(o);return(0,t.useEffect)(()=>{let e=setTimeout(()=>l(e=>c(e)),1e3);return()=>clearTimeout(e)},[a]),(0,n.jsxs)(`div`,{className:i.root,"data-testid":`app-empty-state`,children:[(0,n.jsx)(`ul`,{className:i.container,children:a.map(e=>(0,n.jsx)(r.motion.li,{layout:!0,transition:s,className:i.item,style:{backgroundColor:e}},e))}),(0,n.jsx)(`p`,{className:i.label,children:e})]})};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./desktopStore-LSQweOqZ.cjs`),t=require(`./useDynamicIcon-Cg3B_Aeq.cjs`);let n=require(`react/jsx-runtime`);var r=({fcIcon:r,fallback:i,iconUrl:a,size:o=20,color:s})=>{let c=r?.startsWith(`Fi`),l=r?.startsWith(`Vsc`),u=t.i(!c&&!l?r??``:``,{size:o}),d=t.o(c?r??``:``,{size:o,color:s}),f=t.c(l?r??``:``,{size:o});return a?(0,n.jsx)(`img`,{src:e.g(a),alt:``,width:o,height:o,style:{objectFit:`contain`}}):c&&d?d:l&&f?f:u||(i?(0,n.jsx)(`span`,{"aria-hidden":`true`,children:i}):null)};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
@@ -1,4 +1,4 @@
1
- import { g as e } from "./desktopStore-8cSZlj7s.js";
1
+ import { g as e } from "./desktopStore-xnNbYaYm.js";
2
2
  import { c as t, i as n, o as r } from "./useDynamicIcon-_wGeWu-b.js";
3
3
  import { jsx as i } from "react/jsx-runtime";
4
4
  //#region src/components/Shared/AppIcon.tsx
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./useDynamicIcon-Cg3B_Aeq.cjs`);let t=require(`react`),n=require(`react/jsx-runtime`),r=require(`@mantine/core`);var i=({size:t=16})=>(0,n.jsx)(`span`,{style:{color:`orange`,fontWeight:`bold`,marginLeft:`8px`,display:`flex`,alignItems:`center`},title:`Unsaved changes`,children:e.i(`FcSynchronize`,{size:t})}),a={root:`_root_1aqog_1`,menuTrigger:`_menuTrigger_1aqog_19`,element:`_element_1aqog_37`,sliderLabel:`_sliderLabel_1aqog_44`,select:`_select_1aqog_50`,textInput:`_textInput_1aqog_51`,numberInput:`_numberInput_1aqog_52`,slider:`_slider_1aqog_44`},o={size:16,style:{display:`block`}},s=({name:t})=>e.i(t,o),c=({label:i,icon:c,items:l,rightSection:u})=>{let[d,f]=(0,t.useState)(!1);return(0,n.jsxs)(r.Menu,{opened:d,onClose:()=>f(!1),withinPortal:!0,keepMounted:!0,closeOnItemClick:!0,closeOnEscape:!0,closeOnClickOutside:!0,position:`bottom-start`,children:[(0,n.jsx)(r.Menu.Target,{children:(0,n.jsxs)(`button`,{className:a.menuTrigger,onClick:()=>f(e=>!e),children:[c&&(0,n.jsx)(()=>e.i(c??``,o),{}),(0,n.jsx)(`span`,{children:i}),u&&(0,n.jsx)(`span`,{style:{marginLeft:`auto`},children:u})]})}),(0,n.jsx)(r.Menu.Dropdown,{children:l.map((e,t)=>e.type===`divider`?(0,n.jsx)(r.Menu.Divider,{},t):e.type===`slider`?(0,n.jsx)(r.Menu.Item,{closeMenuOnClick:!1,children:(0,n.jsxs)(`div`,{style:{minWidth:120},children:[e.label&&(0,n.jsx)(`div`,{style:{marginBottom:4},children:e.label}),(0,n.jsx)(r.Slider,{min:e.min,max:e.max,value:e.value,onChange:e.onChange,size:`sm`})]})},t):(0,n.jsx)(r.Menu.Item,{disabled:e.disabled,onClick:e.onClick,leftSection:e.icon?(0,n.jsx)(s,{name:e.icon}):void 0,children:e.label},t))})]})},l=({elements:e})=>{let[o,s]=(0,t.useState)({}),l=(e,t)=>{s(n=>({...n,[e]:{...n[e]??{isHovered:!1,isDragging:!1},...t}}))};return(0,n.jsx)(`div`,{className:a.root,role:`menubar`,"aria-label":`Application menu`,children:e.map((e,t)=>{switch(e.type){case`menu`:return(0,n.jsx)(c,{label:e.label,icon:e.icon,items:e.items,rightSection:e.rightSection},t);case`combobox`:return(0,n.jsx)(`div`,{className:a.element,children:(0,n.jsx)(r.Select,{data:e.options,value:e.value,onChange:t=>t&&e.onChange(t),placeholder:e.label,size:`sm`,className:a.select,comboboxProps:{withinPortal:!0}})},t);case`switch`:return(0,n.jsx)(`div`,{className:a.element,children:(0,n.jsx)(r.Switch,{label:e.label,checked:e.checked,onChange:t=>e.onChange(t.currentTarget.checked),size:`sm`})},t);case`slider`:{let i=o[t]??{isHovered:!1,isDragging:!1},s=i.isHovered||i.isDragging;return(0,n.jsx)(r.Tooltip,{label:(e.labelFormat??(e=>String(e)))(e.value),position:`bottom`,withArrow:!0,opened:s,children:(0,n.jsxs)(`div`,{className:a.element,onMouseEnter:()=>l(t,{isHovered:!0}),onMouseLeave:()=>l(t,{isHovered:!1}),children:[e.label&&(0,n.jsx)(`span`,{className:a.sliderLabel,children:e.label}),(0,n.jsx)(r.Slider,{min:e.min,max:e.max,value:e.value,onChange:n=>{e.onChange(n),l(t,{isDragging:!0})},onChangeEnd:n=>{e.onChange(n),l(t,{isDragging:!1})},size:`sm`,className:a.slider,marks:e.marks})]})},t)}case`text-input`:return(0,n.jsx)(`div`,{className:a.element,children:(0,n.jsx)(r.TextInput,{placeholder:e.placeholder,value:e.value,onChange:t=>e.onChange(t.currentTarget.value),size:`sm`,className:a.textInput})},t);case`number-input`:return(0,n.jsx)(`div`,{className:a.element,children:(0,n.jsx)(r.NumberInput,{label:e.label,value:e.value,onChange:t=>e.onChange(typeof t==`number`?t:0),min:e.min,max:e.max,step:e.step??1,placeholder:e.placeholder,size:`sm`,className:a.numberInput})},t);case`select`:return(0,n.jsx)(`div`,{className:a.element,children:(0,n.jsx)(r.Select,{label:e.label,data:e.options,value:e.value,onChange:t=>t&&e.onChange(t),size:`sm`,className:a.select,comboboxProps:{withinPortal:!0}})},t);case`dirty-indicator`:return(0,n.jsx)(`span`,{style:{marginLeft:`auto`},children:(0,n.jsx)(i,{})},t)}})})};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
@@ -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,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},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`zustand`),l=require(`zustand/middleware`);var u=(0,c.create)()((0,l.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,l.createJSONStorage)(()=>localStorage)}));Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
@@ -0,0 +1,23 @@
1
+ import { create as e } from "zustand";
2
+ import { createJSONStorage as t, persist as n } from "zustand/middleware";
3
+ //#region src/stores/AppTempMemory.ts
4
+ var r = e()(n((e, t) => ({
5
+ snapshots: {},
6
+ setSnapshot: (t, n) => e((e) => ({ snapshots: {
7
+ ...e.snapshots,
8
+ [t]: n
9
+ } })),
10
+ getSnapshot: (e) => {
11
+ let { snapshots: n } = t();
12
+ return n[e] ?? null;
13
+ },
14
+ clearSnapshot: (t) => e((e) => {
15
+ let n = { ...e.snapshots };
16
+ return delete n[t], { snapshots: n };
17
+ })
18
+ }), {
19
+ name: "fde-desktop:appTempMemory",
20
+ storage: t(() => localStorage)
21
+ }));
22
+ //#endregion
23
+ export { r as t };
@@ -0,0 +1,9 @@
1
+ import "@mantine/dates/styles.css";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ import { Calendar as t } from "@mantine/dates";
4
+ var n = { root: "_root_43uio_1" }, r = () => /* @__PURE__ */ e("div", {
5
+ className: n.root,
6
+ children: /* @__PURE__ */ e(t, {})
7
+ });
8
+ //#endregion
9
+ export { r as default };
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`),require(`@mantine/dates/styles.css`);let e=require(`react/jsx-runtime`),t=require(`@mantine/dates`);var n={root:`_root_43uio_1`},r=()=>(0,e.jsx)(`div`,{className:n.root,children:(0,e.jsx)(t.Calendar,{})});exports.default=r;
@@ -1,4 +1,4 @@
1
- import { t as e } from "./Colors-CuABn2W4.js";
1
+ import { t as e } from "./Colors-BIj4g0eH.js";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
3
  import { ColorInput as r, UnstyledButton as i } from "@mantine/core";
4
4
  var a = {
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./Colors-PNt4eyR6.cjs`);let t=require(`react/jsx-runtime`),n=require(`@mantine/core`);var r={root:`_root_18r9b_1`,colorRow:`_colorRow_18r9b_7`,colorSwatch:`_colorSwatch_18r9b_13`,colorInput:`_colorInput_18r9b_38`},i=({value:i,onChange:a,error:o,disabled:s=!1})=>(0,t.jsxs)(`div`,{className:r.root,children:[(0,t.jsx)(`div`,{className:r.colorRow,children:e.t.map(e=>(0,t.jsx)(n.UnstyledButton,{className:r.colorSwatch,"data-selected":i===e||void 0,"data-disabled":s||void 0,style:{background:e},onClick:()=>!s&&a(e),"aria-label":`Color ${e}`,"aria-pressed":i===e,disabled:s},e))}),(0,t.jsx)(n.ColorInput,{value:i,onChange:a,placeholder:`Custom color`,size:`xs`,className:r.colorInput,"aria-label":`Custom color picker`,error:o,disabled:s})]});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./desktopStore-LSQweOqZ.cjs`),t=require(`./useDynamicIcon-Cg3B_Aeq.cjs`),n=require(`./IconColorPicker-7rWNAiNQ.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`@mantine/core`);var o={content:`_content_ej839_1`,header:`_header_ej839_8`,nameRow:`_nameRow_ej839_13`,iconPreview:`_iconPreview_ej839_19`,nameInput:`_nameInput_ej839_30`,collapseToggle:`_collapseToggle_ej839_34`,pickerWrapper:`_pickerWrapper_ej839_46`},s=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,c=e=>s.test(e),l={size:14,style:{display:`block`}},u=({open:e})=>t.i(e?`FcCollapse`:`FcExpand`,l),d=()=>t.i(`FcCancel`,l),f=()=>t.i(`FcCheckmark`,l),p=`VscFolder`,m=`#228be6`,h=`New File`,g=`New Folder`,_=36,v=({window:s})=>{let l=s,v=l?.contentData?.mode??`folder`,y=l?.contentData?.parentId??null,b=l?.contentData?.currentPath??`/home`,[x,S]=(0,r.useState)(v===`folder`?g:h),[C,w]=(0,r.useState)(p),[T,E]=(0,r.useState)(m),[D,O]=(0,r.useState)(l?.contentData?.iconPickerOpen??!1),k=(0,r.useRef)(null),A=e.o(e=>e.closeWindow),j=e.o(e=>e.resizeWindow),M=e.o(e=>e.createFile),N=e.o(e=>e.createFolder),P=e.o(e=>e.addNotification),F=e.o(e=>e.fsNodes),I=e.o(e=>e.windows.find(e=>e.id===l?.id)?.width??400),L=F.some(e=>e.parentId===y&&e.type===v&&e.name===x.trim()),R=v===`folder`&&D&&!c(T),z=x.trim().length>0&&!L&&!R;(0,r.useEffect)(()=>{if(!l?.id||!k.current)return;let e=k.current,t=new ResizeObserver(()=>{j(l.id,I,e.scrollHeight+_)});return t.observe(e),()=>t.disconnect()},[l,I,j]);let B=()=>{if(!z)return;let e=x.trim(),t=y??null,n=C,r=T;A(l.id),v===`folder`?N(e,t,n,r).catch(e=>{console.error(`Failed to create folder:`,e),P({id:`create-folder-error-${Date.now()}`,title:`Error`,message:`Failed to create folder: ${e instanceof Error?e.message:`Unknown error`}`,fcIcon:`FcHighPriority`})}):M(e,``,t).catch(e=>{console.error(`Failed to create file:`,e),P({id:`create-file-error-${Date.now()}`,title:`Error`,message:`Failed to create file: ${e instanceof Error?e.message:`Unknown error`}`,fcIcon:`FcHighPriority`})})},V=()=>{A(l.id)},H=t.c(C,{size:40,color:T});return(0,i.jsxs)(`div`,{ref:k,className:o.root,children:[(0,i.jsx)(`div`,{className:o.header,children:(0,i.jsxs)(a.Text,{fw:600,size:`sm`,children:[v===`folder`?`Create new folder`:`Create new file`,` in `,b,`:`]})}),(0,i.jsxs)(`div`,{className:o.content,children:[(0,i.jsxs)(`div`,{className:o.nameRow,children:[v===`folder`&&H&&(0,i.jsx)(`div`,{className:o.iconPreview,"aria-hidden":`true`,children:H}),(0,i.jsx)(a.TextInput,{value:x,onChange:e=>S(e.currentTarget.value),onKeyDown:e=>e.key===`Enter`&&B(),error:L?`There is already a ${v} with that name`:void 0,rightSection:x?(0,i.jsx)(a.ActionIcon,{variant:`transparent`,size:`sm`,onClick:()=>S(``),"aria-label":`Clear name`,children:(0,i.jsx)(d,{})}):null,autoFocus:!0,className:o.nameInput,"aria-label":`Item name`})]}),v===`folder`&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.UnstyledButton,{className:o.collapseToggle,onClick:()=>O(e=>!e),"aria-expanded":D,children:[(0,i.jsx)(u,{open:D}),(0,i.jsx)(a.Text,{size:`sm`,ml:6,children:`Choose custom icon or color`})]}),(0,i.jsx)(a.Collapse,{expanded:D,children:(0,i.jsx)(`div`,{className:o.pickerWrapper,children:(0,i.jsx)(n.t,{selectedIcon:C,selectedColor:T,onIconChange:w,onColorChange:E,colorError:R?`Enter a valid hex color (e.g. #ff0000)`:void 0})})}),(0,i.jsx)(a.Text,{size:`xs`,c:`dimmed`,mt:4,children:`You can change the icon later in folder properties.`})]}),(0,i.jsxs)(a.Group,{justify:`flex-end`,mt:`md`,children:[(0,i.jsx)(a.Button,{variant:`default`,size:`sm`,onClick:V,leftSection:(0,i.jsx)(d,{}),children:`Cancel`}),(0,i.jsx)(a.Button,{size:`sm`,onClick:B,leftSection:(0,i.jsx)(f,{}),disabled:!z,children:`OK`})]})]})]})};exports.default=v;
@@ -0,0 +1,149 @@
1
+ import { o as e } from "./desktopStore-xnNbYaYm.js";
2
+ import { c as t, i as n } from "./useDynamicIcon-_wGeWu-b.js";
3
+ import { t as r } from "./IconColorPicker-DUIXSb5E.js";
4
+ import { useEffect as i, useRef as a, useState as o } from "react";
5
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ import { ActionIcon as u, Button as d, Collapse as f, Group as p, Text as m, TextInput as h, UnstyledButton as g } from "@mantine/core";
7
+ var _ = {
8
+ content: "_content_ej839_1",
9
+ header: "_header_ej839_8",
10
+ nameRow: "_nameRow_ej839_13",
11
+ iconPreview: "_iconPreview_ej839_19",
12
+ nameInput: "_nameInput_ej839_30",
13
+ collapseToggle: "_collapseToggle_ej839_34",
14
+ pickerWrapper: "_pickerWrapper_ej839_46"
15
+ }, v = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, y = (e) => v.test(e), b = {
16
+ size: 14,
17
+ style: { display: "block" }
18
+ }, x = ({ open: e }) => n(e ? "FcCollapse" : "FcExpand", b), S = () => n("FcCancel", b), C = () => n("FcCheckmark", b), w = "VscFolder", T = "#228be6", E = "New File", D = "New Folder", O = 36, k = ({ window: n }) => {
19
+ let v = n, b = v?.contentData?.mode ?? "folder", k = v?.contentData?.parentId ?? null, A = v?.contentData?.currentPath ?? "/home", [j, M] = o(b === "folder" ? D : E), [N, P] = o(w), [F, I] = o(T), [L, R] = o(v?.contentData?.iconPickerOpen ?? !1), z = a(null), B = e((e) => e.closeWindow), V = e((e) => e.resizeWindow), H = e((e) => e.createFile), U = e((e) => e.createFolder), W = e((e) => e.addNotification), G = e((e) => e.fsNodes), K = e((e) => e.windows.find((e) => e.id === v?.id)?.width ?? 400), q = G.some((e) => e.parentId === k && e.type === b && e.name === j.trim()), J = b === "folder" && L && !y(F), Y = j.trim().length > 0 && !q && !J;
20
+ i(() => {
21
+ if (!v?.id || !z.current) return;
22
+ let e = z.current, t = new ResizeObserver(() => {
23
+ V(v.id, K, e.scrollHeight + O);
24
+ });
25
+ return t.observe(e), () => t.disconnect();
26
+ }, [
27
+ v,
28
+ K,
29
+ V
30
+ ]);
31
+ let X = () => {
32
+ if (!Y) return;
33
+ let e = j.trim(), t = k ?? null, n = N, r = F;
34
+ B(v.id), b === "folder" ? U(e, t, n, r).catch((e) => {
35
+ console.error("Failed to create folder:", e), W({
36
+ id: `create-folder-error-${Date.now()}`,
37
+ title: "Error",
38
+ message: `Failed to create folder: ${e instanceof Error ? e.message : "Unknown error"}`,
39
+ fcIcon: "FcHighPriority"
40
+ });
41
+ }) : H(e, "", t).catch((e) => {
42
+ console.error("Failed to create file:", e), W({
43
+ id: `create-file-error-${Date.now()}`,
44
+ title: "Error",
45
+ message: `Failed to create file: ${e instanceof Error ? e.message : "Unknown error"}`,
46
+ fcIcon: "FcHighPriority"
47
+ });
48
+ });
49
+ }, Z = () => {
50
+ B(v.id);
51
+ }, Q = t(N, {
52
+ size: 40,
53
+ color: F
54
+ });
55
+ return /* @__PURE__ */ l("div", {
56
+ ref: z,
57
+ className: _.root,
58
+ children: [/* @__PURE__ */ c("div", {
59
+ className: _.header,
60
+ children: /* @__PURE__ */ l(m, {
61
+ fw: 600,
62
+ size: "sm",
63
+ children: [
64
+ b === "folder" ? "Create new folder" : "Create new file",
65
+ " in ",
66
+ A,
67
+ ":"
68
+ ]
69
+ })
70
+ }), /* @__PURE__ */ l("div", {
71
+ className: _.content,
72
+ children: [
73
+ /* @__PURE__ */ l("div", {
74
+ className: _.nameRow,
75
+ children: [b === "folder" && Q && /* @__PURE__ */ c("div", {
76
+ className: _.iconPreview,
77
+ "aria-hidden": "true",
78
+ children: Q
79
+ }), /* @__PURE__ */ c(h, {
80
+ value: j,
81
+ onChange: (e) => M(e.currentTarget.value),
82
+ onKeyDown: (e) => e.key === "Enter" && X(),
83
+ error: q ? `There is already a ${b} with that name` : void 0,
84
+ rightSection: j ? /* @__PURE__ */ c(u, {
85
+ variant: "transparent",
86
+ size: "sm",
87
+ onClick: () => M(""),
88
+ "aria-label": "Clear name",
89
+ children: /* @__PURE__ */ c(S, {})
90
+ }) : null,
91
+ autoFocus: !0,
92
+ className: _.nameInput,
93
+ "aria-label": "Item name"
94
+ })]
95
+ }),
96
+ b === "folder" && /* @__PURE__ */ l(s, { children: [
97
+ /* @__PURE__ */ l(g, {
98
+ className: _.collapseToggle,
99
+ onClick: () => R((e) => !e),
100
+ "aria-expanded": L,
101
+ children: [/* @__PURE__ */ c(x, { open: L }), /* @__PURE__ */ c(m, {
102
+ size: "sm",
103
+ ml: 6,
104
+ children: "Choose custom icon or color"
105
+ })]
106
+ }),
107
+ /* @__PURE__ */ c(f, {
108
+ expanded: L,
109
+ children: /* @__PURE__ */ c("div", {
110
+ className: _.pickerWrapper,
111
+ children: /* @__PURE__ */ c(r, {
112
+ selectedIcon: N,
113
+ selectedColor: F,
114
+ onIconChange: P,
115
+ onColorChange: I,
116
+ colorError: J ? "Enter a valid hex color (e.g. #ff0000)" : void 0
117
+ })
118
+ })
119
+ }),
120
+ /* @__PURE__ */ c(m, {
121
+ size: "xs",
122
+ c: "dimmed",
123
+ mt: 4,
124
+ children: "You can change the icon later in folder properties."
125
+ })
126
+ ] }),
127
+ /* @__PURE__ */ l(p, {
128
+ justify: "flex-end",
129
+ mt: "md",
130
+ children: [/* @__PURE__ */ c(d, {
131
+ variant: "default",
132
+ size: "sm",
133
+ onClick: Z,
134
+ leftSection: /* @__PURE__ */ c(S, {}),
135
+ children: "Cancel"
136
+ }), /* @__PURE__ */ c(d, {
137
+ size: "sm",
138
+ onClick: X,
139
+ leftSection: /* @__PURE__ */ c(C, {}),
140
+ disabled: !Y,
141
+ children: "OK"
142
+ })]
143
+ })
144
+ ]
145
+ })]
146
+ });
147
+ };
148
+ //#endregion
149
+ export { k as default };
@@ -0,0 +1,162 @@
1
+ import { G as e, W as t, o as n } from "./desktopStore-xnNbYaYm.js";
2
+ import { t as r } from "./useAdaptiveDimensions-sv9lwqF_.js";
3
+ import { t as i } from "./useDeviceDetection-B9jjlate.js";
4
+ import { useEffect as a } from "react";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { Code as c, Paper as l, Stack as u, Text as d } from "@mantine/core";
7
+ var f = { container: "_container_1o4i3_1" }, p = ({ window: p, notifyReady: m }) => {
8
+ let h = i(), g = r(), _ = n((e) => e.viewportWidth), v = n((e) => e.viewportHeight), y = n((e) => e.setViewportSize);
9
+ return a(() => {
10
+ m?.({});
11
+ }, [m]), a(() => {
12
+ let e = () => {
13
+ y(window.innerWidth, window.innerHeight);
14
+ };
15
+ return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
16
+ }, [y]), /* @__PURE__ */ s("div", {
17
+ className: f.container,
18
+ "data-windowid": p?.id,
19
+ children: [/* @__PURE__ */ o(l, {
20
+ p: "sm",
21
+ shadow: "sm",
22
+ withBorder: !0,
23
+ children: /* @__PURE__ */ s(u, {
24
+ gap: "xs",
25
+ children: [
26
+ /* @__PURE__ */ o(d, {
27
+ fw: "bold",
28
+ size: "sm",
29
+ children: "Runtime Environment"
30
+ }),
31
+ /* @__PURE__ */ s(d, {
32
+ size: "xs",
33
+ children: [
34
+ /* @__PURE__ */ o(c, { children: "isDocker:" }),
35
+ " ",
36
+ String(e())
37
+ ]
38
+ }),
39
+ /* @__PURE__ */ s(d, {
40
+ size: "xs",
41
+ children: [
42
+ /* @__PURE__ */ o(c, { children: "isDev:" }),
43
+ " ",
44
+ String(t())
45
+ ]
46
+ })
47
+ ]
48
+ })
49
+ }), /* @__PURE__ */ o(l, {
50
+ p: "sm",
51
+ shadow: "sm",
52
+ withBorder: !0,
53
+ mt: "sm",
54
+ children: /* @__PURE__ */ s(u, {
55
+ gap: "xs",
56
+ children: [
57
+ /* @__PURE__ */ o(d, {
58
+ fw: "bold",
59
+ size: "sm",
60
+ children: "Device Detection"
61
+ }),
62
+ /* @__PURE__ */ s(d, {
63
+ size: "xs",
64
+ children: [
65
+ /* @__PURE__ */ o(c, { children: "isMobile:" }),
66
+ " ",
67
+ String(h.isMobile)
68
+ ]
69
+ }),
70
+ /* @__PURE__ */ s(d, {
71
+ size: "xs",
72
+ children: [
73
+ /* @__PURE__ */ o(c, { children: "isTablet:" }),
74
+ " ",
75
+ String(h.isTablet)
76
+ ]
77
+ }),
78
+ /* @__PURE__ */ s(d, {
79
+ size: "xs",
80
+ children: [
81
+ /* @__PURE__ */ o(c, { children: "isDesktop:" }),
82
+ " ",
83
+ String(h.isDesktop)
84
+ ]
85
+ }),
86
+ /* @__PURE__ */ s(d, {
87
+ size: "xs",
88
+ children: [
89
+ /* @__PURE__ */ o(c, { children: "isPortrait:" }),
90
+ " ",
91
+ String(h.isPortrait)
92
+ ]
93
+ }),
94
+ /* @__PURE__ */ s(d, {
95
+ size: "xs",
96
+ children: [
97
+ /* @__PURE__ */ o(c, { children: "shouldShowWarning:" }),
98
+ " ",
99
+ String(h.shouldShowWarning)
100
+ ]
101
+ }),
102
+ /* @__PURE__ */ s(d, {
103
+ size: "xs",
104
+ children: [
105
+ /* @__PURE__ */ o(c, { children: "viewportWidth:" }),
106
+ " ",
107
+ _,
108
+ "px"
109
+ ]
110
+ }),
111
+ /* @__PURE__ */ s(d, {
112
+ size: "xs",
113
+ children: [
114
+ /* @__PURE__ */ o(c, { children: "viewportHeight:" }),
115
+ " ",
116
+ v,
117
+ "px"
118
+ ]
119
+ }),
120
+ /* @__PURE__ */ s(d, {
121
+ size: "xs",
122
+ children: [
123
+ /* @__PURE__ */ o(c, { children: "defaultWidth:" }),
124
+ " ",
125
+ g.defaultWidth,
126
+ "px"
127
+ ]
128
+ }),
129
+ /* @__PURE__ */ s(d, {
130
+ size: "xs",
131
+ children: [
132
+ /* @__PURE__ */ o(c, { children: "defaultHeight:" }),
133
+ " ",
134
+ g.defaultHeight,
135
+ "px"
136
+ ]
137
+ }),
138
+ /* @__PURE__ */ s(d, {
139
+ size: "xs",
140
+ children: [
141
+ /* @__PURE__ */ o(c, { children: "minWidth:" }),
142
+ " ",
143
+ g.minWidth,
144
+ "px"
145
+ ]
146
+ }),
147
+ /* @__PURE__ */ s(d, {
148
+ size: "xs",
149
+ children: [
150
+ /* @__PURE__ */ o(c, { children: "minHeight:" }),
151
+ " ",
152
+ g.minHeight,
153
+ "px"
154
+ ]
155
+ })
156
+ ]
157
+ })
158
+ })]
159
+ });
160
+ };
161
+ //#endregion
162
+ export { p as default };
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./desktopStore-LSQweOqZ.cjs`),t=require(`./useAdaptiveDimensions-BDZxP4E3.cjs`),n=require(`./useDeviceDetection-CnxnQWIq.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`@mantine/core`);var o={container:`_container_1o4i3_1`},s=({window:s,notifyReady:c})=>{let l=n.t(),u=t.t(),d=e.o(e=>e.viewportWidth),f=e.o(e=>e.viewportHeight),p=e.o(e=>e.setViewportSize);return(0,r.useEffect)(()=>{c?.({})},[c]),(0,r.useEffect)(()=>{let e=()=>{p(window.innerWidth,window.innerHeight)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[p]),(0,i.jsxs)(`div`,{className:o.container,"data-windowid":s?.id,children:[(0,i.jsx)(a.Paper,{p:`sm`,shadow:`sm`,withBorder:!0,children:(0,i.jsxs)(a.Stack,{gap:`xs`,children:[(0,i.jsx)(a.Text,{fw:`bold`,size:`sm`,children:`Runtime Environment`}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`isDocker:`}),` `,String(e.G())]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`isDev:`}),` `,String(e.W())]})]})}),(0,i.jsx)(a.Paper,{p:`sm`,shadow:`sm`,withBorder:!0,mt:`sm`,children:(0,i.jsxs)(a.Stack,{gap:`xs`,children:[(0,i.jsx)(a.Text,{fw:`bold`,size:`sm`,children:`Device Detection`}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`isMobile:`}),` `,String(l.isMobile)]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`isTablet:`}),` `,String(l.isTablet)]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`isDesktop:`}),` `,String(l.isDesktop)]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`isPortrait:`}),` `,String(l.isPortrait)]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`shouldShowWarning:`}),` `,String(l.shouldShowWarning)]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`viewportWidth:`}),` `,d,`px`]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`viewportHeight:`}),` `,f,`px`]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`defaultWidth:`}),` `,u.defaultWidth,`px`]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`defaultHeight:`}),` `,u.defaultHeight,`px`]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`minWidth:`}),` `,u.minWidth,`px`]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`minHeight:`}),` `,u.minHeight,`px`]})]})})]})};exports.default=s;
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./useDynamicIcon-Cg3B_Aeq.cjs`);let t=require(`react`),n=require(`react/jsx-runtime`),r=require(`@mantine/core`);var i={spinner:`_spinner_yguq4_1`,spin:`_spin_yguq4_1`},a=e=>(e/1024).toFixed(1),o=({state:o,ariaLabel:s=`Download progress`,minDisplayTime:c=1e3})=>{let{status:l,loaded:u,total:d}=o,f=e.i(`FcProcess`,{size:24}),[p,m]=(0,t.useState)(null);if((0,t.useEffect)(()=>{if(l!==`done`&&l!==`error`)return;let e=Date.now(),t=setTimeout(()=>{m(e)},c);return()=>clearTimeout(t)},[l,c]),l===`idle`)return null;let h=d===null?`${a(u)} KB`:`${a(u)} / ${a(d)} KB`;return p?(0,n.jsx)(r.Progress,{value:100,size:`sm`,"aria-label":s,children:(0,n.jsxs)(r.Progress.Label,{children:[a(u),` KB`]})}):(0,n.jsxs)(r.Group,{gap:`sm`,align:`center`,justify:`center`,style:{minHeight:40},children:[(0,n.jsx)(r.Box,{className:i.spinner,"data-testid":`process-icon`,children:f}),(0,n.jsx)(r.Text,{size:`sm`,children:h})]})};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./desktopStore-LSQweOqZ.cjs`),t=require(`./buildBreadcrumbs-C2c2a4R3.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`),i=require(`@mantine/core`),a=require(`react-i18next`);var o={root:`_root_b2ks8_1`,breadcrumbBar:`_breadcrumbBar_b2ks8_8`,breadcrumbSep:`_breadcrumbSep_b2ks8_15`,body:`_body_b2ks8_20`,sidebar:`_sidebar_b2ks8_27`,folderTree:`_folderTree_b2ks8_34`,treeItem:`_treeItem_b2ks8_41`,content:`_content_b2ks8_61`,grid:`_grid_b2ks8_67`,item:`_item_b2ks8_75`,icon:`_icon_b2ks8_97`,name:`_name_b2ks8_105`,empty:`_empty_b2ks8_117`,actionBar:`_actionBar_b2ks8_125`,selectedLabel:`_selectedLabel_b2ks8_136`,saveActionBar:`_saveActionBar_b2ks8_142`,fileNameInput:`_fileNameInput_b2ks8_152`,overlay:`_overlay_b2ks8_158`,panel:`_panel_b2ks8_168`},s=(0,n.memo)(({currentFolderId:e,fsNodes:n,onNavigate:a})=>{let s=t.t(e,n);return(0,r.jsx)(`div`,{className:o.breadcrumbBar,children:(0,r.jsx)(i.Breadcrumbs,{separator:`›`,classNames:{separator:o.breadcrumbSep},children:s.map((e,t)=>t===s.length-1?(0,r.jsx)(i.Text,{size:`xs`,fw:500,children:e.name},e.id??`root`):(0,r.jsx)(i.Anchor,{size:`xs`,onClick:()=>a(e.id),children:e.name},e.id??`root`))})})}),c=(0,n.memo)(({node:e,allNodes:n,currentFolderId:a,depth:s,onNavigate:l})=>{let u=n.filter(t=>t.parentId===e.id&&t.type===`folder`);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.UnstyledButton,{className:o.treeItem,"data-active":a===e.id||void 0,style:{paddingLeft:8+s*14},onClick:()=>l(e.id),"aria-label":e.name,"aria-current":a===e.id?`page`:void 0,children:[(0,r.jsx)(t.n,{type:`folder`,folderNode:e,size:14}),(0,r.jsx)(i.Text,{size:`xs`,ml:6,truncate:!0,children:e.name})]}),u.map(e=>(0,r.jsx)(c,{node:e,allNodes:n,currentFolderId:a,depth:s+1,onNavigate:l},e.id))]})}),l=(0,n.memo)(({currentFolderId:e,fsNodes:n,onNavigate:s})=>{let{t:l}=(0,a.useTranslation)(`window`),u=n.filter(e=>e.parentId===null&&e.type===`folder`);return(0,r.jsx)(`aside`,{className:o.sidebar,children:(0,r.jsxs)(`nav`,{className:o.folderTree,"aria-label":l(`fileDialog.folderTreeAria`,{ns:`common`}),children:[(0,r.jsxs)(i.UnstyledButton,{className:o.treeItem,"data-active":e===null||void 0,style:{paddingLeft:8},onClick:()=>s(null),"aria-label":l(`common:labels.home`),"aria-current":e===null?`page`:void 0,children:[(0,r.jsx)(t.n,{type:`folder`,size:14}),(0,r.jsx)(i.Text,{size:`xs`,ml:6,fw:500,children:l(`common:labels.home`)})]}),u.map(t=>(0,r.jsx)(c,{node:t,allNodes:n,currentFolderId:e,depth:1,onNavigate:s},t.id))]})})}),u=(0,n.memo)(({currentFolderId:n,fsNodes:s,onNavigate:c,onItemDoubleClick:l})=>{let{t:u}=(0,a.useTranslation)(`window`),d=s.filter(e=>e.parentId===n&&e.type===`folder`);if(d.length===0)return(0,r.jsx)(`div`,{className:o.empty,children:(0,r.jsx)(i.Text,{size:`sm`,c:`dimmed`,children:u(`common:messages.noSubfolders`)})});let f=e.E(d);return(0,r.jsx)(`div`,{className:o.grid,role:`listbox`,"aria-label":u(`fileDialog.foldersAria`,{ns:`common`}),children:f.map(e=>(0,r.jsxs)(i.UnstyledButton,{className:o.item,onDoubleClick:()=>{c(e.id),l?.(e)},"aria-label":u(`fileDialog.openFolder`,{name:e.name}),role:`option`,children:[(0,r.jsx)(`div`,{className:o.icon,children:(0,r.jsx)(t.n,{type:`folder`,name:e.name,folderNode:e,size:32})}),(0,r.jsx)(i.Text,{size:`xs`,className:o.name,truncate:!0,children:e.name})]},e.id))})}),d=(0,n.memo)(({opened:e,children:t,ariaLabelKey:n,ariaLabelNs:i=`window`})=>{let{t:s}=(0,a.useTranslation)(i);return e?(0,r.jsx)(`div`,{className:o.overlay,role:`dialog`,"aria-label":s(n),children:(0,r.jsx)(`div`,{className:o.panel,children:t})}):null}),f=({acceptedMimeTypes:c,onConfirm:u,onCancel:d})=>{let{t:f}=(0,a.useTranslation)(`window`),p=e.o(e=>e.fsNodes),[m,h]=(0,n.useState)(null),[g,_]=(0,n.useState)(null),v=m===null?p.filter(e=>e.parentId===null):p.filter(e=>e.parentId===m),y=v.filter(e=>{if(e.type===`folder`)return!0;let t=e;return!c||c.length===0?!0:c.some(e=>t.mimeType===e||e.endsWith(`/*`)&&t.mimeType?.startsWith(e.slice(0,-1)))}),b=(0,n.useCallback)(e=>{h(e),_(null)},[]),x=(0,n.useCallback)(e=>{e.type===`file`&&_(e)},[]),S=(0,n.useCallback)(e=>{e.type===`folder`?b(e.id):u(e)},[b,u]);return(0,r.jsxs)(`div`,{className:o.root,children:[(0,r.jsx)(s,{currentFolderId:m,fsNodes:p,onNavigate:b}),(0,r.jsxs)(`div`,{className:o.body,children:[(0,r.jsx)(l,{currentFolderId:m,fsNodes:p,onNavigate:b}),(0,r.jsx)(`main`,{className:o.content,children:y.length===0?(0,r.jsx)(`div`,{className:o.empty,children:(0,r.jsx)(i.Text,{size:`sm`,c:`dimmed`,children:v.length===0?f(`common:messages.folderEmpty`):f(`common:messages.noMatchingFiles`)})}):(0,r.jsx)(`div`,{className:o.grid,role:`listbox`,"aria-label":f(`fileDialog.filesAria`,{ns:`common`}),children:e.E(y).map(e=>{let n=g?.id===e.id;return(0,r.jsxs)(i.UnstyledButton,{className:o.item,"data-selected":n||void 0,"data-type":e.type,onClick:()=>x(e),onDoubleClick:()=>S(e),"aria-label":e.type===`folder`?f(`fileDialog.openFolder`,{name:e.name,ns:`window`}):f(`fileDialog.selectFile`,{name:e.name,ns:`window`}),"aria-selected":e.type===`file`?n:void 0,role:`option`,children:[(0,r.jsx)(`div`,{className:o.icon,children:(0,r.jsx)(t.n,{type:e.type,name:e.name,folderNode:e.type===`folder`?e:void 0,size:32})}),(0,r.jsx)(i.Text,{size:`xs`,className:o.name,truncate:!0,children:e.name})]},e.id)})})})]}),(0,r.jsxs)(`div`,{className:o.actionBar,children:[(0,r.jsx)(i.Text,{size:`xs`,c:`dimmed`,truncate:!0,className:o.selectedLabel,children:g?g.name:f(`common:messages.noFileSelected`)}),(0,r.jsxs)(i.Group,{gap:`xs`,children:[(0,r.jsx)(i.Button,{variant:`default`,size:`xs`,onClick:d,"aria-label":f(`filePicker.cancelAria`,{ns:`common`}),children:f(`common:actions.cancel`)}),(0,r.jsx)(i.Button,{size:`xs`,disabled:!g,onClick:()=>g&&u(g),"aria-label":f(`filePicker.openSelectedAria`,{ns:`common`}),children:f(`common:actions.open`)})]})]})]})},p=({opened:e,...t})=>e?(0,r.jsx)(d,{opened:e,ariaLabelKey:`fileDialog.openFile`,children:(0,r.jsx)(f,{...t})}):null,m=({initialName:t=`untitled.md`,onConfirm:c,onCancel:d})=>{let{t:f}=(0,a.useTranslation)(`window`),p=e.o(e=>e.fsNodes),[m,h]=(0,n.useState)(null),[g,_]=(0,n.useState)(t),v=(0,n.useCallback)(e=>{h(e)},[]),y=(0,n.useCallback)(()=>{let e=g.trim();e&&c({parentId:m,name:e.endsWith(`.md`)?e:`${e}.md`})},[g,m,c]);return(0,r.jsxs)(`div`,{className:o.root,children:[(0,r.jsx)(s,{currentFolderId:m,fsNodes:p,onNavigate:v}),(0,r.jsxs)(`div`,{className:o.body,children:[(0,r.jsx)(l,{currentFolderId:m,fsNodes:p,onNavigate:v}),(0,r.jsx)(`main`,{className:o.content,children:(0,r.jsx)(u,{currentFolderId:m,fsNodes:p,onNavigate:v})})]}),(0,r.jsxs)(`div`,{className:o.saveActionBar,children:[(0,r.jsx)(i.TextInput,{size:`xs`,placeholder:f(`fileDialog.filename`),value:g,onChange:e=>_(e.currentTarget.value),onKeyDown:e=>e.key===`Enter`&&y(),"aria-label":f(`filePicker.fileNameAria`,{ns:`common`}),className:o.fileNameInput}),(0,r.jsxs)(i.Group,{gap:`xs`,style:{flexShrink:0},children:[(0,r.jsx)(i.Button,{variant:`default`,size:`xs`,onClick:d,"aria-label":f(`filePicker.cancelAria`,{ns:`common`}),children:f(`common:actions.cancel`)}),(0,r.jsx)(i.Button,{size:`xs`,disabled:!g.trim(),onClick:y,"aria-label":f(`fileDialog.saveFile`),children:f(`common:actions.save`)})]})]})]})},h=({opened:e,...t})=>e?(0,r.jsx)(d,{opened:e,ariaLabelKey:`fileDialog.saveFile`,children:(0,r.jsx)(m,{...t})}):null,g=({onConfirm:t,onCancel:c})=>{let{t:d}=(0,a.useTranslation)(`window`),f=e.o(e=>e.fsNodes),[p,m]=(0,n.useState)(null),h=(0,n.useCallback)(e=>{m(e)},[]),g=(0,n.useCallback)(()=>{t(p)},[p,t]);return(0,r.jsxs)(`div`,{className:o.root,children:[(0,r.jsx)(s,{currentFolderId:p,fsNodes:f,onNavigate:h}),(0,r.jsxs)(`div`,{className:o.body,children:[(0,r.jsx)(l,{currentFolderId:p,fsNodes:f,onNavigate:h}),(0,r.jsx)(`main`,{className:o.content,children:(0,r.jsx)(u,{currentFolderId:p,fsNodes:f,onNavigate:h})})]}),(0,r.jsxs)(`div`,{className:o.actionBar,children:[(0,r.jsx)(i.Text,{size:`xs`,c:`dimmed`,truncate:!0,className:o.selectedLabel,children:p===null?d(`common:labels.home`):f.find(e=>e.id===p)?.name??``}),(0,r.jsxs)(i.Group,{gap:`xs`,children:[(0,r.jsx)(i.Button,{variant:`default`,size:`xs`,onClick:c,"aria-label":d(`filePicker.cancelAria`,{ns:`common`}),children:d(`common:actions.cancel`)}),(0,r.jsx)(i.Button,{size:`xs`,onClick:g,"aria-label":d(`fileDialog.selectFolder`),children:d(`common:actions.select`)})]})]})]})},_=({opened:e,...t})=>e?(0,r.jsx)(d,{opened:e,ariaLabelKey:`fileDialog.selectFolder`,children:(0,r.jsx)(g,{...t})}):null;Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
@@ -1,4 +1,4 @@
1
- import { E as e, o as t } from "./desktopStore-8cSZlj7s.js";
1
+ import { E as e, o as t } from "./desktopStore-xnNbYaYm.js";
2
2
  import { n, t as r } from "./buildBreadcrumbs-noWhu8os.js";
3
3
  import { memo as i, useCallback as a, useState as o } from "react";
4
4
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
@@ -0,0 +1,191 @@
1
+ import { t as e } from "./useOpenApp-DdEbOVby.js";
2
+ import { D as t, o as n, x as r } from "./desktopStore-xnNbYaYm.js";
3
+ import { t as i } from "./useNotifications-CR9JLjtC.js";
4
+ import { n as a, t as o } from "./buildBreadcrumbs-noWhu8os.js";
5
+ import { useCallback as s, useEffect as c, useState as l } from "react";
6
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
7
+ import { Anchor as p, Breadcrumbs as m, Text as h, UnstyledButton as g } from "@mantine/core";
8
+ var _ = {
9
+ root: "_root_113j7_1",
10
+ item: "_item_113j7_9"
11
+ }, v = ({ node: e, allNodes: t, currentFolderId: n, depth: r, onNavigate: i }) => {
12
+ let o = t.filter((t) => t.parentId === e.id && t.type === "folder");
13
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(g, {
14
+ className: _.item,
15
+ "data-active": n === e.id || void 0,
16
+ style: { paddingLeft: 8 + r * 14 },
17
+ onClick: () => i(e.id),
18
+ "aria-label": e.name,
19
+ "aria-current": n === e.id ? "page" : void 0,
20
+ children: [/* @__PURE__ */ d(a, {
21
+ type: "folder",
22
+ folderNode: e,
23
+ size: 14
24
+ }), /* @__PURE__ */ d(h, {
25
+ size: "xs",
26
+ ml: 6,
27
+ truncate: !0,
28
+ children: e.name
29
+ })]
30
+ }), o.map((e) => /* @__PURE__ */ d(v, {
31
+ node: e,
32
+ allNodes: t,
33
+ currentFolderId: n,
34
+ depth: r + 1,
35
+ onNavigate: i
36
+ }, e.id))] });
37
+ }, y = ({ allNodes: e, currentFolderId: t, onNavigate: n }) => {
38
+ let r = e.filter((e) => e.parentId === null && e.type === "folder");
39
+ return /* @__PURE__ */ f("nav", {
40
+ className: _.root,
41
+ "aria-label": "Folder tree",
42
+ children: [/* @__PURE__ */ f(g, {
43
+ className: _.item,
44
+ "data-active": t === null || void 0,
45
+ style: { paddingLeft: 8 },
46
+ onClick: () => n(null),
47
+ "aria-label": "Home",
48
+ "aria-current": t === null ? "page" : void 0,
49
+ children: [/* @__PURE__ */ d(a, {
50
+ type: "folder",
51
+ size: 14
52
+ }), /* @__PURE__ */ d(h, {
53
+ size: "xs",
54
+ ml: 6,
55
+ fw: 500,
56
+ children: "Home"
57
+ })]
58
+ }), r.map((r) => /* @__PURE__ */ d(v, {
59
+ node: r,
60
+ allNodes: e,
61
+ currentFolderId: t,
62
+ depth: 1,
63
+ onNavigate: n
64
+ }, r.id))]
65
+ });
66
+ }, b = {
67
+ grid: "_grid_1cag6_1",
68
+ item: "_item_1cag6_9",
69
+ icon: "_icon_1cag6_26",
70
+ name: "_name_1cag6_34",
71
+ empty: "_empty_1cag6_46"
72
+ }, x = ({ node: e, onNavigate: t, onOpenFile: n, onContextMenu: r }) => {
73
+ let i = () => {
74
+ e.type === "folder" ? t(e.id) : n(e);
75
+ }, o = e.type === "folder" ? `Open folder ${e.name}` : `Open file ${e.name}`;
76
+ return /* @__PURE__ */ f(g, {
77
+ className: b.item,
78
+ onDoubleClick: i,
79
+ onContextMenu: (t) => r(t, e.id),
80
+ "aria-label": o,
81
+ role: "option",
82
+ children: [/* @__PURE__ */ d("div", {
83
+ className: b.icon,
84
+ children: /* @__PURE__ */ d(a, {
85
+ type: e.type,
86
+ name: e.name,
87
+ folderNode: e.type === "folder" ? e : void 0,
88
+ size: 32
89
+ })
90
+ }), /* @__PURE__ */ d(h, {
91
+ size: "xs",
92
+ className: b.name,
93
+ truncate: !0,
94
+ children: e.name
95
+ })]
96
+ });
97
+ }, S = ({ nodes: e, onNavigate: r, onOpenFile: i, onNodeContextMenu: a }) => {
98
+ let o = n((e) => e.filesSortMode);
99
+ if (e.length === 0) return /* @__PURE__ */ d("div", {
100
+ className: b.empty,
101
+ children: /* @__PURE__ */ d(h, {
102
+ size: "sm",
103
+ c: "dimmed",
104
+ children: "This folder is empty"
105
+ })
106
+ });
107
+ let s = t(e, o);
108
+ return /* @__PURE__ */ d("div", {
109
+ className: b.grid,
110
+ role: "listbox",
111
+ "aria-label": "Files",
112
+ children: s.map((e) => /* @__PURE__ */ d(x, {
113
+ node: e,
114
+ onNavigate: r,
115
+ onOpenFile: i,
116
+ onContextMenu: a
117
+ }, e.id))
118
+ });
119
+ }, C = {
120
+ root: "_root_13mxj_1",
121
+ breadcrumbBar: "_breadcrumbBar_13mxj_9",
122
+ breadcrumbSep: "_breadcrumbSep_13mxj_16",
123
+ body: "_body_13mxj_21",
124
+ sidebar: "_sidebar_13mxj_28",
125
+ content: "_content_13mxj_35"
126
+ }, w = ({ window: t }) => {
127
+ let a = t?.contentData?.initialFolderId, u = n((e) => e.fsNodes), g = n((e) => e.openContextMenu), _ = n((e) => e.setFilesCurrentFolderId), v = e(), { notify: b } = i(), [x, w] = l(a ?? null), T = s((e) => {
128
+ w(e), _(e);
129
+ }, [_]);
130
+ c(() => {
131
+ _(a ?? null);
132
+ }, [a, _]);
133
+ let E = x === null ? u.filter((e) => e.parentId === null) : u.filter((e) => e.parentId === x), D = s((e) => {
134
+ e.preventDefault(), e.stopPropagation(), g(e.clientX, e.clientY, "files");
135
+ }, [g]), O = s((e, t) => {
136
+ e.preventDefault(), e.stopPropagation(), g(e.clientX, e.clientY, "files", t);
137
+ }, [g]), k = s((e) => {
138
+ try {
139
+ let t = r(e);
140
+ if (t) v(t.appId, { contentData: t.contentData });
141
+ else {
142
+ let t = e.mimeType || "unknown";
143
+ console.warn(`[FilesApp] Unsupported file type: ${e.name} (${t})`), b("Unsupported file type", `Cannot open "${e.name}". File type "${t}" is not supported.`, { fcIcon: "FcDeleteRow" });
144
+ }
145
+ } catch (t) {
146
+ console.error("[FilesApp] Error opening file:", t), b("Error opening file", `An unexpected error occurred while opening "${e.name}".`, { fcIcon: "FcHighPriority" });
147
+ }
148
+ }, [v, b]), A = o(x, u);
149
+ return /* @__PURE__ */ f("div", {
150
+ className: C.root,
151
+ onContextMenu: D,
152
+ children: [/* @__PURE__ */ d("div", {
153
+ className: C.breadcrumbBar,
154
+ children: /* @__PURE__ */ d(m, {
155
+ separator: "›",
156
+ classNames: { separator: C.breadcrumbSep },
157
+ children: A.map((e, t) => t === A.length - 1 ? /* @__PURE__ */ d(h, {
158
+ size: "xs",
159
+ fw: 500,
160
+ "data-testid": `breadcrumb-${e.name}`,
161
+ children: e.name
162
+ }, e.id ?? "root") : /* @__PURE__ */ d(p, {
163
+ size: "xs",
164
+ onClick: () => T(e.id),
165
+ "data-testid": `breadcrumb-${e.name}`,
166
+ children: e.name
167
+ }, e.id ?? "root"))
168
+ })
169
+ }), /* @__PURE__ */ f("div", {
170
+ className: C.body,
171
+ children: [/* @__PURE__ */ d("aside", {
172
+ className: C.sidebar,
173
+ children: /* @__PURE__ */ d(y, {
174
+ allNodes: u,
175
+ currentFolderId: x,
176
+ onNavigate: T
177
+ })
178
+ }), /* @__PURE__ */ d("main", {
179
+ className: C.content,
180
+ children: /* @__PURE__ */ d(S, {
181
+ nodes: E,
182
+ onNavigate: T,
183
+ onOpenFile: k,
184
+ onNodeContextMenu: O
185
+ })
186
+ })]
187
+ })]
188
+ });
189
+ };
190
+ //#endregion
191
+ export { w as default };
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./useOpenApp-BBZ_B7Pr.cjs`),t=require(`./desktopStore-LSQweOqZ.cjs`),n=require(`./useNotifications-rwLmJ7fI.cjs`),r=require(`./buildBreadcrumbs-C2c2a4R3.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`),o=require(`@mantine/core`);var s={root:`_root_113j7_1`,item:`_item_113j7_9`},c=({node:e,allNodes:t,currentFolderId:n,depth:i,onNavigate:l})=>{let u=t.filter(t=>t.parentId===e.id&&t.type===`folder`);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(o.UnstyledButton,{className:s.item,"data-active":n===e.id||void 0,style:{paddingLeft:8+i*14},onClick:()=>l(e.id),"aria-label":e.name,"aria-current":n===e.id?`page`:void 0,children:[(0,a.jsx)(r.n,{type:`folder`,folderNode:e,size:14}),(0,a.jsx)(o.Text,{size:`xs`,ml:6,truncate:!0,children:e.name})]}),u.map(e=>(0,a.jsx)(c,{node:e,allNodes:t,currentFolderId:n,depth:i+1,onNavigate:l},e.id))]})},l=({allNodes:e,currentFolderId:t,onNavigate:n})=>{let i=e.filter(e=>e.parentId===null&&e.type===`folder`);return(0,a.jsxs)(`nav`,{className:s.root,"aria-label":`Folder tree`,children:[(0,a.jsxs)(o.UnstyledButton,{className:s.item,"data-active":t===null||void 0,style:{paddingLeft:8},onClick:()=>n(null),"aria-label":`Home`,"aria-current":t===null?`page`:void 0,children:[(0,a.jsx)(r.n,{type:`folder`,size:14}),(0,a.jsx)(o.Text,{size:`xs`,ml:6,fw:500,children:`Home`})]}),i.map(r=>(0,a.jsx)(c,{node:r,allNodes:e,currentFolderId:t,depth:1,onNavigate:n},r.id))]})},u={grid:`_grid_1cag6_1`,item:`_item_1cag6_9`,icon:`_icon_1cag6_26`,name:`_name_1cag6_34`,empty:`_empty_1cag6_46`},d=({node:e,onNavigate:t,onOpenFile:n,onContextMenu:i})=>{let s=()=>{e.type===`folder`?t(e.id):n(e)},c=e.type===`folder`?`Open folder ${e.name}`:`Open file ${e.name}`;return(0,a.jsxs)(o.UnstyledButton,{className:u.item,onDoubleClick:s,onContextMenu:t=>i(t,e.id),"aria-label":c,role:`option`,children:[(0,a.jsx)(`div`,{className:u.icon,children:(0,a.jsx)(r.n,{type:e.type,name:e.name,folderNode:e.type===`folder`?e:void 0,size:32})}),(0,a.jsx)(o.Text,{size:`xs`,className:u.name,truncate:!0,children:e.name})]})},f=({nodes:e,onNavigate:n,onOpenFile:r,onNodeContextMenu:i})=>{let s=t.o(e=>e.filesSortMode);if(e.length===0)return(0,a.jsx)(`div`,{className:u.empty,children:(0,a.jsx)(o.Text,{size:`sm`,c:`dimmed`,children:`This folder is empty`})});let c=t.D(e,s);return(0,a.jsx)(`div`,{className:u.grid,role:`listbox`,"aria-label":`Files`,children:c.map(e=>(0,a.jsx)(d,{node:e,onNavigate:n,onOpenFile:r,onContextMenu:i},e.id))})},p={root:`_root_13mxj_1`,breadcrumbBar:`_breadcrumbBar_13mxj_9`,breadcrumbSep:`_breadcrumbSep_13mxj_16`,body:`_body_13mxj_21`,sidebar:`_sidebar_13mxj_28`,content:`_content_13mxj_35`},m=({window:s})=>{let c=s?.contentData?.initialFolderId,u=t.o(e=>e.fsNodes),d=t.o(e=>e.openContextMenu),m=t.o(e=>e.setFilesCurrentFolderId),h=e.t(),{notify:g}=n.t(),[_,v]=(0,i.useState)(c??null),y=(0,i.useCallback)(e=>{v(e),m(e)},[m]);(0,i.useEffect)(()=>{m(c??null)},[c,m]);let b=_===null?u.filter(e=>e.parentId===null):u.filter(e=>e.parentId===_),x=(0,i.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),d(e.clientX,e.clientY,`files`)},[d]),S=(0,i.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),d(e.clientX,e.clientY,`files`,t)},[d]),C=(0,i.useCallback)(e=>{try{let n=t.x(e);if(n)h(n.appId,{contentData:n.contentData});else{let t=e.mimeType||`unknown`;console.warn(`[FilesApp] Unsupported file type: ${e.name} (${t})`),g(`Unsupported file type`,`Cannot open "${e.name}". File type "${t}" is not supported.`,{fcIcon:`FcDeleteRow`})}}catch(t){console.error(`[FilesApp] Error opening file:`,t),g(`Error opening file`,`An unexpected error occurred while opening "${e.name}".`,{fcIcon:`FcHighPriority`})}},[h,g]),w=r.t(_,u);return(0,a.jsxs)(`div`,{className:p.root,onContextMenu:x,children:[(0,a.jsx)(`div`,{className:p.breadcrumbBar,children:(0,a.jsx)(o.Breadcrumbs,{separator:`›`,classNames:{separator:p.breadcrumbSep},children:w.map((e,t)=>t===w.length-1?(0,a.jsx)(o.Text,{size:`xs`,fw:500,"data-testid":`breadcrumb-${e.name}`,children:e.name},e.id??`root`):(0,a.jsx)(o.Anchor,{size:`xs`,onClick:()=>y(e.id),"data-testid":`breadcrumb-${e.name}`,children:e.name},e.id??`root`))})}),(0,a.jsxs)(`div`,{className:p.body,children:[(0,a.jsx)(`aside`,{className:p.sidebar,children:(0,a.jsx)(l,{allNodes:u,currentFolderId:_,onNavigate:y})}),(0,a.jsx)(`main`,{className:p.content,children:(0,a.jsx)(f,{nodes:b,onNavigate:y,onOpenFile:C,onNodeContextMenu:S})})]})]})};exports.default=m;
@@ -0,0 +1 @@
1
+ require(`./AppTempMemory-DAC62jiS.cjs`);const e=require(`./VscIcon-CeELixwP.cjs`),t=require(`./ColorPicker-BZqsPh3X.cjs`);let n=require(`react/jsx-runtime`),r=require(`@mantine/core`);var i={root:`_root_1jzye_1`,iconGrid:`_iconGrid_1jzye_7`,iconButton:`_iconButton_1jzye_11`},a=[`VscFolder`,`VscFolderOpened`,`VscHome`,`VscServer`,`VscDatabase`,`VscBook`,`VscMail`,`VscGithub`,`VscCloud`,`VscLock`,`VscSettingsGear`,`VscStarFull`,`VscHeart`,`VscMusic`,`VscDeviceCamera`,`VscArchive`],o=({selectedIcon:o,selectedColor:s,onIconChange:c,onColorChange:l,colorError:u})=>(0,n.jsxs)(`div`,{className:i.root,children:[(0,n.jsx)(r.SimpleGrid,{cols:8,spacing:4,className:i.iconGrid,children:a.map(t=>{let a=o===t;return(0,n.jsx)(r.Tooltip,{label:t,openDelay:500,children:(0,n.jsx)(r.UnstyledButton,{className:i.iconButton,"data-selected":a||void 0,onClick:()=>c(t),"aria-label":t,"aria-pressed":a,children:(0,n.jsx)(e.t,{name:t,size:20,color:s})})},t)})}),(0,n.jsx)(t.t,{value:s,onChange:l,error:u})]});Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});