@fde-desktop/fde-core 0.4.10 → 0.4.13
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.
- package/dist/AppEmptyState-Boej96TB.js +49 -0
- package/dist/AppEmptyState-CLc00OOG.cjs +1 -0
- package/dist/AppIcon-C8vHUVcb.cjs +1 -0
- package/dist/AppIcon-mtEoyzOb.js +22 -0
- package/dist/AppMenuBar-CAlkNHjj.cjs +1 -0
- package/dist/AppMenuBar-DmSfQRXU.js +197 -0
- package/dist/CalendarApp-DOmjWbpl.js +10 -0
- package/dist/CalendarApp-Z0bCCYsK.cjs +1 -0
- package/dist/ColorPicker-CQRRwY-y.cjs +1 -0
- package/dist/ColorPicker-WCeD3Wjf.js +35 -0
- package/dist/CreateItemApp-BkFFFdX1.cjs +1 -0
- package/dist/CreateItemApp-DR8Y4bwo.js +202 -0
- package/dist/DeviceInfoApp-BXQ9uOwF.cjs +1 -0
- package/dist/DeviceInfoApp-I63mJRWy.js +195 -0
- package/dist/DownloadProgress-CkTGTf0z.cjs +1 -0
- package/dist/DownloadProgress-DnVASsv5.js +39 -0
- package/dist/FilePickerApp-By6-vbag.cjs +1 -0
- package/dist/FilePickerApp-ClHuhm6Z.js +390 -0
- package/dist/FilesApp-BRK2OqkQ.cjs +1 -0
- package/dist/FilesApp-BuoFP_KA.js +212 -0
- package/dist/ImageViewerApp-B1niWF75.cjs +1 -0
- package/dist/{ImageViewerApp-CWiP6zx-.js → ImageViewerApp-iojtyFEf.js} +18 -17
- package/dist/{ImageViewerMenuBar-BULkh_Ku.js → ImageViewerMenuBar-BIsUokxV.js} +15 -14
- package/dist/ImageViewerMenuBar-BgzgSF3v.cjs +1 -0
- package/dist/MenuEditApp-BHptoJbz.cjs +1 -0
- package/dist/MenuEditApp-CJUbJaqh.js +492 -0
- package/dist/MenuEditMenuBar-CCOSPAUe.cjs +1 -0
- package/dist/{MenuEditMenuBar-B94z4Umw.js → MenuEditMenuBar-DnCL-kaZ.js} +13 -12
- package/dist/NotesApp-BmQIBtJ2.cjs +1 -0
- package/dist/NotesApp-DJ2dGt4-.js +364 -0
- package/dist/NotesMenuBar-BzojwMtH.cjs +1 -0
- package/dist/{NotesMenuBar-BB4NkKGf.js → NotesMenuBar-DILZTjnT.js} +10 -9
- package/dist/PdfApp-IjY_GtnW.js +39 -0
- package/dist/PdfApp-krW8UI97.cjs +1 -0
- package/dist/PdfMenuBar-Bd5MTZcZ.js +39 -0
- package/dist/PdfMenuBar-DWD0Qa3F.cjs +1 -0
- package/dist/SettingsApp-BE22l5UP.cjs +1 -0
- package/dist/SettingsApp-BTFtTFY_.js +1228 -0
- package/dist/SettingsMenuBar-CZE2evG2.cjs +1 -0
- package/dist/SettingsMenuBar-ktC0viTd.js +42 -0
- package/dist/UploaderApp-Bboc4KZ1.js +263 -0
- package/dist/UploaderApp-Dr1mF7oj.cjs +1 -0
- package/dist/{VscIcon-DueRJVTe.js → VscIcon-AEENjKOE.js} +1 -1
- package/dist/VscIcon-BYb_Soyy.cjs +1 -0
- package/dist/buildBreadcrumbs-Ccd8i11b.cjs +1 -0
- package/dist/buildBreadcrumbs-noWhu8os.js +45 -0
- package/dist/{desktopStore-B0R1-BeA.js → desktopStore-8cSZlj7s.js} +342 -549
- package/dist/desktopStore-C1jR6Fdb.cjs +1 -0
- package/dist/{imageViewerStore-CJMRXaQh.js → imageViewerStore-COrD02Zu.js} +1 -1
- package/dist/imageViewerStore-Dfylg59V.cjs +1 -0
- package/dist/index.cjs +1 -53
- package/dist/index.css +1 -1
- package/dist/index.d.ts +16 -6
- package/dist/index.js +3033 -7513
- package/dist/menuEditStore-CYwtfD6H.cjs +1 -0
- package/dist/{menuEditStore-C8S_EedM.js → menuEditStore-CxsgLiQu.js} +1 -1
- package/dist/notesStore-CrWTO6oB.cjs +1 -0
- package/dist/{notesStore-DKRgTTFn.js → notesStore-Dgah46U5.js} +1 -1
- package/dist/rolldown-runtime-CAFD8bLK.js +11 -0
- package/dist/{settingsAppStore-KOeWRO6h.js → settingsAppStore-DHZhi6Rl.js} +1 -1
- package/dist/settingsAppStore-DuYZNeFf.cjs +1 -0
- package/dist/useAdaptiveDimensions-3Lz4X0Tc.cjs +1 -0
- package/dist/{useAdaptiveDimensions-CunsU0mn.js → useAdaptiveDimensions-DxNLJ7R5.js} +1 -1
- package/dist/{useCloseInterceptor-CuKAAFnj.js → useCloseInterceptor-CIxhOZx1.js} +12 -12
- package/dist/useCloseInterceptor-CdX-09Ib.cjs +1 -0
- package/dist/useDynamicIcon-CK6SjEv5.cjs +1 -0
- package/dist/{useDynamicIcon-GJg3vWsJ.js → useDynamicIcon-_wGeWu-b.js} +1 -1
- package/dist/useOpenApp-ChDhsL9h.cjs +1 -0
- package/dist/{useOpenApp-BVpSfNrG.js → useOpenApp-uguTLkyl.js} +51 -67
- package/dist/{useResolvedUrl-DFKXq598.js → useResolvedUrl-B6x4xy0x.js} +1 -2
- package/dist/useResolvedUrl-Bb39DpVy.cjs +1 -0
- package/package.json +3 -4
- package/dist/AccordionChevron-CJXAq5o5.js +0 -26
- package/dist/AccordionChevron-DBXp38Lm.cjs +0 -1
- package/dist/ActionIcon-C_SfdBfx.cjs +0 -1
- package/dist/ActionIcon-CtVbYlGY.js +0 -145
- package/dist/AppEmptyState-BTujnL_b.js +0 -4962
- package/dist/AppEmptyState-Dc4GaDfu.cjs +0 -1
- package/dist/AppIcon--qzR4sgf.cjs +0 -1
- package/dist/AppIcon-DCDuaU-t.js +0 -80
- package/dist/AppMenuBar-BiHbNg9V.cjs +0 -9
- package/dist/AppMenuBar-CHJy8OF0.js +0 -2639
- package/dist/Box-DRm8EabO.js +0 -1593
- package/dist/Box-D_64wv6n.cjs +0 -1
- package/dist/Button-D0FXpkur.cjs +0 -1
- package/dist/Button-k7SxX1Xl.js +0 -178
- package/dist/CalendarApp-C1HvuJoa.cjs +0 -1
- package/dist/CalendarApp-DBEQqsS_.js +0 -1721
- package/dist/Center-CyryG5zn.js +0 -25
- package/dist/Center-T4No_FAa.cjs +0 -1
- package/dist/CheckIcon-C3WjIR2i.js +0 -25
- package/dist/CheckIcon-CBMLR6Gc.cjs +0 -1
- package/dist/CodeServerApp-B3l5QPuG.cjs +0 -1
- package/dist/CodeServerApp-BpeALSaX.js +0 -2
- package/dist/CodeServerApp-CRjCngFv.cjs +0 -1
- package/dist/CodeServerApp-DY94cy1a.js +0 -149
- package/dist/ColorPicker-BL4UbKCV.cjs +0 -1
- package/dist/ColorPicker-DvRR-wlQ.js +0 -997
- package/dist/CreateItemApp-BU9wmjKM.cjs +0 -1
- package/dist/CreateItemApp-CtdH1K1g.js +0 -400
- package/dist/CreateItemApp-t9F-a6wD.cjs +0 -1
- package/dist/DeviceInfoApp-C306YvtZ.js +0 -223
- package/dist/DeviceInfoApp-Cdju_LIB.cjs +0 -1
- package/dist/DeviceInfoApp-CyB01v4D.cjs +0 -1
- package/dist/DownloadProgress-IRw1dzLX.cjs +0 -1
- package/dist/DownloadProgress-hdupSUBT.js +0 -174
- package/dist/FileIcon-BCpGMI5U.js +0 -88
- package/dist/FileIcon-BCrsxmtt.cjs +0 -1
- package/dist/FilePickerApp-DMGuvahM.js +0 -409
- package/dist/FilePickerApp-Eu0cr2Cm.cjs +0 -1
- package/dist/FilesApp-BQFVHkEn.js +0 -225
- package/dist/FilesApp-BZ_dzZnF.cjs +0 -1
- package/dist/FilesApp-SIWXFPXt.cjs +0 -1
- package/dist/Group-BzwlMeob.js +0 -48
- package/dist/Group-DhwePB84.cjs +0 -1
- package/dist/ImageViewerApp-BOz59TGc.cjs +0 -1
- package/dist/ImageViewerApp-BeqY6voE.cjs +0 -1
- package/dist/ImageViewerApp-DBAfJPSo.js +0 -2
- package/dist/ImageViewerMenuBar-Cb0Nr5-M.js +0 -2
- package/dist/ImageViewerMenuBar-CoEp0RxK.cjs +0 -1
- package/dist/ImageViewerMenuBar-zOkJtqKo.cjs +0 -1
- package/dist/MenuEditApp-BoKtj2GH.js +0 -2
- package/dist/MenuEditApp-D21sEp86.js +0 -2615
- package/dist/MenuEditApp-k3cPfTG9.cjs +0 -1
- package/dist/MenuEditApp-sz9GlLVH.cjs +0 -5
- package/dist/MenuEditMenuBar-6QxlIDpl.cjs +0 -1
- package/dist/MenuEditMenuBar-Bv6R42lf.js +0 -2
- package/dist/MenuEditMenuBar-CBsmH_-T.cjs +0 -1
- package/dist/NotesApp-BtR55Hva.cjs +0 -207
- package/dist/NotesApp-C59exz_9.js +0 -16154
- package/dist/NotesApp-D47I5LS_.js +0 -2
- package/dist/NotesApp-lOwsi2sg.cjs +0 -1
- package/dist/NotesMenuBar-BZITC74y.cjs +0 -1
- package/dist/NotesMenuBar-Bp0sPqyR.cjs +0 -1
- package/dist/NotesMenuBar-xlfODmMA.js +0 -2
- package/dist/Paper-DtUYKmYn.js +0 -30
- package/dist/Paper-DwCpwWwH.cjs +0 -1
- package/dist/PdfApp-1XbFGfoY.cjs +0 -1
- package/dist/PdfApp-BhIoJWeK.cjs +0 -1
- package/dist/PdfApp-C5Rt1Zaw.js +0 -2
- package/dist/PdfApp-C8Hwxxqh.js +0 -38
- package/dist/PdfMenuBar-BA9rKuMP.cjs +0 -1
- package/dist/PdfMenuBar-JXHqwxhZ.cjs +0 -1
- package/dist/PdfMenuBar-R0fu7oYF.js +0 -2
- package/dist/PdfMenuBar-sd-9Vk3h.js +0 -38
- package/dist/SettingsApp-7EhpjzUE.cjs +0 -1
- package/dist/SettingsApp-ByiPAj1I.cjs +0 -1
- package/dist/SettingsApp-d6fmBHxR.js +0 -1829
- package/dist/SettingsApp-qKJmC0lj.js +0 -2
- package/dist/SettingsMenuBar-BPwv8JQK.js +0 -41
- package/dist/SettingsMenuBar-D8R7hOik.js +0 -2
- package/dist/SettingsMenuBar-DDrjZLmg.cjs +0 -1
- package/dist/SettingsMenuBar-DQjUa8g1.cjs +0 -1
- package/dist/Slider-BNO-vDFn.js +0 -1175
- package/dist/Slider-Bg_EIBg6.cjs +0 -1
- package/dist/Stack-BOaJgV3N.cjs +0 -1
- package/dist/Stack-CuDEaP7e.js +0 -34
- package/dist/StorybookApp-Bkr-7mXp.cjs +0 -1
- package/dist/StorybookApp-WYninkJo.js +0 -10
- package/dist/TerminalApp-8XbsKAWa.js +0 -10041
- package/dist/TerminalApp-Bq2e7QQu.cjs +0 -1
- package/dist/TerminalApp-CVu3Axc9.js +0 -2
- package/dist/TerminalApp-b7_d0jRO.cjs +0 -36
- package/dist/TerminalMenuBar-Cb8x9laS.js +0 -2
- package/dist/TerminalMenuBar-De-FH5AE.cjs +0 -1
- package/dist/TerminalMenuBar-iKLydNda.js +0 -112
- package/dist/TerminalMenuBar-yOaWd-hn.cjs +0 -1
- package/dist/TextInput-C3qfxxWI.js +0 -980
- package/dist/TextInput-DcYns3hz.cjs +0 -1
- package/dist/Tooltip-CAOO-qdx.js +0 -3185
- package/dist/Tooltip-DDh_x-CB.cjs +0 -1
- package/dist/UnstyledButton-CI3kyRck.js +0 -25
- package/dist/UnstyledButton-Cl5RuIid.cjs +0 -1
- package/dist/UploaderApp-C76ydsd8.js +0 -487
- package/dist/UploaderApp-CHACW8Yr.js +0 -2
- package/dist/UploaderApp-Q_a3mBik.cjs +0 -1
- package/dist/UploaderApp-htj59ppo.cjs +0 -1
- package/dist/VscIcon-CxEmqD80.cjs +0 -1
- package/dist/chunk-BQCxAhux.js +0 -23
- package/dist/chunk-CiTBaPhY.cjs +0 -1
- package/dist/create-safe-context-95P-Bfg3.cjs +0 -1
- package/dist/create-safe-context-XT2cxc14.js +0 -12
- package/dist/desktopStore-Cox-Og1z.cjs +0 -1
- package/dist/fc-DejOsQyD.cjs +0 -1
- package/dist/fc-kd8WzIER.js +0 -20536
- package/dist/fc-xJ_v2ayq.cjs +0 -184
- package/dist/fi-BahYsbim.js +0 -9993
- package/dist/fi-BkhyTcZo.cjs +0 -1
- package/dist/getRuntime-BLXyQZBB.cjs +0 -1
- package/dist/getRuntime-CCRXVzJH.js +0 -63
- package/dist/iconBase-B4UCuSvv.cjs +0 -1
- package/dist/iconBase-D7iPes7B.js +0 -108
- package/dist/imageViewerStore-CH1qW6md.cjs +0 -1
- package/dist/is-element-BocgicRg.cjs +0 -1
- package/dist/is-element-Bu_JY8Qy.js +0 -7
- package/dist/menuEditStore-CU7IAg3L.cjs +0 -1
- package/dist/notesStore-zKmChTfF.cjs +0 -1
- package/dist/react-DYmzHD0X.js +0 -27
- package/dist/react-Dldg32sN.cjs +0 -1
- package/dist/settingsAppStore-BrlImdAH.cjs +0 -1
- package/dist/terminalStore-LWWjCvCe.js +0 -30
- package/dist/terminalStore-fZe5t7Ty.cjs +0 -1
- package/dist/use-merged-ref-BI9n1hUK.cjs +0 -1
- package/dist/use-merged-ref-BT8_u6vW.js +0 -25
- package/dist/use-resolved-styles-api-AVDygMKo.cjs +0 -1
- package/dist/use-resolved-styles-api-pEOi2wiK.js +0 -21
- package/dist/use-uncontrolled-A4hm9ATM.js +0 -23
- package/dist/use-uncontrolled-BPrfGv0W.cjs +0 -1
- package/dist/useAdaptiveDimensions-Btp0m5Pm.cjs +0 -1
- package/dist/useCloseInterceptor-a_6Lcuqj.cjs +0 -1
- package/dist/useDynamicIcon-SytdL1Tu.cjs +0 -1
- package/dist/useOpenApp-Br0jo4-y.cjs +0 -1
- package/dist/useResolvedUrl-Be5ZlCX7.cjs +0 -1
- package/dist/useTranslation-DMRGdqZi.js +0 -279
- package/dist/useTranslation-D_O7S4RJ.cjs +0 -1
- package/dist/vsc-Ciibqbxo.cjs +0 -1
- package/dist/vsc-DGKSpOAR.js +0 -9574
- /package/dist/{Colors-BxX4G8kX.cjs → Colors-CNJbU7oq.cjs} +0 -0
- /package/dist/{Colors-hca6raEG.js → Colors-CuABn2W4.js} +0 -0
- /package/dist/{useMenuBarUtils-ChmpZjwu.js → useMenuBarUtils-ChAfI7OA.js} +0 -0
- /package/dist/{useMenuBarUtils-Bp5PiztD.cjs → useMenuBarUtils-DAap0ukp.cjs} +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { t as e } from "./Colors-CuABn2W4.js";
|
|
2
|
+
import { useEffect as t, useState as n } from "react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { motion as a } from "framer-motion";
|
|
5
|
+
var o = {
|
|
6
|
+
root: "_root_19u7b_1",
|
|
7
|
+
container: "_container_19u7b_10",
|
|
8
|
+
item: "_item_19u7b_23",
|
|
9
|
+
label: "_label_19u7b_29"
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/utils/getFourRandomColors.ts
|
|
13
|
+
function s(t = 4) {
|
|
14
|
+
return [...e].sort(() => Math.random() - .5).slice(0, t);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/Shared/AppEmptyState/AppEmptyState.tsx
|
|
18
|
+
var c = s(), l = {
|
|
19
|
+
type: "spring",
|
|
20
|
+
damping: 20,
|
|
21
|
+
stiffness: 300
|
|
22
|
+
};
|
|
23
|
+
function u(e) {
|
|
24
|
+
return [...e].sort(() => Math.random() - .5);
|
|
25
|
+
}
|
|
26
|
+
var d = ({ label: e = "Work In Progress" }) => {
|
|
27
|
+
let [s, d] = n(c);
|
|
28
|
+
return t(() => {
|
|
29
|
+
let e = setTimeout(() => d((e) => u(e)), 1e3);
|
|
30
|
+
return () => clearTimeout(e);
|
|
31
|
+
}, [s]), /* @__PURE__ */ i("div", {
|
|
32
|
+
className: o.root,
|
|
33
|
+
"data-testid": "app-empty-state",
|
|
34
|
+
children: [/* @__PURE__ */ r("ul", {
|
|
35
|
+
className: o.container,
|
|
36
|
+
children: s.map((e) => /* @__PURE__ */ r(a.li, {
|
|
37
|
+
layout: !0,
|
|
38
|
+
transition: l,
|
|
39
|
+
className: o.item,
|
|
40
|
+
style: { backgroundColor: e }
|
|
41
|
+
}, e))
|
|
42
|
+
}), /* @__PURE__ */ r("p", {
|
|
43
|
+
className: o.label,
|
|
44
|
+
children: e
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { s as n, d as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./NotesApp-BmQIBtJ2.cjs`);const e=require(`./Colors-CNJbU7oq.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(`./NotesApp-BmQIBtJ2.cjs`);const e=require(`./desktopStore-C1jR6Fdb.cjs`),t=require(`./useDynamicIcon-CK6SjEv5.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}});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { g as e } from "./desktopStore-8cSZlj7s.js";
|
|
2
|
+
import { c as t, i as n, o as r } from "./useDynamicIcon-_wGeWu-b.js";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Shared/AppIcon.tsx
|
|
5
|
+
var a = ({ fcIcon: a, fallback: o, iconUrl: s, size: c = 20, color: l }) => {
|
|
6
|
+
let u = a?.startsWith("Fi"), d = a?.startsWith("Vsc"), f = n(!u && !d ? a ?? "" : "", { size: c }), p = r(u ? a ?? "" : "", {
|
|
7
|
+
size: c,
|
|
8
|
+
color: l
|
|
9
|
+
}), m = t(d ? a ?? "" : "", { size: c });
|
|
10
|
+
return s ? /* @__PURE__ */ i("img", {
|
|
11
|
+
src: e(s),
|
|
12
|
+
alt: "",
|
|
13
|
+
width: c,
|
|
14
|
+
height: c,
|
|
15
|
+
style: { objectFit: "contain" }
|
|
16
|
+
}) : u && p ? p : d && m ? m : f || (o ? /* @__PURE__ */ i("span", {
|
|
17
|
+
"aria-hidden": "true",
|
|
18
|
+
children: o
|
|
19
|
+
}) : null);
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { a as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./NotesApp-BmQIBtJ2.cjs`);const e=require(`./useDynamicIcon-CK6SjEv5.cjs`);let t=require(`react`),n=require(`react/jsx-runtime`),r=require(`@mantine/core`);var i=({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,197 @@
|
|
|
1
|
+
import { i as e } from "./useDynamicIcon-_wGeWu-b.js";
|
|
2
|
+
import { useState as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { Menu as i, NumberInput as a, Select as o, Slider as s, Switch as c, TextInput as l, Tooltip as u } from "@mantine/core";
|
|
5
|
+
//#region src/components/Shared/DirtyIndicator/DirtyIndicator.tsx
|
|
6
|
+
var d = ({ size: t = 16 }) => /* @__PURE__ */ n("span", {
|
|
7
|
+
style: {
|
|
8
|
+
color: "orange",
|
|
9
|
+
fontWeight: "bold",
|
|
10
|
+
marginLeft: "8px",
|
|
11
|
+
display: "flex",
|
|
12
|
+
alignItems: "center"
|
|
13
|
+
},
|
|
14
|
+
title: "Unsaved changes",
|
|
15
|
+
children: e("FcSynchronize", { size: t })
|
|
16
|
+
}), f = {
|
|
17
|
+
root: "_root_1aqog_1",
|
|
18
|
+
menuTrigger: "_menuTrigger_1aqog_19",
|
|
19
|
+
element: "_element_1aqog_37",
|
|
20
|
+
sliderLabel: "_sliderLabel_1aqog_44",
|
|
21
|
+
select: "_select_1aqog_50",
|
|
22
|
+
textInput: "_textInput_1aqog_51",
|
|
23
|
+
numberInput: "_numberInput_1aqog_52",
|
|
24
|
+
slider: "_slider_1aqog_44"
|
|
25
|
+
}, p = {
|
|
26
|
+
size: 16,
|
|
27
|
+
style: { display: "block" }
|
|
28
|
+
}, m = ({ name: t }) => e(t, p), h = ({ label: a, icon: o, items: c, rightSection: l }) => {
|
|
29
|
+
let [u, d] = t(!1);
|
|
30
|
+
return /* @__PURE__ */ r(i, {
|
|
31
|
+
opened: u,
|
|
32
|
+
onClose: () => d(!1),
|
|
33
|
+
withinPortal: !0,
|
|
34
|
+
keepMounted: !0,
|
|
35
|
+
closeOnItemClick: !0,
|
|
36
|
+
closeOnEscape: !0,
|
|
37
|
+
closeOnClickOutside: !0,
|
|
38
|
+
position: "bottom-start",
|
|
39
|
+
children: [/* @__PURE__ */ n(i.Target, { children: /* @__PURE__ */ r("button", {
|
|
40
|
+
className: f.menuTrigger,
|
|
41
|
+
onClick: () => d((e) => !e),
|
|
42
|
+
children: [
|
|
43
|
+
o && /* @__PURE__ */ n(() => e(o ?? "", p), {}),
|
|
44
|
+
/* @__PURE__ */ n("span", { children: a }),
|
|
45
|
+
l && /* @__PURE__ */ n("span", {
|
|
46
|
+
style: { marginLeft: "auto" },
|
|
47
|
+
children: l
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
}) }), /* @__PURE__ */ n(i.Dropdown, { children: c.map((e, t) => e.type === "divider" ? /* @__PURE__ */ n(i.Divider, {}, t) : e.type === "slider" ? /* @__PURE__ */ n(i.Item, {
|
|
51
|
+
closeMenuOnClick: !1,
|
|
52
|
+
children: /* @__PURE__ */ r("div", {
|
|
53
|
+
style: { minWidth: 120 },
|
|
54
|
+
children: [e.label && /* @__PURE__ */ n("div", {
|
|
55
|
+
style: { marginBottom: 4 },
|
|
56
|
+
children: e.label
|
|
57
|
+
}), /* @__PURE__ */ n(s, {
|
|
58
|
+
min: e.min,
|
|
59
|
+
max: e.max,
|
|
60
|
+
value: e.value,
|
|
61
|
+
onChange: e.onChange,
|
|
62
|
+
size: "sm"
|
|
63
|
+
})]
|
|
64
|
+
})
|
|
65
|
+
}, t) : /* @__PURE__ */ n(i.Item, {
|
|
66
|
+
disabled: e.disabled,
|
|
67
|
+
onClick: e.onClick,
|
|
68
|
+
leftSection: e.icon ? /* @__PURE__ */ n(m, { name: e.icon }) : void 0,
|
|
69
|
+
children: e.label
|
|
70
|
+
}, t)) })]
|
|
71
|
+
});
|
|
72
|
+
}, g = ({ elements: e }) => {
|
|
73
|
+
let [i, p] = t({}), m = (e, t) => {
|
|
74
|
+
p((n) => ({
|
|
75
|
+
...n,
|
|
76
|
+
[e]: {
|
|
77
|
+
...n[e] ?? {
|
|
78
|
+
isHovered: !1,
|
|
79
|
+
isDragging: !1
|
|
80
|
+
},
|
|
81
|
+
...t
|
|
82
|
+
}
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
return /* @__PURE__ */ n("div", {
|
|
86
|
+
className: f.root,
|
|
87
|
+
role: "menubar",
|
|
88
|
+
"aria-label": "Application menu",
|
|
89
|
+
children: e.map((e, t) => {
|
|
90
|
+
switch (e.type) {
|
|
91
|
+
case "menu": return /* @__PURE__ */ n(h, {
|
|
92
|
+
label: e.label,
|
|
93
|
+
icon: e.icon,
|
|
94
|
+
items: e.items,
|
|
95
|
+
rightSection: e.rightSection
|
|
96
|
+
}, t);
|
|
97
|
+
case "combobox": return /* @__PURE__ */ n("div", {
|
|
98
|
+
className: f.element,
|
|
99
|
+
children: /* @__PURE__ */ n(o, {
|
|
100
|
+
data: e.options,
|
|
101
|
+
value: e.value,
|
|
102
|
+
onChange: (t) => t && e.onChange(t),
|
|
103
|
+
placeholder: e.label,
|
|
104
|
+
size: "sm",
|
|
105
|
+
className: f.select,
|
|
106
|
+
comboboxProps: { withinPortal: !0 }
|
|
107
|
+
})
|
|
108
|
+
}, t);
|
|
109
|
+
case "switch": return /* @__PURE__ */ n("div", {
|
|
110
|
+
className: f.element,
|
|
111
|
+
children: /* @__PURE__ */ n(c, {
|
|
112
|
+
label: e.label,
|
|
113
|
+
checked: e.checked,
|
|
114
|
+
onChange: (t) => e.onChange(t.currentTarget.checked),
|
|
115
|
+
size: "sm"
|
|
116
|
+
})
|
|
117
|
+
}, t);
|
|
118
|
+
case "slider": {
|
|
119
|
+
let a = i[t] ?? {
|
|
120
|
+
isHovered: !1,
|
|
121
|
+
isDragging: !1
|
|
122
|
+
}, o = a.isHovered || a.isDragging;
|
|
123
|
+
return /* @__PURE__ */ n(u, {
|
|
124
|
+
label: (e.labelFormat ?? ((e) => String(e)))(e.value),
|
|
125
|
+
position: "bottom",
|
|
126
|
+
withArrow: !0,
|
|
127
|
+
opened: o,
|
|
128
|
+
children: /* @__PURE__ */ r("div", {
|
|
129
|
+
className: f.element,
|
|
130
|
+
onMouseEnter: () => m(t, { isHovered: !0 }),
|
|
131
|
+
onMouseLeave: () => m(t, { isHovered: !1 }),
|
|
132
|
+
children: [e.label && /* @__PURE__ */ n("span", {
|
|
133
|
+
className: f.sliderLabel,
|
|
134
|
+
children: e.label
|
|
135
|
+
}), /* @__PURE__ */ n(s, {
|
|
136
|
+
min: e.min,
|
|
137
|
+
max: e.max,
|
|
138
|
+
value: e.value,
|
|
139
|
+
onChange: (n) => {
|
|
140
|
+
e.onChange(n), m(t, { isDragging: !0 });
|
|
141
|
+
},
|
|
142
|
+
onChangeEnd: (n) => {
|
|
143
|
+
e.onChange(n), m(t, { isDragging: !1 });
|
|
144
|
+
},
|
|
145
|
+
size: "sm",
|
|
146
|
+
className: f.slider,
|
|
147
|
+
marks: e.marks
|
|
148
|
+
})]
|
|
149
|
+
})
|
|
150
|
+
}, t);
|
|
151
|
+
}
|
|
152
|
+
case "text-input": return /* @__PURE__ */ n("div", {
|
|
153
|
+
className: f.element,
|
|
154
|
+
children: /* @__PURE__ */ n(l, {
|
|
155
|
+
placeholder: e.placeholder,
|
|
156
|
+
value: e.value,
|
|
157
|
+
onChange: (t) => e.onChange(t.currentTarget.value),
|
|
158
|
+
size: "sm",
|
|
159
|
+
className: f.textInput
|
|
160
|
+
})
|
|
161
|
+
}, t);
|
|
162
|
+
case "number-input": return /* @__PURE__ */ n("div", {
|
|
163
|
+
className: f.element,
|
|
164
|
+
children: /* @__PURE__ */ n(a, {
|
|
165
|
+
label: e.label,
|
|
166
|
+
value: e.value,
|
|
167
|
+
onChange: (t) => e.onChange(typeof t == "number" ? t : 0),
|
|
168
|
+
min: e.min,
|
|
169
|
+
max: e.max,
|
|
170
|
+
step: e.step ?? 1,
|
|
171
|
+
placeholder: e.placeholder,
|
|
172
|
+
size: "sm",
|
|
173
|
+
className: f.numberInput
|
|
174
|
+
})
|
|
175
|
+
}, t);
|
|
176
|
+
case "select": return /* @__PURE__ */ n("div", {
|
|
177
|
+
className: f.element,
|
|
178
|
+
children: /* @__PURE__ */ n(o, {
|
|
179
|
+
label: e.label,
|
|
180
|
+
data: e.options,
|
|
181
|
+
value: e.value,
|
|
182
|
+
onChange: (t) => t && e.onChange(t),
|
|
183
|
+
size: "sm",
|
|
184
|
+
className: f.select,
|
|
185
|
+
comboboxProps: { withinPortal: !0 }
|
|
186
|
+
})
|
|
187
|
+
}, t);
|
|
188
|
+
case "dirty-indicator": return /* @__PURE__ */ n("span", {
|
|
189
|
+
style: { marginLeft: "auto" },
|
|
190
|
+
children: /* @__PURE__ */ n(d, {})
|
|
191
|
+
}, t);
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
//#endregion
|
|
197
|
+
export { d as n, g as t };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
|
|
2
|
+
import "@mantine/dates/styles.css";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { Calendar as n } from "@mantine/dates";
|
|
5
|
+
var r = { root: "_root_43uio_1" }, i = /* @__PURE__ */ e({ default: () => a }), a = () => /* @__PURE__ */ t("div", {
|
|
6
|
+
className: r.root,
|
|
7
|
+
children: /* @__PURE__ */ t(n, {})
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { i as n, a as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./NotesApp-BmQIBtJ2.cjs`);require(`@mantine/dates/styles.css`);let t=require(`react/jsx-runtime`),n=require(`@mantine/dates`);var r={root:`_root_43uio_1`},i=e.i({default:()=>a}),a=()=>(0,t.jsx)(`div`,{className:r.root,children:(0,t.jsx)(n.Calendar,{})});Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./NotesApp-BmQIBtJ2.cjs`);const e=require(`./Colors-CNJbU7oq.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,35 @@
|
|
|
1
|
+
import { t as e } from "./Colors-CuABn2W4.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { ColorInput as r, UnstyledButton as i } from "@mantine/core";
|
|
4
|
+
var a = {
|
|
5
|
+
root: "_root_18r9b_1",
|
|
6
|
+
colorRow: "_colorRow_18r9b_7",
|
|
7
|
+
colorSwatch: "_colorSwatch_18r9b_13",
|
|
8
|
+
colorInput: "_colorInput_18r9b_38"
|
|
9
|
+
}, o = ({ value: o, onChange: s, error: c, disabled: l = !1 }) => /* @__PURE__ */ n("div", {
|
|
10
|
+
className: a.root,
|
|
11
|
+
children: [/* @__PURE__ */ t("div", {
|
|
12
|
+
className: a.colorRow,
|
|
13
|
+
children: e.map((e) => /* @__PURE__ */ t(i, {
|
|
14
|
+
className: a.colorSwatch,
|
|
15
|
+
"data-selected": o === e || void 0,
|
|
16
|
+
"data-disabled": l || void 0,
|
|
17
|
+
style: { background: e },
|
|
18
|
+
onClick: () => !l && s(e),
|
|
19
|
+
"aria-label": `Color ${e}`,
|
|
20
|
+
"aria-pressed": o === e,
|
|
21
|
+
disabled: l
|
|
22
|
+
}, e))
|
|
23
|
+
}), /* @__PURE__ */ t(r, {
|
|
24
|
+
value: o,
|
|
25
|
+
onChange: s,
|
|
26
|
+
placeholder: "Custom color",
|
|
27
|
+
size: "xs",
|
|
28
|
+
className: a.colorInput,
|
|
29
|
+
"aria-label": "Custom color picker",
|
|
30
|
+
error: c,
|
|
31
|
+
disabled: l
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
//#endregion
|
|
35
|
+
export { o as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./NotesApp-BmQIBtJ2.cjs`),t=require(`./desktopStore-C1jR6Fdb.cjs`),n=require(`./useDynamicIcon-CK6SjEv5.cjs`),r=require(`./VscIcon-BYb_Soyy.cjs`),i=require(`./ColorPicker-CQRRwY-y.cjs`);let a=require(`react`),o=require(`react/jsx-runtime`),s=require(`@mantine/core`);var c={root:`_root_1jzye_1`,iconGrid:`_iconGrid_1jzye_7`,iconButton:`_iconButton_1jzye_11`},l=[`VscFolder`,`VscFolderOpened`,`VscHome`,`VscServer`,`VscDatabase`,`VscBook`,`VscMail`,`VscGithub`,`VscCloud`,`VscLock`,`VscSettingsGear`,`VscStar`,`VscHeart`,`VscMusic`,`VscCamera`,`VscArchive`],u=({selectedIcon:e,selectedColor:t,onIconChange:n,onColorChange:a,colorError:u})=>(0,o.jsxs)(`div`,{className:c.root,children:[(0,o.jsx)(s.SimpleGrid,{cols:8,spacing:4,className:c.iconGrid,children:l.map(i=>{let a=e===i;return(0,o.jsx)(s.Tooltip,{label:i,openDelay:500,children:(0,o.jsx)(s.UnstyledButton,{className:c.iconButton,"data-selected":a||void 0,onClick:()=>n(i),"aria-label":i,"aria-pressed":a,children:(0,o.jsx)(r.t,{name:i,size:20,color:t})})},i)})}),(0,o.jsx)(i.t,{value:t,onChange:a,error:u})]}),d={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`},f=e.i({default:()=>w}),p=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,m=e=>p.test(e),h={size:14,style:{display:`block`}},g=({open:e})=>n.i(e?`FcCollapse`:`FcExpand`,h),_=()=>n.i(`FcCancel`,h),v=()=>n.i(`FcCheckmark`,h),y=`VscFolder`,b=`#228be6`,x=`New File`,S=`New Folder`,C=36,w=({window:e})=>{let r=e,i=r?.contentData?.mode??`folder`,c=r?.contentData?.parentId??null,l=r?.contentData?.currentPath??`/home`,[f,p]=(0,a.useState)(i===`folder`?S:x),[h,w]=(0,a.useState)(y),[T,E]=(0,a.useState)(b),[D,O]=(0,a.useState)(r?.contentData?.iconPickerOpen??!1),k=(0,a.useRef)(null),A=t.o(e=>e.closeWindow),j=t.o(e=>e.resizeWindow),M=t.o(e=>e.createFile),N=t.o(e=>e.createFolder),P=t.o(e=>e.addNotification),F=t.o(e=>e.fsNodes),I=t.o(e=>e.windows.find(e=>e.id===r?.id)?.width??400),L=F.some(e=>e.parentId===c&&e.type===i&&e.name===f.trim()),R=i===`folder`&&D&&!m(T),z=f.trim().length>0&&!L&&!R;(0,a.useEffect)(()=>{if(!r?.id||!k.current)return;let e=k.current,t=new ResizeObserver(()=>{j(r.id,I,e.scrollHeight+C)});return t.observe(e),()=>t.disconnect()},[r,I,j]);let B=()=>{if(!z)return;let e=f.trim(),t=c??null,n=h,a=T;A(r.id),i===`folder`?N(e,t,n,a).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(r.id)},H=n.c(h,{size:40,color:T});return(0,o.jsxs)(`div`,{ref:k,className:d.root,children:[(0,o.jsx)(`div`,{className:d.header,children:(0,o.jsxs)(s.Text,{fw:600,size:`sm`,children:[i===`folder`?`Create new folder`:`Create new file`,` in `,l,`:`]})}),(0,o.jsxs)(`div`,{className:d.content,children:[(0,o.jsxs)(`div`,{className:d.nameRow,children:[i===`folder`&&H&&(0,o.jsx)(`div`,{className:d.iconPreview,"aria-hidden":`true`,children:H}),(0,o.jsx)(s.TextInput,{value:f,onChange:e=>p(e.currentTarget.value),onKeyDown:e=>e.key===`Enter`&&B(),error:L?`There is already a ${i} with that name`:void 0,rightSection:f?(0,o.jsx)(s.ActionIcon,{variant:`transparent`,size:`sm`,onClick:()=>p(``),"aria-label":`Clear name`,children:(0,o.jsx)(_,{})}):null,autoFocus:!0,className:d.nameInput,"aria-label":`Item name`})]}),i===`folder`&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.UnstyledButton,{className:d.collapseToggle,onClick:()=>O(e=>!e),"aria-expanded":D,children:[(0,o.jsx)(g,{open:D}),(0,o.jsx)(s.Text,{size:`sm`,ml:6,children:`Choose custom icon or color`})]}),(0,o.jsx)(s.Collapse,{expanded:D,children:(0,o.jsx)(`div`,{className:d.pickerWrapper,children:(0,o.jsx)(u,{selectedIcon:h,selectedColor:T,onIconChange:w,onColorChange:E,colorError:R?`Enter a valid hex color (e.g. #ff0000)`:void 0})})}),(0,o.jsx)(s.Text,{size:`xs`,c:`dimmed`,mt:4,children:`You can change the icon later in folder properties.`})]}),(0,o.jsxs)(s.Group,{justify:`flex-end`,mt:`md`,children:[(0,o.jsx)(s.Button,{variant:`default`,size:`sm`,onClick:V,leftSection:(0,o.jsx)(_,{}),children:`Cancel`}),(0,o.jsx)(s.Button,{size:`sm`,onClick:B,leftSection:(0,o.jsx)(v,{}),disabled:!z,children:`OK`})]})]})]})};Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return w}});
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
|
|
2
|
+
import { o as t } from "./desktopStore-8cSZlj7s.js";
|
|
3
|
+
import { c as n, i as r } from "./useDynamicIcon-_wGeWu-b.js";
|
|
4
|
+
import { t as i } from "./VscIcon-AEENjKOE.js";
|
|
5
|
+
import { t as a } from "./ColorPicker-WCeD3Wjf.js";
|
|
6
|
+
import { useEffect as o, useRef as s, useState as c } from "react";
|
|
7
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
import { ActionIcon as f, Button as p, Collapse as m, Group as h, SimpleGrid as g, Text as _, TextInput as v, Tooltip as y, UnstyledButton as b } from "@mantine/core";
|
|
9
|
+
var x = {
|
|
10
|
+
root: "_root_1jzye_1",
|
|
11
|
+
iconGrid: "_iconGrid_1jzye_7",
|
|
12
|
+
iconButton: "_iconButton_1jzye_11"
|
|
13
|
+
}, S = [
|
|
14
|
+
"VscFolder",
|
|
15
|
+
"VscFolderOpened",
|
|
16
|
+
"VscHome",
|
|
17
|
+
"VscServer",
|
|
18
|
+
"VscDatabase",
|
|
19
|
+
"VscBook",
|
|
20
|
+
"VscMail",
|
|
21
|
+
"VscGithub",
|
|
22
|
+
"VscCloud",
|
|
23
|
+
"VscLock",
|
|
24
|
+
"VscSettingsGear",
|
|
25
|
+
"VscStar",
|
|
26
|
+
"VscHeart",
|
|
27
|
+
"VscMusic",
|
|
28
|
+
"VscCamera",
|
|
29
|
+
"VscArchive"
|
|
30
|
+
], C = ({ selectedIcon: e, selectedColor: t, onIconChange: n, onColorChange: r, colorError: o }) => /* @__PURE__ */ d("div", {
|
|
31
|
+
className: x.root,
|
|
32
|
+
children: [/* @__PURE__ */ u(g, {
|
|
33
|
+
cols: 8,
|
|
34
|
+
spacing: 4,
|
|
35
|
+
className: x.iconGrid,
|
|
36
|
+
children: S.map((r) => {
|
|
37
|
+
let a = e === r;
|
|
38
|
+
return /* @__PURE__ */ u(y, {
|
|
39
|
+
label: r,
|
|
40
|
+
openDelay: 500,
|
|
41
|
+
children: /* @__PURE__ */ u(b, {
|
|
42
|
+
className: x.iconButton,
|
|
43
|
+
"data-selected": a || void 0,
|
|
44
|
+
onClick: () => n(r),
|
|
45
|
+
"aria-label": r,
|
|
46
|
+
"aria-pressed": a,
|
|
47
|
+
children: /* @__PURE__ */ u(i, {
|
|
48
|
+
name: r,
|
|
49
|
+
size: 20,
|
|
50
|
+
color: t
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
}, r);
|
|
54
|
+
})
|
|
55
|
+
}), /* @__PURE__ */ u(a, {
|
|
56
|
+
value: t,
|
|
57
|
+
onChange: r,
|
|
58
|
+
error: o
|
|
59
|
+
})]
|
|
60
|
+
}), w = {
|
|
61
|
+
content: "_content_ej839_1",
|
|
62
|
+
header: "_header_ej839_8",
|
|
63
|
+
nameRow: "_nameRow_ej839_13",
|
|
64
|
+
iconPreview: "_iconPreview_ej839_19",
|
|
65
|
+
nameInput: "_nameInput_ej839_30",
|
|
66
|
+
collapseToggle: "_collapseToggle_ej839_34",
|
|
67
|
+
pickerWrapper: "_pickerWrapper_ej839_46"
|
|
68
|
+
}, T = /* @__PURE__ */ e({ default: () => L }), E = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, D = (e) => E.test(e), O = {
|
|
69
|
+
size: 14,
|
|
70
|
+
style: { display: "block" }
|
|
71
|
+
}, k = ({ open: e }) => r(e ? "FcCollapse" : "FcExpand", O), A = () => r("FcCancel", O), j = () => r("FcCheckmark", O), M = "VscFolder", N = "#228be6", P = "New File", F = "New Folder", I = 36, L = ({ window: e }) => {
|
|
72
|
+
let r = e, i = r?.contentData?.mode ?? "folder", a = r?.contentData?.parentId ?? null, g = r?.contentData?.currentPath ?? "/home", [y, x] = c(i === "folder" ? F : P), [S, T] = c(M), [E, O] = c(N), [L, R] = c(r?.contentData?.iconPickerOpen ?? !1), z = s(null), B = t((e) => e.closeWindow), V = t((e) => e.resizeWindow), H = t((e) => e.createFile), U = t((e) => e.createFolder), W = t((e) => e.addNotification), G = t((e) => e.fsNodes), K = t((e) => e.windows.find((e) => e.id === r?.id)?.width ?? 400), q = G.some((e) => e.parentId === a && e.type === i && e.name === y.trim()), J = i === "folder" && L && !D(E), Y = y.trim().length > 0 && !q && !J;
|
|
73
|
+
o(() => {
|
|
74
|
+
if (!r?.id || !z.current) return;
|
|
75
|
+
let e = z.current, t = new ResizeObserver(() => {
|
|
76
|
+
V(r.id, K, e.scrollHeight + I);
|
|
77
|
+
});
|
|
78
|
+
return t.observe(e), () => t.disconnect();
|
|
79
|
+
}, [
|
|
80
|
+
r,
|
|
81
|
+
K,
|
|
82
|
+
V
|
|
83
|
+
]);
|
|
84
|
+
let X = () => {
|
|
85
|
+
if (!Y) return;
|
|
86
|
+
let e = y.trim(), t = a ?? null, n = S, o = E;
|
|
87
|
+
B(r.id), i === "folder" ? U(e, t, n, o).catch((e) => {
|
|
88
|
+
console.error("Failed to create folder:", e), W({
|
|
89
|
+
id: `create-folder-error-${Date.now()}`,
|
|
90
|
+
title: "Error",
|
|
91
|
+
message: `Failed to create folder: ${e instanceof Error ? e.message : "Unknown error"}`,
|
|
92
|
+
fcIcon: "FcHighPriority"
|
|
93
|
+
});
|
|
94
|
+
}) : H(e, "", t).catch((e) => {
|
|
95
|
+
console.error("Failed to create file:", e), W({
|
|
96
|
+
id: `create-file-error-${Date.now()}`,
|
|
97
|
+
title: "Error",
|
|
98
|
+
message: `Failed to create file: ${e instanceof Error ? e.message : "Unknown error"}`,
|
|
99
|
+
fcIcon: "FcHighPriority"
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}, Z = () => {
|
|
103
|
+
B(r.id);
|
|
104
|
+
}, Q = n(S, {
|
|
105
|
+
size: 40,
|
|
106
|
+
color: E
|
|
107
|
+
});
|
|
108
|
+
return /* @__PURE__ */ d("div", {
|
|
109
|
+
ref: z,
|
|
110
|
+
className: w.root,
|
|
111
|
+
children: [/* @__PURE__ */ u("div", {
|
|
112
|
+
className: w.header,
|
|
113
|
+
children: /* @__PURE__ */ d(_, {
|
|
114
|
+
fw: 600,
|
|
115
|
+
size: "sm",
|
|
116
|
+
children: [
|
|
117
|
+
i === "folder" ? "Create new folder" : "Create new file",
|
|
118
|
+
" in ",
|
|
119
|
+
g,
|
|
120
|
+
":"
|
|
121
|
+
]
|
|
122
|
+
})
|
|
123
|
+
}), /* @__PURE__ */ d("div", {
|
|
124
|
+
className: w.content,
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ d("div", {
|
|
127
|
+
className: w.nameRow,
|
|
128
|
+
children: [i === "folder" && Q && /* @__PURE__ */ u("div", {
|
|
129
|
+
className: w.iconPreview,
|
|
130
|
+
"aria-hidden": "true",
|
|
131
|
+
children: Q
|
|
132
|
+
}), /* @__PURE__ */ u(v, {
|
|
133
|
+
value: y,
|
|
134
|
+
onChange: (e) => x(e.currentTarget.value),
|
|
135
|
+
onKeyDown: (e) => e.key === "Enter" && X(),
|
|
136
|
+
error: q ? `There is already a ${i} with that name` : void 0,
|
|
137
|
+
rightSection: y ? /* @__PURE__ */ u(f, {
|
|
138
|
+
variant: "transparent",
|
|
139
|
+
size: "sm",
|
|
140
|
+
onClick: () => x(""),
|
|
141
|
+
"aria-label": "Clear name",
|
|
142
|
+
children: /* @__PURE__ */ u(A, {})
|
|
143
|
+
}) : null,
|
|
144
|
+
autoFocus: !0,
|
|
145
|
+
className: w.nameInput,
|
|
146
|
+
"aria-label": "Item name"
|
|
147
|
+
})]
|
|
148
|
+
}),
|
|
149
|
+
i === "folder" && /* @__PURE__ */ d(l, { children: [
|
|
150
|
+
/* @__PURE__ */ d(b, {
|
|
151
|
+
className: w.collapseToggle,
|
|
152
|
+
onClick: () => R((e) => !e),
|
|
153
|
+
"aria-expanded": L,
|
|
154
|
+
children: [/* @__PURE__ */ u(k, { open: L }), /* @__PURE__ */ u(_, {
|
|
155
|
+
size: "sm",
|
|
156
|
+
ml: 6,
|
|
157
|
+
children: "Choose custom icon or color"
|
|
158
|
+
})]
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ u(m, {
|
|
161
|
+
expanded: L,
|
|
162
|
+
children: /* @__PURE__ */ u("div", {
|
|
163
|
+
className: w.pickerWrapper,
|
|
164
|
+
children: /* @__PURE__ */ u(C, {
|
|
165
|
+
selectedIcon: S,
|
|
166
|
+
selectedColor: E,
|
|
167
|
+
onIconChange: T,
|
|
168
|
+
onColorChange: O,
|
|
169
|
+
colorError: J ? "Enter a valid hex color (e.g. #ff0000)" : void 0
|
|
170
|
+
})
|
|
171
|
+
})
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ u(_, {
|
|
174
|
+
size: "xs",
|
|
175
|
+
c: "dimmed",
|
|
176
|
+
mt: 4,
|
|
177
|
+
children: "You can change the icon later in folder properties."
|
|
178
|
+
})
|
|
179
|
+
] }),
|
|
180
|
+
/* @__PURE__ */ d(h, {
|
|
181
|
+
justify: "flex-end",
|
|
182
|
+
mt: "md",
|
|
183
|
+
children: [/* @__PURE__ */ u(p, {
|
|
184
|
+
variant: "default",
|
|
185
|
+
size: "sm",
|
|
186
|
+
onClick: Z,
|
|
187
|
+
leftSection: /* @__PURE__ */ u(A, {}),
|
|
188
|
+
children: "Cancel"
|
|
189
|
+
}), /* @__PURE__ */ u(p, {
|
|
190
|
+
size: "sm",
|
|
191
|
+
onClick: X,
|
|
192
|
+
leftSection: /* @__PURE__ */ u(j, {}),
|
|
193
|
+
disabled: !Y,
|
|
194
|
+
children: "OK"
|
|
195
|
+
})]
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
})]
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
//#endregion
|
|
202
|
+
export { S as i, T as n, C as r, L as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./NotesApp-BmQIBtJ2.cjs`),t=require(`./desktopStore-C1jR6Fdb.cjs`),n=require(`./useAdaptiveDimensions-3Lz4X0Tc.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`@mantine/core`);var o=()=>{let e=window.innerWidth,n=window.matchMedia(`(pointer: coarse)`).matches;return e<t.p.MOBILE||n},s=()=>{let e=window.innerWidth;return e>=t.p.MOBILE&&e<t.p.TABLET},c=()=>window.innerWidth>=t.p.TABLET,l=()=>screen.orientation?screen.orientation.type.includes(`portrait`):window.innerHeight>window.innerWidth;function u(){let[e,t]=(0,r.useState)(()=>({isMobile:o(),isTablet:s(),isDesktop:c(),isPortrait:l(),shouldShowWarning:o()&&l(),screenWidth:window.innerWidth,screenHeight:window.innerHeight})),n=(0,r.useCallback)(()=>{let e=o(),n=l();t({isMobile:e,isTablet:s(),isDesktop:c(),isPortrait:n,shouldShowWarning:e&&n,screenWidth:window.innerWidth,screenHeight:window.innerHeight})},[]);return(0,r.useEffect)(()=>(window.addEventListener(`resize`,n),screen.orientation?.addEventListener?.(`change`,n),()=>{window.removeEventListener(`resize`,n),screen.orientation?.removeEventListener?.(`change`,n)}),[n]),e}var d={container:`_container_1o4i3_1`},f=e.i({default:()=>p}),p=({window:e,notifyReady:o})=>{let s=u(),c=n.t(),l=t.o(e=>e.viewportWidth),f=t.o(e=>e.viewportHeight),p=t.o(e=>e.setViewportSize);return(0,r.useEffect)(()=>{o?.({})},[o]),(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:d.container,"data-windowid":e?.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(t.G())]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`isDev:`}),` `,String(t.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(s.isMobile)]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`isTablet:`}),` `,String(s.isTablet)]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`isDesktop:`}),` `,String(s.isDesktop)]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`isPortrait:`}),` `,String(s.isPortrait)]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`shouldShowWarning:`}),` `,String(s.shouldShowWarning)]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`viewportWidth:`}),` `,l,`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:`}),` `,c.defaultWidth,`px`]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`defaultHeight:`}),` `,c.defaultHeight,`px`]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`minWidth:`}),` `,c.minWidth,`px`]}),(0,i.jsxs)(a.Text,{size:`xs`,children:[(0,i.jsx)(a.Code,{children:`minHeight:`}),` `,c.minHeight,`px`]})]})})]})};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|