@fde-desktop/fde-core 0.4.6 → 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-2EME6FYH.js +0 -8
- package/dist/CreateItemApp-BSEISPUS.cjs +0 -14
- package/dist/CreateItemApp-PQB5GTFG.css +0 -107
- package/dist/DeviceInfoApp-2MJFK32B.cjs +0 -11
- package/dist/DeviceInfoApp-KFYU3E43.js +0 -5
- package/dist/DeviceInfoApp-ZSMRSITP.css +0 -7
- package/dist/FilesApp-B7JR4PEP.cjs +0 -14
- package/dist/FilesApp-E6L5W3T2.css +0 -1817
- package/dist/FilesApp-HYTIWN3O.js +0 -8
- package/dist/ImageViewerApp-N2Q7E7WZ.css +0 -215
- package/dist/ImageViewerApp-PLHNQFZ3.js +0 -11
- package/dist/ImageViewerApp-UIXSGW2X.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-4DB5UEWH.js +0 -9
- package/dist/MenuEditApp-B2ZMG4ZY.cjs +0 -15
- 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-BZYASRVJ.cjs +0 -16
- package/dist/NotesApp-MW37NRSN.js +0 -10
- 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-3ZINDODQ.cjs +0 -16
- package/dist/PdfApp-BUIC5U5H.css +0 -206
- package/dist/PdfApp-ZSYAQP7L.js +0 -10
- package/dist/PdfMenuBar-NLZC6JHS.js +0 -4
- package/dist/PdfMenuBar-QUM72EE4.css +0 -56
- package/dist/PdfMenuBar-WBRTKMLN.cjs +0 -13
- package/dist/SettingsApp-2ZNO7AVY.cjs +0 -20
- package/dist/SettingsApp-JVOSEFH3.css +0 -283
- package/dist/SettingsApp-ODZINK6T.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-MTRIYWV4.cjs +0 -16
- package/dist/UploaderApp-V3WUDCG2.js +0 -10
- package/dist/chunk-25GVAXBU.js +0 -215
- package/dist/chunk-2MYZWMDC.js +0 -444
- package/dist/chunk-2NGIGLVP.cjs +0 -219
- package/dist/chunk-2O3W6TLG.cjs +0 -49
- package/dist/chunk-2PSTHGTD.cjs +0 -42
- package/dist/chunk-2RQX7QBP.cjs +0 -148
- package/dist/chunk-2UW42GAP.cjs +0 -2308
- package/dist/chunk-43W6UDUZ.cjs +0 -19
- package/dist/chunk-4E45FBAH.js +0 -223
- package/dist/chunk-4KIMZJ3L.cjs +0 -88
- package/dist/chunk-4XURSNM4.js +0 -43
- package/dist/chunk-4ZCRYHL6.js +0 -407
- package/dist/chunk-57ZTJB2W.cjs +0 -2329
- package/dist/chunk-5C6IQE42.cjs +0 -35
- package/dist/chunk-5NOHYJNH.js +0 -84
- package/dist/chunk-5YH6AKEO.js +0 -146
- package/dist/chunk-7FGL7HGS.cjs +0 -83
- package/dist/chunk-7HQ6KUIO.cjs +0 -50
- package/dist/chunk-7Y7HB7FB.cjs +0 -53
- package/dist/chunk-ABIAPZ6S.cjs +0 -45
- package/dist/chunk-AU4IENXY.cjs +0 -449
- package/dist/chunk-BFMSPWLP.cjs +0 -165
- package/dist/chunk-BQCD5RAF.cjs +0 -48
- package/dist/chunk-BQL3YXMV.js +0 -17429
- package/dist/chunk-C6BEZNAM.cjs +0 -45
- package/dist/chunk-CV5PUHAE.cjs +0 -86
- package/dist/chunk-D5MVFFID.js +0 -42
- package/dist/chunk-D7R55WWT.js +0 -1601
- package/dist/chunk-DEVJOHGE.cjs +0 -38
- package/dist/chunk-DWP2SYF7.js +0 -55
- package/dist/chunk-E55VXNLK.cjs +0 -17498
- package/dist/chunk-EAELL43F.js +0 -42
- package/dist/chunk-EX5V2ZTU.js +0 -40
- package/dist/chunk-FH4ILMKF.js +0 -38
- package/dist/chunk-FNWS4ZKT.js +0 -48
- package/dist/chunk-FRHBM2U7.js +0 -33
- package/dist/chunk-FX2TPX3L.cjs +0 -45
- package/dist/chunk-GRYCUBJZ.js +0 -9
- package/dist/chunk-HIGKZ7UP.js +0 -2293
- package/dist/chunk-HWHBSAUC.js +0 -40
- package/dist/chunk-HYJJVB7G.js +0 -442
- package/dist/chunk-I5MJXFYW.cjs +0 -34
- package/dist/chunk-IDHP3R4I.js +0 -31
- package/dist/chunk-JEBKLIMU.cjs +0 -123
- package/dist/chunk-JX65IKJZ.cjs +0 -324
- package/dist/chunk-KGMXUBWQ.js +0 -280
- package/dist/chunk-KI5FXBOM.cjs +0 -286
- package/dist/chunk-KQHICFX3.js +0 -121
- package/dist/chunk-LMJE6V4N.cjs +0 -42
- package/dist/chunk-MVDGM5Y4.js +0 -68
- package/dist/chunk-NULEEBCG.js +0 -32
- package/dist/chunk-NVEGEK3N.js +0 -31
- package/dist/chunk-OJIDKDKF.js +0 -68
- package/dist/chunk-PDEZ7BIN.js +0 -541
- package/dist/chunk-PKPQA5NR.js +0 -15
- package/dist/chunk-PNDBLFJW.cjs +0 -50
- package/dist/chunk-PVBI2WRF.js +0 -77
- package/dist/chunk-Q3WA72BF.cjs +0 -70
- package/dist/chunk-QFGHYAD7.cjs +0 -237
- package/dist/chunk-RDIDAZ3S.cjs +0 -9
- package/dist/chunk-RGJPRXYY.js +0 -48
- package/dist/chunk-RQ6OZRUW.cjs +0 -41
- package/dist/chunk-SBE4SZAN.cjs +0 -226
- package/dist/chunk-TGWMOHAO.js +0 -17
- package/dist/chunk-U5JKHQBS.js +0 -234
- package/dist/chunk-UIQCTAVM.cjs +0 -59
- package/dist/chunk-VFPEMNSX.js +0 -47
- package/dist/chunk-VLWKVIYD.js +0 -162
- package/dist/chunk-W2Y22XR6.js +0 -2240
- package/dist/chunk-WHZGUG7Q.js +0 -36
- package/dist/chunk-WSA5WSHN.js +0 -283
- package/dist/chunk-XVASHRCE.cjs +0 -70
- package/dist/chunk-XYSMVQQD.cjs +0 -1608
- package/dist/chunk-Y2WL2M7M.js +0 -86
- package/dist/chunk-YAIWI4Z5.js +0 -7
- package/dist/chunk-YOHBUOZJ.cjs +0 -451
- package/dist/chunk-YP2PLNOF.cjs +0 -34
- package/dist/chunk-YSOLW4FS.cjs +0 -11
- package/dist/chunk-YSWU4OKP.cjs +0 -548
- 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-HIGKZ7UP.js
DELETED
|
@@ -1,2293 +0,0 @@
|
|
|
1
|
-
import { ColorPicker_default } from './chunk-EX5V2ZTU.js';
|
|
2
|
-
import { useSettingsAppStore } from './chunk-IDHP3R4I.js';
|
|
3
|
-
import { useResolvedUrl } from './chunk-FNWS4ZKT.js';
|
|
4
|
-
import { PRESET_COLORS } from './chunk-PKPQA5NR.js';
|
|
5
|
-
import { AppIcon_default } from './chunk-NULEEBCG.js';
|
|
6
|
-
import { useCloseInterceptor } from './chunk-PVBI2WRF.js';
|
|
7
|
-
import { DownloadProgress_default } from './chunk-HWHBSAUC.js';
|
|
8
|
-
import { FilePickerModal } from './chunk-2MYZWMDC.js';
|
|
9
|
-
import { useDesktopStore } from './chunk-W2Y22XR6.js';
|
|
10
|
-
import { isDocker } from './chunk-FRHBM2U7.js';
|
|
11
|
-
import { Stack, Text, SimpleGrid, Card, Button, Box, Group, UnstyledButton, Radio, Paper, Slider, TextInput, ScrollArea, Tooltip, SegmentedControl, Badge } from './chunk-BQL3YXMV.js';
|
|
12
|
-
import * as React5 from 'react';
|
|
13
|
-
import { useState, useRef, useEffect, useCallback, useDeferredValue } from 'react';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { create } from 'zustand';
|
|
16
|
-
import { persist, createJSONStorage } from 'zustand/middleware';
|
|
17
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
18
|
-
|
|
19
|
-
// src/infrastructure/adapters/DefaultThemeProvider.ts
|
|
20
|
-
var DEFAULT_FDE_THEME_LIGHT = {
|
|
21
|
-
mode: "light",
|
|
22
|
-
colors: {
|
|
23
|
-
desktop: "#f0f4f8",
|
|
24
|
-
taskbar: "rgba(255, 255, 255, 0.9)",
|
|
25
|
-
window: "#ffffff",
|
|
26
|
-
accent: "#339af0"
|
|
27
|
-
},
|
|
28
|
-
window: {
|
|
29
|
-
borderRadius: "8px",
|
|
30
|
-
headerHeight: 40,
|
|
31
|
-
minWidth: 400,
|
|
32
|
-
minHeight: 300,
|
|
33
|
-
defaultWidth: 800,
|
|
34
|
-
defaultHeight: 600,
|
|
35
|
-
shadow: "0 8px 32px rgba(0, 0, 0, 0.2)"
|
|
36
|
-
},
|
|
37
|
-
taskbar: {
|
|
38
|
-
height: 48,
|
|
39
|
-
position: "bottom",
|
|
40
|
-
background: "rgba(0, 0, 0, 0.8)",
|
|
41
|
-
blur: true
|
|
42
|
-
},
|
|
43
|
-
desktop: {
|
|
44
|
-
background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
|
|
45
|
-
iconSize: 64,
|
|
46
|
-
iconSpacing: 16
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var DEFAULT_FDE_THEME_DARK = {
|
|
50
|
-
mode: "dark",
|
|
51
|
-
colors: {
|
|
52
|
-
desktop: "#1a1b1e",
|
|
53
|
-
taskbar: "rgba(26, 27, 30, 0.9)",
|
|
54
|
-
window: "#25262b",
|
|
55
|
-
accent: "#4dabf7"
|
|
56
|
-
},
|
|
57
|
-
window: {
|
|
58
|
-
borderRadius: "8px",
|
|
59
|
-
headerHeight: 40,
|
|
60
|
-
minWidth: 400,
|
|
61
|
-
minHeight: 300,
|
|
62
|
-
defaultWidth: 800,
|
|
63
|
-
defaultHeight: 600,
|
|
64
|
-
shadow: "0 8px 32px rgba(0, 0, 0, 0.2)"
|
|
65
|
-
},
|
|
66
|
-
taskbar: {
|
|
67
|
-
height: 48,
|
|
68
|
-
position: "bottom",
|
|
69
|
-
background: "rgba(0, 0, 0, 0.8)",
|
|
70
|
-
blur: true
|
|
71
|
-
},
|
|
72
|
-
desktop: {
|
|
73
|
-
background: "linear-gradient(135deg, #1a1b1e 0%, #2d1f3d 100%)",
|
|
74
|
-
iconSize: 64,
|
|
75
|
-
iconSpacing: 16
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
var DefaultThemeProvider = class {
|
|
79
|
-
mode;
|
|
80
|
-
customColors = null;
|
|
81
|
-
constructor(initialMode = "light") {
|
|
82
|
-
this.mode = initialMode;
|
|
83
|
-
}
|
|
84
|
-
getTheme() {
|
|
85
|
-
const base = this.mode === "light" ? DEFAULT_FDE_THEME_LIGHT : DEFAULT_FDE_THEME_DARK;
|
|
86
|
-
if (!this.customColors) return base;
|
|
87
|
-
return {
|
|
88
|
-
...base,
|
|
89
|
-
colors: {
|
|
90
|
-
...base.colors,
|
|
91
|
-
taskbar: this.customColors.taskbar,
|
|
92
|
-
window: this.customColors.window,
|
|
93
|
-
accent: this.customColors.accent
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
setMode(mode) {
|
|
98
|
-
this.mode = mode;
|
|
99
|
-
}
|
|
100
|
-
setCustomColors(colors) {
|
|
101
|
-
this.customColors = colors;
|
|
102
|
-
}
|
|
103
|
-
toggle() {
|
|
104
|
-
this.mode = this.mode === "light" ? "dark" : "light";
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// src/stores/settingsStore.ts
|
|
109
|
-
var SUPPORTED_LANGUAGES = ["en", "es"];
|
|
110
|
-
var DEFAULT_LANGUAGE = "en";
|
|
111
|
-
var getPersistedThemeMode = () => {
|
|
112
|
-
try {
|
|
113
|
-
const newKey = localStorage.getItem("fde-desktop:settings");
|
|
114
|
-
const legacyKey = localStorage.getItem("fran-desktop:settings");
|
|
115
|
-
const stored = newKey ?? legacyKey;
|
|
116
|
-
return JSON.parse(stored ?? "{}")?.state?.theme?.mode ?? null;
|
|
117
|
-
} catch {
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
var persistedMode = getPersistedThemeMode();
|
|
122
|
-
var detectBrowserLanguage = () => {
|
|
123
|
-
if (typeof navigator === "undefined" || !navigator.language) {
|
|
124
|
-
return DEFAULT_LANGUAGE;
|
|
125
|
-
}
|
|
126
|
-
const browserLang = navigator.language.split("-")[0];
|
|
127
|
-
if (SUPPORTED_LANGUAGES.includes(browserLang)) {
|
|
128
|
-
return browserLang;
|
|
129
|
-
}
|
|
130
|
-
return DEFAULT_LANGUAGE;
|
|
131
|
-
};
|
|
132
|
-
var persistedLanguage = (() => {
|
|
133
|
-
try {
|
|
134
|
-
const newKey = localStorage.getItem("fde-desktop:settings");
|
|
135
|
-
const legacyKey = localStorage.getItem("fran-desktop:settings");
|
|
136
|
-
const storedState = JSON.parse(newKey ?? legacyKey ?? "{}")?.state?.language;
|
|
137
|
-
if (storedState && SUPPORTED_LANGUAGES.includes(storedState)) {
|
|
138
|
-
return storedState;
|
|
139
|
-
}
|
|
140
|
-
return detectBrowserLanguage();
|
|
141
|
-
} catch {
|
|
142
|
-
return detectBrowserLanguage();
|
|
143
|
-
}
|
|
144
|
-
})();
|
|
145
|
-
var themeProvider = new DefaultThemeProvider(persistedMode ?? "light");
|
|
146
|
-
var useSettingsStore = create()(
|
|
147
|
-
persist(
|
|
148
|
-
(set) => ({
|
|
149
|
-
wallpaper: null,
|
|
150
|
-
wallpaperModule: "default",
|
|
151
|
-
launcherIcon: "FcElectronics",
|
|
152
|
-
font: "system-ui",
|
|
153
|
-
downloadedFonts: [],
|
|
154
|
-
fontSize: 14,
|
|
155
|
-
animationDuration: 0.3,
|
|
156
|
-
theme: themeProvider.getTheme(),
|
|
157
|
-
themeSetManually: persistedMode !== null,
|
|
158
|
-
customThemeColors: null,
|
|
159
|
-
language: persistedLanguage,
|
|
160
|
-
setWallpaper: (url) => set({ wallpaper: url }),
|
|
161
|
-
setWallpaperModule: (module) => set({ wallpaperModule: module }),
|
|
162
|
-
setLauncherIcon: (icon) => set({ launcherIcon: icon }),
|
|
163
|
-
setFont: (font) => set({ font }),
|
|
164
|
-
markFontDownloaded: (fontName) => set((state) => ({
|
|
165
|
-
downloadedFonts: state.downloadedFonts.includes(fontName) ? state.downloadedFonts : [...state.downloadedFonts, fontName]
|
|
166
|
-
})),
|
|
167
|
-
setFontSize: (size) => set({ fontSize: size }),
|
|
168
|
-
setAnimationDuration: (duration) => set({ animationDuration: duration }),
|
|
169
|
-
setThemeMode: (mode) => {
|
|
170
|
-
themeProvider.setMode(mode);
|
|
171
|
-
set({ theme: themeProvider.getTheme(), themeSetManually: true });
|
|
172
|
-
},
|
|
173
|
-
toggleTheme: () => {
|
|
174
|
-
themeProvider.toggle();
|
|
175
|
-
set({ theme: themeProvider.getTheme(), themeSetManually: true });
|
|
176
|
-
},
|
|
177
|
-
setThemeAutomatic: () => set({ themeSetManually: false }),
|
|
178
|
-
applySystemTheme: (mode) => {
|
|
179
|
-
themeProvider.setMode(mode);
|
|
180
|
-
set({ theme: themeProvider.getTheme() });
|
|
181
|
-
},
|
|
182
|
-
setCustomThemeColors: (colors) => {
|
|
183
|
-
set({ customThemeColors: colors });
|
|
184
|
-
},
|
|
185
|
-
setLanguage: (lang) => set({ language: lang })
|
|
186
|
-
}),
|
|
187
|
-
{
|
|
188
|
-
name: "fde-desktop:settings",
|
|
189
|
-
storage: createJSONStorage(() => localStorage)
|
|
190
|
-
}
|
|
191
|
-
)
|
|
192
|
-
);
|
|
193
|
-
|
|
194
|
-
// src/components/Apps/SettingsApp/sections/sectionRegistry.ts
|
|
195
|
-
var SETTINGS_SECTIONS = [
|
|
196
|
-
{
|
|
197
|
-
id: "wallpaper",
|
|
198
|
-
label: "Wallpaper",
|
|
199
|
-
fcIcon: "FcPicture",
|
|
200
|
-
description: "Change the desktop background image."
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
id: "appearance",
|
|
204
|
-
label: "Appearance",
|
|
205
|
-
fcIcon: "FcBinoculars",
|
|
206
|
-
description: "Switch between light and dark mode."
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
id: "launcher",
|
|
210
|
-
label: "Launcher",
|
|
211
|
-
fcIcon: "FcElectronics",
|
|
212
|
-
description: "Choose the launcher button icon."
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
id: "font",
|
|
216
|
-
label: "Font",
|
|
217
|
-
fcIcon: "FcEditImage",
|
|
218
|
-
description: "Select the system font family."
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
id: "language",
|
|
222
|
-
label: "Language",
|
|
223
|
-
fcIcon: "FcGlobe",
|
|
224
|
-
description: "Choose your preferred language."
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
id: "reset",
|
|
228
|
-
label: "Reset to Default",
|
|
229
|
-
fcIcon: "FcDisclaimer",
|
|
230
|
-
description: "Reset all settings and data to defaults."
|
|
231
|
-
}
|
|
232
|
-
];
|
|
233
|
-
var SettingsSection = ({ title, description, children }) => /* @__PURE__ */ jsxs(Stack, { gap: "md", p: "md", children: [
|
|
234
|
-
/* @__PURE__ */ jsx(Text, { fw: 600, size: "lg", children: title }),
|
|
235
|
-
description && /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: description }),
|
|
236
|
-
children
|
|
237
|
-
] });
|
|
238
|
-
var SettingsSection_default = SettingsSection;
|
|
239
|
-
var defaultWallpaperSrc = "/Images/wallpaper.jpg";
|
|
240
|
-
var WallpaperSettings = () => {
|
|
241
|
-
const { t } = useTranslation("settings");
|
|
242
|
-
const wallpaper = useSettingsStore((state) => state.wallpaper);
|
|
243
|
-
const wallpaperModule = useSettingsStore((state) => state.wallpaperModule);
|
|
244
|
-
const setWallpaper = useSettingsStore((state) => state.setWallpaper);
|
|
245
|
-
const setWallpaperModule = useSettingsStore((state) => state.setWallpaperModule);
|
|
246
|
-
const [urlInput, setUrlInput] = useState("");
|
|
247
|
-
const [pickerOpen, setPickerOpen] = useState(false);
|
|
248
|
-
const fileInputRef = useRef(null);
|
|
249
|
-
const resolvedWallpaper = useResolvedUrl(wallpaper ?? void 0);
|
|
250
|
-
const previewSrc = resolvedWallpaper ?? defaultWallpaperSrc;
|
|
251
|
-
const handleFileChange = useCallback(
|
|
252
|
-
(e) => {
|
|
253
|
-
const file = e.target.files?.[0];
|
|
254
|
-
if (!file) return;
|
|
255
|
-
const reader = new FileReader();
|
|
256
|
-
reader.onload = (evt) => {
|
|
257
|
-
const result = evt.target?.result;
|
|
258
|
-
if (typeof result === "string") setWallpaper(result);
|
|
259
|
-
};
|
|
260
|
-
reader.readAsDataURL(file);
|
|
261
|
-
},
|
|
262
|
-
[setWallpaper]
|
|
263
|
-
);
|
|
264
|
-
const handleUrlApply = useCallback(() => {
|
|
265
|
-
const trimmed = urlInput.trim();
|
|
266
|
-
if (trimmed) setWallpaper(trimmed);
|
|
267
|
-
}, [urlInput, setWallpaper]);
|
|
268
|
-
const handleReset = useCallback(() => {
|
|
269
|
-
setWallpaper(null);
|
|
270
|
-
setUrlInput("");
|
|
271
|
-
}, [setWallpaper]);
|
|
272
|
-
const handleFsImageSelect = useCallback(
|
|
273
|
-
(node) => {
|
|
274
|
-
const imageUrl = node.url ? node.url.startsWith("idb://") ? node.url : `${import.meta.env.BASE_URL}${node.url}` : null;
|
|
275
|
-
if (imageUrl) {
|
|
276
|
-
setWallpaper(imageUrl);
|
|
277
|
-
}
|
|
278
|
-
setPickerOpen(false);
|
|
279
|
-
},
|
|
280
|
-
[setWallpaper]
|
|
281
|
-
);
|
|
282
|
-
return /* @__PURE__ */ jsxs(SettingsSection_default, { title: t("wallpaper.title"), children: [
|
|
283
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
284
|
-
SegmentedControl,
|
|
285
|
-
{
|
|
286
|
-
value: wallpaperModule,
|
|
287
|
-
onChange: setWallpaperModule,
|
|
288
|
-
data: [{ value: "default", label: t("wallpaper.staticImage") }],
|
|
289
|
-
fullWidth: true
|
|
290
|
-
}
|
|
291
|
-
) }),
|
|
292
|
-
/* @__PURE__ */ jsx(
|
|
293
|
-
"img",
|
|
294
|
-
{
|
|
295
|
-
src: previewSrc,
|
|
296
|
-
alt: t("wallpaper.wallpaperPreview"),
|
|
297
|
-
style: { width: "100%", height: 180, objectFit: "cover", borderRadius: 8 }
|
|
298
|
-
}
|
|
299
|
-
),
|
|
300
|
-
/* @__PURE__ */ jsxs(Group, { children: [
|
|
301
|
-
/* @__PURE__ */ jsx(
|
|
302
|
-
"input",
|
|
303
|
-
{
|
|
304
|
-
ref: fileInputRef,
|
|
305
|
-
type: "file",
|
|
306
|
-
accept: "image/*",
|
|
307
|
-
style: { display: "none" },
|
|
308
|
-
onChange: handleFileChange,
|
|
309
|
-
"aria-label": t("wallpaper.uploadAria", { defaultValue: "Upload wallpaper file" })
|
|
310
|
-
}
|
|
311
|
-
),
|
|
312
|
-
/* @__PURE__ */ jsx(Button, { variant: "light", onClick: () => setPickerOpen(true), children: t("wallpaper.chooseFromImages") }),
|
|
313
|
-
/* @__PURE__ */ jsx(Button, { variant: "light", onClick: () => fileInputRef.current?.click(), children: t("wallpaper.uploadFromDisk") }),
|
|
314
|
-
/* @__PURE__ */ jsx(Button, { variant: "subtle", color: "red", onClick: handleReset, children: t("wallpaper.resetToDefault") })
|
|
315
|
-
] }),
|
|
316
|
-
/* @__PURE__ */ jsxs(Group, { align: "flex-end", children: [
|
|
317
|
-
/* @__PURE__ */ jsx(
|
|
318
|
-
TextInput,
|
|
319
|
-
{
|
|
320
|
-
label: t("wallpaper.orEnterUrl"),
|
|
321
|
-
placeholder: "https://example.com/image.jpg",
|
|
322
|
-
value: urlInput,
|
|
323
|
-
onChange: (e) => setUrlInput(e.currentTarget.value),
|
|
324
|
-
style: { flex: 1 }
|
|
325
|
-
}
|
|
326
|
-
),
|
|
327
|
-
/* @__PURE__ */ jsx(Button, { onClick: handleUrlApply, disabled: !urlInput.trim(), children: t("common:actions.apply") })
|
|
328
|
-
] }),
|
|
329
|
-
/* @__PURE__ */ jsx(
|
|
330
|
-
FilePickerModal,
|
|
331
|
-
{
|
|
332
|
-
opened: pickerOpen,
|
|
333
|
-
acceptedMimeTypes: ["image/*"],
|
|
334
|
-
onConfirm: handleFsImageSelect,
|
|
335
|
-
onCancel: () => setPickerOpen(false)
|
|
336
|
-
}
|
|
337
|
-
)
|
|
338
|
-
] });
|
|
339
|
-
};
|
|
340
|
-
var WallpaperSettings_default = WallpaperSettings;
|
|
341
|
-
var AppearanceSettings = () => {
|
|
342
|
-
const { t } = useTranslation("settings");
|
|
343
|
-
const themeMode = useSettingsStore((state) => state.theme.mode);
|
|
344
|
-
const themeSetManually = useSettingsStore((state) => state.themeSetManually);
|
|
345
|
-
const customThemeColors = useSettingsStore((state) => state.customThemeColors);
|
|
346
|
-
const animationDuration = useSettingsStore((state) => state.animationDuration);
|
|
347
|
-
const setThemeMode = useSettingsStore((state) => state.setThemeMode);
|
|
348
|
-
const setThemeAutomatic = useSettingsStore((state) => state.setThemeAutomatic);
|
|
349
|
-
const setCustomThemeColors = useSettingsStore((state) => state.setCustomThemeColors);
|
|
350
|
-
const setAnimationDuration = useSettingsStore((state) => state.setAnimationDuration);
|
|
351
|
-
const currentValue = customThemeColors ? "custom" : themeSetManually ? themeMode : "system";
|
|
352
|
-
const handleChange = useCallback(
|
|
353
|
-
(value) => {
|
|
354
|
-
if (value === "system") {
|
|
355
|
-
setThemeAutomatic();
|
|
356
|
-
setCustomThemeColors(null);
|
|
357
|
-
} else if (value === "custom") {
|
|
358
|
-
setCustomThemeColors({
|
|
359
|
-
taskbar: "#339af0",
|
|
360
|
-
window: "#ffffff",
|
|
361
|
-
accent: "#339af0"
|
|
362
|
-
});
|
|
363
|
-
} else {
|
|
364
|
-
setThemeMode(value);
|
|
365
|
-
setCustomThemeColors(null);
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
|
-
[setThemeMode, setThemeAutomatic, setCustomThemeColors]
|
|
369
|
-
);
|
|
370
|
-
const handleColorChange = useCallback(
|
|
371
|
-
(key) => (color) => {
|
|
372
|
-
if (customThemeColors) {
|
|
373
|
-
setCustomThemeColors({ ...customThemeColors, [key]: color });
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
[customThemeColors, setCustomThemeColors]
|
|
377
|
-
);
|
|
378
|
-
const handleAnimationChange = useCallback(
|
|
379
|
-
(value) => {
|
|
380
|
-
setAnimationDuration(value);
|
|
381
|
-
},
|
|
382
|
-
[setAnimationDuration]
|
|
383
|
-
);
|
|
384
|
-
const isCustom = currentValue === "custom";
|
|
385
|
-
return /* @__PURE__ */ jsxs(Stack, { gap: "md", p: "md", children: [
|
|
386
|
-
/* @__PURE__ */ jsx(Text, { fw: 600, size: "lg", children: t("appearance.title") }),
|
|
387
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: t("appearance.description") }),
|
|
388
|
-
/* @__PURE__ */ jsx(
|
|
389
|
-
SegmentedControl,
|
|
390
|
-
{
|
|
391
|
-
value: currentValue,
|
|
392
|
-
onChange: handleChange,
|
|
393
|
-
data: [
|
|
394
|
-
{ label: t("common:theme.light"), value: "light" },
|
|
395
|
-
{ label: t("common:theme.dark"), value: "dark" },
|
|
396
|
-
{ label: t("common:theme.system"), value: "system" },
|
|
397
|
-
{ label: t("common:theme.custom"), value: "custom" }
|
|
398
|
-
],
|
|
399
|
-
"aria-label": t("appearance.themeMode", { defaultValue: "Theme mode" })
|
|
400
|
-
}
|
|
401
|
-
),
|
|
402
|
-
/* @__PURE__ */ jsxs(Stack, { gap: "sm", mt: "md", children: [
|
|
403
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
404
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, mb: "xs", c: isCustom ? "dark" : void 0, children: t("appearance.taskbar") }),
|
|
405
|
-
/* @__PURE__ */ jsx(
|
|
406
|
-
ColorPicker_default,
|
|
407
|
-
{
|
|
408
|
-
value: customThemeColors?.taskbar ?? "#339af0",
|
|
409
|
-
onChange: handleColorChange("taskbar"),
|
|
410
|
-
disabled: !isCustom
|
|
411
|
-
}
|
|
412
|
-
)
|
|
413
|
-
] }),
|
|
414
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
415
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, mb: "xs", c: isCustom ? "dark" : void 0, children: t("appearance.window") }),
|
|
416
|
-
/* @__PURE__ */ jsx(
|
|
417
|
-
ColorPicker_default,
|
|
418
|
-
{
|
|
419
|
-
value: customThemeColors?.window ?? "#ffffff",
|
|
420
|
-
onChange: handleColorChange("window"),
|
|
421
|
-
disabled: !isCustom
|
|
422
|
-
}
|
|
423
|
-
)
|
|
424
|
-
] }),
|
|
425
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
426
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, mb: "xs", c: isCustom ? "dark" : void 0, children: t("appearance.accent") }),
|
|
427
|
-
/* @__PURE__ */ jsx(
|
|
428
|
-
ColorPicker_default,
|
|
429
|
-
{
|
|
430
|
-
value: customThemeColors?.accent ?? "#339af0",
|
|
431
|
-
onChange: handleColorChange("accent"),
|
|
432
|
-
disabled: !isCustom
|
|
433
|
-
}
|
|
434
|
-
)
|
|
435
|
-
] })
|
|
436
|
-
] }),
|
|
437
|
-
/* @__PURE__ */ jsxs(Box, { mt: "md", children: [
|
|
438
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, mb: "xs", children: t("appearance.animationDuration") }),
|
|
439
|
-
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", mb: "sm", children: t("appearance.animationDescription") }),
|
|
440
|
-
/* @__PURE__ */ jsxs(Group, { align: "center", gap: "md", children: [
|
|
441
|
-
/* @__PURE__ */ jsx(
|
|
442
|
-
Slider,
|
|
443
|
-
{
|
|
444
|
-
value: animationDuration,
|
|
445
|
-
onChange: handleAnimationChange,
|
|
446
|
-
min: 0.1,
|
|
447
|
-
max: 1,
|
|
448
|
-
step: 0.1,
|
|
449
|
-
style: { flex: 1 },
|
|
450
|
-
marks: [
|
|
451
|
-
{ value: 0.1, label: "0.1s" },
|
|
452
|
-
{ value: 0.5, label: "0.5s" },
|
|
453
|
-
{ value: 1, label: "1.0s" }
|
|
454
|
-
],
|
|
455
|
-
"aria-label": t("appearance.animationDuration")
|
|
456
|
-
}
|
|
457
|
-
),
|
|
458
|
-
/* @__PURE__ */ jsxs(Text, { size: "sm", fw: 500, style: { minWidth: 40 }, children: [
|
|
459
|
-
animationDuration.toFixed(1),
|
|
460
|
-
"s"
|
|
461
|
-
] })
|
|
462
|
-
] })
|
|
463
|
-
] })
|
|
464
|
-
] });
|
|
465
|
-
};
|
|
466
|
-
var AppearanceSettings_default = AppearanceSettings;
|
|
467
|
-
var LauncherSettings = () => {
|
|
468
|
-
const launcherIcon = useSettingsStore((state) => state.launcherIcon);
|
|
469
|
-
const setLauncherIcon = useSettingsStore((state) => state.setLauncherIcon);
|
|
470
|
-
const [allIconNames, setAllIconNames] = useState([]);
|
|
471
|
-
const [search, setSearch] = useState("");
|
|
472
|
-
const deferredSearch = useDeferredValue(search);
|
|
473
|
-
useEffect(() => {
|
|
474
|
-
import('react-icons/fc').then((mod) => {
|
|
475
|
-
const names = Object.keys(mod).filter((k) => k.startsWith("Fc")).sort();
|
|
476
|
-
setAllIconNames(names);
|
|
477
|
-
});
|
|
478
|
-
}, []);
|
|
479
|
-
const filtered = deferredSearch ? allIconNames.filter((n) => n.toLowerCase().includes(deferredSearch.toLowerCase())) : allIconNames;
|
|
480
|
-
const handleSelect = useCallback(
|
|
481
|
-
(name) => {
|
|
482
|
-
setLauncherIcon(name);
|
|
483
|
-
},
|
|
484
|
-
[setLauncherIcon]
|
|
485
|
-
);
|
|
486
|
-
return /* @__PURE__ */ jsxs(SettingsSection_default, { title: "Launcher Icon", description: `Selected: ${launcherIcon}`, children: [
|
|
487
|
-
/* @__PURE__ */ jsx(
|
|
488
|
-
TextInput,
|
|
489
|
-
{
|
|
490
|
-
placeholder: "Search icons...",
|
|
491
|
-
value: search,
|
|
492
|
-
onChange: (e) => setSearch(e.currentTarget.value),
|
|
493
|
-
"aria-label": "Search icons"
|
|
494
|
-
}
|
|
495
|
-
),
|
|
496
|
-
/* @__PURE__ */ jsx(ScrollArea, { style: { flex: 1, height: 300 }, children: /* @__PURE__ */ jsx(SimpleGrid, { cols: 8, spacing: 4, children: filtered.map((name) => /* @__PURE__ */ jsx(Tooltip, { label: name, withArrow: true, openDelay: 400, children: /* @__PURE__ */ jsx(
|
|
497
|
-
UnstyledButton,
|
|
498
|
-
{
|
|
499
|
-
onClick: () => handleSelect(name),
|
|
500
|
-
"aria-label": name,
|
|
501
|
-
"aria-pressed": name === launcherIcon,
|
|
502
|
-
style: {
|
|
503
|
-
padding: 6,
|
|
504
|
-
borderRadius: 6,
|
|
505
|
-
background: name === launcherIcon ? "var(--mantine-primary-color-light)" : "transparent",
|
|
506
|
-
display: "flex",
|
|
507
|
-
alignItems: "center",
|
|
508
|
-
justifyContent: "center"
|
|
509
|
-
},
|
|
510
|
-
children: /* @__PURE__ */ jsx(AppIcon_default, { fcIcon: name, size: 24 })
|
|
511
|
-
}
|
|
512
|
-
) }, name)) }) })
|
|
513
|
-
] });
|
|
514
|
-
};
|
|
515
|
-
var LauncherSettings_default = LauncherSettings;
|
|
516
|
-
|
|
517
|
-
// src/constants/Fonts.ts
|
|
518
|
-
var AVAILABLE_FONTS = [
|
|
519
|
-
{
|
|
520
|
-
value: "system-ui",
|
|
521
|
-
label: "System Default",
|
|
522
|
-
stack: "system-ui, Avenir, Helvetica, Arial, sans-serif"
|
|
523
|
-
},
|
|
524
|
-
{ value: "Courier New", label: "Courier New", stack: '"Courier New", monospace' },
|
|
525
|
-
{ value: "Source Code Pro", label: "Source Code Pro", stack: '"Source Code Pro", monospace' },
|
|
526
|
-
{ value: "Open Sans", label: "Open Sans", stack: '"Open Sans", monospace' }
|
|
527
|
-
];
|
|
528
|
-
var FONT_STACKS = Object.fromEntries(
|
|
529
|
-
AVAILABLE_FONTS.map((f) => [f.value, f.stack])
|
|
530
|
-
);
|
|
531
|
-
var GOOGLE_FONTS_HREF = {
|
|
532
|
-
"Source Code Pro": "https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap",
|
|
533
|
-
"Open Sans": "https://fonts.googleapis.com/css2?family=Open+Sans&display=swap"
|
|
534
|
-
};
|
|
535
|
-
|
|
536
|
-
// ../../node_modules/.bun/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
537
|
-
var Subscribable = class {
|
|
538
|
-
constructor() {
|
|
539
|
-
this.listeners = /* @__PURE__ */ new Set();
|
|
540
|
-
this.subscribe = this.subscribe.bind(this);
|
|
541
|
-
}
|
|
542
|
-
subscribe(listener) {
|
|
543
|
-
this.listeners.add(listener);
|
|
544
|
-
this.onSubscribe();
|
|
545
|
-
return () => {
|
|
546
|
-
this.listeners.delete(listener);
|
|
547
|
-
this.onUnsubscribe();
|
|
548
|
-
};
|
|
549
|
-
}
|
|
550
|
-
hasListeners() {
|
|
551
|
-
return this.listeners.size > 0;
|
|
552
|
-
}
|
|
553
|
-
onSubscribe() {
|
|
554
|
-
}
|
|
555
|
-
onUnsubscribe() {
|
|
556
|
-
}
|
|
557
|
-
};
|
|
558
|
-
|
|
559
|
-
// ../../node_modules/.bun/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/focusManager.js
|
|
560
|
-
var FocusManager = class extends Subscribable {
|
|
561
|
-
#focused;
|
|
562
|
-
#cleanup;
|
|
563
|
-
#setup;
|
|
564
|
-
constructor() {
|
|
565
|
-
super();
|
|
566
|
-
this.#setup = (onFocus) => {
|
|
567
|
-
if (typeof window !== "undefined" && window.addEventListener) {
|
|
568
|
-
const listener = () => onFocus();
|
|
569
|
-
window.addEventListener("visibilitychange", listener, false);
|
|
570
|
-
return () => {
|
|
571
|
-
window.removeEventListener("visibilitychange", listener);
|
|
572
|
-
};
|
|
573
|
-
}
|
|
574
|
-
return;
|
|
575
|
-
};
|
|
576
|
-
}
|
|
577
|
-
onSubscribe() {
|
|
578
|
-
if (!this.#cleanup) {
|
|
579
|
-
this.setEventListener(this.#setup);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
onUnsubscribe() {
|
|
583
|
-
if (!this.hasListeners()) {
|
|
584
|
-
this.#cleanup?.();
|
|
585
|
-
this.#cleanup = void 0;
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
setEventListener(setup) {
|
|
589
|
-
this.#setup = setup;
|
|
590
|
-
this.#cleanup?.();
|
|
591
|
-
this.#cleanup = setup((focused) => {
|
|
592
|
-
if (typeof focused === "boolean") {
|
|
593
|
-
this.setFocused(focused);
|
|
594
|
-
} else {
|
|
595
|
-
this.onFocus();
|
|
596
|
-
}
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
setFocused(focused) {
|
|
600
|
-
const changed = this.#focused !== focused;
|
|
601
|
-
if (changed) {
|
|
602
|
-
this.#focused = focused;
|
|
603
|
-
this.onFocus();
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
onFocus() {
|
|
607
|
-
const isFocused = this.isFocused();
|
|
608
|
-
this.listeners.forEach((listener) => {
|
|
609
|
-
listener(isFocused);
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
isFocused() {
|
|
613
|
-
if (typeof this.#focused === "boolean") {
|
|
614
|
-
return this.#focused;
|
|
615
|
-
}
|
|
616
|
-
return globalThis.document?.visibilityState !== "hidden";
|
|
617
|
-
}
|
|
618
|
-
};
|
|
619
|
-
var focusManager = new FocusManager();
|
|
620
|
-
|
|
621
|
-
// ../../node_modules/.bun/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
|
|
622
|
-
var defaultTimeoutProvider = {
|
|
623
|
-
// We need the wrapper function syntax below instead of direct references to
|
|
624
|
-
// global setTimeout etc.
|
|
625
|
-
//
|
|
626
|
-
// BAD: `setTimeout: setTimeout`
|
|
627
|
-
// GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
|
|
628
|
-
//
|
|
629
|
-
// If we use direct references here, then anything that wants to spy on or
|
|
630
|
-
// replace the global setTimeout (like tests) won't work since we'll already
|
|
631
|
-
// have a hard reference to the original implementation at the time when this
|
|
632
|
-
// file was imported.
|
|
633
|
-
setTimeout: (callback, delay) => setTimeout(callback, delay),
|
|
634
|
-
clearTimeout: (timeoutId) => clearTimeout(timeoutId),
|
|
635
|
-
setInterval: (callback, delay) => setInterval(callback, delay),
|
|
636
|
-
clearInterval: (intervalId) => clearInterval(intervalId)
|
|
637
|
-
};
|
|
638
|
-
var TimeoutManager = class {
|
|
639
|
-
// We cannot have TimeoutManager<T> as we must instantiate it with a concrete
|
|
640
|
-
// type at app boot; and if we leave that type, then any new timer provider
|
|
641
|
-
// would need to support the default provider's concrete timer ID, which is
|
|
642
|
-
// infeasible across environments.
|
|
643
|
-
//
|
|
644
|
-
// We settle for type safety for the TimeoutProvider type, and accept that
|
|
645
|
-
// this class is unsafe internally to allow for extension.
|
|
646
|
-
#provider = defaultTimeoutProvider;
|
|
647
|
-
#providerCalled = false;
|
|
648
|
-
setTimeoutProvider(provider) {
|
|
649
|
-
if (process.env.NODE_ENV !== "production") {
|
|
650
|
-
if (this.#providerCalled && provider !== this.#provider) {
|
|
651
|
-
console.error(
|
|
652
|
-
`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,
|
|
653
|
-
{ previous: this.#provider, provider }
|
|
654
|
-
);
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
this.#provider = provider;
|
|
658
|
-
if (process.env.NODE_ENV !== "production") {
|
|
659
|
-
this.#providerCalled = false;
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
setTimeout(callback, delay) {
|
|
663
|
-
if (process.env.NODE_ENV !== "production") {
|
|
664
|
-
this.#providerCalled = true;
|
|
665
|
-
}
|
|
666
|
-
return this.#provider.setTimeout(callback, delay);
|
|
667
|
-
}
|
|
668
|
-
clearTimeout(timeoutId) {
|
|
669
|
-
this.#provider.clearTimeout(timeoutId);
|
|
670
|
-
}
|
|
671
|
-
setInterval(callback, delay) {
|
|
672
|
-
if (process.env.NODE_ENV !== "production") {
|
|
673
|
-
this.#providerCalled = true;
|
|
674
|
-
}
|
|
675
|
-
return this.#provider.setInterval(callback, delay);
|
|
676
|
-
}
|
|
677
|
-
clearInterval(intervalId) {
|
|
678
|
-
this.#provider.clearInterval(intervalId);
|
|
679
|
-
}
|
|
680
|
-
};
|
|
681
|
-
var timeoutManager = new TimeoutManager();
|
|
682
|
-
function systemSetTimeoutZero(callback) {
|
|
683
|
-
setTimeout(callback, 0);
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
// ../../node_modules/.bun/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/utils.js
|
|
687
|
-
var isServer = typeof window === "undefined" || "Deno" in globalThis;
|
|
688
|
-
function noop() {
|
|
689
|
-
}
|
|
690
|
-
function isValidTimeout(value) {
|
|
691
|
-
return typeof value === "number" && value >= 0 && value !== Infinity;
|
|
692
|
-
}
|
|
693
|
-
function timeUntilStale(updatedAt, staleTime) {
|
|
694
|
-
return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
|
|
695
|
-
}
|
|
696
|
-
function resolveStaleTime(staleTime, query) {
|
|
697
|
-
return typeof staleTime === "function" ? staleTime(query) : staleTime;
|
|
698
|
-
}
|
|
699
|
-
function resolveEnabled(enabled, query) {
|
|
700
|
-
return typeof enabled === "function" ? enabled(query) : enabled;
|
|
701
|
-
}
|
|
702
|
-
var hasOwn = Object.prototype.hasOwnProperty;
|
|
703
|
-
function replaceEqualDeep(a, b, depth = 0) {
|
|
704
|
-
if (a === b) {
|
|
705
|
-
return a;
|
|
706
|
-
}
|
|
707
|
-
if (depth > 500) return b;
|
|
708
|
-
const array = isPlainArray(a) && isPlainArray(b);
|
|
709
|
-
if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;
|
|
710
|
-
const aItems = array ? a : Object.keys(a);
|
|
711
|
-
const aSize = aItems.length;
|
|
712
|
-
const bItems = array ? b : Object.keys(b);
|
|
713
|
-
const bSize = bItems.length;
|
|
714
|
-
const copy = array ? new Array(bSize) : {};
|
|
715
|
-
let equalItems = 0;
|
|
716
|
-
for (let i = 0; i < bSize; i++) {
|
|
717
|
-
const key = array ? i : bItems[i];
|
|
718
|
-
const aItem = a[key];
|
|
719
|
-
const bItem = b[key];
|
|
720
|
-
if (aItem === bItem) {
|
|
721
|
-
copy[key] = aItem;
|
|
722
|
-
if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;
|
|
723
|
-
continue;
|
|
724
|
-
}
|
|
725
|
-
if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") {
|
|
726
|
-
copy[key] = bItem;
|
|
727
|
-
continue;
|
|
728
|
-
}
|
|
729
|
-
const v = replaceEqualDeep(aItem, bItem, depth + 1);
|
|
730
|
-
copy[key] = v;
|
|
731
|
-
if (v === aItem) equalItems++;
|
|
732
|
-
}
|
|
733
|
-
return aSize === bSize && equalItems === aSize ? a : copy;
|
|
734
|
-
}
|
|
735
|
-
function shallowEqualObjects(a, b) {
|
|
736
|
-
if (!b || Object.keys(a).length !== Object.keys(b).length) {
|
|
737
|
-
return false;
|
|
738
|
-
}
|
|
739
|
-
for (const key in a) {
|
|
740
|
-
if (a[key] !== b[key]) {
|
|
741
|
-
return false;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
return true;
|
|
745
|
-
}
|
|
746
|
-
function isPlainArray(value) {
|
|
747
|
-
return Array.isArray(value) && value.length === Object.keys(value).length;
|
|
748
|
-
}
|
|
749
|
-
function isPlainObject(o) {
|
|
750
|
-
if (!hasObjectPrototype(o)) {
|
|
751
|
-
return false;
|
|
752
|
-
}
|
|
753
|
-
const ctor = o.constructor;
|
|
754
|
-
if (ctor === void 0) {
|
|
755
|
-
return true;
|
|
756
|
-
}
|
|
757
|
-
const prot = ctor.prototype;
|
|
758
|
-
if (!hasObjectPrototype(prot)) {
|
|
759
|
-
return false;
|
|
760
|
-
}
|
|
761
|
-
if (!prot.hasOwnProperty("isPrototypeOf")) {
|
|
762
|
-
return false;
|
|
763
|
-
}
|
|
764
|
-
if (Object.getPrototypeOf(o) !== Object.prototype) {
|
|
765
|
-
return false;
|
|
766
|
-
}
|
|
767
|
-
return true;
|
|
768
|
-
}
|
|
769
|
-
function hasObjectPrototype(o) {
|
|
770
|
-
return Object.prototype.toString.call(o) === "[object Object]";
|
|
771
|
-
}
|
|
772
|
-
function replaceData(prevData, data, options) {
|
|
773
|
-
if (typeof options.structuralSharing === "function") {
|
|
774
|
-
return options.structuralSharing(prevData, data);
|
|
775
|
-
} else if (options.structuralSharing !== false) {
|
|
776
|
-
if (process.env.NODE_ENV !== "production") {
|
|
777
|
-
try {
|
|
778
|
-
return replaceEqualDeep(prevData, data);
|
|
779
|
-
} catch (error) {
|
|
780
|
-
console.error(
|
|
781
|
-
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`
|
|
782
|
-
);
|
|
783
|
-
throw error;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
return replaceEqualDeep(prevData, data);
|
|
787
|
-
}
|
|
788
|
-
return data;
|
|
789
|
-
}
|
|
790
|
-
function shouldThrowError(throwOnError, params) {
|
|
791
|
-
if (typeof throwOnError === "function") {
|
|
792
|
-
return throwOnError(...params);
|
|
793
|
-
}
|
|
794
|
-
return !!throwOnError;
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
// ../../node_modules/.bun/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/environmentManager.js
|
|
798
|
-
var environmentManager = /* @__PURE__ */ (() => {
|
|
799
|
-
let isServerFn = () => isServer;
|
|
800
|
-
return {
|
|
801
|
-
/**
|
|
802
|
-
* Returns whether the current runtime should be treated as a server environment.
|
|
803
|
-
*/
|
|
804
|
-
isServer() {
|
|
805
|
-
return isServerFn();
|
|
806
|
-
},
|
|
807
|
-
/**
|
|
808
|
-
* Overrides the server check globally.
|
|
809
|
-
*/
|
|
810
|
-
setIsServer(isServerValue) {
|
|
811
|
-
isServerFn = isServerValue;
|
|
812
|
-
}
|
|
813
|
-
};
|
|
814
|
-
})();
|
|
815
|
-
|
|
816
|
-
// ../../node_modules/.bun/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
817
|
-
function pendingThenable() {
|
|
818
|
-
let resolve;
|
|
819
|
-
let reject;
|
|
820
|
-
const thenable = new Promise((_resolve, _reject) => {
|
|
821
|
-
resolve = _resolve;
|
|
822
|
-
reject = _reject;
|
|
823
|
-
});
|
|
824
|
-
thenable.status = "pending";
|
|
825
|
-
thenable.catch(() => {
|
|
826
|
-
});
|
|
827
|
-
function finalize(data) {
|
|
828
|
-
Object.assign(thenable, data);
|
|
829
|
-
delete thenable.resolve;
|
|
830
|
-
delete thenable.reject;
|
|
831
|
-
}
|
|
832
|
-
thenable.resolve = (value) => {
|
|
833
|
-
finalize({
|
|
834
|
-
status: "fulfilled",
|
|
835
|
-
value
|
|
836
|
-
});
|
|
837
|
-
resolve(value);
|
|
838
|
-
};
|
|
839
|
-
thenable.reject = (reason) => {
|
|
840
|
-
finalize({
|
|
841
|
-
status: "rejected",
|
|
842
|
-
reason
|
|
843
|
-
});
|
|
844
|
-
reject(reason);
|
|
845
|
-
};
|
|
846
|
-
return thenable;
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
// ../../node_modules/.bun/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/notifyManager.js
|
|
850
|
-
var defaultScheduler = systemSetTimeoutZero;
|
|
851
|
-
function createNotifyManager() {
|
|
852
|
-
let queue = [];
|
|
853
|
-
let transactions = 0;
|
|
854
|
-
let notifyFn = (callback) => {
|
|
855
|
-
callback();
|
|
856
|
-
};
|
|
857
|
-
let batchNotifyFn = (callback) => {
|
|
858
|
-
callback();
|
|
859
|
-
};
|
|
860
|
-
let scheduleFn = defaultScheduler;
|
|
861
|
-
const schedule = (callback) => {
|
|
862
|
-
if (transactions) {
|
|
863
|
-
queue.push(callback);
|
|
864
|
-
} else {
|
|
865
|
-
scheduleFn(() => {
|
|
866
|
-
notifyFn(callback);
|
|
867
|
-
});
|
|
868
|
-
}
|
|
869
|
-
};
|
|
870
|
-
const flush = () => {
|
|
871
|
-
const originalQueue = queue;
|
|
872
|
-
queue = [];
|
|
873
|
-
if (originalQueue.length) {
|
|
874
|
-
scheduleFn(() => {
|
|
875
|
-
batchNotifyFn(() => {
|
|
876
|
-
originalQueue.forEach((callback) => {
|
|
877
|
-
notifyFn(callback);
|
|
878
|
-
});
|
|
879
|
-
});
|
|
880
|
-
});
|
|
881
|
-
}
|
|
882
|
-
};
|
|
883
|
-
return {
|
|
884
|
-
batch: (callback) => {
|
|
885
|
-
let result;
|
|
886
|
-
transactions++;
|
|
887
|
-
try {
|
|
888
|
-
result = callback();
|
|
889
|
-
} finally {
|
|
890
|
-
transactions--;
|
|
891
|
-
if (!transactions) {
|
|
892
|
-
flush();
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
return result;
|
|
896
|
-
},
|
|
897
|
-
/**
|
|
898
|
-
* All calls to the wrapped function will be batched.
|
|
899
|
-
*/
|
|
900
|
-
batchCalls: (callback) => {
|
|
901
|
-
return (...args) => {
|
|
902
|
-
schedule(() => {
|
|
903
|
-
callback(...args);
|
|
904
|
-
});
|
|
905
|
-
};
|
|
906
|
-
},
|
|
907
|
-
schedule,
|
|
908
|
-
/**
|
|
909
|
-
* Use this method to set a custom notify function.
|
|
910
|
-
* This can be used to for example wrap notifications with `React.act` while running tests.
|
|
911
|
-
*/
|
|
912
|
-
setNotifyFunction: (fn) => {
|
|
913
|
-
notifyFn = fn;
|
|
914
|
-
},
|
|
915
|
-
/**
|
|
916
|
-
* Use this method to set a custom function to batch notifications together into a single tick.
|
|
917
|
-
* By default React Query will use the batch function provided by ReactDOM or React Native.
|
|
918
|
-
*/
|
|
919
|
-
setBatchNotifyFunction: (fn) => {
|
|
920
|
-
batchNotifyFn = fn;
|
|
921
|
-
},
|
|
922
|
-
setScheduler: (fn) => {
|
|
923
|
-
scheduleFn = fn;
|
|
924
|
-
}
|
|
925
|
-
};
|
|
926
|
-
}
|
|
927
|
-
var notifyManager = createNotifyManager();
|
|
928
|
-
|
|
929
|
-
// ../../node_modules/.bun/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/onlineManager.js
|
|
930
|
-
var OnlineManager = class extends Subscribable {
|
|
931
|
-
#online = true;
|
|
932
|
-
#cleanup;
|
|
933
|
-
#setup;
|
|
934
|
-
constructor() {
|
|
935
|
-
super();
|
|
936
|
-
this.#setup = (onOnline) => {
|
|
937
|
-
if (typeof window !== "undefined" && window.addEventListener) {
|
|
938
|
-
const onlineListener = () => onOnline(true);
|
|
939
|
-
const offlineListener = () => onOnline(false);
|
|
940
|
-
window.addEventListener("online", onlineListener, false);
|
|
941
|
-
window.addEventListener("offline", offlineListener, false);
|
|
942
|
-
return () => {
|
|
943
|
-
window.removeEventListener("online", onlineListener);
|
|
944
|
-
window.removeEventListener("offline", offlineListener);
|
|
945
|
-
};
|
|
946
|
-
}
|
|
947
|
-
return;
|
|
948
|
-
};
|
|
949
|
-
}
|
|
950
|
-
onSubscribe() {
|
|
951
|
-
if (!this.#cleanup) {
|
|
952
|
-
this.setEventListener(this.#setup);
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
onUnsubscribe() {
|
|
956
|
-
if (!this.hasListeners()) {
|
|
957
|
-
this.#cleanup?.();
|
|
958
|
-
this.#cleanup = void 0;
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
setEventListener(setup) {
|
|
962
|
-
this.#setup = setup;
|
|
963
|
-
this.#cleanup?.();
|
|
964
|
-
this.#cleanup = setup(this.setOnline.bind(this));
|
|
965
|
-
}
|
|
966
|
-
setOnline(online) {
|
|
967
|
-
const changed = this.#online !== online;
|
|
968
|
-
if (changed) {
|
|
969
|
-
this.#online = online;
|
|
970
|
-
this.listeners.forEach((listener) => {
|
|
971
|
-
listener(online);
|
|
972
|
-
});
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
isOnline() {
|
|
976
|
-
return this.#online;
|
|
977
|
-
}
|
|
978
|
-
};
|
|
979
|
-
var onlineManager = new OnlineManager();
|
|
980
|
-
|
|
981
|
-
// ../../node_modules/.bun/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/retryer.js
|
|
982
|
-
function canFetch(networkMode) {
|
|
983
|
-
return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true;
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
// ../../node_modules/.bun/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/query.js
|
|
987
|
-
function fetchState(data, options) {
|
|
988
|
-
return {
|
|
989
|
-
fetchFailureCount: 0,
|
|
990
|
-
fetchFailureReason: null,
|
|
991
|
-
fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused",
|
|
992
|
-
...data === void 0 && {
|
|
993
|
-
error: null,
|
|
994
|
-
status: "pending"
|
|
995
|
-
}
|
|
996
|
-
};
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
// ../../node_modules/.bun/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
1000
|
-
var QueryObserver = class extends Subscribable {
|
|
1001
|
-
constructor(client, options) {
|
|
1002
|
-
super();
|
|
1003
|
-
this.options = options;
|
|
1004
|
-
this.#client = client;
|
|
1005
|
-
this.#selectError = null;
|
|
1006
|
-
this.#currentThenable = pendingThenable();
|
|
1007
|
-
this.bindMethods();
|
|
1008
|
-
this.setOptions(options);
|
|
1009
|
-
}
|
|
1010
|
-
#client;
|
|
1011
|
-
#currentQuery = void 0;
|
|
1012
|
-
#currentQueryInitialState = void 0;
|
|
1013
|
-
#currentResult = void 0;
|
|
1014
|
-
#currentResultState;
|
|
1015
|
-
#currentResultOptions;
|
|
1016
|
-
#currentThenable;
|
|
1017
|
-
#selectError;
|
|
1018
|
-
#selectFn;
|
|
1019
|
-
#selectResult;
|
|
1020
|
-
// This property keeps track of the last query with defined data.
|
|
1021
|
-
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
1022
|
-
#lastQueryWithDefinedData;
|
|
1023
|
-
#staleTimeoutId;
|
|
1024
|
-
#refetchIntervalId;
|
|
1025
|
-
#currentRefetchInterval;
|
|
1026
|
-
#trackedProps = /* @__PURE__ */ new Set();
|
|
1027
|
-
bindMethods() {
|
|
1028
|
-
this.refetch = this.refetch.bind(this);
|
|
1029
|
-
}
|
|
1030
|
-
onSubscribe() {
|
|
1031
|
-
if (this.listeners.size === 1) {
|
|
1032
|
-
this.#currentQuery.addObserver(this);
|
|
1033
|
-
if (shouldFetchOnMount(this.#currentQuery, this.options)) {
|
|
1034
|
-
this.#executeFetch();
|
|
1035
|
-
} else {
|
|
1036
|
-
this.updateResult();
|
|
1037
|
-
}
|
|
1038
|
-
this.#updateTimers();
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
onUnsubscribe() {
|
|
1042
|
-
if (!this.hasListeners()) {
|
|
1043
|
-
this.destroy();
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
shouldFetchOnReconnect() {
|
|
1047
|
-
return shouldFetchOn(
|
|
1048
|
-
this.#currentQuery,
|
|
1049
|
-
this.options,
|
|
1050
|
-
this.options.refetchOnReconnect
|
|
1051
|
-
);
|
|
1052
|
-
}
|
|
1053
|
-
shouldFetchOnWindowFocus() {
|
|
1054
|
-
return shouldFetchOn(
|
|
1055
|
-
this.#currentQuery,
|
|
1056
|
-
this.options,
|
|
1057
|
-
this.options.refetchOnWindowFocus
|
|
1058
|
-
);
|
|
1059
|
-
}
|
|
1060
|
-
destroy() {
|
|
1061
|
-
this.listeners = /* @__PURE__ */ new Set();
|
|
1062
|
-
this.#clearStaleTimeout();
|
|
1063
|
-
this.#clearRefetchInterval();
|
|
1064
|
-
this.#currentQuery.removeObserver(this);
|
|
1065
|
-
}
|
|
1066
|
-
setOptions(options) {
|
|
1067
|
-
const prevOptions = this.options;
|
|
1068
|
-
const prevQuery = this.#currentQuery;
|
|
1069
|
-
this.options = this.#client.defaultQueryOptions(options);
|
|
1070
|
-
if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== "boolean") {
|
|
1071
|
-
throw new Error(
|
|
1072
|
-
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
1073
|
-
);
|
|
1074
|
-
}
|
|
1075
|
-
this.#updateQuery();
|
|
1076
|
-
this.#currentQuery.setOptions(this.options);
|
|
1077
|
-
if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {
|
|
1078
|
-
this.#client.getQueryCache().notify({
|
|
1079
|
-
type: "observerOptionsUpdated",
|
|
1080
|
-
query: this.#currentQuery,
|
|
1081
|
-
observer: this
|
|
1082
|
-
});
|
|
1083
|
-
}
|
|
1084
|
-
const mounted = this.hasListeners();
|
|
1085
|
-
if (mounted && shouldFetchOptionally(
|
|
1086
|
-
this.#currentQuery,
|
|
1087
|
-
prevQuery,
|
|
1088
|
-
this.options,
|
|
1089
|
-
prevOptions
|
|
1090
|
-
)) {
|
|
1091
|
-
this.#executeFetch();
|
|
1092
|
-
}
|
|
1093
|
-
this.updateResult();
|
|
1094
|
-
if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) {
|
|
1095
|
-
this.#updateStaleTimeout();
|
|
1096
|
-
}
|
|
1097
|
-
const nextRefetchInterval = this.#computeRefetchInterval();
|
|
1098
|
-
if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) {
|
|
1099
|
-
this.#updateRefetchInterval(nextRefetchInterval);
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
getOptimisticResult(options) {
|
|
1103
|
-
const query = this.#client.getQueryCache().build(this.#client, options);
|
|
1104
|
-
const result = this.createResult(query, options);
|
|
1105
|
-
if (shouldAssignObserverCurrentProperties(this, result)) {
|
|
1106
|
-
this.#currentResult = result;
|
|
1107
|
-
this.#currentResultOptions = this.options;
|
|
1108
|
-
this.#currentResultState = this.#currentQuery.state;
|
|
1109
|
-
}
|
|
1110
|
-
return result;
|
|
1111
|
-
}
|
|
1112
|
-
getCurrentResult() {
|
|
1113
|
-
return this.#currentResult;
|
|
1114
|
-
}
|
|
1115
|
-
trackResult(result, onPropTracked) {
|
|
1116
|
-
return new Proxy(result, {
|
|
1117
|
-
get: (target, key) => {
|
|
1118
|
-
this.trackProp(key);
|
|
1119
|
-
onPropTracked?.(key);
|
|
1120
|
-
if (key === "promise") {
|
|
1121
|
-
this.trackProp("data");
|
|
1122
|
-
if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") {
|
|
1123
|
-
this.#currentThenable.reject(
|
|
1124
|
-
new Error(
|
|
1125
|
-
"experimental_prefetchInRender feature flag is not enabled"
|
|
1126
|
-
)
|
|
1127
|
-
);
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
return Reflect.get(target, key);
|
|
1131
|
-
}
|
|
1132
|
-
});
|
|
1133
|
-
}
|
|
1134
|
-
trackProp(key) {
|
|
1135
|
-
this.#trackedProps.add(key);
|
|
1136
|
-
}
|
|
1137
|
-
getCurrentQuery() {
|
|
1138
|
-
return this.#currentQuery;
|
|
1139
|
-
}
|
|
1140
|
-
refetch({ ...options } = {}) {
|
|
1141
|
-
return this.fetch({
|
|
1142
|
-
...options
|
|
1143
|
-
});
|
|
1144
|
-
}
|
|
1145
|
-
fetchOptimistic(options) {
|
|
1146
|
-
const defaultedOptions = this.#client.defaultQueryOptions(options);
|
|
1147
|
-
const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);
|
|
1148
|
-
return query.fetch().then(() => this.createResult(query, defaultedOptions));
|
|
1149
|
-
}
|
|
1150
|
-
fetch(fetchOptions) {
|
|
1151
|
-
return this.#executeFetch({
|
|
1152
|
-
...fetchOptions,
|
|
1153
|
-
cancelRefetch: fetchOptions.cancelRefetch ?? true
|
|
1154
|
-
}).then(() => {
|
|
1155
|
-
this.updateResult();
|
|
1156
|
-
return this.#currentResult;
|
|
1157
|
-
});
|
|
1158
|
-
}
|
|
1159
|
-
#executeFetch(fetchOptions) {
|
|
1160
|
-
this.#updateQuery();
|
|
1161
|
-
let promise = this.#currentQuery.fetch(
|
|
1162
|
-
this.options,
|
|
1163
|
-
fetchOptions
|
|
1164
|
-
);
|
|
1165
|
-
if (!fetchOptions?.throwOnError) {
|
|
1166
|
-
promise = promise.catch(noop);
|
|
1167
|
-
}
|
|
1168
|
-
return promise;
|
|
1169
|
-
}
|
|
1170
|
-
#updateStaleTimeout() {
|
|
1171
|
-
this.#clearStaleTimeout();
|
|
1172
|
-
const staleTime = resolveStaleTime(
|
|
1173
|
-
this.options.staleTime,
|
|
1174
|
-
this.#currentQuery
|
|
1175
|
-
);
|
|
1176
|
-
if (environmentManager.isServer() || this.#currentResult.isStale || !isValidTimeout(staleTime)) {
|
|
1177
|
-
return;
|
|
1178
|
-
}
|
|
1179
|
-
const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime);
|
|
1180
|
-
const timeout = time + 1;
|
|
1181
|
-
this.#staleTimeoutId = timeoutManager.setTimeout(() => {
|
|
1182
|
-
if (!this.#currentResult.isStale) {
|
|
1183
|
-
this.updateResult();
|
|
1184
|
-
}
|
|
1185
|
-
}, timeout);
|
|
1186
|
-
}
|
|
1187
|
-
#computeRefetchInterval() {
|
|
1188
|
-
return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;
|
|
1189
|
-
}
|
|
1190
|
-
#updateRefetchInterval(nextInterval) {
|
|
1191
|
-
this.#clearRefetchInterval();
|
|
1192
|
-
this.#currentRefetchInterval = nextInterval;
|
|
1193
|
-
if (environmentManager.isServer() || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {
|
|
1194
|
-
return;
|
|
1195
|
-
}
|
|
1196
|
-
this.#refetchIntervalId = timeoutManager.setInterval(() => {
|
|
1197
|
-
if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {
|
|
1198
|
-
this.#executeFetch();
|
|
1199
|
-
}
|
|
1200
|
-
}, this.#currentRefetchInterval);
|
|
1201
|
-
}
|
|
1202
|
-
#updateTimers() {
|
|
1203
|
-
this.#updateStaleTimeout();
|
|
1204
|
-
this.#updateRefetchInterval(this.#computeRefetchInterval());
|
|
1205
|
-
}
|
|
1206
|
-
#clearStaleTimeout() {
|
|
1207
|
-
if (this.#staleTimeoutId) {
|
|
1208
|
-
timeoutManager.clearTimeout(this.#staleTimeoutId);
|
|
1209
|
-
this.#staleTimeoutId = void 0;
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
#clearRefetchInterval() {
|
|
1213
|
-
if (this.#refetchIntervalId) {
|
|
1214
|
-
timeoutManager.clearInterval(this.#refetchIntervalId);
|
|
1215
|
-
this.#refetchIntervalId = void 0;
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
createResult(query, options) {
|
|
1219
|
-
const prevQuery = this.#currentQuery;
|
|
1220
|
-
const prevOptions = this.options;
|
|
1221
|
-
const prevResult = this.#currentResult;
|
|
1222
|
-
const prevResultState = this.#currentResultState;
|
|
1223
|
-
const prevResultOptions = this.#currentResultOptions;
|
|
1224
|
-
const queryChange = query !== prevQuery;
|
|
1225
|
-
const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState;
|
|
1226
|
-
const { state } = query;
|
|
1227
|
-
let newState = { ...state };
|
|
1228
|
-
let isPlaceholderData = false;
|
|
1229
|
-
let data;
|
|
1230
|
-
if (options._optimisticResults) {
|
|
1231
|
-
const mounted = this.hasListeners();
|
|
1232
|
-
const fetchOnMount = !mounted && shouldFetchOnMount(query, options);
|
|
1233
|
-
const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);
|
|
1234
|
-
if (fetchOnMount || fetchOptionally) {
|
|
1235
|
-
newState = {
|
|
1236
|
-
...newState,
|
|
1237
|
-
...fetchState(state.data, query.options)
|
|
1238
|
-
};
|
|
1239
|
-
}
|
|
1240
|
-
if (options._optimisticResults === "isRestoring") {
|
|
1241
|
-
newState.fetchStatus = "idle";
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
let { error, errorUpdatedAt, status } = newState;
|
|
1245
|
-
data = newState.data;
|
|
1246
|
-
let skipSelect = false;
|
|
1247
|
-
if (options.placeholderData !== void 0 && data === void 0 && status === "pending") {
|
|
1248
|
-
let placeholderData;
|
|
1249
|
-
if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {
|
|
1250
|
-
placeholderData = prevResult.data;
|
|
1251
|
-
skipSelect = true;
|
|
1252
|
-
} else {
|
|
1253
|
-
placeholderData = typeof options.placeholderData === "function" ? options.placeholderData(
|
|
1254
|
-
this.#lastQueryWithDefinedData?.state.data,
|
|
1255
|
-
this.#lastQueryWithDefinedData
|
|
1256
|
-
) : options.placeholderData;
|
|
1257
|
-
}
|
|
1258
|
-
if (placeholderData !== void 0) {
|
|
1259
|
-
status = "success";
|
|
1260
|
-
data = replaceData(
|
|
1261
|
-
prevResult?.data,
|
|
1262
|
-
placeholderData,
|
|
1263
|
-
options
|
|
1264
|
-
);
|
|
1265
|
-
isPlaceholderData = true;
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
if (options.select && data !== void 0 && !skipSelect) {
|
|
1269
|
-
if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) {
|
|
1270
|
-
data = this.#selectResult;
|
|
1271
|
-
} else {
|
|
1272
|
-
try {
|
|
1273
|
-
this.#selectFn = options.select;
|
|
1274
|
-
data = options.select(data);
|
|
1275
|
-
data = replaceData(prevResult?.data, data, options);
|
|
1276
|
-
this.#selectResult = data;
|
|
1277
|
-
this.#selectError = null;
|
|
1278
|
-
} catch (selectError) {
|
|
1279
|
-
this.#selectError = selectError;
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
if (this.#selectError) {
|
|
1284
|
-
error = this.#selectError;
|
|
1285
|
-
data = this.#selectResult;
|
|
1286
|
-
errorUpdatedAt = Date.now();
|
|
1287
|
-
status = "error";
|
|
1288
|
-
}
|
|
1289
|
-
const isFetching = newState.fetchStatus === "fetching";
|
|
1290
|
-
const isPending = status === "pending";
|
|
1291
|
-
const isError = status === "error";
|
|
1292
|
-
const isLoading = isPending && isFetching;
|
|
1293
|
-
const hasData = data !== void 0;
|
|
1294
|
-
const result = {
|
|
1295
|
-
status,
|
|
1296
|
-
fetchStatus: newState.fetchStatus,
|
|
1297
|
-
isPending,
|
|
1298
|
-
isSuccess: status === "success",
|
|
1299
|
-
isError,
|
|
1300
|
-
isInitialLoading: isLoading,
|
|
1301
|
-
isLoading,
|
|
1302
|
-
data,
|
|
1303
|
-
dataUpdatedAt: newState.dataUpdatedAt,
|
|
1304
|
-
error,
|
|
1305
|
-
errorUpdatedAt,
|
|
1306
|
-
failureCount: newState.fetchFailureCount,
|
|
1307
|
-
failureReason: newState.fetchFailureReason,
|
|
1308
|
-
errorUpdateCount: newState.errorUpdateCount,
|
|
1309
|
-
isFetched: query.isFetched(),
|
|
1310
|
-
isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,
|
|
1311
|
-
isFetching,
|
|
1312
|
-
isRefetching: isFetching && !isPending,
|
|
1313
|
-
isLoadingError: isError && !hasData,
|
|
1314
|
-
isPaused: newState.fetchStatus === "paused",
|
|
1315
|
-
isPlaceholderData,
|
|
1316
|
-
isRefetchError: isError && hasData,
|
|
1317
|
-
isStale: isStale(query, options),
|
|
1318
|
-
refetch: this.refetch,
|
|
1319
|
-
promise: this.#currentThenable,
|
|
1320
|
-
isEnabled: resolveEnabled(options.enabled, query) !== false
|
|
1321
|
-
};
|
|
1322
|
-
const nextResult = result;
|
|
1323
|
-
if (this.options.experimental_prefetchInRender) {
|
|
1324
|
-
const hasResultData = nextResult.data !== void 0;
|
|
1325
|
-
const isErrorWithoutData = nextResult.status === "error" && !hasResultData;
|
|
1326
|
-
const finalizeThenableIfPossible = (thenable) => {
|
|
1327
|
-
if (isErrorWithoutData) {
|
|
1328
|
-
thenable.reject(nextResult.error);
|
|
1329
|
-
} else if (hasResultData) {
|
|
1330
|
-
thenable.resolve(nextResult.data);
|
|
1331
|
-
}
|
|
1332
|
-
};
|
|
1333
|
-
const recreateThenable = () => {
|
|
1334
|
-
const pending = this.#currentThenable = nextResult.promise = pendingThenable();
|
|
1335
|
-
finalizeThenableIfPossible(pending);
|
|
1336
|
-
};
|
|
1337
|
-
const prevThenable = this.#currentThenable;
|
|
1338
|
-
switch (prevThenable.status) {
|
|
1339
|
-
case "pending":
|
|
1340
|
-
if (query.queryHash === prevQuery.queryHash) {
|
|
1341
|
-
finalizeThenableIfPossible(prevThenable);
|
|
1342
|
-
}
|
|
1343
|
-
break;
|
|
1344
|
-
case "fulfilled":
|
|
1345
|
-
if (isErrorWithoutData || nextResult.data !== prevThenable.value) {
|
|
1346
|
-
recreateThenable();
|
|
1347
|
-
}
|
|
1348
|
-
break;
|
|
1349
|
-
case "rejected":
|
|
1350
|
-
if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {
|
|
1351
|
-
recreateThenable();
|
|
1352
|
-
}
|
|
1353
|
-
break;
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
return nextResult;
|
|
1357
|
-
}
|
|
1358
|
-
updateResult() {
|
|
1359
|
-
const prevResult = this.#currentResult;
|
|
1360
|
-
const nextResult = this.createResult(this.#currentQuery, this.options);
|
|
1361
|
-
this.#currentResultState = this.#currentQuery.state;
|
|
1362
|
-
this.#currentResultOptions = this.options;
|
|
1363
|
-
if (this.#currentResultState.data !== void 0) {
|
|
1364
|
-
this.#lastQueryWithDefinedData = this.#currentQuery;
|
|
1365
|
-
}
|
|
1366
|
-
if (shallowEqualObjects(nextResult, prevResult)) {
|
|
1367
|
-
return;
|
|
1368
|
-
}
|
|
1369
|
-
this.#currentResult = nextResult;
|
|
1370
|
-
const shouldNotifyListeners = () => {
|
|
1371
|
-
if (!prevResult) {
|
|
1372
|
-
return true;
|
|
1373
|
-
}
|
|
1374
|
-
const { notifyOnChangeProps } = this.options;
|
|
1375
|
-
const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps;
|
|
1376
|
-
if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) {
|
|
1377
|
-
return true;
|
|
1378
|
-
}
|
|
1379
|
-
const includedProps = new Set(
|
|
1380
|
-
notifyOnChangePropsValue ?? this.#trackedProps
|
|
1381
|
-
);
|
|
1382
|
-
if (this.options.throwOnError) {
|
|
1383
|
-
includedProps.add("error");
|
|
1384
|
-
}
|
|
1385
|
-
return Object.keys(this.#currentResult).some((key) => {
|
|
1386
|
-
const typedKey = key;
|
|
1387
|
-
const changed = this.#currentResult[typedKey] !== prevResult[typedKey];
|
|
1388
|
-
return changed && includedProps.has(typedKey);
|
|
1389
|
-
});
|
|
1390
|
-
};
|
|
1391
|
-
this.#notify({ listeners: shouldNotifyListeners() });
|
|
1392
|
-
}
|
|
1393
|
-
#updateQuery() {
|
|
1394
|
-
const query = this.#client.getQueryCache().build(this.#client, this.options);
|
|
1395
|
-
if (query === this.#currentQuery) {
|
|
1396
|
-
return;
|
|
1397
|
-
}
|
|
1398
|
-
const prevQuery = this.#currentQuery;
|
|
1399
|
-
this.#currentQuery = query;
|
|
1400
|
-
this.#currentQueryInitialState = query.state;
|
|
1401
|
-
if (this.hasListeners()) {
|
|
1402
|
-
prevQuery?.removeObserver(this);
|
|
1403
|
-
query.addObserver(this);
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
onQueryUpdate() {
|
|
1407
|
-
this.updateResult();
|
|
1408
|
-
if (this.hasListeners()) {
|
|
1409
|
-
this.#updateTimers();
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
#notify(notifyOptions) {
|
|
1413
|
-
notifyManager.batch(() => {
|
|
1414
|
-
if (notifyOptions.listeners) {
|
|
1415
|
-
this.listeners.forEach((listener) => {
|
|
1416
|
-
listener(this.#currentResult);
|
|
1417
|
-
});
|
|
1418
|
-
}
|
|
1419
|
-
this.#client.getQueryCache().notify({
|
|
1420
|
-
query: this.#currentQuery,
|
|
1421
|
-
type: "observerResultsUpdated"
|
|
1422
|
-
});
|
|
1423
|
-
});
|
|
1424
|
-
}
|
|
1425
|
-
};
|
|
1426
|
-
function shouldLoadOnMount(query, options) {
|
|
1427
|
-
return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false);
|
|
1428
|
-
}
|
|
1429
|
-
function shouldFetchOnMount(query, options) {
|
|
1430
|
-
return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);
|
|
1431
|
-
}
|
|
1432
|
-
function shouldFetchOn(query, options, field) {
|
|
1433
|
-
if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") {
|
|
1434
|
-
const value = typeof field === "function" ? field(query) : field;
|
|
1435
|
-
return value === "always" || value !== false && isStale(query, options);
|
|
1436
|
-
}
|
|
1437
|
-
return false;
|
|
1438
|
-
}
|
|
1439
|
-
function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
|
|
1440
|
-
return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
|
|
1441
|
-
}
|
|
1442
|
-
function isStale(query, options) {
|
|
1443
|
-
return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));
|
|
1444
|
-
}
|
|
1445
|
-
function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
|
|
1446
|
-
if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {
|
|
1447
|
-
return true;
|
|
1448
|
-
}
|
|
1449
|
-
return false;
|
|
1450
|
-
}
|
|
1451
|
-
var QueryClientContext = React5.createContext(
|
|
1452
|
-
void 0
|
|
1453
|
-
);
|
|
1454
|
-
var useQueryClient = (queryClient) => {
|
|
1455
|
-
const client = React5.useContext(QueryClientContext);
|
|
1456
|
-
if (!client) {
|
|
1457
|
-
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1458
|
-
}
|
|
1459
|
-
return client;
|
|
1460
|
-
};
|
|
1461
|
-
var IsRestoringContext = React5.createContext(false);
|
|
1462
|
-
var useIsRestoring = () => React5.useContext(IsRestoringContext);
|
|
1463
|
-
IsRestoringContext.Provider;
|
|
1464
|
-
function createValue() {
|
|
1465
|
-
let isReset = false;
|
|
1466
|
-
return {
|
|
1467
|
-
clearReset: () => {
|
|
1468
|
-
isReset = false;
|
|
1469
|
-
},
|
|
1470
|
-
reset: () => {
|
|
1471
|
-
isReset = true;
|
|
1472
|
-
},
|
|
1473
|
-
isReset: () => {
|
|
1474
|
-
return isReset;
|
|
1475
|
-
}
|
|
1476
|
-
};
|
|
1477
|
-
}
|
|
1478
|
-
var QueryErrorResetBoundaryContext = React5.createContext(createValue());
|
|
1479
|
-
var useQueryErrorResetBoundary = () => React5.useContext(QueryErrorResetBoundaryContext);
|
|
1480
|
-
var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {
|
|
1481
|
-
const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;
|
|
1482
|
-
if (options.suspense || options.experimental_prefetchInRender || throwOnError) {
|
|
1483
|
-
if (!errorResetBoundary.isReset()) {
|
|
1484
|
-
options.retryOnMount = false;
|
|
1485
|
-
}
|
|
1486
|
-
}
|
|
1487
|
-
};
|
|
1488
|
-
var useClearResetErrorBoundary = (errorResetBoundary) => {
|
|
1489
|
-
React5.useEffect(() => {
|
|
1490
|
-
errorResetBoundary.clearReset();
|
|
1491
|
-
}, [errorResetBoundary]);
|
|
1492
|
-
};
|
|
1493
|
-
var getHasError = ({
|
|
1494
|
-
result,
|
|
1495
|
-
errorResetBoundary,
|
|
1496
|
-
throwOnError,
|
|
1497
|
-
query,
|
|
1498
|
-
suspense
|
|
1499
|
-
}) => {
|
|
1500
|
-
return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));
|
|
1501
|
-
};
|
|
1502
|
-
|
|
1503
|
-
// ../../node_modules/.bun/@tanstack+react-query@5.96.1+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/suspense.js
|
|
1504
|
-
var ensureSuspenseTimers = (defaultedOptions) => {
|
|
1505
|
-
if (defaultedOptions.suspense) {
|
|
1506
|
-
const MIN_SUSPENSE_TIME_MS = 1e3;
|
|
1507
|
-
const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);
|
|
1508
|
-
const originalStaleTime = defaultedOptions.staleTime;
|
|
1509
|
-
defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);
|
|
1510
|
-
if (typeof defaultedOptions.gcTime === "number") {
|
|
1511
|
-
defaultedOptions.gcTime = Math.max(
|
|
1512
|
-
defaultedOptions.gcTime,
|
|
1513
|
-
MIN_SUSPENSE_TIME_MS
|
|
1514
|
-
);
|
|
1515
|
-
}
|
|
1516
|
-
}
|
|
1517
|
-
};
|
|
1518
|
-
var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
|
|
1519
|
-
var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;
|
|
1520
|
-
var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
|
|
1521
|
-
errorResetBoundary.clearReset();
|
|
1522
|
-
});
|
|
1523
|
-
function useBaseQuery(options, Observer, queryClient) {
|
|
1524
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1525
|
-
if (typeof options !== "object" || Array.isArray(options)) {
|
|
1526
|
-
throw new Error(
|
|
1527
|
-
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
1528
|
-
);
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
const isRestoring = useIsRestoring();
|
|
1532
|
-
const errorResetBoundary = useQueryErrorResetBoundary();
|
|
1533
|
-
const client = useQueryClient();
|
|
1534
|
-
const defaultedOptions = client.defaultQueryOptions(options);
|
|
1535
|
-
client.getDefaultOptions().queries?._experimental_beforeQuery?.(
|
|
1536
|
-
defaultedOptions
|
|
1537
|
-
);
|
|
1538
|
-
const query = client.getQueryCache().get(defaultedOptions.queryHash);
|
|
1539
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1540
|
-
if (!defaultedOptions.queryFn) {
|
|
1541
|
-
console.error(
|
|
1542
|
-
`[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
1543
|
-
);
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1546
|
-
defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic";
|
|
1547
|
-
ensureSuspenseTimers(defaultedOptions);
|
|
1548
|
-
ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);
|
|
1549
|
-
useClearResetErrorBoundary(errorResetBoundary);
|
|
1550
|
-
const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);
|
|
1551
|
-
const [observer] = React5.useState(
|
|
1552
|
-
() => new Observer(
|
|
1553
|
-
client,
|
|
1554
|
-
defaultedOptions
|
|
1555
|
-
)
|
|
1556
|
-
);
|
|
1557
|
-
const result = observer.getOptimisticResult(defaultedOptions);
|
|
1558
|
-
const shouldSubscribe = !isRestoring && options.subscribed !== false;
|
|
1559
|
-
React5.useSyncExternalStore(
|
|
1560
|
-
React5.useCallback(
|
|
1561
|
-
(onStoreChange) => {
|
|
1562
|
-
const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;
|
|
1563
|
-
observer.updateResult();
|
|
1564
|
-
return unsubscribe;
|
|
1565
|
-
},
|
|
1566
|
-
[observer, shouldSubscribe]
|
|
1567
|
-
),
|
|
1568
|
-
() => observer.getCurrentResult(),
|
|
1569
|
-
() => observer.getCurrentResult()
|
|
1570
|
-
);
|
|
1571
|
-
React5.useEffect(() => {
|
|
1572
|
-
observer.setOptions(defaultedOptions);
|
|
1573
|
-
}, [defaultedOptions, observer]);
|
|
1574
|
-
if (shouldSuspend(defaultedOptions, result)) {
|
|
1575
|
-
throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);
|
|
1576
|
-
}
|
|
1577
|
-
if (getHasError({
|
|
1578
|
-
result,
|
|
1579
|
-
errorResetBoundary,
|
|
1580
|
-
throwOnError: defaultedOptions.throwOnError,
|
|
1581
|
-
query,
|
|
1582
|
-
suspense: defaultedOptions.suspense
|
|
1583
|
-
})) {
|
|
1584
|
-
throw result.error;
|
|
1585
|
-
}
|
|
1586
|
-
client.getDefaultOptions().queries?._experimental_afterQuery?.(
|
|
1587
|
-
defaultedOptions,
|
|
1588
|
-
result
|
|
1589
|
-
);
|
|
1590
|
-
if (defaultedOptions.experimental_prefetchInRender && !environmentManager.isServer() && willFetch(result, isRestoring)) {
|
|
1591
|
-
const promise = isNewCacheEntry ? (
|
|
1592
|
-
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1593
|
-
fetchOptimistic(defaultedOptions, observer, errorResetBoundary)
|
|
1594
|
-
) : (
|
|
1595
|
-
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1596
|
-
query?.promise
|
|
1597
|
-
);
|
|
1598
|
-
promise?.catch(noop).finally(() => {
|
|
1599
|
-
observer.updateResult();
|
|
1600
|
-
});
|
|
1601
|
-
}
|
|
1602
|
-
return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
|
|
1603
|
-
}
|
|
1604
|
-
|
|
1605
|
-
// ../../node_modules/.bun/@tanstack+react-query@5.96.1+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useQuery.js
|
|
1606
|
-
function useQuery(options, queryClient) {
|
|
1607
|
-
return useBaseQuery(options, QueryObserver);
|
|
1608
|
-
}
|
|
1609
|
-
|
|
1610
|
-
// src/hooks/injectFontLink.ts
|
|
1611
|
-
var injectFontLink = (font) => {
|
|
1612
|
-
const href = GOOGLE_FONTS_HREF[font];
|
|
1613
|
-
if (!href) return;
|
|
1614
|
-
const existing = document.head.querySelector(`link[data-font="${font}"]`);
|
|
1615
|
-
if (existing) return;
|
|
1616
|
-
const link = document.createElement("link");
|
|
1617
|
-
link.rel = "stylesheet";
|
|
1618
|
-
link.href = href;
|
|
1619
|
-
link.setAttribute("data-font", font);
|
|
1620
|
-
document.head.appendChild(link);
|
|
1621
|
-
};
|
|
1622
|
-
|
|
1623
|
-
// src/hooks/useFontDownload.ts
|
|
1624
|
-
var fetchFontCss = async (font) => {
|
|
1625
|
-
const href = GOOGLE_FONTS_HREF[font];
|
|
1626
|
-
if (!href) {
|
|
1627
|
-
throw new Error(`Font "${font}" not found in Google Fonts`);
|
|
1628
|
-
}
|
|
1629
|
-
const response = await fetch(href);
|
|
1630
|
-
if (!response.ok) {
|
|
1631
|
-
throw new Error(`Failed to download font: HTTP ${response.status}`);
|
|
1632
|
-
}
|
|
1633
|
-
await response.text();
|
|
1634
|
-
injectFontLink(font);
|
|
1635
|
-
return { font, success: true };
|
|
1636
|
-
};
|
|
1637
|
-
var useFontDownload = (font) => {
|
|
1638
|
-
const queryClient = useQueryClient();
|
|
1639
|
-
const markFontDownloaded = useSettingsStore((state) => state.markFontDownloaded);
|
|
1640
|
-
const downloadedFonts = useSettingsStore((state) => state.downloadedFonts);
|
|
1641
|
-
const isDownloaded = font ? downloadedFonts.includes(font) : false;
|
|
1642
|
-
const needsDownload = font && !isDownloaded && GOOGLE_FONTS_HREF[font];
|
|
1643
|
-
const query = useQuery({
|
|
1644
|
-
queryKey: ["font", font ?? ""],
|
|
1645
|
-
queryFn: async ({ queryKey }) => {
|
|
1646
|
-
const [, fontName] = queryKey;
|
|
1647
|
-
if (!fontName || !GOOGLE_FONTS_HREF[fontName]) {
|
|
1648
|
-
throw new Error(`Font "${fontName}" not available`);
|
|
1649
|
-
}
|
|
1650
|
-
const result = await fetchFontCss(fontName);
|
|
1651
|
-
if (result.success) {
|
|
1652
|
-
markFontDownloaded(fontName);
|
|
1653
|
-
}
|
|
1654
|
-
return result;
|
|
1655
|
-
},
|
|
1656
|
-
enabled: !!needsDownload,
|
|
1657
|
-
staleTime: Infinity,
|
|
1658
|
-
gcTime: Infinity,
|
|
1659
|
-
retry: false
|
|
1660
|
-
});
|
|
1661
|
-
const progress = query.isFetching ? { status: "downloading", loaded: 0, total: null, percent: null, error: null } : query.isError ? {
|
|
1662
|
-
status: "error",
|
|
1663
|
-
loaded: 0,
|
|
1664
|
-
total: null,
|
|
1665
|
-
percent: null,
|
|
1666
|
-
error: query.error?.message ?? "Unknown error"
|
|
1667
|
-
} : query.isSuccess ? { status: "done", loaded: 0, total: 0, percent: 100, error: null } : { status: "idle", loaded: 0, total: null, percent: null, error: null };
|
|
1668
|
-
const reset = () => {
|
|
1669
|
-
if (font) {
|
|
1670
|
-
queryClient.removeQueries({ queryKey: ["font", font] });
|
|
1671
|
-
}
|
|
1672
|
-
};
|
|
1673
|
-
return {
|
|
1674
|
-
...query,
|
|
1675
|
-
progress,
|
|
1676
|
-
isDownloaded,
|
|
1677
|
-
reset
|
|
1678
|
-
};
|
|
1679
|
-
};
|
|
1680
|
-
var ERROR_COLOR = PRESET_COLORS[1];
|
|
1681
|
-
var FontDownloadStatus = ({ status, error, onDownload }) => {
|
|
1682
|
-
const { t } = useTranslation("settings");
|
|
1683
|
-
if (error) {
|
|
1684
|
-
return /* @__PURE__ */ jsx(Badge, { color: ERROR_COLOR, variant: "filled", size: "sm", "aria-label": `Download error: ${error}`, children: t("common:status.error") });
|
|
1685
|
-
}
|
|
1686
|
-
return /* @__PURE__ */ jsx(
|
|
1687
|
-
Button,
|
|
1688
|
-
{
|
|
1689
|
-
size: "xs",
|
|
1690
|
-
variant: "light",
|
|
1691
|
-
onClick: onDownload,
|
|
1692
|
-
loading: status === "downloading",
|
|
1693
|
-
"aria-label": t("font.download"),
|
|
1694
|
-
children: t("font.download")
|
|
1695
|
-
}
|
|
1696
|
-
);
|
|
1697
|
-
};
|
|
1698
|
-
var FontSettings = () => {
|
|
1699
|
-
const { t } = useTranslation("settings");
|
|
1700
|
-
const font = useSettingsStore((state) => state.font);
|
|
1701
|
-
const setFont = useSettingsStore((state) => state.setFont);
|
|
1702
|
-
const fontSize = useSettingsStore((state) => state.fontSize);
|
|
1703
|
-
const setFontSize = useSettingsStore((state) => state.setFontSize);
|
|
1704
|
-
const downloadedFonts = useSettingsStore((state) => state.downloadedFonts);
|
|
1705
|
-
const markFontDownloaded = useSettingsStore((state) => state.markFontDownloaded);
|
|
1706
|
-
const [activeDownload, setActiveDownload] = useState(null);
|
|
1707
|
-
const fontDownload = useFontDownload(activeDownload);
|
|
1708
|
-
useEffect(() => {
|
|
1709
|
-
if (fontDownload.isSuccess && fontDownload.data?.success && activeDownload) {
|
|
1710
|
-
if (!downloadedFonts.includes(activeDownload)) {
|
|
1711
|
-
markFontDownloaded(activeDownload);
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
}, [
|
|
1715
|
-
fontDownload.isSuccess,
|
|
1716
|
-
fontDownload.data,
|
|
1717
|
-
activeDownload,
|
|
1718
|
-
downloadedFonts,
|
|
1719
|
-
markFontDownloaded
|
|
1720
|
-
]);
|
|
1721
|
-
const handleDownloadFont = useCallback((fontName) => {
|
|
1722
|
-
setActiveDownload(fontName);
|
|
1723
|
-
}, []);
|
|
1724
|
-
const getFontStatus = (fontName) => {
|
|
1725
|
-
if (downloadedFonts.includes(fontName)) return "done";
|
|
1726
|
-
if (activeDownload === fontName) {
|
|
1727
|
-
return fontDownload.progress.status;
|
|
1728
|
-
}
|
|
1729
|
-
return "idle";
|
|
1730
|
-
};
|
|
1731
|
-
const getFontError = (fontName) => {
|
|
1732
|
-
if (activeDownload === fontName) {
|
|
1733
|
-
return fontDownload.progress.error;
|
|
1734
|
-
}
|
|
1735
|
-
return null;
|
|
1736
|
-
};
|
|
1737
|
-
const handleDownloadCustomFont = useCallback((customName) => {
|
|
1738
|
-
const trimmed = customName.trim();
|
|
1739
|
-
if (!trimmed) return;
|
|
1740
|
-
const familyParam = trimmed.replace(/\s+/g, "+");
|
|
1741
|
-
const href = `https://fonts.googleapis.com/css2?family=${familyParam}&display=swap`;
|
|
1742
|
-
GOOGLE_FONTS_HREF[trimmed] = href;
|
|
1743
|
-
setActiveDownload(trimmed);
|
|
1744
|
-
}, []);
|
|
1745
|
-
const availableFontValues = AVAILABLE_FONTS.map((f) => f.value);
|
|
1746
|
-
const customFonts = downloadedFonts.filter((f) => !availableFontValues.includes(f));
|
|
1747
|
-
return /* @__PURE__ */ jsxs(Stack, { gap: "md", p: "md", children: [
|
|
1748
|
-
/* @__PURE__ */ jsx(Text, { fw: 600, size: "lg", children: t("font.title") }),
|
|
1749
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: t("font.description") }),
|
|
1750
|
-
/* @__PURE__ */ jsx(
|
|
1751
|
-
Radio.Group,
|
|
1752
|
-
{
|
|
1753
|
-
value: font,
|
|
1754
|
-
onChange: setFont,
|
|
1755
|
-
"aria-label": t("font.selectionAria", { defaultValue: "Font selection" }),
|
|
1756
|
-
children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
1757
|
-
AVAILABLE_FONTS.map((f) => {
|
|
1758
|
-
const hasGoogleFont = !!GOOGLE_FONTS_HREF[f.value];
|
|
1759
|
-
const isDownloaded = downloadedFonts.includes(f.value);
|
|
1760
|
-
const status = getFontStatus(f.value);
|
|
1761
|
-
const error = getFontError(f.value);
|
|
1762
|
-
const isReady = !hasGoogleFont || isDownloaded || status === "done";
|
|
1763
|
-
return /* @__PURE__ */ jsx(Paper, { p: "sm", withBorder: true, radius: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
1764
|
-
/* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
|
|
1765
|
-
/* @__PURE__ */ jsx(
|
|
1766
|
-
Radio,
|
|
1767
|
-
{
|
|
1768
|
-
value: f.value,
|
|
1769
|
-
label: f.label,
|
|
1770
|
-
"aria-label": f.label,
|
|
1771
|
-
disabled: !isReady
|
|
1772
|
-
}
|
|
1773
|
-
),
|
|
1774
|
-
/* @__PURE__ */ jsxs(Group, { gap: "xs", align: "center", children: [
|
|
1775
|
-
isReady && /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { fontFamily: f.stack }, children: "AaBbCcDd" }),
|
|
1776
|
-
hasGoogleFont && /* @__PURE__ */ jsx(
|
|
1777
|
-
FontDownloadStatus,
|
|
1778
|
-
{
|
|
1779
|
-
fontLabel: f.label,
|
|
1780
|
-
status,
|
|
1781
|
-
error,
|
|
1782
|
-
onDownload: () => handleDownloadFont(f.value),
|
|
1783
|
-
isDownloaded
|
|
1784
|
-
}
|
|
1785
|
-
)
|
|
1786
|
-
] })
|
|
1787
|
-
] }),
|
|
1788
|
-
hasGoogleFont && status === "downloading" && /* @__PURE__ */ jsx(DownloadProgress_default, { state: fontDownload.progress })
|
|
1789
|
-
] }) }, f.value);
|
|
1790
|
-
}),
|
|
1791
|
-
customFonts.map((fontName) => /* @__PURE__ */ jsx(Paper, { p: "sm", withBorder: true, radius: "md", children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
|
|
1792
|
-
/* @__PURE__ */ jsx(Radio, { value: fontName, label: fontName, "aria-label": fontName }),
|
|
1793
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { fontFamily: `"${fontName}"` }, children: "AaBbCcDd" })
|
|
1794
|
-
] }) }, fontName))
|
|
1795
|
-
] })
|
|
1796
|
-
}
|
|
1797
|
-
),
|
|
1798
|
-
/* @__PURE__ */ jsx(Paper, { p: "sm", withBorder: true, radius: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
1799
|
-
/* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
|
|
1800
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: t("font.fontSize") }),
|
|
1801
|
-
/* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
|
|
1802
|
-
fontSize,
|
|
1803
|
-
"px"
|
|
1804
|
-
] })
|
|
1805
|
-
] }),
|
|
1806
|
-
/* @__PURE__ */ jsx(
|
|
1807
|
-
Slider,
|
|
1808
|
-
{
|
|
1809
|
-
value: fontSize,
|
|
1810
|
-
onChange: setFontSize,
|
|
1811
|
-
min: 10,
|
|
1812
|
-
max: 24,
|
|
1813
|
-
step: 1,
|
|
1814
|
-
marks: [{ value: 10 }, { value: 14 }, { value: 18 }, { value: 20 }, { value: 24 }],
|
|
1815
|
-
"aria-label": t("font.fontSizeAria", { defaultValue: "Font size" })
|
|
1816
|
-
}
|
|
1817
|
-
)
|
|
1818
|
-
] }) }),
|
|
1819
|
-
/* @__PURE__ */ jsx(
|
|
1820
|
-
CustomFontDownloader,
|
|
1821
|
-
{
|
|
1822
|
-
onDownload: handleDownloadCustomFont,
|
|
1823
|
-
activeDownload,
|
|
1824
|
-
fontDownload
|
|
1825
|
-
}
|
|
1826
|
-
)
|
|
1827
|
-
] });
|
|
1828
|
-
};
|
|
1829
|
-
var CustomFontDownloader = ({
|
|
1830
|
-
onDownload,
|
|
1831
|
-
activeDownload,
|
|
1832
|
-
fontDownload
|
|
1833
|
-
}) => {
|
|
1834
|
-
const { t } = useTranslation("settings");
|
|
1835
|
-
const [customFontName, setCustomFontName] = useState("");
|
|
1836
|
-
const isActive = activeDownload === customFontName.trim();
|
|
1837
|
-
const status = isActive ? fontDownload.progress.status : "idle";
|
|
1838
|
-
const hasError = isActive && fontDownload.progress.status === "error";
|
|
1839
|
-
const handleNameChange = useCallback(
|
|
1840
|
-
(value) => {
|
|
1841
|
-
setCustomFontName(value);
|
|
1842
|
-
if (hasError) {
|
|
1843
|
-
fontDownload.reset?.();
|
|
1844
|
-
}
|
|
1845
|
-
},
|
|
1846
|
-
[hasError, fontDownload]
|
|
1847
|
-
);
|
|
1848
|
-
const handleDownloadClick = useCallback(() => {
|
|
1849
|
-
onDownload(customFontName);
|
|
1850
|
-
}, [customFontName, onDownload]);
|
|
1851
|
-
const isSuccess = isActive && status === "done";
|
|
1852
|
-
return /* @__PURE__ */ jsx(Paper, { p: "sm", withBorder: true, radius: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
1853
|
-
/* @__PURE__ */ jsxs(Text, { size: "sm", fw: 500, children: [
|
|
1854
|
-
t("font.downloadByName"),
|
|
1855
|
-
" ",
|
|
1856
|
-
/* @__PURE__ */ jsx("a", { href: "https://fonts.google.com/", target: "_blank", rel: "noreferrer", children: t("font.fromGoogleFonts") })
|
|
1857
|
-
] }),
|
|
1858
|
-
/* @__PURE__ */ jsxs(Group, { gap: "xs", align: "flex-start", children: [
|
|
1859
|
-
/* @__PURE__ */ jsx(
|
|
1860
|
-
TextInput,
|
|
1861
|
-
{
|
|
1862
|
-
placeholder: t("font.namePlaceholder", { defaultValue: "e.g. Open Sans" }),
|
|
1863
|
-
value: customFontName,
|
|
1864
|
-
onChange: (e) => handleNameChange(e.currentTarget.value),
|
|
1865
|
-
style: { flex: 1 },
|
|
1866
|
-
"aria-label": t("font.customNameAria", { defaultValue: "Custom font name" }),
|
|
1867
|
-
error: hasError ? t("font.downloadError") : void 0
|
|
1868
|
-
}
|
|
1869
|
-
),
|
|
1870
|
-
/* @__PURE__ */ jsx(
|
|
1871
|
-
Button,
|
|
1872
|
-
{
|
|
1873
|
-
onClick: handleDownloadClick,
|
|
1874
|
-
disabled: !customFontName.trim() || status === "downloading",
|
|
1875
|
-
loading: status === "downloading",
|
|
1876
|
-
"aria-label": t("font.downloadCustomAria", { defaultValue: "Download custom font" }),
|
|
1877
|
-
style: { marginTop: hasError ? 0 : void 0 },
|
|
1878
|
-
children: t("font.download")
|
|
1879
|
-
}
|
|
1880
|
-
)
|
|
1881
|
-
] }),
|
|
1882
|
-
status === "downloading" && /* @__PURE__ */ jsx(DownloadProgress_default, { state: fontDownload.progress }),
|
|
1883
|
-
isSuccess && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: t("font.downloadSuccess") })
|
|
1884
|
-
] }) });
|
|
1885
|
-
};
|
|
1886
|
-
var FontSettings_default = FontSettings;
|
|
1887
|
-
|
|
1888
|
-
// src/infrastructure/i18nConstants.ts
|
|
1889
|
-
var SUPPORTED_LANGUAGES2 = ["en", "es"];
|
|
1890
|
-
var DEFAULT_LANGUAGE2 = "en";
|
|
1891
|
-
|
|
1892
|
-
// src/components/Shared/LanguageFlag/LanguageFlag.module.css
|
|
1893
|
-
var LanguageFlag_default = {};
|
|
1894
|
-
var FLAGS = {
|
|
1895
|
-
en: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 60 40", className: LanguageFlag_default.flag, children: [
|
|
1896
|
-
/* @__PURE__ */ jsx("rect", { fill: "#012169", width: "60", height: "40" }),
|
|
1897
|
-
/* @__PURE__ */ jsx("path", { d: "M0,0 L60,40 M60,0 L0,40", stroke: "#fff", strokeWidth: "6" }),
|
|
1898
|
-
/* @__PURE__ */ jsx("path", { d: "M0,0 L60,40 M60,0 L0,40", stroke: "#C8102E", strokeWidth: "4" }),
|
|
1899
|
-
/* @__PURE__ */ jsx("path", { d: "M30,0 V40 M0,20 H60", stroke: "#fff", strokeWidth: "10" }),
|
|
1900
|
-
/* @__PURE__ */ jsx("path", { d: "M30,0 V40 M0,20 H60", stroke: "#C8102E", strokeWidth: "6" })
|
|
1901
|
-
] }),
|
|
1902
|
-
es: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 60 40", className: LanguageFlag_default.flag, children: [
|
|
1903
|
-
/* @__PURE__ */ jsx("rect", { fill: "#C60B1E", width: "60", height: "40" }),
|
|
1904
|
-
/* @__PURE__ */ jsx("rect", { fill: "#FFC400", y: "10", width: "60", height: "20" })
|
|
1905
|
-
] })
|
|
1906
|
-
};
|
|
1907
|
-
var LanguageFlag = ({ lang, size = 20 }) => /* @__PURE__ */ jsx(
|
|
1908
|
-
"div",
|
|
1909
|
-
{
|
|
1910
|
-
style: { width: size * 1.5, height: size },
|
|
1911
|
-
className: LanguageFlag_default.container,
|
|
1912
|
-
"aria-label": lang === "en" ? "English" : "Espa\xF1ol",
|
|
1913
|
-
"data-testid": `flag-${lang}`,
|
|
1914
|
-
children: FLAGS[lang]
|
|
1915
|
-
}
|
|
1916
|
-
);
|
|
1917
|
-
var LanguageFlag_default2 = LanguageFlag;
|
|
1918
|
-
var LANGUAGE_NAMES = {
|
|
1919
|
-
en: "English",
|
|
1920
|
-
es: "Espa\xF1ol"
|
|
1921
|
-
};
|
|
1922
|
-
var LanguageSettings = () => {
|
|
1923
|
-
const { t } = useTranslation("settings");
|
|
1924
|
-
const language = useSettingsStore((state) => state.language);
|
|
1925
|
-
const setLanguage = useSettingsStore((state) => state.setLanguage);
|
|
1926
|
-
const handleSelect = useCallback(
|
|
1927
|
-
(lang) => {
|
|
1928
|
-
setLanguage(lang);
|
|
1929
|
-
},
|
|
1930
|
-
[setLanguage]
|
|
1931
|
-
);
|
|
1932
|
-
return /* @__PURE__ */ jsx(SettingsSection_default, { title: t("language.title"), description: t("language.description"), children: /* @__PURE__ */ jsx(Stack, { gap: "xs", children: SUPPORTED_LANGUAGES2.map((lang) => /* @__PURE__ */ jsx(
|
|
1933
|
-
UnstyledButton,
|
|
1934
|
-
{
|
|
1935
|
-
onClick: () => handleSelect(lang),
|
|
1936
|
-
"aria-label": LANGUAGE_NAMES[lang],
|
|
1937
|
-
"aria-pressed": lang === language,
|
|
1938
|
-
style: {
|
|
1939
|
-
padding: "12px 16px",
|
|
1940
|
-
borderRadius: 8,
|
|
1941
|
-
width: "100%",
|
|
1942
|
-
background: lang === language ? "var(--mantine-primary-color-light)" : "transparent",
|
|
1943
|
-
border: lang === language ? "1px solid var(--mantine-primary-color-filled)" : "1px solid transparent",
|
|
1944
|
-
transition: "all 0.15s ease",
|
|
1945
|
-
cursor: "pointer"
|
|
1946
|
-
},
|
|
1947
|
-
children: /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
|
|
1948
|
-
/* @__PURE__ */ jsx(LanguageFlag_default2, { lang, size: 24 }),
|
|
1949
|
-
/* @__PURE__ */ jsx(Text, { fw: lang === language ? 600 : 400, children: LANGUAGE_NAMES[lang] })
|
|
1950
|
-
] })
|
|
1951
|
-
},
|
|
1952
|
-
lang
|
|
1953
|
-
)) }) });
|
|
1954
|
-
};
|
|
1955
|
-
var LanguageSettings_default = LanguageSettings;
|
|
1956
|
-
|
|
1957
|
-
// src/utils/clearBrowserData.ts
|
|
1958
|
-
async function clearBrowserData(options) {
|
|
1959
|
-
const globalScope = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : void 0;
|
|
1960
|
-
if (!globalScope) {
|
|
1961
|
-
return;
|
|
1962
|
-
}
|
|
1963
|
-
if (!options?.keepServiceWorker && "serviceWorker" in globalScope.navigator) {
|
|
1964
|
-
const registrations = await globalScope.navigator.serviceWorker.getRegistrations();
|
|
1965
|
-
for (const registration of registrations) {
|
|
1966
|
-
await registration.unregister();
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
if ("caches" in globalScope) {
|
|
1970
|
-
const cacheNames = await globalScope.caches.keys();
|
|
1971
|
-
for (const name of cacheNames) {
|
|
1972
|
-
await globalScope.caches.delete(name);
|
|
1973
|
-
}
|
|
1974
|
-
}
|
|
1975
|
-
if (!options?.keepIndexedDB && "indexedDB" in globalScope) {
|
|
1976
|
-
const dbs = await globalScope.indexedDB.databases();
|
|
1977
|
-
for (const db of dbs) {
|
|
1978
|
-
if (db.name) {
|
|
1979
|
-
globalScope.indexedDB.deleteDatabase(db.name);
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
if (!options?.keepLocalStorage && "localStorage" in globalScope) {
|
|
1984
|
-
globalScope.localStorage.clear();
|
|
1985
|
-
}
|
|
1986
|
-
if (!options?.keepSessionStorage && "sessionStorage" in globalScope) {
|
|
1987
|
-
globalScope.sessionStorage.clear();
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
// src/utils/resetDockerWorkspace.ts
|
|
1992
|
-
async function resetDockerWorkspace() {
|
|
1993
|
-
if (!isDocker()) return;
|
|
1994
|
-
await fetch("/api/fs/reset", { method: "POST" });
|
|
1995
|
-
await fetch("/api/fs/seed", { method: "POST" });
|
|
1996
|
-
}
|
|
1997
|
-
var ResetSettings = () => {
|
|
1998
|
-
const { t } = useTranslation("settings");
|
|
1999
|
-
const [modalOpen, setModalOpen] = useState(false);
|
|
2000
|
-
const handleOpenModal = useCallback(() => {
|
|
2001
|
-
setModalOpen(true);
|
|
2002
|
-
}, []);
|
|
2003
|
-
const handleCloseModal = useCallback(() => {
|
|
2004
|
-
setModalOpen(false);
|
|
2005
|
-
}, []);
|
|
2006
|
-
const handleConfirmReset = useCallback(async () => {
|
|
2007
|
-
await resetDockerWorkspace();
|
|
2008
|
-
await clearBrowserData();
|
|
2009
|
-
window.location.reload();
|
|
2010
|
-
}, []);
|
|
2011
|
-
const handleKeepFiles = useCallback(async () => {
|
|
2012
|
-
await resetDockerWorkspace();
|
|
2013
|
-
await clearBrowserData({ keepIndexedDB: true });
|
|
2014
|
-
window.location.reload();
|
|
2015
|
-
}, []);
|
|
2016
|
-
return /* @__PURE__ */ jsxs(SettingsSection_default, { title: t("reset.title"), description: t("reset.description"), children: [
|
|
2017
|
-
/* @__PURE__ */ jsx(Button, { color: "red", onClick: handleOpenModal, style: { alignSelf: "flex-start" }, children: t("reset.resetButton") }),
|
|
2018
|
-
modalOpen && /* @__PURE__ */ jsx(
|
|
2019
|
-
Box,
|
|
2020
|
-
{
|
|
2021
|
-
style: {
|
|
2022
|
-
position: "fixed",
|
|
2023
|
-
top: 0,
|
|
2024
|
-
left: 0,
|
|
2025
|
-
right: 0,
|
|
2026
|
-
bottom: 0,
|
|
2027
|
-
background: "rgba(0,0,0,0.5)",
|
|
2028
|
-
display: "flex",
|
|
2029
|
-
alignItems: "center",
|
|
2030
|
-
justifyContent: "center",
|
|
2031
|
-
zIndex: 1e3
|
|
2032
|
-
},
|
|
2033
|
-
role: "dialog",
|
|
2034
|
-
"aria-label": "Confirm reset",
|
|
2035
|
-
children: /* @__PURE__ */ jsx(
|
|
2036
|
-
Box,
|
|
2037
|
-
{
|
|
2038
|
-
style: {
|
|
2039
|
-
background: "var(--mantine-color-default)",
|
|
2040
|
-
borderRadius: 8,
|
|
2041
|
-
padding: 24,
|
|
2042
|
-
maxWidth: 400,
|
|
2043
|
-
width: "100%"
|
|
2044
|
-
},
|
|
2045
|
-
children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
2046
|
-
/* @__PURE__ */ jsx(Text, { fw: 600, size: "lg", ta: "center", children: t("reset.modalTitle") }),
|
|
2047
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", ta: "center", children: t("reset.modalDescription") }),
|
|
2048
|
-
/* @__PURE__ */ jsxs(Group, { justify: "center", gap: "xs", mt: "md", children: [
|
|
2049
|
-
/* @__PURE__ */ jsx(Button, { variant: "default", onClick: handleCloseModal, children: t("reset.goBack") }),
|
|
2050
|
-
/* @__PURE__ */ jsx(Button, { color: "blue", onClick: handleKeepFiles, children: t("reset.keepFiles") }),
|
|
2051
|
-
/* @__PURE__ */ jsx(Button, { color: "red", onClick: handleConfirmReset, children: t("reset.burnEverything") })
|
|
2052
|
-
] })
|
|
2053
|
-
] })
|
|
2054
|
-
}
|
|
2055
|
-
)
|
|
2056
|
-
}
|
|
2057
|
-
)
|
|
2058
|
-
] });
|
|
2059
|
-
};
|
|
2060
|
-
var ResetSettings_default = ResetSettings;
|
|
2061
|
-
|
|
2062
|
-
// src/components/Apps/SettingsApp/SettingsApp.module.css
|
|
2063
|
-
var SettingsApp_default = {};
|
|
2064
|
-
|
|
2065
|
-
// src/constants/profileData.ts
|
|
2066
|
-
var PROFILE = {
|
|
2067
|
-
name: "Francisco N\xFA\xF1ez Palomares",
|
|
2068
|
-
title: "Fullstack Developer & DevOps",
|
|
2069
|
-
email: "frannunpal@gmail.com",
|
|
2070
|
-
phone: "+34 600 275 210",
|
|
2071
|
-
location: "Spain",
|
|
2072
|
-
linkedin: "https://www.linkedin.com/in/francisco-n\xFA\xF1ez-palomares-74a484171/",
|
|
2073
|
-
github: "https://github.com/frannunpal",
|
|
2074
|
-
cvUrls: {
|
|
2075
|
-
en: "Desktop/CV_2026_English.pdf",
|
|
2076
|
-
es: "Desktop/CV 2026.pdf"
|
|
2077
|
-
}
|
|
2078
|
-
};
|
|
2079
|
-
var APP_VERSION = "0.4.0";
|
|
2080
|
-
var getVersionString = () => APP_VERSION;
|
|
2081
|
-
var SECTION_COMPONENTS = {
|
|
2082
|
-
wallpaper: WallpaperSettings_default,
|
|
2083
|
-
appearance: AppearanceSettings_default,
|
|
2084
|
-
launcher: LauncherSettings_default,
|
|
2085
|
-
font: FontSettings_default,
|
|
2086
|
-
language: LanguageSettings_default,
|
|
2087
|
-
reset: ResetSettings_default
|
|
2088
|
-
};
|
|
2089
|
-
var SettingsApp = ({ window: window2, notifyReady }) => {
|
|
2090
|
-
const { t } = useTranslation("settings");
|
|
2091
|
-
const [activeSectionId, setActiveSectionId] = useState(null);
|
|
2092
|
-
const [isDirty, setIsDirty] = useState(false);
|
|
2093
|
-
const windows = useDesktopStore((state) => state.windows);
|
|
2094
|
-
const windowId = window2?.id ?? windows.find((w) => w.content === "settings")?.id;
|
|
2095
|
-
const wallpaper = useSettingsStore((state) => state.wallpaper);
|
|
2096
|
-
const wallpaperModule = useSettingsStore((state) => state.wallpaperModule);
|
|
2097
|
-
const theme = useSettingsStore((state) => state.theme);
|
|
2098
|
-
const font = useSettingsStore((state) => state.font);
|
|
2099
|
-
const fontSize = useSettingsStore((state) => state.fontSize);
|
|
2100
|
-
const launcherIcon = useSettingsStore((state) => state.launcherIcon);
|
|
2101
|
-
const customThemeColors = useSettingsStore((state) => state.customThemeColors);
|
|
2102
|
-
const animationDuration = useSettingsStore((state) => state.animationDuration);
|
|
2103
|
-
const setWallpaper = useSettingsStore((state) => state.setWallpaper);
|
|
2104
|
-
const setWallpaperModule = useSettingsStore((state) => state.setWallpaperModule);
|
|
2105
|
-
const setFont = useSettingsStore((state) => state.setFont);
|
|
2106
|
-
const setFontSize = useSettingsStore((state) => state.setFontSize);
|
|
2107
|
-
const setLauncherIcon = useSettingsStore((state) => state.setLauncherIcon);
|
|
2108
|
-
const setThemeMode = useSettingsStore((state) => state.setThemeMode);
|
|
2109
|
-
const setCustomThemeColors = useSettingsStore((state) => state.setCustomThemeColors);
|
|
2110
|
-
const setThemeAutomatic = useSettingsStore((state) => state.setThemeAutomatic);
|
|
2111
|
-
const setAnimationDuration = useSettingsStore((state) => state.setAnimationDuration);
|
|
2112
|
-
const snapshotRef = useRef(null);
|
|
2113
|
-
useEffect(() => {
|
|
2114
|
-
if (snapshotRef.current !== null) return;
|
|
2115
|
-
snapshotRef.current = {
|
|
2116
|
-
wallpaper,
|
|
2117
|
-
wallpaperModule,
|
|
2118
|
-
themeMode: theme.mode,
|
|
2119
|
-
font,
|
|
2120
|
-
fontSize,
|
|
2121
|
-
launcherIcon,
|
|
2122
|
-
customThemeColors,
|
|
2123
|
-
animationDuration
|
|
2124
|
-
};
|
|
2125
|
-
}, [
|
|
2126
|
-
wallpaper,
|
|
2127
|
-
wallpaperModule,
|
|
2128
|
-
theme.mode,
|
|
2129
|
-
font,
|
|
2130
|
-
fontSize,
|
|
2131
|
-
launcherIcon,
|
|
2132
|
-
customThemeColors,
|
|
2133
|
-
animationDuration
|
|
2134
|
-
]);
|
|
2135
|
-
useEffect(() => {
|
|
2136
|
-
if (!snapshotRef.current) return;
|
|
2137
|
-
const current = {
|
|
2138
|
-
wallpaper,
|
|
2139
|
-
wallpaperModule,
|
|
2140
|
-
themeMode: theme.mode,
|
|
2141
|
-
font,
|
|
2142
|
-
fontSize,
|
|
2143
|
-
launcherIcon,
|
|
2144
|
-
customThemeColors,
|
|
2145
|
-
animationDuration
|
|
2146
|
-
};
|
|
2147
|
-
const dirty = JSON.stringify(current) !== JSON.stringify(snapshotRef.current);
|
|
2148
|
-
setIsDirty(dirty);
|
|
2149
|
-
}, [
|
|
2150
|
-
wallpaper,
|
|
2151
|
-
wallpaperModule,
|
|
2152
|
-
theme.mode,
|
|
2153
|
-
font,
|
|
2154
|
-
fontSize,
|
|
2155
|
-
launcherIcon,
|
|
2156
|
-
customThemeColors,
|
|
2157
|
-
animationDuration
|
|
2158
|
-
]);
|
|
2159
|
-
const revertToSnapshot = useCallback(() => {
|
|
2160
|
-
const snapshot = snapshotRef.current;
|
|
2161
|
-
if (!snapshot) return;
|
|
2162
|
-
setWallpaper(snapshot.wallpaper);
|
|
2163
|
-
setWallpaperModule(snapshot.wallpaperModule);
|
|
2164
|
-
setFont(snapshot.font);
|
|
2165
|
-
setFontSize(snapshot.fontSize);
|
|
2166
|
-
setLauncherIcon(snapshot.launcherIcon);
|
|
2167
|
-
setAnimationDuration(snapshot.animationDuration);
|
|
2168
|
-
if (snapshot.customThemeColors) {
|
|
2169
|
-
setCustomThemeColors(snapshot.customThemeColors);
|
|
2170
|
-
} else {
|
|
2171
|
-
setCustomThemeColors(null);
|
|
2172
|
-
setThemeAutomatic();
|
|
2173
|
-
}
|
|
2174
|
-
setThemeMode(snapshot.themeMode);
|
|
2175
|
-
setIsDirty(false);
|
|
2176
|
-
}, [
|
|
2177
|
-
setWallpaper,
|
|
2178
|
-
setWallpaperModule,
|
|
2179
|
-
setFont,
|
|
2180
|
-
setFontSize,
|
|
2181
|
-
setLauncherIcon,
|
|
2182
|
-
setAnimationDuration,
|
|
2183
|
-
setThemeMode,
|
|
2184
|
-
setCustomThemeColors,
|
|
2185
|
-
setThemeAutomatic
|
|
2186
|
-
]);
|
|
2187
|
-
useEffect(() => {
|
|
2188
|
-
if (!windowId) return;
|
|
2189
|
-
useSettingsAppStore.getState().reset(windowId);
|
|
2190
|
-
}, [windowId]);
|
|
2191
|
-
useEffect(() => {
|
|
2192
|
-
if (!windowId) return;
|
|
2193
|
-
useSettingsAppStore.getState().setIsDirty(windowId, isDirty);
|
|
2194
|
-
}, [windowId, isDirty]);
|
|
2195
|
-
useEffect(() => {
|
|
2196
|
-
notifyReady?.({
|
|
2197
|
-
...window2?.contentData ?? {},
|
|
2198
|
-
discard: revertToSnapshot
|
|
2199
|
-
});
|
|
2200
|
-
}, [window2, notifyReady, revertToSnapshot]);
|
|
2201
|
-
const isDirtyGetter = useCallback(() => {
|
|
2202
|
-
if (!snapshotRef.current) return false;
|
|
2203
|
-
const current = {
|
|
2204
|
-
wallpaper: useSettingsStore.getState().wallpaper,
|
|
2205
|
-
wallpaperModule: useSettingsStore.getState().wallpaperModule,
|
|
2206
|
-
themeMode: useSettingsStore.getState().theme.mode,
|
|
2207
|
-
font: useSettingsStore.getState().font,
|
|
2208
|
-
fontSize: useSettingsStore.getState().fontSize,
|
|
2209
|
-
launcherIcon: useSettingsStore.getState().launcherIcon,
|
|
2210
|
-
customThemeColors: useSettingsStore.getState().customThemeColors,
|
|
2211
|
-
animationDuration: useSettingsStore.getState().animationDuration
|
|
2212
|
-
};
|
|
2213
|
-
return JSON.stringify(current) !== JSON.stringify(snapshotRef.current);
|
|
2214
|
-
}, []);
|
|
2215
|
-
useCloseInterceptor({
|
|
2216
|
-
isDirtyGetter,
|
|
2217
|
-
windowId,
|
|
2218
|
-
onDiscard: revertToSnapshot,
|
|
2219
|
-
onSave: () => {
|
|
2220
|
-
}
|
|
2221
|
-
});
|
|
2222
|
-
const handleSelectSection = useCallback((id) => {
|
|
2223
|
-
setActiveSectionId(id);
|
|
2224
|
-
}, []);
|
|
2225
|
-
const handleShowAll = useCallback(() => {
|
|
2226
|
-
setActiveSectionId(null);
|
|
2227
|
-
}, []);
|
|
2228
|
-
const handleContactMe = useCallback(() => {
|
|
2229
|
-
globalThis.location.href = `mailto:${PROFILE.email}`;
|
|
2230
|
-
}, []);
|
|
2231
|
-
const ActiveSection = activeSectionId ? SECTION_COMPONENTS[activeSectionId] : null;
|
|
2232
|
-
return /* @__PURE__ */ jsxs("div", { className: SettingsApp_default.root, children: [
|
|
2233
|
-
/* @__PURE__ */ jsx("aside", { className: SettingsApp_default.sidebar, children: /* @__PURE__ */ jsxs("nav", { "aria-label": "Settings sections", children: [
|
|
2234
|
-
/* @__PURE__ */ jsxs(
|
|
2235
|
-
"button",
|
|
2236
|
-
{
|
|
2237
|
-
className: SettingsApp_default.navItem,
|
|
2238
|
-
"data-active": activeSectionId === null || void 0,
|
|
2239
|
-
onClick: handleShowAll,
|
|
2240
|
-
"aria-label": "All Settings",
|
|
2241
|
-
"aria-current": activeSectionId === null ? "page" : void 0,
|
|
2242
|
-
children: [
|
|
2243
|
-
/* @__PURE__ */ jsx(AppIcon_default, { fcIcon: "FcList", size: 16 }),
|
|
2244
|
-
/* @__PURE__ */ jsx(Text, { size: "xs", ml: 6, truncate: true, children: t("all") })
|
|
2245
|
-
]
|
|
2246
|
-
}
|
|
2247
|
-
),
|
|
2248
|
-
SETTINGS_SECTIONS.map((section) => /* @__PURE__ */ jsxs(
|
|
2249
|
-
"button",
|
|
2250
|
-
{
|
|
2251
|
-
className: SettingsApp_default.navItem,
|
|
2252
|
-
"data-active": activeSectionId === section.id || void 0,
|
|
2253
|
-
onClick: () => handleSelectSection(section.id),
|
|
2254
|
-
"aria-label": section.label,
|
|
2255
|
-
"aria-current": activeSectionId === section.id ? "page" : void 0,
|
|
2256
|
-
children: [
|
|
2257
|
-
/* @__PURE__ */ jsx(AppIcon_default, { fcIcon: section.fcIcon, size: 16 }),
|
|
2258
|
-
/* @__PURE__ */ jsx(Text, { size: "xs", ml: 6, truncate: true, children: t(`sections.${section.id}.label`) })
|
|
2259
|
-
]
|
|
2260
|
-
},
|
|
2261
|
-
section.id
|
|
2262
|
-
))
|
|
2263
|
-
] }) }),
|
|
2264
|
-
/* @__PURE__ */ jsx("main", { className: SettingsApp_default.content, children: ActiveSection ? /* @__PURE__ */ jsx(ActiveSection, {}) : /* @__PURE__ */ jsxs(Stack, { className: SettingsApp_default.overviewPadding, h: "100%", justify: "space-between", gap: 0, children: [
|
|
2265
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2266
|
-
/* @__PURE__ */ jsx(Text, { fw: 500, mb: "md", size: "sm", c: "dimmed", children: t("all") }),
|
|
2267
|
-
/* @__PURE__ */ jsx(SimpleGrid, { cols: 2, spacing: "sm", children: SETTINGS_SECTIONS.map((section) => /* @__PURE__ */ jsx(
|
|
2268
|
-
Card,
|
|
2269
|
-
{
|
|
2270
|
-
withBorder: true,
|
|
2271
|
-
padding: "md",
|
|
2272
|
-
radius: "md",
|
|
2273
|
-
className: SettingsApp_default.sectionCard,
|
|
2274
|
-
onClick: () => handleSelectSection(section.id),
|
|
2275
|
-
role: "button",
|
|
2276
|
-
"aria-label": `Open ${section.label} settings`,
|
|
2277
|
-
children: /* @__PURE__ */ jsxs(Stack, { gap: 6, align: "flex-start", children: [
|
|
2278
|
-
/* @__PURE__ */ jsx(AppIcon_default, { fcIcon: section.fcIcon, size: 28 }),
|
|
2279
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: t(`sections.${section.id}.label`) }),
|
|
2280
|
-
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: t(`sections.${section.id}.description`) })
|
|
2281
|
-
] })
|
|
2282
|
-
},
|
|
2283
|
-
section.id
|
|
2284
|
-
)) })
|
|
2285
|
-
] }),
|
|
2286
|
-
/* @__PURE__ */ jsx(Button, { gradient: { from: "blue", to: "cyan", deg: 90 }, onClick: handleContactMe, children: "FDE: Fran Desktop Environment" }),
|
|
2287
|
-
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", ta: "center", className: SettingsApp_default.versionFooter, children: getVersionString() })
|
|
2288
|
-
] }) })
|
|
2289
|
-
] });
|
|
2290
|
-
};
|
|
2291
|
-
var SettingsApp_default2 = SettingsApp;
|
|
2292
|
-
|
|
2293
|
-
export { AVAILABLE_FONTS, DEFAULT_LANGUAGE2 as DEFAULT_LANGUAGE, DefaultThemeProvider, FONT_STACKS, GOOGLE_FONTS_HREF, LanguageFlag_default2 as LanguageFlag_default, PROFILE, SETTINGS_SECTIONS, SUPPORTED_LANGUAGES2 as SUPPORTED_LANGUAGES, SettingsApp_default2 as SettingsApp_default, SettingsSection_default, clearBrowserData, getPersistedThemeMode, injectFontLink, useFontDownload, useSettingsStore };
|