@fde-desktop/fde-core 0.4.7 → 0.4.8
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/AccordionChevron-CJXAq5o5.js +26 -0
- package/dist/AccordionChevron-DBXp38Lm.cjs +1 -0
- package/dist/ActionIcon-C_SfdBfx.cjs +1 -0
- package/dist/ActionIcon-CtVbYlGY.js +145 -0
- package/dist/AppEmptyState-BTujnL_b.js +4962 -0
- package/dist/AppEmptyState-Dc4GaDfu.cjs +1 -0
- package/dist/AppIcon--qzR4sgf.cjs +1 -0
- package/dist/AppIcon-DCDuaU-t.js +80 -0
- package/dist/AppMenuBar-BiHbNg9V.cjs +9 -0
- package/dist/AppMenuBar-CHJy8OF0.js +2639 -0
- package/dist/Box-DRm8EabO.js +1593 -0
- package/dist/Box-D_64wv6n.cjs +1 -0
- package/dist/Button-D0FXpkur.cjs +1 -0
- package/dist/Button-k7SxX1Xl.js +178 -0
- package/dist/CalendarApp-C1HvuJoa.cjs +1 -0
- package/dist/CalendarApp-DBEQqsS_.js +1721 -0
- package/dist/Center-CyryG5zn.js +25 -0
- package/dist/Center-T4No_FAa.cjs +1 -0
- package/dist/CheckIcon-C3WjIR2i.js +25 -0
- package/dist/CheckIcon-CBMLR6Gc.cjs +1 -0
- package/dist/CodeServerApp-B3l5QPuG.cjs +1 -0
- package/dist/CodeServerApp-BpeALSaX.js +2 -0
- package/dist/CodeServerApp-CRjCngFv.cjs +1 -0
- package/dist/CodeServerApp-DY94cy1a.js +149 -0
- package/dist/ColorPicker-BL4UbKCV.cjs +1 -0
- package/dist/ColorPicker-DvRR-wlQ.js +997 -0
- package/dist/Colors-BxX4G8kX.cjs +1 -0
- package/dist/Colors-hca6raEG.js +15 -0
- package/dist/CreateItemApp-BU9wmjKM.cjs +1 -0
- package/dist/CreateItemApp-CtdH1K1g.js +400 -0
- package/dist/CreateItemApp-t9F-a6wD.cjs +1 -0
- package/dist/DeviceInfoApp-C306YvtZ.js +223 -0
- package/dist/DeviceInfoApp-Cdju_LIB.cjs +1 -0
- package/dist/DeviceInfoApp-CyB01v4D.cjs +1 -0
- package/dist/DownloadProgress-IRw1dzLX.cjs +1 -0
- package/dist/DownloadProgress-hdupSUBT.js +174 -0
- package/dist/FileIcon-BCpGMI5U.js +88 -0
- package/dist/FileIcon-BCrsxmtt.cjs +1 -0
- package/dist/FilePickerApp-DMGuvahM.js +409 -0
- package/dist/FilePickerApp-Eu0cr2Cm.cjs +1 -0
- package/dist/FilesApp-30OjnOuP.cjs +1 -0
- package/dist/FilesApp-BvlzPNuO.cjs +1 -0
- package/dist/FilesApp-VXrmtt63.js +225 -0
- package/dist/Group-BzwlMeob.js +48 -0
- package/dist/Group-DhwePB84.cjs +1 -0
- package/dist/ImageViewerApp-BOz59TGc.cjs +1 -0
- package/dist/ImageViewerApp-BeqY6voE.cjs +1 -0
- package/dist/ImageViewerApp-CWiP6zx-.js +68 -0
- package/dist/ImageViewerApp-DBAfJPSo.js +2 -0
- package/dist/ImageViewerMenuBar-BULkh_Ku.js +86 -0
- package/dist/ImageViewerMenuBar-Cb0Nr5-M.js +2 -0
- package/dist/ImageViewerMenuBar-CoEp0RxK.cjs +1 -0
- package/dist/ImageViewerMenuBar-zOkJtqKo.cjs +1 -0
- package/dist/MenuEditApp-BoKtj2GH.js +2 -0
- package/dist/MenuEditApp-D21sEp86.js +2615 -0
- package/dist/MenuEditApp-k3cPfTG9.cjs +1 -0
- package/dist/MenuEditApp-sz9GlLVH.cjs +5 -0
- package/dist/MenuEditMenuBar-6QxlIDpl.cjs +1 -0
- package/dist/MenuEditMenuBar-B94z4Umw.js +59 -0
- package/dist/MenuEditMenuBar-Bv6R42lf.js +2 -0
- package/dist/MenuEditMenuBar-CBsmH_-T.cjs +1 -0
- package/dist/NotesApp-BtR55Hva.cjs +207 -0
- package/dist/NotesApp-C59exz_9.js +16154 -0
- package/dist/NotesApp-D47I5LS_.js +2 -0
- package/dist/NotesApp-lOwsi2sg.cjs +1 -0
- package/dist/NotesMenuBar-BB4NkKGf.js +61 -0
- package/dist/NotesMenuBar-BZITC74y.cjs +1 -0
- package/dist/NotesMenuBar-Bp0sPqyR.cjs +1 -0
- package/dist/NotesMenuBar-xlfODmMA.js +2 -0
- package/dist/Paper-DtUYKmYn.js +30 -0
- package/dist/Paper-DwCpwWwH.cjs +1 -0
- package/dist/PdfApp-1XbFGfoY.cjs +1 -0
- package/dist/PdfApp-BhIoJWeK.cjs +1 -0
- package/dist/PdfApp-C5Rt1Zaw.js +2 -0
- package/dist/PdfApp-C8Hwxxqh.js +38 -0
- package/dist/PdfMenuBar-BA9rKuMP.cjs +1 -0
- package/dist/PdfMenuBar-JXHqwxhZ.cjs +1 -0
- package/dist/PdfMenuBar-R0fu7oYF.js +2 -0
- package/dist/PdfMenuBar-sd-9Vk3h.js +38 -0
- package/dist/SettingsApp-BA-5B4RA.cjs +1 -0
- package/dist/SettingsApp-B_rev1xh.cjs +1 -0
- package/dist/SettingsApp-Ck4aUXs5.js +2 -0
- package/dist/SettingsApp-DUMKSA3K.js +2425 -0
- package/dist/SettingsMenuBar-BPwv8JQK.js +41 -0
- package/dist/SettingsMenuBar-D8R7hOik.js +2 -0
- package/dist/SettingsMenuBar-DDrjZLmg.cjs +1 -0
- package/dist/SettingsMenuBar-DQjUa8g1.cjs +1 -0
- package/dist/Slider-BNO-vDFn.js +1175 -0
- package/dist/Slider-Bg_EIBg6.cjs +1 -0
- package/dist/Stack-BOaJgV3N.cjs +1 -0
- package/dist/Stack-CuDEaP7e.js +34 -0
- package/dist/StorybookApp-Bkr-7mXp.cjs +1 -0
- package/dist/StorybookApp-WYninkJo.js +10 -0
- package/dist/TerminalApp-8XbsKAWa.js +10041 -0
- package/dist/TerminalApp-Bq2e7QQu.cjs +1 -0
- package/dist/TerminalApp-CVu3Axc9.js +2 -0
- package/dist/TerminalApp-b7_d0jRO.cjs +36 -0
- package/dist/TerminalMenuBar-Cb8x9laS.js +2 -0
- package/dist/TerminalMenuBar-De-FH5AE.cjs +1 -0
- package/dist/TerminalMenuBar-iKLydNda.js +112 -0
- package/dist/TerminalMenuBar-yOaWd-hn.cjs +1 -0
- package/dist/TextInput-C3qfxxWI.js +980 -0
- package/dist/TextInput-DcYns3hz.cjs +1 -0
- package/dist/Tooltip-CAOO-qdx.js +3185 -0
- package/dist/Tooltip-DDh_x-CB.cjs +1 -0
- package/dist/UnstyledButton-CI3kyRck.js +25 -0
- package/dist/UnstyledButton-Cl5RuIid.cjs +1 -0
- package/dist/UploaderApp-BZXW75A0.cjs +1 -0
- package/dist/UploaderApp-C9W_yCT-.js +487 -0
- package/dist/UploaderApp-CPpStgP5.cjs +1 -0
- package/dist/UploaderApp-DHsMQN-f.js +2 -0
- package/dist/VscIcon-CxEmqD80.cjs +1 -0
- package/dist/VscIcon-DueRJVTe.js +8 -0
- package/dist/chunk-BQCxAhux.js +23 -0
- package/dist/chunk-CiTBaPhY.cjs +1 -0
- package/dist/create-safe-context-95P-Bfg3.cjs +1 -0
- package/dist/create-safe-context-XT2cxc14.js +12 -0
- package/dist/desktopStore-B0R1-BeA.js +1905 -0
- package/dist/desktopStore-Cox-Og1z.cjs +1 -0
- package/dist/fc-DejOsQyD.cjs +1 -0
- package/dist/fc-kd8WzIER.js +20536 -0
- package/dist/fc-xJ_v2ayq.cjs +184 -0
- package/dist/fi-BahYsbim.js +9993 -0
- package/dist/fi-BkhyTcZo.cjs +1 -0
- package/dist/getRuntime-BLXyQZBB.cjs +1 -0
- package/dist/getRuntime-CCRXVzJH.js +63 -0
- package/dist/iconBase-B4UCuSvv.cjs +1 -0
- package/dist/iconBase-D7iPes7B.js +108 -0
- package/dist/imageViewerStore-CH1qW6md.cjs +1 -0
- package/dist/imageViewerStore-CJMRXaQh.js +50 -0
- package/dist/index.cjs +53 -5642
- package/dist/index.css +2 -9192
- package/dist/index.d.ts +2258 -2019
- package/dist/index.js +8983 -4780
- package/dist/is-element-BocgicRg.cjs +1 -0
- package/dist/is-element-Bu_JY8Qy.js +7 -0
- package/dist/menuEditStore-C8S_EedM.js +38 -0
- package/dist/menuEditStore-CU7IAg3L.cjs +1 -0
- package/dist/notesStore-DKRgTTFn.js +36 -0
- package/dist/notesStore-zKmChTfF.cjs +1 -0
- package/dist/react-DYmzHD0X.js +27 -0
- package/dist/react-Dldg32sN.cjs +1 -0
- package/dist/settingsAppStore-BrlImdAH.cjs +1 -0
- package/dist/settingsAppStore-KOeWRO6h.js +29 -0
- package/dist/terminalStore-LWWjCvCe.js +30 -0
- package/dist/terminalStore-fZe5t7Ty.cjs +1 -0
- package/dist/use-merged-ref-BI9n1hUK.cjs +1 -0
- package/dist/use-merged-ref-BT8_u6vW.js +25 -0
- package/dist/use-resolved-styles-api-AVDygMKo.cjs +1 -0
- package/dist/use-resolved-styles-api-pEOi2wiK.js +21 -0
- package/dist/use-uncontrolled-A4hm9ATM.js +23 -0
- package/dist/use-uncontrolled-BPrfGv0W.cjs +1 -0
- package/dist/useAdaptiveDimensions-Btp0m5Pm.cjs +1 -0
- package/dist/useAdaptiveDimensions-CunsU0mn.js +40 -0
- package/dist/useCloseInterceptor-CuKAAFnj.js +51 -0
- package/dist/useCloseInterceptor-a_6Lcuqj.cjs +1 -0
- package/dist/useDynamicIcon-GJg3vWsJ.js +22 -0
- package/dist/useDynamicIcon-SytdL1Tu.cjs +1 -0
- package/dist/useMenuBarUtils-Bp5PiztD.cjs +1 -0
- package/dist/useMenuBarUtils-ChmpZjwu.js +6 -0
- package/dist/useOpenApp-BdarhIgl.cjs +1 -0
- package/dist/useOpenApp-JHCPTBWa.js +279 -0
- package/dist/useResolvedUrl-Be5ZlCX7.cjs +1 -0
- package/dist/useResolvedUrl-DFKXq598.js +30 -0
- package/dist/useTranslation-DMRGdqZi.js +279 -0
- package/dist/useTranslation-D_O7S4RJ.cjs +1 -0
- package/dist/vsc-Ciibqbxo.cjs +1 -0
- package/dist/vsc-DGKSpOAR.js +9574 -0
- package/package.json +7 -3
- package/dist/CalendarApp-CHLUCAI7.css +0 -744
- package/dist/CalendarApp-K7ZOUZ6C.js +0 -2
- package/dist/CalendarApp-OTGEERSS.cjs +0 -8
- package/dist/CodeServerApp-5KZGO7HL.css +0 -75
- package/dist/CodeServerApp-LUZFCQBI.js +0 -3
- package/dist/CodeServerApp-P3TMJPLY.cjs +0 -9
- package/dist/CreateItemApp-ESQ42VHH.js +0 -8
- package/dist/CreateItemApp-PQB5GTFG.css +0 -107
- package/dist/CreateItemApp-RFE3REWZ.cjs +0 -14
- package/dist/DeviceInfoApp-XNIS6ZY6.js +0 -5
- package/dist/DeviceInfoApp-ZNLQNOKI.cjs +0 -11
- package/dist/DeviceInfoApp-ZSMRSITP.css +0 -7
- package/dist/FilesApp-4GEU64QN.js +0 -8
- package/dist/FilesApp-E6L5W3T2.css +0 -1817
- package/dist/FilesApp-QSLB5IWR.cjs +0 -14
- package/dist/ImageViewerApp-N2Q7E7WZ.css +0 -215
- package/dist/ImageViewerApp-NCVDKLB3.js +0 -11
- package/dist/ImageViewerApp-QB373H5Z.cjs +0 -17
- package/dist/ImageViewerMenuBar-I3TFKQPS.cjs +0 -14
- package/dist/ImageViewerMenuBar-TV5C6TM2.js +0 -5
- package/dist/ImageViewerMenuBar-XLK4LIHW.css +0 -56
- package/dist/MenuEditApp-5EFYAPFC.cjs +0 -15
- package/dist/MenuEditApp-V5XOPIHX.js +0 -9
- package/dist/MenuEditApp-YA6HSAMJ.css +0 -94
- package/dist/MenuEditMenuBar-7VHMZNRM.css +0 -56
- package/dist/MenuEditMenuBar-GF6L4PGZ.cjs +0 -15
- package/dist/MenuEditMenuBar-IUXFPZE5.js +0 -6
- package/dist/NotesApp-2YNT7Y3D.js +0 -10
- package/dist/NotesApp-IAEE7YHU.cjs +0 -16
- package/dist/NotesApp-TQ6IHDNX.css +0 -302
- package/dist/NotesMenuBar-25LKN3SE.cjs +0 -15
- package/dist/NotesMenuBar-MXLOX7OT.css +0 -56
- package/dist/NotesMenuBar-SRV3AIAL.js +0 -6
- package/dist/PdfApp-67XIX6AM.js +0 -10
- package/dist/PdfApp-BUIC5U5H.css +0 -206
- package/dist/PdfApp-GZ6RHTBR.cjs +0 -16
- package/dist/PdfMenuBar-NLZC6JHS.js +0 -4
- package/dist/PdfMenuBar-QUM72EE4.css +0 -56
- package/dist/PdfMenuBar-WBRTKMLN.cjs +0 -13
- package/dist/SettingsApp-BPLMGPNK.cjs +0 -20
- package/dist/SettingsApp-JVOSEFH3.css +0 -283
- package/dist/SettingsApp-LUDIXCYY.js +0 -14
- package/dist/SettingsMenuBar-5CBSSMVM.css +0 -56
- package/dist/SettingsMenuBar-VLT6TTCM.js +0 -6
- package/dist/SettingsMenuBar-Y5QEXDEO.cjs +0 -15
- package/dist/StorybookApp-NQ244BER.css +0 -7
- package/dist/StorybookApp-NZDV4X3Y.js +0 -1
- package/dist/StorybookApp-VF3KIMU3.cjs +0 -7
- package/dist/TerminalApp-CDGWRBFJ.cjs +0 -10
- package/dist/TerminalApp-EAATMIMX.css +0 -77
- package/dist/TerminalApp-GCKJCM55.js +0 -4
- package/dist/TerminalMenuBar-3J26O26Q.css +0 -56
- package/dist/TerminalMenuBar-7BH7MGNJ.cjs +0 -14
- package/dist/TerminalMenuBar-7JAEQUZ4.js +0 -5
- package/dist/UploaderApp-6KV3TGCT.css +0 -1817
- package/dist/UploaderApp-FJC2J4I5.js +0 -10
- package/dist/UploaderApp-HLXJYJZQ.cjs +0 -16
- package/dist/chunk-2PSTHGTD.cjs +0 -42
- package/dist/chunk-2RQX7QBP.cjs +0 -148
- package/dist/chunk-43W6UDUZ.cjs +0 -19
- package/dist/chunk-4E45FBAH.js +0 -223
- package/dist/chunk-4E4U2A25.cjs +0 -237
- package/dist/chunk-4QHX7CMN.cjs +0 -38
- package/dist/chunk-4XURSNM4.js +0 -43
- package/dist/chunk-4ZCRYHL6.js +0 -407
- package/dist/chunk-5C6IQE42.cjs +0 -35
- package/dist/chunk-5HUYQDQF.js +0 -36
- package/dist/chunk-5NOHYJNH.js +0 -84
- package/dist/chunk-5QFZW6HW.js +0 -2241
- package/dist/chunk-5YH6AKEO.js +0 -146
- package/dist/chunk-756GPSPM.js +0 -283
- package/dist/chunk-7WUYUTPN.js +0 -2293
- package/dist/chunk-7XCMBW64.js +0 -162
- package/dist/chunk-7Y7HB7FB.cjs +0 -53
- package/dist/chunk-ABIAPZ6S.cjs +0 -45
- package/dist/chunk-ACHGJKCI.cjs +0 -286
- package/dist/chunk-BQCD5RAF.cjs +0 -48
- package/dist/chunk-BQL3YXMV.js +0 -17429
- package/dist/chunk-C3XER4N3.js +0 -442
- package/dist/chunk-C6BEZNAM.cjs +0 -45
- package/dist/chunk-CILU6BWC.cjs +0 -548
- package/dist/chunk-CV5PUHAE.cjs +0 -86
- package/dist/chunk-D5MVFFID.js +0 -42
- package/dist/chunk-D7R55WWT.js +0 -1601
- package/dist/chunk-DFYDUXWP.cjs +0 -34
- package/dist/chunk-DWP2SYF7.js +0 -55
- package/dist/chunk-E55VXNLK.cjs +0 -17498
- package/dist/chunk-E5FW77FG.js +0 -77
- package/dist/chunk-EAELL43F.js +0 -42
- package/dist/chunk-EX5V2ZTU.js +0 -40
- package/dist/chunk-FD7QZCTN.cjs +0 -2329
- package/dist/chunk-FH4ILMKF.js +0 -38
- package/dist/chunk-FRHBM2U7.js +0 -33
- package/dist/chunk-FX2TPX3L.cjs +0 -45
- package/dist/chunk-GPXNLTPI.cjs +0 -451
- package/dist/chunk-GRYCUBJZ.js +0 -9
- package/dist/chunk-HPHHS7FJ.cjs +0 -49
- package/dist/chunk-HWHBSAUC.js +0 -40
- package/dist/chunk-IDHP3R4I.js +0 -31
- package/dist/chunk-IHWGT3DL.js +0 -86
- package/dist/chunk-JEBKLIMU.cjs +0 -123
- package/dist/chunk-KDZLBI6F.cjs +0 -324
- package/dist/chunk-KQHICFX3.js +0 -121
- package/dist/chunk-LMJE6V4N.cjs +0 -42
- package/dist/chunk-MCHPDWVH.js +0 -444
- package/dist/chunk-MVDGM5Y4.js +0 -68
- package/dist/chunk-N36HBL53.cjs +0 -165
- package/dist/chunk-NV5GNFA3.js +0 -541
- package/dist/chunk-NVEGEK3N.js +0 -31
- package/dist/chunk-OJIDKDKF.js +0 -68
- package/dist/chunk-PGGNSLM7.js +0 -215
- package/dist/chunk-PKPQA5NR.js +0 -15
- package/dist/chunk-PNDBLFJW.cjs +0 -50
- package/dist/chunk-Q3WA72BF.cjs +0 -70
- package/dist/chunk-RDIDAZ3S.cjs +0 -9
- package/dist/chunk-RGJPRXYY.js +0 -48
- package/dist/chunk-RPSYXORB.cjs +0 -219
- package/dist/chunk-RQ6OZRUW.cjs +0 -41
- package/dist/chunk-SBE4SZAN.cjs +0 -226
- package/dist/chunk-TAFNCDUI.js +0 -234
- package/dist/chunk-TFIDSENE.cjs +0 -88
- package/dist/chunk-TGWMOHAO.js +0 -17
- package/dist/chunk-UA6XSTW6.js +0 -48
- package/dist/chunk-UIQCTAVM.cjs +0 -59
- package/dist/chunk-UKYESVDS.cjs +0 -50
- package/dist/chunk-V4N255NL.cjs +0 -2309
- package/dist/chunk-VO6KXO2I.js +0 -32
- package/dist/chunk-WXSTSC3D.cjs +0 -83
- package/dist/chunk-XSK7BWYO.js +0 -47
- package/dist/chunk-XVAPJ4PP.cjs +0 -449
- package/dist/chunk-XVASHRCE.cjs +0 -70
- package/dist/chunk-XYSMVQQD.cjs +0 -1608
- package/dist/chunk-YAIWI4Z5.js +0 -7
- package/dist/chunk-YGYOLDKR.js +0 -280
- package/dist/chunk-YP2PLNOF.cjs +0 -34
- package/dist/chunk-YSOLW4FS.cjs +0 -11
- package/dist/chunk-YY6OUR2U.js +0 -44
- package/dist/chunk-YZWS7FDT.cjs +0 -409
- package/dist/chunk-Z5YGWL65.cjs +0 -39
- package/dist/chunk-ZHNDXNL4.js +0 -45
- package/dist/chunk-ZX3EDZ5C.cjs +0 -17
- package/dist/index.d.cts +0 -2019
package/dist/chunk-IDHP3R4I.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { create } from 'zustand';
|
|
2
|
-
|
|
3
|
-
// src/stores/factories/createWindowStateStore.ts
|
|
4
|
-
function createDirtyStateStore() {
|
|
5
|
-
const DEFAULT_STATE = { isDirty: false };
|
|
6
|
-
return create((set, get) => ({
|
|
7
|
-
states: {},
|
|
8
|
-
getIsDirty: (windowId) => get().states[windowId]?.isDirty ?? false,
|
|
9
|
-
setIsDirty: (windowId, isDirty) => {
|
|
10
|
-
const currentIsDirty = get().states[windowId]?.isDirty ?? false;
|
|
11
|
-
if (currentIsDirty === isDirty) return;
|
|
12
|
-
set((s) => ({
|
|
13
|
-
states: {
|
|
14
|
-
...s.states,
|
|
15
|
-
[windowId]: { ...s.states[windowId] ?? DEFAULT_STATE, isDirty }
|
|
16
|
-
}
|
|
17
|
-
}));
|
|
18
|
-
},
|
|
19
|
-
reset: (windowId) => {
|
|
20
|
-
set((s) => ({
|
|
21
|
-
states: { ...s.states, [windowId]: DEFAULT_STATE }
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// src/components/Apps/SettingsApp/settingsAppStore.ts
|
|
28
|
-
var useSettingsAppStore = createDirtyStateStore();
|
|
29
|
-
var useIsDirty = (windowId) => useSettingsAppStore((s) => s.states[windowId]?.isDirty ?? false);
|
|
30
|
-
|
|
31
|
-
export { useIsDirty, useSettingsAppStore };
|
package/dist/chunk-IHWGT3DL.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { useImageViewerStore } from './chunk-DWP2SYF7.js';
|
|
2
|
-
import { AppEmptyState_default } from './chunk-ZHNDXNL4.js';
|
|
3
|
-
import { useResolvedUrl } from './chunk-UA6XSTW6.js';
|
|
4
|
-
import { FilePickerModal } from './chunk-MCHPDWVH.js';
|
|
5
|
-
import { IMAGE_MIME_TYPES } from './chunk-5QFZW6HW.js';
|
|
6
|
-
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
7
|
-
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
-
|
|
10
|
-
// src/components/Apps/ImageViewerApp/ImageViewerApp.module.css
|
|
11
|
-
var ImageViewerApp_default = {};
|
|
12
|
-
var ACCEPTED_IMAGE_TYPES = [...IMAGE_MIME_TYPES, "image/*"];
|
|
13
|
-
var ImageViewerApp = ({ window, notifyReady }) => {
|
|
14
|
-
const { t } = useTranslation("apps");
|
|
15
|
-
const win = window;
|
|
16
|
-
const windowId = win?.id ?? "";
|
|
17
|
-
const initialSrc = win?.contentData?.src;
|
|
18
|
-
const [src, setSrc] = useState(initialSrc);
|
|
19
|
-
const [pickerOpen, setPickerOpen] = useState(false);
|
|
20
|
-
const [imageDimensions, setImageDimensions] = useState(null);
|
|
21
|
-
const containerRef = useRef(null);
|
|
22
|
-
const displayZoom = useImageViewerStore((s) => s.getDisplayZoom(windowId));
|
|
23
|
-
const fitToWindow = useImageViewerStore((s) => s.getFitToWindow(windowId));
|
|
24
|
-
const updateCalculatedZoom = useImageViewerStore((s) => s.updateCalculatedZoom);
|
|
25
|
-
const reset = useImageViewerStore((s) => s.reset);
|
|
26
|
-
const resolvedSrc = useResolvedUrl(src);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
reset(windowId);
|
|
29
|
-
}, [windowId, reset]);
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (!fitToWindow || !imageDimensions || !containerRef.current) return;
|
|
32
|
-
const observer = new ResizeObserver((entries) => {
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
const { width, height } = entry.contentRect;
|
|
35
|
-
updateCalculatedZoom(windowId, imageDimensions, { width, height });
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
observer.observe(containerRef.current);
|
|
39
|
-
return () => observer.disconnect();
|
|
40
|
-
}, [fitToWindow, imageDimensions, windowId, updateCalculatedZoom]);
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
notifyReady?.({
|
|
43
|
-
...win?.contentData ?? {},
|
|
44
|
-
setPickerOpen: () => setPickerOpen(true)
|
|
45
|
-
});
|
|
46
|
-
}, [win, notifyReady]);
|
|
47
|
-
const handleFileSelected = useCallback(
|
|
48
|
-
(node) => {
|
|
49
|
-
setSrc(node.url ?? node.name);
|
|
50
|
-
setPickerOpen(false);
|
|
51
|
-
reset(windowId);
|
|
52
|
-
setImageDimensions(null);
|
|
53
|
-
},
|
|
54
|
-
[windowId, reset]
|
|
55
|
-
);
|
|
56
|
-
const handleImageLoad = useCallback((e) => {
|
|
57
|
-
const img = e.currentTarget;
|
|
58
|
-
setImageDimensions({ width: img.naturalWidth, height: img.naturalHeight });
|
|
59
|
-
}, []);
|
|
60
|
-
const imgStyle = fitToWindow ? void 0 : { transform: `scale(${displayZoom / 100})` };
|
|
61
|
-
const content = resolvedSrc ? /* @__PURE__ */ jsx(
|
|
62
|
-
"img",
|
|
63
|
-
{
|
|
64
|
-
src: resolvedSrc,
|
|
65
|
-
alt: resolvedSrc.split("/").pop() ?? "image",
|
|
66
|
-
className: ImageViewerApp_default.image,
|
|
67
|
-
style: imgStyle,
|
|
68
|
-
onLoad: handleImageLoad
|
|
69
|
-
}
|
|
70
|
-
) : /* @__PURE__ */ jsx(AppEmptyState_default, { label: t("imageViewer.noImage") });
|
|
71
|
-
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: ImageViewerApp_default.container, "data-windowid": win?.id, children: [
|
|
72
|
-
content,
|
|
73
|
-
/* @__PURE__ */ jsx(
|
|
74
|
-
FilePickerModal,
|
|
75
|
-
{
|
|
76
|
-
opened: pickerOpen,
|
|
77
|
-
acceptedMimeTypes: ACCEPTED_IMAGE_TYPES,
|
|
78
|
-
onConfirm: handleFileSelected,
|
|
79
|
-
onCancel: () => setPickerOpen(false)
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
] });
|
|
83
|
-
};
|
|
84
|
-
var ImageViewerApp_default2 = ImageViewerApp;
|
|
85
|
-
|
|
86
|
-
export { ImageViewerApp_default2 as ImageViewerApp_default };
|
package/dist/chunk-JEBKLIMU.cjs
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkZ5YGWL65_cjs = require('./chunk-Z5YGWL65.cjs');
|
|
4
|
-
var chunkE55VXNLK_cjs = require('./chunk-E55VXNLK.cjs');
|
|
5
|
-
var react = require('react');
|
|
6
|
-
var fc = require('react-icons/fc');
|
|
7
|
-
var reactI18next = require('react-i18next');
|
|
8
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
|
|
10
|
-
var CodeServerNotSupported = () => {
|
|
11
|
-
const { t } = reactI18next.useTranslation("apps");
|
|
12
|
-
return /* @__PURE__ */ jsxRuntime.jsx(chunkE55VXNLK_cjs.Center, { "data-testid": "code-server-not-supported", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkE55VXNLK_cjs.Stack, { align: "center", gap: "lg", p: "xl", maw: 400, children: [
|
|
13
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkE55VXNLK_cjs.Text, { size: "3rem", children: /* @__PURE__ */ jsxRuntime.jsx(fc.FcInfo, {}) }),
|
|
14
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkE55VXNLK_cjs.Text, { size: "lg", fw: 700, ta: "center", children: t("codeServer.notAvailable") }),
|
|
15
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkE55VXNLK_cjs.Text, { size: "sm", c: "dimmed", ta: "center", children: t("codeServer.notAvailableMessage") }),
|
|
16
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkE55VXNLK_cjs.Text, { size: "sm", c: "dimmed", ta: "center", children: t("codeServer.dockerRequired") })
|
|
17
|
-
] }) });
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// src/components/Apps/CodeServerApp/CodeServerApp.module.css
|
|
21
|
-
var CodeServerApp_default = {};
|
|
22
|
-
var CodeServerAppInner = ({ window, notifyReady }) => {
|
|
23
|
-
const win = window;
|
|
24
|
-
const [state, setState] = react.useState({
|
|
25
|
-
status: "idle",
|
|
26
|
-
url: null,
|
|
27
|
-
error: null
|
|
28
|
-
});
|
|
29
|
-
const hasNotifiedRef = react.useRef(false);
|
|
30
|
-
const startingRef = react.useRef(false);
|
|
31
|
-
const startCodeServer = react.useCallback(async () => {
|
|
32
|
-
if (startingRef.current) return;
|
|
33
|
-
startingRef.current = true;
|
|
34
|
-
setState((prev) => ({ ...prev, status: "starting", error: null }));
|
|
35
|
-
try {
|
|
36
|
-
const response = await fetch("/api/code-server/start", { method: "POST" });
|
|
37
|
-
const data = await response.json();
|
|
38
|
-
if (data.success && data.url) {
|
|
39
|
-
setState({
|
|
40
|
-
status: "running",
|
|
41
|
-
url: data.url,
|
|
42
|
-
error: null
|
|
43
|
-
});
|
|
44
|
-
} else {
|
|
45
|
-
setState({
|
|
46
|
-
status: "error",
|
|
47
|
-
url: null,
|
|
48
|
-
error: data.error || "Failed to start code-server"
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
} catch (err) {
|
|
52
|
-
setState({
|
|
53
|
-
status: "error",
|
|
54
|
-
url: null,
|
|
55
|
-
error: err instanceof Error ? err.message : "Failed to start code-server"
|
|
56
|
-
});
|
|
57
|
-
} finally {
|
|
58
|
-
startingRef.current = false;
|
|
59
|
-
}
|
|
60
|
-
}, []);
|
|
61
|
-
const stopCodeServer = react.useCallback(async () => {
|
|
62
|
-
try {
|
|
63
|
-
await fetch("/api/code-server/stop", { method: "POST" });
|
|
64
|
-
} catch (err) {
|
|
65
|
-
console.error("[CodeServerApp] Error stopping code-server:", err);
|
|
66
|
-
}
|
|
67
|
-
}, []);
|
|
68
|
-
react.useEffect(() => {
|
|
69
|
-
startCodeServer();
|
|
70
|
-
return () => {
|
|
71
|
-
stopCodeServer();
|
|
72
|
-
};
|
|
73
|
-
}, [startCodeServer, stopCodeServer]);
|
|
74
|
-
react.useEffect(() => {
|
|
75
|
-
if (!hasNotifiedRef.current && notifyReady) {
|
|
76
|
-
hasNotifiedRef.current = true;
|
|
77
|
-
notifyReady({
|
|
78
|
-
...win?.contentData ?? {},
|
|
79
|
-
status: state.status,
|
|
80
|
-
restart: startCodeServer
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}, [notifyReady, state.status, startCodeServer, win?.contentData]);
|
|
84
|
-
react.useEffect(() => {
|
|
85
|
-
if (hasNotifiedRef.current && notifyReady) {
|
|
86
|
-
notifyReady({
|
|
87
|
-
...win?.contentData ?? {},
|
|
88
|
-
status: state.status
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}, [state.status, notifyReady, win?.contentData]);
|
|
92
|
-
if (state.status === "idle" || state.status === "starting") {
|
|
93
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: CodeServerApp_default.loading, children: [
|
|
94
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: CodeServerApp_default.spinner }),
|
|
95
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { children: "Starting VS Code..." })
|
|
96
|
-
] }) });
|
|
97
|
-
}
|
|
98
|
-
if (state.status === "error") {
|
|
99
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: CodeServerApp_default.error, children: [
|
|
100
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { children: "Failed to start VS Code" }),
|
|
101
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { children: state.error }),
|
|
102
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { onClick: startCodeServer, className: CodeServerApp_default.retryButton, children: "Retry" })
|
|
103
|
-
] }) });
|
|
104
|
-
}
|
|
105
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
|
-
"iframe",
|
|
107
|
-
{
|
|
108
|
-
src: state.url || "",
|
|
109
|
-
className: CodeServerApp_default.iframe,
|
|
110
|
-
title: "VS Code",
|
|
111
|
-
allow: "clipboard-read; clipboard-write"
|
|
112
|
-
}
|
|
113
|
-
) });
|
|
114
|
-
};
|
|
115
|
-
var CodeServerApp = (props) => {
|
|
116
|
-
if (!chunkZ5YGWL65_cjs.isDocker()) {
|
|
117
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CodeServerNotSupported, {});
|
|
118
|
-
}
|
|
119
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CodeServerAppInner, { ...props });
|
|
120
|
-
};
|
|
121
|
-
var CodeServerApp_default2 = CodeServerApp;
|
|
122
|
-
|
|
123
|
-
exports.CodeServerApp_default = CodeServerApp_default2;
|
package/dist/chunk-KDZLBI6F.cjs
DELETED
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunk4QHX7CMN_cjs = require('./chunk-4QHX7CMN.cjs');
|
|
4
|
-
var chunkV4N255NL_cjs = require('./chunk-V4N255NL.cjs');
|
|
5
|
-
var react = require('react');
|
|
6
|
-
|
|
7
|
-
// src/constants/Animations.ts
|
|
8
|
-
var ANIMATION_DURATION = 0.3;
|
|
9
|
-
var createEaseIn = (duration) => ({
|
|
10
|
-
duration,
|
|
11
|
-
ease: "easeIn"
|
|
12
|
-
});
|
|
13
|
-
var createEaseOut = (duration) => ({
|
|
14
|
-
duration,
|
|
15
|
-
ease: "easeOut"
|
|
16
|
-
});
|
|
17
|
-
var createWindowVariants = (duration) => ({
|
|
18
|
-
hidden: { opacity: 0, scale: 0.92, y: 12 },
|
|
19
|
-
visible: { opacity: 1, scale: 1, y: 0, transition: createEaseOut(duration) },
|
|
20
|
-
exit: { opacity: 0, scale: 0.92, y: 12, transition: createEaseIn(duration) }
|
|
21
|
-
});
|
|
22
|
-
var createPanelVariants = (duration) => ({
|
|
23
|
-
initial: { opacity: 0, y: 8, scale: 0.96 },
|
|
24
|
-
animate: { opacity: 1, y: 0, scale: 1, transition: createEaseOut(duration) },
|
|
25
|
-
exit: { opacity: 0, y: 8, scale: 0.96, transition: createEaseIn(duration) }
|
|
26
|
-
});
|
|
27
|
-
var createMinimizeVariant = (duration) => (deltaX, deltaY) => ({
|
|
28
|
-
opacity: 0,
|
|
29
|
-
scale: 0.1,
|
|
30
|
-
x: deltaX,
|
|
31
|
-
y: deltaY,
|
|
32
|
-
transition: { duration, ease: [0.4, 0, 1, 1] }
|
|
33
|
-
});
|
|
34
|
-
var createRestoreVariant = (duration) => (deltaX, deltaY) => ({
|
|
35
|
-
opacity: [0, 1],
|
|
36
|
-
scale: [0.1, 1],
|
|
37
|
-
x: [deltaX, 0],
|
|
38
|
-
y: [deltaY, 0],
|
|
39
|
-
transition: { duration, ease: [0, 0, 0.2, 1] }
|
|
40
|
-
});
|
|
41
|
-
var createMaximizeTransition = (duration) => ({
|
|
42
|
-
duration,
|
|
43
|
-
ease: "easeOut"
|
|
44
|
-
});
|
|
45
|
-
var EASE_IN = { duration: ANIMATION_DURATION, ease: "easeIn" };
|
|
46
|
-
var EASE_OUT = { duration: ANIMATION_DURATION, ease: "easeOut" };
|
|
47
|
-
var windowVariants = createWindowVariants(ANIMATION_DURATION);
|
|
48
|
-
var panelVariants = createPanelVariants(ANIMATION_DURATION);
|
|
49
|
-
var minimizeVariant = createMinimizeVariant(0.3);
|
|
50
|
-
var restoreVariant = createRestoreVariant(0.3);
|
|
51
|
-
var openVariants = {
|
|
52
|
-
scale: {
|
|
53
|
-
hidden: { opacity: 0, scale: 0.92, y: 12 },
|
|
54
|
-
visible: { opacity: 1, scale: 1, y: 0, transition: EASE_OUT }
|
|
55
|
-
},
|
|
56
|
-
slide: {
|
|
57
|
-
hidden: { opacity: 0, y: 40 },
|
|
58
|
-
visible: { opacity: 1, y: 0, transition: EASE_OUT }
|
|
59
|
-
},
|
|
60
|
-
fade: {
|
|
61
|
-
hidden: { opacity: 0 },
|
|
62
|
-
visible: { opacity: 1, transition: EASE_OUT }
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
var maximizeTransition = { duration: 0.25, ease: "easeOut" };
|
|
66
|
-
var randomWindowPosition = () => ({
|
|
67
|
-
x: 150 + Math.random() * 200,
|
|
68
|
-
y: 80 + Math.random() * 100
|
|
69
|
-
});
|
|
70
|
-
var centerWindowPosition = (viewportWidth, viewportHeight, windowWidth, windowHeight) => ({
|
|
71
|
-
x: Math.round((viewportWidth - windowWidth) / 2),
|
|
72
|
-
y: Math.round((viewportHeight - windowHeight) / 2)
|
|
73
|
-
});
|
|
74
|
-
var FilesAppLazy = react.lazy(() => import('./FilesApp-QSLB5IWR.cjs'));
|
|
75
|
-
var NotesAppLazy = react.lazy(() => import('./NotesApp-IAEE7YHU.cjs'));
|
|
76
|
-
var ImageViewerAppLazy = react.lazy(() => import('./ImageViewerApp-QB373H5Z.cjs'));
|
|
77
|
-
var PdfAppLazy = react.lazy(() => import('./PdfApp-GZ6RHTBR.cjs'));
|
|
78
|
-
var MenuEditAppLazy = react.lazy(() => import('./MenuEditApp-5EFYAPFC.cjs'));
|
|
79
|
-
var UploaderAppLazy = react.lazy(() => import('./UploaderApp-HLXJYJZQ.cjs'));
|
|
80
|
-
var SettingsAppLazy = react.lazy(() => import('./SettingsApp-BPLMGPNK.cjs'));
|
|
81
|
-
var DeviceInfoAppLazy = react.lazy(() => import('./DeviceInfoApp-ZNLQNOKI.cjs'));
|
|
82
|
-
var CalendarAppLazy = react.lazy(() => import('./CalendarApp-OTGEERSS.cjs'));
|
|
83
|
-
var CreateItemAppLazy = react.lazy(() => import('./CreateItemApp-RFE3REWZ.cjs'));
|
|
84
|
-
var NotesMenuBarLazy = react.lazy(
|
|
85
|
-
() => import('./NotesMenuBar-25LKN3SE.cjs').then((m) => ({ default: m.NotesMenuBar }))
|
|
86
|
-
);
|
|
87
|
-
var MenuEditMenuBarLazy = react.lazy(
|
|
88
|
-
() => import('./MenuEditMenuBar-GF6L4PGZ.cjs').then((m) => ({ default: m.MenuEditMenuBar }))
|
|
89
|
-
);
|
|
90
|
-
var SettingsMenuBarLazy = react.lazy(
|
|
91
|
-
() => import('./SettingsMenuBar-Y5QEXDEO.cjs').then((m) => ({ default: m.SettingsMenuBar }))
|
|
92
|
-
);
|
|
93
|
-
var PdfMenuBarLazy = react.lazy(
|
|
94
|
-
() => import('./PdfMenuBar-WBRTKMLN.cjs').then((m) => ({ default: m.PdfMenuBar }))
|
|
95
|
-
);
|
|
96
|
-
var ImageViewerMenuBarLazy = react.lazy(
|
|
97
|
-
() => import('./ImageViewerMenuBar-I3TFKQPS.cjs').then((m) => ({
|
|
98
|
-
default: m.ImageViewerMenuBar
|
|
99
|
-
}))
|
|
100
|
-
);
|
|
101
|
-
var TerminalAppLazy = react.lazy(() => import('./TerminalApp-CDGWRBFJ.cjs'));
|
|
102
|
-
var TerminalMenuBarLazy = react.lazy(
|
|
103
|
-
() => import('./TerminalMenuBar-7BH7MGNJ.cjs').then((m) => ({ default: m.TerminalMenuBar }))
|
|
104
|
-
);
|
|
105
|
-
var CodeServerAppLazy = react.lazy(() => import('./CodeServerApp-P3TMJPLY.cjs'));
|
|
106
|
-
var StorybookAppLazy = react.lazy(() => import('./StorybookApp-VF3KIMU3.cjs'));
|
|
107
|
-
|
|
108
|
-
// src/components/Window/helperRegistry.ts
|
|
109
|
-
var _registry = null;
|
|
110
|
-
var NULL_COMPONENT = (() => null);
|
|
111
|
-
function resolveEntry(entry) {
|
|
112
|
-
return {
|
|
113
|
-
...entry,
|
|
114
|
-
component: entry.component ?? (entry.loader ? react.lazy(entry.loader) : void 0),
|
|
115
|
-
MenuBarComponent: entry.MenuBarComponent ?? (entry.menuBarLoader ? react.lazy(entry.menuBarLoader) : void 0)
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
function initRegistry(registry) {
|
|
119
|
-
_registry = {};
|
|
120
|
-
for (const [key, entry] of Object.entries(registry)) {
|
|
121
|
-
_registry[key] = resolveEntry(entry);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
function getAppComponent(content) {
|
|
125
|
-
if (!_registry) {
|
|
126
|
-
console.warn(`[AppRegistry] Registry not initialized, requested app: ${content}`);
|
|
127
|
-
return NULL_COMPONENT;
|
|
128
|
-
}
|
|
129
|
-
const component = _registry[content]?.component;
|
|
130
|
-
if (!component) {
|
|
131
|
-
console.warn(`[AppRegistry] App not found: ${content}`);
|
|
132
|
-
return NULL_COMPONENT;
|
|
133
|
-
}
|
|
134
|
-
return component;
|
|
135
|
-
}
|
|
136
|
-
function getMenuBarBuilder(content) {
|
|
137
|
-
return _registry?.[content]?.buildMenuBar;
|
|
138
|
-
}
|
|
139
|
-
function getMenuBarComponent(content) {
|
|
140
|
-
return _registry?.[content]?.MenuBarComponent;
|
|
141
|
-
}
|
|
142
|
-
function isLazyApp(content) {
|
|
143
|
-
return _registry?.[content]?.isLazy ?? false;
|
|
144
|
-
}
|
|
145
|
-
function getAppName(content) {
|
|
146
|
-
return _registry?.[content]?.appName;
|
|
147
|
-
}
|
|
148
|
-
function getRegistryEntry(content) {
|
|
149
|
-
return _registry?.[content];
|
|
150
|
-
}
|
|
151
|
-
function registerComponents(entries) {
|
|
152
|
-
if (!_registry) _registry = {};
|
|
153
|
-
for (const [key, entry] of Object.entries(entries)) {
|
|
154
|
-
_registry[key] = resolveEntry(entry);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
var CORE_REGISTRY = {};
|
|
158
|
-
function initCoreRegistry() {
|
|
159
|
-
const entries = {
|
|
160
|
-
files: {
|
|
161
|
-
component: FilesAppLazy,
|
|
162
|
-
appName: "Files",
|
|
163
|
-
isLazy: true
|
|
164
|
-
},
|
|
165
|
-
settings: {
|
|
166
|
-
component: SettingsAppLazy,
|
|
167
|
-
MenuBarComponent: SettingsMenuBarLazy,
|
|
168
|
-
appName: "Settings",
|
|
169
|
-
isLazy: true
|
|
170
|
-
},
|
|
171
|
-
pdf: {
|
|
172
|
-
component: PdfAppLazy,
|
|
173
|
-
MenuBarComponent: PdfMenuBarLazy,
|
|
174
|
-
appName: "PDF",
|
|
175
|
-
isLazy: true
|
|
176
|
-
},
|
|
177
|
-
"image-viewer": {
|
|
178
|
-
component: ImageViewerAppLazy,
|
|
179
|
-
MenuBarComponent: ImageViewerMenuBarLazy,
|
|
180
|
-
appName: "Image Viewer",
|
|
181
|
-
isLazy: true
|
|
182
|
-
},
|
|
183
|
-
uploader: {
|
|
184
|
-
component: UploaderAppLazy,
|
|
185
|
-
appName: "Uploader",
|
|
186
|
-
isLazy: true
|
|
187
|
-
},
|
|
188
|
-
createItem: {
|
|
189
|
-
component: CreateItemAppLazy,
|
|
190
|
-
appName: "Create Item",
|
|
191
|
-
isLazy: true
|
|
192
|
-
},
|
|
193
|
-
"device-info": {
|
|
194
|
-
component: DeviceInfoAppLazy,
|
|
195
|
-
appName: "Device Info",
|
|
196
|
-
isLazy: true
|
|
197
|
-
},
|
|
198
|
-
menuedit: {
|
|
199
|
-
component: MenuEditAppLazy,
|
|
200
|
-
MenuBarComponent: MenuEditMenuBarLazy,
|
|
201
|
-
appName: "Menu Editor",
|
|
202
|
-
isLazy: true
|
|
203
|
-
},
|
|
204
|
-
notepad: {
|
|
205
|
-
component: NotesAppLazy,
|
|
206
|
-
MenuBarComponent: NotesMenuBarLazy,
|
|
207
|
-
appName: "Notepad",
|
|
208
|
-
isLazy: true
|
|
209
|
-
},
|
|
210
|
-
calendar: {
|
|
211
|
-
component: CalendarAppLazy,
|
|
212
|
-
appName: "Calendar",
|
|
213
|
-
isLazy: true
|
|
214
|
-
},
|
|
215
|
-
terminal: {
|
|
216
|
-
component: TerminalAppLazy,
|
|
217
|
-
MenuBarComponent: TerminalMenuBarLazy,
|
|
218
|
-
appName: "Terminal",
|
|
219
|
-
isLazy: true
|
|
220
|
-
},
|
|
221
|
-
"code-server": {
|
|
222
|
-
component: CodeServerAppLazy,
|
|
223
|
-
appName: "VS Code",
|
|
224
|
-
isLazy: true
|
|
225
|
-
},
|
|
226
|
-
storybook: {
|
|
227
|
-
component: StorybookAppLazy,
|
|
228
|
-
appName: "Storybook",
|
|
229
|
-
isLazy: true
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
Object.assign(CORE_REGISTRY, entries);
|
|
233
|
-
registerComponents(entries);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// src/hooks/useOpenApp.ts
|
|
237
|
-
var useOpenApp = () => {
|
|
238
|
-
const openWindow = chunkV4N255NL_cjs.useDesktopStore((state) => state.openWindow);
|
|
239
|
-
const focusWindow = chunkV4N255NL_cjs.useDesktopStore((state) => state.focusWindow);
|
|
240
|
-
const windows = chunkV4N255NL_cjs.useDesktopStore((state) => state.windows);
|
|
241
|
-
const customApps = chunkV4N255NL_cjs.useDesktopStore((state) => state.customApps);
|
|
242
|
-
const adaptiveDimensions = chunk4QHX7CMN_cjs.useAdaptiveDimensions();
|
|
243
|
-
return react.useCallback(
|
|
244
|
-
(appId, { contentData, position } = {}) => {
|
|
245
|
-
const app = chunkV4N255NL_cjs.APPS.find((a) => a.id === appId);
|
|
246
|
-
const customApp = customApps.find((a) => a.id === appId);
|
|
247
|
-
const registryEntry = getRegistryEntry(appId);
|
|
248
|
-
const isSingleWindow = app?.singleWindow === true || customApp?.window?.singleWindow === true || registryEntry?.singleWindow === true;
|
|
249
|
-
if (isSingleWindow) {
|
|
250
|
-
const existingWindow = windows.find((w) => w.content === appId);
|
|
251
|
-
if (existingWindow) {
|
|
252
|
-
focusWindow(existingWindow.id);
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
const { x, y } = position ?? randomWindowPosition();
|
|
257
|
-
openWindow({
|
|
258
|
-
title: app?.name ?? registryEntry?.appName ?? customApp?.name ?? appId.charAt(0).toUpperCase() + appId.slice(1),
|
|
259
|
-
content: appId,
|
|
260
|
-
icon: app?.icon ?? registryEntry?.icon ?? customApp?.icon,
|
|
261
|
-
fcIcon: app?.fcIcon ?? registryEntry?.fcIcon,
|
|
262
|
-
iconUrl: app?.iconUrl ?? registryEntry?.iconUrl,
|
|
263
|
-
iconColor: app?.iconColor ?? registryEntry?.iconColor,
|
|
264
|
-
canMaximize: app?.canMaximize ?? registryEntry?.canMaximize ?? customApp?.window?.canMaximize,
|
|
265
|
-
x,
|
|
266
|
-
y,
|
|
267
|
-
width: app?.defaultWidth ?? registryEntry?.defaultWidth ?? customApp?.window?.defaultWidth ?? adaptiveDimensions.defaultWidth,
|
|
268
|
-
height: app?.defaultHeight ?? registryEntry?.defaultHeight ?? customApp?.window?.defaultHeight ?? adaptiveDimensions.defaultHeight,
|
|
269
|
-
minWidth: app?.minWidth === false || registryEntry?.minWidth === false || customApp?.window?.minWidth === false ? void 0 : app?.minWidth ?? registryEntry?.minWidth ?? customApp?.window?.minWidth ?? adaptiveDimensions.minWidth,
|
|
270
|
-
minHeight: app?.minHeight === false || registryEntry?.minHeight === false || customApp?.window?.minHeight === false ? void 0 : app?.minHeight ?? registryEntry?.minHeight ?? customApp?.window?.minHeight ?? adaptiveDimensions.minHeight,
|
|
271
|
-
contentData: {
|
|
272
|
-
...contentData,
|
|
273
|
-
...app?.autoLoad ? { autoLoad: app.autoLoad } : {}
|
|
274
|
-
},
|
|
275
|
-
alwaysOnTop: app?.alwaysOnTop ?? registryEntry?.alwaysOnTop
|
|
276
|
-
});
|
|
277
|
-
},
|
|
278
|
-
[openWindow, focusWindow, windows, customApps, adaptiveDimensions]
|
|
279
|
-
);
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
exports.ANIMATION_DURATION = ANIMATION_DURATION;
|
|
283
|
-
exports.CORE_REGISTRY = CORE_REGISTRY;
|
|
284
|
-
exports.CalendarAppLazy = CalendarAppLazy;
|
|
285
|
-
exports.CreateItemAppLazy = CreateItemAppLazy;
|
|
286
|
-
exports.DeviceInfoAppLazy = DeviceInfoAppLazy;
|
|
287
|
-
exports.EASE_IN = EASE_IN;
|
|
288
|
-
exports.EASE_OUT = EASE_OUT;
|
|
289
|
-
exports.FilesAppLazy = FilesAppLazy;
|
|
290
|
-
exports.ImageViewerAppLazy = ImageViewerAppLazy;
|
|
291
|
-
exports.ImageViewerMenuBarLazy = ImageViewerMenuBarLazy;
|
|
292
|
-
exports.MenuEditAppLazy = MenuEditAppLazy;
|
|
293
|
-
exports.MenuEditMenuBarLazy = MenuEditMenuBarLazy;
|
|
294
|
-
exports.NotesAppLazy = NotesAppLazy;
|
|
295
|
-
exports.NotesMenuBarLazy = NotesMenuBarLazy;
|
|
296
|
-
exports.PdfAppLazy = PdfAppLazy;
|
|
297
|
-
exports.PdfMenuBarLazy = PdfMenuBarLazy;
|
|
298
|
-
exports.SettingsAppLazy = SettingsAppLazy;
|
|
299
|
-
exports.SettingsMenuBarLazy = SettingsMenuBarLazy;
|
|
300
|
-
exports.UploaderAppLazy = UploaderAppLazy;
|
|
301
|
-
exports.centerWindowPosition = centerWindowPosition;
|
|
302
|
-
exports.createEaseIn = createEaseIn;
|
|
303
|
-
exports.createEaseOut = createEaseOut;
|
|
304
|
-
exports.createMaximizeTransition = createMaximizeTransition;
|
|
305
|
-
exports.createMinimizeVariant = createMinimizeVariant;
|
|
306
|
-
exports.createPanelVariants = createPanelVariants;
|
|
307
|
-
exports.createRestoreVariant = createRestoreVariant;
|
|
308
|
-
exports.createWindowVariants = createWindowVariants;
|
|
309
|
-
exports.getAppComponent = getAppComponent;
|
|
310
|
-
exports.getAppName = getAppName;
|
|
311
|
-
exports.getMenuBarBuilder = getMenuBarBuilder;
|
|
312
|
-
exports.getMenuBarComponent = getMenuBarComponent;
|
|
313
|
-
exports.initCoreRegistry = initCoreRegistry;
|
|
314
|
-
exports.initRegistry = initRegistry;
|
|
315
|
-
exports.isLazyApp = isLazyApp;
|
|
316
|
-
exports.maximizeTransition = maximizeTransition;
|
|
317
|
-
exports.minimizeVariant = minimizeVariant;
|
|
318
|
-
exports.openVariants = openVariants;
|
|
319
|
-
exports.panelVariants = panelVariants;
|
|
320
|
-
exports.randomWindowPosition = randomWindowPosition;
|
|
321
|
-
exports.registerComponents = registerComponents;
|
|
322
|
-
exports.restoreVariant = restoreVariant;
|
|
323
|
-
exports.useOpenApp = useOpenApp;
|
|
324
|
-
exports.windowVariants = windowVariants;
|
package/dist/chunk-KQHICFX3.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { isDocker } from './chunk-FRHBM2U7.js';
|
|
2
|
-
import { Center, Stack, Text } from './chunk-BQL3YXMV.js';
|
|
3
|
-
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
4
|
-
import { FcInfo } from 'react-icons/fc';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
var CodeServerNotSupported = () => {
|
|
9
|
-
const { t } = useTranslation("apps");
|
|
10
|
-
return /* @__PURE__ */ jsx(Center, { "data-testid": "code-server-not-supported", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxs(Stack, { align: "center", gap: "lg", p: "xl", maw: 400, children: [
|
|
11
|
-
/* @__PURE__ */ jsx(Text, { size: "3rem", children: /* @__PURE__ */ jsx(FcInfo, {}) }),
|
|
12
|
-
/* @__PURE__ */ jsx(Text, { size: "lg", fw: 700, ta: "center", children: t("codeServer.notAvailable") }),
|
|
13
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", ta: "center", children: t("codeServer.notAvailableMessage") }),
|
|
14
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", ta: "center", children: t("codeServer.dockerRequired") })
|
|
15
|
-
] }) });
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// src/components/Apps/CodeServerApp/CodeServerApp.module.css
|
|
19
|
-
var CodeServerApp_default = {};
|
|
20
|
-
var CodeServerAppInner = ({ window, notifyReady }) => {
|
|
21
|
-
const win = window;
|
|
22
|
-
const [state, setState] = useState({
|
|
23
|
-
status: "idle",
|
|
24
|
-
url: null,
|
|
25
|
-
error: null
|
|
26
|
-
});
|
|
27
|
-
const hasNotifiedRef = useRef(false);
|
|
28
|
-
const startingRef = useRef(false);
|
|
29
|
-
const startCodeServer = useCallback(async () => {
|
|
30
|
-
if (startingRef.current) return;
|
|
31
|
-
startingRef.current = true;
|
|
32
|
-
setState((prev) => ({ ...prev, status: "starting", error: null }));
|
|
33
|
-
try {
|
|
34
|
-
const response = await fetch("/api/code-server/start", { method: "POST" });
|
|
35
|
-
const data = await response.json();
|
|
36
|
-
if (data.success && data.url) {
|
|
37
|
-
setState({
|
|
38
|
-
status: "running",
|
|
39
|
-
url: data.url,
|
|
40
|
-
error: null
|
|
41
|
-
});
|
|
42
|
-
} else {
|
|
43
|
-
setState({
|
|
44
|
-
status: "error",
|
|
45
|
-
url: null,
|
|
46
|
-
error: data.error || "Failed to start code-server"
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
} catch (err) {
|
|
50
|
-
setState({
|
|
51
|
-
status: "error",
|
|
52
|
-
url: null,
|
|
53
|
-
error: err instanceof Error ? err.message : "Failed to start code-server"
|
|
54
|
-
});
|
|
55
|
-
} finally {
|
|
56
|
-
startingRef.current = false;
|
|
57
|
-
}
|
|
58
|
-
}, []);
|
|
59
|
-
const stopCodeServer = useCallback(async () => {
|
|
60
|
-
try {
|
|
61
|
-
await fetch("/api/code-server/stop", { method: "POST" });
|
|
62
|
-
} catch (err) {
|
|
63
|
-
console.error("[CodeServerApp] Error stopping code-server:", err);
|
|
64
|
-
}
|
|
65
|
-
}, []);
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
startCodeServer();
|
|
68
|
-
return () => {
|
|
69
|
-
stopCodeServer();
|
|
70
|
-
};
|
|
71
|
-
}, [startCodeServer, stopCodeServer]);
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
if (!hasNotifiedRef.current && notifyReady) {
|
|
74
|
-
hasNotifiedRef.current = true;
|
|
75
|
-
notifyReady({
|
|
76
|
-
...win?.contentData ?? {},
|
|
77
|
-
status: state.status,
|
|
78
|
-
restart: startCodeServer
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}, [notifyReady, state.status, startCodeServer, win?.contentData]);
|
|
82
|
-
useEffect(() => {
|
|
83
|
-
if (hasNotifiedRef.current && notifyReady) {
|
|
84
|
-
notifyReady({
|
|
85
|
-
...win?.contentData ?? {},
|
|
86
|
-
status: state.status
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}, [state.status, notifyReady, win?.contentData]);
|
|
90
|
-
if (state.status === "idle" || state.status === "starting") {
|
|
91
|
-
return /* @__PURE__ */ jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsxs("div", { className: CodeServerApp_default.loading, children: [
|
|
92
|
-
/* @__PURE__ */ jsx("div", { className: CodeServerApp_default.spinner }),
|
|
93
|
-
/* @__PURE__ */ jsx("p", { children: "Starting VS Code..." })
|
|
94
|
-
] }) });
|
|
95
|
-
}
|
|
96
|
-
if (state.status === "error") {
|
|
97
|
-
return /* @__PURE__ */ jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsxs("div", { className: CodeServerApp_default.error, children: [
|
|
98
|
-
/* @__PURE__ */ jsx("h3", { children: "Failed to start VS Code" }),
|
|
99
|
-
/* @__PURE__ */ jsx("p", { children: state.error }),
|
|
100
|
-
/* @__PURE__ */ jsx("button", { onClick: startCodeServer, className: CodeServerApp_default.retryButton, children: "Retry" })
|
|
101
|
-
] }) });
|
|
102
|
-
}
|
|
103
|
-
return /* @__PURE__ */ jsx("div", { className: CodeServerApp_default.container, children: /* @__PURE__ */ jsx(
|
|
104
|
-
"iframe",
|
|
105
|
-
{
|
|
106
|
-
src: state.url || "",
|
|
107
|
-
className: CodeServerApp_default.iframe,
|
|
108
|
-
title: "VS Code",
|
|
109
|
-
allow: "clipboard-read; clipboard-write"
|
|
110
|
-
}
|
|
111
|
-
) });
|
|
112
|
-
};
|
|
113
|
-
var CodeServerApp = (props) => {
|
|
114
|
-
if (!isDocker()) {
|
|
115
|
-
return /* @__PURE__ */ jsx(CodeServerNotSupported, {});
|
|
116
|
-
}
|
|
117
|
-
return /* @__PURE__ */ jsx(CodeServerAppInner, { ...props });
|
|
118
|
-
};
|
|
119
|
-
var CodeServerApp_default2 = CodeServerApp;
|
|
120
|
-
|
|
121
|
-
export { CodeServerApp_default2 as CodeServerApp_default };
|