efficient-shell 11.12.0 → 12.0.0
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/README.md +10 -12
- package/dist/{Browser-LPGSKKLU.js → Browser-CXZAXF55.js} +17 -17
- package/dist/Calculator-TKQRQGTI.js +29 -0
- package/dist/{CurrencyConverter-N2HQT7IR.js → CurrencyConverter-WFC3TAL4.js} +12 -12
- package/dist/Files-QM5PW6BX.js +88 -0
- package/dist/{Notepad-JCWNOQET.js → Notepad-B7CKQ54M.js} +9 -9
- package/dist/PdfViewer-3UEC5TNN.js +1 -0
- package/dist/{PomodoroTimer-356JUEM3.js → PomodoroTimer-JMJORKWZ.js} +68 -68
- package/dist/{Preview-X7XNDI6X.js → Preview-OELV5X55.js} +27 -27
- package/dist/Sidebar-SZ5OGL6C.js +44 -0
- package/dist/{Stock-2XOOZNRR.js → Stock-R3436P6X.js} +3 -3
- package/dist/{Weather-ZDU2722T.js → Weather-6N3ZPO2Q.js} +18 -18
- package/dist/{WorldClock-PQGERFCH.js → WorldClock-BJKYHGLS.js} +6 -6
- package/dist/ai/index.js +58 -58
- package/dist/apps/index.d.ts +9 -27
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/StatTile.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-7V32O5NF.js → chunk-2UO47XB4.js} +14 -30
- package/dist/{chunk-FEUTN4GK.js → chunk-33F35NNM.js} +1 -1
- package/dist/{chunk-FUHURDBL.js → chunk-34AHFST2.js} +1 -1
- package/dist/{chunk-UEWB6IOD.js → chunk-3LGPZAVU.js} +2 -2
- package/dist/{chunk-4APQHXLI.js → chunk-3YQICVUP.js} +2 -2
- package/dist/{chunk-IJ6HZXZY.js → chunk-46EBZ7YI.js} +1 -1
- package/dist/{chunk-PTVTNCD6.js → chunk-46VLN6KC.js} +1 -1
- package/dist/{chunk-HOEEFFE3.js → chunk-4ALGGYHV.js} +7 -7
- package/dist/{chunk-34AHNPW7.js → chunk-4DDL6NXB.js} +1 -1
- package/dist/{chunk-F33L4J3P.js → chunk-4K7BA3PD.js} +6 -6
- package/dist/chunk-4LNO444F.js +11 -0
- package/dist/{chunk-225LCPO7.js → chunk-4MERJIJJ.js} +1 -1
- package/dist/chunk-56YJIKVI.js +11 -0
- package/dist/{chunk-GJVGGYQ2.js → chunk-5EWKVVUD.js} +1 -1
- package/dist/chunk-5PDHKH2A.js +3 -0
- package/dist/{chunk-ELIWGIR7.js → chunk-62RAGXWK.js} +9 -9
- package/dist/{chunk-NMQGAP3H.js → chunk-63ZLF7LS.js} +1 -1
- package/dist/chunk-6E47JSLM.js +22 -0
- package/dist/{chunk-3PZI2C4R.js → chunk-6HO7244M.js} +1 -1
- package/dist/{chunk-4TB4CSLB.js → chunk-6KGIHI6X.js} +9 -9
- package/dist/{chunk-OLJUPBY4.js → chunk-6MWLOLLP.js} +1 -1
- package/dist/{chunk-6WPKLF6G.js → chunk-7P2WKDGB.js} +14 -14
- package/dist/{chunk-SPMD7UZO.js → chunk-A34PD3XT.js} +16 -16
- package/dist/{chunk-KVVZLEUG.js → chunk-A3AKJDLI.js} +1 -1
- package/dist/chunk-AEMAGYIZ.js +8 -0
- package/dist/{chunk-JGWUSJDD.js → chunk-AICGATHE.js} +33 -33
- package/dist/{chunk-OCWWEHNR.js → chunk-AIJ6OR6X.js} +2 -2
- package/dist/{chunk-WOOKUEED.js → chunk-AQ3LCE2U.js} +1 -1
- package/dist/{chunk-BOJEZKYS.js → chunk-ATURDO2C.js} +12 -12
- package/dist/{chunk-ZHS2VQU7.js → chunk-B7WTHCTF.js} +3 -3
- package/dist/{chunk-LWFH5QTJ.js → chunk-BUHTLO2K.js} +1 -1
- package/dist/{chunk-EQ72AP5E.js → chunk-BYLGKRIT.js} +1 -1
- package/dist/{chunk-D5MN3LXC.js → chunk-C4T4APD6.js} +22 -22
- package/dist/{chunk-IFWXC323.js → chunk-CCA4LQNB.js} +1 -1
- package/dist/{chunk-Y4RHGLXB.js → chunk-CFJL6MML.js} +1 -1
- package/dist/{chunk-UHGAT5MH.js → chunk-CJ4U4C4A.js} +5 -5
- package/dist/{chunk-TZXAW32T.js → chunk-CRILBBSU.js} +1 -1
- package/dist/{chunk-D4RVWSUT.js → chunk-CRO56LVN.js} +1 -1
- package/dist/{chunk-DHMOJX2Z.js → chunk-D7DRZKUI.js} +1 -1
- package/dist/{chunk-6S6FJJKP.js → chunk-DD2ZGHCG.js} +6 -6
- package/dist/{chunk-GJFTO7D4.js → chunk-DSKROZST.js} +1 -1
- package/dist/{chunk-LP45EML2.js → chunk-DV4B26FJ.js} +1 -1
- package/dist/{chunk-P75N466Z.js → chunk-DW5Y57I2.js} +2 -2
- package/dist/{chunk-CAIKDX2M.js → chunk-DWYCSJ6O.js} +2 -2
- package/dist/{chunk-7A2Y3W55.js → chunk-E47TNYYE.js} +1 -1
- package/dist/{chunk-IIKPM3F4.js → chunk-ED5D2O6E.js} +1 -1
- package/dist/{chunk-HGMQOHMK.js → chunk-EFBWQWUS.js} +1 -1
- package/dist/chunk-EJBR5Y4X.js +9 -0
- package/dist/{chunk-AO7XAAGG.js → chunk-EM6VZSNJ.js} +1 -1
- package/dist/{chunk-ZA2RBNRA.js → chunk-EO3IKZCP.js} +1 -1
- package/dist/chunk-EZBE3H2W.js +9 -0
- package/dist/{chunk-PMKBWDXO.js → chunk-FGWHTNC3.js} +1 -1
- package/dist/{chunk-UOGF37Z4.js → chunk-GCRPI3AL.js} +1 -1
- package/dist/{chunk-DMBA6KYQ.js → chunk-GEQC4ABV.js} +6 -6
- package/dist/{chunk-T74FGTLW.js → chunk-GHMDLZH4.js} +7 -7
- package/dist/chunk-GWDTGCQB.js +9 -0
- package/dist/{chunk-VEATEVMV.js → chunk-H34KI3HV.js} +9 -9
- package/dist/{chunk-LXQHTY3A.js → chunk-H3IGNWT7.js} +3 -3
- package/dist/{chunk-VZ52KKNA.js → chunk-HCKCQIWA.js} +6 -6
- package/dist/{chunk-I5GDAQYL.js → chunk-HK4QAI2A.js} +2 -2
- package/dist/{chunk-FD6XZRWA.js → chunk-HKPVHSZ3.js} +1 -1
- package/dist/{chunk-GS74BABV.js → chunk-HNUKXGYP.js} +1 -1
- package/dist/{chunk-B2AYI45X.js → chunk-HTB5AEZU.js} +6 -6
- package/dist/chunk-IJXMWWTM.js +9 -0
- package/dist/{chunk-AWQ5SOC5.js → chunk-IK37Q6LY.js} +1 -1
- package/dist/{chunk-TTQJQKCE.js → chunk-IS7C6OWZ.js} +8 -8
- package/dist/{chunk-YQLKZ5UQ.js → chunk-JAQO3TNE.js} +1 -1
- package/dist/chunk-JINTE3G4.js +1 -0
- package/dist/{chunk-SKRFI6WB.js → chunk-JQHL4B4C.js} +12 -12
- package/dist/{chunk-5IESW4PM.js → chunk-JSUL7UON.js} +5 -5
- package/dist/{chunk-KV4QPU6U.js → chunk-K46DLEIX.js} +21 -21
- package/dist/{chunk-LXBBJNBQ.js → chunk-KABXUBIH.js} +1 -1
- package/dist/{chunk-CR3YDABU.js → chunk-KRH7UAD2.js} +1 -1
- package/dist/{chunk-PDFV3YQB.js → chunk-KSHNA6W2.js} +1 -1
- package/dist/{chunk-4JJ5WT4D.js → chunk-L6OPXIZN.js} +1 -1
- package/dist/{chunk-ZKBGUDNB.js → chunk-LBGRLG3Y.js} +1 -1
- package/dist/{chunk-PL4HKGYP.js → chunk-LISPTWW3.js} +1 -1
- package/dist/{chunk-HJBR73GS.js → chunk-LJN77RG6.js} +1 -1
- package/dist/chunk-LPJGF6LK.js +27 -0
- package/dist/{chunk-M4AOQYSP.js → chunk-LXHTCLNX.js} +1 -1
- package/dist/chunk-MBY5JIGB.js +1 -0
- package/dist/{chunk-L2IPWMLI.js → chunk-MOBJVNLF.js} +10 -10
- package/dist/{chunk-R6TDZ7T5.js → chunk-MQXZZBR6.js} +1 -1
- package/dist/{chunk-UCAMOW53.js → chunk-MSAQGUGU.js} +4 -4
- package/dist/{chunk-K3IUUZO5.js → chunk-N7GFQZ2J.js} +8 -8
- package/dist/chunk-N7LDQZTL.js +8 -0
- package/dist/{chunk-CR42APAY.js → chunk-NDP2I5HK.js} +6 -6
- package/dist/{chunk-VVDK7XPH.js → chunk-NIBYHQLT.js} +1 -1
- package/dist/{chunk-KYHDDVTR.js → chunk-NK5RRBXY.js} +6 -6
- package/dist/{chunk-WEEQDPU3.js → chunk-NPTHHWXZ.js} +5 -5
- package/dist/chunk-NZISMTQE.js +7 -0
- package/dist/{chunk-VIDT4JLR.js → chunk-O53EQODF.js} +1 -1
- package/dist/{chunk-HT7SOOMD.js → chunk-OAZX7ZGB.js} +10 -10
- package/dist/{chunk-4EVYK6DR.js → chunk-OMCM3SIE.js} +4 -4
- package/dist/{chunk-WZJPASST.js → chunk-OMUC6TZT.js} +6 -6
- package/dist/{chunk-PETBAYS5.js → chunk-OXVRXWJL.js} +12 -12
- package/dist/{chunk-RBAC26J7.js → chunk-P75R4EYJ.js} +3 -3
- package/dist/{chunk-JJLAI6GL.js → chunk-PB6XGDLJ.js} +8 -8
- package/dist/{chunk-HDABS36W.js → chunk-PLDMQNKD.js} +7 -7
- package/dist/{chunk-6UJYRGWY.js → chunk-QMTYILTT.js} +1 -1
- package/dist/{chunk-5KKJAYKT.js → chunk-QTNMALBN.js} +1 -1
- package/dist/{chunk-ZMC25LRC.js → chunk-RBINX62X.js} +1 -1
- package/dist/{chunk-SAASFWKB.js → chunk-RDYFZHT3.js} +1 -1
- package/dist/{chunk-JRCFOZEU.js → chunk-RLTTAH46.js} +4 -4
- package/dist/{chunk-UTITWGVW.js → chunk-RPFONHXQ.js} +1 -1
- package/dist/{chunk-2XORVHF2.js → chunk-RSPCCVN4.js} +1 -1
- package/dist/{chunk-UVMM7AYO.js → chunk-S262RGL6.js} +1 -1
- package/dist/{chunk-NPT6EXHK.js → chunk-SCPPW3ZC.js} +1 -1
- package/dist/chunk-SOWRW647.js +6 -0
- package/dist/chunk-SZC35EYE.js +28 -0
- package/dist/{chunk-6CK44QWU.js → chunk-T4WDJ7IB.js} +29 -29
- package/dist/{chunk-7FCIFHO7.js → chunk-T6BGS26U.js} +1 -1
- package/dist/{chunk-O6VIHWYU.js → chunk-TF6DYDNQ.js} +1 -1
- package/dist/{chunk-JJZAYAVL.js → chunk-THSKCKAQ.js} +1 -1
- package/dist/{chunk-64KZ74CS.js → chunk-TLE6VHMJ.js} +7 -7
- package/dist/{chunk-3N2MNOV5.js → chunk-TOSUM2OI.js} +1 -1
- package/dist/{chunk-SEP35R2E.js → chunk-TVRKONNH.js} +1 -1
- package/dist/{chunk-LLSLY6BT.js → chunk-U24GFE5L.js} +1 -1
- package/dist/{chunk-6ETRVCMH.js → chunk-UDVUVFRS.js} +12 -12
- package/dist/{chunk-OMROEVOP.js → chunk-UIOKWFT4.js} +1 -1
- package/dist/{chunk-G3FHFWC2.js → chunk-UMFEOZ75.js} +3 -3
- package/dist/{chunk-N75MPMLD.js → chunk-UNJWYV6V.js} +2 -2
- package/dist/chunk-UYNFTF6L.js +2 -0
- package/dist/{chunk-AQ7CNPEE.js → chunk-VI4NLOVJ.js} +10 -10
- package/dist/{chunk-VU5P4ZM5.js → chunk-VNAOZVSM.js} +13 -13
- package/dist/{chunk-JFCCI5L2.js → chunk-VOXX4LNC.js} +1 -1
- package/dist/{chunk-RXVFAFEB.js → chunk-VPGQMNW3.js} +1 -1
- package/dist/{chunk-GRC46C4V.js → chunk-W4UYDSTI.js} +7 -7
- package/dist/{chunk-DXKXETTT.js → chunk-WPCNJ4UL.js} +1 -1
- package/dist/{chunk-LJJ7FDAQ.js → chunk-WRJP33DN.js} +2 -2
- package/dist/{chunk-NTUZT37J.js → chunk-WRRMZAKK.js} +4 -4
- package/dist/chunk-WVIUU4BZ.js +13 -0
- package/dist/{chunk-RMSF4UCJ.js → chunk-X3NYVMXJ.js} +1 -1
- package/dist/chunk-XNFZLSWW.js +7 -0
- package/dist/{chunk-FFNPAJLS.js → chunk-XZ2WQNOX.js} +9 -9
- package/dist/chunk-XZU24YKP.js +13 -0
- package/dist/{chunk-CXZ7PHHF.js → chunk-Y3SVPBUT.js} +6 -6
- package/dist/{chunk-YOXR3VKO.js → chunk-YAZENY3X.js} +1 -1
- package/dist/{chunk-FRH2AHPI.js → chunk-YESTUDOK.js} +1 -1
- package/dist/{chunk-SSM6P43S.js → chunk-YIV7CFBG.js} +2 -2
- package/dist/{chunk-BPJ3CQH7.js → chunk-YJOJ5MUZ.js} +11 -11
- package/dist/chunk-YN5K72D6.js +5 -0
- package/dist/chunk-YQEGMCSX.js +9 -0
- package/dist/{chunk-HJM4LSMM.js → chunk-YXOFUY4J.js} +1 -1
- package/dist/{chunk-6C6M3QXL.js → chunk-ZHFKBWBU.js} +1 -1
- package/dist/{chunk-SI33IE7G.js → chunk-ZITMPMUT.js} +2 -2
- package/dist/{chunk-XOH6QERF.js → chunk-ZKYBLZPT.js} +9 -9
- package/dist/{chunk-IUG4Z2ND.js → chunk-ZU3BD75E.js} +1 -1
- package/dist/{chunk-PVVHWLNX.js → chunk-ZU432XW4.js} +1 -1
- package/dist/{chunk-5UCRYSQJ.js → chunk-ZYDRBF3H.js} +5 -5
- package/dist/{chunk-2ZAFRGRF.js → chunk-ZYJAZ5HH.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +523 -523
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +0 -265
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/shell.css +1 -12
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -8
- package/dist/Calculator-XUV5JV3O.js +0 -29
- package/dist/Documents-IRPS3N5T.js +0 -84
- package/dist/Files-VN2IOPHX.js +0 -88
- package/dist/PdfViewer-M4RTCNNE.js +0 -1
- package/dist/Sidebar-OZMJNAXN.js +0 -44
- package/dist/Spreadsheet-YQOVGIU7.js +0 -75
- package/dist/chunk-2E3K4FSQ.js +0 -13
- package/dist/chunk-2NRNKF46.js +0 -9
- package/dist/chunk-2XOH3NJZ.js +0 -27
- package/dist/chunk-5W3U3EVG.js +0 -7
- package/dist/chunk-5YP7MFPK.js +0 -1
- package/dist/chunk-7TVGP2SX.js +0 -8
- package/dist/chunk-AD27M3ZH.js +0 -9
- package/dist/chunk-CGA6RTVI.js +0 -9
- package/dist/chunk-EBGOENC3.js +0 -3
- package/dist/chunk-ES2LUEPN.js +0 -22
- package/dist/chunk-FZWSP7KJ.js +0 -28
- package/dist/chunk-IKKR2TYY.js +0 -9
- package/dist/chunk-KU4IWX6F.js +0 -2
- package/dist/chunk-L74WV4RJ.js +0 -6
- package/dist/chunk-MD6EPKOR.js +0 -11
- package/dist/chunk-MFP5KOQW.js +0 -9
- package/dist/chunk-Q7UTGO73.js +0 -11
- package/dist/chunk-QDL2FNP7.js +0 -8
- package/dist/chunk-R7KRBKFH.js +0 -5
- package/dist/chunk-UBQUXUD2.js +0 -7
- package/dist/chunk-UZTKBA7Z.js +0 -13
- package/dist/chunk-VTVSMRFX.js +0 -1
- package/dist/chunk-YXSGMPNW.js +0 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ A desktop-style React UI shell — windows, taskbar, start menu, sticky notes, f
|
|
|
6
6
|
|
|
7
7
|
### → [Live demo](https://efficient-pty-ltd.github.io/efficient-shell/)
|
|
8
8
|
|
|
9
|
-
A backend-less playground hosted on GitHub Pages. Wallpapers, themes, sticky notes, the
|
|
9
|
+
A backend-less playground hosted on GitHub Pages. Wallpapers, themes, sticky notes, the notepad, all wired to `localStorage` so the page survives a refresh. Source is in [`examples/demo/`](examples/demo/).
|
|
10
10
|
|
|
11
11
|
[](https://efficient-pty-ltd.github.io/efficient-shell/)
|
|
12
12
|
|
|
@@ -21,8 +21,10 @@ A backend-less playground hosted on GitHub Pages. Wallpapers, themes, sticky not
|
|
|
21
21
|
**Page templates:** ready-made screens composed from the primitives — `<DashboardTemplate>`, `<DataTablePage>`, `<FormLayoutPage>`, `<CheckoutTemplate>`, `<EmailTemplate>`, `<ChatTemplate>`, `<GalleryTemplate>`, `<AuthScreen>`, `<ErrorPage>`. `<ErrorBoundary>` catches a render crash and shows the 500 page in place of a blank screen.
|
|
22
22
|
|
|
23
23
|
**Apps:**
|
|
24
|
-
- **Utilities:** Calculator, Notepad,
|
|
25
|
-
- **Documents / Web:** Preview,
|
|
24
|
+
- **Utilities:** Calculator, Notepad, Weather, CurrencyConverter, PomodoroTimer, WorldClock, TodoList
|
|
25
|
+
- **Documents / Web:** Preview, Files, Browser
|
|
26
|
+
|
|
27
|
+
Documents and Spreadsheets are in [`efficient-office`](https://github.com/Efficient-Pty-Ltd/efficient-office) since 12.0.0.
|
|
26
28
|
|
|
27
29
|
Most apps ship in the `bundledApps` registry; a few (WorldClock, Notepad) want consumer-supplied prefs wiring to persist content across reloads. The bundled `Customization` settings page is also exported separately for consumers to register at `/settings/customization`.
|
|
28
30
|
|
|
@@ -1755,15 +1757,13 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
|
|
|
1755
1757
|
|
|
1756
1758
|
| Export | Type |
|
|
1757
1759
|
|---|---|
|
|
1758
|
-
| `bundledApps` | `WindowRegistry` —
|
|
1760
|
+
| `bundledApps` | `WindowRegistry` — 10 ready-to-mount apps. |
|
|
1759
1761
|
| `utilityApps`, `documentApps`, `webApps` | Subsets of `bundledApps`. |
|
|
1760
|
-
| `Calculator`, `
|
|
1762
|
+
| `Calculator`, `Weather`, `CurrencyConverter`, `PomodoroTimer`, `TodoList`, `Browser` | Lazy components — use directly in custom registry entries. |
|
|
1761
1763
|
| `PdfViewer` | Lazy component — the PDF reader on its own, for embedding. See below. |
|
|
1762
|
-
| `BUILTIN_APP_INFO` | Per-app metadata for the document/web apps (
|
|
1763
|
-
|
|
1764
|
-
**Spreadsheets** computes and formats like Excel or Google Sheets: about 120 functions, references across sheets, a formula bar with autocomplete, number formats as Excel format codes, borders, merged cells, frozen rows and columns, sort, column filters, and find and replace. `.xlsx` opens and saves with formulas and formatting and needs no dependency; `.xls` and `.ods` open through the optional `xlsx` peer. A function the engine lacks shows `#NAME?` on screen, and the formula itself is kept and saved. A formula returns one value: no spilled dynamic arrays, charts or pivot tables.
|
|
1764
|
+
| `BUILTIN_APP_INFO` | Per-app metadata for the document/web apps (Notepad, Preview, Files, Browser): display name, independent app version and one-line description. Drives each app's "About" dialog (window title menu → About <App>), which also shows the shell version. The dialog's words, and each app's description, are the strings catalog's `aboutApp` section; `description` here is its English default. |
|
|
1765
1765
|
|
|
1766
|
-
**Documents
|
|
1766
|
+
**Documents and Spreadsheets moved to `efficient-office` in 12.0.0.** `utilityApps` no longer has `/spreadsheet`, `documentApps` no longer has `/documents`, and `Documents`, `Spreadsheet`, their `BUILTIN_APP_INFO` entries and the `documents` / `spreadsheet` string sections are gone. A host registers Office's apps at those two routes itself (`efficient-office/documents`, `efficient-office/spreadsheet`). The spreadsheet stage stays here — `setSpreadsheetPreview`, `peekSpreadsheetPreviewStage`, `claimSpreadsheetPreviewStage`, `SPREADSHEET_PREVIEW_UPDATE_EVENT`, `PendingSpreadsheetStage` — and `openAttachment` still opens CSV at `/spreadsheet`, so it reaches Office's window.
|
|
1767
1767
|
|
|
1768
1768
|
#### An embedded PDF — `PdfViewer`
|
|
1769
1769
|
|
|
@@ -3926,7 +3926,7 @@ with sample arguments.
|
|
|
3926
3926
|
|
|
3927
3927
|
</details>
|
|
3928
3928
|
|
|
3929
|
-
<details><summary><code>aboutApp</code> —
|
|
3929
|
+
<details><summary><code>aboutApp</code> — 8 keys</summary>
|
|
3930
3930
|
|
|
3931
3931
|
| Key | Type | English default |
|
|
3932
3932
|
|---|---|---|
|
|
@@ -3934,9 +3934,7 @@ with sample arguments.
|
|
|
3934
3934
|
| `version` | `(version: string) => string` | `Version {version}` |
|
|
3935
3935
|
| `partOf` | `(shell: string) => string` | `Part of the {shell} desktop environment` |
|
|
3936
3936
|
| `shellVersion` | `(version: string) => string` | `shell v{version}` |
|
|
3937
|
-
| `spreadsheet` | `string` | `Multi-sheet spreadsheet editor with CSV / TSV import and export.` |
|
|
3938
3937
|
| `notepad` | `string` | `Color-coded notes with checklists, desktop stickies and entity autolinking.` |
|
|
3939
|
-
| `documents` | `string` | `Word processor that opens and saves Word files, with styles, tables, page setup and find and replace, and a plain editor for text files.` |
|
|
3940
3938
|
| `preview` | `string` | `Viewer for PDF documents, images, DXF drawings and 3D models — CAD-style measuring with object snap and an AutoCAD-like command bar.` |
|
|
3941
3939
|
| `files` | `string` | `Personal file manager with folders, uploads, quota, trash and desktop shortcut folders.` |
|
|
3942
3940
|
| `browser` | `string` | `Minimal web browser with bookmarks, history and navigation bar.` |
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import{InputEndActionButton as e}from"./chunk-
|
|
1
|
+
import{InputEndActionButton as e}from"./chunk-HNUKXGYP.js";import"./chunk-NZISMTQE.js";import"./chunk-4DDL6NXB.js";import"./chunk-AYZY3YNC.js";import"./chunk-LE5LWALR.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-YQEGMCSX.js";import{WindowTitle as n}from"./chunk-AICGATHE.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-FGWHTNC3.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-6MWLOLLP.js";import{confirm as s}from"./chunk-LPJGF6LK.js";import"./chunk-YN5K72D6.js";import"./chunk-TOSUM2OI.js";import"./chunk-3DVNXNTF.js";import"./chunk-YAZENY3X.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-KRH7UAD2.js";import"./chunk-6HO7244M.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-JINTE3G4.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KGIHI6X.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as a}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-MBY5JIGB.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function N(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,N]=c(k||b),[C,W]=c(w),[L,z]=c([w]),[D,R]=c(0),[E,H]=c(0),[S,T]=c(x),[G,M]=c(!1),[U,X]=c(null),K=i(null),O=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(S))}catch{}},[S]);const Y=e=>{const t=f(e);t&&(N(t),W(t),z(e=>{const o=e.slice(0,D+1);return o.push(t),o}),R(e=>e+1),M(!1))},J=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},A=()=>{const e=U?.trim();e?(T(t=>[...t,{label:e,url:w}]),X(null)):X(null)};l(()=>{if(null===U)return;K.current?.focus(),K.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||X(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==U]);const I=e=>{T(t=>t.filter((t,o)=>o!==e))},P=D>0,F=D<L.length-1,B=S.some(e=>e.url===w),Z="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
|
|
2
2
|
return m("div",{className:"relative flex flex-col h-full bg-white",children:[
|
|
3
|
-
/* @__PURE__ */u(n,{title:`Browser - ${
|
|
3
|
+
/* @__PURE__ */u(n,{title:`Browser - ${v(w)}`}),
|
|
4
4
|
/* @__PURE__ */u(r,{app:"browser"}),
|
|
5
5
|
/* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
|
|
6
|
-
/* @__PURE__ */u("button",{onClick:()=>{if(
|
|
7
|
-
/* @__PURE__ */u("button",{onClick:()=>{if(L
|
|
8
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
9
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
10
|
-
/* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),
|
|
6
|
+
/* @__PURE__ */u("button",{onClick:()=>{if(D>0){const e=D-1;R(e),N(L[e]),W(L[e]),M(!1)}},disabled:!P,className:Z,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
|
|
7
|
+
/* @__PURE__ */u("button",{onClick:()=>{if(D<L.length-1){const e=D+1;R(e),N(L[e]),W(L[e]),M(!1)}},disabled:!F,className:Z,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
|
|
8
|
+
/* @__PURE__ */u("button",{onClick:()=>H(e=>e+1),className:Z,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
9
|
+
/* @__PURE__ */u("button",{onClick:()=>Y(b),className:Z,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
10
|
+
/* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),Y(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
|
|
11
11
|
/* @__PURE__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
|
|
12
12
|
/* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>W(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
|
|
13
13
|
/* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>W(w)}})})]})}),
|
|
14
|
-
/* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
14
|
+
/* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>B?I(S.findIndex(e=>e.url===w)):void X(v(w)),className:Z+" "+(B?"text-yellow-500":""),title:B?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:B?"currentColor":"none",strokeWidth:1.5})}),
|
|
15
|
+
/* @__PURE__ */u("button",{onClick:J,className:Z,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>M(e=>!e),className:Z,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==U&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
|
|
17
17
|
/* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
|
|
18
18
|
/* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
|
|
19
|
-
/* @__PURE__ */u("input",{ref:
|
|
19
|
+
/* @__PURE__ */u("input",{ref:K,type:"text",value:U,onChange:e=>X(e.target.value),onKeyDown:e=>{"Enter"===e.key?A():"Escape"===e.key&&X(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
|
|
20
20
|
/* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
|
|
21
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
22
|
-
/* @__PURE__ */u("button",{onClick:
|
|
23
|
-
/* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===
|
|
21
|
+
/* @__PURE__ */u("button",{onClick:()=>X(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:A,disabled:!U.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
|
|
23
|
+
/* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===S.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),S.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>Y(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&I(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
|
|
24
24
|
/* @__PURE__ */u("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
|
|
25
25
|
/* @__PURE__ */u("div",{className:"flex-1"}),
|
|
26
26
|
/* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(p,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
|
|
27
|
-
/* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:
|
|
27
|
+
/* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:E,iframeRef:O,openExternal:J,showHelp:G,dismissHelp:()=>M(!1)})})]})}function v(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
|
|
28
28
|
/* @__PURE__ */u(a,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
|
|
29
|
-
/* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[
|
|
29
|
+
/* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[v(e)," can't be embedded"]}),
|
|
30
30
|
/* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
|
|
31
31
|
/* @__PURE__ */u("span",{className:"font-mono text-xs",children:"X-Frame-Options"})," ","or ",
|
|
32
32
|
/* @__PURE__ */u("span",{className:"font-mono text-xs",children:"Content-Security-Policy"})," header that refuses iframe embedding. The browser blocks the load before our app can do anything about it."]}),
|
|
@@ -41,4 +41,4 @@ return m("div",{className:"relative flex flex-col h-full bg-white",children:[
|
|
|
41
41
|
/* @__PURE__ */m("p",{children:["Hit the ",
|
|
42
42
|
/* @__PURE__ */u("span",{className:"font-medium",children:"↗"})," button to open the page in a real new tab. Sites that ",
|
|
43
43
|
/* @__PURE__ */u("em",{children:"do"})," allow embedding (Wikipedia, DevDocs, your own apps) work fine in here."]}),
|
|
44
|
-
/* @__PURE__ */u("button",{onClick:s,className:"mt-2 text-2xs text-blue-600 hover:underline",children:"Got it"})]})]})}export{
|
|
44
|
+
/* @__PURE__ */u("button",{onClick:s,className:"mt-2 text-2xs text-blue-600 hover:underline",children:"Got it"})]})]})}export{N as default};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-HKPVHSZ3.js";import{useWidgetSettings as n}from"./chunk-AICGATHE.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-FGWHTNC3.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-6MWLOLLP.js";import"./chunk-LPJGF6LK.js";import"./chunk-YN5K72D6.js";import"./chunk-TOSUM2OI.js";import"./chunk-3DVNXNTF.js";import"./chunk-YAZENY3X.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-KRH7UAD2.js";import"./chunk-6HO7244M.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KGIHI6X.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as r}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-MBY5JIGB.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[j,N]=c(!1),[y,x]=c(""),[f,C]=c([]),[v,$]=c(!1),[T,W]=c(()=>e(h)),[E,D]=c(!1),[H,L]=c(T),F=i(null);n(o(()=>{L({...T}),D(!0)},[T]));const M=o(e=>{x(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),S=o(()=>{k("0"),d(null),g(null),N(!1)},[]),w=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),A=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=w(p,t,b);k(String(e)),d(e),C(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,w]),G=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=w(p,e,b),n=`${p} ${b} ${e} =`;C(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,w]),J=o(()=>{k(e=>String(parseFloat(e)/100))},[]),K=o(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);s(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?M(e.key):"."===e.key?M("."):"+"===e.key?A("+"):"-"===e.key?A("-"):"*"===e.key?A("×"):"/"===e.key?(e.preventDefault(),A("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&F.current?.contains(e.target)&&e.preventDefault(),G()):"Escape"===e.key?S():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&J())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[M,A,G,S,J]);const X="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",O=`${X} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,U=`${X} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,B=`${X} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,Z=`${X} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
|
|
2
|
+
return l(a,{children:[
|
|
3
|
+
/* @__PURE__ */l("div",{ref:F,className:"flex flex-col h-full",style:{opacity:T.activeOpacity/100,backdropFilter:T.activeBlur>0?`blur(${T.activeBlur}px)`:void 0},children:[
|
|
4
|
+
/* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
|
|
5
|
+
/* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:f.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(y||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${b} ${j?"":m}`}),
|
|
6
|
+
/* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
|
|
7
|
+
/* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
|
|
8
|
+
/* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
|
|
9
|
+
/* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
|
|
10
|
+
/* @__PURE__ */u("button",{onClick:S,className:B,children:"AC"}),
|
|
11
|
+
/* @__PURE__ */u("button",{onClick:K,className:B,children:"+/−"}),
|
|
12
|
+
/* @__PURE__ */u("button",{onClick:J,className:B,children:"%"}),
|
|
13
|
+
/* @__PURE__ */u("button",{onClick:()=>A("÷"),className:`${U} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
|
|
14
|
+
/* @__PURE__ */u("button",{onClick:()=>M("7"),className:O,children:"7"}),
|
|
15
|
+
/* @__PURE__ */u("button",{onClick:()=>M("8"),className:O,children:"8"}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>M("9"),className:O,children:"9"}),
|
|
17
|
+
/* @__PURE__ */u("button",{onClick:()=>A("×"),className:`${U} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
|
|
18
|
+
/* @__PURE__ */u("button",{onClick:()=>M("4"),className:O,children:"4"}),
|
|
19
|
+
/* @__PURE__ */u("button",{onClick:()=>M("5"),className:O,children:"5"}),
|
|
20
|
+
/* @__PURE__ */u("button",{onClick:()=>M("6"),className:O,children:"6"}),
|
|
21
|
+
/* @__PURE__ */u("button",{onClick:()=>A("-"),className:`${U} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:()=>M("1"),className:O,children:"1"}),
|
|
23
|
+
/* @__PURE__ */u("button",{onClick:()=>M("2"),className:O,children:"2"}),
|
|
24
|
+
/* @__PURE__ */u("button",{onClick:()=>M("3"),className:O,children:"3"}),
|
|
25
|
+
/* @__PURE__ */u("button",{onClick:()=>A("+"),className:`${U} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
|
|
26
|
+
/* @__PURE__ */u("button",{onClick:()=>M("0"),className:`${O} col-span-2`,children:"0"}),
|
|
27
|
+
/* @__PURE__ */u("button",{onClick:()=>M("."),className:O,children:"."}),
|
|
28
|
+
/* @__PURE__ */u("button",{onClick:G,className:Z,children:"="})]})]}),
|
|
29
|
+
/* @__PURE__ */u(t,{open:E,onClose:()=>D(!1),title:"Calculator Settings",appearance:H,onAppearanceChange:L,onSave:()=>{W(H),localStorage.setItem(h,JSON.stringify(H)),D(!1)}})]})}export{m as default};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-
|
|
1
|
+
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-HKPVHSZ3.js";import{useWidgetSettings as r}from"./chunk-AICGATHE.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-FGWHTNC3.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-6MWLOLLP.js";import"./chunk-LPJGF6LK.js";import"./chunk-YN5K72D6.js";import"./chunk-TOSUM2OI.js";import"./chunk-3DVNXNTF.js";import"./chunk-YAZENY3X.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-KRH7UAD2.js";import"./chunk-6HO7244M.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KGIHI6X.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-MBY5JIGB.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function j(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(j),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[v,C]=s(!1),[U,J]=s([]),[H,L]=s(f),[A,B]=s("USD"),[G,O]=s("CNY");r(o(()=>{J([...u]),L({...f}),C(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
|
|
2
2
|
return i(a,{children:[
|
|
3
|
-
/* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[
|
|
3
|
+
/* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
|
|
4
4
|
return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
|
|
5
5
|
/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
|
|
6
|
-
/* @__PURE__ */m("span",{className:"text-base",children:
|
|
6
|
+
/* @__PURE__ */m("span",{className:"text-base",children:N[t]||""}),
|
|
7
7
|
/* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:t}),
|
|
8
8
|
/* @__PURE__ */m("svg",{className:"h-3 w-3 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}),
|
|
9
|
-
/* @__PURE__ */m("span",{className:"text-base",children:
|
|
9
|
+
/* @__PURE__ */m("span",{className:"text-base",children:N[e]||""}),
|
|
10
10
|
/* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
|
|
11
11
|
/* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
|
|
12
|
-
/* @__PURE__ */m(e,{open:v,onClose:()=>C(!1),title:"Currency Settings",appearance:
|
|
12
|
+
/* @__PURE__ */m(e,{open:v,onClose:()=>C(!1),title:"Currency Settings",appearance:H,onAppearanceChange:L,onSave:()=>{if(0===U.length)return;const t=U.slice(0,4);d(t),x(H),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(H)),C(!1)},children:/* @__PURE__ */i("div",{children:[
|
|
13
13
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
|
|
14
|
-
/* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",
|
|
15
|
-
/* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:
|
|
16
|
-
/* @__PURE__ */i("span",{className:"text-sm",children:[
|
|
17
|
-
/* @__PURE__ */m("button",{onClick:()=>
|
|
18
|
-
/* @__PURE__ */m("select",{value:
|
|
14
|
+
/* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",U.length,"/",4,")"]})]}),
|
|
15
|
+
/* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:U.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
|
|
16
|
+
/* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
|
|
17
|
+
/* @__PURE__ */m("button",{onClick:()=>J(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),U.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
|
|
18
|
+
/* @__PURE__ */m("select",{value:A,onChange:t=>B(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
|
|
19
19
|
/* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
|
|
20
|
-
/* @__PURE__ */m("select",{value:
|
|
21
|
-
/* @__PURE__ */m("button",{onClick:()=>{
|
|
20
|
+
/* @__PURE__ */m("select",{value:G,onChange:t=>O(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
|
|
21
|
+
/* @__PURE__ */m("button",{onClick:()=>{A!==G&&U.length<4&&J(t=>[...t,[A,G]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import{openPreviewFile as e}from"./chunk-D7DRZKUI.js";import{SidebarLayout as t}from"./chunk-DD2ZGHCG.js";import"./chunk-QWK6DRSN.js";import"./chunk-3LGPZAVU.js";import{Breadcrumbs as n}from"./chunk-ZU3BD75E.js";import{formatBytes as a}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{getFilesDemoTree as r}from"./chunk-34AHFST2.js";import{AboutApp as i}from"./chunk-YQEGMCSX.js";import{peekFilesViewRequest as s,consumeFilesViewRequest as o,FILES_SHOW_TRASH_EVENT as l,FILES_OPEN_DESKTOP_FOLDER_EVENT as c,subscribeDesktopFolders as d,getDesktopFoldersSnapshot as m,FolderGlyph as h,DesktopItemMiniIcon as p,desktopItemTypeLabel as u}from"./chunk-WVIUU4BZ.js";import"./chunk-ESL5TDNA.js";import{useWindowManager as f,WindowTitle as x}from"./chunk-AICGATHE.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-FGWHTNC3.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-6MWLOLLP.js";import{confirm as k,prompt as g}from"./chunk-LPJGF6LK.js";import"./chunk-YN5K72D6.js";import{ItemCount as b}from"./chunk-TOSUM2OI.js";import"./chunk-3DVNXNTF.js";import"./chunk-YAZENY3X.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-KRH7UAD2.js";import"./chunk-6HO7244M.js";import{toast_default as y}from"./chunk-A3AKJDLI.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-JINTE3G4.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KGIHI6X.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as N}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as w}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import{TH_ONE_LINE as v}from"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-MBY5JIGB.js";import"./chunk-C3QOHMR6.js";import{useState as j,useEffect as $,useSyncExternalStore as D,useRef as C,useCallback as L}from"react";import{jsxs as T,jsx as E,Fragment as R}from"react/jsx-runtime";var W="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",U={pdf:"pdf",dxf:"dxf",csv:"csv",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",stp:"3d",step:"3d",stl:"3d",obj:"3d",gltf:"3d",glb:"3d","3mf":"3d",iges:"3d",igs:"3d",ply:"3d",fbx:"3d"};function F(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function I(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function M(){const M=W.replace(/\/$/,""),P=null!==r(),[A,S]=j("/"),[O,G]=j([]),[H,J]=j([]),[K,B]=j(null),[V,Z]=j(!0),[X,Y]=j(!1),[Q,z]=j(null),[_,q]=j(!1),[ee,te]=j(()=>{const e=s();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});$(()=>{o()},[]);const[ne,ae]=j([]);$(()=>{const e=()=>{o(),te("trash")},t=e=>{o();const t=e.detail?.folderId;t&&te({desktopFolderId:t})};return window.addEventListener(l,e),window.addEventListener(c,t),()=>{window.removeEventListener(l,e),window.removeEventListener(c,t)}},[]);const re=D(d,m,m),ie="object"==typeof ee?ee.desktopFolderId:null,se=ie?re?.folders.find(e=>e.id===ie)??null:null,oe=ie&&re?.itemsByFolder[ie]||[];$(()=>{ie&&re&&!re.folders.some(e=>e.id===ie)&&te("files")},[ie,re]);const le=C(0),ce=C(null),{openPage:de,openEntity:me}=f(),he=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>de(e)}):"page"===t.entityType?de(t.entityId):me(t.entityType,t.entityId,null,t.label)},pe=L((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),ue=L(async()=>{try{const e=await pe(`${M}/api/quota`);if(e.ok){const t=await e.json();z({used:t.used,limit:t.limit})}}catch{}},[pe,M]),fe=L(async e=>{if(B(null),P){const t=function(e){const t=r();if(!t)return[];let n=t;for(const t of e.split("/").filter(Boolean)){const e=n.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];n=e.children}return n.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return G(t),S(e),Y(!1),Z(!1),void("/"===e&&J(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}Z(!0);try{const t=await pe(`${M}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void y.error(e.error||`Failed to list (${t.status})`)}const n=await t.json(),a=n.entries||[];G(a),S(n.path||e),Y(!1),"/"===(n.path||e)&&J(a.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){Y(!0)}finally{Z(!1)}ue()},[pe,M,ue,P]),xe=L(async()=>{if(P)return ae([]),void Z(!1);Z(!0),B(null);try{const e=await pe(`${M}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void y.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();ae(t.entries||[]),Y(!1)}catch{Y(!0)}finally{Z(!1)}ue()},[pe,M,ue,P]);$(()=>{"files"===ee?fe(A):"trash"===ee&&xe()},[A,ee]);const ke=async e=>{const t=F(A,e.name);try{const n=await pe(`${M}/api/file?path=${encodeURIComponent(t)}`);if(!n.ok)return void y.error(`Download failed (${n.status})`);const a=await n.blob(),r=URL.createObjectURL(a),i=document.createElement("a");i.href=r,i.download=e.name,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}catch(e){y.error(e?.message||"Download failed")}},ge=async e=>{const t=Array.from(e);for(const e of t){const t=new FormData;t.append("file",e);try{const n=await pe(`${M}/api/upload?path=${encodeURIComponent(A)}`,{method:"POST",body:t});if(!n.ok){const t=await n.json().catch(()=>({}));if(413===n.status){const n=Math.max(0,(t.limit||0)-(t.used||0));y.error(`Quota exceeded — ${a(n)} free, ${e.name} is ${a(t.attempted||e.size)}`)}else y.error(`Upload ${e.name}: ${t.error||n.status}`)}}catch(t){y.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}fe(A)},be=()=>{le.current=0,q(!1)};if($(()=>{const e=()=>be();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),X)/* @__PURE__ */
|
|
2
|
+
return T("div",{className:"flex flex-col h-full bg-white",children:[
|
|
3
|
+
/* @__PURE__ */E(x,{title:"Files - offline"}),
|
|
4
|
+
/* @__PURE__ */E("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */T("div",{className:"max-w-md",children:[
|
|
5
|
+
/* @__PURE__ */E(N,{name:"close-circle",className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
|
|
6
|
+
/* @__PURE__ */E("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
|
|
7
|
+
/* @__PURE__ */T("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
|
|
8
|
+
/* @__PURE__ */E("span",{className:"font-mono",children:M}),". Make sure the server is running — see ",
|
|
9
|
+
/* @__PURE__ */E("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
|
|
10
|
+
/* @__PURE__ */E("button",{onClick:()=>fe(A),className:"px-3 h-8 text-sm bg-blue-500 text-on-accent rounded hover:bg-blue-600",children:"Retry"})]})})]});const ye="/"===A?[]:A.split("/").filter(Boolean),Ne=Q&&Q.limit>0?Math.min(100,Math.round(Q.used/Q.limit*100)):0,we=Ne>90?"bg-red-500":Ne>75?"bg-amber-500":"bg-blue-500",ve=[{label:"My files",onClick:()=>S("/")},...ye.map((e,t)=>({label:e,onClick:()=>S("/"+ye.slice(0,t+1).join("/"))}))],je=e=>"flex w-full items-center gap-2 rounded-md px-3 min-h-(--row-height-menu) py-2 text-left text-sm transition-colors "+(e?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),$e=e=>/* @__PURE__ */E("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.6,children:/* @__PURE__ */E("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),De=/* @__PURE__ */T("nav",{className:"p-2",children:[
|
|
11
|
+
/* @__PURE__ */E("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Locations"}),
|
|
12
|
+
/* @__PURE__ */T("button",{onClick:()=>{te("files"),S("/")},className:je("files"===ee&&"/"===A),children:[$e("M2.25 12l8.954-8.955a1.5 1.5 0 012.122 0L21.75 12M4.5 9.75v9.75a.75.75 0 00.75.75H9V15a.75.75 0 01.75-.75h4.5A.75.75 0 0115 15v5.25h3.75a.75.75 0 00.75-.75V9.75"),"My files"]}),H.map(e=>/* @__PURE__ */T("button",{onClick:()=>{te("files"),S("/"+e)},className:je("files"===ee&&A==="/"+e),children:[$e("M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"),
|
|
13
|
+
/* @__PURE__ */E("span",{className:"truncate",children:e})]},e)),!P&&/* @__PURE__ */T("button",{onClick:()=>te("trash"),className:je("trash"===ee),children:[$e("M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79"),"Trash"]}),re&&re.folders.length>0&&/* @__PURE__ */T(R,{children:[
|
|
14
|
+
/* @__PURE__ */E("div",{className:"px-2 pt-3 pb-2 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Desktop"}),re.folders.map(e=>/* @__PURE__ */T("button",{onClick:()=>te({desktopFolderId:e.id}),className:je(ie===e.id),children:[
|
|
15
|
+
/* @__PURE__ */E(h,{className:"h-4 w-4 shrink-0 text-amber-500"}),
|
|
16
|
+
/* @__PURE__ */E("span",{className:"truncate",children:e.name}),
|
|
17
|
+
/* @__PURE__ */E(b,{count:e.itemCount,active:ie===e.id,className:"ml-auto"})]},e.id))]})]});/* @__PURE__ */
|
|
18
|
+
return T("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{P||"object"==typeof ee||e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),le.current++,_||q(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{le.current>0&&le.current--,0===le.current&&q(!1)},onDrop:e=>{e.preventDefault(),be(),P||"object"==typeof ee||e.dataTransfer.files?.length&&ge(e.dataTransfer.files)},children:[
|
|
19
|
+
/* @__PURE__ */E(x,{title:se?`Files - ${se.name}`:"Files"+("/"===A?"":" - "+A)}),
|
|
20
|
+
/* @__PURE__ */E(i,{app:"files"}),
|
|
21
|
+
/* @__PURE__ */E("input",{ref:ce,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&ge(e.target.files),ce.current&&(ce.current.value="")}}),
|
|
22
|
+
/* @__PURE__ */E("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */E(t,{sidebar:De,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */T("div",{className:"flex h-full min-w-0 flex-col",children:[
|
|
23
|
+
/* @__PURE__ */T("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0 text-xs",children:[/* @__PURE__ */T(R,"files"===ee?{children:[
|
|
24
|
+
/* @__PURE__ */E("button",{onClick:()=>S(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),n=t.lastIndexOf("/");return n<=0?"/":t.slice(0,n)}(A)),disabled:"/"===A,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",title:"Parent folder",children:/* @__PURE__ */E(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
25
|
+
/* @__PURE__ */E("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */E(n,{items:ve,maxItems:5})}),
|
|
26
|
+
/* @__PURE__ */E("button",{onClick:()=>fe(A),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */E(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),!P&&/* @__PURE__ */T(R,{children:[
|
|
27
|
+
/* @__PURE__ */T("button",{onClick:()=>te("trash"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",title:"Open trash",children:[
|
|
28
|
+
/* @__PURE__ */E(N,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
|
|
29
|
+
/* @__PURE__ */T("button",{onClick:async()=>{const e=await g({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void y.error("Folder names cannot contain slashes");const t=F(A,e),n=await pe(`${M}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!n.ok){const e=await n.json().catch(()=>({}));return void y.error(e.error||`Create folder failed (${n.status})`)}fe(A)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
|
|
30
|
+
/* @__PURE__ */E(N,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
|
|
31
|
+
/* @__PURE__ */T("button",{onClick:()=>ce.current?.click(),className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 flex items-center gap-1",children:[
|
|
32
|
+
/* @__PURE__ */E(N,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===ee?{children:[
|
|
33
|
+
/* @__PURE__ */E("button",{onClick:()=>te("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */E(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
34
|
+
/* @__PURE__ */E("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
|
|
35
|
+
/* @__PURE__ */E("button",{onClick:xe,className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */E(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),
|
|
36
|
+
/* @__PURE__ */E("button",{onClick:async()=>{if(0===ne.length)return;if(!await k({title:"Empty trash",message:`${ne.length} item${1===ne.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await pe(`${M}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void y.error(t.error||`Empty trash failed (${e.status})`)}xe()},disabled:0===ne.length,className:"px-2 py-1 rounded text-red-600 hover:bg-red-50 disabled:opacity-30 flex items-center gap-1",children:"Empty trash"})]}:{children:[
|
|
37
|
+
/* @__PURE__ */E("button",{onClick:()=>te("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */E(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
38
|
+
/* @__PURE__ */E(h,{className:"h-4 w-4 text-amber-500 ml-1"}),
|
|
39
|
+
/* @__PURE__ */E("span",{className:"flex-1 text-gray-700 font-medium px-1 truncate",children:se?.name??"Desktop folder"}),
|
|
40
|
+
/* @__PURE__ */E("span",{className:"text-2xs text-ink-faintest px-2",children:"Desktop shortcuts"})]}),Q&&/* @__PURE__ */T(R,{children:[
|
|
41
|
+
/* @__PURE__ */E("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
42
|
+
/* @__PURE__ */T("div",{className:"flex items-center gap-2",title:`${a(Q.used)} of ${a(Q.limit)} used`,children:[
|
|
43
|
+
/* @__PURE__ */E("div",{className:"w-20 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */E("div",{className:`h-full ${we} transition-all`,style:{width:`${Ne}%`}})}),
|
|
44
|
+
/* @__PURE__ */T("span",{className:"text-2xs text-ink-faint tabular-nums whitespace-nowrap",children:[a(Q.used)," / ",a(Q.limit)]})]})]})]}),
|
|
45
|
+
/* @__PURE__ */E("div",{className:"flex-1 overflow-auto",children:"object"==typeof ee?0===oe.length?/* @__PURE__ */E("div",{className:"p-10 text-center text-sm text-gray-400",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */T("table",{className:"w-full text-sm",children:[
|
|
46
|
+
/* @__PURE__ */E("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */T("tr",{children:[
|
|
47
|
+
/* @__PURE__ */E("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
|
|
48
|
+
/* @__PURE__ */E("th",{className:`${v} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
|
|
49
|
+
/* @__PURE__ */E("th",{className:`${v} w-56`})]})}),
|
|
50
|
+
/* @__PURE__ */E("tbody",{children:oe.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
|
|
51
|
+
return T("tr",{onClick:()=>B(t),onDoubleClick:()=>he(e),className:"cursor-default border-b border-gray-100 "+(K===t?"bg-blue-50":"hover:bg-gray-50"),children:[
|
|
52
|
+
/* @__PURE__ */T("td",{className:"px-3 h-8 flex items-center gap-2",children:[
|
|
53
|
+
/* @__PURE__ */E(p,{item:e}),
|
|
54
|
+
/* @__PURE__ */E("span",{className:"truncate",title:e.label,children:e.label})]}),
|
|
55
|
+
/* @__PURE__ */E("td",{className:"px-3 h-8 text-xs text-ink-faint",children:u(e)}),
|
|
56
|
+
/* @__PURE__ */T("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
|
|
57
|
+
/* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),he(e)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Open"}),
|
|
58
|
+
/* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),re?.moveToDesktop([e])},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-ink-faint text-2xs ml-1",children:"Move to desktop"}),
|
|
59
|
+
/* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),re?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"trash"===ee?V&&0===ne.length?/* @__PURE__ */E(w,{size:"sm",padding:"p-6",label:"Loading"}):0===ne.length?/* @__PURE__ */E("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */T("table",{className:"w-full text-sm",children:[
|
|
60
|
+
/* @__PURE__ */E("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */T("tr",{children:[
|
|
61
|
+
/* @__PURE__ */E("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
|
|
62
|
+
/* @__PURE__ */E("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Original location"}),
|
|
63
|
+
/* @__PURE__ */E("th",{className:`${v} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
|
|
64
|
+
/* @__PURE__ */E("th",{className:`${v} text-right font-medium px-3 h-8 w-40`,children:"Deleted"}),
|
|
65
|
+
/* @__PURE__ */E("th",{className:`${v} w-44`})]})}),
|
|
66
|
+
/* @__PURE__ */E("tbody",{children:ne.map(e=>/* @__PURE__ */T("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[
|
|
67
|
+
/* @__PURE__ */T("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===e.kind?/* @__PURE__ */E(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */E(N,{name:"page",className:"h-4 w-4 text-ink-faintest shrink-0",strokeWidth:1.5}),
|
|
68
|
+
/* @__PURE__ */E("span",{className:"truncate",title:e.name,children:e.name})]}),
|
|
69
|
+
/* @__PURE__ */E("td",{className:"px-3 h-8 text-ink-faint text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
|
|
70
|
+
/* @__PURE__ */E("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:a(e.size)}),
|
|
71
|
+
/* @__PURE__ */E("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums",children:e.deletedAt?I(e.deletedAt):"—"}),
|
|
72
|
+
/* @__PURE__ */T("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
|
|
73
|
+
/* @__PURE__ */E("button",{onClick:()=>(async e=>{const t=await pe(`${M}/api/trash/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id})});if(!t.ok){const e=await t.json().catch(()=>({}));return void y.error(e.error||`Restore failed (${t.status})`)}y.success(`Restored "${e.name}"`),xe()})(e),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Restore"}),
|
|
74
|
+
/* @__PURE__ */E("button",{onClick:()=>(async e=>{if(!await k({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"}))return;const t=await pe(`${M}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void y.error(e.error||`Delete failed (${t.status})`)}xe()})(e),className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):V&&0===O.length?/* @__PURE__ */E(w,{size:"sm",padding:"p-6",label:"Loading"}):0===O.length?/* @__PURE__ */T("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!P&&/* @__PURE__ */T(R,{children:[" Drop files here or click ",
|
|
75
|
+
/* @__PURE__ */E("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */T("table",{className:"w-full text-sm",children:[
|
|
76
|
+
/* @__PURE__ */E("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */T("tr",{children:[
|
|
77
|
+
/* @__PURE__ */E("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
|
|
78
|
+
/* @__PURE__ */E("th",{className:`${v} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
|
|
79
|
+
/* @__PURE__ */E("th",{className:`${v} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),
|
|
80
|
+
/* @__PURE__ */E("th",{className:`${v} w-32`})]})}),
|
|
81
|
+
/* @__PURE__ */E("tbody",{children:O.map(t=>/* @__PURE__ */T("tr",{onClick:()=>B(t.name),onDoubleClick:()=>{"folder"===t.kind?S(F(A,t.name)):(async t=>{if(P)return;const n=F(A,t.name),a=(t.name.split(".").pop()||"").toLowerCase(),r=U[a];r?await e({filePath:n,filename:t.name,kind:r,onStaged:e=>de(e)}):ke(t)})(t)},className:"cursor-default border-b border-gray-100 "+(K===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
|
|
82
|
+
/* @__PURE__ */T("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===t.kind?/* @__PURE__ */E(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */E(N,{name:"page",className:"h-4 w-4 text-ink-faintest shrink-0",strokeWidth:1.5}),
|
|
83
|
+
/* @__PURE__ */E("span",{className:"truncate",title:t.name,children:t.name})]}),
|
|
84
|
+
/* @__PURE__ */E("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:"folder"===t.kind?"—":a(t.size)}),
|
|
85
|
+
/* @__PURE__ */E("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums",children:I(t.modifiedAt)}),
|
|
86
|
+
/* @__PURE__ */E("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!P&&/* @__PURE__ */T(R,{children:["file"===t.kind&&/* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),ke(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-ink-faint text-2xs",children:"Download"}),
|
|
87
|
+
/* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await g({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void y.error("Names cannot contain slashes");const n=F(A,e.name),a=F(A,t),r=await pe(`${M}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:n,to:a})});if(!r.ok){const e=await r.json().catch(()=>({}));return void y.error(e.error||`Rename failed (${r.status})`)}fe(A)})(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-ink-faint text-2xs ml-1",children:"Rename"}),
|
|
88
|
+
/* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),(async e=>{if(!await k({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will be permanently removed.`,confirmLabel:"Delete",variant:"danger"}))return;const t=F(A,e.name),n=await pe(`${M}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok){const e=await n.json().catch(()=>({}));return void y.error(e.error||`Delete failed (${n.status})`)}fe(A)})(t)},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete"})]})})]},t.name))})]})})]})})}),_&&/* @__PURE__ */E("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */E("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{M as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{getNumberingConfigs as e}from"./chunk-
|
|
2
|
-
/* @__PURE__ */x("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{
|
|
1
|
+
import{getNumberingConfigs as e}from"./chunk-U24GFE5L.js";import{SidebarLayout as t}from"./chunk-DD2ZGHCG.js";import"./chunk-QWK6DRSN.js";import"./chunk-3LGPZAVU.js";import{timeAgo as r}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{AboutApp as n}from"./chunk-YQEGMCSX.js";import{useWindowManager as o,client_default as i}from"./chunk-AICGATHE.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-FGWHTNC3.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-6MWLOLLP.js";import"./chunk-LPJGF6LK.js";import"./chunk-YN5K72D6.js";import"./chunk-TOSUM2OI.js";import"./chunk-3DVNXNTF.js";import"./chunk-YAZENY3X.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-KRH7UAD2.js";import"./chunk-6HO7244M.js";import{toast_default as c}from"./chunk-A3AKJDLI.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as s}from"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-JINTE3G4.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KGIHI6X.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as l}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-MBY5JIGB.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as p,useState as d,useCallback as m}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as h,Fragment as g,jsx as x}from"react/jsx-runtime";var y=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var k={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},b=/\[([ xX]?)\]/g;function f(){const{openEntity:f}=o(),{prefs:j,save:N}=s(),{data:v}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),w=a({});p(()=>{if(!v)return;const e={};for(const t of v){const r=k[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}w.current=e},[v]);const T=j.notepad_notes||[],[_,W]=d(null),[C,D]=d(""),[G,X]=d(""),[S,$]=d("yellow"),[L,J]=d(!1),[K,M]=d(!1),O=a(null),U=a();p(()=>{if(!_&&T.length>0){const e=T[0];W(e.id),D(e.title),X(e.content),$(e.color)}},[T.length]);const E=m(e=>{N({notepad_notes:e})},[N]),H=m(()=>{if(!_||!L)return;const e=T.map(e=>e.id===_?{...e,title:C,content:G,color:S,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);E(e),J(!1)},[_,L,C,G,S,T,E]);p(()=>{if(L)return U.current&&clearTimeout(U.current),U.current=setTimeout(H,800),()=>{U.current&&clearTimeout(U.current)}},[L,H]),p(()=>()=>{L&&H()},[]);const I=e=>{L&&H(),W(e.id),D(e.title),X(e.content),$(e.color),J(!1),M(!1)},A=e=>{const t=G.slice(0,e),r=G.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=G.slice(e+r[0].length);X(t+n+o),J(!0)},F=async(e,t)=>{const r=w.current[e];if(!r)return;const n=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:n,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,n):c.error(`${n} not found`)}catch{c.error(`Failed to look up ${n}`)}},Y="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",Z=/* @__PURE__ */h(g,{children:[
|
|
2
|
+
/* @__PURE__ */x("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{L&&H();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...T];E(t),W(e.id),D(""),X(""),$("yellow"),J(!1),M(!0),setTimeout(()=>O.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-accent-fill text-on-accent px-3 min-h-8 py-1 text-sm font-medium hover:bg-accent-fill-hover transition-colors",children:[
|
|
3
3
|
/* @__PURE__ */x(l,{name:"add",className:"h-4 w-4",strokeWidth:2}),"New Note"]})}),
|
|
4
4
|
/* @__PURE__ */x("div",{className:"flex-1 overflow-y-auto",children:0===T.length?/* @__PURE__ */x("p",{className:"text-sm text-gray-400 text-center py-8 px-4",children:"No notes yet. Create one to get started."}):T.map(e=>{const t=(n=e.color,y.find(e=>e.key===n)||y[0]);var n;/* @__PURE__ */
|
|
5
|
-
return h("button",{onClick:()=>
|
|
5
|
+
return h("button",{onClick:()=>I(e),className:"w-full text-left px-3 py-3 border-b border-line-subtle transition-colors "+(_===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
|
|
6
6
|
/* @__PURE__ */h("div",{className:"flex items-center gap-2",children:[
|
|
7
7
|
/* @__PURE__ */x("div",{className:`w-3 h-3 rounded-full shrink-0 ${t.dot}`}),
|
|
8
8
|
/* @__PURE__ */x("span",{className:"text-sm font-medium text-gray-900 truncate flex-1",children:e.title||"Untitled"})]}),
|
|
@@ -10,15 +10,15 @@ return h("button",{onClick:()=>V(e),className:"w-full text-left px-3 py-3 border
|
|
|
10
10
|
/* @__PURE__ */x("p",{className:"text-2xs text-gray-300 mt-0.5 ml-5",children:r(e.updated_at)})]},e.id)})})]});/* @__PURE__ */
|
|
11
11
|
return h("div",{className:"h-full",children:[
|
|
12
12
|
/* @__PURE__ */x(n,{app:"notepad"}),
|
|
13
|
-
/* @__PURE__ */x(t,{sidebar:
|
|
13
|
+
/* @__PURE__ */x(t,{sidebar:Z,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:_?/* @__PURE__ */h("div",{className:"flex-1 flex flex-col min-w-0",children:[
|
|
14
14
|
/* @__PURE__ */h("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200",children:[
|
|
15
|
-
/* @__PURE__ */x("input",{value:
|
|
16
|
-
/* @__PURE__ */x("div",{className:"flex gap-1",children:y.map(e=>/* @__PURE__ */x("button",{onClick:()=>{
|
|
17
|
-
/* @__PURE__ */x("button",{onClick:()=>(e=>{const t=T.filter(t=>t.id!==e);if(
|
|
18
|
-
return x("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(
|
|
15
|
+
/* @__PURE__ */x("input",{value:C,onChange:e=>{D(e.target.value),J(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
|
|
16
|
+
/* @__PURE__ */x("div",{className:"flex gap-1",children:y.map(e=>/* @__PURE__ */x("button",{onClick:()=>{$(e.key),J(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${S===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
|
|
17
|
+
/* @__PURE__ */x("button",{onClick:()=>(e=>{const t=T.filter(t=>t.id!==e);if(E(t),_===e){const e=t[0];e?I(e):(W(null),D(""),X(""))}})(_),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */x(l,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),K?/* @__PURE__ */x("textarea",{ref:O,value:G,onChange:e=>{X(e.target.value),J(!0)},onBlur:()=>{M(!1),L&&H()},placeholder:Y,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */x("div",{onClick:()=>{M(!0),setTimeout(()=>O.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:G?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],c=/([A-Z]{2,4})#(\d{4,6})/g;let s;for(;null!==(s=c.exec(e));){const e=s[1],t=s[2];if(w.current[e]){const n=s.index,o=s[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */x("button",{onClick:()=>F(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}b.lastIndex=0;let a=0;for(let e=0;e<r;e++)a+=t[e].length+1;for(;null!==(s=b.exec(e));){const e="x"===s[1]||"X"===s[1],t=s.index,n=a+t;i.push({idx:t,len:s[0].length,render:()=>/* @__PURE__ */x("button",{onClick:()=>A(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */x(l,{name:"check",className:"w-3 h-3",strokeWidth:3})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */x("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */x("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */x("span",{children:""},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
|
|
18
|
+
return x("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(G):/* @__PURE__ */x("p",{className:"text-gray-300 whitespace-pre-line",children:Y})}),
|
|
19
19
|
/* @__PURE__ */h("div",{className:"px-4 min-h-8 py-1 border-t border-line-subtle flex items-center gap-4 text-2xs text-ink-faintest",children:[
|
|
20
20
|
/* @__PURE__ */x("span",{children:"[] checkbox"}),
|
|
21
21
|
/* @__PURE__ */x("span",{children:"SO#35001 entity link"}),
|
|
22
|
-
/* @__PURE__ */x("span",{className:"ml-auto",children:
|
|
22
|
+
/* @__PURE__ */x("span",{className:"ml-auto",children:K?"Editing":"Click to edit"})]})]}):/* @__PURE__ */x("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */h("div",{className:"text-center text-gray-400",children:[
|
|
23
23
|
/* @__PURE__ */x(l,{name:"page",className:"h-12 w-12 mx-auto mb-3 text-gray-300",strokeWidth:1}),
|
|
24
24
|
/* @__PURE__ */x("p",{className:"text-sm",children:"Select a note or create a new one"})]})})})]})}export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-OXVRXWJL.js";import"./chunk-A3AKJDLI.js";import"./chunk-UQYNPYF4.js";import"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-MBY5JIGB.js";import"./chunk-C3QOHMR6.js";
|