efficient-shell 8.20.0 → 8.21.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 +4 -3
- package/dist/{Browser-KK4DSPFA.js → Browser-WJ7YGO3M.js} +14 -14
- package/dist/Calculator-FHN36ZE3.js +29 -0
- package/dist/{CurrencyConverter-PD2CEL6V.js → CurrencyConverter-ONCRQNI4.js} +9 -9
- package/dist/{Documents-QRU3INP2.js → Documents-YEMIR4WQ.js} +5 -5
- package/dist/{Files-NQBM46JA.js → Files-QWSOYRD4.js} +25 -25
- package/dist/{Notepad-KU2VK5QB.js → Notepad-MFVUGAGD.js} +10 -10
- package/dist/PdfViewer-ZFZ4PEAV.js +1 -0
- package/dist/{PomodoroTimer-JEQTTMGA.js → PomodoroTimer-JVQ5K7B4.js} +68 -68
- package/dist/{Preview-C6VU5P3N.js → Preview-7G2WM7DN.js} +44 -44
- package/dist/Sidebar-OFRMBB5V.js +43 -0
- package/dist/{Spreadsheet-HLH3EHCX.js → Spreadsheet-VKOS3PUA.js} +13 -13
- package/dist/{Stock-VCMJMUCW.js → Stock-TWJNCTNT.js} +3 -3
- package/dist/{Weather-HF3E3N3M.js → Weather-RM7GPLAH.js} +16 -16
- package/dist/{WorldClock-PM5CJQSL.js → WorldClock-ITJ2MO75.js} +6 -6
- package/dist/ai/index.js +17 -17
- 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/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/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-22S6LG6D.js +6 -0
- package/dist/{chunk-CQXKO5PB.js → chunk-24L7NLA3.js} +1 -1
- package/dist/{chunk-O3HXASSH.js → chunk-2BS74SYW.js} +1 -1
- package/dist/{chunk-THPTJGV5.js → chunk-2H6PDKTC.js} +7 -7
- package/dist/chunk-36MUTG34.js +1 -0
- package/dist/{chunk-VWVFKMU7.js → chunk-3HNK7IRJ.js} +3 -3
- package/dist/{chunk-KSSIZW3C.js → chunk-3PQHPFXP.js} +5 -5
- package/dist/{chunk-5TVF4BCM.js → chunk-3Z7LIHMB.js} +1 -1
- package/dist/chunk-4CANQ3B3.js +1 -0
- package/dist/{chunk-UEUCGC6G.js → chunk-4CWKK5HV.js} +4 -4
- package/dist/chunk-4IU5BSVE.js +2 -0
- package/dist/chunk-4PZN25MV.js +20 -0
- package/dist/{chunk-RC5SGXXR.js → chunk-4VK3GJZI.js} +1 -1
- package/dist/chunk-4XOTP5CB.js +2 -0
- package/dist/{chunk-PXCARPLZ.js → chunk-55WFJELE.js} +1 -1
- package/dist/{chunk-MRBC7GLE.js → chunk-5Z2WLSFM.js} +15 -15
- package/dist/{chunk-KB6BGPQK.js → chunk-6GVJ6IKD.js} +1 -1
- package/dist/{chunk-7T3COEQK.js → chunk-6KO5VTL7.js} +1 -1
- package/dist/{chunk-AZWEWGYG.js → chunk-6V753BUI.js} +3 -3
- package/dist/{chunk-FOSCSAJZ.js → chunk-735HKUTV.js} +1 -1
- package/dist/chunk-73DAZUJP.js +14 -0
- package/dist/{chunk-C6LV3HJW.js → chunk-7DKPJUGU.js} +1 -1
- package/dist/{chunk-IGH6DECG.js → chunk-7M7ESM5V.js} +12 -12
- package/dist/{chunk-UEMGH6EO.js → chunk-7S2I6ACG.js} +1 -1
- package/dist/{chunk-RZT7QES5.js → chunk-A4U4BTN3.js} +4 -4
- package/dist/{chunk-EQZAHIUG.js → chunk-ACZZXO5S.js} +2 -2
- package/dist/{chunk-5GMWOYTF.js → chunk-AH2AUQYM.js} +1 -1
- package/dist/{chunk-AILWMDWP.js → chunk-AJ42UE53.js} +1 -1
- package/dist/{chunk-XDG2RWUO.js → chunk-AX7KPMDV.js} +2 -2
- package/dist/{chunk-B36HEVMT.js → chunk-AXZEINMF.js} +19 -19
- package/dist/{chunk-OAYHU7YN.js → chunk-B4XPFCCQ.js} +2 -2
- package/dist/{chunk-JSOO4O5K.js → chunk-B55IXYDR.js} +2 -2
- package/dist/chunk-B5VOHZCD.js +1 -0
- package/dist/{chunk-MVCNSGM4.js → chunk-BIS5PHHV.js} +2 -2
- package/dist/{chunk-3V6UFR7M.js → chunk-BXM72C73.js} +1 -1
- package/dist/{chunk-X3II54HU.js → chunk-CDRXZBVR.js} +1 -1
- package/dist/{chunk-6SBPGUSR.js → chunk-CFLVEKSH.js} +1 -1
- package/dist/{chunk-FBSQABH2.js → chunk-CMYLTCPA.js} +1 -1
- package/dist/{chunk-YZCRHDOB.js → chunk-CU2B7G5A.js} +1 -1
- package/dist/{chunk-P5QRK7WD.js → chunk-CUT7PAXL.js} +1 -1
- package/dist/{chunk-5SULG7D5.js → chunk-D323R2FT.js} +1 -1
- package/dist/{chunk-AK632G3F.js → chunk-D5HHU5AO.js} +7 -7
- package/dist/{chunk-UELYZT4T.js → chunk-DIKOEJ2Y.js} +1 -1
- package/dist/{chunk-CVNM25BM.js → chunk-DLCIGDKC.js} +6 -6
- package/dist/chunk-DLS2VCBK.js +3 -0
- package/dist/{chunk-QSPW43OC.js → chunk-DMLJOBQS.js} +8 -8
- package/dist/chunk-DNKACLRF.js +11 -0
- package/dist/{chunk-D6FSZBJ5.js → chunk-DO6XTJ77.js} +1 -1
- package/dist/chunk-DZT2O3JD.js +11 -0
- package/dist/{chunk-KZ6P7WC6.js → chunk-EAEUSMYL.js} +1 -1
- package/dist/{chunk-XSFQR374.js → chunk-ECZT7SIE.js} +1 -1
- package/dist/{chunk-VYKITRFG.js → chunk-EDQBTPDF.js} +7 -7
- package/dist/{chunk-XBXEK6XP.js → chunk-EKWSGPJ4.js} +7 -7
- package/dist/{chunk-JJ6IUIYX.js → chunk-EL3O7ZFQ.js} +1 -1
- package/dist/chunk-ERFM5U3M.js +12 -0
- package/dist/{chunk-TLJCUUZU.js → chunk-ET32NQHX.js} +1 -1
- package/dist/chunk-ETSKG62F.js +1 -0
- package/dist/{chunk-XDAR2DSX.js → chunk-EXMFUK3A.js} +8 -8
- package/dist/chunk-F2Z6IXMM.js +2 -0
- package/dist/{chunk-KS3AQKHD.js → chunk-FPDKMCQH.js} +7 -7
- package/dist/{chunk-TF3E5J3Y.js → chunk-GI7FOLDX.js} +1 -1
- package/dist/{chunk-DCNXCFAD.js → chunk-H7ZXUGXX.js} +26 -26
- package/dist/{chunk-ZLHF5XRR.js → chunk-HJIBTA6V.js} +9 -9
- package/dist/{chunk-Z6V3EY6F.js → chunk-HVVPBAP5.js} +3 -3
- package/dist/chunk-HYFHCPNJ.js +15 -0
- package/dist/{chunk-DBLJIK5J.js → chunk-IAQC775L.js} +1 -1
- package/dist/{chunk-J67YIQEN.js → chunk-IGCXJHAK.js} +1 -1
- package/dist/{chunk-DBDJQVQM.js → chunk-IJA5ZAGL.js} +1 -1
- package/dist/{chunk-YUIWG2QT.js → chunk-IKNNHEVY.js} +1 -1
- package/dist/{chunk-EXVR3BWW.js → chunk-IMF537IJ.js} +9 -9
- package/dist/{chunk-TKBP5HRY.js → chunk-IPOSLLLU.js} +12 -12
- package/dist/{chunk-VXWCX65A.js → chunk-IURSUMDO.js} +8 -8
- package/dist/{chunk-7SPX7DLO.js → chunk-IY3CRZRH.js} +16 -16
- package/dist/chunk-JGE7S7RQ.js +29 -0
- package/dist/{chunk-H5GQWWPA.js → chunk-JYOI66DT.js} +1 -1
- package/dist/chunk-K4DZWCUP.js +8 -0
- package/dist/{chunk-42BBJJDP.js → chunk-KIBL6M3T.js} +10 -5
- package/dist/chunk-KPFOXLN4.js +5 -0
- package/dist/chunk-KZEQJVBO.js +3 -0
- package/dist/chunk-L2HZ7YXS.js +14 -0
- package/dist/chunk-L2YW3END.js +4 -0
- package/dist/{chunk-RYC3ZHXM.js → chunk-L65EQCZN.js} +5 -5
- package/dist/{chunk-KATRRQD5.js → chunk-L6FLPBU2.js} +5 -5
- package/dist/{chunk-3WM23XSR.js → chunk-LDFRVV5R.js} +8 -8
- package/dist/{chunk-3KDY6V6I.js → chunk-LMLM4KHQ.js} +8 -8
- package/dist/{chunk-LMOPRRQY.js → chunk-LQQMELJM.js} +12 -12
- package/dist/{chunk-CQAXN3HN.js → chunk-LVSPLCGG.js} +1 -1
- package/dist/{chunk-WGSIYW63.js → chunk-M5BFTFBK.js} +15 -15
- package/dist/{chunk-ZDJNTOUS.js → chunk-MEOICYR5.js} +1 -1
- package/dist/{chunk-CDBS47XI.js → chunk-MFEJ6TYE.js} +1 -1
- package/dist/{chunk-U62AWCZR.js → chunk-MHYOQMBV.js} +1 -1
- package/dist/{chunk-RHYMHVFS.js → chunk-MKITHLDU.js} +9 -9
- package/dist/chunk-MOOBUMON.js +9 -0
- package/dist/{chunk-R6L6PKQP.js → chunk-MTSZ66O4.js} +1 -1
- package/dist/{chunk-Q6YPDR7U.js → chunk-MWAYM46R.js} +12 -12
- package/dist/{chunk-CHNYSP6K.js → chunk-N6DTTOB6.js} +1 -1
- package/dist/{chunk-XXBGWT7L.js → chunk-N7VNKAXZ.js} +1 -1
- package/dist/{chunk-F5VXS5JO.js → chunk-NBVF2CXM.js} +1 -1
- package/dist/{chunk-VO3HT6IK.js → chunk-NDTMQRR2.js} +1 -1
- package/dist/{chunk-MQADQ4YF.js → chunk-NKJDOQVW.js} +1 -1
- package/dist/{chunk-QKHTL3FQ.js → chunk-NNKMEF3D.js} +1 -1
- package/dist/{chunk-3AVHOYQZ.js → chunk-NRDO5IHL.js} +1 -1
- package/dist/{chunk-Q2S76TZH.js → chunk-NSCLFAKK.js} +1 -1
- package/dist/{chunk-EVPOZQOI.js → chunk-OCCHDMEV.js} +1 -1
- package/dist/chunk-OF6TUQAL.js +7 -0
- package/dist/{chunk-DAV7SMCJ.js → chunk-OSSFYFXO.js} +1 -1
- package/dist/{chunk-F22KWATP.js → chunk-OSVN2UF7.js} +1 -1
- package/dist/{chunk-3RM3D2P3.js → chunk-OTU633XJ.js} +6 -6
- package/dist/{chunk-KE6NYTGF.js → chunk-OZF4QAJT.js} +3 -3
- package/dist/{chunk-HME2P5VX.js → chunk-OZPYTSPD.js} +23 -23
- package/dist/{chunk-MBXTOYMX.js → chunk-P7WUDHIP.js} +6 -6
- package/dist/{chunk-ZNZDV6SN.js → chunk-PG6AVBSR.js} +1 -1
- package/dist/{chunk-UPHXYWL6.js → chunk-PJCVNFWM.js} +11 -11
- package/dist/{chunk-J324R2BM.js → chunk-PTDLNTSK.js} +13 -13
- package/dist/{chunk-N7KL336H.js → chunk-PVSGQN5M.js} +6 -6
- package/dist/{chunk-47MFBFIX.js → chunk-PWOFYFMO.js} +6 -6
- package/dist/{chunk-RQ5RVKRO.js → chunk-QEVIQZIE.js} +2 -2
- package/dist/{chunk-4MTC6HA5.js → chunk-RAAUW5OZ.js} +2 -2
- package/dist/{chunk-E2YGQAFU.js → chunk-RAI3GTS6.js} +1 -1
- package/dist/chunk-RAQESAQZ.js +3 -0
- package/dist/{chunk-5JQCPUEO.js → chunk-RCRI6QZV.js} +1 -1
- package/dist/{chunk-G3IG4X4Z.js → chunk-RDPUVCXR.js} +1 -1
- package/dist/{chunk-4TER5BHR.js → chunk-RZBHO74V.js} +1 -1
- package/dist/{chunk-MKTO2FHK.js → chunk-SAKHGHF5.js} +1 -1
- package/dist/{chunk-4G5M752L.js → chunk-SXSMIMFY.js} +3 -3
- package/dist/{chunk-JSB5G2XQ.js → chunk-THDSOVEH.js} +2 -2
- package/dist/{chunk-CHOMUTLT.js → chunk-TT3S2XVQ.js} +1 -1
- package/dist/chunk-TW6WEYGO.js +8 -0
- package/dist/{chunk-XUK35DKG.js → chunk-U5I7IF72.js} +1 -1
- package/dist/{chunk-IM7QHAXT.js → chunk-UFVQ7ZBP.js} +5 -5
- package/dist/{chunk-QSW26NAH.js → chunk-UQBPKZUR.js} +1 -1
- package/dist/{chunk-F4PESM6A.js → chunk-UY47AKZU.js} +6 -6
- package/dist/{chunk-4TL3MRRE.js → chunk-VH6GB73Q.js} +1 -1
- package/dist/{chunk-2GPXC6JX.js → chunk-VHAM5TD2.js} +1 -1
- package/dist/{chunk-5VUVKP55.js → chunk-VOHZQVFK.js} +6 -6
- package/dist/chunk-VT62T6B3.js +19 -0
- package/dist/{chunk-IH4SVMXJ.js → chunk-VX4BNYH3.js} +2 -2
- package/dist/{chunk-O43QLNPL.js → chunk-VY7EPQEG.js} +1 -1
- package/dist/chunk-WBEMN4JG.js +9 -0
- package/dist/{chunk-TQP3L4OC.js → chunk-WDXJWC3Y.js} +5 -5
- package/dist/{chunk-E4O2ZMXF.js → chunk-WJEDIAG4.js} +1 -1
- package/dist/{chunk-7HTURXIA.js → chunk-WRJDHFLD.js} +3 -3
- package/dist/chunk-X4EBWJWO.js +1 -0
- package/dist/{chunk-4FOTTLL7.js → chunk-XVJCVYDI.js} +2 -2
- package/dist/{chunk-NGVODCMV.js → chunk-XWH6KVVB.js} +3 -3
- package/dist/chunk-Y5ZWPU4L.js +14 -0
- package/dist/{chunk-7RD623PT.js → chunk-YGEK2Z6P.js} +1 -1
- package/dist/{chunk-55DONELU.js → chunk-YSHS6QIY.js} +6 -6
- package/dist/{chunk-ABD5X73I.js → chunk-YTGWIMXB.js} +1 -1
- package/dist/{chunk-2SHDXTB6.js → chunk-YVBFFE4Z.js} +5 -5
- package/dist/{chunk-B5MOPSMW.js → chunk-ZBLNVAZ4.js} +3 -3
- package/dist/{chunk-BIEKHPZ5.js → chunk-ZDK2JYH5.js} +52 -52
- package/dist/{chunk-FFZ7KPIV.js → chunk-ZKOIGLRF.js} +7 -7
- package/dist/data/DataTable.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/file-intake/index.js +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.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/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.d.ts +157 -0
- package/dist/forms/MediaLibrary.js +2 -0
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.d.ts +54 -3
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Segmented.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.d.ts +64 -0
- package/dist/forms/mediaLibraryMenu.js +2 -0
- package/dist/forms/mediaMoveItems.d.ts +42 -3
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +424 -424
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +6 -6
- 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/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/StatusBadge.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.d.ts +9 -1
- package/dist/shell/Tooltip.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/language.js +1 -1
- package/dist/shell/strings.d.ts +88 -0
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- 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.d.ts +4 -2
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-PH6NVEEZ.js +0 -29
- package/dist/PdfViewer-GODDA4GG.js +0 -1
- package/dist/Sidebar-SJMMY2Y2.js +0 -43
- package/dist/chunk-2LXTJXWC.js +0 -6
- package/dist/chunk-36DYXGQI.js +0 -7
- package/dist/chunk-3NWCVZRK.js +0 -10
- package/dist/chunk-3P7SBAKK.js +0 -3
- package/dist/chunk-6UOMJ7E4.js +0 -2
- package/dist/chunk-ABDT4M5L.js +0 -19
- package/dist/chunk-BZWTFLQD.js +0 -15
- package/dist/chunk-CIGHIX6Z.js +0 -14
- package/dist/chunk-DAJTVAWO.js +0 -11
- package/dist/chunk-ENVCMR3M.js +0 -5
- package/dist/chunk-H5VGRHNT.js +0 -9
- package/dist/chunk-HLGE6TVE.js +0 -4
- package/dist/chunk-HMZLRXLA.js +0 -1
- package/dist/chunk-JH4W3R4Q.js +0 -11
- package/dist/chunk-KKZZAK76.js +0 -1
- package/dist/chunk-LYLEH25Y.js +0 -1
- package/dist/chunk-NI76QOA2.js +0 -2
- package/dist/chunk-NZ67C5OK.js +0 -12
- package/dist/chunk-OHSJWKNV.js +0 -14
- package/dist/chunk-Q75PSCZ5.js +0 -20
- package/dist/chunk-SIQSD3QT.js +0 -8
- package/dist/chunk-TCB2J3PS.js +0 -9
- package/dist/chunk-UDD7GB4F.js +0 -2
- package/dist/chunk-WMO2JQNL.js +0 -8
- package/dist/chunk-WOHOIJRZ.js +0 -3
- package/dist/chunk-X7ZBGXUU.js +0 -1
- /package/dist/{chunk-PCGZS6S4.js → chunk-276AUQNN.js} +0 -0
package/README.md
CHANGED
|
@@ -1560,11 +1560,12 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
|
|
|
1560
1560
|
| `FilePicker` | Documents on a record: one dashed zone that is a button (click, Enter, Space) and a drop target, listing the chosen `File[]`. It never uploads — the form submits them as it submits everything else. `accept`, `maxSizeBytes` and `maxFiles` are enforced on a drop exactly as on a pick, and a rejected file is announced (`role="alert"`) naming the file and the rule. Forwards its ref to the zone for `FormErrorSummary`. |
|
|
1561
1561
|
| `useFileIntake`, `acceptsFile`, `FileIntakeAlert` | The intake every upload primitive above takes its files through — the file dialog, a drop and a paste reach one set of checks (`accept`, `maxSizeBytes`, `maxFiles`) and one announced rejection list. For a surface with a layout of its own; never so a consumer renders its own file input. Also on the React-only subpath [`efficient-shell/file-intake`](#upload-intake-without-the-shell--efficient-shellfile-intake) for a page that cannot load the shell. |
|
|
1562
1562
|
| `MediaUploadField` | The single image / video slot — logo, cover, avatar, favicon. Dashed zone empty; filled, the preview carries a bar along its bottom edge with "Change image" (or "Change video") and a Remove bin, shown on hover or keyboard focus and always on a screen with no hover; both take a drop. `kind` + `onKindChange` put an Image / Video strip on top; `focus` + `onFocusChange` make the picture an `ImageFocusPoint` (drag the dot or move it with the arrow keys; `focus` alone still places the picture). `replaceLabel` is the bar's words; `removeLabel` names the bin. `onFile` hands the consumer the chosen `File` to upload (the field owns the gesture); `onPick` opens the consumer's own library picker instead; with neither it emits an object-URL. `maxSizeBytes` joins `accept` on every gesture. A library that answers later returns a promise of the URL from `onPick`: the field is busy ("Choosing") until it settles, takes the URL it resolves to, and says "The library could not be opened" if it fails. |
|
|
1563
|
-
| `MediaUploadGrid` | The gallery sibling: thumbnails, an Add tile, per-thumb remove, drag-and-keyboard reorder, optional cover badge. `onFiles` receives EVERY file of a multi-file drop or dialog pick; `onPick` defers to a library picker. `maxFiles` counts against the items held. Typed drags between galleries: `dragType` + an item's `dragData` let a tile be dragged out (a `readOnly` gallery too); `dropType` + `onDropData` let the zone take that drag and hand over its payload (to link an existing picture instead of uploading it again). An item's `mark` sits at the top left ("Linked") and its `removeLabel` names its × ("Unlink"). |
|
|
1563
|
+
| `MediaUploadGrid` | The gallery sibling: thumbnails, an Add tile, per-thumb remove, drag-and-keyboard reorder, optional cover badge. `onFiles` receives EVERY file of a multi-file drop or dialog pick; `onPick` defers to a library picker. `maxFiles` counts against the items held. Typed drags between galleries: `dragType` + an item's `dragData` let a tile be dragged out (a `readOnly` gallery too); `dropType` + `onDropData` let the zone take that drag and hand over its payload (to link an existing picture instead of uploading it again). An item's `mark` sits at the top left ("Linked") and its `removeLabel` names its × ("Unlink"). Choosing tiles (the media library): `selected` (ids) gives the chosen look and `aria-selected`; `onItemClick(id, { ctrlKey, metaKey, shiftKey })` makes each tile a focusable option (click, Enter, Space) carrying `data-grid-id` and `data-grid-item` for `useMarquee`; `onItemDoubleClick` and `onItemContextMenu` hand over those gestures; `menuOnMedia` puts the UI-16 media-tile exception (`data-menu-on-media`) on every tile, so a right-click on the picture opens the host's menu. An item's `name` replaces the name read off its URL. An item's `badges` (`MediaTileBadge`: `label`, `count`, `icon`, `tone`) sit in ONE row inside the tile; on a tile under `FULL_BADGE_TILE_PX` (112) each shows its short form, its figure and its icon ("7" with `link`, `email` alone), and its full words in the shell `Tooltip` on hover and focus. |
|
|
1564
1564
|
| `useGridSelection`, `useMarquee`, `MarqueeBox` | File Explorer selection for a grid of tiles keyed by id (moved in from admin-portal). `useGridSelection(orderedIds, enabled?, liveIds?)`: a click selects one, Ctrl/Cmd toggles, Shift selects the run from the anchor (replacing), Ctrl+Shift adds the run; `selectAll`, `clear`, `setSelection(ids, { additive })`. It prunes itself to `liveIds` (default `orderedIds`), so a tile folded out of view stays selected and a deleted one does not; `enabled: false` holds nothing. `useMarquee({ containerRef, enabled, selected, setSelection, clearSelection })` is the rubber band: a drag on the grid's background selects every tile (`[data-grid-id]`, or `idAttribute`) the box touches, Ctrl/Cmd adds, a press that does not move clears, and the nearest scroller scrolls near its edge. A press inside `ignore` (tiles marked `data-grid-item`, controls) is left alone. `MarqueeBox` draws the box; the desktop's own icon selection draws with it too. |
|
|
1565
1565
|
| `ImageLightbox`, `ZoomableImage` | The full-screen viewer for a GALLERY (harness PAT-7; a single stored document opens in the Preview window instead, UI-18). `images` (`{ url, caption?, kind? }`), `startIndex`, `onClose`, `onIndexChange`, `onOpenFile`. A picture zooms with the wheel, a pinch and a double-click and pans with a drag (`ZoomableImage`); a video gets the player; any other file a card whose "Open file" links to it, or calls `onOpenFile` (a host that can show it in the Preview window). A `1 / 5` counter and Close top right, Previous / Next that wrap, caption and "Open original" below; ArrowLeft / ArrowRight step, and Escape closes through the shell's Escape seam, so the window behind stays open. A modal dialog with a focus trap and a scroll lock, portalled to `<body>` on the overlay layer; a click on the backdrop closes, a click on the picture does not. Words: the `lightbox` section. |
|
|
1566
1566
|
| `MediaUsedInList` | "Used in 7 places": a row per place that still uses a file — the host's kind word as a badge ("Page", "Email") and the place's name. A row with `onOpen` is a link-look button; a row without one is plain text, never a button that goes nowhere. It fetches nothing; the host hands over the rows. `heading` and `emptyText` replace the catalog's `media.usedIn` / `media.notUsed`. |
|
|
1567
|
-
| `mediaMoveItems`, `useMediaMoveItems` | The "Move to" list as `DropdownMenu` entries, so a bulk bar's "Move to" button and any menu that takes the same entries draw one definition. `{ count, kind, targets, onPick }`: it leads with "Move 3 images to" (`media.moveTo`), runs of targets that share a `group` get a label and a line, `depth` indents a nested folder, and a target with `disabledReason` stays in the list, off, with the reason under it. No targets says `media.moveNowhere`. The hook reads the words from the catalog; the plain function takes them as its second argument.
|
|
1567
|
+
| `mediaMoveItems`, `useMediaMoveItems` | The "Move to" list as `DropdownMenu` entries, so a bulk bar's "Move to" button and any menu that takes the same entries draw one definition. `{ count, kind, targets, onPick }`: it leads with "Move 3 images to" (`media.moveTo`), runs of targets that share a `group` get a label and a line, `depth` indents a nested folder, and a target with `disabledReason` stays in the list, off, with the reason under it. No targets says `media.moveNowhere`. The hook reads the words from the catalog; the plain function takes them as its second argument. `mediaMoveSubmenu(options)` is the same list as ONE "Move to ▸" row (a `type: 'submenu'` entry) for a menu that holds other things; `head: false` drops the "Move 3 images to" line (a folder moving). |
|
|
1568
|
+
| `MediaLibrary`, `mediaLibraryMenu` | THE media library (harness UI-21): the Media Library window (`mode="manage"`) and the website editor's and email designer's image picker (`mode="pick"`) are this one part. Presentational: it never fetches; the host is the port (`MediaLibraryProps`). It hands over `location` (`{ place: 'files', folderId }`, `{ place: 'products', nodeId }`, `{ place: 'trash' }`) with `onLocationChange`, `folders` (`{ id, name, parentId, count }`, any depth), `products` (brand > design > finish, `sharedFrom` on a shared brand), `files` (what the open place holds, filtered by the host: `name`, `url`, `thumbUrl`, `usedCount`, `email`, `private`, `trashedDaysAgo`, and the detail rows), `usedIn` rows for the one chosen file, the counts, and the callbacks: `onUpload(files, folderId)`, `onNewFolder(parentId)` (return the new id and its name field opens, selected), `onRename`, `onMove`, `onTrash`, `onRestore`, `onDeleteForever`, `onEmptyTrash`, `onReplace`, `onCropEdit`, `onOpenInDesign`, `onChoose`, `onCancel`. A callback left out takes its action away (Replace before it exists); `denied: { action: reason }` keeps an action, off, with the reason. The tree: Products (read-only, lock, "Read-only" badge; hover, the details panel and the empty state say "Read-only. Edit these pictures in Products > Design > Media.", plus "Edited at HQ (<tenant>)." under a shared brand), All files, Trash (not in the picker). The toolbar: `Breadcrumbs`, search (`query`), Media type / Use / Sort (`filters` + `onFiltersChange`), the host's own `extraFilters`, Grid / List (`view` + `onViewChange`), New folder and Upload (off in Products with their reasons). The grid is `MediaUploadGrid` with `useGridSelection` and `useMarquee` (Ctrl/Cmd+A, Escape), marks "Used N", "Email", "Private", "N days ago"; a double click opens `ImageLightbox` (in the picker it chooses). ONE menu definition, `mediaLibraryMenu(target, context)`, feeds both a folder's ⋯ `DropdownMenu` and every right-click `ContextMenu` (a folder, 1 or N files, a file in Trash, a Products folder, a render), "Move to ▸" a submenu in both; with N files chosen, Rename, Replace and Copy URL are off. Drag: files onto a folder move there, a folder onto a folder nests, files from the computer upload into the open folder; Products takes nothing, and its `Tooltip` says why (`MEDIA_FILES_DRAG_TYPE`, `MEDIA_FOLDER_DRAG_TYPE`). The details panel: picture, `DescriptionList`, Copy URL, Replace / Crop & edit / Move to / Rename / Trash (Restore / Delete forever in Trash; a render: read-only `Banner` and Open in Design > Media), `MediaUsedInList`. Two or more chosen: a bulk bar. The picker: a footer "1 selected · <name>", Cancel / Choose image; a `private` file (or one with `pickDisabledReason`) cannot be chosen. Under 640 px of its own width (or `layout="phone"`): the tree over the toolbar, three tiles a row, and the details in a bottom sheet (`Drawer side="bottom"`). Words: the `mediaLibrary` section. |
|
|
1568
1569
|
| `StartMenu` / `Desktop` / `WindowManagerProvider` | Used internally by `Layout`; rarely instantiated directly. |
|
|
1569
1570
|
| `Modal`, `ModalActions`, `CopyButton`, `CancelButton` | Window primitive supporting standard / compact / widget styles. Every window frame is a non-modal `role="dialog"` (no `aria-modal`: a window stands beside other windows, with no scrim and no focus trap), named by the title it draws through `aria-labelledby`; a widget, a phone frame and the Home tab draw no title, so their title text is the `aria-label`. A test finds an open window with `getByRole('dialog', { name: 'Its title' })`, and a modal popup over it with `[role="dialog"][aria-modal="true"]`. |
|
|
1570
1571
|
| `splitTitle(title)` | Splits a window or page title for the Sidebar layout's tab: `{ text, copy, accessories, badges, actions }` — the title's words for the tab (a badge's own text is not among them), the `CopyButton`'s text (a routed page tab's copy icon; window tabs draw none), and every badge and control (any component, `button`, `a`, `select`, …) in title order, split into `badges` (`StatusBadge`, `ColoredBadge`, or a component with `titleRole = 'badge'`) for the record bar and `actions` (everything else) for the active window tab. Inline SVG is dropped. A badge drawn as a styled `<span>` counts as words, so draw badges with `StatusBadge` / `ColoredBadge`. |
|
|
@@ -1608,7 +1609,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
|
|
|
1608
1609
|
| `Card`, `StatCard` | Surface panel (optional header/footer; `description` puts one sentence under the title, outside the heading; `headingLevel` makes the title a heading and the card a region named by it, and an `aria-label` names the region instead when the title is not the name, such as a count; `tone="warning"` draws the border amber for a card that needs attention, and the card's words still say why; `tone="current"` marks the current card in a list with a light-blue header band, a blue title and `aria-current`) + dashboard metric tile. |
|
|
1609
1610
|
| `Avatar`, `AvatarGroup` | User avatar with initials fallback + status dot; overlapping stack with +N overflow. |
|
|
1610
1611
|
| `Banner` | Static in-flow alert (`tone`: info / success / warning / danger / neutral). `neutral` is a note that is none of the other four ("Prices exclude GST"): grey in the kit's neutral, the same wash and ink as a neutral `StatusBadge` (`--status-neutral-soft` / `--status-neutral-soft-ink`, `--status-neutral-solid` when `emphasis="solid"`), with the info glyph. `action` renders a control at the right edge — after the text, so a screen reader reaches the problem before the remedy, and before the dismiss ×, so "Update card" is never past "close this". Vertically centred against the words and `shrink-0`, so a message that wraps does not drag the button down or squeeze it — and on a narrow banner (a phone, a narrow column: the words keep at least 12rem) it drops UNDER the words rather than leave them a column one word wide. A banner that names a condition and leaves the fix three menus away is the usual shape of a notice nobody acts on. |
|
|
1611
|
-
| `Tabs`, `Accordion`, `Tooltip` | Controlled tab strip, collapsible sections, solid hover/focus tooltip. `Tabs variant="pill"` draws the same strip as `Segmented` (the active tab solid blue on the grey track); use it when each choice shows its own panel, and `Segmented` when the choice is a value. `block` gives every tab an equal share of the strip's width, in either look (the same word as `Segmented`'s `block`): the editors' settings panel uses it for its two icon-only tabs, Design (`adjust`) and Animation (`animation`), with the `underline` look, so the chosen tab is a blue icon over a blue underline. `labelsFit` shows an icon tab's word beside its icon only while the words fit the strip's parent, measured in the three steps `IconRail`'s `labelsFit` takes (every word, then only the chosen tab's, then icons only); a hidden word still names the tab, and the tab's Tooltip says it. Items with an `href` make the strip in-page links for one scrolling page: the same underline drawn as a `<nav>` of `<a>`, `aria-current="location"` on the section in view, the current item following the scroll through `onChange`, and a click scrolling its `#section` into view and focusing it. A tab's `tone="warning"` inks it amber while it is not the chosen one, in either mode's underline look. Each `Accordion` title is a heading holding its button, `<h3><button aria-expanded aria-controls>`, the WAI-ARIA accordion pattern; `level` (2–6, default 3) sets the heading under the host's own, and the heading draws nothing of its own. An open item's panel is a region named by its button. `AccordionHeading` is a title in a tier's look that folds nothing (a heading, no button), and `AccordionBody` is the band body's side inset with no band above it, for a flat list of compact setting rows. A tooltip's `side` is a preference: near an edge the bubble slides along that side to stay 8 px clear of it, and flips to the opposite side when its own has no room, keeping inside the screen and inside the shell window that owns its trigger (UI-11). It never leaves that box: a bubble wider than the room wraps, and one taller than the room is cut off at it. The bubble is drawn on `<body>`, in a `fixed` layer laid over its trigger, so a scrolling pane or an `overflow-hidden` box around the trigger cannot cut it off; it follows the trigger when that moves and closes once the trigger has scrolled out of sight. A small arrow on the edge facing the trigger points at the trigger's centre wherever the bubble ended up, kept clear of the bubble's corners; it is the bubble's own surface (`.rosh-tooltip-arrow` in `ui.css`), seamless, and hidden from assistive technology. The bubble is SOLID, not glass, in every setting: the kit's solid popup surface (`--rosh-glass-surface`, `--rosh-glass-solid-border`, `--rosh-glass-solid-shadow`), so words behind a small bubble never mix with its own. |
|
|
1612
|
+
| `Tabs`, `Accordion`, `Tooltip` | Controlled tab strip, collapsible sections, solid hover/focus tooltip. `Tabs variant="pill"` draws the same strip as `Segmented` (the active tab solid blue on the grey track); use it when each choice shows its own panel, and `Segmented` when the choice is a value. `block` gives every tab an equal share of the strip's width, in either look (the same word as `Segmented`'s `block`): the editors' settings panel uses it for its two icon-only tabs, Design (`adjust`) and Animation (`animation`), with the `underline` look, so the chosen tab is a blue icon over a blue underline. `labelsFit` shows an icon tab's word beside its icon only while the words fit the strip's parent, measured in the three steps `IconRail`'s `labelsFit` takes (every word, then only the chosen tab's, then icons only); a hidden word still names the tab, and the tab's Tooltip says it. Items with an `href` make the strip in-page links for one scrolling page: the same underline drawn as a `<nav>` of `<a>`, `aria-current="location"` on the section in view, the current item following the scroll through `onChange`, and a click scrolling its `#section` into view and focusing it. A tab's `tone="warning"` inks it amber while it is not the chosen one, in either mode's underline look. Each `Accordion` title is a heading holding its button, `<h3><button aria-expanded aria-controls>`, the WAI-ARIA accordion pattern; `level` (2–6, default 3) sets the heading under the host's own, and the heading draws nothing of its own. An open item's panel is a region named by its button. `AccordionHeading` is a title in a tier's look that folds nothing (a heading, no button), and `AccordionBody` is the band body's side inset with no band above it, for a flat list of compact setting rows. A tooltip's `side` is a preference: near an edge the bubble slides along that side to stay 8 px clear of it, and flips to the opposite side when its own has no room, keeping inside the screen and inside the shell window that owns its trigger (UI-11). It never leaves that box: a bubble wider than the room wraps, and one taller than the room is cut off at it. The bubble is drawn on `<body>`, in a `fixed` layer laid over its trigger, so a scrolling pane or an `overflow-hidden` box around the trigger cannot cut it off; it follows the trigger when that moves and closes once the trigger has scrolled out of sight. A small arrow on the edge facing the trigger points at the trigger's centre wherever the bubble ended up, kept clear of the bubble's corners; it is the bubble's own surface (`.rosh-tooltip-arrow` in `ui.css`), seamless, and hidden from assistive technology. The bubble is SOLID, not glass, in every setting: the kit's solid popup surface (`--rosh-glass-surface`, `--rosh-glass-solid-border`, `--rosh-glass-solid-shadow`), so words behind a small bubble never mix with its own. `open` holds a tooltip open (or shut) whatever the pointer does: for a drag over a place that refuses the drop, when the browser sends no hover. |
|
|
1612
1613
|
| `StepChain`, `StepChainItem` | A chain of steps for work in progress — a one-line summary that opens to steps, each with a status glyph (`pending`, `active`, `complete`, `failed`, `stopped`, `waiting`, `skipped`), a label, a one-line `description` and folded detail. Open while `busy`, folded to its summary when the work is done, and a click always wins; `aria-expanded` on the toggle, the summary is a polite live region, the spinner and chevron respect reduced motion. Modelled on the "Chain of Thought" shape of Vercel AI Elements (no code copied). The assistant chat's tool calls and a plan checklist draw with it. |
|
|
1613
1614
|
| `Stepper` | A linear wizard's progress strip — numbered circles, connectors, `aria-current="step"`. Controlled like Tabs; completed steps are clickable to go back (when `onChange` is wired), upcoming steps never are — moving forward belongs to the wizard's own Continue button, behind its validation. |
|
|
1614
1615
|
| `DataTable` | Read-only table for server-driven lists: it renders and reports, and never sorts or pages its own `data`. Controlled sort and pager, row selection, column groups, pinned columns, windowed rendering. `onRow` gives a row `onClick`, a `className`, any `data-*` attributes for its `<tr>` — a test's or a stylesheet's hook (`data-testid`, `data-state`) — the pointer and the keyboard coming in and out (`onMouseEnter` … `onBlur`) and `current`. `rowHref` makes each row one real link (`onRowPress` a button) with its controls still pressable — see [DataTable rows that are links](#datatable-rows-that-are-links). `stackOnNarrow` turns each row into a labelled card on a narrow container — see [DataTable on a narrow screen](#datatable-on-a-narrow-screen). |
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-
|
|
1
|
+
import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-ACZZXO5S.js";import{WindowTitle as r}from"./chunk-ZDK2JYH5.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-55WFJELE.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-NRDO5IHL.js";import{confirm as n}from"./chunk-5Z2WLSFM.js";import"./chunk-BIS5PHHV.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-PJCVNFWM.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5QFPTDQF.js";import"./chunk-MFEJ6TYE.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-D323R2FT.js";import"./chunk-6KO5VTL7.js";import"./chunk-X4EBWJWO.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import{Icon as a}from"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import"./chunk-VH6GB73Q.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-ETSKG62F.js";import"./chunk-C3QOHMR6.js";import{useRef as s,useEffect as i,useState as l}from"react";import{jsxs as c,jsx as m,Fragment as u}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",h="react-os-shell:browser-homepage",p="https://en.wikipedia.org/wiki/Main_Page",g=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],b=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 k(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&&b.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var f=["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 g;try{const e=localStorage.getItem(d);if(!e)return g;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return g}function w(){return"undefined"==typeof window?p:localStorage.getItem(h)||p}function y(){const u=s(void 0);void 0===u.current&&(u.current=e()),i(()=>{null!=u.current&&t(u.current)},[]);const p=u.current?k(u.current.url):"",[g,b]=l(w),[f,y]=l(p||g),[j,C]=l(f),[W,R]=l([f]),[z,L]=l(0),[S,E]=l(0),[D,T]=l(x),[J,K]=l(!1),[H,M]=l(null),U=s(null),O=s(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(D))}catch{}},[D]);const F=e=>{const t=k(e);t&&(y(t),C(t),R(e=>{const o=e.slice(0,z+1);return o.push(t),o}),L(e=>e+1),K(!1))},G=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},I=()=>{const e=H?.trim();e?(T(t=>[...t,{label:e,url:f}]),M(null)):M(null)};i(()=>{if(null===H)return;U.current?.focus(),U.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||M(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==H]);const B=e=>{T(t=>t.filter((t,o)=>o!==e))},P=z>0,Q=z<W.length-1,V=D.some(e=>e.url===f),A="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"relative flex flex-col h-full bg-white",children:[
|
|
3
3
|
/* @__PURE__ */m(r,{title:`Browser - ${v(f)}`}),
|
|
4
4
|
/* @__PURE__ */m(o,{app:"browser"}),
|
|
5
5
|
/* @__PURE__ */c("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
6
|
-
/* @__PURE__ */m("button",{onClick:()=>{if(
|
|
7
|
-
/* @__PURE__ */m("button",{onClick:()=>{if(
|
|
8
|
-
/* @__PURE__ */m("button",{onClick:()=>E(e=>e+1),className:
|
|
9
|
-
/* @__PURE__ */m("button",{onClick:()=>
|
|
10
|
-
/* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),
|
|
6
|
+
/* @__PURE__ */m("button",{onClick:()=>{if(z>0){const e=z-1;L(e),y(W[e]),C(W[e]),K(!1)}},disabled:!P,className:A,title:"Back",children:/* @__PURE__ */m(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
|
|
7
|
+
/* @__PURE__ */m("button",{onClick:()=>{if(z<W.length-1){const e=z+1;L(e),y(W[e]),C(W[e]),K(!1)}},disabled:!Q,className:A,title:"Forward",children:/* @__PURE__ */m(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
|
|
8
|
+
/* @__PURE__ */m("button",{onClick:()=>E(e=>e+1),className:A,title:"Refresh",children:/* @__PURE__ */m(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
9
|
+
/* @__PURE__ */m("button",{onClick:()=>F(g),className:A,title:"Home",children:/* @__PURE__ */m(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
10
|
+
/* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),F(j)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */c("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__ */m("span",{className:"px-2 text-gray-400 text-xs",children:f.startsWith("https://")?"🔒":"⚠️"}),
|
|
12
12
|
/* @__PURE__ */m("input",{type:"text",value:j,onChange:e=>C(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…"}),f!==j&&/* @__PURE__ */m("button",{type:"button",onClick:()=>C(f),className:"px-2 text-2xs text-gray-400 hover:text-gray-700",title:"Reset to current URL",children:"×"})]})}),
|
|
13
|
-
/* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>
|
|
14
|
-
/* @__PURE__ */m("button",{onClick:
|
|
15
|
-
/* @__PURE__ */m("button",{onClick:()=>
|
|
13
|
+
/* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>V?B(D.findIndex(e=>e.url===f)):void M(v(f)),className:A+" "+(V?"text-yellow-500":""),title:V?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(a,{name:"star",className:"h-4 w-4",fill:V?"currentColor":"none",strokeWidth:1.5})}),
|
|
14
|
+
/* @__PURE__ */m("button",{onClick:G,className:A,title:"Open in new tab",children:/* @__PURE__ */m(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
|
|
15
|
+
/* @__PURE__ */m("button",{onClick:()=>K(e=>!e),className:A,title:"Embedding help",children:/* @__PURE__ */m(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==H&&/* @__PURE__ */c("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:[
|
|
16
16
|
/* @__PURE__ */m("div",{className:"text-2xs font-semibold uppercase tracking-wide text-gray-500 mb-1",children:"Bookmark this page"}),
|
|
17
17
|
/* @__PURE__ */m("div",{className:"text-2xs text-gray-400 truncate mb-2 font-mono",title:f,children:f}),
|
|
18
|
-
/* @__PURE__ */m("input",{ref:
|
|
18
|
+
/* @__PURE__ */m("input",{ref:U,type:"text",value:H,onChange:e=>M(e.target.value),onKeyDown:e=>{"Enter"===e.key?I():"Escape"===e.key&&M(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-gray-300 rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
|
|
19
19
|
/* @__PURE__ */c("div",{className:"flex justify-end gap-1 mt-2",children:[
|
|
20
|
-
/* @__PURE__ */m("button",{onClick:()=>
|
|
21
|
-
/* @__PURE__ */m("button",{onClick:
|
|
22
|
-
/* @__PURE__ */c("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===
|
|
20
|
+
/* @__PURE__ */m("button",{onClick:()=>M(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
|
|
21
|
+
/* @__PURE__ */m("button",{onClick:I,disabled:!H.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
|
|
22
|
+
/* @__PURE__ */c("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===D.length&&/* @__PURE__ */m("span",{className:"text-2xs text-gray-400 italic px-2",children:"No bookmarks yet — star the address bar to add one."}),D.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>F(e.url),onContextMenu:async o=>{o.preventDefault();await n({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&B(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-gray-700 hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
|
|
23
23
|
/* @__PURE__ */m("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)),
|
|
24
24
|
/* @__PURE__ */m("div",{className:"flex-1"}),
|
|
25
25
|
/* @__PURE__ */m("button",{onClick:()=>{b(f);try{localStorage.setItem(h,f)}catch{}},className:"px-2 py-0.5 text-2xs text-gray-500 hover:text-gray-800",title:"Set current page as homepage",children:"Set as home"})]}),
|
|
26
|
-
/* @__PURE__ */m("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */m(N,{url:f,iframeKey:
|
|
26
|
+
/* @__PURE__ */m("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */m(N,{url:f,iframeKey:S,iframeRef:O,openExternal:G,showHelp:J,dismissHelp:()=>K(!1)})})]})}function v(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function N({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[d,h]=l(!1);i(()=>{h(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return f.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!d?/* @__PURE__ */m("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */c("div",{className:"max-w-md text-center",children:[
|
|
27
27
|
/* @__PURE__ */m(a,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
|
|
28
28
|
/* @__PURE__ */c("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[v(e)," can't be embedded"]}),
|
|
29
29
|
/* @__PURE__ */c("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-MTSZ66O4.js";import{useWidgetSettings as n}from"./chunk-ZDK2JYH5.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-55WFJELE.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-NRDO5IHL.js";import"./chunk-5Z2WLSFM.js";import"./chunk-BIS5PHHV.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-PJCVNFWM.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5QFPTDQF.js";import"./chunk-MFEJ6TYE.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-D323R2FT.js";import"./chunk-6KO5VTL7.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import{Icon as r}from"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import"./chunk-VH6GB73Q.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-ETSKG62F.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as l,useEffect as o}from"react";import{jsxs as s,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),[N,j]=c(!1),[y,x]=c(""),[f,v]=c([]),[C,$]=c(!1),[T,E]=c(()=>e(h)),[W,S]=c(!1),[J,w]=c(T),D=i(null);n(l(()=>{w({...T}),S(!0)},[T]));const F=l(e=>{x(""),k(t=>N||"0"===t?(j(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[N]),L=l(()=>{k("0"),d(null),g(null),j(!1)},[]),R=l((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}},[]),K=l(e=>{const t=parseFloat(m);if(null!==p&&b&&!N){const e=R(p,t,b);k(String(e)),d(e),v(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),j(!0)},[m,p,b,N,R]),M=l(()=>{if(null===p||!b)return;const e=parseFloat(m),t=R(p,e,b),n=`${p} ${b} ${e} =`;v(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),j(!0)},[m,p,b,R]),B=l(()=>{k(e=>String(parseFloat(e)/100))},[]),G=l(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);o(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?F(e.key):"."===e.key?F("."):"+"===e.key?K("+"):"-"===e.key?K("-"):"*"===e.key?K("×"):"/"===e.key?(e.preventDefault(),K("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&D.current?.contains(e.target)&&e.preventDefault(),M()):"Escape"===e.key?L():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&B())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[F,K,M,L,B]);const Q="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",U=`${Q} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,V=`${Q} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,A=`${Q} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,O=`${Q} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
|
|
2
|
+
return s(a,{children:[
|
|
3
|
+
/* @__PURE__ */s("div",{ref:D,className:"flex flex-col h-full",style:{opacity:T.activeOpacity/100,backdropFilter:T.activeBlur>0?`blur(${T.activeBlur}px)`:void 0},children:[
|
|
4
|
+
/* @__PURE__ */s("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} ${N?"":m}`}),
|
|
6
|
+
/* @__PURE__ */s("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,C?{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__ */s("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
|
|
10
|
+
/* @__PURE__ */u("button",{onClick:L,className:A,children:"AC"}),
|
|
11
|
+
/* @__PURE__ */u("button",{onClick:G,className:A,children:"+/−"}),
|
|
12
|
+
/* @__PURE__ */u("button",{onClick:B,className:A,children:"%"}),
|
|
13
|
+
/* @__PURE__ */u("button",{onClick:()=>K("÷"),className:`${V} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
|
|
14
|
+
/* @__PURE__ */u("button",{onClick:()=>F("7"),className:U,children:"7"}),
|
|
15
|
+
/* @__PURE__ */u("button",{onClick:()=>F("8"),className:U,children:"8"}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>F("9"),className:U,children:"9"}),
|
|
17
|
+
/* @__PURE__ */u("button",{onClick:()=>K("×"),className:`${V} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
|
|
18
|
+
/* @__PURE__ */u("button",{onClick:()=>F("4"),className:U,children:"4"}),
|
|
19
|
+
/* @__PURE__ */u("button",{onClick:()=>F("5"),className:U,children:"5"}),
|
|
20
|
+
/* @__PURE__ */u("button",{onClick:()=>F("6"),className:U,children:"6"}),
|
|
21
|
+
/* @__PURE__ */u("button",{onClick:()=>K("-"),className:`${V} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:()=>F("1"),className:U,children:"1"}),
|
|
23
|
+
/* @__PURE__ */u("button",{onClick:()=>F("2"),className:U,children:"2"}),
|
|
24
|
+
/* @__PURE__ */u("button",{onClick:()=>F("3"),className:U,children:"3"}),
|
|
25
|
+
/* @__PURE__ */u("button",{onClick:()=>K("+"),className:`${V} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
|
|
26
|
+
/* @__PURE__ */u("button",{onClick:()=>F("0"),className:`${U} col-span-2`,children:"0"}),
|
|
27
|
+
/* @__PURE__ */u("button",{onClick:()=>F("."),className:U,children:"."}),
|
|
28
|
+
/* @__PURE__ */u("button",{onClick:M,className:O,children:"="})]})]}),
|
|
29
|
+
/* @__PURE__ */u(t,{open:W,onClose:()=>S(!1),title:"Calculator Settings",appearance:J,onAppearanceChange:w,onSave:()=>{E(J),localStorage.setItem(h,JSON.stringify(J)),S(!1)}})]})}export{m as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-
|
|
1
|
+
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-MTSZ66O4.js";import{useWidgetSettings as r}from"./chunk-ZDK2JYH5.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-55WFJELE.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-NRDO5IHL.js";import"./chunk-5Z2WLSFM.js";import"./chunk-BIS5PHHV.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-PJCVNFWM.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5QFPTDQF.js";import"./chunk-MFEJ6TYE.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-D323R2FT.js";import"./chunk-6KO5VTL7.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import"./chunk-VH6GB73Q.js";import{LoadingSpinner as n}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-ETSKG62F.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as a,useEffect as o}from"react";import{jsxs as c,Fragment as i,jsx as l}from"react/jsx-runtime";var m=["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 g(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function k(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 N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var f={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function j(){const[u,d]=s(N),[j,y]=s(()=>t(h)),[x,b]=s({}),[S,D]=s(!1),[v,C]=s(!1),[J,R]=s([]),[U,L]=s(j),[B,K]=s("USD"),[W,M]=s("CNY");r(a(()=>{R([...u]),L({...j}),C(!0)},[u,j])),o(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){D(!0);const r={};for(const e of t){const t=g(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,k(e,n.rates))}catch{}}e&&(b(r),D(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
|
|
2
2
|
return c(i,{children:[
|
|
3
|
-
/* @__PURE__ */l("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${j.activeOpacity/100})`,backdropFilter:j.activeBlur>0?`blur(${j.activeBlur}px)`:void 0},children:/* @__PURE__ */c("div",{className:"px-4 py-3 space-y-1",children:[
|
|
3
|
+
/* @__PURE__ */l("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${j.activeOpacity/100})`,backdropFilter:j.activeBlur>0?`blur(${j.activeBlur}px)`:void 0},children:/* @__PURE__ */c("div",{className:"px-4 py-3 space-y-1",children:[S&&/* @__PURE__ */l(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=x[t]?.[e];/* @__PURE__ */
|
|
4
4
|
return c("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__ */c("div",{className:"flex items-center gap-2",children:[
|
|
6
6
|
/* @__PURE__ */l("span",{className:"text-base",children:f[t]||""}),
|
|
@@ -9,13 +9,13 @@ return c("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),l
|
|
|
9
9
|
/* @__PURE__ */l("span",{className:"text-base",children:f[e]||""}),
|
|
10
10
|
/* @__PURE__ */l("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
|
|
11
11
|
/* @__PURE__ */l("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__ */l(e,{open:
|
|
12
|
+
/* @__PURE__ */l(e,{open:v,onClose:()=>C(!1),title:"Currency Settings",appearance:U,onAppearanceChange:L,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),y(U),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(U)),C(!1)},children:/* @__PURE__ */c("div",{children:[
|
|
13
13
|
/* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:["Currency Pairs ",
|
|
14
|
-
/* @__PURE__ */c("span",{className:"text-2xs font-normal text-gray-400",children:["(",
|
|
15
|
-
/* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:
|
|
14
|
+
/* @__PURE__ */c("span",{className:"text-2xs font-normal text-gray-400",children:["(",J.length,"/",4,")"]})]}),
|
|
15
|
+
/* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:J.map(([t,e],r)=>/* @__PURE__ */c("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
|
|
16
16
|
/* @__PURE__ */c("span",{className:"text-sm",children:[f[t]||""," ",t," → ",f[e]||""," ",e]}),
|
|
17
|
-
/* @__PURE__ */l("button",{onClick:()=>
|
|
18
|
-
/* @__PURE__ */l("select",{value:
|
|
17
|
+
/* @__PURE__ */l("button",{onClick:()=>R(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),J.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
|
|
18
|
+
/* @__PURE__ */l("select",{value:B,onChange:t=>K(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:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
|
|
19
19
|
/* @__PURE__ */l("span",{className:"text-gray-400",children:"→"}),
|
|
20
|
-
/* @__PURE__ */l("select",{value:
|
|
21
|
-
/* @__PURE__ */l("button",{onClick:()=>{
|
|
20
|
+
/* @__PURE__ */l("select",{value:W,onChange:t=>M(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:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
|
|
21
|
+
/* @__PURE__ */l("button",{onClick:()=>{B!==W&&J.length<4&&R(t=>[...t,[B,W]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-2xs text-gray-400 italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{j as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{escapeHtml as e}from"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-
|
|
1
|
+
import{escapeHtml as e}from"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-ACZZXO5S.js";import{WindowTitle as n}from"./chunk-ZDK2JYH5.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-55WFJELE.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-NRDO5IHL.js";import"./chunk-5Z2WLSFM.js";import"./chunk-BIS5PHHV.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{toast_default as r}from"./chunk-OSVN2UF7.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-PJCVNFWM.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5QFPTDQF.js";import"./chunk-MFEJ6TYE.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-D323R2FT.js";import"./chunk-6KO5VTL7.js";import"./chunk-X4EBWJWO.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import{Icon as s}from"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import"./chunk-VH6GB73Q.js";import{LoadingSpinner as c}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-ETSKG62F.js";import"./chunk-C3QOHMR6.js";import{useState as m,useRef as d}from"react";import{jsxs as h,jsx as u}from"react/jsx-runtime";var p=/* @__PURE__ */new Set(["txt","md","markdown","csv","tsv","log","json","xml","html","htm","css","js","jsx","ts","tsx","py","rb","go","rs","java","c","h","cpp","hpp","sh","bash","yml","yaml","toml","ini","conf","env","sql"]),g=/* @__PURE__ */new Set(["docx"]),x={filename:"Untitled",kind:"docx",content:"",ext:"docx"};function f(){const[f,y]=m(x),[k,v]=m(!1),[b,w]=m(!1),[j,N]=m(!1),[C,D]=m(null),L=d(null),M=d(null),R=d(null),U=(e,t)=>{R.current?.focus(),document.execCommand(e,!1,t),N(!0)},W=e=>{for(const t of e){if(!t.type.startsWith("image/"))continue;const e=new FileReader;e.onload=()=>{R.current?.focus(),document.execCommand("insertImage",!1,String(e.result)),N(!0)},e.readAsDataURL(t)}},T=e=>{C&&(C.el.removeAttribute("width"),C.el.removeAttribute("height"),C.el.style.width=e??"",C.el.style.height=e?"auto":"",N(!0),D(null))},B=async t=>{const n=(t.name.split(".").pop()||"").toLowerCase();v(!0);try{if(p.has(n)||!g.has(n)&&t.type.startsWith("text/")){const r=await t.text(),o=e(r).replace(/\n/g,"<br>");y({filename:t.name,kind:"text",content:o,ext:n}),N(!1)}else if(g.has(n))try{const e=await(import(
|
|
2
2
|
/* @vite-ignore */
|
|
3
|
-
"mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});y({filename:t.name,kind:"docx",content:o.value||"<p><em>(empty document)</em></p>",ext:n}),
|
|
3
|
+
"mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});y({filename:t.name,kind:"docx",content:o.value||"<p><em>(empty document)</em></p>",ext:n}),N(!1)}catch(e){r.error('Install the optional "mammoth" peer dep to read .docx files.')}else"doc"===n?r.error(".doc is the legacy Word binary format — convert to .docx first."):r.error(`Unsupported file type: .${n||"unknown"}`)}finally{v(!1)}},O=f?.filename?(S=f.filename).length>24?`${S.slice(0,23)}…`:S:"Untitled";var S;/* @__PURE__ */
|
|
4
4
|
return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),b||w(!0)},onDragLeave:e=>{e.currentTarget===e.target&&w(!1)},onDrop:e=>{e.preventDefault(),w(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?W(t):B(t[0]))},children:[
|
|
5
|
-
/* @__PURE__ */u(n,{title:`${
|
|
5
|
+
/* @__PURE__ */u(n,{title:`${O}${j?" •":""} - Documents`}),
|
|
6
6
|
/* @__PURE__ */u(t,{app:"documents"}),
|
|
7
7
|
/* @__PURE__ */h("div",{className:"flex items-center flex-wrap gap-x-2 gap-y-1 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
8
8
|
/* @__PURE__ */u("input",{ref:L,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&B(t),L.current&&(L.current.value="")},className:"hidden"}),
|
|
@@ -41,7 +41,7 @@ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
|
|
|
41
41
|
/* @__PURE__ */u("input",{ref:M,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&W(Array.from(e.target.files)),M.current&&(M.current.value="")}}),
|
|
42
42
|
/* @__PURE__ */h("button",{onClick:()=>M.current?.click(),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors flex items-center gap-1",title:"Insert image (or paste / drop one)",children:[
|
|
43
43
|
/* @__PURE__ */u(s,{name:"image",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Image"]})]}),
|
|
44
|
-
/* @__PURE__ */u("div",{className:"flex-1 min-h-0 overflow-hidden",children:k?/* @__PURE__ */u(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */u("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */u("div",{ref:R,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,onInput:()=>
|
|
44
|
+
/* @__PURE__ */u("div",{className:"flex-1 min-h-0 overflow-hidden",children:k?/* @__PURE__ */u(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */u("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */u("div",{ref:R,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,onInput:()=>N(!0),onPaste:e=>{const t=Array.from(e.clipboardData?.items??[]).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>!!e);t.length&&(e.preventDefault(),W(t))},onClick:e=>{const t=e.target;"IMG"===t.tagName&&(e.preventDefault(),D({x:e.clientX,y:e.clientY,el:t}))},dangerouslySetInnerHTML:{__html:f.content},className:"docx"===f.kind?"docs-editor mx-auto w-[8.5in] min-h-[11in] bg-white p-[1in] shadow text-sm leading-relaxed text-gray-800 outline-none focus:ring-2 focus:ring-blue-400/40":"docs-editor block w-full min-h-full p-4 font-mono text-sm leading-relaxed text-gray-800 bg-white outline-none whitespace-pre-wrap"})})}),b&&/* @__PURE__ */u("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__ */u("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop a document to open · images insert into the page"})}),C&&/* @__PURE__ */h(o,{minWidth:150,style:{left:C.x,top:C.y},onClose:()=>D(null),children:[
|
|
45
45
|
/* @__PURE__ */u(i,{children:"Image width"}),
|
|
46
46
|
/* @__PURE__ */u(l,{onClick:()=>T("25%"),children:"25%"}),
|
|
47
47
|
/* @__PURE__ */u(l,{onClick:()=>T("50%"),children:"50%"}),
|
|
@@ -49,4 +49,4 @@ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
|
|
|
49
49
|
/* @__PURE__ */u(l,{onClick:()=>T("100%"),children:"100%"}),
|
|
50
50
|
/* @__PURE__ */u(l,{onClick:()=>T(null),children:"Original size"}),
|
|
51
51
|
/* @__PURE__ */u(a,{}),
|
|
52
|
-
/* @__PURE__ */u(l,{danger:!0,onClick:()=>{
|
|
52
|
+
/* @__PURE__ */u(l,{danger:!0,onClick:()=>{C?.el.remove(),N(!0),D(null)},children:"Remove image"})]})]})}export{f as default};
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import{openPreviewFile as e}from"./chunk-
|
|
1
|
+
import{openPreviewFile as e}from"./chunk-MHYOQMBV.js";import{SidebarLayout as t}from"./chunk-OTU633XJ.js";import"./chunk-QWK6DRSN.js";import"./chunk-THDSOVEH.js";import{Breadcrumbs as r}from"./chunk-RZBHO74V.js";import{formatBytes as a}from"./chunk-X2S2XDZI.js";import"./chunk-5OTS2G3M.js";import"./chunk-36BRD5J3.js";import{getFilesDemoTree as n}from"./chunk-IAQC775L.js";import{AboutApp as s}from"./chunk-ACZZXO5S.js";import{peekFilesViewRequest as i,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-RAAUW5OZ.js";import"./chunk-ESL5TDNA.js";import"./chunk-VTVSMRFX.js";import{useWindowManager as f,WindowTitle as x}from"./chunk-ZDK2JYH5.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-55WFJELE.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-NRDO5IHL.js";import{confirm as g,prompt as y}from"./chunk-5Z2WLSFM.js";import"./chunk-BIS5PHHV.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{toast_default as b}from"./chunk-OSVN2UF7.js";import"./chunk-PJCVNFWM.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5QFPTDQF.js";import"./chunk-MFEJ6TYE.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-D323R2FT.js";import{TH_ONE_LINE as k}from"./chunk-6KO5VTL7.js";import"./chunk-X4EBWJWO.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import{Icon as N}from"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import"./chunk-VH6GB73Q.js";import{LoadingSpinner as w}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-ETSKG62F.js";import"./chunk-C3QOHMR6.js";import{useState as v,useEffect as j,useSyncExternalStore as $,useRef as C,useCallback as D}from"react";import{jsxs as L,jsx as T,Fragment as E}from"react/jsx-runtime";var R="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",W={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 S(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function O(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 F(){const F=R.replace(/\/$/,""),M=null!==n(),[I,P]=v("/"),[U,A]=v([]),[V,J]=v([]),[B,K]=v(null),[H,Q]=v(!0),[z,G]=v(!1),[X,Z]=v(null),[_,Y]=v(!1),[q,ee]=v(()=>{const e=i();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});j(()=>{o()},[]);const[te,re]=v([]);j(()=>{const e=()=>{o(),ee("trash")},t=e=>{o();const t=e.detail?.folderId;t&&ee({desktopFolderId:t})};return window.addEventListener(l,e),window.addEventListener(c,t),()=>{window.removeEventListener(l,e),window.removeEventListener(c,t)}},[]);const ae=$(d,m,m),ne="object"==typeof q?q.desktopFolderId:null,se=ne?ae?.folders.find(e=>e.id===ne)??null:null,ie=ne&&ae?.itemsByFolder[ne]||[];j(()=>{ne&&ae&&!ae.folders.some(e=>e.id===ne)&&ee("files")},[ne,ae]);const oe=C(0),le=C(null),{openPage:ce,openEntity:de}=f(),me=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>ce(e)}):"page"===t.entityType?ce(t.entityId):de(t.entityType,t.entityId,null,t.label)},he=D((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),pe=D(async()=>{try{const e=await he(`${F}/api/quota`);if(e.ok){const t=await e.json();Z({used:t.used,limit:t.limit})}}catch{}},[he,F]),ue=D(async e=>{if(K(null),M){const t=function(e){const t=n();if(!t)return[];let r=t;for(const t of e.split("/").filter(Boolean)){const e=r.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];r=e.children}return r.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return A(t),P(e),G(!1),Q(!1),void("/"===e&&J(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}Q(!0);try{const t=await he(`${F}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void b.error(e.error||`Failed to list (${t.status})`)}const r=await t.json(),a=r.entries||[];A(a),P(r.path||e),G(!1),"/"===(r.path||e)&&J(a.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){G(!0)}finally{Q(!1)}pe()},[he,F,pe,M]),fe=D(async()=>{if(M)return re([]),void Q(!1);Q(!0),K(null);try{const e=await he(`${F}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void b.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();re(t.entries||[]),G(!1)}catch{G(!0)}finally{Q(!1)}pe()},[he,F,pe,M]);j(()=>{"files"===q?ue(I):"trash"===q&&fe()},[I,q]);const xe=async e=>{const t=S(I,e.name);try{const r=await he(`${F}/api/file?path=${encodeURIComponent(t)}`);if(!r.ok)return void b.error(`Download failed (${r.status})`);const a=await r.blob(),n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download=e.name,s.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}catch(e){b.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 r=await he(`${F}/api/upload?path=${encodeURIComponent(I)}`,{method:"POST",body:t});if(!r.ok){const t=await r.json().catch(()=>({}));if(413===r.status){const r=Math.max(0,(t.limit||0)-(t.used||0));b.error(`Quota exceeded — ${a(r)} free, ${e.name} is ${a(t.attempted||e.size)}`)}else b.error(`Upload ${e.name}: ${t.error||r.status}`)}}catch(t){b.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}ue(I)},ye=()=>{oe.current=0,Y(!1)};if(j(()=>{const e=()=>ye();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),z)/* @__PURE__ */
|
|
2
2
|
return L("div",{className:"flex flex-col h-full bg-white",children:[
|
|
3
3
|
/* @__PURE__ */T(x,{title:"Files - offline"}),
|
|
4
4
|
/* @__PURE__ */T("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */L("div",{className:"max-w-md",children:[
|
|
5
5
|
/* @__PURE__ */T(N,{name:"close-circle",className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
|
|
6
6
|
/* @__PURE__ */T("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
|
|
7
7
|
/* @__PURE__ */L("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
|
|
8
|
-
/* @__PURE__ */T("span",{className:"font-mono",children:
|
|
8
|
+
/* @__PURE__ */T("span",{className:"font-mono",children:F}),". Make sure the server is running — see ",
|
|
9
9
|
/* @__PURE__ */T("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
|
|
10
|
-
/* @__PURE__ */T("button",{onClick:()=>ue(
|
|
10
|
+
/* @__PURE__ */T("button",{onClick:()=>ue(I),className:"px-3 h-8 text-sm bg-blue-500 text-white rounded hover:bg-blue-600",children:"Retry"})]})})]});const be="/"===I?[]:I.split("/").filter(Boolean),ke=X&&X.limit>0?Math.min(100,Math.round(X.used/X.limit*100)):0,Ne=ke>90?"bg-red-500":ke>75?"bg-amber-500":"bg-blue-500",we=[{label:"My files",onClick:()=>P("/")},...be.map((e,t)=>({label:e,onClick:()=>P("/"+be.slice(0,t+1).join("/"))}))],ve=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"),je=e=>/* @__PURE__ */T("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__ */T("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),$e=/* @__PURE__ */L("nav",{className:"p-2",children:[
|
|
11
11
|
/* @__PURE__ */T("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Locations"}),
|
|
12
|
-
/* @__PURE__ */L("button",{onClick:()=>{ee("files"),
|
|
13
|
-
/* @__PURE__ */T("span",{className:"truncate",children:e})]},e)),!
|
|
12
|
+
/* @__PURE__ */L("button",{onClick:()=>{ee("files"),P("/")},className:ve("files"===q&&"/"===I),children:[je("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"]}),V.map(e=>/* @__PURE__ */L("button",{onClick:()=>{ee("files"),P("/"+e)},className:ve("files"===q&&I==="/"+e),children:[je("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__ */T("span",{className:"truncate",children:e})]},e)),!M&&/* @__PURE__ */L("button",{onClick:()=>ee("trash"),className:ve("trash"===q),children:[je("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"]}),ae&&ae.folders.length>0&&/* @__PURE__ */L(E,{children:[
|
|
14
14
|
/* @__PURE__ */T("div",{className:"px-2 pt-3 pb-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Desktop"}),ae.folders.map(e=>/* @__PURE__ */L("button",{onClick:()=>ee({desktopFolderId:e.id}),className:ve(ne===e.id),children:[
|
|
15
15
|
/* @__PURE__ */T(h,{className:"h-4 w-4 shrink-0 text-amber-500"}),
|
|
16
16
|
/* @__PURE__ */T("span",{className:"truncate",children:e.name}),e.itemCount>0&&/* @__PURE__ */T("span",{className:"ml-auto text-2xs text-gray-400 tabular-nums",children:e.itemCount})]},e.id))]})]});/* @__PURE__ */
|
|
17
|
-
return L("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{
|
|
18
|
-
/* @__PURE__ */T(x,{title:se?`Files - ${se.name}`:"Files"+("/"===
|
|
17
|
+
return L("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{M||"object"==typeof q||e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),oe.current++,_||Y(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{oe.current>0&&oe.current--,0===oe.current&&Y(!1)},onDrop:e=>{e.preventDefault(),ye(),M||"object"==typeof q||e.dataTransfer.files?.length&&ge(e.dataTransfer.files)},children:[
|
|
18
|
+
/* @__PURE__ */T(x,{title:se?`Files - ${se.name}`:"Files"+("/"===I?"":" - "+I)}),
|
|
19
19
|
/* @__PURE__ */T(s,{app:"files"}),
|
|
20
20
|
/* @__PURE__ */T("input",{ref:le,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&ge(e.target.files),le.current&&(le.current.value="")}}),
|
|
21
21
|
/* @__PURE__ */T("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */T(t,{sidebar:$e,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */L("div",{className:"flex h-full min-w-0 flex-col",children:[
|
|
22
|
-
/* @__PURE__ */L("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-gray-200 bg-gray-50 shrink-0 text-xs",children:[/* @__PURE__ */L(
|
|
23
|
-
/* @__PURE__ */T("button",{onClick:()=>
|
|
22
|
+
/* @__PURE__ */L("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-gray-200 bg-gray-50 shrink-0 text-xs",children:[/* @__PURE__ */L(E,"files"===q?{children:[
|
|
23
|
+
/* @__PURE__ */T("button",{onClick:()=>P(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),r=t.lastIndexOf("/");return r<=0?"/":t.slice(0,r)}(I)),disabled:"/"===I,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",title:"Parent folder",children:/* @__PURE__ */T(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
24
24
|
/* @__PURE__ */T("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */T(r,{items:we,maxItems:5})}),
|
|
25
|
-
/* @__PURE__ */T("button",{onClick:()=>ue(
|
|
25
|
+
/* @__PURE__ */T("button",{onClick:()=>ue(I),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */T(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),!M&&/* @__PURE__ */L(E,{children:[
|
|
26
26
|
/* @__PURE__ */L("button",{onClick:()=>ee("trash"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",title:"Open trash",children:[
|
|
27
27
|
/* @__PURE__ */T(N,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
|
|
28
|
-
/* @__PURE__ */L("button",{onClick:async()=>{const e=await y({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void b.error("Folder names cannot contain slashes");const t=
|
|
28
|
+
/* @__PURE__ */L("button",{onClick:async()=>{const e=await y({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void b.error("Folder names cannot contain slashes");const t=S(I,e),r=await he(`${F}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!r.ok){const e=await r.json().catch(()=>({}));return void b.error(e.error||`Create folder failed (${r.status})`)}ue(I)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
|
|
29
29
|
/* @__PURE__ */T(N,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
|
|
30
30
|
/* @__PURE__ */L("button",{onClick:()=>le.current?.click(),className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 flex items-center gap-1",children:[
|
|
31
31
|
/* @__PURE__ */T(N,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===q?{children:[
|
|
32
32
|
/* @__PURE__ */T("button",{onClick:()=>ee("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */T(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
33
33
|
/* @__PURE__ */T("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
|
|
34
34
|
/* @__PURE__ */T("button",{onClick:fe,className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */T(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),
|
|
35
|
-
/* @__PURE__ */T("button",{onClick:async()=>{if(0===te.length)return;if(!await g({title:"Empty trash",message:`${te.length} item${1===te.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await he(`${
|
|
35
|
+
/* @__PURE__ */T("button",{onClick:async()=>{if(0===te.length)return;if(!await g({title:"Empty trash",message:`${te.length} item${1===te.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await he(`${F}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void b.error(t.error||`Empty trash failed (${e.status})`)}fe()},disabled:0===te.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:[
|
|
36
36
|
/* @__PURE__ */T("button",{onClick:()=>ee("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */T(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
37
37
|
/* @__PURE__ */T(h,{className:"h-4 w-4 text-amber-500 ml-1"}),
|
|
38
38
|
/* @__PURE__ */T("span",{className:"flex-1 text-gray-700 font-medium px-1 truncate",children:se?.name??"Desktop folder"}),
|
|
39
|
-
/* @__PURE__ */T("span",{className:"text-2xs text-gray-400 px-2",children:"Desktop shortcuts"})]}),
|
|
39
|
+
/* @__PURE__ */T("span",{className:"text-2xs text-gray-400 px-2",children:"Desktop shortcuts"})]}),X&&/* @__PURE__ */L(E,{children:[
|
|
40
40
|
/* @__PURE__ */T("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
41
|
-
/* @__PURE__ */L("div",{className:"flex items-center gap-2",title:`${a(
|
|
41
|
+
/* @__PURE__ */L("div",{className:"flex items-center gap-2",title:`${a(X.used)} of ${a(X.limit)} used`,children:[
|
|
42
42
|
/* @__PURE__ */T("div",{className:"w-20 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */T("div",{className:`h-full ${Ne} transition-all`,style:{width:`${ke}%`}})}),
|
|
43
|
-
/* @__PURE__ */L("span",{className:"text-2xs text-gray-500 tabular-nums whitespace-nowrap",children:[a(
|
|
43
|
+
/* @__PURE__ */L("span",{className:"text-2xs text-gray-500 tabular-nums whitespace-nowrap",children:[a(X.used)," / ",a(X.limit)]})]})]})]}),
|
|
44
44
|
/* @__PURE__ */T("div",{className:"flex-1 overflow-auto",children:"object"==typeof q?0===ie.length?/* @__PURE__ */T("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__ */L("table",{className:"w-full text-sm",children:[
|
|
45
45
|
/* @__PURE__ */T("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
|
|
46
46
|
/* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8`,children:"Name"}),
|
|
47
47
|
/* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
|
|
48
48
|
/* @__PURE__ */T("th",{className:`${k} w-56`})]})}),
|
|
49
49
|
/* @__PURE__ */T("tbody",{children:ie.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
|
|
50
|
-
return L("tr",{onClick:()=>
|
|
50
|
+
return L("tr",{onClick:()=>K(t),onDoubleClick:()=>me(e),className:"cursor-default border-b border-gray-100 "+(B===t?"bg-blue-50":"hover:bg-gray-50"),children:[
|
|
51
51
|
/* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:[
|
|
52
52
|
/* @__PURE__ */T(p,{item:e}),
|
|
53
53
|
/* @__PURE__ */T("span",{className:"truncate",title:e.label,children:e.label})]}),
|
|
@@ -55,7 +55,7 @@ return L("tr",{onClick:()=>Q(t),onDoubleClick:()=>me(e),className:"cursor-defaul
|
|
|
55
55
|
/* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
|
|
56
56
|
/* @__PURE__ */T("button",{onClick:t=>{t.stopPropagation(),me(e)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Open"}),
|
|
57
57
|
/* @__PURE__ */T("button",{onClick:t=>{t.stopPropagation(),ae?.moveToDesktop([e])},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Move to desktop"}),
|
|
58
|
-
/* @__PURE__ */T("button",{onClick:t=>{t.stopPropagation(),ae?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"trash"===q?
|
|
58
|
+
/* @__PURE__ */T("button",{onClick:t=>{t.stopPropagation(),ae?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"trash"===q?H&&0===te.length?/* @__PURE__ */T(w,{size:"sm",padding:"p-6",label:"Loading"}):0===te.length?/* @__PURE__ */T("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
|
|
59
59
|
/* @__PURE__ */T("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
|
|
60
60
|
/* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8`,children:"Name"}),
|
|
61
61
|
/* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8`,children:"Original location"}),
|
|
@@ -67,21 +67,21 @@ return L("tr",{onClick:()=>Q(t),onDoubleClick:()=>me(e),className:"cursor-defaul
|
|
|
67
67
|
/* @__PURE__ */T("span",{className:"truncate",title:e.name,children:e.name})]}),
|
|
68
68
|
/* @__PURE__ */T("td",{className:"px-3 h-8 text-gray-500 text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
|
|
69
69
|
/* @__PURE__ */T("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:a(e.size)}),
|
|
70
|
-
/* @__PURE__ */T("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:e.deletedAt?
|
|
70
|
+
/* @__PURE__ */T("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:e.deletedAt?O(e.deletedAt):"—"}),
|
|
71
71
|
/* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
|
|
72
|
-
/* @__PURE__ */T("button",{onClick:()=>(async e=>{const t=await he(`${
|
|
73
|
-
/* @__PURE__ */T("button",{onClick:()=>(async e=>{if(!await g({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"}))return;const t=await he(`${
|
|
72
|
+
/* @__PURE__ */T("button",{onClick:()=>(async e=>{const t=await he(`${F}/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 b.error(e.error||`Restore failed (${t.status})`)}b.success(`Restored "${e.name}"`),fe()})(e),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Restore"}),
|
|
73
|
+
/* @__PURE__ */T("button",{onClick:()=>(async e=>{if(!await g({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"}))return;const t=await he(`${F}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void b.error(e.error||`Delete failed (${t.status})`)}fe()})(e),className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):H&&0===U.length?/* @__PURE__ */T(w,{size:"sm",padding:"p-6",label:"Loading"}):0===U.length?/* @__PURE__ */L("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!M&&/* @__PURE__ */L(E,{children:[" Drop files here or click ",
|
|
74
74
|
/* @__PURE__ */T("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
|
|
75
75
|
/* @__PURE__ */T("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
|
|
76
76
|
/* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8`,children:"Name"}),
|
|
77
77
|
/* @__PURE__ */T("th",{className:`${k} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
|
|
78
78
|
/* @__PURE__ */T("th",{className:`${k} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),
|
|
79
79
|
/* @__PURE__ */T("th",{className:`${k} w-32`})]})}),
|
|
80
|
-
/* @__PURE__ */T("tbody",{children:
|
|
80
|
+
/* @__PURE__ */T("tbody",{children:U.map(t=>/* @__PURE__ */L("tr",{onClick:()=>K(t.name),onDoubleClick:()=>{"folder"===t.kind?P(S(I,t.name)):(async t=>{if(M)return;const r=S(I,t.name),a=(t.name.split(".").pop()||"").toLowerCase(),n=W[a];n?await e({filePath:r,filename:t.name,kind:n,onStaged:e=>ce(e)}):xe(t)})(t)},className:"cursor-default border-b border-gray-100 "+(B===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
|
|
81
81
|
/* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===t.kind?/* @__PURE__ */T(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */T(N,{name:"page",className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
|
|
82
82
|
/* @__PURE__ */T("span",{className:"truncate",title:t.name,children:t.name})]}),
|
|
83
83
|
/* @__PURE__ */T("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:"folder"===t.kind?"—":a(t.size)}),
|
|
84
|
-
/* @__PURE__ */T("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:
|
|
85
|
-
/* @__PURE__ */T("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!
|
|
86
|
-
/* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await y({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void b.error("Names cannot contain slashes");const r=
|
|
87
|
-
/* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),(async e=>{if(!await g({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will be permanently removed.`,confirmLabel:"Delete",variant:"danger"}))return;const t=
|
|
84
|
+
/* @__PURE__ */T("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:O(t.modifiedAt)}),
|
|
85
|
+
/* @__PURE__ */T("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!M&&/* @__PURE__ */L(E,{children:["file"===t.kind&&/* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),xe(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs",children:"Download"}),
|
|
86
|
+
/* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await y({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void b.error("Names cannot contain slashes");const r=S(I,e.name),a=S(I,t),n=await he(`${F}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:r,to:a})});if(!n.ok){const e=await n.json().catch(()=>({}));return void b.error(e.error||`Rename failed (${n.status})`)}ue(I)})(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Rename"}),
|
|
87
|
+
/* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),(async e=>{if(!await g({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will be permanently removed.`,confirmLabel:"Delete",variant:"danger"}))return;const t=S(I,e.name),r=await he(`${F}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!r.ok){const e=await r.json().catch(()=>({}));return void b.error(e.error||`Delete failed (${r.status})`)}ue(I)})(t)},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete"})]})})]},t.name))})]})})]})})}),_&&/* @__PURE__ */T("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__ */T("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{F as default};
|